RHEL4上安裝oracle9i-9.2.0.4

etzhang發表於2007-08-01
1、預設安裝RHEL4。
2、安裝telnet與rsh服務,並設定。
3、安裝系統所差的RPM。
[@more@]
1、預設安裝RHEL4。
2、安裝telnet與rsh服務,並設定。
3、安裝系統所差的RPM。
查年需要的以下RPM包有沒有安裝,未安裝的用rpm -Uvh 安裝。
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
除compat-oracle-rhel4-1.0-5.i386.rpm、compat-libcwait-2.0-2.i386.rpm在ORACLE的p4198954_21_LINUX.zip補丁包裡。其它都在Linux系統安裝盤的Disk3與Disk4裡。
4、安裝JDK
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)


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
或者用Sun公司的JDK:j2sdk-1_3_1-linux-i386.bin。將j2sdk-1_3_1-linux-i386.bin複製至/usr/local,執行/usr/local/j2sdk-1_3_1-linux-i386.bin。
ln -s /usr/local/jdk1.3.1 /usr/local/java
5、修改配置檔案# vi /etc/sysctl.conf,新增
# Set kernel for Oracle
kernel.shmall=2097152
kernel.shmmax=268435456
kernel.shmmni=4096
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000
退出後執行# /sbin/sysctl -p
修改#vi /etc/security/limits.conf檔案,新增:
oracle soft nofile 4096
oracle hard nofile 63536
oracle soft nproc 2047
oracle hard nproc 16384
6、新建使用者組和使用者oracle並設定密碼:
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
passwd oracle
7、準備oracle的安裝及資料儲存:
例如:我建立了一個dagavg(包含三個LV--/dev/datavg/software /dev/datavg/data /dev/datavg/app)
修改/etc/fstab,新增
/dev/datavg/software /software ext3 defaults 1 2
/dev/datavg/app /u02 ext3 defaults 1 2
/dev/datavg/data /u01 ext3 defaults 1 2
su - root
mkdir -p /u01/oradata
mkdir -p /u02/app/oracle/product/9.2.0
chown -R oracle.oinstall /u02
chown -R oracle.dba /u01
chmod 755 /u01
8、設定oracle環境變數:
su - oracle
cd
vi .bash_profile
新增:
# Set the LD_ASSUME_KERNEL environment variable only for RHEL AS 4 !!
# Use the "Linuxthreads with floating stacks" implementation instead of NPTL:
export LD_ASSUME_KERNEL=2.4.19 # for RHEL AS 4
# Oracle Environment
export ORACLE_BASE=/u02/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_AMERICA.zhs16gbk;
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export ORACLE_OWNER=oracle
# Set shell search paths
export PATH=$PATH:$ORACLE_HOME/bin
# Set the following CLASSPATH environment variable:
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH

9、解壓Oracle安裝檔案。
zcat ship_9204_linux_disk1.cpio.gz | cpio -idmv
zcat ship_9204_linux_disk2.cpio.gz | cpio -idmv
zcat ship_9204_linux_disk3.cpio.gz | cpio -idmv
10、oracle進入桌面環境,執行runInstaller進行安裝。
安裝過程中可能要求root執行一些指令碼。
11、oracle安裝補丁:
Download the patch 3948480 (Oracle9i Patch Set Release 2 (9.2.0.6) Patch Set 5) from and execute the following commands:
su - oracle
$ cp p3948480_9206_LINUX.zip /tmp
$ cd /tmp
$ unzip p3948480_9206_LINUX.zip
Archive: p3948480_9206_LINUX.zip
creating: Disk1/
creating: Disk1/stage/
creating: Disk1/stage/Patches/
...

Now download the patch 4188455 from .
This patch is needed for launching the runInstaller that came with the patch 3948480 we just downloaded above.
su - oracle
$ cp p4188455_10103_LINUX.zip /tmp
$ cd /tmp
$ unzip p4188455_10103_LINUX.zip
Archive: p4188455_10103_LINUX.zip
inflating: oraparam.ini
inflating: README.txt
$
The /tmp/oraparam.ini file will now be used for launching the runInstaller that came with the patch 3948480.
To patch the runInstaller itself, run:
su - oracle
$ echo $LD_ASSUME_KERNEL
2.4.19
$ /tmp/Disk1/install/runInstaller -paramFile /tmp/oraparam.ini
- Welcome Screen: Click Next
- File Locations: Use default values (in my example: /tmp/Disk1/stage/products.xml)
- Available Products: Select "Oracle Universial Installer 10.1.0.3.0 !"
- Summary: Click Install
- At the end of the installation, you must exit runInstaller!

