图形化安装Oracle11gR2
环境:
verify: CentOS release 6.5 (Final)
release:CentOS release 6.7 (Final)
1、登录到root用户下:
2、安装相关软件依赖包
灰色部分存在问题,不执行
切换到yum.repos.d目录下:
cd /etc/yum.repos.d
使用wget下载oracle提供的yum库:
wget https://public-yum.oracle.com/public-yum-ol6.repo
下载yum源
执行yum语句安装所有的oracle所需的先决条件:
yum install oracle-rdbms-server-11gR2-preinstall
如果出现” GPG key retrieval failed “的错误:
wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
如果以上步骤不成功则依次检查安装以下包:
检查:rpm -q package-name
安装:yum install -y package-name
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
3、创建oracle用户,组
创建Oracle安装组oinstall,数据库管理员组dba,及oracle用户
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/useradd -g oinstall -G dba oracle(主组oinstall,其它组:dba)
# passwd oracle
4、修改操作系统参数
配置内核参数:
可以直接在/etc/sysctl.conf文件中添加以下参数:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500 ---这个在上面已经设置过了
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
然后使用/sbin/sysctl -p --使内核参数实时生效
5、为Oracle用户设置Shell限制
使用命令vim /etc/security/limits.conf添加以下内容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
6、建立oracle安装目录和环境变量配置:
建立安装目录
创建oracle用户目录: mkdir -p /u01/app/oracle
指定所有者、组和权限
chown -R oracle:oinstall /u01/app/
chmod -R 775 /u01/app/
在/etc/profile末尾增加oracle相关限制
vim /etc/profile
#Oracle判断
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
设置Oracle用户环境变量
[root@qiao oracle]# su - oracle --切换到Oracle用户下,接下来的步骤都是oracle用户下操作
vim ~/.bash_profile --编辑Oracle环境变量配置文件
添加以下内容:
export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=ocp --默认实例名
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK/UTF8 ---数据库编码
export NLS_DATE_FORMAT=YYYY/MM/DD ----数据库时间格式
----以下两个设置是用来设置rlwrap插件的环境
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
source /home/oracle/.bash_profile --使配置生效
5、安装数据库软件
5.1、准备Oracle11g安装文件并解压
unzip p13390677_112040_Linux-x86-64_1of7.zip -d /u01/app/
unzip p13390677_112040_Linux-x86-64_2of7.zip -d /u01/app/
5.2、静默安装
cd /u01/app/database/response
cd /u01/app/database/response
mv db_install.rsp db_install.rsp.bak
vim db_install.rsp
添加压缩包下的db_install.rsp的内容
文件中ORACLE_HOSTNAME,要与主机名一致
chmod 640 db_install.rsp
灰色部分手动建库时会做
vim dbca.rsp
修改以下内容:
GDBNAME = "upcrm"
SID = "upcrm"
SYSPASSWORD = "upcrm"
SYSTEMPASSWORD = "upcrm"
EMCONFIGURATION = "LOCAL"
SYSMANPASSWORD = "upcrm"
DBSNMPPASSWORD = "upcrm"
vim netca.rsp
修改以下内容:
INSTALL_TYPE=""custom""
cd ..
./runInstaller -silent -responseFile /u01/app/database/response/db_install.rsp
安装失败,返回检查配置
最后会提示成功
在此过程中的安装都会记录到:
/u01/app/oracle/oraInventory/logs/installActions2016-08-25_06-31-10AM.log
灰色部分建库时会执行
cd /u01/app/database/response
dbca -silent -cloneTemplate -responseFile ./dbca.rsp
netca /silent /responseFile /u01/app/database/response/netca.rsp
切换到root用户下
vim /etc/hosts 查看是否有hostname显示的主机名称
如果没有就添加上
灰色部分建库时会执行
切换回oracle用户下:
lsnrctl start
sqlplus / as sysdba
SQL> create spfile from pfile='/u01/app/admin/upcrm/pfile/init.ora';
SQL> startup nomount;
6、安装rlwrap实现sqlplus的回显功能
[oracle@localhost home]$ rpm -ivh rlwrap-0.37-1.el6.x86_64.rpm
遇上的一些错误:
1. PRVF-0002 : Could not retrieve local nodename
信息:
[oracle@QYSD-Test database]$ ./runInstaller -silent -responseFile /u01/app/database/response/db_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 41293 MB Passed
Checking swap space: must be greater than 150 MB. Actual 7903 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-11-14_08-25-10PM. Please wait ...[oracle@QYSD-Test database]$ [FATAL] PRVF-0002 : Could not retrieve local nodename
A log of this session is currently saved as: /tmp/OraInstall2016-11-14_08-25-10PM/installActions2016-11-14_08-25-10PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.
解决方式:
修改/etc/hosts文件,添加主机名称。
例如:
127.0.0.1 QYSD-Test localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 QYSD-Test localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.115 QYSD-Test
2. Finding the most appropriate exit status for the current application
信息:
[oracle@QYSD-Test database]$ ./runInstaller -silent -responseFile /u01/app/database/response/db_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 41084 MB Passed
Checking swap space: must be greater than 150 MB. Actual 7903 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-11-14_08-32-42PM. Please wait ...[oracle@QYSD-Test database]$ [WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
[FATAL] [INS-13013] Target environment do not meet some mandatory requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /tmp/OraInstall2016-11-14_08-32-42PM/installActions2016-11-14_08-32-42PM.log
ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2016-11-14_08-32-42PM/installActions2016-11-14_08-32-42PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
A log of this session is currently saved as: /tmp/OraInstall2016-11-14_08-32-42PM/installActions2016-11-14_08-32-42PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.
日志信息:
WARNING: A log of this session is currently saved as: /tmp/OraInstall2016-11-14_08-32-42PM/installActions2016-11-14_08-32-42PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.
INFO: Finding the most appropriate exit status for the current application
INFO: Exit Status is -3
INFO: Shutdown Oracle Database 11g Release 2 Installer
INFO: Unloading Setup Driver
解决方式:
将db_install.rsp中的DECLINE_SECURITY_UPDATES修改为:DECLINE_SECURITY_UPDATES=true
然后使用:./runInstaller -silent -ignoreSysPrereqs -ignorePrereq -responseFile /u01/app/database/response/db_install.rsp