Oracle 8.1.7.0.1 for RedHat Linux 6.2
These are my notes (jkl@ccl.net, Jan Labanowski) on installing
Oracle 8.1.7.0.1 for Linux on Pentium III computer with 256MB of memory,
with 2 256M swap partitions (SwapTotal: 385440 kB as given by:
cat /proc/meminfo).
I am using RH Linux 6.2 with current updates (as of Feb 15, 2001)
I am using GNOME as my desktop environment in X-windows.
Please send me (jkl@ccl.net) corrections and comments about the stuff which is
fuzzy and hard to follow, so I can make it better. Thank you in advance...
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.
Installing RH6.2 Linux
Booted from the CD Nr. 1 in the Linux 6.2 distribution (CD Version: 10539-1)
and hit Enter. Since I also have a Adaptex SCSI controller on board, it loaded
driver aic7xxx. Then showed the the GUI.
I chose English, Generic 101PC Keyboard Model with US ENglisg/ISO 9995-3
layout., enabled dead keys, and 3 button PS/2 mouse.
My partitions were done before, on previous install with fdisk:
Device Boot Start End Blocks Id System Mount Point
/dev/hda1 * 1 1023 8217216 c Win95 FAT32 (LBA) /win
/dev/hda2 1024 1040 136552+ 83 Linux /boot
/dev/hda3 1041 1171 1052257+ 83 Linux /ftp
/dev/hda4 1172 3720 20474842+ 5 Extended
/dev/hda5 1172 1204 265041 82 Linux swap swap
/dev/hda6 1205 1237 265041 82 Linux swap swap
/dev/hda7 1238 3720 19944666 83 Linux /
So I did not bother them, but just assigned /boot, /ftp, and / to them
on the page by clicking on Edit after highlighting a partition.
Then chose Time zone, Root password (did not create any users at this time).
CHose no MD5 pass, but enabled shadow passwords. The packages I chose were:
* Printer Support * Samba server
* X Window * Anon FTP
* Gnome * Web Server
* KDE * SQL Server/Postgress
* Mail/WWW/News Tools * Network Management Workstation
* Dos/Windows connectivity * Authoring/Publishing
* Graphic Manipulations * Emacs
* Multimedia Support * Development
* Networked Workstation * Kernel development
* Dial up Workstation * Utilities.
* NFS Connectivity
My monitor is Cornerstone c1025. It is not on the list, so I took
default "DDC Probed Montor/CRN0018, and entered: 30-95 kHz as horizontal
scan, and 50-160 Hz as vertical sync (from the monitor manual book).
I have ATI XPERT 98 PCI with 8Megs, so I clicked on ATI Xpert 98,
8192k, [Test this configuration], checked [Customize X Config].
I said Yes on the next test screen asking me if I can see the question.
In Customize X screen I chose 1280x1024 16 bits as my resolution settings.
It installed all packages, but froze on me when creating boot diskette.
I rebooted the machine from CD, but chose UPGRADE (not the INSTALL) on the
screen which asked for type of installation.
Clicked on Next, which got me to Installing 118 Packages.
Then, it created the Boot Diskette. Then I removed CD and Diskette and
computer rebooted. It went through fsck to repair the disk left with
bad inodes after it froze during install.
When I logged in, and did startx the X was at wrong resolution and
wrong sync. I used Xconfigurator to fix it. It never wanted to
ask me for the amount of memory on the video card, so I had to do [Back]
several times at the X Configuration screen to get to the appropriate screen.
Getting Oracle and Docs
I went to Oracle Store, and bought the CD PACK for Linux Intel.
It came with a lot of CDs (16 to be exact).
Then I did exactly what they wanted. I put a 1st CD "Start Here" in:
mkdir /cdrom
chmod 777 /cdrom
# if you put CD in, it will usually mount itself as /mnt/cdrom
# So you need to unmount it, if you want to do what they want
umount /mnt/cdrom
mount -t iso9660 /dev/cdrom /cdrom
Then I fired my Netscape browser with the URL: file:///cdrom/welcome.html
The "Start Here" CD does not really have any information on it (it
has only 122 kBytes of data on it).
They suggest that you read their Installation manual for the product.
This is what I did.
I went to documentation site http://otn.oracle.com/docs/index.htm
and kept downloading PDF files until I filled up my disk {:-)}.
I probably did not have to do it, since they have the
"Oracle 8i On-Line Generic Documentation CD-ROM. Release 3 (8.1.7)."
I then burned a CD with all this stuff for my personal use (it would be
a crime to give it to someone!!!), so I do not have to download it
again and again...
Then I unmounted the CDROM and removed it
cd
umount /cdrom
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.
Getting some upgrades for Red Hat Linux 6.2
First, I installed a utility called wget. It allows retrieving files
from Web and Anon FTP easily on a command line. I got it from the original
RH6.2 CD Number 1. Somehow, it was not installed as default:
a) Put your RH CD1 in the drive
b) wait until it is mounted itself [DO NOT RUN AUTORUN!!!]
c) check iif it is mounted (df -k will list /mnt/cdrom).
d) If did not mount bu itself, do mount /mnt/cdrom
Then install it:
rpm -Uhv /mnt/cdrom/RedHat/RPMS/wget-1.5.3-6.i386.rpm
I went to ftp.rpmfind.net late at night (whey US sleeps, and Europe did not
wake up yet ) and retrieved the updates:
ftp ftp.rpmfind.net
Name: anonymous
Password: quest
cd linux/redhat/updates/6.2
binary
prompt
!mkdir i386
lcd i386
cd i386
mget *
!mkdir ../i586
lcd ../i586
cd ../i586
mget *
!mkdir ../i586
lcd ../i586
cd ../i586
mget *
!mkdir ../i686
lcd ../i686
cd ../i686
mget *
!mkdir ../i686
lcd ../i686
cd ../i686
mget *
!mkdir ../SRPMS
lcd ../SPRMS
cd ../SRPMS
get kernel-2.2.17-14.src.rpm
To tell you the truth, I burned a CD with this stuff, since I have 6 PCs
to update. And it is so much easier than copying and downloading
several times the same thing. You can get the updates from the RedHat itself,
ftp://updates.redhat.com but this site is usuall overbooked. So go to
the list of mirrors http://www.redhat.com/download/mirror.html and pick
up the one which is not under siege.
The first update I made was to update the updating package, i.e., RPM.
In my case, as you remember, I have it on the CD.
cd /mnt/cdrom/6.2/i386
rpm -Uhv rpm*
I also needed badly the ssh. And to compile ssh, I needed openssl.
While there is a newer openssl out there, I took the older one from
the Red Hat updates RPM, so it is known as a RPM package to the system,
since other RPMs are dependent on it. I also installed pam, since ssh needs it.
cd /mnt/cdrom/6.2/i386
rpm -Uhv openssl*
rpm -Uhv pam*
Now, I took the OpenSsh
cd /root/updates
wget ftp://ftp.eecs.umich.edu/pub/OpenBSD/OpenSSH/portable/openssh-2.3.0p1.tar.gz
tar zxvf openssh-2.3.0p1.tar.gz
cd openssh-2.3.0p1
Looked at INSTALL file and did
./configure
make
make install
PATH=${PATH}://usr/local/bin
export PATH
Updating packages
Before updating kernel, I installed all updates but kernel itself.
Updating other packages
Note that it is assumed that openssl and pam are already installed as
described above.
cd /mnt/cdrom/6.2/i386
rpm -Uhv SysVinit*
rpm -Uhv apache-*
rpm -Uhv bash*
rpm -Uhv ed*
rpm -Uhv emacs*
rpm -Uhv esound*
rpm -Uhv fetchmail*
rpm -Uhv gdm*
rpm -Uhv ghostscript*
rpm -Uhv glibc*
rpm -Uhv gnorpm*
rpm -Uhv gnu*
rpm -Uhv gpm*
rpm -Uhv imap*
rpm -Uhv inetd*
rpm -Uhv iputils*
rpm -Uhv joe*
rpm -Uhv krb*
rpm -Uhv libtiff*
rpm -Uhv lpr*
rpm -Uhv mailx*
rpm -Uhv man*
rpm -Uhv mgetty*
rpm -Uhv mod_perl*
rpm -Uhv modutils*
rpm -Uhv mutt*
rpm -Uhv ncurses*
rpm -Uhv netscape*
rpm -Uhv nfs-utils*
rpm -Uhv nscd*
rpm -Uhv openldap* nss_ldap*
rpm -Uhv perl*
rpm -Uhv php*
rpm -Uhv pine*
rpm -Uhv popt*
rpm -Uhv python*
rpm -Uhv rmt*
rpm -Uhv samba*
rpm -Uhv slocate*
rpm -Uhv sysklogd*
rpm -Uhv tcsh*
rpm -Uhv textutils*
rpm -Uhv tmpwatch*
rpm -Uhv traceroute*
rpm -Uhv transfig*
rpm -Uhv umb-scheme*
rpm -Uhv wu-ftpd*
rpm -Uhv xchat*
rpm -Uhv xpdf*
rpm -Uhv up2date* usermode* ../noarch/*.rpm
Then, I rebooted the machine.
Updating the kernel for Red Hat Linux 6.2
The updates contained also a newer kernel (the kernel which I originally
installed was: 2.2.14-5.0. You can check your kernel version with
uname -a
The latest Red Hat kernel update is 2.2.17-14. The latest kernel 2.2.X
on the http://www.kernel.org/pub/linux/kernel/v2.2/ site is
2.2.18. I decided to go with the 2.2.18 upgrade from
http://www.us.kernel.org/pub/linux/kernel/v2.2/linux-2.2.18.tar.gz
I first saved the sources, binaries, and config files of the 2.2.14-5.0 kernel
just in case.
Before you start upgrading the kernel, you should
read the piece "Upgrading the Linux Kernel on Red Hat Linux Systems"
which is available from:
http://www.redhat.com/support/docs/howto/kernel-upgrade/kernel-upgrade.html.
This were my actions:
Save/Backup whatever you can...
cd /usr/src
# remove link to linux-2.2.14
rm linux
# make a copy of /boot dir
mkdir /boot-old
cd /boot
tar cvf - . | ( cd /boot-old; tar xvf - )
mkdir /etc-old
cd /etc
tar cvf - . | ( cd /etc-old; tar xvf - )
Make boot-up/rescue disk
First check what is your current kernel and enter its version for mkbootdisk
uname -r
fdformat /dev/fd0H1440
mkbootdisk --device /dev/fd0H1440 2.2.14-5.0
I rebooted the computer with a dikette in the drive to see that disk really
works.
Saving old configuration
I was running X.
To make sure that my option for the working kernel will be passed over
to the new build, I saved the old kernel options:
cd /usr/src/linux-2.2.14
make xconfig
# pushed Store Configuration to File
# /root/config-2.2.14-5.0
# pushed Quit Without Saving
I also copied a file from configs directory:
cp /usr/src/linux-2.2.14/configs/kernel-2.2.14-i686.config /root
Quite frankly, I am not sure which one corresponds to the config of the
Kernel which came with the distribution. The differences between them
are quite minor:
diff config-2.2.14-5.0 kernel-2.2.14-i686.config
13c13
< CONFIG_M386=y
---
> # CONFIG_M386 is not set
18,21c18,27
< # CONFIG_M686FX is not set
< # CONFIG_X86_PN_OFF is not set
< # CONFIG_X86_FX is not set
< # CONFIG_X86_CPU_OPTIMIZATIONS is not set
---
> CONFIG_M686FX=y
> CONFIG_X86_WP_WORKS_OK=y
> CONFIG_X86_INVLPG=y
> CONFIG_X86_BSWAP=y
> CONFIG_X86_POPAD_OK=y
> CONFIG_X86_TSC=y
> CONFIG_X86_GOOD_APIC=y
> CONFIG_X86_PN_OFF=y
> CONFIG_X86_FX=y
> CONFIG_X86_CPU_OPTIMIZATIONS=y
38c44
< # CONFIG_BIGMEM is not set
---
> CONFIG_BIGMEM=y
83,86d88
Upgrading Linux kernel
I retrieved new kernel to /usr/src directory from the
standard www.country.kernel.org site, in my case www.us.kernel.org.
The latest was: 2.2.18:
cd /usr/src
wget http://www.us.kernel.org/pub/linux/kernel/v2.2/linux-2.2.18.tar.bz2
Then I unpacked it as (make sure that linux link is deleted from /usr/src):
cd /usr/src
tar Ixvf linux-2.2.18.tar.bz2
mv linux linux-2.2.18
ln -s linux-2.2.18 linux
While obviously, this is the virgin source, I still go by the book:
cd /usr/src/linux
make mrproper
make xconfig
The last one brought a GUI. I clicked first on the
[Load Configuration from File] and entered /root/kernel-2.2.14-i686.config
as a file.
In another terminal window I did:
diff /usr/src/linux/arch/i386/defconfig \
/root/kernel-2.2.14-i686.config | more
To see what are the differences between default settings of the virgin kernel
and the RedHat settings.
Then I went through the options to see what they say and change some.
I first clicked at the upper leftmost button [Code Mature] and than
at [Next] button of each table. I made changes indicated with the
***********. You probably should leave the original defaults, if you are
using different hardware (namely motherboard) than I do. I use: ASUS P3V133.
It has the VIA VT82C596B PCI to ISA bridge and also all this USB stuff which I
do not use.
Code Maturity
Prompt for development: Y
Processor type
PPro Processor Family
/dev/cpu/microcode - Intel P6 CPU microcode: M
/dev/cpu/*/msr - Model specific register support: N
/dev/cpu/*/cpuid -- CPU info support: N
1GB Max Physical Memory
Math Emulation: Y
MTRR: Y
Symmetric Multiprocessing: N
Loadable Module Support
Enable loadable: Y
Set version info on all symbols: Y
Kernel module loader: Y
General Setup:
Networking: Y
PCI support: Y
[Any] PCI Access Mode: ANY
PCI quirks: Y
PCI bridge optimization: N
Backward compatible /proc/pci: Y
MCA Support: N
SGI SUpport: N
System V IPC: Y
BSD Process Accounting: Y
Sysctl: Y
Kernel support for a.out: M
Kernel support for ELF: Y
Kernel support for Misc: Y
Kernel support for Java Binaries: M
Parallel port Support: M
PC-style hardware: M
Support for Foreign hardware: N
Advvanced Power Management BIOS support: Y
Ignore USER SUSPEND: N
Enable PM at boot time: N
Make CPU Idle calls when idle: N
Enable console blanking using APM: N
RTC stores time in GMT: Y
Allow interrupts during APM BIOS calls: N
Use real mode APM Bios call to power off: N
Toshiba Laptop Support: N
Plug and Play support
Plug and Play support: Y
Auto-probe for Paralle devices: M
Block Devices
Floppy: Y
Enhanced IDE: Y
Use old disk: N
Include IDE/ATA-2: Y
Include IDE/ATAPI CDROM: Y
Include IDE/ATAPI Tape: M
Include IDE/ATAPI Floppy: M
Include SCSI emulation: M
CMD640 chipset: Y
CMD640 enhanced support: N
RZ1000 chipset: Y
Generic PCI IDE: Y
Generic PCI bus-master: Y
Generic PSI bus-master DMA support: Y
Boot off-board chipsets first support: N
Use DMA by default when available: Y **********
OPTi82C621 chipset: N
ALI15X3 chipset: N
Tekram TRM290 chipset: N
NS87415 chipset: N
VIA82 C586 chipset: Y **********
CMD646 chipset: Y
Cyrix CS5530 MediaGX chipset: N
Other IDE chipset: N
Additional Block Devices: M
Network block device: M
Myltiple device driver support: Y
Linear mode: M
RAID-0: M
RAID-1: M
RAID-4/5: M
RAM disk support: Y
Default RAM disk size: 4096
XT hard disk support: N ************
Mylex DAC960: M
Parallel port IDE support: M
Parallel IDE high level drivers
Parallel port IDE disk: M
Parallel port ATAPI CD-ROMS: M
Parallel port ATAPI disks: M
Parallel port ATAPI tapes: M
Parallel port generic ATAPI devices: M
Prallel IDE protocol modules
ATEN EH-100: M
MicroSolutions: M
Data Store Commuter: M
FIT TF-2000: M
FIT TF-3000: M
Shuttle EPAT/EPEZ: M
Shuttle EPIA: M
Freecom IQ ASIC-2: M
Freecom powewr: M
King Byte: M
KT PHd: M
OnSpec 90c20: M
OnSpec 90c26: M
Compaq SMART2: M
Compaq CISS Array: N
Networking options:
Packet socket: Y
Kernel/User netling: Y
Routing messages: Y
Netlink device emulation: Y
Network firewals: Y
Socket Filtering: Y
Unix domain sockets: Y
TCP/IP Networking: Y
IP multicasting: Y
Advanced router: N
...
IP:kernel: N
...
IP:firewalling: Y
IP:firewall packed netling: Y
IP:transparent proxy: Y
IP:masquerading: Y
Protocol-specific masquerading as modules
IP:ICMP masquerading: Y
Protocol-specifc masquerading support
IP:masq special: Y
IP:ipautofw: M
IP:ipportwf: M
IP:ip fwmark mask: M
IP:optimize: N
IP:tunnel: M
IP:GRE: M
IP: multicast routing: N
...
IP:aliasing: Y
IP:ARP: N
IP: TCP syncookie support: Y
IP: Reverse ARP: M
IP: Allo large window: M
The IPv6: N
........
The IPX: M
IPX full internal IPX net: N
IPX SPX network: N
Appletalk DDP: M
CCITT X.25: N
LAPB: N
Bridging: N
Frame diverter: N
802.2 LLC: N
Acorn: N
...
WAN router: M
Forwarding between high speed interfaces: N
CPU is too slow to handle full bandwith: N
QoS:
None checked
Telephony Support:
Linux telephony support: M
QuickNet Internet: M
SCSI Support
SCSI Support: Y
SCSI disk support: Y
SCSI tape support: M
SCSI CD-ROM support: Y
Enable vendor specific extensions: Y
SCSI Generic Support: M
Proble all LUNs on each SCSI device : Y
Verbose SCSI Error: Y
SCSI loggin: Y
SCSI low-level drivers:
3ware Hardware: N
7000FASST: M
ACARD SCSI: M
Adaptec AHA152X: M
Adaptec AHA1542: M
Adaptec AHA1740: M
Adaptec Raid: M
Adaptec AIC7xxx: M
Enable Tagged Command: N
Max number of TCQ: 8
Collect Stats to report in /proc: Y
Delay in seconds after SCSI reset: 5
IBM ServeRAID: M
Advansys Support: M
Advansys IN200: M
AMI: M
Buslogic: M
Omit FlashPoint: N
Compaq Fibre: N
DTC3180: M
EATA: M
enable tagged command queueing: Y
enable elevator sorting: N
16 Maximum number of queued commands
EATA-DMA: M
EATA-PIO: M
Future DOmain: M
GDT: M
Generic NCR5380: M
Enable NCR53c400 extensions: N
PORT: NCR5380/53c400 mapping
Initio 9100U: M
Initio INI: M
IOMEGA parallel ppa: M
IOMEGA parallel imm: M
ppa/imm option slow: N
ppa/imm option assume slow: N
NCR53c406a: M
symbios 53c416: M
Simple: 53c710: M
... and so on... Did not change anything.
I2O device support
I2O Support: N
Network device support:
Network device support: Y
ARCnet:
Dummy net driver: M
Bonding: M
EQL: M
Ethertap: M
General Instruments Surf: N
Ethernet (10 or 100MBit)
Ethernet (1000 Mbut)
FDDI driver: Y
Digital DEFEA: N
SysKonnect FDDI PCI: M
Hippi driver: N
Appletalk devices
PLIP: M
PPP: M
SLIP: M
CSLIP: Y
Keepalive: Y
Six bit SLIP: Y
Wireless LAN: Y
STRIP: M
ATT: M
Airnet: M
Token Ring
Fibre Channel: Y
Interphase: M
RedCreek: M
Traffic: M
WAN interfaces
SBNI12-xx: M
ARCnet devices
ARCnet support: N
Ethernet (10 and 100Mbit)
Ethernet: Y
3COM cards: Y
3c501: M
3c503: M
3c505: M
3c507: M
3c509/3c579: M
3c515 ISA: M
3c590/3c900: M
AMD LANCE: M
Wester DIgital/SMC cards: Y
WD80*3 support: M
SMC Ultra: M
SMC Ultra32: M
SMC 9194: M
RacalInterlan: Y
NI6010: M
NI5210: M
NI6510: M
RealTek 8129: M
RealTek 8139: N
Other ISA: Y
ATI70/1720: M
Cabletron: M
... accepted all defaults
Ethernet (1000MBit)
Alteon: M
Packet Engines GNIC-II: N
Packet Engines Yellowfin: M
SysKonnect: M
Appletalk devices
Took defaults
Token Ring devices
Took defaults
Wan Interaces:
Took defaults
Amateur Radio Support:
Amateur Radio: N
IrDA support
Defaults
Infrared-port device drivers
Defaults
ISDN Subsystems
Defaults
ISDN Features
Defaults
...
Passive ISDN
Defaults
Active ISDN
Defaults
Old CDROM Drivers
Defaults
Character devices:
Defaults
Mice:
ATIXL busmouse: M
Logitech busmouse: M
Microsoft busmouse: M
PS2 Mouse: Y
C&T 82C710 mouser: M
PC1010 digitizer pad: M
Joystick:
Default
Video for Linux
Default
Ftape, Floppy tape device:
Default
Watchdog card:
Default
I2C Support
I2C Support: N
Hardware sensors support
none
USB Support
Support for USB: M
USB verbose: N
Miscelaneous USB Options
Preliminary USB device filesystem: N
Support for hot: N
Enforce: N
USB Controllers:
UHCI: M
UHCI Alternative: M
OHCI: M
USB Devices:
USB printer: M
USB Scanner: M
USB Modem : M
USB Serial Convertor: M
USB Generic Serial Driver: N
Filesystems
Quota support: Y
Kernet automounter: Y
AFFS: N
Amiga: N
Apple: N
DOS FAT: M
MSDOS fs support: M
UMSDOS Unix like: M
VFAT: M
ISO9660: Y
MS Joiliet: Y
Minix: N
NTFS: M
OS/2 HPFS: M
Network file systems:
Coda: N
NFS: Y
NFS Version 3 support: Y
NFS Server support: Y
NFS Server Ver3 support: Y
SMB: M
Use a default NLS: N
NCP: N
Partition types:
BSD: Y
Macintosh : Y
SMD: Y
Solaris: Y
Unixware: Y
Native language support:
Default: cp437
437: Y
737: M
775: M
850: M
852: M
855: N
860: N
861: N
862: N
863: N
864: N
865: N
866: M
869: M
874: N
932: N
936: N
949: N
950: N
8859-1: M
8859-2: M
8859-3: N
8859-4: N
8859-5: M
8859-6: N
8859-7: M
Console Drvers
VGA TEXT: Y
Video mode selection: Y
MDA: M
SUpport for frame buffer: Y
Permedia2: M
ATI MAch64: M
VESA VGA: N
VGA 16: N
Matrox acceleration: M
Millenium: Y
Mistique: Y
G100/G200: Y
Multihead: Y
Sound
SOund card Support: M
Support for C-Media: M
Enable legacy FM
Enable legacy MPU-401
Crystal SoundFusion: M
Creative SBLive: M
Ensonic AudioPCI: M
Creative Ensonic AudioPCI 97: M
ESS Mastro: M
ESS Maesto3: M
Rest took defaults
Additional low level sound:
Additional low lever sound drivers: Y
Took defaults
Kernel hacking
Magic SysRq Key: Y
Then, at the end I clicked on:
Main Menu,
Store Configuration File: /root/kernel_config_1
Save and Exit
Then, in the xterm window I ran:
make dep
Then I made the following changes in header files, 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 (the 0x8000000 is half of my memory in hex):
#define SHMMAX 0x2000000 --> #define SHMMAX 0x8000000
(I have 256Megs, i.e. 0x10000000 of it and 0x8000000 is half)
#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
and edited sem.h:
#define SEMOPM 32 --> #define SEMOPM 100
then edited the Makefile in /usr/src/linux and changed:
EXTRAVERSION = --> EXTRAVERSION = -01
Now I was ready to build kernel and modules:
cd /usr/src/linux
make bzImage
make modules
make modules_install
After doing this the directory /lib/modules/2.2.18-01 was created, as well
as new kernel and System.map. I installed the files in /boot partition and
made a RAM disk:
cd /boot
rm vmlinuz
cp /usr/src/linux/arch/i386/boot/bzImage vmlinuz-2.2.18-01
ln -s vmlinuz-2.2.18-01 vmlinuz
rm System.map
cp /usr/src/linux/System.map System.map-2.2.18-01
ln -s System.map-2.2.18-01 System.map
mkinitrd /boot/initrd-2.2.18-01.img 2.2.18-01
Now is time to fix lilo. I first edited /etc/lilo.conf to be:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
linear
default=linux
image=/boot/vmlinuz-2.2.18-01
label=test
initrd=/boot/initrd-2.2.18-01.img
read-only
root=/dev/hda7
image=/boot/vmlinuz-2.2.14-5.0
label=linux
initrd=/boot/initrd-2.2.14-5.0.img
read-only
root=/dev/hda7
other=/dev/hda1
label=dos
It will load new kernel when you type test after boot: prompt.
Then I ran lilo to put these changes on hard drive.
lilo -v
This generated the following output:
# lilo -v
LILO version 21, Copyright 1992-1998 Werner Almesberger
Reading boot sector from /dev/hda
Merging with /boot/boot.b
Boot image: /boot/vmlinuz-2.2.18-01
Mapping RAM disk /boot/initrd-2.2.18-01.img
Added test
Boot image: /boot/vmlinuz-2.2.14-5.0
Mapping RAM disk /boot/initrd-2.2.14-5.0.img
Added linux *
Boot other: /dev/hda1, loader /boot/chain.b
Added dos
/boot/boot.0300 exists - no backup copy made.
Writing boot sector.
Then I created a boot rescue diskette with a new kernel:
cd /boot
fdformat /dev/fd0H1440
mkbootdisk --device /dev/fd0 2.2.18-01
Then I silently prayed and rebooted the machines.
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.
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
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 put the "Oracle 81 Enterprise Edition Release 3 (8.1.7) for
Linux Intel and it mounted itself as /mnt/cdrom. I killed the directory
gizmo which appeared on my Xwindow screen, I unmounted it and remounted it
as /cdrom:
umount /mnt/cdrom
mount -t iso9660 /dev/cdrom /cdrom
In the browser, I looked at URL file:///cdrom/index.htm and looked at
release notes.
Then I logged out as root, and logged in as user oracle, started
Xwindow, created .bash_profile in /home/oracle as shown below:
PATH=${PATH}:${HOME}/bin
BASH_ENV=${HOME}/.bashrc
USERNAME="oracle"
export USERNAME BASH_ENV PATH
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=linux817
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
You can find a copy of my .bash_profile here. Note that people usually use ORCL as ORACLE_SID.
In my case it is: ORACLE_SID=linux817
After changing the file you have to do:
. .bash_profile
to actually set your environment variables, or log out and then
log in again as user oracle.
Running Oracle Installer
Then I started Oracle install (as user oracle);
cd /cdrom
./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 on the [Retry] button in the pop off window.
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
I chose to use the linux817 for a name, and the Internet Name for my
computer, i.e.:
Global Database Name: linux817.mymachine.mycompany.com
SID linux817
and clicked [Next]
Summary
It displayed a bunch of products to be installed. Impressive.
I clicked on [Install]
Install
A window was was reporting installation progress.
You can get a cup of coffee made now, since it takes time.
It actually takes too much time... It just died in the middle of install
(about 64% or something), and I woke it up by clicking on Help button.
It displayed HELP and it started running again. BTW the HELP is for
Windows, i.e., garbage (e.g. they tell you to look into "C:\Program Files"
directory, and similar things). Oh well, it is only $40... You have got
what you paid for. After about 30 minutes it popped off small window asking
to run /u01/app/oracle/product/8.1.7.0.1/root.sh
as root. I first opened the /u01/app/oracle/product/8.1.7.0.1/root.sh
in an editor, since my previous experience was that this script has
errors.
The script is 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:
RMF="/bin/rm -f "
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 wonder why they cannot run the damned thing before sending
it to people who are potential customers. I must not be understanding
modern marketing. Maybe they want to get "intimate" with the software.
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 (i.e., took default). 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]
(I actually once wanted to use the installer and configure Net8 manually --
the installer froze, and I had to delete everything and start anew.
Maybe it was bad luck, but try ANYTHING custom in the installer with
"extreme prejudice".)
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.mymachine.mycompany.com
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).
Starting Oracle
All instructions below assume that you are logged in as user oracle.
DO NOT DO ANYTHING AS root, unless specifically instructed!!!
I first saved all processes which were running as user oracle (or had
some oracle somewhere in the command line). I saved them to file.
There are a lot of processes which belonged to the GNOME desktop environment
for XWindow. The ones belonging to installer have /cdrom/stage/Components...
The lines with ora_*-linux817 are actually the components of Oracle
server. The /u01/app/oracle/product/8.1.7.0.1/bin/tnslsnr LISTENER -inherit
is a listener (i.e., the component which allows remote access to the
database via clients or JDBC). The lines with:
/u01/app/oracle/product/8.1.7.0.1/Apache/Apache/bin/httpd -d /u01/app
are processes of Apache Web server.
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.
First logged in and logged out to sqlplus.
$ sqlplus
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Mar 13 02:33:42 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> quit
Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production
I.e., it logged me in, and logged me out... Good...
I stopped the database:
svrmgrl
connect internal
shutdown
quit
I was nicely surprized that the errors which showed up in the
Oracle 8i EE 8.1.7.0.0 Web downloadable version (my log of installation
is available here) were not here anymore.
The stuff produced on the screen is given below.
$ 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.
$
I also killed listener.
lsnrctl stop
which put these things on the screen.
$ lsnrctl stop
LSNRCTL for Linux: Version 8.1.7.0.0 - Production on 13-MAR-2001 12:26:05
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
The command completed successfully
I also killed the httpd (Apache) on port 7777 which was started by the
installation.
cd $ORACLE_HOME
cd Apache/Apache/bin
./apachectl stop
ps auwx | grep httpd
I will deal with Apache later. Actually, this is good reading, so go and
look at pages at http://localhost:7777/ and you will find a few useful things.
Then I restarted again oracle again. But I started listener first, so
when oracle starts it will register itself with the listener. While it
probably does not matter much, you should start oracle after you start the
listener.
lsnrctl start
svrmgrl
connect internal
startup
quit
The screen output looked like (italic is what I typed):
$ lsnrctl start
LSNRCTL for Linux: Version 8.1.7.0.0 - Production on 13-MAR-2001 14:41:38
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Starting /u01/app/oracle/product/8.1.7.0.1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 8.1.7.0.0 - Production
System parameter file is /u01/app/oracle/product/8.1.7.0.1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/8.1.7.0.1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=axanar)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=axanar)(PORT=2481))(PROTOCOL_STACK=(PRESENTATION=GIOP)(SESSION=RAW)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 8.1.7.0.0 - Production
Start Date 13-MAR-2001 14:41:38
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /u01/app/oracle/product/8.1.7.0.1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/8.1.7.0.1/network/log/listener.log
Services Summary...
PLSExtProchas 1 service handler(s)
linux817has 1 service handler(s)
The command completed successfully
$
$ 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.
$
So I tried to log in and changed passwords for sys and system users.
This is what was on the screen:
$ sqlplus
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Mar 13 15:01:43 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: guess_what
Retype new password: guess_what
SQL> quit
Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production
$
$ sqlplus
SQL*Plus: Release 8.1.7.0.0 - Production on Tue Mar 13 15:03:21 2001
(c) Copyright 2000 Oracle Corporation. All rights reserved.
Enter user-name: system
Enter password: manager
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 SYSTEM
Old password: manager
New password: somethingElse
Retype new password: somethingElse
SQL> quit
Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production
$
Now, I did another
ps auwx | grep oracle > oracle_processes1
to see if things are running. The output is here. It seems it ran.
Checking permissions on directories and files
Logged in as user oracle and did the stuff suggested in the Oracle 8i
Installation Guide (Part Number: A86017-02) on page 4-3 and 4-4.
The permissions are mostly OK since the installer does a good job.
But I am just documenting/checking what they should set to:
ls -ld $ORACLE_HOME/bin
chmod 751 $ORACLE_HOME/bin
ls -ld $ORACLE_HOME/bin/oracle
chmod 6751 $ORACLE_HOME/bin/oracle
ls -ld $ORACLE_HOME/lib
chmod 755 $ORACLE_HOME/lib
ls -l $ORACLE_HOME/lib
chmod 644 $ORACLE_HOME/lib/*
ls -ld $ORACLE_HOME/rdbms/log
chmod 751 $ORACLE_HOME/rdbms/log
ls -ld $ORACLE_HOME/rdbms
chmod 751 $ORACLE_HOME/rdbms
find $ORACLE_HOME/rdbms -type f -exec chmod 644 {} \;
ls -ld $ORACLE_HOME/sqlplus
chmod 751 $ORACLE_HOME/sqlplus
find $ORACLE_HOME/sqlplus -type f -exec chmod 644 {} \;
ls -ld $ORACLE_HOME/network/trace
chmod 777 $ORACLE_HOME/network/trace
Starting Oracle on bootup automatically
I became a root...
File /etc/oratab lists all databases which are installed.
In my case it only had:
linux817:/u01/app/oracle/product/8.1.7.0.1:N
i.e., that there is a $ORACLE_SID linux817, and that $ORACLE_HOME for it
is /u01/app/oracle/product/8.1.7.0.1, and N which means do not start
it on boot up by dbstart script. But I want to start it on boot up, so
I changed the line to:
linux817:/u01/app/oracle/product/8.1.7.0.1:Y
Then I logged out as root and logged in again as user "oracle".
I made a directory for oracle stdout/stderr logs
cd $ORACLE_HOME
mkdir logs
This directory will contain a file oracle_on_off.log which collects
when oracle is started and shut down.
Then I created two scripts in $ORACLE_HOME/bin. One, oracle_startup to start up
oracle and whatever else I need (e.g., listener, apache, etc...).
Another script was oracle_shutdown to shutdown down oracle.
The scripts call the original Oracle startup/shutdown scripts:
dbstart and dbshut (in $ORACLE_HOME/bin) and also other things which you want
started with oracle. Note that I start listener BEFORE I start oracle db, since
this way the oracle db will register its readines with listener as soon as
it is up, while otherwise it would happen with delay (I believe that
listener is scanning what is running at intervals).
I also remembered to change their permissions:
cd $ORACLE_HOME/bin
chmod 755 oracle_startup oracle_shutdown
These scripts can be used to start and stop oracle and associated services
when you are logged in as user oracle. They can also be used to start
and stop oracle automatically on boot up and halt as described later, but
have to be called with "su - oracle -c "command" (read on...).
Then I created a script to start and stop oracle on boot-up/shutdown:
/etc/rc.d/init/dbora.
It just calls the oracle_startup and oracle_shutdown scripts and makes
sure oracle runs as user oracle.
Note that the script calls oracle_startup and oracle_shutdown scripts
(which in turn call original dbstart and dbshut scripts provided in
$ORACLE_HOME/bin). The scripts are called with "su - oracle", i.e., the
.bashrc and .bash_profile scripts for user oracle are executed before any
other actions, like you actually logged in. That is why oracle's components
will inherit environment variables set in the login scripts.
Then I tested if dbora works:
cd /etc/rc.d/init.d
chmod 755 dbora
chkconfig --add dbora
chkconfig --list dbora
./dbora start
ps auwx | grep oracle
./dbora stop
ps auwx | grep oracle
and it pretended that it did.
Adding environment variables on log in to oracle account
After reading the Post Installation chapter (pages 4-7 to 4-9) in Oracle 8i
Installation Guide (Release 3 8.1.7 for Linux Intel, Part No. A86017-02,
December 2000) I am quite confused what one should put in the CLASSPATH.
They say to put stuff like $ORACLE_HOME/JRE/lib:$ORACLE_HOME/jlib in
the CLASSPATH. The problem is that this is probably wrong, since you
should put jars or directories with classes, something like:
$ORACLE_HOME/JRE/lib/rt.jar:$ORACLE_HOME/JRE/lib/i18n.jar...
These directories do not contain classes but jar files.
The directory $ORACLE_HOME/jlib contains 16 jar files. Should I put all or
some? This is not an easy question since, for example, the directory
contains jars: jssl-1_1.jar and jssl-1_2.jar which are different versions
of the same package oracle.security.*... They probably refer to
JDK 1.1.X and 1.2.X, but who knows... I decided not to add jars
if I do not know what they do. I can always change CLASSPATH later
when I get ClassNotFound.
I did not use the /usr/local/bin/oraenv script since, IMHO, it is not working
correctly, and even if $ORACLE_HOME is correctly set, and ORAENV_ASK=NO
it still asks for ORACLE_HOME.
My final .bash_profile script is available here.
For Net8 I added a line in the /etc/services:
listener 1521/tcp #Net8 listener
Testing Oracle
Retrieving info from the test database with sqlplus
I logged in as user oracle, and started the oracle with one of my scripts:
oracle_startup
Oracle comes with the trial database, and a test user: scott (password: tiger).
This is what I did to check if I can run anything:
$ sqlplus scott/tiger
SQL*Plus: Release 8.1.7.0.0 - Production on Sat Mar 10 02:50:32 2001
(c) Copyright 2000 Oracle Corporation. All rights reserved.
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> select ENAME from EMP where SAL < 2000;
ENAME
----------
SMITH
ALLEN
WARD
MARTIN
TURNER
ADAMS
JAMES
MILLER
8 rows selected.
SQL> quit
Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production
With the Partitioning option
JServer Release 8.1.7.0.1 - Production
$
Trying simple JDBC application with Oracle
Note, all examples below assume that you are running Bourne/K/Bash shell.
I wrote a simple Java application, JDBCTest.java which retrieves the same
information as above, but it uses the JDBC driver. I saved it
as JDBCTest.java, and placed it in /tmp. I updated CLASSPATH
and added the entry for Oracle JDBC driver and current directory.
Then I compiled it and ran it. I used the URL for the OCI driver, i.e.,
run it on the same machine as the oracle.
cd /tmp
CLASSPATH=${CLASSPATH}:${ORACLE_HOME}/jdbc/lib/classes111_g.zip:.
export CLASSPATH
javac JDBCTest.java
ARG_DRIVER="oracle.jdbc.driver.OracleDriver"
ARG_DB_URL="jdbc:oracle:oci8:@"
ARG_USER="scott"
ARG_PASSWORD="tiger"
java JDBCTest $ARG_DRIVER $ARG_DB_URL $ARG_USER $ARG_PASSWORD
Which produced:
Arg[0]=oracle.jdbc.driver.OracleDriver
Arg[1]=jdbc:oracle:oci8:@
Arg[2]=scott
Arg[3]=tiger
Connected to jdbc:oracle:oci8:@ as user scott
Results of the query:
select ENAME from EMP where SAL < 2000
SMITH
ALLEN
WARD
MARTIN
TURNER
ADAMS
JAMES
MILLER
Database connection closed
The classes111.zip JDBC driver for JDK 1.1.X (1.1.8 in this case) which
came with the Oracle 8.1.7 was woring fine locally, since it was a OCI
(Oracle Call Interface) driver (i.e., one which accesses directly the binary
C libraries of the Oracle and contains native code and is not portable to
other OSes or platforms, e.g., the driver for Linux Intel need not work on
Solaris). Obviously such JDBC drivers can only be used on the same machine
on which either Oracle server or Oracle client is running.
I could not find Linux Intel JDBC-OCI drivers for JDK 1.2.*/1.3 on the Oracle
Web Site. Either they are not yet available or you need to use 3rd party
drivers. It is logical, since Oracle itself uses JDK 1.1.8 under Linux.
The above JDBC example was working on the virigin install of Oracle
as described above. Unfortunately, this configuration will not work
if we want to access Oracle from another machine. Whever you do, you
will get:
Exception in thread "main" java.lang.RuntimeException: SQL Exception
Io exception: The Network Adapter could not establish the connection
at JDBCTest.main(JDBCTest.java:70)
To access Oracle from another machine you need to edit configuration files
in the $ORACLE_HOME/network/admin
directory. It is probably "Elementary, my dear Watson" for the Oracle
gurus, but it was hours of digging through manuals, Web archives, etc,
before it started working for me. Anyhow, I provide here the originals and
the modified files which worked for the remote ORACLE access.
listener.ora original listener.ora corrected
sqlnet.ora original sqlnet.ora corrected
tnsnames.ora original tnsnames.ora corrected
There is another type of JDBC driver for Oracle. It is called a JDBC-Thin
driver, and it is pure Java. You can get it from Oracle Technet page:
http://technet.oracle.com/software/tech/java/sqlj_jdbc/htdocs/ftp.htm.
There are actually two sets of Thin Drivers: for JDK1.1 and JDK1.2 under:
Oracle8i 8.1.7 JDBC Drivers for use with JDK 1.2.x
and
Oracle8i 8.1.7 JDBC Drivers for use with JDK 1.1.x
respectively.
To check if thin driver is working, I copied the JDBCTest.java
to another (Linux) machine which did not have Oracle installed.
I had two JDKs installed on this machine: JDK1.3 and the Blackdown 1.1.8.
I copied the classes12.zip (the Oracle-Thin JDBC driver for JDK1.2) and
classes111.zip (the thin JDBC Oracle driver for JDK 1.1.8) to the directory
/usr/local/oracle-jdbc and first tried the JDK1.2 driver.
JAVA_HOME=/usr/local/jdk1.3
export JAVA_HOME
PATH=${PATH}:${JAVA_HOME}/bin
export PATH
CLASSPATH=${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/dt.tools
CLASSPATH=${CLASSPATH}:/usr/local/oracle-jdbc/classes12.zip:.
export CLASSPATH
javac JDBCTest.java
ARG_DRIVER="oracle.jdbc.driver.OracleDriver"
ARG_DB_URL="jdbc:oracle:thin:@axanar.ccl.net:1521:linux817"
ARG_USER="scott"
ARG_PASSWORD="tiger"
java JDBCTest $ARG_DRIVER $ARG_DB_URL $ARG_USER $ARG_PASSWORD
It produced:
Arg[0]=oracle.jdbc.driver.OracleDriver
Arg[1]=jdbc:oracle:thin:@axanar.ccl.net:1521:linux817
Arg[2]=scott
Arg[3]=tiger
Connected to jdbc:oracle:thin:@axanar.ccl.net:1521:linux817 as user scott
Results of the query:
select ENAME from EMP where SAL < 2000
SMITH
ALLEN
WARD
MARTIN
TURNER
ADAMS
JAMES
MILLER
Database connection closed
I then checked if the JDK1.1.8 will behave as well:
JAVA_HOME=/usr/local/jdk1.1.8
export JAVA_HOME
PATH=${PATH}:${JAVA_HOME}/bin
export PATH
CLASSPATH=${JAVA_HOME}/lib/classes.zip
CLASSPATH=${CLASSPATH}:/usr/local/oracle-jdbc/classes111.zip:.
export CLASSPATH
javac JDBCTest.java
ARG_DRIVER="oracle.jdbc.driver.OracleDriver"
ARG_DB_URL="jdbc:oracle:thin:@axanar.ccl.net:1521:linux817"
ARG_USER="scott"
ARG_PASSWORD="tiger"
java JDBCTest $ARG_DRIVER $ARG_DB_URL $ARG_USER $ARG_PASSWORD
The result was the same, i.e., worked...
Then I tried a really convoluted stuff, Oracle specific naming as:
JAVA_HOME=/usr/local/jdk1.1.8
export JAVA_HOME
PATH=${PATH}:${JAVA_HOME}/bin
export PATH
CLASSPATH=${JAVA_HOME}/lib/classes.zip
CLASSPATH=${CLASSPATH}:/usr/local/oracle-jdbc/classes111.zip:.
export CLASSPATH
javac JDBCTest.java
ARG_DRIVER="oracle.jdbc.driver.OracleDriver"
ARG_DB_URL="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=axanar.ccl.net)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=linux817)))"
ARG_USER="scott"
ARG_PASSWORD="tiger"
java JDBCTest $ARG_DRIVER "$ARG_DB_URL" $ARG_USER $ARG_PASSWORD
I was quite positively surprised when I saw:
Arg[0]=oracle.jdbc.driver.OracleDriver
Arg[1]=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=axanar.ccl.net)(PROTOCOL=t
cp)(PORT=1521))(CONNECT_DATA=(SID=linux817)))
Arg[2]=scott
Arg[3]=tiger
Connected to jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=axanar.ccl.net)(PROT
OCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=linux817))) as user scott
Results of the query:
select ENAME from EMP where SAL < 2000
SMITH
ALLEN
WARD
MARTIN
TURNER
ADAMS
JAMES
MILLER
Database connection closed