阿里云 CentOS7.4,静默安装Oracle11g2的教程

论坛 期权论坛 脚本     
匿名技术用户   2020-12-29 00:03   279   0

转自:https://blog.csdn.net/sinat_32998977/article/details/79437014


最近在阿里云上买了一个服务器,CentOS7.4的操作系统,从买来到搭建java环境以及安装oracle 11g,也是折腾了好多天,今天才把oracle11g的安装过程整理出来。


1.建立swap分区(我自己的服务器内存只有1G)

  1. dd if=/dev/zero of=/home/swap bs=1024 count=2097152 #bs为单位,count为设置的大小2048*1024
  2. mkswap /home/swap #格式化交换文件
  3. swapon /home/swap #立即启用交换分区文件, 要停止使用新创建的swap文件,只要执行 swapoff/home/swap命令即可.

查看分区情况 free -m

vim /etc/fstab 添加一行
/home/swap swap swap defaults 0 0

否则重启后 swap分区会失效

2.创建用户和用户组

  1. groupadd oinstall             #创建用户组oinstall
  2. groupadd dba              #创建用户组dba
  3. useradd -g oinstall -G dba -m oracle  #创建oracle用户,并加入到oinstall和dba用户组
  4. groups oracle               #查询用户组是否授权成功
  5. passwd oracle              #设置用户oracle的登陆密码,不设置密码,在CentOS的图形登陆界面没法登陆
  6. id oracle        #查看新建的oracle用户

3.创建安装目录和权限

  1. mkdir -p /data/oracle  #oracle数据库安装目录
  2. mkdir -p /data/oraInventory  #oracle数据库配置文件目录
  3. mkdir -p /data/database  #oracle数据库软件包解压目录
  4. cd /data
  5. ll   #创建完毕检查一下
  6. chown -R oracle:oinstall /data/oracle  #设置目录所有者为oinstall用户组的oracle用户
  7. chown -R oracle:oinstall /data/oraInventory
  8. chown -R oracle:oinstall /data/database

4.修改OS系统标识

  1. vi /etc/redhat-release

修改成redhat-7

5.关闭防火墙和selinux(阿里云中已经关闭)

6.修改内核参数

  1. vi /etc/sysctl.conf 增加如下内容:
  2. net.ipv4.icmp_echo_ignore_broadcasts = 1
  3. net.ipv4.conf.all.rp_filter = 1
  4. #设置最大打开文件数
  5. fs.file-max = 6815744
  6. fs.aio-max-nr = 1048576
  7. #共享内存的总量,8G内存设置:2097152*4k/1024/1024
  8. kernel.shmall = 2097152
  9. #最大共享内存的段大小
  10. kernel.shmmax = 2147483648
  11. #整个系统共享内存端的最大数
  12. kernel.shmmni = 4096
  13. kernel.sem = 250 32000 100 128
  14. #可使用的IPv4端口范围
  15. net.ipv4.ip_local_port_range = 9000 65500
  16. net.core.rmem_default = 262144
  17. net.core.rmem_max= 4194304
  18. net.core.wmem_default= 262144
  19. net.core.wmem_max= 1048576
sysctl -p #文件生效

  1. vi /etc/security/limits.conf 增加如下内容:
  2. oracle soft nproc 2047
  3. oracle hard nproc 16384
  4. oracle soft nofile 1024
  5. oracle hard nofile 65536

7.配置oracle用户的环境变量

  1. vi /home/oracle/.bash_profile
  2. export ORACLE_BASE=/data/oracle
  3. export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
  4. #oracle启动数据库实例名
  5. export ORACLE_SID=orcl11g
  6. #添加系统环境变量
  7. export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
  8. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
  9. export TNS_ADMIN=$ORACLE_HOME/network/admin

8.安装需要的rpm包

  1. yum -y install gcc gcc-c++ make binutils compat-libstdc++-33 glibc glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel libXtst sysstat ksh make libXi compat-libcap1

rpm -qa | grep * 可以检测是否安装成功

