Home
: 5. Installing Oracle 8.1.7
Installing Oracle 8.1.7 - ADU
style
NOTE: This document was written based on Oracle,
version 8.1.6, with some updates for 8.1.7 and ADU specific steps.
Throughout this document, a '[bob@localhost]$' shell prompt indicates a
normal user (and after you create the oracle user, '[oracle@localhost]$' will
indicate that you are the oracle user). A '[root@localhost]#' for a prompt
indicates that you are operating as root. Text preceded by a ';' is a
comment by the authors of this document about what should be happening at that
point.
5.1. Acquire Oracle 8.1.7 Enterprise
Edition
You have two choices for obtaining the 8.1.7 "tarball".
Regardless of whether you copy the file from the CD or copy it over the network,
you will want to save it in /opt, rather than your home directory (because the
file is very large, saving it into your home directory will quickly fill up our
fileserver, and installation will be quicker if the file is on your local hard
drive). In order to save the tarrball onto your local machine, though, you
will want to alter the permissions on /opt:
To temporarily "become" root, we use the
'su' command (setuser).
[bob@localhost]$ cd /opt
[bob@localhost]$ su
Password: ; enter the root password obtained from a TA
[root@localhost]# chmod 777 /opt
[root@localhost]# exit
1.
Get a tarball of the installer by either:
[bob@localhost]$ cd /opt
[bob@localhost]$ scp
10.11.0.81:/opt/linux81701.tar ./
; It may ask some convoluted
security question. Answer 'yes'
<userid>@10.11.0.81's
password: ; enter your password
; wait for 20 minutes or
so...
[bob@localhost]$
- Getting a CD (floating around the lab) and copying the
tarball to your machine.
After inserting the CD:
[bob@localhost]$ cd /opt
[bob@localhost]$ cp
/mnt/cdrom/linux81701.tar .
[bob@localhost]$
2. After the download is complete, untar the file to a convenient location.
To do this, you will need to login and cd to the directory where the archive
is.
[bob@localhost]$ cd /opt
[bob@localhost] $ tar -xvf
linux81701.tar |
5.2. Things to Keep in
Mind
Throughout these instructions, we will refer to a number
of configurable settings and advise certain defaults. With the exception of
passwords, we advise you to follow these defaults unless you know what you are
doing. Subsequent documents will expect that you used the defaults, so a change
made here will necessitate further changes later. For a guide to the defaults,
please see
Section
5.10..
5.3. Pre-Installation
Tasks
Though Oracle 8.1.7 has an automated installer, we still
need to perform several manual, administrative tasks before we can launch it.
You must perform all of these steps as the
root user. We recommend doing
a '
su -' to become root, but only when it is necessary. This
command gives you full root access.
- Login as yourself (if you are not already logged in)
- Open a terminal window type and login as root
[bob@localhost]$ su -
; Enter the root password (obtained from a TA) when prompted.
[root@localhost]#
|
- Create and setup the oracle group and
oracle account
-
We need to create a user oracle, which is used to install the
product, as well as starting and stopping the database.
[root@localhost]# groupadd
dba [root@localhost]# groupadd
oinstall [root@localhost]# groupadd
oracle [root@localhost]# useradd -g dba -G oinstall,oracle -m oracle -d
/opt/oraclehome |
Now change the
oracle account password
[root@localhost]# passwd.local
oracle [root@localhost]#
logout |
You will be
prompted for the New Password and Confirmation of that password.
- Setup the installation location for Oracle
While Oracle can reside in a variety of places in the file system, we will
have adopted '/opt/ora8' as the base directory.
Note: the Oracle install needs about 1 GB free on '/opt/' to install
successfully.
[bob@localhost]$ su - oracle
Password: <the password you set above>
[oracle@localhost]$ mkdir /opt/ora8
[oracle@localhost]$ cd /opt/ora8
[oracle@localhost]$ mkdir -p m01 m02 m03/oradata/ora8
|
- Set up the oracle user environment
These lines will change the Oracle date
settings and will break the ArsDigita Community System (ACS) because ACS
depends on the ANSI date format, YYYY-MM-DD dates.
- Log out as oracle
- Log back in as oracle and double check that your
environment variables are as intended
[bob@localhost]$ su - oracle
[oracle@localhost]$ env | grep ORA
|
If it worked,
you should see:
ORACLE_SID=ora8
ORACLE_BASE=/opt/ora8/m01/app/oracle
ORACLE_TERM=vt100
ORACLE_HOME=/opt/ora8/m01/app/oracle/product/8.1.7
ORA_NLS33=
/opt/ora8/m01/app/oracle/product/8.1.7/ocommon/nls/admin/data
|
If not, try
adding the files to ~oracle/.bashrc instead of
.bash_profile. Then logout and log back in again. Also, be certain
you are doing su - and not just su. The - means
that .bashrc and .bash_profile will be evaluated.
Make sure that /bin, /usr/bin, and /usr/local/bin are
in your path by typing (it may not look exactly like this, but as long as the
/opt/ora8 stuff is there, all is well):
[oracle@localhost]$ echo $PATH
/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/opt/oraclehome/bin:/opt/ora8/m01/app/oracle/product/8.1.7/bin
|
If they are
not, then add them to the .bash_profile by changing the PATH statement above
to PATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin
5.4. Installing Oracle 8.1.7
Server
- Log in as the user oracle:
Start a new terminal
[bob@localhost]$ xhost +localhost
[bob@localhost]$ su - oracle
Password: ; Enter oracle password
[oracle@localhost]$ export DISPLAY=
localhost:0.0 |
- Find the 'runInstaller' script
- If you are installing from the tarball, the install
script is located in the 'Oracle8iR2' directory that was created when you
expanded the archive.
[oracle@localhost]$ cd /opt/Disk1 |
Check
to make sure the file is there.
[oracle@localhost]$ ls
doc index.htm install runInstaller stage starterdb
|
If you don't see
runInstaller you are in the wrong directory.
- Run the installer
[oracle@localhost]$
./runInstaller |
- A window will open that welcomes you to the 'Oracle
Universal Installer' (OUI). Click on "Next"
- The "File Locations" screen in the OUI:
- The "Source" path should be prefilled with
/opt/Disk1/stage/products.jar"
- The
"destination" path should be prefilled with
"/opt/ora8/m01/app/oracle/product/8.1.7"
- If the destination is not correct it is because your environment
variables are not set properly. Make sure you logged on as oracle
using su - oracle. If so, edit the ~oracle/.bash_profile
as you did in Section
5.3.
- Click "Next" (a pop up window will display
Loading Product information).
- The "Unix Group Name" screen in the OUI:
- The Unix Group name needs to be set to 'oinstall' ( we
made this Unix group earlier ).
- Click "Next"
- A popup window appears instantly, requesting you to
run a script a root:
- In an active terminal window, then type:
[bob@localhost]$ su
[root@localhost]# cd /opt/ora8/m01/app/oracle/product/8.1.7
[root@localhost]# ./orainstRoot.sh
; You should see:
Creating Oracle Inventory pointer file (/etc/oraInst.loc)
Changing groupname of /opt/ora8/m01/app/oracle/oraInventory to oinstall.
[root@localhost]# exit |
- Click "Retry"
- The "Available Products" screen in the OUI:
- Select "Oracle8i Enterprise Edition 8.1.7.0.1"
- Click "Next"
- The "Installation Types" screen
- Select the "Custom" installation type.
- Click "Next"
- The "Available Product Components" screen
- In addition to the defaults, make sure that "Oracle
Protocol Support 8.1.7.0.0," and "Oracle8i for Unix Documentation 8.1.7.0.0"
are also checked. In order to save space, you can safely disable
Oracle Enterprise Manager Products, and SQLJ (under Oracle JDBC
Drivers).
- Click "Next"
- A progress bar will appear for about 1 minute.
- The "Component Locations" screen in the OUI
- Click on the "Java Runtime Environment 1.1.8" It
should have the path "/opt/ora8/m01/app/oracle/jre/1.1.8"
- Click "Next"
- A progress bar will appear for about 1 minute.
- The "Privileged Operation System Groups" screen in the
OUI
- Enter "dba" for "Database Administrator (OSDBA) Group"
- Enter "dba" for the "Database Operator (OSOPER) Group"
- Click "Next"
- A progress bar will appear for a short while.
- The
"Authentication Methods" screen in the OUI
- None of the items should be selected.
- Click "Next"
- When the JDK Home directory screen comes up, enter
"/usr/java" and click "Next"
- The "Create a Database" screen in the OUI
- Select "No" as we will do this later, after some
important configuration changes.
- Click "Next"
- "Oracle Protocol Support"
- TCP should be grayed, but selected. LU6.2 should not be selected.
- Click "Next"
- The "Summary" screen in the OUI
- Check the "Space Requirements" section to verify you
have enough disk space for the install.
- Check that
"(116 products)" is in the "New Installations" section title. If you have
fewer than 104, panic. If you have more, it is probably okay, but it will use up more of your possibly
precious disk space.
- Click "Install"
- A progress bar will appear for about 20- 30 minutes.
Now is a good time to take a break.
- A "Setup Privileges" window will popup towards the end
of the installation asking you to run a script as root
- The script supplied by Oracle has two minor shell
errors in it. Copy the version from 10.11.0.81, and run the script as
root.
[bob@localhost]$ scp 10.11.0.81:/opt/use_this_root.sh /tmp/root.sh
bob@10.11.0.81's password: ; enter your password
[bob@localhost]$ su -
Password: ; Enter root password
[root@localhost]# source ~oracle/.bash_profile
[root@localhost]# /tmp/root.sh
; You should see the following.
Running Oracle8 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/ora8/m01/app/oracle/product/8.1.7
ORACLE_SID= ora8
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Press ENTER here to accept default of /usr/local/bin
Creating /etc/oratab
file... 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. [root@localhost]#
exit |
- Go back to the pop-up window and click "OK"
- The "Configuration Tools" screen in the OUI
- This window displays the config tools that will
automatically be launched. Wait a few seconds...
- The "Welcome" screen in the "net 8 Configuration
Assistant" will popup
- Make sure the "Perform Typical installation" is
not selected.
- Click "Next"
- The "Directory Service Access" screen in the "Net 8
Configuration Assistant"
- Select "No"
- Click "Next"
- The "Listener Configuration, Listener Name" screen in
the "Net 8 Configuration Assistant"
- Accept the default listener name of "LISTENER"
- Click "Next"
- The "Listener Configuration, Select Protocols" screen in
the "Net 8 Configuration Assistant"
- The only choice in "Select protocols:" should be
"TCP/IP"
- Click "Next"
- The "Listener Configuration TCP/IP Protocol" screen in
the "Net 8 Configuration Assistant"
- Default Port should be 1521 and selected.
- Click "Next"
- The "Listener Configuration, More Listeners" screen in
the "Net 8 Configuration Assistant"
- The "Listener Configuration Complete" screen in the "Net
8 Configuration Assistant"
- The "Naming Methods Configuration" screen in the "Net 8
Configuration Assistant"
- The "Complete" screen in the "Net 8 Configuration
Assistant"
- The "End of Installation" screen in the OUI
- Click "Exit"
- Click "Yes" on the confirmation pop up window.
- The Oracle Universal Installer window should have
disappeared!
Congratulations, you have just
installed Oracle 8.1.7 Server! However, you still need to create a database
which can take about an hour of non-interactive time, so don't quit yet.
5.5. Creating the First
Database
This step will
take you through the steps of creating a customized database. Be warned that
this process takes about an hour on a Pentium II with 128 MB of RAM. It also takes a huge
chunk of diskspace, so you may want to delete your Oracle tarball before creating
the database (using the command 'rm /opt/linux81701.tar').
- Open up a terminal and su to oracle and then run the
dbassist program.
[bob@localhost]$ xhost +localhost
[bob@localhost]$ su - oracle
Password: ; Enter oracle password
[oracle@localhost]$ export DISPLAY=
localhost:0.0
[oracle@localhost]$ dbassist |
- The "Welcome" screen in the Oracle Database
Configuration Agent (ODCA)
- Select "Create a database"
- Click "Next"
- The "Select database type" screen in the ODCA
- Select "Custom"
- Click "Next"
- The "Primary Database Type" window in ODCA
- Select "Multipurpose"
- Click "Next"
- The "concurrent connected users" screen of the ODCA
- Select "30" concurrent users.
- Click "Next"
- Select "Dedicated Server Mode", click
"Next"
- Accept all of the options, and click "Next"
Oracle Visual Information Retrieval may be grayed out. If so, you can ignore
it; just make sure that everything else is checked.
- For "Global Database Name", enter "ora8"; for
"SID", also enter "ora8" (it should do this automatically). Click
"Next".
- Accept the defaults for the next screen (control file
location). Click "Next"
- Under the System tab, set Size to 100MB
- Under the Users tab, set Size to 50MB
- Under the Rollback tab, set Size to 100MB. Click "Next"
- Increase the redo log sizes to 10000K each. Click
"Next"
- Use the default checkpoint interval & timeout. Click
"Next"
- Set "Block Size" to 4096 (better for small
Linux boxes; aD uses 8192 on the big Solaris machines). Click
"Next"
- Accept the defaults for the Trace File Directories.
Click "Next"
- Do not choose to create the database now.
Select "Save information to a shell script" and click "Finish"
(We're going to examine the contents of this file before creating our
database).
- Click the "OK" button in the resulting popup
window. Oracle should pop up another one saying "Your shell script will be
saved as: ./sqlora8.sh" The full path to this will likely be
/opt/ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib/sqlora8.sh
- Click the "OK" button again. Oracle will alert
you that the script has been saved successfully.
- We now need to customize the database configuration a
bit. While still logged on as oracle, edit the database initialization
script (run when the db loads). The scripts are kept in
$ORACLE_HOME/dbs and the name of the script is usually
initSID.ora where SID is the SID of your
database. The following will open the file for editing:
; edit /opt/ora8/m01/app/oracle/product/8.1.7/dbs/initora8.ora [oracle@localhost]$ emacs /opt/ora8/m01/app/oracle/product/8.1.7/dbs/initora8.ora |
- Add the following line to the end:
nls_date_format = "YYYY-MM-DD"
- Save the file. In emacs, do CTRL-X CTRL-S to
save followed by CTRL-X CTRL-C to exit or use the menu.
- At this point, you are ready to initiate database
creation. We recommend shutting down X to free up some RAM unless you have 256
MB of RAM or more. You can do this quickly by doing a
CRTL-ALT-BACKSPACE, but make sure you have saved any files you were
editing. You should now be returned to a text shell prompt. If you get sent to
a graphical login screen instead, switch to a virtual console by doing
CRTL-ALT-F1. Then login as oracle.
- Change to the directory where the database creation
script is and run it:
[oracle@localhost]$ cd /opt/ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib
[oracle@localhost]$ ./sqlora8.sh |
In
some instances, Oracle will save the file to
/opt/ora8/m01/app/oracle/product/8.1.7/assistants/dbca Try running the
script there if your first attempt does not succeed.
- Your database will now be built. It will take > 1
hour - no fooling. You should see lots of errors scroll by (like: "ORA-01432:
public synonym to be dropped does not exist") Don't let this worry you.
Eventually, you'll be returned to your shell prompt. In the meantime,
relax, you've earned it.
For this step, open up a terminal and su to oracle as
usual. You should be running X and Netscape for this phase.
5.7. 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
/opt/ora8/m01/app/oracle/product/8.1.7/bin/dbstart $ chmod 755
/opt/ora8/m01/app/oracle/product/8.1.7/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 need a
script to automate startup and shutdown. Get
oracle8i.txt from the course page and save it
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.7.1.0 - Production
With the Partitioning option
JServer Release 8.1.7.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.7.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.7/bin/startlsnr
$ cp /tmp/stoplsnr.txt /ora8/m01/app/oracle/product/8.1.7/bin/stoplsnr
$ chmod 700 /ora8/m01/app/oracle/product/8.1.7/bin/startlsnr
$ chmod 700 /ora8/m01/app/oracle/product/8.1.7/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.7.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.7.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.7/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 8.1.7.0.0 - Production
System parameter file is /ora8/m01/app/oracle/product/8.1.7/network/admin/listener.ora
Log messages written to /ora8/m01/app/oracle/product/8.1.7/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.7.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.7/network/admin/listener.ora
Listener Log File /ora8/m01/app/oracle/product/8.1.7/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 the listener8i 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
# /sbin/shutdown -r -t 0
now |
Log back in and
ensure that Oracle started automatically.
$ su -
oracle $ sqlplus
system/alexisahunk@ora8 SQL>
exit |
Congratulations,
your installation of Oracle 8.1.7 is complete.
5.8. Troubleshooting Oracle
Dates
Oracle has an internal representation for storing the
data based on the number of seconds elapsed since some date. However, for the
purposes of inputing dates into Oracle and getting them back out, Oracle needs
to be told to use a specific date format. By default, it uses an Oracle-specific
format which isn't copacetic. You want Oracle to use the ANSI-compliant date
format which is of form
'YYYY-MM-DD'.
To fix this, you should include the following line in
$ORACLE_HOME/dbs/initSID.ora or for the default
case, $ORACLE_HOME/dbs/initora8.ora
nls_date_format = "YYYY-MM-DD" |
You
test whether this solved the problem by firing up
sqlplus and typing:
SQL> select sysdate from dual; |
You
should see back a date like
2000-06-02. If some of the date is chopped
off, i.e. like
2000-06-0, everything is still fine. The problem here is
that
sqlplus is simply truncating the output. You can fix this by typing:
SQL> column sysdate format a15
SQL> select sysdate from dual; |
If
the date does not conform to this format, double-check that you included the
necessary line in the init scripts. If it still isn't working, make sure that
you have restarted the database since adding the line if you didn't do it prior
to database creation.
If you're sure that you have restarted the database since adding the line,
check your initialization scripts. Make sure that the following line is not
included:
export nls_lang = american |
Setting
this environment variable will override the date setting. Either delete this
line and login again or add the following entry to your login scripts
after the
nls_lang line:
export nls_date_format = 'YYYY-MM-DD' |
Log
back in again. If adding the
nls_date_format line doesn't help, you can
ask for advice in our
web/db
forum.
- Dropping a tablespace
- Run sqlplus as the dba:
$ sqlplus system/changeme |
- To drop a user and all of the tables and data owned by
that user:
SQL> drop user oracle_user_name cascade; |
- To drop the tablespace: This will delete everything in
the tablespace overriding any referential integrity constraints. Run this
command only if you want to clean out your database entirely.
SQL> drop tablespace table_space_name including contents cascade constraints; |
For
more information on Oracle, please consult the
documentation.
We
used the following defaults while installing Oracle.
($Id: oracle.xml,v 1.1.2.6 2001/02/20 19:52:53 claus Exp
$)