Oracle DBA Tips Corner |
|
Installing Oracle8i Release 3 (8.1.7) 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_817_installation_files.tar"
as the Oracle User ID and place it in his HOME directory.
Oracle8i Release 3 (8.1.7) 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.
Oracle HTTP Server 1.3.12.0.1a
Oracle Product Options
Net8 Product Set
Oracle Utilities
Oracle Java Products
Oracle Enterprise Manager Products
Oracle Configuration Assistant
Development Tools
Oracle Installation Products
[*] Oracle8i for UNIX Documentation 8.1.7.0.0
<Next>
Installing the Oracle 8.1.7.4.0 Patchset
Before starting the installation of the Oracle 8.1.7.4.0 patchset, you will need to
verify and shutdown all Oracle processes. During the installation process (above) you
will notice that the Oracle Configuration Assistant started the Apache web server. You
will be required to shut this process down before continuing:
After shutting down all Oracle processes, you will then need to obtain the 8.1.7.4.0 patchset
from Metalink. Simply download the patchset "8174_solaris32_release.tar" to a temporary
directory. Extract the contents of this archive and run the Oracle Universal Installer to
install the patchset:
Configure Net8
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 - (ORA817)
If you would like to create the ORA817 (one in which installs all
Oracle options like JServer, Virage, Timeseries, SQL*Plus Help, Spatial, etc.)
I have included with this example, simply navigate to the directory
~oracle/admin/ORA817/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
Oracle8i Release 3 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 Oracle8i (8.1.7):
Here is a short introduction to some of the configuration parameters that will
be used for installing the Oracle database software:
Oracle8i 8.1.7 Documentation
Oracle8i Installation Guide Release 3 (8.1.7) for Sun SPARC Solaris - (A85471_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_817_installation_files.tar
x oracle_817_installation_files, 0 bytes, 0 tape blocks
x oracle_817_installation_files/admin.tar, 50176 bytes, 98 tape blocks
x oracle_817_installation_files/common.tar, 813568 bytes, 1589 tape blocks
x oracle_817_installation_files/crontabORA817.txt, 3450 bytes, 7 tape blocks
x oracle_817_installation_files/dbora, 8056 bytes, 16 tape blocks
x oracle_817_installation_files/dbshut, 2511 bytes, 5 tape blocks
x oracle_817_installation_files/dbstart, 4092 bytes, 8 tape blocks
x oracle_817_installation_files/local_bin.tar, 20480 bytes, 40 tape blocks
x oracle_817_installation_files/oratab, 746 bytes, 2 tape blocks
x oracle_817_installation_files/profile_oracle, 5903 bytes, 12 tape blocks
x oracle_817_installation_files/system, 1804 bytes, 4 tape blocks
$ cp oracle_817_installation_files/profile_oracle ~/.profile
$ tar xvf oracle_817_installation_files/admin.tar
$ tar xvf oracle_817_installation_files/common.tar
$ cp oracle_817_installation_files/oratab /var/opt/oracle/
$ (cd /opt/bin && tar xvf ~/oracle_817_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 Net8 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 Oracle8i, 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 hsfs /dev/.... /cdrom
$ cd
$ pwd
/u01/app/oracle
$ /cdrom/oracle8i/runInstaller
$ Initializing Java Virtual Machine from /tmp/OraInstall/jre/bin/jre. Please wait...
Oracle8i Software Installation Screen Responses
Screen Name
Choice
Welcome Screen
<Next>
File Locations
Source Path: /cdrom/oracle8i/stage/products.jar
Destination Path: /u01/app/oracle/product/8.1.7
<Next>
UNIX Group Name
UNIX Group Name: dba
<Next>
Available Products
Oracle8i Enterprise Edition 8.1.7.0.0
Oracle8i Client 8.1.7.0.0
Oracle8i Management and Integration 8.1.7.0.0
<Next>
Installation Types
Typical (1.01GB)
Minimal (836MB)
Custom
<Next>
Software Assessment Manager
[*] Oracle8i Server 8.1.7.0.0
[*] Oracle HTTP Server Extensions 8.1.7.0.0
[*] Apache Module for Oracle Servlet Engine 8.1.7.0.0
[*] Oracle Mod PL/SQL Gateway 3.0.0.4.0
[*] BC4J Runtime 3.2.1
[*] Apache Configuration for XML Developer's Kit 8.1.7.0.0
[*] Oracle Time Series 8.1.7.0.0
[*] Oracle Visual Information Retrieval 8.1.7.0.0
[*] Oracle Spatial 8.1.7.0.0
[ ] Oracle Advanced Security 8.1.7.0.0
[*] Oracle interMedia 8.1.7.0.0
[*] Advanced Replication 8.1.7.0.0
[*] Oracle Partitioning 8.1.7.0.0
[ ] Legato Storage Manager 8.1.7.0.0
[*] Net8 Client 8.1.7.0.0
[*] Net8 Server 8.1.7.0.0
[*] Oracle Names 8.1.7.0.0
[*] Oracle Connection Manager 8.1.7.0.0
[*] External Naming NIS 8.1.7.0.0
[ ] Oracle Protocol Support 8.1.7.0.0
[*] Oracle Database Utilities 8.1.7.0.0
[*] SQL*Plus 8.1.7.0.0
[*] Oracle JDBC Drivers 8.1.7.0.0 (All)
[*] Oracle SQLJ 8.1.7.0.0
[*] Oracle Java Tools 8.1.7.0.0
[*] Oracle Intelligent 8.1.7.0.0
[*] Oracle Agent Extensions 8.1.7.0.0
[ ] Oracle Management Server 2.2.0.0.0
[*] Oracle Enterprise Manager Client 2.2.0.0.0
[ ] Oracle Enterprise Manager Web Site 2.2.0.0.0
[*] Oracle Enterprise Manager Quick Tours 2.2.0.0.0
[*] Oracle Data Migration Assistant 8.1.7.0.0
[*] Oracle Database Configuration Assistant 8.1.7.0.0
[*] Oracle Call Interface (OCI) 8.1.7.0.0
[*] Oracle Type Translator 8.1.7.0.0
[*] Oracle XML Developer's Kit 8.1.7.0.0
[*] Oracle XML SQL Utility 2.0.0.0.0
[*] Oracle Universal Installer 1.7.1.8.0
Component Locations
<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".
NOTE:
There are times when Disk 2 will be mounted as /cdrom/oracle8i#1. It this
happens, the Oracle Universal Installer will not recognize it since it was started
from /cdrom/oracle8i. If this happens, you can simply create a symbolic
link as follows and go back to the dialog and hit "OK":
# cd /cdrom
# ln -s oracle8i#1 oracle8i
$ cd /u01/app/oracle/product/8.1.7
$ su
Password: *******
# ./root.sh
Running Oracle8 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/8.1.7
ORACLE_SID= ORA817
Enter the full pathname of the local bin directory: [/usr/local/bin]: /opt/bin
Entry will be added to the /var/opt/oracle/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.
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.
# 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 /otp/bin
$ cp oraenv.custom oraenv
$ eject cdrom
If you have been following this article, you will have just finished installing
Oracle8i (8.1.7.0.0). It is now time to apply the 8.1.7.4.0 patchset and that is
what we will be doing in this section.
$ $ORACLE_HOME/Apache/Apache/bin/apachectl stop
/u01/app/oracle/product/8.1.7/Apache/Apache/bin/apachectl stop: httpd stopped
$ mkdir /u01/app/oracle/patchset
$ mv 8174_solaris32_release.tar /u01/app/oracle/patchset
$ cd /u01/app/oracle/patchset
$ tar xvf 8174_solaris32_release.tar
$ cd
$ runInstaller
$ Initializing Java Virtual Machine from /u01/app/oracle/jre/1.1.8/bin/jre. Please wait...
Here is a sample of the screen shots that I used for the patchset install:
Oracle8i 8.1.7.4.0 Patchset Installation Screen Responses
Screen Name
Choice
Welcome Screen
<Next>
File Locations
Source Path: /u01/app/oracle/patchset/Disk1/stage/products.jar
Destination Path: /u01/app/oracle/product/8.1.7
<Next>
Summary
<Install>
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 Net8 software. If you have been following this
article, you will already have the necessary files to configure Net8. The file
"oracle_817_installation_files.tar"
contains three files:
$ id
uid=175(oracle) gid=115(dba)
$ cd ~/oracle_817_installation_files
$ pwd
/u01/app/oracle/oracle_817_installation_files
$ cp listener.ora sqlnet.ora tnsnames.ora $ORACLE_HOME/network/admin
$ cd
$ lsnrctl start
LSNRCTL for Solaris: Version 8.1.7.4.0 - Production on 31-JUL-2004 18:21:39
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Starting /u01/app/oracle/product/8.1.7/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 8.1.7.4.0 - Production
System parameter file is /u01/app/oracle/product/8.1.7/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/8.1.7/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=alex)(PORT=1521))(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=alex)(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 8.1.7.4.0 - Production
Start Date 31-JUL-2004 18:21:39
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/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/8.1.7/network/log/listener.log
Services Summary...
PLSExtProc has 1 service handler(s)
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 8.1.7 database named ORA817 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
$ dbassist
$ cd ~/admin/ORA817/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/ORA817/create
$ tail -f crdb.log
Included in the file you downloaded and extracted earlier in this article
(oracle_817_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_817_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_817_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
NOTE:
For Oracle 8.1.6 users, the DBA would need to modify the dbstart
script to recognize the JServer banner in SQL*Plus. This is a bug
with dbstart in the 8.1.6 release, but I always look for and include this
modified version of dbstart. In the included dbstart script,
I would have to add the following to line 64 of the dbstart script.
/(PL\/SQL|JServer) (Release|Version)/ {substr($3,1,3) ;
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.6 and Oracle 8.1.7). For example, you may
have two database - ORA816 (using Oracle release 8.1.6) and
ORA817 (using Oracle release 8.1.7). 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 = [ORA817] ? ORA816
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 Net8,
I included a pretty generic listener.ora file that
will not allow the OIA recognize and discover the
Oracle SID ORA817. In order for the OIA to discover
this SID, you will need to edit the listener.ora file
to include the ORA817 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 = TCP)(HOST = localhost)(PORT = 2481))
)
(PROTOCOL_STACK =
(PRESENTATION = GIOP)
(SESSION = RAW)
)
)
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
(ADDRESS = (PROTOCOL = IPC)(KEY = ORA817_ALEX.IDEVELOPMENT.INFO))
(ADDRESS = (PROTOCOL = IPC)(KEY = ORA817_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/8.1.7)
(PROGRAM = extproc)
(ENVS="EXTPROC_DLLS=ANY")
)
(SID_DESC =
(GLOBAL_DBNAME = ORA817_ALEX.IDEVELOPMENT.INFO)
(SID_NAME = ORA817)
(ORACLE_HOME = /u01/app/oracle/product/8.1.7)
)
)
$ lsnrctl stop
$ lsnrctl start
Now that we have the listener setup, let's start
the Oracle Intelligent Agent
$ lsnrctl dbsnmp_start
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, ORA817_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.
$ lsnrctl dbsnmp_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.ORA817_ALEX.IDEVELOPMENT.INFO.NAME=dbsnmp
SNMP.CONNECT.ORA817_ALEX.IDEVELOPMENT.INFO.PASSWORD=manager
$ chmod 600 $ORACLE_HOME/network/admin/snmp_rw.ora
$ ls -al $ORACLE_HOME/network/admin/snmp_rw.ora
-rw------- 1 oracle dba 259 Aug 1 12:20 /u01/app/oracle/product/8.1.7/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;
$ lsnrctl dbsnmp_start
$ 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 Oracle8i 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:21:43 EST
Page Count: 7119