|
发表于 2002-12-11 17:35:37
|
显示全部楼层
Oracle 9i (9.0.1) on RedHat 7.1 and 7.2 installation HowTo
Copyright (c) 2001 by Robert Schmakel, this document is governed by The General Public License (GPL)
This HowTo is not intended to replace the Oracle Installation Guides, but to assist those trying to install Oracle on Red Hat 7.1 and 7.2, which isn't exactly documented by Oracle. According to a press release from Red Hat in September of 2001, RH 7.1 has also been certified; however I have yet to find any further details or information other than the press release. Keep in mind that Oracle 9i has not been certified on Red Hat 7.2 at the time this paper was written, therefore, you may want / need to take this into consideration before continuing with the installation.
1 Prerequisites
1.1 Hardware requirements
All values listed are according to the Installation Guide from Oracle, I have included what I was using when testing this procedure in parenthesis.
 For the server you need at least 512MB of RAM (384MB)
 You need twice the amount of RAM or at least 400MB of Swap Space (1488884),
 At least 2.5GB for the software installation plus another 1GB for the starter database, if included in the install,
 You also need at least 400MB of disk space in the /tmp directory. If you do not have 400MB of free space in the /tmp directory, you can create a temporary directory somewhere else and set the environment variables TEMP and TMPDIR to point to the new location.
1.2 Software requirements
All values listed are according to the Installation Guide from Oracle, I have included what I was using when testing this procedure in parenthesis.
Oracle 9i is certified on SuSE 7.1 with kernel 2.4.4 and the operation system library GNU lib C 2.2 and according to Red Hat in their press release from September, also with Red Hat 7.1, but there was no further information available (kernel 2.4.2, the one that comes with Red Hat Linux version 7.1).
 Window Manager (fvwm, Xwindows, ...)
 JDK 1.1.8 is required if installing the Apache version delivered with Oracle.
 You will need to downgrade the "binutils" package to the version 2.10.0.18-1. This version was delivered with Red Hat 7.0 and can be downloaded from Red Hat, http://www.redhat.com.
