charleschen的麦地

——SomeDay I Will Be Back!

导航

笔记:Oracle9i在linux下的安装步骤

Posted on 2006-12-30 16:47  charleschen  阅读(765)  评论(1编辑  收藏  举报

上周同学问我要Oracle9i在linux下的安装文档,本来以为没的了。

结果居然被我掘地三尺给找到了。其实这些东西网上多的是,ITPub上一堆闲人等着给人解释这方面的

问题,^_^.

特别推荐ITPub去年出的第一本书,收录了不少好文章,而且还可以在旧书店买到,(我的就是这样淘来的。

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

Setting Shared Memory 
For Oracle 9i (9.2.0) installation I had to increase the maximum shared memory size on my Linux server for all Red Hat versions. The Oracle Database Configuration Assistant displayed the following error message on my server:
ORA-27123: unable to attach to shared memory segment.
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

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
For more information on the "oinstall" group account, see When to use "OINSTALL" group during install of oracle. 
Creating Oracle Directories 
In this example, make sure that the /opt filesystem is large enough, see Oracle Disk Space for more information. If /opt is not on a separate filesystem, then make sure the root filesystem "/" has enough space. 
su - root
mkdir /home/opt/oracle
mkdir /home/opt/oracle/product
mkdir /home/opt/oracle/product/9.2.0
chown -R oracle.oinstall /home/opt/oracle
                                           
mkdir /var/opt/oracle
chown oracle.dba /var/opt/oracle
chmod 755 /var/opt/oracle



Setting Oracle Environments 

export ORACLE_BASE=/home/opt/oracle
export ORACLE_HOME=/home/opt/oracle/product/9.2.0
export ORACLE_SID=ahwt
export ORACLE_TERM=xterm
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export PATH=$PATH:$ORACLE_HOME/bin



Set the following Oracle environment variables before you start runInstaller. 

As the oracle user execute the following commands: 
# Set the LD_ASSUME_KERNEL environment variable only for Red Hat 9 and
# for Red Hat Enterprise Linux Advanced Server 3 (RHEL AS 3) !!
# Use the "Linuxthreads with floating stacks" implementation instead of NPTL:
export LD_ASSUME_KERNEL=2.4.1

# Oracle Environment
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/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". 
Starting runInstaller 
Before you continue, make sure you have set the Oracle environment variables, see above. 

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




Running Oracle Installation on RH 7.1, 7.2, 7.3, 8.0, 9, and on RH AS 2.1 
Keep in mind that you will get one or more errors here during the Oracle installation! See Oracle Installation Errors for more information.

This is how I answered the questions for the runInstaller:

- What would you like as the base directory (Inventory Location):
  /opt/oracle/oraInventory
- UNIX Group Name (permission for updating Oracle software):
  oinstall
  You could also use "dba" which I do not recommend for security reasons.
  For more information on the "oinstall" group account, see
  When to use "OINSTALL" group during install of oracle.
  
- Full path name for Oracle Home: 
  /opt/oracle/product/9.2.0
etc.