Oracle DBA Tips Corner |
|
Installing Oracle9i Release 2 (9.2.0) on Solaris 9
by Jeff Hunter, Sr. Database Administrator
Contents
Overview
Hardware Requirements
sunsolve.sun.com/pub-cgi/show.pl?target=patches/patch-access
Download and unzip the file 9_Recommended.zip to a temporary directory.
It will create the directory called 9_Recommended. Change to this directory
and run the install_cluster shell script.
The process may take up to several hours depending on the system.
If for example you have only one partition named /db0, simply go to this
directory and create all of the mount points: /u01 through /u06.
Once all of the mount points are created in the /db0 directory, go back
to the root directory (cd /) and create symbolic links to the
/db0/<mount_point> for all mount points. For example:
Configuring the Oracle UNIX User ID
Before delving into the details for configuring the Oracle User ID,
I packaged an archive of shell scripts and configuration files to
assist with the Oracle preparation and installation. You should
download the archive
"oracle_920_installation_files.tar"
as the Oracle User ID and place it in his HOME directory.
Oracle9i Release 2 (9.2.0) includes native support for
files greater than 2 GB. Check your shell to determine whether
it will impose a limit.
Starting the Oracle Universal Installer
Installations can no longer be performed using character mode. However, the DBA
may elect to configure the OUI to perform a non-interactive installation of the Oracle
products. The OUI in non-interactive mode can be run directly from a machine's
console, X-Windows environment or via an X-terminal emulator.
Enterprise Edition Options 9.2.0.1.0
Oracle Net Services 9.2.0.1.0
Oracle Enterprise Manager Products 9.2.0.1.0
Oracle9i Development Kit 9.2.0.1.0
[*] Oracle9i for UNIX Documentation 9.2.0.1.0
Oracle HTTP Server 9.2.0.1.0
[ ] Oracle Transparent Gateways 9.2.0.1.0
[*] iSQL*Plus 9.2.0.1.0
[*] Oracle JDBC/OCI Interfaces 9.2.0.1.0
<Next>
You will need to following the same procedures to replace Disk 2
with Disk 3.
Installing the Oracle 9.2.0.5.0 Patchset
Before starting the installation of the Oracle 9.2.0.5.0 patchset, you will need to
verify and shutdown all Oracle processes that have been started from the 9.2.0.1.0
product set. During the installation process (above) you
will notice that the Oracle Configuration Assistant started the Apache web server
and the Oracle Intelligent Agent. You
will be required to shut this process down before continuing:
After shutting down all Oracle processes, you will then need to obtain the 9.2.0.5.0 patchset
from Metalink. Simply download the patchset "p3501955_9205_SOLARIS.zip" to a temporary
directory. Extract the contents of this archive and run the Oracle Universal Installer to
install the patchset:
Exit from the Oracle Universal Installer (OUI). At this point, we have only installed the newest
version (10.1.0.2.0) of the Oracle Universal Installer. We know need to kick off this version
of OUI to apply the 9.2.0.5.0 patchset:
At the end of the installation and linking phase, you will be prompted to run
a configuration script as the root user before the installation can proceed. Leave
this window up, and go to
/u01/app/oracle/product/9.2.0 and run the root.sh script:
Configure Oracle Net
You can simple copy these three files to the proper location as follows as
the oracle user id and start the Oracle listener:
Creating the Oracle Database - (ORA920)
If you would like to create the ORA920 (one in which installs all
Oracle options like Oracle JVM, interMedia, Context, XMLDB, Spatial, ultraSearch,
cwmlite, Demo Schemas, etc.)
I have included with this example, simply navigate to the directory
~oracle/admin/ORA920/create
and run the file RUN_CRDB.sh as the oracle user id
as follows:
Setting up Automatic Database Starting & Stopping
The dbora utility has been implemented to utilize the Oracle supplied scripts
$ORACLE_HOME/bin/dbstart and $ORACLE_HOME/bin/dbshut. This utility (dbora)
will be run by the UNIX init process, and reads the /var/opt/oracle/oratab file to
dynamically determine which databases to start and stop.
Here is how to install the dbora file:
Note that I also included a revised version of the Oracle supplied scripts
dbshut and dbstart. You will want to copy these two files
to the $ORACLE_HOME/bin directory:
Within the dbshut script, I wanted
to use the immediate option for all shutdowns. I did not have
to make any changes to the dbstart script.
Miscellaneous Options
If you have been following
along with this article, the required scripts for switching your
Oracle database environment is already included. From the command prompt,
simply run the following:
Edit the listener.ora file as follows:
After making changes to the listener.ora file, you
will need to restart the Oracle listener:
To change the PASSWORD and or USERNAME used by the Intelligent Agent:
If <username> is the default (DBSNMP), there is no
need to specify the user here. Only the password is required.
Here is an example of the entry I added to my
$ORACLE_HOME/network/admin/snmp_rw.ora file
to change the password of DBSNMP to manager:
About the Author
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter
and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express,
prior, written permission. Application to host any of the material elsewhere can be made by contacting me at jhunter@idevelopment.info.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate,
but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from
relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.
This article is a comprehensive guide for installing
Oracle9i Release 2 on the Solaris 9 (SPARC) operating environment.
Please keep in mind
that this article should not be considered
a substitution for completely reading and understanding the official
installation guide and release notes from Oracle. The following links can be used to
download the official installation guides for Oracle9i (9.2.0):
Here is a short introduction to some of the configuration parameters that will
be used for installing the Oracle database software:
Oracle9i Database Release 2 Documentation
Oracle9i Installation Guide Release 2 for Sun Solaris - (A96167-01)
This section describes the steps and requirements that should be performed
by the DBA as it relates to the Sun hardware and Solaris operating
environment before performing the Oracle database software. Keep in mind that
the following steps need to be performed by the root user id.
% su -
# su -
# unzip 9_Recommended.zip
# cd 9_Recommended
# ./install_cluster
During the patch process you may encounter several failures with either error
code 2 and/or error code 8. These are normal. They represent
"package already at current rev" and "underlying package not installed". Anything other
than 2 or 8 you should look more closely at.
# /usr/sbin/swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 136,1 16 4198304 4198304
and multiply the value in the BLOCKS column by 512.
NOTE:
If 400 MB or more is not available in /tmp, you can create
a "tmp" directory in another file system, then set the environment
variables TMP (used by Oracle) and TMPDIR (used by operating
system programs like the linker "ld" and library archiver
"ar") to point to this location. For example:
# mkdir /u01/app/oracle/tmp
# TEMP=/u01/app/oracle/tmp; export TEMP
# TMPDIR=/u01/app/oracle/tmp; export TMPDIR
# /usr/sbin/prtconf | grep "Memory size"
Memory size: 1792 Megabytes
# df -g | grep "block size"
/ (/dev/dsk/c0t0d0s0 ): 8192 block size 1024 frag size
/proc (/proc ): 512 block size 512 frag size
/etc/mnttab (mnttab ): 512 block size 512 frag size
/dev/fd (fd ): 1024 block size 1024 frag size
/var/run (swap ): 8192 block size 8192 frag size
/tmp (swap ): 8192 block size 8192 frag size
/u01 (/dev/dsk/c0t2d0s7 ): 8192 block size 1024 frag size
/u03 (/dev/md/dsk/d0 ): 8192 block size 1024 frag size
/u04 (/dev/md/dsk/d1 ): 8192 block size 1024 frag size
/u05 (/dev/md/dsk/d2 ): 8192 block size 1024 frag size
/u06 (/dev/md/dsk/d3 ): 8192 block size 1024 frag size
/cartman (cartman:/share2 ): 8192 block size 512 frag size
* +---- SNIP HERE ---+
*
* +--------------------------------------------------------------+
* | SHARED MEMORY |
* | ------------------------------------------------------------ |
* | shmmax - Maximum size, in bytes, of a single shared memory |
* | segment. Should be set large enough for the largest |
* | SGA size. Typically set to 4GB. |
* | shmmin - The minimum size, in bytes, of a single shared |
* | memory segment. |
* | shmseg - The maximum number of share memory segments that |
* | can be attached (i.e. used) by a single process. |
* | shmmni - This determines how many shared memory segments can |
* | be on the system. |
* +--------------------------------------------------------------+
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmseg=10
set shmsys:shminfo_shmmni=100
* +------------------------------------------------------------+
* | SEMAPHORES |
* | ---------------------------------------------------------- |
* | semmni - Maximum number of semaphore sets on the system |
* | semmsl - Maximum number of semaphores per set |
* | semmns - Maximum number of semaphores available system wide|
* | |
* | NOTE: The maximum number of available semaphores |
* | on the system is the lesser of SEMMNS and |
* | the product (SEMMNI*SEMMSL). |
* +------------------------------------------------------------+
set semsys:seminfo_semmni=800
set semsys:seminfo_semmsl=25
set semsys:seminfo_semmns=20000
* +---- SNIP HERE ---+
NOTE:
After making changes to the kernel parameters under Solaris, you will
need to re-boot the database server before any changes can take effect. # groupadd -g 115 dba
# mkdir -p /u01/app
# useradd -u 175 -c "Oracle Software Owner" -d /u01/app/oracle -g "dba" -m -s /bin/ksh oracle
64 blocks
# passwd oracle
New Password: ***********
Re-enter new Password: ***********
passwd: password successfully changed for oracle
NOTE:
Not all database servers come with a large number of disks needed to
store all of the mount points /u01 through /u06. For example,
you may have a machine that only has one disk / partition for the database
called /db0. To create the database on this machine, the DBA Group
will use symbolic links to emulate the different mount points.
# su
# cd /db0
# mkdir u01 u03 u04 u05 u06
# cd /
# ln -s /db0/u01 /u01
# ln -s /db0/u03 /u03
# ln -s /db0/u04 /u04
# ln -s /db0/u05 /u05
# ln -s /db0/u06 /u06
# mkdir /u01/app
# mkdir /u01/app/oracle
# cd /db0
# chown -R oracle:dba u*
# chown -R oracle:dba /u01
# chown -R oracle:dba /u03
# chown -R oracle:dba /u04
# chown -R oracle:dba /u05
# chown -R oracle:dba /u06
# cd /var/opt
# mkdir oracle
# chown -R oracle:dba oracle
# cd /opt
# mkdir bin
# chown -R oracle:dba bin
After configuring the Solaris operating environment, it is time to setup the
Oracle UNIX User ID for the installation of the Oracle database software. Keep in mind that
the following steps need to be performed by the oracle user id.
% su - oracle
The file (blocks) value should be multiplied by 512 to obtain the
maximum file size imposed by the shell. A value of unlimited
is the operating system default and is the maximum value of 1 TB.
$ ulimit -Sa
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) 8192
coredump(blocks) unlimited
nofiles(descriptors) 256
memory(kbytes) unlimited
$ ulimit -Ha
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) unlimited
stack(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) 65536
memory(kbytes) unlimited
$ id
uid=175(oracle) gid=115(dba)
$ pwd
/u01/app/oracle
$ tar xvf oracle_920_installation_files.tar
x oracle_920_installation_files, 0 bytes, 0 tape blocks
x oracle_920_installation_files/admin.tar, 48128 bytes, 94 tape blocks
x oracle_920_installation_files/common.tar, 813568 bytes, 1589 tape blocks
x oracle_920_installation_files/dbora, 8060 bytes, 16 tape blocks
x oracle_920_installation_files/dbshut, 3310 bytes, 7 tape blocks
x oracle_920_installation_files/dbstart, 5002 bytes, 10 tape blocks
x oracle_920_installation_files/local_bin.tar, 20480 bytes, 40 tape blocks
x oracle_920_installation_files/oratab, 746 bytes, 2 tape blocks
x oracle_920_installation_files/profile_oracle, 5903 bytes, 12 tape blocks
x oracle_920_installation_files/system, 1804 bytes, 4 tape blocks
x oracle_920_installation_files/ldap.ora, 851 bytes, 2 tape blocks
x oracle_920_installation_files/listener.ora, 1752 bytes, 4 tape blocks
x oracle_920_installation_files/sqlnet.ora, 16075 bytes, 32 tape blocks
x oracle_920_installation_files/tnsnames.ora, 1606 bytes, 4 tape blocks
x oracle_920_installation_files/crontabORA920.txt, 3450 bytes, 7 tape blocks
$ cp oracle_920_installation_files/profile_oracle ~/.profile
$ tar xvf oracle_920_installation_files/admin.tar
$ tar xvf oracle_920_installation_files/common.tar
$ cp oracle_920_installation_files/oratab /var/opt/oracle/
$ (cd /opt/bin && tar xvf ~/oracle_920_installation_files/local_bin.tar)
$ . ~/.profile
.profile executed
$
$ /usr/bin/which make
$ /usr/bin/which ar
$ /usr/bin/which ld
$ /usr/bin/which nm
Each command should point to the /usr/ccs/bin directory.
If not, add /usr/ccs/bin to the beginning of the PATH
environment variable in the current shell.
$ mkdir /u01/app/oracle/product
$ mkdir -p /u03/app/oradata
$ mkdir -p /u04/app/oradata
$ mkdir -p /u05/app/oradata
$ mkdir -p /u06/app/oradata
Beginning with Oracle version 8i, the Oracle Universal Installer (OUI)
is a Java application and uses a JRE (Java runtime Environment) shipped on the media.
Other Java applications that utilize the JRE are the Database Configuration Assistant
and the Oracle Net Assistant. The JRE shipped by Oracle is the only one supported to run
with these applications.
NOTE:
If you are using Hummingbird's Exceed X-Windows emulator while installing
and using Oracle9i, set the window manager to run in "Native"
mode so that Microsoft windows functions as the window manager. See your
Exceed documentation for instructions on configuring the window manager.
$ DISPLAY=<your local workstation>:0
$ export DISPLAY
For example:
$ DISPLAY=bartman:0
$ export DISPLAY
$ xclock
$ su -
# mkdir /cdrom
# mount -r -F hsfs /dev/dsk/cxtydzs2 /cdrom
In the above example, /cdrom is the CD-ROM mount point directory
and /dev/dsk/cxtydzs2 is the device name for the CD-ROM
device, for example /dev/dsk/c0t6d0s2.
$ cd
$ pwd
/u01/app/oracle
$ /cdrom/cdrom0/runInstaller
$ Initializing Java Virtual Machine from /tmp/OraInstall/jre/bin/jre. Please wait...
Oracle9i Software Installation Screen Responses
Screen Name
Choice
Welcome Screen
<Next>
File Locations
Source Path: /cdrom/cdrom0/stage/products.jar
Destination Name: OracleHome920
Destination Path: /u01/app/oracle/product/9.2.0
<Next>
Available Products
Oracle9i Database 9.2.0.1.0
Oracle9i Client 9.2.0.1.0
Oracle9i Management and Integration 9.2.0.1.0
<Next>
Installation Types
Enterprise Edition (3.18GB)
Standard Edition (3.10GB)
Custom
<Next>
Available Product Components
[*] Oracle9i 9.2.0.1.0
[ ] Oracle Advanced Security 9.2.0.1.0
[*] Oracle Partitioning 9.2.0.1.0
[*] Oracle Spatial 9.2.0.1.0
[ ] Legato Networker Single Server 6.1.0.0.0
[ ] Oracle Label Security 9.2.0.1.0
[*] Oracle OLAP 9.2.0.1.0
[*] Oracle Data Mining 9.2.0.1.0
[*] Oracle Net Listener 9.2.0.1.0
[*] Oracle Connection Manager 9.2.0.1.0
[ ] Oracle Names 9.2.0.1.0
[*] Oracle Intelligent Agent 9.2.0.1.0
[ ] Oracle Enterprise Manager Web Site 9.2.0.1.0
[ ] Oracle Management Server 9.2.0.1.0
[*] Oracle Enterprise Manager Client 9.2.0.1.0
[*] Oracle Change Management Pack 9.2.0.1.0
[*] Oracle Diagnostics Pack 9.2.0.1.0
[*] Oracle Tuning Pack 9.2.0.1.0
[*] Oracle Management Pack for Oracle Applications 9.2.0.1.0
[ ] Oracle Management Pack for Oracle Standard Edition 9.2.0.1.0
[*] Oracle C++ Call Interface 9.2.0.1.0
[*] Oracle Call Interface (OCI) 9.2.0.1.0
[*] Oracle Programmer 9.2.0.1.0
[*] Oracle XML Developer's Kit 9.2.0.1.0
[*] Oracle HTTP Server Extensions 9.2.0.1.0
[*] Apache Configuration for Oracle XML Developer's Kit 9.2.0.1.0
[*] Oracle eBusiness Management Extensions 9.2.0.1.0
[*] BC4J Runtime for Database 9.0.2.692.1
[*] Oracle Mod PL/SQL Gateway 3.0.9.8.3b
Component Locations
Keep all defaults
<Next>
Privileged Operating System Groups
OSDBA: dba
OSOPER: dba
<Next>
Upgrading or Migrating an Existing Database
Leave unchecked...
<Next>
Create Database
Yes
No
<Next>
Summary
<Install>
$ su -
# eject cdrom
# exit
$
After replacing Disk 1 with Disk 2, return the dialog box from the
Oracle Universal Installer and hit "OK".
$ cd /u01/app/oracle/product/9.2.0
$ su
Password: *******
# ./root.sh
Running Oracle9 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/9.2.0
Enter the full pathname of the local bin directory: [/usr/local/bin]: /opt/bin
Adding entry to /var/opt/oracle/oratab file...
Entries will be added to the /var/opt/oracle/oratab file as needed 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.
# exit
$
After successfully running the root.sh script, go back to the dialog window
from the Oracle Universal Installer and click "OK" to continue.
$ cd /opt/bin
$ cp oraenv.custom oraenv
$ eject cdrom
If you have been following this article, you will have just finished installing
Oracle9i (9.2.0.1.0). It is now time to apply the 9.2.0.5.0 patchset and that is
what we will be doing in this section.
$ $ORACLE_HOME/Apache/Apache/bin/apachectl stop
/u01/app/oracle/product/9.2.0/Apache/Apache/bin/apachectl stop: httpd stopped
$ agentctl stop
DBSNMP for Solaris: Version 9.2.0.1.0 - Production on 01-AUG-2004 21:29:35
Copyright (c) 2002 Oracle Corporation. All rights reserved.
Agent shutdown
$ mkdir /u01/app/oracle/patchset
$ mv p3501955_9205_SOLARIS.zip /u01/app/oracle/patchset
$ cd /u01/app/oracle/patchset
$ unzip p3501955_9205_SOLARIS.zip
$ cpio -idmv < 9205_solaris_release.cpio
$ cd Disk1
$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be 5.6, 5.7, 5.8 or 5.9. Actual 5.9
Passed
Checking Temp space: must be greater than 250 MB. Actual 3100 MB Passed
Checking swap space: must be greater than 500 MB. Actual 3424MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2004-08-01_09-48-18PM. Please wait ...ORA920 on alex
: Oracle Universal Installer, Version 10.1.0.2.0 Production
Copyright (C) 1999, 2004, Oracle. All rights reserved.
Here is a sample of the screen shots that I used to install the newset Oracle Universal Installer (10.1.0.2.0):
Oracle9i 9.2.0.5.0 Patchset Installation Screen Responses
Screen Name
Choice
Welcome Screen
<Next>
File Locations
Source Path: /u01/app/oracle/patchset/Disk1/stage/products.xml
Destination Name: OracleHome920
Destination Path: /u01/app/oracle/product/9.2.0
<Next>
Select a Product to Install
Oracle 9iR2 Patch Set 9.2.0.5.0
Oracle Universal Installer 10.1.0.2.0
<Next>
Summary
<Install>
$ cd /u01/app/oracle/patchset/Disk1
$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be 5.6, 5.7, 5.8 or 5.9. Actual 5.9
Passed
Checking Temp space: must be greater than 250 MB. Actual 3100 MB Passed
Checking swap space: must be greater than 500 MB. Actual 3424MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2004-08-01_09-48-18PM. Please wait ...ORA920 on alex
: Oracle Universal Installer, Version 10.1.0.2.0 Production
Copyright (C) 1999, 2004, Oracle. All rights reserved.
Here is a sample of the screen shots that I used to install the 9.2.0.5.0 patch set
Oracle9i 9.2.0.5.0 Patchset Installation Screen Responses
Screen Name
Choice
Welcome Screen
<Next>
File Locations
Source Path: /u01/app/oracle/patchset/Disk1/stage/products.xml
Destination Name: OracleHome920
Destination Path: /u01/app/oracle/product/9.2.0
<Next>
Select a Product to Install
Oracle 9iR2 Patch Set 9.2.0.5.0
Oracle Universal Installer 10.1.0.2.0
<Next>
Summary
<Install>
$ cd /u01/app/oracle/product/9.2.0
$ su
Password: *******
# ./root.sh
Running Oracle9 root.sh script...
The following environment variables are set as:
ORACLE_HOME= /u01/app/oracle/product/9.2.0
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
# exit
$
After successfully running the root.sh script, go back to the dialog window
from the Oracle Universal Installer and click "OK" to continue.
At this point, the Oracle database software and required patchset have
been installed. Before moving on in creating our Oracle database, we should
first configure the Oracle Net software. If you have been following this
article, you will already have the necessary files to configure Oracle Net. The file
"oracle_920_installation_files.tar"
contains three files:
$ id
uid=175(oracle) gid=115(dba)
$ cd ~/oracle_920_installation_files
$ pwd
/u01/app/oracle/oracle_920_installation_files
$ cp listener.ora sqlnet.ora tnsnames.ora $ORACLE_HOME/network/admin
$ cd
$ lsnrctl start
LSNRCTL for Solaris: Version 9.2.0.5.0 - Production on 01-AUG-2004 22:22:32
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Starting /u01/app/oracle/product/9.2.0/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 9.2.0.5.0 - Production
System parameter file is /u01/app/oracle/product/9.2.0/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/9.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=2481))(PROTOCOL_STACK=(PRESENTATION=GIOP)(SESSION=RAW)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Solaris: Version 9.2.0.5.0 - Production
Start Date 01-AUG-2004 22:22:32
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /u01/app/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=2481))(PROTOCOL_STACK=(PRESENTATION=GIOP)(SESSION=RAW)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
We are now heading into the final strech - time to create an Oracle database. This section
will describe the steps to create an Oracle 9.2.0 database named ORA920 using
regular SQL scripts. If you have been following along with this article, I have already
included the SQL scripts required to create the database.
NOTE:
The scripts I have included for in this article were created from Oracle's
Database Configuration Assistant (DBCA) and slightly modified. If you wanted to
create the database on your own, you can simply use Oracle's DBCA
to create one with your own features and options. Simple export your DISPLAY
variable to poing to your local workstation and run dbca. For my
example below, the name of my workstation is bartman:
$ DISPLAY=bartman:0
$ export DISPLAY
$ dbca
$ cd ~/admin/ORA920/create
$ ./RUN_CRDB.sh
NOTE:
The database creation process can take anywhere from 40 minutes to well over an hour
depending on the speed of you server. During the database creation phase, you can
open another terminal session to the database server and monitor the creation
process by tailing the file crdb.log as follows:
$ id
uid=175(oracle) gid=115(dba)
$ cd admin/ORA920/create
$ tail -f crdb.log
Included in the file you downloaded and extracted earlier in this article
(oracle_920_installation_files.tar)
is a utility called dbora that may be used to automatically start and stop the Oracle
database and all the other Oracle routines. The dbora script may differ on every
database server only slightly as each database server has different requirements for handling
Apache, listener and other agents. The dbora script should be place in /etc/init.d.
$ su
# cp /u01/app/oracle/oracle_920_installation_files/dbora /etc/init.d
# cd /etc/init.d
# chmod 744 dbora
# chown root:sys dbora
# ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
# ln -s /etc/init.d/dbora /etc/rc3.d/S90dbora
# exit
NOTE:
Make sure to set the ORACLE_HOME shell variable in the dbora
file to the proper product set (version) you wish to use. This is
commonly the highest version of the Oracle you have installed on the machine.
$ id
uid=175(oracle) gid=115(dba)
$ cd oracle_920_installation_files
$ cp $ORACLE_HOME/bin/dbstart $ORACLE_HOME/bin/dbstart.original
$ cp $ORACLE_HOME/bin/dbshut $ORACLE_HOME/bin/dbshut.original
$ cp dbstart dbshut $ORACLE_HOME/bin
Change Oracle Database Environment
In many cases, you will have more than one database running
on your single database server. It is even possible to be using
two different databases running on different releases of the
Oracle database software.
(i.e. Oracle 8.1.7 and Oracle 9.2.0). For example, you may
have two database - ORA817 (using Oracle release 8.1.6) and
ORA920 (using Oracle release 9.2.0). When logged in to
the database server, you may need to switch your environment variables
to switch between these two databases. This would require you update
environment variables like ORACLE_HOME, ORACLE_SID,
PATH, LD_LIBRARY_PATH, etc. Although this can be
done manually at the command line, it can get old real quick. Instead
you can use a single command line script to switch between all
database environments declared in your /var/opt/oracle/oratab
file.
Lock Down Default Accounts
$ . oraenv
ORACLE_SID = [ORA920] ? ORA817
Notice that in the above example, we didn't just run the oraenv script,
but rather, we sourced it by using a dot followed by a space and then the
script name
Lock the following accounts using:
Starting the Oracle Intelligent Agent
SQL> alter user <USERID> account lock;
Now let's look at how to start the Oracle
Intelligent Agent (OIA). Note that in the section
Configure Oracle Net,
I included a pretty generic listener.ora file that
will not allow the OIA to recognize and discover the
Oracle SID ORA920. In order for the OIA to discover
this SID, you will need to edit the listener.ora file
to include the ORA920 database.
Re-linking the Product Set
listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(PROTOCOL_STACK =
(PRESENTATION = TTC)
(SESSION = NS)
)
)
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(ADDRESS = (PROTOCOL = IPC)(KEY = ORA920_ALEX.IDEVELOPMENT.INFO))
(ADDRESS = (PROTOCOL = IPC)(KEY = ORA920_ALEX))
)
(PROTOCOL_STACK =
(PRESENTATION = TTC)
(SESSION = NS)
)
)
)
CONNECT_TIMEOUT_LISTENER = 10
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/9.2.0)
(PROGRAM = extproc)
(ENVS="EXTPROC_DLLS=ANY")
)
(SID_DESC =
(GLOBAL_DBNAME = ORA920_ALEX.IDEVELOPMENT.INFO)
(SID_NAME = ORA920)
(ORACLE_HOME = /u01/app/oracle/product/9.2.0)
)
)
$ lsnrctl stop
$ lsnrctl start
Now that we have the listener setup, let's start
the Oracle Intelligent Agent
$ agentctl start
DBSNMP for Solaris: Version 9.2.0.5.0 - Production on 03-AUG-2004 19:15:02
Copyright (c) 2003 Oracle Corporation. All rights reserved.
Starting Oracle Intelligent Agent...
Agent started
To verify that the OIA did indeed recognize our database,
do a head on the file snmp_ro.ora to verify the
snmp.visibleservices entry:
$ head -n 1 snmp_ro.ora
snmp.visibleservices = (listener, ORA920_ALEX.IDEVELOPMENT.INFO)
The Oracle Intelligent Agent requires a database logon for each SID that
it manages. By default this account is called "dbsnmp" and the password
is "dbsnmp". The account name and/or password can be changed from the
default but you will need to make a few additional modifications.
In the examples below, you will need to replace any information
with brackets < > with the information from your system.
$ agentctl stop
SNMP.CONNECT.<connect_string>.NAME=<username>
SNMP.CONNECT.<connect_string>.PASSWORD=<password>
NOTE:
The variable <connect_string> is the exact listing of
the database name as it appears in the snmp_ro.ora file.
snmp.connect.ORA920_ALEX.IDEVELOPMENT.INFO.name=dbsnmp
snmp.connect.ORA920_ALEX.IDEVELOPMENT.INFO.password=manager
NOTE:
The above 2 lines are case-sensitive and the OIA keywords (not the service names)
must be listed in lower case letters or the parameters will be ignored.
$ chmod 600 $ORACLE_HOME/network/admin/snmp_rw.ora
$ ls -al $ORACLE_HOME/network/admin/snmp_rw.ora
-rw------- 1 oracle dba 259 Aug 3 19:18 /u01/app/oracle/product/9.2.0/network/admin/snmp_rw.ora
SQL> alter user DBSNMP identified by <newpassword>
Here is how I changed the password for DBSNMP:
SQL> alter user DBSNMP identified by manager;
$ agentctl start
NOTE:
New in Oracle9i, if the password is changed in the snmp_rw.ora file, the
first time the agent is started the parameter listed above will change and the
password will become encrypted. This ensures the password is secure for this
account. As a side note, some platforms will not allow white spaces around the
equal sign. Here is a snippet of the two lines I added to the snmp_rw.ora file
to change the default password of the DBSNMP password:
snmp.connect.ORA920_ALEX.IDEVELOPMENT.INFO.name=dbsnmp
snmp.connect.ORA920_ALEX.IDEVELOPMENT.INFO.encryptedpassword="8bfa724579334d65"
$ sqlplus system/manager
SQL> select username from v$session where username = 'DBSNMP';
USERNAME
--------------
DBSNMP
DBSNMP
The query should return two records as shown above.
The Oracle9i product set does not use the Oracle Installer
to re-link objects. It is all done through the re-link command in the
$ORACLE_HOME/bin directory. If you should find it necessary
to need to re-link the Oracle product, run the following as the
oracle user id:
$ cd $ORACLE_HOME/bin
$ relink all
Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author,
and an Oracle ACE.
Jeff currently works as a Senior Database Administrator for
The DBA Zone, Inc. located in Pittsburgh, Pennsylvania.
His work includes advanced performance tuning, Java and PL/SQL programming, capacity
planning, database security, and physical / logical database design in a UNIX,
Linux, and Windows server environment. Jeff's other interests include mathematical
encryption theory, programming language processors (compilers and interpreters)
in Java and C, LDAP, writing web-based database administration tools, and of
course Linux. He has been a Sr. Database Administrator and Software Engineer
for over 16 years and maintains his own website site at:
http://www.iDevelopment.info.
Jeff graduated from Stanislaus State University in Turlock,
California, with a Bachelor's degree in Computer Science.
Tuesday, 22-Jan-2008 23:15:15 EST
Page Count: 9996