Ensure that no Oracle processes are running:
ps -ef | grep ora

Now to patch Oracle9iR2, run:
su - oracle
$ echo $LD_ASSUME_KERNEL # it is important that this variable is set!
2.4.19
$ /tmp/Disk1/install/runInstaller -paramFile /tmp/oraparam.ini
- Welcome Screen: Click Next
- File Locations: Use default values (in my example: /tmp/Disk1/stage/products.xml)
- Available Products: Select "Oracle 9iR2 Patchset 9.2.0.6.0"
- Summary: Click Install
When are asked to run root.sh, run it before you click Continue
- At the end of the installation, exit runInstaller.

After the 9.2.0.6 patchset has been applied, download the patch 4190568 from . Also, download the opatch utility for release
10.1.0.2 (patch 2617419) from .
To install opatch, run:
su - oracle
$ cp p2617419_10102_GENERIC.zip /tmp
$ cd /tmp
$ unzip p2617419_10102_GENERIC.zip
$ cp -a /tmp/OPatch/ $ORACLE_HOME

To apply the 4190568 patch, run
su - oracle
$ unzip p4190568_9206_LINUX.zip
$ cd 4193454
$ export PATH=$PATH:$ORACLE_HOME/OPatch
$ opatch apply
最新的補丁已經到了p4547809_92080_LINUX.zip,download the opatch from .
$ cp p4547809_92080_LINUX.zip /tmp
$ unzip p4547809_92080_LINUX.zip
$ /tmp/Disk1/runInstaller
- Welcome Screen: Click Next
- File Locations: Use default values (in my example: /tmp/Disk1/stage/products.xml)
- Available Products: Select "Oracle 9iR2 Patchset 9.2.0.8.0"
- Summary: Click Install
When are asked to run root.sh, run it before you click Continue
- At the end of the installation, exit runInstaller.
Startup and Shutdown of the Oracle 9i Database
sqlplus:
svrmgrl is not supported any more. You can now do everything with sqlplus.
For instance, to startup the database, run the following commands:
oracle$ agentctl start
oracle$ lsnrctl start
oracle$ $ORACLE_HOME/Apache/Apache/apachectl start
oracle$ sqlplus /nolog
SQL> connect / as sysdba
SQL> startup
The slash connects you to the schema owned by SYS. So in this example you will be connected to the schema owned by SYS with the privilege SYSDBA. SYSDBA
gives you the following privileges:
- sysoper privileges WITH ADMIN OPTION
- create database
- recover database until
$ORACLE_HOME/bin/dbstart and $ORACLE_HOME/bin/dbshut
You can also use $ORACLE_HOME/bin/dbstart to startup the database, and $ORACLE_HOME/bin/dbshut to shutdown the database. You can place
$ORACLE_HOME/bin/dbstart into the /etc/rc.d/rc.local boot script to automatically bring up the database at system boot time. To get $ORACLE_HOME/bin/dbstart
and $ORACLE_HOME/bin/dbshut working, you need to change the third field for your Oracle SID in /etc/oratab from "N" to "Y".
For example, for the Oracle SID "test" I changed the line in /etc/oratab from:
test:/u01/app/oracle/product/9.2.0:N
to read:
test:/u01/app/oracle/product/9.2.0:Y
In some cases for 9.2.0 I also had to copy the init file for my SID "test" from /u01/app/oracle/admin/test/pfile to $ORACLE_HOME/dbs to get dbstart and
dbshut working:
cp /u01/app/oracle/admin/test/pfile/inittest.ora.642002224936 $ORACLE_HOME/dbs/inittest.ora

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/743764/viewspace-929901/,如需轉載,請註明出處,否則將追究法律責任。

相關文章