一、安装前准备
1.安装介质
2、添加oracle用户和组
[root@zquathost oracle]# groupadd oinstall
[root@zquathost oracle]# groupadd dba
[root@zquathost oracle]# useradd -g oinstall -G dba -m oracle
[root@zquathost oracle]# passwd oracle
3.创建文件夹并授权
[root@zquathost oracle]# mkdir /oracle/app
[root@zquathost oracle]# mkdir /oracle/app/oracle
[root@zquathost oracle]# mkdir /oracle/app/oradata
[root@zquathost oracle]# mkdir /oracle/app/oracle/product
[root@zquathost oracle]# chown -R oracle:oinstall /oracle/app
[root@zquathost oracle]# ls -l
4.内存参数设置
[root@zquathost ~]# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nofile 65536
oracle hard memlock 52428800
oracle soft memlock 52428800
[root@zquathost ~]# vi /etc/sysctl.conf
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
[root@zquathost ~]# sysctl -p
5.oracle用户环境变量设置
[root@zquathost /]# su - oracle
[oracle@zquathost ~]$ vi .bash_profile
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/usr/lib:/usr/local/lib
6.安装oracle依赖包
[root@zquathost ~]# yum install -y gcc
[root@zquathost ~]# yum install -y libaio-devel
[root@zquathost ~]# yum install -y gcc-c++
[root@zquathost ~]# yum install -y elfutils-libelf-devel
[root@zquathost ~]# yum install -y compat-libstdc++-33
下载pdksh-5.2.14-30.x86_64.rpm包到/home目录
[root@zquathost ~]# rpm -ivh /home/pdksh-5.2.14-30.x86_64.rpm
注意:如果已经有gcc后就不需要执行这一步,此步为可选步骤。
二、oracle安装步骤
1、启动安装界面
以xdm为例,如果有疑问,可参考《图形终端远程操作Linux》,链接:http://baijiahao.baidu.com/builder/preview/s?id=1564735350184338
安装好XManager后,启动Xmanager - Passive,会最小化到状态栏,执行xclock测试
将安装介质复制到/oracle/app中进行解压:
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
也可以在解压之前先判断压缩包是否完整:
unzip –t linux.x64_11gR2_database_1of2.zip
unzip –t linux.x64_11gR2_database_2of2.zip
在/oracle/app/database目录执行./runInstaller.sh,弹出如下界面:
2、开始安装
3、语言选择
4、数据库版本选择
5、选择安装目录
6、数据库类型选择
7、实例名称
8、参数设置
9、设置数据存储目录
10、系统用户口令
11、完成安装
当看到上述界面时,说明需要使用root用户执行上述脚本:
执行脚本
[root@ zquathost ~]# sh /oracle/app/oraInventory/orainstRoot.sh
Changing permissions of /oracle/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script is complete.
[root@ zquathost ~]# sh /oracle/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER=oracle
ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
验证安装是否完成
[oracle@zquathost ~]$ sqlplus / as sysdba
如果可以访问,说明安装成功。