以 Oracle 用户进入,建立 $HOME/.bash_profile:
# Oracle Environment
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/9.0.1
export ORACLE_SID=test
export ORACLE_TERM=xterm
#export TNS_ADMIN= 设置这个变量,如果 sqlnet.ora, tnsnames.ora等不在$ORACLE_HOME/network/admin 目录下。
export NLS_LANG=AMERICAN;
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/openwin/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/td/lib:/usr/ucblib:/usr/local/lib
export LD_LIBRARY_PATH
# Set shell search paths:
PATH=/bin:/usr/bin:/usr/sbin:/etc:/opt/bin:/usr/ccs/bin:/usr/openwin/bin:/opt/local/GNU/bin
PATH=$PATH:/opt/local/bin:/opt/NSCPnav/bin:$ORACLE_HOME/bin
PATH=$PATH:/usr/local/samba/bin:/usr/ucb:
export PATH
# CLASSPATH must include the following JRE locations:
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
启动 runInstaller
Oracle 不再支持字符模式的安装,因此必须设置 DISPLAY 变量,假设节点名为 oracleserver,那么 oracleserver 必须允许 runInstaller 显示 X 信息。如果你不在远程安装数据库,可以跳过下面的第一和第二步。
第一步:yourdesktop:user$ xhost +oracleserver
第二步:从 oracleserver 的控制台上以 Oracle 用户执行:
oracleserver:oracle$ export DISPLAY=yourdesktop:0.0
第三步a:从第一张 CD ,执行 runInstaller (不要 cd 到 /mnt/cdrom !)
oracleserver:oracle$ mount /mnt/cdrom
oracleserver:oracle$ /mnt/cdrom/runInstaller
第三步b:或者从下载点:
oracleserver:oracle$ Disk1/RunInstaller
运行 Oracle 安装
下面是我回答 runInstaller 的问题: What would you like as the base directory (Inventory Location): /opt/oracle/oraInventory
UNIX Group Name (permission for updating Oracle software): oinstall
Full path name of the Oracle Home: /opt/oracle/product/9.0.1
JDK Home Directory: /usr/local/java
注意:
如果没有“降级” binutils 包的话,安装到第三张 CD 时,你会看到下面的错误:
"Error invoking target install of makefile /opt/oracle/product/9.0.1/plsql/lib/ins_plsql.mk"
解决的办法请看后面的“Oracle 安装错误”。
你可能还会碰到 "Oracle Net Configuration Assistant" 挂起的问题,请参考后面的”Oracle 安装中重要的技巧和提示“。
Save the .bash_profile file and re-login as the oracle user. Make sure the .bash_profile ran correctly by issuing the following command:
set | more
Installation
Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=<machine-name>:0.0; export DISPLAY
Start the Oracle Universal Installer (OUI) by issuing the following command in the Disk1 directory:
./runInstaller
Continue with the installation as normal.
Before the linking phase of the installation begins you should edit the $ORACLE_HOME/bin/genclntsh script altering the following line:
LD_SELF_CONTAINED="-z defs"
to:
LD_SELF_CONTAINED=""
The linking phase should now proceed correctly.
Post Installation
Edit the /etc/oracle file setting the restart flag for each instance to 'Y':
TSH1:/home/oracle/product/9.2.0.1.0:Y
Create a file called /etc/init.d/dbora containing the following:
#!/bin/sh
# 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=/home/oracle/product/9.2.0.1.0
ORA_OWNER=oracle
if [! -f $ORA_HOME/bin/dbstart]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" 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/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 &
;;
esac
Use chmod to set the privileges to 750:
chmod 750 /etc/init.d/dbora
Link the file into the appropriate run-level script directories:
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
The relevant instances should now startup/shutdown automatically at system startup/shutdown.
Oracle9i (9.2.0.1.0) Installation on RedHat 8.0 Linux
This article is intended as a brief guide to installing Oracle9i (9.2.0.1.0) on RedHat 8.0 Linux. For additional information and platform variations read the "Installation Guide for UNIX Systems".
Unpack Files
First unzip the files:
gunzip lnx_920_disk1.cpio.gz
gunzip lnx_920_disk2.cpio.gz
gunzip lnx_920_disk3.cpio.gz
Next unpack the contents of the files:
cpio -idmv < lnx_920_disk1.cpio
cpio -idmv < lnx_920_disk1.cpio
cpio -idmv < lnx_920_disk1.cpio
You should now have three directories (Disk1, Disk2 and Disk3) containing installation files.
Set Kernel Parameters
The following table contains minimum kernel settings. If the current settings exceed these figures then do not alter them:
The current semaphore settings can be viewed using the following command:
cat /proc/sys/kernel/sem
250 32000 32 128
The values listed are for the SEMMSL, SEMMNS, SEMOPM, and SEMMNI parameters. The adjusted values can be set using:
# echo SEMMSL_value SEMMNS_value SEMOPM_value SEMMNI_value > /proc/sys/kernel/sem
echo 250 32000 100 128 > /proc/sys/kernel/sem
The shared memory settings can be viewed using the following command:
cat shared_memory_parameter
The values can be set using:
echo 2147483648 > /proc/sys/kernel/shmmax
Set the File Handles, Sockets and Process limit using:
echo 65536 > /proc/sys/fs/file-max
ulimit -n 65536
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_change
ulimit -u 16384
The necessary parameter changes can be combined in a script and run during system startup: