Oracle 8.1.7.0.1 for RedHat Linux 7.0

These are my notes (jkl@ccl.net, Jan Labanowski) on installing Oracle 8.1.7.0.1 for Linux on my Laptop (Dell Inspiron 5000e, Pentium III 700MHz, 192MB memory, with 3 128Meg swap partitions (SwapTotal: 385440 kB as given by: cat /proc/meminfo). I am using RH Linux 7.0 with current updates (as of end of Jan., 2001) I am using KDE as my desktop environment in X-windows. Frankly, I do not encourage installing Oracle on RH7.0 at this time. I installed on two computers following the script to the letter, and on one it works, and on another it does not... It probably depends what was my history of updates and upgrades... So do yourself a favor and install it on RH6.2 if you can. Disclaimer: All below is a nonsence. If you want to learn the truth, hire a competent lawyer. They will tell you what is right for a fee.

Getting Oracle and Docs

First, I went to the Oracle OTN site: http://otn.oracle.com/ and clicked on: "Top Downloads" and Oracle8i Database on the top of right column. It lead me to: http://otn.oracle.com/software/products/oracle8i/software_index.htm. From there I clicked on Oracle 8i Downloads, Release 3, Version 8.1.7 "Oracle8i Enterprise Edition Release 3 (8.1.7.0.1) for Linux (Intel), with OPS" I had to sign up, etc, and finally downloaded over 500MBytes tar file. I also downloaded Installation and Release Notes as PDF files. Then I went to documentation site http://otn.oracle.com/docs/index.htm and kept downloading PDF files until I filled up my disk {:-)}. I then burned a CD with all this stuff, so I have an easy way to keep reinstalling and trying, and erasing, and trying again. {:-(}. Beside the "official" Installation Manual from Oracle, I also looked for the docs on the web, and found: http://jordan.fortwayne.com/oracle/817.html (my local copy is here) which I am following closely here (great page), and http://www.zx81.org.uk/computing/oracle/oracle-howto/oracle-howto.html (my local copy is here) which is slightly out of date by full of great ideas and prescriptions when you actually want to use Oracle.

Recompiling Linux kernel

The Oracle Installation Guide from Oracle tells you to change your kernel parameters and then recompile the kernel. Oracle uses a lot of memory, and while people say it is OK not to modify the kernel, I tried to do what they suggest in the Oracle Installation Guide. First, I had to get the kernel RPM sources out of the RH7.0 CD. They are on the 1st and 4th CD from RH 7.0 distribution. Before messing the kernel, I made a boot disk just in case: cd /boot mkbootdisk --device /dev/fd0 2.2.16-22 First, try not to get any RPMs, since you may have already installed them when you were installing your Linux on your computer. Only if it does not want to compile new kernel, then try get the stuff from the CDs (or network, e.g.: rufus.w3.org aka www.rpmfind.net) Start with 4th CD of RedHat 7.0 distribution. mount /mnt/cdrom cd mnt/cdrom/SRPMS rpm -Uhv kernel*rpm which should show something like: kernel ################################################## kernel24 ################################################## kernelcfg ################################################## Then do: rpm -Uhv dev86-0.15.0-5.src.rpm I also mounted the 1st RedHat CD. mount /mnt/cdrom cd /mnt/cdrom/RedHat/RPMS rpm -Uhv kernel-doc-2.2.16-22.i386.rpm and also: rpm -Uhv kernel-headers-2.4.0-0.26.i386.rpm \ kernel-source-2.2.16-22.i386.rpm \ kernel-utils-2.2.16-22.i386.rpm \ kernel-headers-2.4.0-0.26.i386.rpm but it told me that those are already installed (just checking -- I always install Linux with kernel development packages, so I expected that these are there). Then I made the following changes, as suggested on the page 2-2 of Oracle Installation Guide: cd /usr/src/linux/include/asm cp -p shmparam.h shmparam.h-orig and edited shmparam.h: #define SHMMAX 0x2000000 --> #define SHMMAX 0x6000000 (I have 192Megs, i.e., 0xc000000, so half of it is #define SHMMNI (1<<_SHM_ID_BITS) --> #define SHMMNI 100 #define SHMSEG SHMMNI --> #define SHMSEG 10 and then cd /usr/src/linux/include/linux cp -p sem.h sem.h-orig end edited: #define SEMOPM 32 --> #define SEMOPM 100 Then I went to recompile the kernel: cd /usr/src/linux make distclean make mrproper make xconfig The last one brought a GUI. then clicked on "Save and Exit" and make dep make clean then edited the Makefile in /usr/src/linux and changed: EXTRAVERSION = -22 --> EXTRAVERSION = -22jkl and CC :=$(shell if which $(CROSS_COMPILE)kgcc > /dev/null 2>&1; then echo $(CROSS_COMPILE)kgcc; else echo $(CROSS_COMPILE)gcc; fi) -D__KERNEL__ -I$(HPATH) to a simple: CC =$(CROSS_COMPILE)kgcc -D__KERNEL__ -I$(HPATH) Finally, did: make bzImage It surprized me, since it finished without errors... Now, I copied the stuff: cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.2.16-22jkl cd /etc cp -p lilo.conf lilo.conf.orig Then edited lilo.conf and added a block for "test" kernel: boot=/dev/hda2 map=/boot/map install=/boot/boot.b prompt timeout=50 message=/boot/message linear default=test image=/boot/vmlinuz-2.2.16-22 label=linux read-only root=/dev/hda8 image=/boot/vmlinuz-2.2.16-22jkl label=test read-only root=/dev/hda8 other=/dev/hda1 label=dos Since I was not changing the modules, I just did the symbolic link: ln -s /lib/modules/2.2.16-22 /lib/modules/2.2.16-22jkl Then I ran mkinitrd to create RAM disk to be able to make boot diskette: cd /boot /sbin/mkinitrd initrd-2.2.16-22jkl 2.2.16-22jkl Then, I made a boot disk with new kernel just in case: cd /boot mkbootdisk --device /dev/fd0 2.2.16-22jkl Then I ran: /sbin/lilo -v During kernel recompilation I was greatly helped by the Kernel-HOWTO by Brian Ward ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/html_single/Kernel-HOWTO.html (my local copy is here). I also used: http://www.redhat.com/support/manuals/RHL-7-Manual/ref-guide/s1-sysadmin-build-kernel.html and Jason Costomiris note on RedHat discussion list: http://www.linuxarkivet.nu/mlists/redhat-list/0009/msg02713.html (local copy is here).

Oracle Installation

Then I prepared for Oracle install. I did not do any reparitioning since my disk was already partitioned as: # df -k Filesystem 1k-blocks Used Available Use% Mounted on /dev/hda8 22487756 1592396 19753048 8% / /dev/hda2 51238 3564 45028 8% /boot /dev/hda1 7665648 2508928 5156720 33% /win But obviously, if I was preparing a PC solely for Oracle, I would do what they say in Installation Guide and created partitions.

Installing JDK1.1.8

Installed Java JDK1.1.8v3 for Linux from Blackdown taken from: (you may want to right click on these links if you do not have bz2 MIME type set) ftp://metalab.unc.edu/pub/linux/devel/lang/java/blackdown.org/JDK-1.1.8/i386/v3/jdk118_v3-glibc-2.1.3.tar.bz2. Local copy is here. I placed it in /tmp, and then unpacked it as: cd /tmp tar Ixvf jdk118_v3-glibc-2.1.3.tar.bz2 mv jdk118_v3 /usr/local cd /usr/local ln -s jdk118_v3 java

Updating RH7.0 glibc

Since Oracle8i is compiled with glibc2.1 and RH7.0 has glibc2.2, there is a problem. There is a compatibility toolkit, though... In needed it during installation. Before you can actually install Oracle, you have to religiously apply the glibc latest updates. In my case, I did: ftp updates.redhat.com Name: anonymous Password: guest binary cd 7.0 cd i386 get glibc-common-2.2-12.i386.rpm get glibc-devel-2.2-12.i386.rpm get glibc-profile-2.2-12.i386 get nscd-2.2-12.i386.rpm cd ../i686 get glibc-2.2-12.i686.rpm quit rpm -Uhv glibc* nscd*

Installing glibc2.1 toolkit

Now, you also need a tookit which will temporarily substitute glibc2.2 for glibc2.1 during installation. This is the instructions for installing the toolkit: http://ftp.valinux.com/pub/support/hjl/glibc/sdk/2.1/readme.Oracle8i (local copy is here). The toolkit itself is here: http://ftp.valinux.com/pub/support/hjl/glibc/sdk/2.1/i386-glibc-2.1-linux.tar.gz Local copy is here. I saved this patch in /tmp and then unpacked it as: cd / tar zxvf /tmp/i386-glibc-2.1-linux.tar.gz Then I saved "official" RH7.0 gcc, cc, and ld and libraries, and replaced them for the time of installation with the glibc2.1 stuff cd /usr/bin mkdir saved mv gcc cc ld saved ln -s /usr/i386-glibc-2.1-linux/bin/i386-glibc21-linux-gcc gcc ln -s gcc cc ln -s /usr/i386-glibc-2.1-linux/bin/i386-glibc21-linux-ld ld cd /usr/lib mkdir saved mv libc.so libdl.so libm.so libpthread.so saved mv libc.a libdl.a libm.a libpthread.a saved

Creating accounts and groups for Oracle

Then I created needed users and groups groupadd oinstall groupadd dba groupadd oper useradd oracle -g oinstall -G dba,oper passwd oracle

Removing traces of previous failed installs of Oracle

Since I had oracle installed before, I deleted all traces of it namely: rm -rf /u01 rm /etc/oratab rm /etc/oraInst.loc Note, if you have a running/needed/usefull installation of Oracle on your system DO NOT DO THAT!!! Use Oracle GUI to do uninstall (the same which you used to install -- it is described below).

Directories and Environment Varialbles

Created directory for Oracle Install: mkdir /u01 chown oracle.dba /u01 Then I untarred my Oracle from my CD cd /usr/src mkdir -p oracle-dist/oracle-dist/8.1.7.0.1 cd oracle-dist/oracle-dist/8.1.7.0.1 tar tvf /mnt/cdrom/linux81701.tar Then exited X-window desktop, logged out as root, logged in as oracle and started X-window desktop (startx). I added the following to the .bash_profile in /home/oracle (home) directory: JAVA_HOME=/usr/local/java export JAVA_HOME ORACLE_BASE=/u01/app/oracle export ORACLE_BASE ORACLE_HOME=${ORACLE_BASE}/product/8.1.7.0.1 export ORACLE_HOME ORACLE_SID=linux81701 export ORACLE_SID PATH=${PATH}:${ORACLE_HOME}/bin:${JAVA_HOME}:/bin export PATH if [ "${LD_LIBRARY_PATH:-}" == "" ]; then LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/usr/local/lib else LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH} fi export LD_LIBRARY_PATH CLASSPATH=${JAVA_HOME}/lib/classes.zip export CLASSPATH

Running Oracle Installer

Then I started Oracle install (as user oracle); cd /usr/src/oracle-dist/8.1.7.0.1/Disk1 ./runInstaller The window appeared: Welcome with bunch of options. I clicked on [Next] File Locations Accepted the defaults on next window (Source and Destination Paths) since they came from myself (current directory and ORACLE_HOME environment variable) by clicking [Next]. Unix Group Name Unix Group Name: oinstall Clicked [Next] and it asked me to execute a script: /u01/app/oracle/product/8.1.7.0.1/orainstRoot.sh First, I checked the script for bugs... It looked fine to me. I opened the xterm and su - and as a root cd /u01/app/oracle/product/8.1.7.0.1 ./orainstRoot.sh It told me: Creating Oracle Inventory pointer file (/etc/oraInst.loc) Changing groupname of /u01/app/oracle/oraInventory to oinstall. I did not close the xterm since I will need it later on. Then I clicked in the pop off window the [Retry] button. It then came with available product information window: Available Products I selected Oracle8i Enterprise Edition 8.1.7.0.1 and clicked [Next] Installation Types Accepted default Typical Installation (837 MB) and clicked [Next] Choose JDK Home Directory Since there is so much fuzz about Oracle not liking new JDKs, I accepted /usr/local/java which was a link to jdk118_v3 as described above. Database Identification Global Database Name: jkl.localhost.localdomain SID linux817 and clicked [Next] Summary It displayed a bunch of products to be installed. Impressive. I clicked on [Install] Install A window was displaying which was reporting installation progress. You can get a cup of coffee made now, since it takes time. After about 30 minutes it popped off the small window asking to run /u01/app/oracle/product/8.1.7.1./root.sh as root. I first opened the /u01/app/oracle/product/8.1.7.1./root.sh in editor, since my previous experience was that this script has errors. The script was wrong... It is actually two scripts merged together. At line 63 we have: $ECHO "IMPORTANT NOTE: Please delete any log and trace files previously" $ECHO " created by the Oracle Enterprise Manager Intelligent" $ECHO " Agent. These files may be found in the directories" $ECHO " you use for storing other Net8 log and trace files." $ECHO " If such files exist, the OEM IA may not restart." #!/usr/bin/sh # # $Header # $Copyright # Then at line 102 we have RMF=/bin/rm -f which is obviously wrong since "/bin/rm -f" should be quoted. and finally, at line 156 we have: RUID=`/usr/bin/id|$AWK -F\( '{print $2}'|$AWK -F\) '{print $1}` which should obviously be: RUID=`/usr/bin/id|$AWK -F\( '{print $2}'|$AWK -F\) '{print $1}'` I corrected the script and ran, but frankly, I am not sure I should have had. I opened the the xterm, logged as root and did: su - /u01/app/oracle/product/8.1.7.0.1/root.sh It displayed: IMPORTANT NOTE: Please delete any log and trace files previously created by the Oracle Enterprise Manager Intelligent Agent. These files may be found in the directories you use for storing other Net8 log and trace files. If such files exist, the OEM IA may not restart. Running Oracle8 root.sh script... \nThe following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/8.1.7.0.1 ORACLE_SID= linux817 Enter the full pathname of the local bin directory: [/usr/local/bin]: I entered Enter. It told me: Entry will be added to the /etc/oratab file by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. Then I clicked OK button in the small window, and the installation continued... It displayed the new window: Configuration Tools and was popping new windows for individual components to configure: Net8 Configuration Assistant: Welcome Selected Perform typical configuration and clicked [Next] Database Creation Progress window (just showed progress). v- Creating and starting Oracle instance v- Copying database files v- Initializing database v- Database creation complete Then it displayed the window: Database creation completed. Database Information: global database name: jkl.localhost.localdomain database system identifier (SID): linux817 SYS account password: change_on_install SYSTEM account password: manager I clicked OK button. Then it started the Apache web server and displayed: End of Installation clicked [Exit] (do not do Next Install, or you will waste your current install).

