|
装了次 Oracle 8.1.7.0.4, 剧痛苦。把过程记下来,供大家参考。如有错误,望大虾门指正。
Installing Oracle 8.1.7.0.4 on RedHat Advanced Server 2.1
by shengze, based on ......
This article is migrated from a topic found from WWW, it's url is ???
It was an awful experience. I hope the group that writes the database is different from the group that writes the installer, because the installer group sucks. Click through for the details.
Step 0 - Download and Unpack Oracle
Download two files from Oracle's site: linux81701.tar and glibc-2.1.3-stubs.tar.gz. Make sure they have the following MD5 checksums:
bb6cee85bd78c91cfd4d02224b99adc5 linux81701.tar
7afc4a65f7d5c456e5a323b453ece2c1 glibc-2.1.3-stubs.tar.gz
Unpack Oracle into /opt/oracle:
cd /opt/oracle/
tar xf linux81701.tar
Do not unpack the glibc stubs file yet.
Step 1 - Install Prerequisites
Since Advanced Server comes with glibc 2.2 and Oracle needs glibc 2.1, you'll need to download compat versions of the various libraries:
up2date -u compat-glibc
up2date -u compat-egcs
up2date -u compat-libstdc++
up2date -u compat-libs
or they can be found from http://rpm.pbone.net/index.php3/stat/14/idka/56/datan/2002-09-29 seperately.
Go to http://www.blackdown.org/ to download jdk118_v3-glibc-2.1.3.tar.bz2, install it to directory /usr/local/java
Step 2 - Setup Users and Directory Permissions
Create the Oracle user and groups:
groupadd dba
groupadd oracle
groupadd oinstall
useradd oracle -g oinstall -G dba,oracle
Create the directory where Oracle will be installed and give it appropriate permissions:
mkdir /usr/oracle
chown oracle.dba /usr/oracle
Step 3 - Setup Environment Variables
Append the following lines to the oracle user's .profile:
export LD_ASSUME_KERNEL=2.2.5
source /usr/i386-glibc21-linux/bin/i386-glibc21-linux-env.sh
umask 022
export ORACLE_BASE=/usr/oracle
export ORACLE_HOME=$ORACLE_BASE/product/8.1.7
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/ctx/lib:/usr/bin:/bin:/usr/local/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib:/usr/local/lib:$LD_LIBRARY_PATH
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export ORACLE_SID=dev
Step 4 - Symlink to Compat GCC
We need to symlink out to the correct GCC to make Oracle uses it when it compiles anything:
su - oracle
cd $ORACLE_HOME
mkdir bin
cd bin
ln -s /usr/bin/i386-glibc21-linux-gcc cc
ln -s /usr/bin/i386-glibc21-linux-gcc gcc
Step 5 - Install Oracle
Go ahead and install Oracle as user oracle with the default settings. If any errors occur during installation be sure to hit Ignore and continue with the installation:
su - oracle
cd /opt/oracle/Disk1
./runInstaller
Near the end of the installation, the installer will prompt you to run $ORACLE_HOME/root.sh as root. This file has two errors in it, so before you run it make the following changes:
Change line 98 from:
SED=/usr/local/bin/sed
to:
SED=/bin/sed
[thanks to 'lex' for pointing this out]
Change line 102 from:
RMF=/bin/rm -f
to:
RMF="/bin/rm -f"
Change line 156 from:
RUID=`/usr/bin/id|$AWK -F\( '{print $2}'|$AWK -F\) '{print $1}`
to:
RUID=`/usr/bin/id|$AWK -F\( '{print $2}'|$AWK -F\) '{print $1}'`
At the end of the installation, the installer will try to run three configuration wizards: the Net8 Configuration Assistant, the Oracle Database Configuration Assistant, and the Apache Web Server Configuration Assistant. You should stop all of them. You will run them later. After this your installer is done and you should exit it.
Step 6 - Install Oracle
update default jre with the one from http://www.blackdown.com.
$cd $ORACLE_HOME/jre
$mv 1.1.8 1.1.8.org
$link -s /usr/local/java 1.1.8
$cd 1.1.8/lib
$cp classes.zip rt.jar
Step 7 - Install Oracle patch 8.1.7.0.4
Install patch as instructed in manuals.
Step 8 - Install GLIBC Stubs
Now, you should install the glibc stubs (still as oracle):
su - oracle
cd $ORACLE_HOME
tar xfz /opt/oracle/glibc-2.1.3-stubs.tar.gz
./setup_stubs.sh
cd bin
relink all
Step 7 - Run the Various Assistants
Now, you can run the Net8 Configuration Assistant and the Database Configuration Assistant
su - oracle
$ORACLE_HOME/bin/netasst
$ORACLE_HOME/bin/dbassist
(I experienced a segment error when running $ORACLE_HOME/bin/netca)
Step 8 - Create a Shutdown/Startup Service
Create the file /etc/rc.d/init.d/oracle with the following contents:
#!/bin/sh
#
# Startup script for Oracle
#
# chkconfig: 345 79 11
# description: Oracle.
# processname: oracle
# pidfile: /var/run/oracle.pid
#
# Source function library.
. /etc/rc.d/init.d/functions
ORACLE_HOME=/usr/oracle/product/8.1.7
ORACLE_USER=oracle
# See how we were called.
case "$1" in
start)
echo -n "Starting Oracle Database Server: "
daemon --user=$ORACLE_USER $ORACLE_HOME/bin/dbstart
success "Starting Oracle Database Server: "
echo
echo -n "Starting Oracle TNS Listener: "
daemon --user=$ORACLE_USER $ORACLE_HOME/bin/lsnrctl start >> /dev/null
success "Starting Oracle TNS Listener: "
echo
echo -n "Starting Oracle HTTP Server: "
daemon --user=$ORACLE_USER $ORACLE_HOME/Apache/Apache/bin/apachectl start
success "Starting Oracle HTTP Server: "
echo
touch /var/lock/subsys/oracle
;;
stop)
echo -n "Stopping Oracle Database Server: "
daemon --user=$ORACLE_USER $ORACLE_HOME/bin/dbshut
success "Stopping Oracle Database Server: "
echo
echo -n "Stopping Oracle TNS Listener: "
daemon --user=$ORACLE_USER $ORACLE_HOME/bin/lsnrctl stop >> /dev/null
success "Stopping Oracle TNS Listener: "
echo
echo -n "Stopping Oracle HTTP Server: "
daemon --user=$ORACLE_USER $ORACLE_HOME/Apache/Apache/bin/apachectl stop
success "Stopping Oracle HTTP Server: "
echo
rm -f /var/lock/subsys/oracle
rm -f /var/run/oracle.pid
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
Set the appropriate owner and mode:
chown root.root /etc/rc.d/init.d/oracle
chmod 0755 /etc/rc.d/init.d/oracle
Now you can start Oracle by typing:
service oracle start
You can stop Oracle by typing:
service oracle stop
Note that only the databases in /etc/oratab with the last field set to Y will start and stop automatically. The following line, for example, will automatically start and stop the dev database:
dev:/usr/oracle/product/8.1.7:Y
Step 9 - Enjoy (or not)
You're done. Congrats. |
|