1.3 JDK Installation
If you are going to be installing the Oracle HTTP [Apache] component utilities JDK 1.1.8 v3 is required. Ensure that you have JDK 1.1.8 v3 installed. According to the Oracle documentation, the Blackdown JDK version 1.1.8_v3 is recommended. You can get JDK 1.1.8_v3 from:
ftp://ftp.openlinux.org/pub/mirr ... /JDK-1.1.8/i386/v3/
The file you need is called jdk118_v3-glibc-2.1.3.tar.bz2.
You can install the above file by entering the command:
cp jdk118_v3-glibc-2.1.3.tar.bz2 /usr/local
cd /usr/local
tar -xjvf jdk118_v3-glibc-2.1.3.tar.bz2
With the JDK installed, you then need to create a symbolic link so the Oracle installer can find it:
ln -s /usr/local/jdk118_v3 /usr/local/java
That is all there is to the jdk installation.
1.4 Kernel parameters
You need to make sure that the shared memory parameters are set to at least the values required by Oracle. You may be able to install and run 9i without doing this, but you may run into problems later. It is recommended that these parameters are set properly at the very beginning.
Here are the guidelines for these values according to the Oracle installation procedures (these are the minimum values):
SEMMNI = 100
SEMMSL = 100
SEMMNS = 256
SEMOPM = 100
SEMVMX = 32767
and
SHMMAX = One-half the size of your system's physical memeory
SHMMIN = 1
SEMMNI = 100
SEMSEG = 4096
You can set some of the kernel parameters dynamically and others you need to build a new kernel in order to change. To set the kernel parameters when building a new kernel, you need to edit the shared memory file:
/usr/src/linux/include/asm/shmparam.h
and the semaphore file:
/usr/src/linux/include/linux/sem.h.
Remember, this requires that you build a new kernel, so make sure that you have the necessary documentation and source files to complete this task. You can also try dynamic kernel parameters by editing /etc/sysctl.conf and activating these dynamic kernel parameters with sysctl -p.
The current values of kernel parameters that can be changed dynamically can be found in the pseudo files located in the directory /proc/sys/kernel. To check and change these kernel parameters dynamically, you can follow the following steps:
1. Log in as the user root.
2. Go to the /proc/sys/kernel directory.
3. Check how the semaphore parameter values are currently set by looking at the sem file using the program cat. For example:
# cat sem
The result will be a list of the values for the parameters SEMMSL, SEMMNS, SEMOPM and SEMMNI respectively. This is the result that I got:
250 32000 32 128
In this example, 250 is the SEMMSL parameter value, 32000 is the SEMMNS parameter value, 32 is the SEMOPM parameter value and 128 is the SEMMNI parameter value.
4. To modify the parameter values, use the following command:
# echo SEMMSL_value SEMMNS_value SEMOPM_value SEMMNI_value > sem
which means that we need to enter the following command to meet the requirements set forth by Oracle (the values that already exceed the required minimum should not be changed):
# echo 250 32000 100 128 > sem
Remember, all of the above parameters must be entered in order!
5. To check the shared memory parameter values for SHMMAX and SHMMNI, you can also use the cat utility. For example:
# cat shmmax
or
# cat shmmni
The results will just be one number per command. These are the results that I got: 33554432 and 4096 respectively.
6. You can modify the shared memeory parameter by using the echo command similar to 4. above. For example, to change the SHMMAX parameter to half of my system's memory (384MB), you would enter the command:
# echo 201326592 > shmmax
7. You need to enter these values in the file /etc/sysctl.conf in order for them to take effect when the server is restarted, for example:
kernel.sem = 250 32000 100 128
kernel.shmmax = 201326592
If you stick to (or have to stick to) the old method of static kernel parameters, here are the necessary steps for building a new kernel and modules:
mkbootdisk –device /dev/fd0 2.4.2-2 <- (7.1) for your safety / to be able to boot from a floppy disk
or <-
mkbootdisk -device /dev/fd0 2.4.7-10 <- (7.2)
cd /usr/src/linux <- go to the root of the kernel sources
make menuconfig <- choose the capabilities you want to
<- put in your kernel and in your modules
make dep
make clean
make bzImage <- create the new kernel
make modules <- create the new modules
make modules-install <- copy the new modules to the appropriate directory
make install <- copy the new kernel to the appropriate directory
<. (possibly overwriting the old one)
1.5 Mount points
Oracle9i requires at least two mount points. One for the software and one for the database files. If you are performing an Optimal Flexible Architecture (OFA) compliant installation, you are going to need at least 4. Again, one for the software, and at least three for database files. All mount points need to follow the pattern, /<string_constant><fixed-length_key>, for example /ora01 for the software and /ora02, ora03 and ora04 for the database files.
1.6 Oracle user and groups
You need to create the following groups before you start the installer:
groupadd oinstall # this is the group for the installation
groupadd dba # this is the group for database administrators
groupadd oper # this is the group for database operators
The user "oracle" needs to be created. This user, oracle, need to have the group "oinstall" assigned as the primary group and osdba and osoper as secondary groups. This can be accomplished by:
useradd oracle -g oinstall -G dba,oper
passwd oracle # you need to assign a password to the oracle user
After creating the user oracle, you need to change the ownership and permissions on the mount points created earlier. You need to change them so that the user oracle owns them with the group dba and the permissions are 775:
chown oracle.dba /ora01 # repeat for all other mount points as well
chmod 775 /ora01 # again, repeat for all other mount points.
1.7 The Environment
Now we need to set up the user oracle's environment. To do this, log in as oracle and verify that the umask is set to 022:
umask
if not, you need to add the line
umask 022
to the ~/.bash_profile file as well as the following parameters:
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOME=/ora01/app/oracle/product/9.0.1
ORACLE_SID=orc1
ORACLE_TERM=xterm
TNS_ADMIN=$ORACLE_HOME/config
NLS_LANG=german_germany
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$LD_LIBRARY_PATHORACLE_HOME/lib
PATH=$PATHORACLE_HOME/bin
CLASSPATH=$CLASSPATHORACLE_HOME/JREORACLE_HOME/jlibORACLE_HOME/rdbms/jlib:
CLASSPATH=$CLASSPATHORACLE_HOME/network/jlib
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH CLASSPATH LD_LIBRARY_PATH
export ORACLE_TERM ORA_NLS33 NLS_LANG
Log out and then back in as the user oracle. Ensure that the the above specified environment settings are active and the paths are correct (/bin,/usr/bin,/usr/local/bin)
env
1.8 Linking Problems
Oracle9i will not install without errors “out of the box”. To avoid these problems or work around them, I have found two options that work fine. The first one is to downgrade the “binutils” package to that from Red Hat 7.0 (refer to 1.8.1). This was done originally when doing the testing with Red Hat 7.1. There is a more elegant solution which entails modifying the Oracle script “genclntsh” during the installation (refer to 1.8.2).
1.8.1 Downgrade the binutils package
Obtain the rpm package binutils-2.10.0.18-1.i386.rpm (either from the installation CDs from Red Hat 7.0 or from the Red Hat web site, http://www.redhat.com) and enter the following command, assuming that you are in the directory where the rpm package is located:
rpm -Uvh -–force –-nodeps binutils-2.10.0.18.-1.i386.rpm
After the installation, don't forget to restore your original “binutils” package, for Red Hat 7.2, the command would look like:
rpm -Uvh –force –nodeps binutils-2.11.90.0.8-9.i386.rpm
1.8.2 “genclntsh” Modification (recommended)
During the installation, wait for the error message:
Error invoking target install of makefile <$ORACLE_HOME>/plsql/lib/ins_plsql.mk
(where <$ORACLE_HOME> is the path you defined where Oracle is being installed to)
At this point, edit the file “genclntsh” located in “$ORACLE_HOME/bin/” and change the line from:
LD_SELF_CONTAINED=”-z defs”
to
LD_SELF_CONTAINED=””
After editing, run the script as the user “oracle”:
$ORACLE_HOME/bin/genclntsh
which creates a new “libclntst9.a” file:
created <$ORACLE_HOME>/lib/libcltst9.a
After you have done that, return to the error pop-up window and click on retry. Everything should link fine after that.
And now the actual installation.
2 Installation
Make sure you are logged in as oracle and start your Windows Manager.
From within a terminal window (e.g. xterm), go to the directory where the Oracle software is located
cd /mnt/cdrom
Start the installation with the program runInstaller
./runInstaller
1. The Oracle Universal Installer starts (OUI), click on the Next button
Verify that the source directory is listed correctly
/mnt/cdrom/stage/products.jar
The destination path should be the same as what you defined in the ORACLE_HOME environment variable, then click Next to continue.
2. When asked for the Unix Group Name, enter "oinstall" as the group and click Next.
3. A window will pop up telling you to run the orainstRoot.sh script. To do this you need to start another terminal window and assume the root identity. Change to the ORACLE_HOME directory and run the script orainstRoot.sh:
su root
cd /tmp
. ./orainstRoot.sh
When this is done, leave the terminal open, stay logged in as root and switch back to the popup window and click Continue.
4. Now you will see the Available Products screen. Here you should select Oracle9i Database 9.0.1.0.0 and click Next.
5. The next screen shows the Installation Types. Here you have the choice of Enterprise Edition, Standard Edition and Custom. The Enterprise Edition installs a pre-configured starter database, product options, management tools, Networking services, utilities and basic client software for an Oracle database server. This will run the necessary assistants to create a demo database and configure Net8. For this example, we will select Enterprise Edition, then click Next.
6. You need to choose what type of database you want to install, or choose the option "Software Only" for no seed database in the next screen. Choose an option and click Next.
7. In the next screen you will need to enter the global database name, which is a user defined name plus the domain name. The global database name must be 8 characters or less. Verify that the displayed ORACLE_SID is correct for the database that you want to create. Click Next.
8. In the Database Character Set screen, choose the character set that you want for your seed database and click on Next.
9. Now you need to supply the JDK Home Directory (for JDK 118) which, if following these instructions, should be /usr/local/java. Once entered / defined, click Next.
10. Finally you get a summary screen of the options that will be installed. Review this summary and click on Install.
11. After files have been copied and linked, another window will pop up asking you to run the root.sh script as the user root. To do this, switch back to the terminal from earlier (you did leave it open) where root is still logged in and change to the ORACLE_HOME directory and run the script root.sh.
cd $ORACLE_HOME
# Remember, we logged on as root from the oracle user previously with the command su root,
# which maintained the environment variables set for oracle user.
. ./root.sh
When asked for the path to your local bin directory is, you should be able to just hit Enter.
When the script is finished, you can log out as root and close the terminal window, as it will no longer be needed. Return to the pop up window and click on OK.
12. The Configuration Tools start one after the other finishing with the Configuration Assistant. Once complete the installation is finished. In the case that “Oracle Net Configuration Assistant” should hang, mark it and stop it. When all other tools have finished, remark “Oracle Net Configuration Assistant” and click “retry”. It should finish successfully.
Click on Exit and confirm that you want to exit
3 Post installation
3.1 Tasks to perform as root:
Create any additional user accounts and verify security according to your requirements.
Automate database startup and shutdown if desired. Automatic startup is optional, but automatic shutdown is highly recommended, because it guards against an instance crash if the computer is shutdown without shutting down the database first. You need to perform the following to implement automatic startup and shutdown:
1. Edit the /etc/oratab file. The entries in the oratab file are in the format
<SID>:<ORACLE_HOME>:{Y|N}
In order to start and stop automatically using dbstart and dbshut, you need to make sure that the last field is Y.
2. Create a file named dbora in the directory /etc/rc.d/init.d if it doesn't already exist. The file should look something like this:
#!/bin/sh
# Set ORA_HOME to be equivalent to the ORACLE_HOME
# from which you wish to execute dbstart, dbshut
# and lsnrctl
# set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME
ORA_HOME=/ora01/app/oracle/product/9.0.1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start; unable to find dbstart"
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/lsnrctl start &"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &
;;
'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/lsnrctl stop &"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut &
;;
esac
This will also start and stop the listener automatically.
3. Create links to the dbora for the appropriate run levels. This could be automated with special remark lines (# chkconfig: 235 99 10 and # description: starts Oracle) in the dbora-script and a call to ntsysv or tksysv or chkconfig. The result should be similar to making the following manual calls:
# Instead of manually putting the kill script in rc3.d and rc5.d, we will
# only put it in rc0.d. This way we are sure that the DB is shut down
# before the server goes down.
ln -s /etc/rc.d/init.d/dbora /etc/rc.d/rc0.d/K10dbora
ln -s /etc/rc.d/init.d/dbora /etc/rc.d/rc3.d/S99dbora
ln -s /etc/rc.d/init.d/dbora /etc/rc.d/rc5.d/S99dbora
4. Change the group membership of the Apache account if necessary. This is to protect database security.
3.2 Tasks to perform as the user oracle
Ensure that the startup files for the oracle user as well as all other Oracle user accounts reflect the proper settings.
1. Apply any necessary patches.
2. If required, adjust the parameters in the initsid.ora file. To bring the created rollback segments on line when the database is started, you need uncomment the parameter rollback_segments.
That's about it. Now you can sit back and enjoy Oracle 9i on Red Hat Linux 7.1 or 7.2! |
|