2.CentOS Oracle安装
2.1 打patch,解压安装文件。
[Linuxidc.com@Linuxidc.com]$sudo unzip p3006854_9204_LINUX.zip
[Linuxidc.com@Linuxidc.com]$sudo cd 3006854
[Linuxidc.com@Linuxidc.com]$sudo sh rhel3_pre_install.sh
依次解压几个文件:
[Linuxidc.com@Linuxidc.com]$sudo gunzip .cpio.gz
[Linuxidc.com@Linuxidc.com]$sudo cpio -idmv < .cpio
得到Disk1,Disk2,Disk3三个目录。
2.2 开始安装,这时不要建新数据库。
[Linuxidc.com@Linuxidc.com]$sudo xhost +
切换到oracle用户。
[Linuxidc.com@Linuxidc.com]$su - oracle
Password:
[oracle@oracle]$cd /Disk1
[oracle@oracle]$./runInstaller&
启动CentOS Oracle安装程序,在选择安装类型时选择"Software Only",结束安装。
升级到9.2.0.6,执行此步骤之前请修改/etc/RedHat-release,rhel 3不必修改,新的补丁安装程序和oracle 10的一样会检测系统。
确保其内容如下:
Red Hat Enterprise Linux AS release 3 (Taroon)
进入9026安装程序目录,
[oracle@oracle]$./runInstaller&
选择安装 "Oracle Universal Installer"。
安装完毕,重新启动安装程序。
选择安装 "Oracle9iR2 Patch Set"。
2.3 CentOS Oracle安装创建数据库
[oracle@oracle]$dbca &
启动数据库代理,填写必要的参数,创建数据。
也可以预先指定参数。
[oracle@oracle]$`dbca -createDatabase -templateName New_Database.dbt
-gdbName oralin.localhost -datafileD
estination /var/opt/oralce/oradata/ -sid
oralin` &
如果不想启动图形,可以追加上-silent参数。
3 CentOS Oracle安装后的处理
3.1 创建启动服务程序
如果***没有***进行1.1步,可以从gurulabs(http://www.gurulabs.com/)下载rpm包。
wget -c http://www.gurulabs.com/files/oraclerun9i-1.4-1.noarch.rpm
[Linuxidc.com@Linuxidc.com]$sudo rpm -ivh oraclerun9i-1.4-1.noarch.rpm
它提供了几个文件:
[Linuxidc.com@Linuxidc.com]$sudo rpm -ql oraclerun9i
/etc/init.d/oracle
/etc/profile.d/oracle.csh
/etc/profile.d/oracle.sh
/etc/sysconfig/oracle
/usr/share/doc/oraclerun9i-1.4/INSTALL
修改/etc/profile.d/oracle.sh,设置$ORACLE_HOME,$ORACLE_SID,$ORACLE_BASE。
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2
export ORACLE_SID=oralin
修改/etc/sysconfig/oracle,将START_ORALCE改成"yes"。
修改/etc/oratab,将N改成Y。
调整系统参数:
[Linuxidc.com@Linuxidc.com]$sudo /etc/init.d/oracle tunekernel
启动数据库:
[Linuxidc.com@Linuxidc.com]$sudo /etc/init.d/oracle start
关闭数据库:
[Linuxidc.com@Linuxidc.com]$sudo /etc/init.d/oracle stop
如果执行了1.1步,自己手写一个shell(/etc/init.d/oracle)就行了,内容如下
#!/bin/sh
# chkconfig: - 20 80
#
# description: Oracle auto start-stop script.
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/opt/oracle/product/9.2
ORA_OWNER=oracle
if [! -f $ORA_HOME/bin/dbstart]
then
echo "Oracle startup: cannot start"
exit
fi
case "" in
'start')
# Start the Oracle databases
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/lsnrctl start
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
su - $ORA_OWNER -c $ORA_HOME/bin/lsnrctl stop
;;
esac
3.2 还原gcc的链接
[Linuxidc.com@Linuxidc.com]$sudo rm /usr/bin/gcc
[Linuxidc.com@Linuxidc.com]$sudo rm /usr/bin/g++
[Linuxidc.com@Linuxidc.com]$sudo mv /usr/bin/g++32 /usr/bin/g++
[Linuxidc.com@Linuxidc.com]$sudo mv /usr/bin/gcc32 /usr/bin/gcc