Restoring original RH 7.0 libraries and compiler/linker

I logged as a root on one of the xterms (su -) and restored the glibc2.2 setting: cd /usr/bin rm -f gcc cc ld cd /usr/bin/saved mv * .. cd .. rm -rf saved cd /usr/lib/saved mv * .. cd .. rm -rf saved

Starting Oracle

I did ps auwx | grep oracle > oracle_processes I am including the list of processes here. Then, it was time to test if the thing actually works. cd $ORACLE_HOME/rdbms/admin sqlplus It did not... Enter user-name: sys Enter password: ERROR: ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux Error: 2: No such file or directory So I tried to start it: svrmgrl connect internal startup quit But got: [oracle@localhost 8.1.7.0.1]$ svrmgrl Oracle Server Manager Release 3.1.7.0.0 - Production Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved. Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SVRMGR> connect internal Connected. SVRMGR> startup LRM-00109: could not open parameter file '/u01/app/oracle/product/8.1.7.0.1/dbs/initlinux81701.ora' ORA-01078: failure in processing system parameters SVRMGR>quit Server Manager complete. [oracle@localhost 8.1.7.0.1]$ So I looked for files *.ora starting from the top directory of Oracle: cd /u01 find . -name '*.ora' -print I got many answers but one was interesting: ./app/oracle/product/8.1.7.0.1/dbs/initlinux817.ora So I linked the initlinux817.ora to initlinux81701.ora cd /u01/app/oracle/product/8.1.7.0.1/dbs ln -s /u01/app/oracle/admin/jkl/pfile/initlinux817.ora initlinux81701.ora and started again: svrmgrl connect internal startup quit It then barked: ORACLE instance started. Total System Global Area 72704160 bytes Fixed Size 73888 bytes Variable Size 55681024 bytes Database Buffers 16777216 bytes Redo Buffers 172032 bytes ORA-01102: cannot mount database in EXCLUSIVE mode SVRMGR> quit I rebooted the machine. Then logged in again as oracle. Started x (startx) and typed: [oracle@localhost oracle]$ svrmgrl Oracle Server Manager Release 3.1.7.0.0 - Production Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved. Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SVRMGR> connect internal Connected. SVRMGR> startup ORACLE instance started. Total System Global Area 72704160 bytes Fixed Size 73888 bytes Variable Size 55681024 bytes Database Buffers 16777216 bytes Redo Buffers 172032 bytes ORA-01990: error opening password file '/u01/app/oracle/product/8.1.7.0.1/dbs/orapw' SVRMGR> quit So again, I decided to look for the file cd /u01 find . -name 'orapw' -print But it did not find it. So I went to /u01/app/oracle/product/8.1.7.0.1/dbs and tried to find something like passwd file. There was the file orapwlinux817. So I made a link cd /u01/app/oracle/product/8.1.7.0.1/dbs ln -s orapwlinux817 orapw and then at SVRMGR> prompt I typed SVRMGR> shutdown ORA-01109: database not open Database dismounted. ORACLE instance shut down. SVRMGR> quit Server Manager complete. I logged out as oracle, and then logged in as oracle, to see is something is still running. Nothing was running after log out (beside, or course, the login shell). So I tried to start it again: svrmgrl connect internal startup quit No errors showed up, so I was more optimistic. [oracle@localhost oracle]$ svrmgrl Oracle Server Manager Release 3.1.7.0.0 - Production Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved. Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SVRMGR> connect internal Connected. SVRMGR> startup ORACLE instance started. Total System Global Area 72704160 bytes Fixed Size 73888 bytes Variable Size 55681024 bytes Database Buffers 16777216 bytes Redo Buffers 172032 bytes Database mounted. Database opened. SVRMGR> quit Server Manager complete. [oracle@localhost oracle]$ So I tried to log in: sqlplus It spew: Worked for me this time: [oracle@localhost oracle]$ sqlplus SQL*Plus: Release 8.1.7.0.0 - Production on Thu Feb 8 16:44:08 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Enter user-name: sys Enter password: change_on_install Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SQL> password Changing password for SYS Old password: change_on_install New password: xxxxxxxx Retype new password: xxxxxxxx SQL> quit [oracle@localhost oracle]$ svrmgrl Oracle Server Manager Release 3.1.7.0.0 - Production Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved. Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SVRMGR> connect internal Connected. SVRMGR> shutdown Database closed. Database dismounted. ORACLE instance shut down. SVRMGR> quit Server Manager complete. [oracle@localhost oracle]$ What to do with Oracle once it is installed is another story.