CentOS Installation Oracle 11g R2
Lab Environment:
Linux server operating system: CentOS 5.5 32-bit (note: Please separate partition/data for installation of Oracle database during system installation)
Linux Server IP Address: 192.168.32.130
Oracle Database version: Linux_11gr2_database
Windows Client system: Windows Xp
Specific operation:
First, install X window
Yum groupinstall "X window System"
Vim/etc/inittab #图形界面启动
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Id:5:initdefault:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vim/etc/sysconfig/iptables #开放UDP 177 Port
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-A rh-firewall-1-input-m state--state new-m udp-p UDP--dport 177-j ACCEPT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shutdown-r now #重启
Ii. preparatory work before installation
1. Download Oracle 11g R2 Linux version
Http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_databas
E_1of2.zip
Http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_databas
E_2of2.zip
2. Modify the operating system ID (CentOS system installation is not supported by Oracle by default)
Vim/etc/redhat-release
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Red Hat Enterprise Linux Server release 5.5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. Create the Oracle Database installation directory
Mkdir-p/data/oracle #安装目录
Mkdir-p/data/orainventory #配置文件目录
Mkdir-p/data/database #软件包解压目录
4. Create system users and user groups running the Oracle database
Groupadd Oinstall
Groupadd dba
USERADD-G oinstall-g dba Oracle
passwd Oracle
Chown-r oracle:oinstall/data/oracle
Chown-r oracle:oinstall/data/orainventory
Chown-r Oracle:oinstall/data/database
5. Set Kernel parameters
Vim/etc/sysctl.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Kernel paramaters required by Oracle 11gR1
Fs.file-max = 6815744
FS.AIO-MAX-NR = 3113202
Kernel.sem = 250 32000 100 128
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 #刷新设置
6. Oracle User Limit settings
Vim/etc/security/limits.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Oracle Set
Oracle Soft Nproc 2047
Oracle Hard Nproc 16384
Oracle Soft Nofile 1024
Oracle Hard Nofile 65536
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7. User Environment
Vim ~oracle/.bash_profile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Export Oracle_base=/data/oracle/oracle #安装目录
Export Oracle_home= $ORACLE _base/product/11.2.0/db_1
Export ORACLE_SID=ORCL #数据库实例名
Export Oracle_term=xterm
Export path= $ORACLE _home/bin:/usr/sbin: $PATH
Export Ld_library_path= $ORACLE _home/lib:/lib:/usr/lib
Export
Export Nls_lang=american_america. Zhs16gbk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8. Configure the Firewall
Vim/etc/sysconfig/iptables #开放1521端口
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 1521-j ACCEPT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9. Extracting Oracle Software packages
Unzip linux_11gr2_database_1of2.zip-d/data/database
Unzip linux_11gr2_database_2of2.zip-d/data/database
Chown-r Oracle:oinstall/data/database/database
10. Install Oracle Dependent packages
Yum install-y binutils compat-libstdc++-33 elfutils-libelf
Elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel
Libaio libaio-devel libgcc libstdc++ libstdc++-devel make Numactl
Sysstat libxp UnixODBC unixodbc-devel pdksh-*
III. Installation of Oracle
A, Host +
Su–oracle
Export display=:0.0
B. Log on with Oracle user at boot time
Cd/data/database/database #进入安装包目录
./runinstaller #安装, the following interface appears and the graphics configuration process is skipped
Iv. Configuring the Listener
Su-oracle
NETCA #配置监听程序命令, the graphics configuration process is skipped
V. Creating a DB instance
Su-oracle
DBCA #启动oracle实例安装界面, as shown, the graphics configuration process is skipped
VI. Launch of Oracle
Su-oracle
Sqlplus/nolog #进入sqlplus环境, but do not log in
Conn/as SYSDBA #以超级管理员权限登录
Startup #启动数据库实例
Quit
Lsnrctl Start #启动监听
Startup parameter Description:
Startup #不带任何参数, start the DB instance and open the database, generally choose this startup mode
Startup Nomount #只启动数据库实例, do not open the database, typically used when creating a new database
Startup Mount #启动数据库实例, and load the database, but do not open the database, generally used to modify the database name and other management uses
Lsnrctl Status #查看Oracle运行状态
Vii. Close Oracle
Su-oracle
Lsnrctl Stop #关闭监听
Sqlplus/nolog
Conn/as SYSDBA
Shutdown Immediate #关闭数据库实例
Quit
Shutdown parameter Description:
Normal #等待所有的用户断开连接 The new connection is not allowed after the command is executed
Immediate #等待用户完成当前的语句后, disconnecting users and not allowing new users to connect
Transactional #等待用户完成当前的事务后断开连接, new users are not allowed to connect
Abort #强行断开连接并直接关闭数据库
Viii. Startup scripts
Vim/data/oracle/oracle/product/11.2.0/db_1/bin/dbstart
Vim/data/oracle/oracle/product/11.2.0/db_1/bin/dbshut
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
oracle_home_listner= $ORACLE _home
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vim/etc/init.d/oracle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh
# chkconfig:0356 99 10
# Description:startup Script for Oracle Databases
# Script Path:/etc/init.d/oracle
# Author:
#
Oracle_base=/data/oracle/oracle
Oracle_home= $ORACLE _base/product/11.2.0/db_1
Oracle_sid=orcl
Path= $ORACLE _home/bin:/usr/sbin: $PATH
Export Oracle_base oracle_home oracle_sid PATH
#
Ora_ownr= "Oracle"
#
if [!-F $ORACLE _home/bin/dbstart-o!-D $ORACLE _home]
Then
echo "Oracle startup:cannot start"
Exit 1
Fi
#
Case "$" in
Start
su-$ORA _OWNR-LC $ORACLE _home/bin/dbstart
echo "Oracle Start succesful!"
;;
Stop
#
su-$ORA _OWNR-LC $ORACLE _home/bin/dbshut
echo "Oracle Stop succesful!"
;;
Restart
$ stop
$ start
;;
*)
echo $ "Usage: ' basename $ ' {Start|stop|restart}"
Exit 1
Esac
Exit 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
chmod 755/etc/init.d/oracle
2. Adding system Services
Ln-s/etc/init.d/oracle/etc/rc3.d/s99oracle #添加系统启动级别3软连接
Ln-s/etc/init.d/oracle/etc/rc5.d/s99oracle #添加系统启动级别5软连接
Ln-s/etc/init.d/oracle/etc/rc0.d/k01oracle #添加系统关机软连接
Ln-s/etc/init.d/oracle/etc/rc6.d/k01oracle #添加系统重启软连接
Chkconfig--add Oracle #添加系统服务
Official Document: Http://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm#CEGHFFGG
Reference Document: Http://www.osyunwei.com/archives/5445.html
CentOS 6.5 Installation Oracle 11g R2