9.解压两个安装文件到对应的文件夹下(自行修改对应的目录)

  1. unzip /opt/soft/linux.x64_11gR2_database_1of2.zip -d /data/database/
  2. unzip /opt/soft/linux.x64_11gR2_database_2of2.zip -d /data/database/

10.修改安装配置信息

  1. vim /data/database/database/db_install.rsp
  1. ####################################################################
  2. ## Copyright(c) Oracle Corporation 1998,2008. All rights reserved.##
  3. ## ##
  4. ## Specify values for the variables listed below to customize ##
  5. ## your installation. ##
  6. ## ##
  7. ## Each variable is associated with a comment. The comment ##
  8. ## can help to populate the variables with the appropriate ##
  9. ## values. ##
  10. ## ##
  11. ## IMPORTANT NOTE: This file contains plain text passwords and ##
  12. ## should be secured to have read permission only by oracle user ##
  13. ## or db administrator who owns this installation. ##
  14. ## ##
  15. ####################################################################
  16. #------------------------------------------------------------------------------
  17. # Do not change the following system generated value.
  18. #------------------------------------------------------------------------------
  19. oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
  20. #------------------------------------------------------------------------------
  21. # Specify the installation option.
  22. # It can be one of the following:
  23. # 1. INSTALL_DB_SWONLY
  24. # 2. INSTALL_DB_AND_CONFIG
  25. # 3. UPGRADE_DB
  26. #-------------------------------------------------------------------------------
  27. oracle.install.option=INSTALL_DB_SWONLY
  28. #-------------------------------------------------------------------------------
  29. # Specify the hostname of the system as set during the install. It can be used
  30. # to force the installation to use an alternative hostname rather than using the
  31. # first hostname found on the system. (e.g., for systems with multiple hostnames
  32. # and network interfaces)
  33. #-------------------------------------------------------------------------------
  34. ORACLE_HOSTNAME=liumingpp
  35. #-------------------------------------------------------------------------------
  36. # Specify the Unix group to be set for the inventory directory.
  37. #-------------------------------------------------------------------------------
  38. UNIX_GROUP_NAME=oinstall
  39. #-------------------------------------------------------------------------------
  40. # Specify the location which holds the inventory files.
  41. #-------------------------------------------------------------------------------
  42. INVENTORY_LOCATION=/data/oraInventory
  43. #-------------------------------------------------------------------------------
  44. # Specify the languages in which the components will be installed.
  45. #
  46. # en : English ja : Japanese
  47. # fr : French ko : Korean
  48. # ar : Arabic es : Latin American Spanish
  49. # bn : Bengali lv : Latvian
  50. # pt_BR: Brazilian Portuguese lt : Lithuanian
  51. # bg : Bulgarian ms : Malay
  52. # fr_CA: Canadian French es_MX: Mexican Spanish
  53. # ca : Catalan no : Norwegian
  54. # hr : Croatian pl : Polish
  55. # cs : Czech pt : Portuguese
  56. # da : Danish ro : Romanian
  57. # nl : Dutch ru : Russian
  58. # ar_EG: Egyptian zh_CN: Simplified Chinese
  59. # en_GB: English (Great Britain) sk : Slovak
  60. # et : Estonian sl : Slovenian
  61. # fi : Finnish es_ES: Spanish
  62. # de : German sv : Swedish
  63. # el : Greek th : Thai
  64. # iw : Hebrew zh_TW: Traditional Chinese
  65. # hu : Hungarian tr : Turkish
  66. # is : Icelandic uk : Ukrainian
  67. # in : Indonesian vi : Vietnamese
  68. # it : Italian
  69. #
  70. # Example : SELECTED_LANGUAGES=en,fr,ja
  71. #------------------------------------------------------------------------------
  72. SELECTED_LANGUAGES=zh_CN,en
  73. #------------------------------------------------------------------------------
  74. # Specify the complete path of the Oracle Home.
  75. #------------------------------------------------------------------------------
  76. ORACLE_HOME=/data/oracle/product/11.2.0/db_1
  77. #------------------------------------------------------------------------------
  78. # Specify the complete path of the Oracle Base.
  79. #------------------------------------------------------------------------------
  80. ORACLE_BASE=/data/oracle/
  81. #------------------------------------------------------------------------------
  82. # Specify the installation edition of the component.
  83. #
  84. # The value should contain only one of these choices.
  85. # EE : Enterprise Edition
  86. # SE : Standard Edition
  87. # SEONE : Standard Edition One
  88. # PE : Personal Edition (WINDOWS ONLY)
  89. #------------------------------------------------------------------------------
  90. oracle.install.db.InstallEdition=EE
  91. #------------------------------------------------------------------------------
  92. # This variable is used to enable or disable custom install.
  93. #
  94. # true : Components mentioned as part of 'customComponents' property
  95. # are considered for install.
  96. # false : Value for 'customComponents' is not considered.
  97. #------------------------------------------------------------------------------
  98. oracle.install.db.isCustomInstall=false
  99. #------------------------------------------------------------------------------
  100. # This variable is considered only if 'IsCustomInstall' is set to true.
  101. #
  102. # Description: List of Enterprise Edition Options you would like to install.
  103. #
  104. # The following choices are available. You may specify any
  105. # combination of these choices. The components you choose should
  106. # be specified in the form "internal-component-name:version"
  107. # Below is a list of components you may specify to install.
  108. #
  109. # oracle.rdbms.partitioning:11.2.0.1.0 - Oracle Partitioning
  110. # oracle.rdbms.dm:11.2.0.1.0 - Oracle Data Mining
  111. # oracle.rdbms.dv:11.2.0.1.0 - Oracle Database Vault
  112. # oracle.rdbms.lbac:11.2.0.1.0 - Oracle Label Security
  113. # oracle.rdbms.rat:11.2.0.1.0 - Oracle Real Application Testing
  114. # oracle.oraolap:11.2.0.1.0 - Oracle OLAP
  115. #------------------------------------------------------------------------------
  116. oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
  117. ###############################################################################
  118. # #
  119. # PRIVILEGED OPERATING SYSTEM GROUPS #
  120. # ------------------------------------------ #
  121. # Provide values for the OS groups to which OSDBA and OSOPER privileges #
  122. # needs to be granted. If the install is being performed as a member of the #
  123. # group "dba", then that will be used unless specified otherwise below. #
  124. # #
  125. ###############################################################################
  126. #------------------------------------------------------------------------------
  127. # The DBA_GROUP is the OS group which is to be granted OSDBA privileges.
  128. #------------------------------------------------------------------------------
  129. oracle.install.db.DBA_GROUP=dba
  130. #------------------------------------------------------------------------------
  131. # The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
  132. #------------------------------------------------------------------------------
  133. oracle.install.db.OPER_GROUP=oinstall
  134. #------------------------------------------------------------------------------
  135. # Specify the cluster node names selected during the installation.
  136. #------------------------------------------------------------------------------
  137. oracle.install.db.CLUSTER_NODES=
  138. #------------------------------------------------------------------------------
  139. # Specify the type of database to create.
  140. # It can be one of the following:
  141. # - GENERAL_PURPOSE/TRANSACTION_PROCESSING
  142. # - DATA_WAREHOUSE
  143. #------------------------------------------------------------------------------
  144. oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
  145. #------------------------------------------------------------------------------
  146. # Specify the Starter Database Global Database Name.
  147. #------------------------------------------------------------------------------
  148. oracle.install.db.config.starterdb.globalDBName=orcl
  149. #------------------------------------------------------------------------------
  150. # Specify the Starter Database SID.
  151. #------------------------------------------------------------------------------
  152. oracle.install.db.config.starterdb.SID=sidOracle11GR2
  153. #------------------------------------------------------------------------------
  154. # Specify the Starter Database character set.
  155. #
  156. # It can be one of the following:
  157. # AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,
  158. # EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,
  159. # BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,
  160. # AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,
  161. # IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,
  162. # KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,
  163. # ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258
  164. #------------------------------------------------------------------------------
  165. oracle.install.db.config.starterdb.characterSet=AL32UTF8
  166. #------------------------------------------------------------------------------
  167. # This variable should be set to true if Automatic Memory Management
  168. # in Database is desired.
  169. # If Automatic Memory Management is not desired, and memory allocation
  170. # is to be done manually, then set it to false.
  171. #------------------------------------------------------------------------------
  172. oracle.install.db.config.starterdb.memoryOption=true
  173. #------------------------------------------------------------------------------
  174. # Specify the total memory allocation for the database. Value(in MB) should be
  175. # at least 256 MB, and should not exceed the total physical memory available
  176. # on the system.
  177. # Example: oracle.install.db.config.starterdb.memoryLimit=512
  178. #------------------------------------------------------------------------------
  179. oracle.install.db.config.starterdb.memoryLimit=512
  180. #------------------------------------------------------------------------------
  181. # This variable controls whether to load Example Schemas onto the starter
  182. # database or not.
  183. #------------------------------------------------------------------------------
  184. oracle.install.db.config.starterdb.installExampleSchemas=false
  185. #------------------------------------------------------------------------------
  186. # This variable includes enabling audit settings, configuring password profiles
  187. # and revoking some grants to public. These settings are provided by default.
  188. # These settings may also be disabled.
  189. #------------------------------------------------------------------------------
  190. oracle.install.db.config.starterdb.enableSecuritySettings=true
  191. ###############################################################################
  192. # #
  193. # Passwords can be supplied for the following four schemas in the #
  194. # starter database: #
  195. # SYS #
  196. # SYSTEM #
  197. # SYSMAN (used by Enterprise Manager) #
  198. # DBSNMP (used by Enterprise Manager) #
  199. # #
  200. # Same password can be used for all accounts (not recommended) #
  201. # or different passwords for each account can be provided (recommended) #
  202. # #
  203. ###############################################################################
  204. #------------------------------------------------------------------------------
  205. # This variable holds the password that is to be used for all schemas in the
  206. # starter database.
  207. #-------------------------------------------------------------------------------
  208. oracle.install.db.config.starterdb.password.ALL=******
  209. #-------------------------------------------------------------------------------
  210. # Specify the SYS password for the starter database.
  211. #-------------------------------------------------------------------------------
  212. oracle.install.db.config.starterdb.password.SYS=
  213. #-------------------------------------------------------------------------------
  214. # Specify the SYSTEM password for the starter database.
  215. #-------------------------------------------------------------------------------
  216. oracle.install.db.config.starterdb.password.SYSTEM=
  217. #-------------------------------------------------------------------------------
  218. # Specify the SYSMAN password for the starter database.
  219. #-------------------------------------------------------------------------------
  220. oracle.install.db.config.starterdb.password.SYSMAN=
  221. #-------------------------------------------------------------------------------
  222. # Specify the DBSNMP password for the starter database.
  223. #-------------------------------------------------------------------------------
  224. oracle.install.db.config.starterdb.password.DBSNMP=
  225. #-------------------------------------------------------------------------------
  226. # Specify the management option to be selected for the starter database.
  227. # It can be one of the following:
  228. # 1. GRID_CONTROL
  229. # 2. DB_CONTROL
  230. #-------------------------------------------------------------------------------
  231. oracle.install.db.config.starterdb.control=DB_CONTROL
  232. #-------------------------------------------------------------------------------
  233. # Specify the Management Service to use if Grid Control is selected to manage
  234. # the database.
  235. #-------------------------------------------------------------------------------
  236. oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
  237. #-------------------------------------------------------------------------------
  238. # This variable indicates whether to receive email notification for critical
  239. # alerts when using DB control.
  240. #-------------------------------------------------------------------------------
  241. oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
  242. #-------------------------------------------------------------------------------
  243. # Specify the email address to which the notifications are to be sent.
  244. #-------------------------------------------------------------------------------
  245. oracle.install.db.config.starterdb.dbcontrol.emailAddress=
  246. #-------------------------------------------------------------------------------
  247. # Specify the SMTP server used for email notifications.
  248. #-------------------------------------------------------------------------------
  249. oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
  250. ###############################################################################
  251. # #
  252. # SPECIFY BACKUP AND RECOVERY OPTIONS #
  253. # ------------------------------------ #
  254. # Out-of-box backup and recovery options for the database can be mentioned #
  255. # using the entries below. #
  256. # #
  257. ###############################################################################
  258. #------------------------------------------------------------------------------
  259. # This variable is to be set to false if automated backup is not required. Else
  260. # this can be set to true.
  261. #------------------------------------------------------------------------------
  262. oracle.install.db.config.starterdb.automatedBackup.enable=false
  263. #------------------------------------------------------------------------------
  264. # Regardless of the type of storage that is chosen for backup and recovery, if
  265. # automated backups are enabled, a job will be scheduled to run daily at
  266. # 2:00 AM to backup the database. This job will run as the operating system
  267. # user that is specified in this variable.
  268. #------------------------------------------------------------------------------
  269. oracle.install.db.config.starterdb.automatedBackup.osuid=
  270. #-------------------------------------------------------------------------------
  271. # Regardless of the type of storage that is chosen for backup and recovery, if
  272. # automated backups are enabled, a job will be scheduled to run daily at
  273. # 2:00 AM to backup the database. This job will run as the operating system user
  274. # specified by the above entry. The following entry stores the password for the
  275. # above operating system user.
  276. #-------------------------------------------------------------------------------
  277. oracle.install.db.config.starterdb.automatedBackup.ospwd=
  278. #-------------------------------------------------------------------------------
  279. # Specify the type of storage to use for the database.
  280. # It can be one of the following:
  281. # - FILE_SYSTEM_STORAGE
  282. # - ASM_STORAGE
  283. #------------------------------------------------------------------------------
  284. oracle.install.db.config.starterdb.storageType=
  285. #-------------------------------------------------------------------------------
  286. # Specify the database file location which is a directory for datafiles, control
  287. # files, redo logs.
  288. #
  289. # Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM
  290. #-------------------------------------------------------------------------------
  291. oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
  292. #-------------------------------------------------------------------------------
  293. # Specify the backup and recovery location.
  294. #
  295. # Applicable only when oracle.install.db.config.starterdb.storage=FILE_SYSTEM
  296. #-------------------------------------------------------------------------------
  297. oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
  298. #-------------------------------------------------------------------------------
  299. # Specify the existing ASM disk groups to be used for storage.
  300. #
  301. # Applicable only when oracle.install.db.config.starterdb.storage=ASM
  302. #-------------------------------------------------------------------------------
  303. oracle.install.db.config.asm.diskGroup=
  304. #-------------------------------------------------------------------------------
  305. # Specify the password for ASMSNMP user of the ASM instance.
  306. #
  307. # Applicable only when oracle.install.db.config.starterdb.storage=ASM_SYSTEM
  308. #-------------------------------------------------------------------------------
  309. oracle.install.db.config.asm.ASMSNMPPassword=
  310. #------------------------------------------------------------------------------
  311. # Specify the My Oracle Support Account Username.
  312. #
  313. # Example : MYORACLESUPPORT_USERNAME=metalink
  314. #------------------------------------------------------------------------------
  315. MYORACLESUPPORT_USERNAME=
  316. #------------------------------------------------------------------------------
  317. # Specify the My Oracle Support Account Username password.
  318. #
  319. # Example : MYORACLESUPPORT_PASSWORD=password
  320. #------------------------------------------------------------------------------
  321. MYORACLESUPPORT_PASSWORD=
  322. #------------------------------------------------------------------------------
  323. # Specify whether to enable the user to set the password for
  324. # My Oracle Support credentials. The value can be either true or false.
  325. # If left blank it will be assumed to be false.
  326. #
  327. # Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true
  328. #------------------------------------------------------------------------------
  329. SECURITY_UPDATES_VIA_MYORACLESUPPORT=
  330. #------------------------------------------------------------------------------
  331. # Specify whether user wants to give any proxy details for connection.
  332. # The value can be either true or false. If left blank it will be assumed
  333. # to be false.
  334. #
  335. # Example : DECLINE_SECURITY_UPDATES=false
  336. #------------------------------------------------------------------------------
  337. DECLINE_SECURITY_UPDATES=true
  338. #------------------------------------------------------------------------------
  339. # Specify the Proxy server name. Length should be greater than zero.
  340. #
  341. # Example : PROXY_HOST=proxy.domain.com
  342. #------------------------------------------------------------------------------
  343. PROXY_HOST=
  344. #------------------------------------------------------------------------------
  345. # Specify the proxy port number. Should be Numeric and atleast 2 chars.
  346. #
  347. # Example : PROXY_PORT=25
  348. #------------------------------------------------------------------------------
  349. PROXY_PORT=
  350. #------------------------------------------------------------------------------
  351. # Specify the proxy user name. Leave PROXY_USER and PROXY_PWD
  352. # blank if your proxy server requires no authentication.
  353. #
  354. # Example : PROXY_USER=username
  355. #------------------------------------------------------------------------------
  356. PROXY_USER=
  357. #------------------------------------------------------------------------------
  358. # Specify the proxy password. Leave PROXY_USER and PROXY_PWD
  359. # blank if your proxy server requires no authentication.
  360. #
  361. # Example : PROXY_PWD=password
  362. #------------------------------------------------------------------------------
  363. PROXY_PWD=

