(This document is a blatent rip-off of a more comprehensive version, by Jesus M. Salvo Jr, with bits of ArsDigita's notes)
1. Preparing to Install
1.1 Setup Linux groups and accounts
Now change the oracle account password# groupadd dba # useradd -g dba -m oracle
You will be prompted for the New Password and Confirmation of that password.# passwd oracle
1.2 Setup environment variables
As oracle, add the following lines to /home/oracle/.bash_profile
export ORACLE_BASE=/apps/oracle export ORACLE_HOME=$ORACLE_BASE/product/8.1.6 export PATH=$PATH:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export ORACLE_SID=ora816 export ORACLE_TERM=vt100 export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data umask 022
Note: You should already have a export statement for PATH. Mine reads export USERNAME BASH_ENV PATH. Make sure this line comes after the lines you added, and that your lines come after the original PATH= line.
1.3 Setup Symbolic Links for Database Files
If you're installing on a machine with small disks that are likely to be upgraded, you can a symbolic link to access the database directory which will facilitate easy hardware changes or addition of new drives. For example:
As root, create the actual directory where the database will be stored:Now create the directory where Oracle "thinks" the database is:# mkdir -p /data/oradata/MyDatabase # chown -R oracle:dba /data # chmod -R 770 /data
Now you have a symbolic link, /MyDatabase/oradata which you will use to write to the database. If you need to change the location of the database later, you may copy the files to the new location, and change the symbolic link to point to the new location.# mkdir /MyDatabase # chown oracle:dba /MyDatabase # chmod 770 /MyDatabase # ln -s /data/oradata/MyDatabase /MyDatabase/oradata
2. Installation
Login as oracle, mount the CD and start X Window:
Either double click on the runInstaller icon in your file manager (in /mnt/cdrom) or in a terminal in X Window, type /mnt/cdrom/runInstaller. The following headings correspond to the page headings in the Oracle Universal Installer.mount /dev/cdrom startx
Welcome
Click NextFile Locations
The source will default to /stage/products.jar on the CD, which is fine.The destination will be $ORACLE_HOME. If it's not, you did something wrong earlier.
Click Next
Inventory Location (First Time Install Only)
Default base directory will be /apps/oracle/oraInventory.Click OK
Unix Group Name (First Time Install Only)
Type dba
Click Next
Pop-up Window (First Time Install Only)
Open a terminal in another window and run the script as root:Return to the pop-up window and click Retry.$ su # /apps/oracle/product/8.1.6/orainstRoot.sh
Available Products
Select Oracle8i 8.1.6.1.0 Click NextInstallation Types
Select CustomClick Next
Available Product Components
Select any additional components if you want them. Make sure you tick Oracle SQLJ 8.1.6.0.Click Next
Component Locations
No need to select alternate locations. My Total Required Disk Space was 483MbClick Next
Privileged Operation System Groups
The two groups should be dba. If not, you did something wrong earlier.Click Next
Create Database
Select No.Click Next
Summary
Click Install. Note the location of the log files shown below the progress bar (/apps/oracle/oraInventory/logs/installActions.log for me).My machine takes 10m 06s from clicking Install to displaying the next dialogue.
When it's finished copying and linking, you'll get a "Setup Privileges" dialogue box. In a terminal, as oracle, type:
The script asks for the pathname of the local bin directory. You can accept the default of /usr/bin by just pressing [ENTER].cd $ORACLE_HOME su ./root.sh
Click OK back in the dialogue box.
Configuration Tools
This will launch the Net 8 Configuration Assistant. The following headings refer to the title bar in this window until stated otherwise.Net8 Configuration Assistant: Welcome
Click NextNet8 Configuration Assistant: Directory Service Access
Select the No option.Click Next
Net8 Configuration Assistant: Listener Configuration, Listener Name
Leave the default name of "Listener".Click Next
Net8 Configuration Assistant: Listener Configuration, Select Protocols
TCP/IP should be in "Selected Protocols".Click Next
Net8 Configuration Assistant: Listener Configuration, TCP/IP Protocol
Use the standard port number of 1521.Click Next
Net8 Configuration Assistant: Listener Configuration, More Listeners?
Leave "No" selected.Click Next
Net8 Configuration Assistant: Listener Configuration Done
Click NextNet8 Configuration Assistant: Naming Methods Configuration
Leave "No" selected.Click Next
Net8 Configuration Assistant: Done
Click FinishThe Net8 Configuration Assistant will close, and you'll be back to the Oracle Universal Installer.
End of Installation
Click ExitClick Yes
3. Database Creation
Still in X Window, either double click on the dbassist icon in your file manager in /apps/oracle/product/8.1.6/bin) or in a terminal type $ORACLE_HOME/bin/dbassist.Select Create a database
Click Next
Select Custom
Click Next
Select Multipurpose
Click Next
If you're just playing, leave concurrently connected users at 15. Otherwise 60 is the value suggested by ArsDigita.
Click Next
Select Dedicated Server Mode
Click Next
Leave all options ticked.
Click Next
Enter ora816 as the Global Database Name.
The SID should be fill in automatically to be the same.
Leave the other options alone.
Click Next
If you're just playing, leave the control files and max. settings alone. You should really spread your control files across different disks though. If you don't have enough disks, use separate directories anyway - it'll make the installation of new disks easier when you get them.
Click Next
If you're playing you can leave the default sizes for the tablespaces. Otherwise, here are some recommended sizes:
Tablespace Name | Size (Mb) |
---|---|
System | 200 |
Index | 200 |
Temporary | 150 |
Rollback | 516 |
Intermedia | 150 |
Again, only if you're serious, increase the three Redo Log files to 10000Kb. As with the control files, split these over 3 disks if you can, or at least 3 directories.
Click Next
Leave the logging parameters alone.
Click Next
Increase "Processes" to 100 and change the block size to 4096.
Click Next
Leave the trace files alone.
Click Next
Select Save information to a shell script
Click Finish
This will help you understand what is happening in the background and help you diagnose any problem during database creation.
In the save dialogue, click OK.
OK everything else.
Edit init.ora - this is only necessary if you intend to install the ACS
Add the following line to $ORACLE_HOME/dbs/initora816.ora:Also change the line the setting for open_cursors:nls_date_format = "YYYY-MM-DD"
open_cursors = 500
Run the scripts
The scripts can be found in $ORACLE_HOME/assistants/dbca/jlib. You only need to run sqlora816.sh which calls each of the other scripts, but it's best to try the first one on its own just so you know it isn't going to fall at the first hurdle.sqlora816.sh sets two environment variables before running the scripts, but these are already set in our profile, so we're safe to call the other scripts individually.
Edit sqlora816.sh and comment out the first script:
Now run this script manually from the prompt:#./ora816run.sh
If you can't hear the hard disk, you might think that svrmgr has crashed. You'll see a line with./ora816run.sh
2> 3> 4>...etc. and the cursor at the end. Get used to this lack of feedback :) All it will tell you is "Statement processed." and any errors.
It takes about a minute for this script to finish. Hopefully you'll get no error messages, in which case you can run the rest of the scripts with
Don't worry about the "does not exist" messages. It's just dropping objects before it creates them../sqlora816.sh
My machine took 1hr 22mins.
4. Post Database Creation Procedures
I've ripped this straight out of the ArsDigita version of this document. Sorry, I haven't had a chance to test it yet.Automating Startup & Shutdown
You will want to automate the database startup and shutdown process. It's probably best to have Oracle spring to life when you boot up your machine.
- Oracle includes a script called dbstart that can be used to
automatically start the database. Unfortunately, the script shipped in the
Linux distribution does not work out of the box. The fix is simple. Follow
these directions to apply it. First, save dbstart
to /tmp. Then login, and su to oracle.
$ cp /tmp/dbstart.txt /ora8/m01/app/oracle/product/8.1.6/bin/dbstart $ chmod 755 /ora8/m01/app/oracle/product/8.1.6/bin/dbstart
- While you're logged in as oracle, you should configure the oratab file to load your database at start.
- Edit the file /etc/oratab
- You will see this line.
ora8:/ora8/m01/app/oracle/product/8.1.6:N
By the way, if you changed the service name or have multiple databases, the format of this file is
service_name:$ORACLE_HOME:Y || N (for autoload)
- Change the last letter from "N" to "Y". This tells Oracle that you want
the database to start when the machine boots. It should look like this.
ora8:/ora8/m01/app/oracle/product/8.1.6:Y
- Save the file & quit the terminal.
- You need a script to automate startup and shutdown. Save oracle8i.txt
in /tmp. Then login as root and install the script.
$ su - # cp /tmp/oracle8i.txt /etc/rc.d/init.d/oracle8i # chown root.root /etc/rc.d/init.d/oracle8i # chmod 700 /etc/rc.d/init.d/oracle8i
- Test the script by typing the following commands and checking the output.
# /etc/rc.d/init.d/oracle8i stop Oracle 8i auto start/stop Shutting Oracle8i: Oracle Server Manager Release 3.1.6.0.0 - Production Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved. Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production With the Partitioning option JServer Release 8.1.6.0.0 - Production SVRMGR> Connected. SVRMGR> Database closed. Database dismounted. ORACLE instance shut down. SVRMGR> Server Manager complete. Database "ora8" shut down. # /etc/rc.d/init.d/oracle8i start Oracle 8i auto start/stop Starting Oracle8i: SQL*Plus: Release 8.1.6.0.0 - Production on Sat Jun 10 17:56:02 2000 (c) Copyright 1999 Oracle Corporation. All rights reserved. SQL> Connected to an idle instance. SQL> ORACLE instance started. Total System Global Area 85004272 bytes Fixed Size 69616 bytes Variable Size 76374016 bytes Database Buffers 8388608 bytes Redo Buffers 172032 bytes Database mounted. Database opened. SQL> Disconnected Database "ora8" warm started.
- If it worked, then run these commands to make the startup and shutdown
automatic.
# cd /etc/rc.d/init.d/ # chkconfig --add oracle8i # chkconfig --list oracle8i ; You should see: oracle8i 0:off 1:off 2:off 3:on 4:on 5:on 6:off
- You also need some scripts to automate startup and shutdown of the
Oracle8i listener. The listener is a name server that allows your Oracle
programs to talk to local and remote databases using a standard naming
convention. It is required for Intermedia Text and full site search.
Download these three scripts into /tmp
Now issue the following commands (still as root).
# su - oracle # cp /tmp/startlsnr.txt /ora8/m01/app/oracle/product/8.1.6/bin/startlsnr $ cp /tmp/stoplsnr.txt /ora8/m01/app/oracle/product/8.1.6/bin/stoplsnr $ chmod 700 /ora8/m01/app/oracle/product/8.1.6/bin/startlsnr $ chmod 700 /ora8/m01/app/oracle/product/8.1.6/bin/stoplsnr $ exit ; You should now be back as root. # cp /tmp/listener8i.txt /etc/rc.d/init.d/listener8i # cd /etc/rc.d/init.d # chmod 700 listener8i
Test the listener automation by running the following commands and checking the output.
# ./listener8i stop Oracle 8i listener start/stop Shutting down Listener for 8i: LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 10-JUN-2000 18:28:49 (c) Copyright 1998, 1999, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))) The command completed successfully # ./listener8i start Oracle 8i listener start/stop Starting the Listener for 8i: LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 10-JUN-2000 18:28:52 (c) Copyright 1998, 1999, Oracle Corporation. All rights reserved. Starting /ora8/m01/app/oracle/product/8.1.6/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 8.1.6.0.0 - Production System parameter file is /ora8/m01/app/oracle/product/8.1.6/network/admin/listener.ora Log messages written to /ora8/m01/app/oracle/product/8.1.6/network/log/listener.log Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 8.1.6.0.0 - Production Start Date 10-JUN-2000 18:28:53 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /ora8/m01/app/oracle/product/8.1.6/network/admin/listener.ora Listener Log File /ora8/m01/app/oracle/product/8.1.6/network/log/listener.log Services Summary... PLSExtProc has 1 service handler(s) ora8 has 1 service handler(s) The command completed successfully
This test will verify that the listener is operating normally. Login into the database using the listener naming convention.
sqlplus username/password@SID
# su - oracle $ sqlplus system/alexisahunk@ora8 SQL> select sysdate from dual; SYSDATE ---------- 2000-06-10 SQL> exit $ exit #
Now run
chkconfig
on thelistener8i
script.# cd /etc/rc.d/init.d/ # chkconfig --add listener8i # chkconfig --list listener8i listener8i 0:off 1:off 2:off 3:on 4:on 5:on 6:off
- Test the automation
As a final test, reboot your computer and make sure Oracle comes up. You can do this by typing
Log back in and ensure that Oracle started automatically.# /sbin/shutdown -r -t 0 now
$ su - oracle $ sqlplus system/alexisahunk@ora8 SQL> exit
Michael Hinds, Brian Fenton, Kevin Crosbie, Aug 2001