Installing Oracle 9i R2 (9.2.0.1.0) on Red Hat 9 This is the installation HOWTO for Oracle 9.2 on RedHat Linux 9. Please remember that Oracle 9.2 is not certified for RedHat 9 and this combination should not be endorsed in production environments. For a full list of Oracle certified environments, check out the Oracle certification matrix. 1. Creating users and groups: ------------------------- Become root and execute the following commands [roko@miniroko] su -[root@miniroko]# groupadd oinstall [root@miniroko]# groupadd dba [root@miniroko]# useradd -g oinstall -G dba oracle [root@miniroko]# passwd oracle2. Creating directories. -------------------------- Oracle recommends OFA - Optimal Flexible Architecture directory structure, but we will install everything under /opt/ora9: [root@miniroko]# mkdir -p /opt/ora9/product/9.2 [root@miniroko]# chown -R oracle.oinstall /opt/ora9/* [root@miniroko]# mkdir /var/opt/oracle [root@miniroko]# chown oracle.dba /var/opt/oracle [root@miniroko]# chown oracle.dba /opt/ora93. Preinstallation (system configuration): --------------------------- 3.1 Install these compatibility libraries: compat-gcc-7.3-2.96.118.i386.rpm compat-libgcj-7.3-2.96.118.i386.rpm compat-libgcj-devel-7.3-2.96.118.i386.rpm nss_db-compat-2.2-20.i386.rpm I found them all using Synaptic, a graphical tool for updating your RH system. To install synaptic, first download Apt binary RPM package for RH9 from http://apt.freshrpms.net/ and then do (as root):[root@miniroko]# rpm -Uvh apt-0.5.5cnc5-fr2.i386.rpm [root@miniroko]# apt-get install synaptic3.2 Set kernel params to be correct at startup: Append these lines to /etc/sysctl.conf kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.shmall = 2097152 kernel.sem = 250 32000 128 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000Append these lines into /etc/security/limits.conf oracle soft nofile 65536 oracle hard nofile 65536 oracle soft nproc 16384 oracle hard nproc 16384REBOOT the system so the kernel changes can take effect, or if rebooting is not an option, you can change the kernel params at runtime by issuing: [root@miniroko]# echo 250 32000 100 128 > /proc/sys/kernel/sem [root@miniroko]# echo 536870912 > /proc/sys/kernel/shmmax [root@miniroko]# echo 4096 > /proc/sys/kernel/shmmni [root@miniroko]# echo 2097152 > /proc/sys/kernel/shmall [root@miniroko]# echo 65536 > /proc/sys/kernel/fs/file-max [root@miniroko]# echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range4. Preinstallation (oracle environment): ---------------------------- Login as oracle user: su - oraclePut the following lines in ~/.bashrc:#oracle 9i export ORACLE_BASE=/opt/ora9 export ORACLE_HOME=/opt/ora9/product/9.2 export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH export ORACLE_OWNER=oracle export ORACLE_SID=ora9i export ORACLE_TERM=vt100 export LD_ASSUME_KERNEL=2.4.1 export THREADS_FLAG=native export LD_LIBRARY_PATH=/opt/ora9/product/9.2/lib:$LD_LIBRARY_PATH export PATH=/opt/ora9/product/9.2/bin:$PATH # # change this NLS settings to suit your country: # example: # german_germany.we8iso8859p15, american_america.we8iso8859p2 etc. # export NLS_LANG='croatian_croatia.ee8iso8859p2'
If you want other national settings (these are croatian), consult the supported settings here, and change the NLS_LANG variable accordingly. 5. Installation: ------------------------Login as root and allow user oracle to write to X display: su - xhost +Login to oracle user: su - oracleStart the installation. Do not switch to your CD-ROM mount directory because you will not be able to unmount the 1st Cd to insert others when asked. /mnt/cdrom/install/linux/runInstallerDuring the installation, Oracle will ask you to insert other disks. Open up a new console, unmount the current disk with umount /dev/cdrom (as root), replace the disk. If Redhat9 does not mount it automagically, mount it yourself with mount /dev/cdrom Your installation will produce two errors. First, you will see an error dialog informing about problems with ins_oemagent.mk. Choose ignore on this one, we will fix it in postinstallation.Second dialog will inform you about an "Error in invoking target install of makefile $ORACLE_HOME/ctx/lib/ins_ctx.mk". When that happens, open up a new console and login as oracle user. Execute the following commands:[oracle@miniroko oracle]$ cd $ORACLE_HOME/install [oracle@miniroko install]$ tail make.logYou will see a line such as this: gcc -o ctxhx -L/opt/ora9/product/9.2/ctx/lib/ -L/opt/ora9/product/9.2/lib/ -L/opt/ora9/product/9.2/lib/stubs/ /opt/ora9/product/9.2/ctx/lib/ctxhx.o -L/opt/ora9/product/9.2/ctx/lib/ -lm -lsc_ca -lsc_fa -lsc_ex -lsc_da -lsc_ut -lsc_ch -lsc_fi -lctxhx -lc -Wl,-rpath,/opt/ora9/product/9.2/ctx/lib -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9Copy this line, add -ldl at the end and run it in $ORACLE_HOME/bin [oracle@miniroko]$ cd $ORACLE_HOME/bin [oracle@miniroko bin]$ gcc -o ctxhx -L/opt/ora9/product/9.2/ctx/lib/ -L/opt/ora9/product/9.2/lib/ -L/opt/ora9/product/9.2/lib/stubs/ /opt/ora9/product/9.2/ctx/lib/ctxhx.o -L/opt/ora9/product/9.2/ctx/lib/ -lm -lsc_ca -lsc_fa -lsc_ex -lsc_da -lsc_ut -lsc_ch -lsc_fi -lctxhx -lc -Wl,-rpath,/opt/ora9/product/9.2/ctx/lib -lnls9 -lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9 -ldlNow hit the ignore button on the dialog and the installation will continue. At the end Oracle installation will probably inform you that agents failed to start. Choose ignore on this one, we will fix it later 6. Postinstall --------------------------- Open up a console and login as oracle user. Execute these lines: [oracle@miniroko oracle]$ cd $ORACLE_HOME/network/lib [oracle@miniroko lib]$ make -f ins_net_client.mk installThen edit the $ORACLE_HOME/ctx/lib/ins_ctx.mk file so that lines 13-14 change from: ctxhx: $(CTXHXOBJ) $(LINK) $(CTXHXOBJ) $(INSO_LINK)to ctxhx: $(CTXHXOBJ) $(LINK) -ldl $(CTXHXOBJ) $(INSO_LINK)Then do a [oracle@miniroko lib]$ make -f $ORACLE_HOME/ctx/lib/ins_ctx.mk installNow you should be able to start your agents with [oracle@miniroko lib]$ /opt/ora9/product/9.2/bin/agentctl start7. Starting the database ------------------------------ The easiest way is to create a startup/shutdown script as such -- #!/bin/bash # # (c) [email protected] # # name: /etc/rc.d/init.d/ora9 # description: starts and stops oracle 9i database, TNS listener # http server, and fixes kernel parameters for oracle #oracle environment export ORACLE_HOME=/opt/ora9/product/9.2 export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH export NLS_LANG='croatian_croatia.ee8iso8859p2' export ORACLE_SID=tisexport DISPLAY=:0 oracle_user=oracle
# see how we're called
case $1 in start) # fix kernel parameters echo 250 32000 100 128 > /proc/sys/kernel/sem echo 536870912 > /proc/sys/kernel/shmmax echo 4096 > /proc/sys/kernel/shmmni echo 2097152 > /proc/sys/kernel/shmall echo 65536 > /proc/sys/kernel/fs/file-max echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range # start listener, apache and database su - "$oracle_user"<<EOO lsnrctl start apachectl start sqlplus /nolog<<EOS connect / as sysdba startup EOS EOO ;;
stop) # stop listener, apache and database su - "$oracle_user"<<EOO lsnrctl stop apachectl stop sqlplus /nolog<<EOS connect / as sysdba shutdown immediate EOS EOO ;;
*) echo "Usage: ora9 [start|stop]" ;;
esac-- Just make sure you change the ORACLE_SID to your SID. You can copy that script to your /etc/rc.d/init.d directory or link it from your runlevel startup directory (e.g. /etc/rc.d/rc5.d) to make sure Oracle is started upon booting the machine, and stopped before shutting down. Alternativly you can start and stop it directly with /etc/rc.d/init.d/ora9 start|stop That's it, good luck -- Roko Roic [email protected] http://codah.net
如果解决了,请告诉我一下.谢了.....
我的LINUX 装的是个人版的,我想重装一个服务器的试一下.
export LD_ASSUME_KERNEL=2.4.1 (或2.4.8 ?)
然后runInstaller就可以起来了
This is the installation HOWTO for Oracle 9.2 on RedHat Linux 9. Please remember that Oracle 9.2 is not certified for RedHat 9 and this combination should not be endorsed in production environments. For a full list of Oracle certified environments, check out the Oracle certification matrix. 1. Creating users and groups:
-------------------------
Become root and execute the following commands
[roko@miniroko] su -[root@miniroko]# groupadd oinstall
[root@miniroko]# groupadd dba
[root@miniroko]# useradd -g oinstall -G dba oracle
[root@miniroko]# passwd oracle2. Creating directories.
--------------------------
Oracle recommends OFA - Optimal Flexible Architecture directory structure, but we will install everything under /opt/ora9:
[root@miniroko]# mkdir -p /opt/ora9/product/9.2
[root@miniroko]# chown -R oracle.oinstall /opt/ora9/*
[root@miniroko]# mkdir /var/opt/oracle
[root@miniroko]# chown oracle.dba /var/opt/oracle
[root@miniroko]# chown oracle.dba /opt/ora93. Preinstallation (system configuration):
---------------------------
3.1 Install these compatibility libraries:
compat-gcc-7.3-2.96.118.i386.rpm
compat-libgcj-7.3-2.96.118.i386.rpm
compat-libgcj-devel-7.3-2.96.118.i386.rpm
nss_db-compat-2.2-20.i386.rpm
I found them all using Synaptic, a graphical tool for updating your RH system. To install synaptic, first download Apt binary RPM package for RH9 from http://apt.freshrpms.net/ and then do (as root):[root@miniroko]# rpm -Uvh apt-0.5.5cnc5-fr2.i386.rpm
[root@miniroko]# apt-get install synaptic3.2 Set kernel params to be correct at startup: Append these lines to /etc/sysctl.conf
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 128 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000Append these lines into /etc/security/limits.conf
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384REBOOT the system so the kernel changes can take effect, or if rebooting is not an option, you can change the kernel params at runtime by issuing:
[root@miniroko]# echo 250 32000 100 128 > /proc/sys/kernel/sem
[root@miniroko]# echo 536870912 > /proc/sys/kernel/shmmax
[root@miniroko]# echo 4096 > /proc/sys/kernel/shmmni
[root@miniroko]# echo 2097152 > /proc/sys/kernel/shmall
[root@miniroko]# echo 65536 > /proc/sys/kernel/fs/file-max
[root@miniroko]# echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range4. Preinstallation (oracle environment):
----------------------------
Login as oracle user:
su - oraclePut the following lines in ~/.bashrc:#oracle 9i
export ORACLE_BASE=/opt/ora9
export ORACLE_HOME=/opt/ora9/product/9.2
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=ora9i
export ORACLE_TERM=vt100
export LD_ASSUME_KERNEL=2.4.1
export THREADS_FLAG=native
export LD_LIBRARY_PATH=/opt/ora9/product/9.2/lib:$LD_LIBRARY_PATH
export PATH=/opt/ora9/product/9.2/bin:$PATH
#
# change this NLS settings to suit your country:
# example:
# german_germany.we8iso8859p15, american_america.we8iso8859p2 etc.
#
export NLS_LANG='croatian_croatia.ee8iso8859p2'
If you want other national settings (these are croatian), consult the supported settings here, and change the NLS_LANG variable accordingly. 5. Installation:
------------------------Login as root and allow user oracle to write to X display:
su -
xhost +Login to oracle user:
su - oracleStart the installation. Do not switch to your CD-ROM mount directory because you will not be able to unmount the 1st Cd to insert others when asked. /mnt/cdrom/install/linux/runInstallerDuring the installation, Oracle will ask you to insert other disks. Open up a new console, unmount the current disk with umount /dev/cdrom (as root), replace the disk. If Redhat9 does not mount it automagically, mount it yourself with mount /dev/cdrom
Your installation will produce two errors.
First, you will see an error dialog informing about problems with ins_oemagent.mk. Choose ignore on this one, we will fix it in postinstallation.Second dialog will inform you about an "Error in invoking target install of makefile $ORACLE_HOME/ctx/lib/ins_ctx.mk".
When that happens, open up a new console and login as oracle user. Execute the following commands:[oracle@miniroko oracle]$ cd $ORACLE_HOME/install
[oracle@miniroko install]$ tail make.logYou will see a line such as this:
gcc -o ctxhx -L/opt/ora9/product/9.2/ctx/lib/ -L/opt/ora9/product/9.2/lib/
-L/opt/ora9/product/9.2/lib/stubs/ /opt/ora9/product/9.2/ctx/lib/ctxhx.o
-L/opt/ora9/product/9.2/ctx/lib/ -lm -lsc_ca -lsc_fa -lsc_ex -lsc_da -lsc_ut
-lsc_ch -lsc_fi -lctxhx -lc -Wl,-rpath,/opt/ora9/product/9.2/ctx/lib -lnls9
-lcore9 -lnls9 -lcore9 -lnls9 -lxml9 -lcore9 -lunls9 -lnls9Copy this line, add -ldl at the end and run it in $ORACLE_HOME/bin
[oracle@miniroko]$ cd $ORACLE_HOME/bin
[oracle@miniroko bin]$ gcc -o ctxhx -L/opt/ora9/product/9.2/ctx/lib/
-L/opt/ora9/product/9.2/lib/ -L/opt/ora9/product/9.2/lib/stubs/
/opt/ora9/product/9.2/ctx/lib/ctxhx.o -L/opt/ora9/product/9.2/ctx/lib/
-lm -lsc_ca -lsc_fa -lsc_ex -lsc_da -lsc_ut -lsc_ch -lsc_fi -lctxhx -lc
-Wl,-rpath,/opt/ora9/product/9.2/ctx/lib -lnls9 -lcore9 -lnls9 -lcore9
-lnls9 -lxml9 -lcore9 -lunls9 -lnls9 -ldlNow hit the ignore button on the dialog and the installation will continue.
At the end Oracle installation will probably inform you that agents failed to start. Choose ignore on this one, we will fix it later 6. Postinstall
---------------------------
Open up a console and login as oracle user. Execute these lines:
[oracle@miniroko oracle]$ cd $ORACLE_HOME/network/lib
[oracle@miniroko lib]$ make -f ins_net_client.mk installThen edit the $ORACLE_HOME/ctx/lib/ins_ctx.mk file so that lines 13-14 change from:
ctxhx: $(CTXHXOBJ)
$(LINK) $(CTXHXOBJ) $(INSO_LINK)to
ctxhx: $(CTXHXOBJ)
$(LINK) -ldl $(CTXHXOBJ) $(INSO_LINK)Then do a
[oracle@miniroko lib]$ make -f $ORACLE_HOME/ctx/lib/ins_ctx.mk installNow you should be able to start your agents with
[oracle@miniroko lib]$ /opt/ora9/product/9.2/bin/agentctl start7. Starting the database
------------------------------
The easiest way is to create a startup/shutdown script as such
--
#!/bin/bash
#
# (c) [email protected]
#
# name: /etc/rc.d/init.d/ora9
# description: starts and stops oracle 9i database, TNS listener
# http server, and fixes kernel parameters for oracle
#oracle environment
export ORACLE_HOME=/opt/ora9/product/9.2
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH
export NLS_LANG='croatian_croatia.ee8iso8859p2'
export ORACLE_SID=tisexport DISPLAY=:0
oracle_user=oracle
# see how we're called
start)
# fix kernel parameters
echo 250 32000 100 128 > /proc/sys/kernel/sem
echo 536870912 > /proc/sys/kernel/shmmax
echo 4096 > /proc/sys/kernel/shmmni
echo 2097152 > /proc/sys/kernel/shmall
echo 65536 > /proc/sys/kernel/fs/file-max
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range # start listener, apache and database
su - "$oracle_user"<<EOO
lsnrctl start
apachectl start
sqlplus /nolog<<EOS
connect / as sysdba
startup
EOS
EOO
;;
stop)
# stop listener, apache and database
su - "$oracle_user"<<EOO
lsnrctl stop
apachectl stop
sqlplus /nolog<<EOS
connect / as sysdba
shutdown immediate
EOS
EOO
;;
*)
echo "Usage: ora9 [start|stop]"
;;
esac--
Just make sure you change the ORACLE_SID to your SID.
You can copy that script to your /etc/rc.d/init.d directory or link it from your runlevel startup directory (e.g. /etc/rc.d/rc5.d) to make sure Oracle is started upon booting the machine, and stopped before shutting down.
Alternativly you can start and stop it directly with /etc/rc.d/init.d/ora9 start|stop
That's it, good luck --
Roko Roic
[email protected]
http://codah.net
希望对你也有用。