11.进行安装

  1. su - oracle #切换为oracle执行以下安装操作
  2. cd /data/database/database
  3. ./runInstaller -silent -ignorePrereq -ignoreSysPrereqs -responseFile /data/database/database/response/db_install.rsp

12.使用root用户运行

  1. su - root
  2. /data/oraInventory/orainstRoot.sh
  3. /data/oracle/product/11.2.0/db_1/root.sh

13.配置tnsnames.ora

  1. vim /data/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
  2. #新增如下内容:
  3. alioracle =
  4. (DESCRIPTION =
  5. (ADDRESS_LIST =
  6. (ADDRESS = (PROTOCOL = TCP)(HOST = 主机名称hostname)(PORT = 1521))
  7. )
  8. (CONNECT_DATA =
  9. (SERVICE_NAME = orcl)
  10. )
  11. )



14.建库

  1. cd /data/oracle/product/11.2.0/db_1/bin
  2. ./dbca -silent -responseFile /data/database/database/response/dbca.rsp
  3. #需要输入oracle用的 用户名和密码

15.配置listener.ora

  1. vim /data/oracle/product/11.2.0/db_1/network/admin/listener.ora
  2. #新增如下内容:
  3. LISTENER=(DESCRIPTION_LIST=(DESCRIPTION=
  4. (ADDRESS=(PROTOCOL=TCP)(HOST=主机名称hostname)(PORT=1521))
  5. )
  6. )
  7. SID_LIST_LISTENER=
  8. (SID_LIST=
  9. (SID_DESC=
  10. (GLOBAL_DBNAME=orcl)
  11. (SID_NAME=orcl11g)
  12. (ORACLE_HOME=/data/oracle/product/11.2.0/db_1)
  13. (PRESPAWN_MAX=20)
  14. (PRESPAWN_LIST=
  15. (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
  16. )
  17. )
  18. )

16.去阿里云控制台,找到安全组,去添加1521端口的配置规则,否则用公网ip连接不到oracle数据库,

这一步很关键,否则无法用公网ip远程连接。

17.接下来用sqlplus去创建用户的id以及分配权限

  1. create user product identified by product;
  2. grant connect, resource to product;
  3. grant select on V_$session to product;
  4. grant select on V_$sesstat to product;
  5. grant select on V_$statname to product;
  6. 后面就可以用plsql工具去远程连接安装好的oracle数据库。

附:oracle实例的启动和启动监听

  1. su - oracle #切换到oracle用户
  2. lsbrctl start #启动
  3. lsnrctl stop #停止
  4. sdnrctl status #查看listener的状态
  5. sqlplus "/as sysdba" #以sysdba的身份登陆
  6. strartup

可以telnet一下 公网ip 1521,查看下网络是否连通,然后就可以用plsql工具去远程登陆了。

具体的安装步骤就这么多了,如有不足和错误的地方欢迎来指正,谢谢!

文章参考:

https://www.jianshu.com/p/7470295689d8

https://www.cnblogs.com/xibei666/p/5935219.html

http://www.111cn.net/sys/CentOS/105946.htm


分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP