今天本打算做下OGG实验,发现我的GoldenGate软件都是32位的,在64位的linux上跑不起来,只好在虚拟机上实验,可是虚拟机(Vbox)安装文件竟然被杀毒软件给干掉了,悲哀啊,只好重新安装一遍虚拟机,在安装数据库的时候,我顺便做了下静默安装ORACLE11gR2的实验,实验环境OEL5.4,ORACLE11gR2,实验过程如下:
1.创建ORACLE用户。
[root@stream ~]# groupadd -g 1000 oinstall [root@stream ~]# groupadd -g 1200 dba [root@stream ~]# useradd -u 1100 -g oinstall -G dba oracle [root@stream ~]# passwd oracle
2.建立需要的目录,并修改属组和权限。
[root@stream ~]# mkdir -p /u01/app/oracle/oradata/stream [root@stream ~]# chown -R oracle:oinstall /u01 [root@stream ~]# chmod -R 775 /u01
3.修改linux内核参数。
[root@stream ~]# vi /etc/sysctl.conf kernel.shmmax = 4294967295 kernel.shmmni = 4096 kernel.shmall = 2097152 kernel.sem = 250 32000 100 128 fs.file-max = 6815744 fs.aio-max-nr = 1048576 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576
通过sysctl –p命令使之生效。
[root@stream ~]# sysctl -p
4.对Oracle用户,配置Shell Limites,在/etc/security/limits.conf文件里添加如下信息。
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
5.检查安装ORACLE11gR2需要的rpm包,将没装的包装上。
[root@stream ~]# rpm -q binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel| grep not
6.上传ORACLE安装介质并解压。
7.设置responseFile文件。
[oracle@stream ~]$ cd database/response [oracle@stream database]$ vi db_install.rsp
修改db_install.rsp文件的以下内容。
oracle.install.option=INSTALL_DB_SWONLY UNIX_GROUP_NAME=oinstall INVENTORY_LOCATION=/u01/app/oracle/oraInventory ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 ORACLE_BASE=/u01/app/oracle oracle.install.db.InstallEdition=EE oracle.install.db.isCustomInstall=false oracle.install.db.DBA_GROUP=dba oracle.install.db.OPER_GROUP=dba DECLINE_SECURITY_UPDATES=true
8.执行安装命令。
[oracle@stream database]$ ./runInstaller -silent - responseFile /home/oracle/database/response/db_install.rsp Starting Oracle Universal Installer... Checking Temp space:must be greater than 80 MB.Actual 10766 MB Passed Checking swap space:must be greater than 150 MB.Actual 2020 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-03-01_10-06-14AM. Please wait ... You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2012-03-01_10-06-14AM.log
此时,会在后台进行数据库软件的安装,可能需要挺长的时间,可以在开一个SHELL,去监控安装数据库时产生的日志文件。
[oracle@stream database]$ tail –f /u01/app/oraInventory/logs/ installActions2012-03-01_10-06-14AM.log
直到提示用root用户执行/u01/app/oracle/product/11.2.0/dbhome_1/root.sh脚本。
The following configuration scripts need to be executed as the "root" user. #!/bin/sh #Root scripts to run /u01/app/oraInventory/orainstRoot.sh /u01/app/oracle/product/11.2.0/dbhome_1/root.sh To execute the configuration scripts: 1. Open a terminal window 2. Log in as "root" 3. Run the scripts 4. Return to this window and hit "Enter" key to continue
新打开一个SHELL,切换到root用户执行上述2个脚本。
[root@stream ~]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete.
用root用户执行完这两个脚本后,在执行静默安装的SHELL窗口按下回车键,结束安装过程。
/u01/app/oraInventory/orainstRoot.sh /u01/app/oracle/product/11.2.0/dbhome_1/root.sh To execute the configuration scripts: 1. Open a terminal window 2. Log in as "root" 3. Run the scripts 4. Return to this window and hit "Enter" key to continue Successfully Setup Software.
9.检查安装是否成功。
[oracle@stream ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on 10:18:53 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance. SQL> exit Disconnected
至此,ORACLE软件安装结束,如果接下来用DBCA图形界面建库,需要先创建监听,如果静默建库,可以在数据库创建完成后在建立监听,静默创建数据库请听下回分解。