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

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


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


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

[html]  view plain  copy
  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.创建用户和用户组

[html]  view plain  copy
  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.创建安装目录和权限

[java]  view plain  copy
  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系统标识

[java]  view plain  copy
  1. vi /etc/redhat-release  

修改成redhat-7

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

6.修改内核参数

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

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

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

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

8.安装需要的rpm包

[html]  view plain  copy
  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.解压两个安装文件到对应的文件夹下(自行修改对应的目录)

[html]  view plain  copy
  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.修改安装配置信息

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

11.进行安装

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

12.使用root用户运行

[html]  view plain  copy
  1. su - root  
  2. /data/oraInventory/orainstRoot.sh  
  3. /data/oracle/product/11.2.0/db_1/root.sh  

13.配置tnsnames.ora

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



14.建库

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

15.配置listener.ora

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

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

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

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

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

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

[html]  view plain  copy
  1. su - oracle #切换到oracle用户  
  2. lsbrctl start #启动  
  3. lsnrctl stop #停止  
  4. sdnrctl status #查看listener的状态  
  5.   
  6. sqlplus "/as sysdba" #以sysdba的身份登陆  
  7. 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
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值