oracle 在RHELAS4上的安装
时间:2006-09-30 来源:xyg_1980
Unpacking Downloaded Oracle9i Installation Files and Burning Oracle9i CDs
Download Oracle9i for Linux from the following web site:
http://otn.oracle.com/software/products/oracle9i/htdocs/linuxsoft.html Uncompress and unpack downloaded files: For Oracle9i (9.2.0): One step procedure (uses less disk space and is faster): zcat lnx_920_disk1.cpio.gz | cpio -idmv
zcat lnx_920_disk2.cpio.gz | cpio -idmv
zcat lnx_920_disk3.cpio.gz | cpio -idmv
Two step procedure: # Uncompress
gunzip lnx_920_disk1.cpio.gz lnx_920_disk2.cpio.gz lnx_920_disk3.cpio.gz Linux9i_Disk3.cpio.gz # Unpack the downloaded files:
cpio -idmv < lnx_920_disk1.cpio
cpio -idmv < lnx_920_disk2.cpio
cpio -idmv < lnx_920_disk3.cpio For Oracle9i (9.0.1): One step procedure (uses less disk space and is faster): zcat Linux9i_Disk1.cpio.gz | cpio -idmv
zcat Linux9i_Disk2.cpio.gz | cpio -idmv
zcat Linux9i_Disk3.cpio.gz | cpio -idmv
Two step procedure: # Uncompress
gunzip Linux9i_Disk1.cpio.gz Linux9i_Disk2.cpio.gz Linux9i_Disk3.cpio.gz # Unpack the downloaded files:
cpio -idmv < Linux9i_Disk1.cpio
cpio -idmv < Linux9i_Disk2.cpio
cpio -idmv < Linux9i_Disk3.cpio Now you should have 3 directories containing installation files: Disk1
Disk2
Disk3
I executed the following commands when I burned the 3 CDs:
mkisofs -r Disk1 | cdrecord -v --eject dev=0,0,0 speed=15 -
mkisofs -r Disk2 | cdrecord -v --eject dev=0,0,0 speed=15 -
mkisofs -r Disk3 | cdrecord -v --eject dev=0,0,0 speed=15 -
(You can get the dev numbers when you execute cdrecord -scanbus). /////////////////////////////////////////////////////////////////////////////////////////
1.Setting Swap Space
To check the memory, run:
grep MemTotal /proc/meminfo
To check the swap space, run:
cat /proc/swaps
You can also add temporary swap space by creating a temporary swap file instead of using a raw device. Here is the procedure:
su - root
dd if=/dev/zero of=tmpswap bs=1k count=900000
chmod 600 tmpswap
mkswap tmpswap
swapon tmpswap
To disable the temporary swap space execute the following commands:
su - root
swapoff tmpswap
rm tmpswap
2.Setting Shared Memory
I temporarely increased the shmmax setting for the kernel by executing the following command:
$ su - root
# cat /proc/sys/kernel/shmmax
33554432
# echo `expr 1024 \* 1024 \* 1024` > /proc/sys/kernel/shmmax
# cat /proc/sys/kernel/shmmax
1073741824
3.Checking /tmp Space
The Oracle Universal Installer requires up to 400 MB of free space in the /tmp directory.
To check the space in /tmp, run:
$ df /tmp
If you do not have enough space in the /tmp directory, you can temporarily create a tmp directory in another filesystem. Here is how you can do this:
su - root
mkdir /<AnotherFilesystem>/tmp
chown root.root /<AnotherFilesystem>/tmp
chmod 1777 /<AnotherFilesystem>/tmp
export TEMP=/<AnotherFilesystem> # used by Oracle
export TMPDIR=/<AnotherFilesystem> # used by Linux programs like the linker "ld"
When you are done with your Oracle installation, shutdown Oracle and remove the temporary directory:
su - root
rmdir /<AnotherFilesystem>/tmp
unset TEMP
unset TMPDIR 4.Checking Packages (RPMs)
Ensure the following required packages are installed on your server by running the following command:
rpm -q make \
compat-db \
compat-gcc-32 \
compat-gcc-32-c++ \
compat-oracle-rhel4 \
compat-libcwait \
compat-libgcc-296 \
compat-libstdc++-296 \
compat-libstdc++-33 \
gcc \
gcc-c++ \
gnome-libs \
gnome-libs-devel \
libaio-devel \
libaio \
make \
openmotif21 \
xorg-x11-deprecated-libs-devel \
xorg-x11-deprecated-libs 5.Creating Oracle User Accounts
su - root
groupadd dba # group of users to be granted with SYSDBA system privilege
groupadd oinstall # group owner of Oracle files
useradd -c "Oracle software owner" -g oinstall -G dba oracle
passwd oracle /////////////////////////////////////////////////////////////////////////////////////////
JDK Skip this step for Oracle9iR2. I successfully installed Oracle9iR2 without installing JDK on the system. Oracle comes now with its own Java. This means that you don't have to execute the following steps which were required for older Oracle versions: Download JDK 1.3.1 or Blackdown 1.1.8_v3: (I usually used Blackdown)
http://www.blackdown.org
http://java.sun.com According to the JDK documentation, install JDK under /usr/local. Then create a symbolic link to the JDK under /usr/local/java:
su - root
bzip2 -dc jdk118_v3-glibc-2.1.3.tar.bz2 | tar xf - -C /usr/local
ln -s /usr/local/jdk118_v3 /usr/local/java /////////////////////////////////////////////////////////////////////////////////////////
6.Creating Oracle Directories
su - root
mkdir -p /u01/app/oracle/product/9.2.0
chown -R oracle.oinstall /u01
mkdir /var/opt/oracle
chown oracle.dba /var/opt/oracle
chmod 755 /var/opt/oracle 7.Setting Oracle Environments
As the oracle user execute the following commands:
# Set the LD_ASSUME_KERNEL environment variable only for Red Hat 9,
# RHEL AS 3, and RHEL AS 4 !!
# Use the "Linuxthreads with floating stacks" implementation instead of NPTL:
export LD_ASSUME_KERNEL=2.4.1 # for RH 9 and RHEL AS 3
export LD_ASSUME_KERNEL=2.4.19 # for RHEL AS 4
# Oracle Environment
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2.0
export ORACLE_SID=test
export ORACLE_TERM=xterm
# export TNS_ADMIN= Set if sqlnet.ora, tnsnames.ora, etc. are not in $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
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
# Set shell search paths
export PATH=$PATH:$ORACLE_HOME/bin
I successfully installed Oracle9iR2 without setting the following CLASSPATH environment variable:
# CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
# CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
# export CLASSPATH
You can put these environment settings at the end of the ~oracle/.bash_profile file if you use bash. By this way you don't have to set the environment variables again when you login as "oracle", or when you switch to the user "oracle" by executing "su - oracle". 9.Starting runInstaller
Oracle no longer supports a character mode installer. Therefore, in order to execute runInstaller directly from a console of a machine you are logged into (in this example the node name where Oracle is running is called "oracleserver"), you need to set the DISPLAY environment variable. Before you do that, make sure that you also allow runInstaller on "oracleserver" to display X information on your Linux desktop machine (in this example, the PC name where you are running X Windows like KDE or GNOME is called "yourdesktop"), because programs running on remote machines cannot display information to your screen unless you give them the authority to do so. Note that the X display relink mechanism does not work for NT desktop machines unless you use Exceed
Before you run runInstaller, execute e.g. 'xterm' to see if your X setup is really working! If you install Oracle on your desktop PC and not on a remote node, then you can skip step 1 and 3.
Step 1: Allow "oracleserver" to display X information to your desktop PC "yourdesktop":
yourdesktop:user$ xhost +oracleserver
Step 2: Open a new window and login to the Oracle server "oracleserver" as root. This window will be used for mounting and unmounting the Oracle CDs.
oracleserver:$ su - root
oracleserver:root# mount /mnt/cdrom
Step 3: From the console of your Oracle server "oracleserver" where you will run runInstaller, execute the following commands:
oracleserver:$ su - oracle
oracleserver:oracle$ export DISPLAY=yourdesktop:0.0
Step 4: Now execute runInstaller as "oracle". Do not cd to /mnt/cdrom !!
oracleserver:oracle$ /mnt/cdrom/runInstaller 10.Fix nodeinfo
Now installation should proceed without any linking errors but you will get one error in the end: Parameter "nodeinfo" = NO_VALUE
Agent Service Failed In order to fix this, run the following for starting the wizard after setup has finished: netca & Now change into $ORACLE_HOME and run ./lsnrctl start.(oracle 监听进程) Check that the process is running: ps afx | grep LISTEN 11.Automating Database Startup and Shutdown for HP, Linux and Solaris (Optional)
a)Edit the /var/opt/oracle/oratab file for Solaris and /etc/oratab file for HP and Linux.
Database entries in the oratab file appears in the following format:
ORACLE_SID:ORACLE_HOME:{Y|N}
In the preceding command, Y or N specifies whether you want the dbstart and dbshut scripts to start up and shut down the database. For each database that you want to start up, find the ORACLE_SID entry identified by the sid in the first field. Change the last field for each to Y.
For Oracle Real Application Clusters installation, this entry appears in the following format:
DB_NAME:ORACLE_HOME:{Y|N}
In the preceding command, DB_NAME is the cluster database name. Y or N specifies whether you want the dbstart and dbshut scripts to start up and shut down the database. b)In the /etc/init.d directory, create a dbora script similar to the following, if it does not already exist. Be sure to give the full path of the dbstart utility. script dbora
#!/bin/bash
#chkconfig:2345 99 10
#description:Oracle 9i server ORA_HOME=/u01/app/oracle/product/9.2.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
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
;; '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 chkconfig --add dbora find /etc/rc.d/ -name '*dbora' -print 结果如下
/etc/rc.d/rc4.d/S99dbora
/etc/rc.d/rc0.d/K10dbora
/etc/rc.d/rc6.d/K10dbora
/etc/rc.d/rc1.d/K10dbora
/etc/rc.d/rc3.d/S99dbora
/etc/rc.d/rc2.d/S99dbora
/etc/rc.d/init.d/dbora
/etc/rc.d/rc5.d/S99dbora # ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
# ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
Download Oracle9i for Linux from the following web site:
http://otn.oracle.com/software/products/oracle9i/htdocs/linuxsoft.html Uncompress and unpack downloaded files: For Oracle9i (9.2.0): One step procedure (uses less disk space and is faster): zcat lnx_920_disk1.cpio.gz | cpio -idmv
zcat lnx_920_disk2.cpio.gz | cpio -idmv
zcat lnx_920_disk3.cpio.gz | cpio -idmv
Two step procedure: # Uncompress
gunzip lnx_920_disk1.cpio.gz lnx_920_disk2.cpio.gz lnx_920_disk3.cpio.gz Linux9i_Disk3.cpio.gz # Unpack the downloaded files:
cpio -idmv < lnx_920_disk1.cpio
cpio -idmv < lnx_920_disk2.cpio
cpio -idmv < lnx_920_disk3.cpio For Oracle9i (9.0.1): One step procedure (uses less disk space and is faster): zcat Linux9i_Disk1.cpio.gz | cpio -idmv
zcat Linux9i_Disk2.cpio.gz | cpio -idmv
zcat Linux9i_Disk3.cpio.gz | cpio -idmv
Two step procedure: # Uncompress
gunzip Linux9i_Disk1.cpio.gz Linux9i_Disk2.cpio.gz Linux9i_Disk3.cpio.gz # Unpack the downloaded files:
cpio -idmv < Linux9i_Disk1.cpio
cpio -idmv < Linux9i_Disk2.cpio
cpio -idmv < Linux9i_Disk3.cpio Now you should have 3 directories containing installation files: Disk1
Disk2
Disk3
I executed the following commands when I burned the 3 CDs:
mkisofs -r Disk1 | cdrecord -v --eject dev=0,0,0 speed=15 -
mkisofs -r Disk2 | cdrecord -v --eject dev=0,0,0 speed=15 -
mkisofs -r Disk3 | cdrecord -v --eject dev=0,0,0 speed=15 -
(You can get the dev numbers when you execute cdrecord -scanbus). /////////////////////////////////////////////////////////////////////////////////////////
1.Setting Swap Space
To check the memory, run:
grep MemTotal /proc/meminfo
To check the swap space, run:
cat /proc/swaps
You can also add temporary swap space by creating a temporary swap file instead of using a raw device. Here is the procedure:
su - root
dd if=/dev/zero of=tmpswap bs=1k count=900000
chmod 600 tmpswap
mkswap tmpswap
swapon tmpswap
To disable the temporary swap space execute the following commands:
su - root
swapoff tmpswap
rm tmpswap
2.Setting Shared Memory
I temporarely increased the shmmax setting for the kernel by executing the following command:
$ su - root
# cat /proc/sys/kernel/shmmax
33554432
# echo `expr 1024 \* 1024 \* 1024` > /proc/sys/kernel/shmmax
# cat /proc/sys/kernel/shmmax
1073741824
3.Checking /tmp Space
The Oracle Universal Installer requires up to 400 MB of free space in the /tmp directory.
To check the space in /tmp, run:
$ df /tmp
If you do not have enough space in the /tmp directory, you can temporarily create a tmp directory in another filesystem. Here is how you can do this:
su - root
mkdir /<AnotherFilesystem>/tmp
chown root.root /<AnotherFilesystem>/tmp
chmod 1777 /<AnotherFilesystem>/tmp
export TEMP=/<AnotherFilesystem> # used by Oracle
export TMPDIR=/<AnotherFilesystem> # used by Linux programs like the linker "ld"
When you are done with your Oracle installation, shutdown Oracle and remove the temporary directory:
su - root
rmdir /<AnotherFilesystem>/tmp
unset TEMP
unset TMPDIR 4.Checking Packages (RPMs)
Ensure the following required packages are installed on your server by running the following command:
rpm -q make \
compat-db \
compat-gcc-32 \
compat-gcc-32-c++ \
compat-oracle-rhel4 \
compat-libcwait \
compat-libgcc-296 \
compat-libstdc++-296 \
compat-libstdc++-33 \
gcc \
gcc-c++ \
gnome-libs \
gnome-libs-devel \
libaio-devel \
libaio \
make \
openmotif21 \
xorg-x11-deprecated-libs-devel \
xorg-x11-deprecated-libs 5.Creating Oracle User Accounts
su - root
groupadd dba # group of users to be granted with SYSDBA system privilege
groupadd oinstall # group owner of Oracle files
useradd -c "Oracle software owner" -g oinstall -G dba oracle
passwd oracle /////////////////////////////////////////////////////////////////////////////////////////
JDK Skip this step for Oracle9iR2. I successfully installed Oracle9iR2 without installing JDK on the system. Oracle comes now with its own Java. This means that you don't have to execute the following steps which were required for older Oracle versions: Download JDK 1.3.1 or Blackdown 1.1.8_v3: (I usually used Blackdown)
http://www.blackdown.org
http://java.sun.com According to the JDK documentation, install JDK under /usr/local. Then create a symbolic link to the JDK under /usr/local/java:
su - root
bzip2 -dc jdk118_v3-glibc-2.1.3.tar.bz2 | tar xf - -C /usr/local
ln -s /usr/local/jdk118_v3 /usr/local/java /////////////////////////////////////////////////////////////////////////////////////////
6.Creating Oracle Directories
su - root
mkdir -p /u01/app/oracle/product/9.2.0
chown -R oracle.oinstall /u01
mkdir /var/opt/oracle
chown oracle.dba /var/opt/oracle
chmod 755 /var/opt/oracle 7.Setting Oracle Environments
As the oracle user execute the following commands:
# Set the LD_ASSUME_KERNEL environment variable only for Red Hat 9,
# RHEL AS 3, and RHEL AS 4 !!
# Use the "Linuxthreads with floating stacks" implementation instead of NPTL:
export LD_ASSUME_KERNEL=2.4.1 # for RH 9 and RHEL AS 3
export LD_ASSUME_KERNEL=2.4.19 # for RHEL AS 4
# Oracle Environment
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/9.2.0
export ORACLE_SID=test
export ORACLE_TERM=xterm
# export TNS_ADMIN= Set if sqlnet.ora, tnsnames.ora, etc. are not in $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
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
# Set shell search paths
export PATH=$PATH:$ORACLE_HOME/bin
I successfully installed Oracle9iR2 without setting the following CLASSPATH environment variable:
# CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
# CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
# export CLASSPATH
You can put these environment settings at the end of the ~oracle/.bash_profile file if you use bash. By this way you don't have to set the environment variables again when you login as "oracle", or when you switch to the user "oracle" by executing "su - oracle". 9.Starting runInstaller
Oracle no longer supports a character mode installer. Therefore, in order to execute runInstaller directly from a console of a machine you are logged into (in this example the node name where Oracle is running is called "oracleserver"), you need to set the DISPLAY environment variable. Before you do that, make sure that you also allow runInstaller on "oracleserver" to display X information on your Linux desktop machine (in this example, the PC name where you are running X Windows like KDE or GNOME is called "yourdesktop"), because programs running on remote machines cannot display information to your screen unless you give them the authority to do so. Note that the X display relink mechanism does not work for NT desktop machines unless you use Exceed
Before you run runInstaller, execute e.g. 'xterm' to see if your X setup is really working! If you install Oracle on your desktop PC and not on a remote node, then you can skip step 1 and 3.
Step 1: Allow "oracleserver" to display X information to your desktop PC "yourdesktop":
yourdesktop:user$ xhost +oracleserver
Step 2: Open a new window and login to the Oracle server "oracleserver" as root. This window will be used for mounting and unmounting the Oracle CDs.
oracleserver:$ su - root
oracleserver:root# mount /mnt/cdrom
Step 3: From the console of your Oracle server "oracleserver" where you will run runInstaller, execute the following commands:
oracleserver:$ su - oracle
oracleserver:oracle$ export DISPLAY=yourdesktop:0.0
Step 4: Now execute runInstaller as "oracle". Do not cd to /mnt/cdrom !!
oracleserver:oracle$ /mnt/cdrom/runInstaller 10.Fix nodeinfo
Now installation should proceed without any linking errors but you will get one error in the end: Parameter "nodeinfo" = NO_VALUE
Agent Service Failed In order to fix this, run the following for starting the wizard after setup has finished: netca & Now change into $ORACLE_HOME and run ./lsnrctl start.(oracle 监听进程) Check that the process is running: ps afx | grep LISTEN 11.Automating Database Startup and Shutdown for HP, Linux and Solaris (Optional)
a)Edit the /var/opt/oracle/oratab file for Solaris and /etc/oratab file for HP and Linux.
Database entries in the oratab file appears in the following format:
ORACLE_SID:ORACLE_HOME:{Y|N}
In the preceding command, Y or N specifies whether you want the dbstart and dbshut scripts to start up and shut down the database. For each database that you want to start up, find the ORACLE_SID entry identified by the sid in the first field. Change the last field for each to Y.
For Oracle Real Application Clusters installation, this entry appears in the following format:
DB_NAME:ORACLE_HOME:{Y|N}
In the preceding command, DB_NAME is the cluster database name. Y or N specifies whether you want the dbstart and dbshut scripts to start up and shut down the database. b)In the /etc/init.d directory, create a dbora script similar to the following, if it does not already exist. Be sure to give the full path of the dbstart utility. script dbora
#!/bin/bash
#chkconfig:2345 99 10
#description:Oracle 9i server ORA_HOME=/u01/app/oracle/product/9.2.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
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
;; '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 chkconfig --add dbora find /etc/rc.d/ -name '*dbora' -print 结果如下
/etc/rc.d/rc4.d/S99dbora
/etc/rc.d/rc0.d/K10dbora
/etc/rc.d/rc6.d/K10dbora
/etc/rc.d/rc1.d/K10dbora
/etc/rc.d/rc3.d/S99dbora
/etc/rc.d/rc2.d/S99dbora
/etc/rc.d/init.d/dbora
/etc/rc.d/rc5.d/S99dbora # ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
# ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
相关阅读 更多 +