Category Archives: oracle 9i

Oracle – Profile for single User owning multiple databases with Single

In test and development database environments, it is desirable to use one Oracle installation for multiple databases. The use of a single Oracle installation for multiple databases reduces the amount of space being used and creates a single place for update of binary files. This is easily accommodated in a LINUX or UNIX environment through the proper setting of your .profile or .bash_profile file. In this article we will review the configuration of your profile file to use a single Oracle home with multiple databases.

1. To accomplish the setup of our profile for multiple databases on a single ORACLE_HOME, we will have to create a .profile with three sections: 1. Request for information; 2. Local variables definitions; and 3. global variables definitions. The request for information section will appear to the user upon logon or re-initialization of the .profile and determines which database the user wishes to use. The local variable section defines the variables need to connect to a particular database. The global variable section defines the variables which will be the same regardless of our connection to a certain database.

2. The request for information section defines the variable “database” which is used to set the ORACLE_SID variable, as seen below.

## Beginning of request for information
database=””
while [ -z “$database” ]
do
echo “\n\nEnter database & Oracle version to use:”
echo “1 – ORCL 10.2.0.4 ”
echo “2 – ORCL2 10.2.0.4”
echo “3 – ORCL3 10.2.0.4”
print -n “> ”
read database
if [[ “$database” != “1” &&
“$database” != “2” &&
“$database” != “3” ]]
then
echo “$database” is not valid >&3
database=””
fi
done
## Ending of request for information

3. The local variable section defines all variables for a specific database, as seen below.

##Beginning of local variable definitions
if [[ $database = “1” ]]
then
export ORACLE_SID=orcl
elif [[ $database = “2” ]]
then
export ORACLE_SID=orcl2
elif [[ $database = “3” ]]
then
export ORACLE_SID=orcl3
else
echo “Invalid options ”
fi
## Ending of local variable definitions

4. The global variable section defines all variables for any database using this specific ORACLE_HOME, as seen below.

## Beginning of global variable definitions

export NLS_LANG=AMERICAN_AMERICA.US7ASCII
export ORACLE_BASE=/opt/app/oracle/product
export ORACLE_HOME=/opt/app/oracle/product/10.2
export PATH=.:/opt/perl/bin:$PATH:$ORACLE_HOME/bin
export SHLIB_PATH=$ORACLE_HOME/lib:/usr/lib:/opt/java1.3
export TNS_AMDIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/obackup/bin
export ORACLE_TERM=vt220

cd

echo “Your ORACLE_BASE is set to ‘$ORACLE_BASE'”
echo “Your ORACLE_SID is set to ‘$ORACLE_SID'”
echo “Your ORACLE_HOME is set to ‘$ORACLE_HOME'”

umask 022
export PS1=$ORACLE_SID” $ ”
stty erase ^?
export LINES=24
export COLUMNS=80
export PATH=$PATH:/opt/java1.5:/opt/java1.5/bin

## Ending of global variable definitions

5. Place all profile sections into one file named .profile from UNIX or .bash_profile for linux under your /home/{username} directory. In this example, I will place the following text in the file /home/lcatt/.profile for the OS user lcatt.

## Beginning of request for information
database=””
while [ -z “$database” ]
do
echo “\n\nEnter database & Oracle version to use:”
echo “1 – ORCL 10.2.0.4 ”
echo “2 – ORCL2 10.2.0.4”
echo “3 – ORCL3 10.2.0.4”
print -n “> ”
read database
if [[ “$database” != “1” &&
“$database” != “2” &&
“$database” != “3” ]]
then
echo “$database” is not valid >&3
database=””
fi
done
## Ending of request for information

##Beginning of local variable definitions
if [[ $database = “1” ]]
then
export ORACLE_SID=orcl
elif [[ $database = “2” ]]
then
export ORACLE_SID=orcl2
elif [[ $database = “3” ]]
then
export ORACLE_SID=orcl3
else
echo “Invalid options ”
fi
## Ending of local variable definitions

## Beginning of global variable definitions

export NLS_LANG=AMERICAN_AMERICA.US7ASCII
export ORACLE_BASE=/opt/app/oracle/product
export ORACLE_HOME=/opt/app/oracle/product/10.2
export PATH=.:/opt/perl/bin:$PATH:$ORACLE_HOME/bin
export SHLIB_PATH=$ORACLE_HOME/lib:/usr/lib:/opt/java1.3
export TNS_AMDIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/obackup/bin
export ORACLE_TERM=vt220

cd

echo “Your ORACLE_BASE is set to ‘$ORACLE_BASE'”
echo “Your ORACLE_SID is set to ‘$ORACLE_SID'”
echo “Your ORACLE_HOME is set to ‘$ORACLE_HOME'”

umask 022
export PS1=$ORACLE_SID” $ ”
stty erase ^?
export LINES=24
export COLUMNS=80
export PATH=$PATH:/opt/java1.5:/opt/java1.5/bin

## Ending of global variable definitions

6. Change directory to your home directory with command cd, list current user with command id, and Re-initialize your .profile file as shown below:

$ orcl $ cd
orcl $ id uid=103(lcatt) gid=20(users) groups=200(dba)
orcl $ . ./.profile

7. Upon re-initialization of the profile, you will be able to select the database environment you wish, as seen below. In this example we have select 1 to setup the variables for the database ORCL.

Enter database & Oracle version to use:
1 – ORCL 10.2.0.4
2 – ORCL2 10.2.0.4
3 – ORCL3 10.2.0.4
> 1
Your ORACLE_BASE is set to ‘/opt/app/oracle/product’
Your ORACLE_SID is set to ‘orcl’
Your ORACLE_HOME is set to ‘/opt/app/oracle/product/10.2’
orcl $

This completes setup of .profile for multiple databases using the same oracle home.

Larry J. Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch Oracle database still running: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. In this article we will cover the error which would be received when you attempt to apply an Oracle patch to a currently executing Oracle database.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch apply

conflicts against Oracle Home…
OPatch continues with these patches: 7155248 7155249 7155250 7155251
7155252 7155253 7155254 7197583 7375611 7375613 7375617 7609057 7609058
8309592 8309632 8309642 8568395 8568397 8568398 8568402 8568404 8568405
8836667 8836671 8836675 8836677 8836678 8836681 8836683 8836684 8836686
9119226 9173244 9173248 9173253

Do you want to proceed? [y|n]
y
User Responded with: Y

Running prerequisite checks…
Prerequisite check “CheckActiveFilesAndExecutables” failed.
The details are:

Following executables are active :
/u01/prism/oracle/product/10.2.0/db_1/bin/oracle
UtilSession failed: Prerequisite check “CheckActiveFilesAndExecutables” failed.

OPatch failed with error code 73
mylinux :>

4. As seen above the OPatch utility errored out with code 73 and references the Prerequisite check “CheckActiveFilesAndExecutables”. This error normally occurs when the Oracle database is still up and running, so we check it below with the command ps:

mylinux :> ps -ef|grep smon
cimsora 26981 1 0 02:12 ? 00:00:00 ora_smon_prism
cimsora 4326 11581 0 02:34 pts/1 00:00:00 grep smon

5. As seen above the database is in fact up, so logon as sysdba and shut it down.

mylinux :> sqlplus ‘/ as sysdba’

SQL*Plus: Release 10.2.0.4.0 – Production on Sun Feb 2802:38:36 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit

6. Once the database is shutdown we can re-execute our OPatch install.

Larry J Catt, OCP9i, 10g
oracle@allcompute.com
www.allcompute.com

Wrong OPatch utility for CPU being applied: Code 14

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. In this article we will cover the error which would be received when you use OPatch options that are not supported by your currently installed OPatch utility.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You receive the following error or similar error during installation.

ORCL :> OPatch napply -skip_subset -skip_duplicate
Invoking OPatch 10.2.0.3.0

Oracle interim Patch Installer version 10.2.0.3.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..

Syntax Error… Unrecognized Command or Option: failed to parse arguments
“unknown option ‘-skip_subset'”
Please use the option ‘OPatch -help’ to get correct syntax

OPatch failed with error code 14
ORCL :>

5. This error is being generated because OPatch 10.2.0.3.0 did not support the napply option or its tags. The solution is to download the latest Oracle Patch 6880880, containing the OPatch utility, and unzip it in your ORACLE_HOME directory.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch picks up incorrect Home from OraInst.loc: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. OPatch uses the OraInst.loc file located in /etc or /var/opt/oracle depending on your OS to determine what needs to be applied during patch installation. In this article we will cover the error which would be received if your OraInst.loc file points at the incorrect home or contains invalid information.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You receive the following error or similar error during installation.

Oracle Interim Patch Installer version 10.2.0.4.9
Copyright (c) 2009, Oracle Corporation. All rights reserved.

Oracle Home : /app/oracle/product/10.2.0
Central Inventory : /app/agent10g
from : /var/opt/oracle/oraInst.loc
OPatch version : 10.2.0.4.9
OUI version : 10.2.0.4.0
OUI location : /app/oracle/product/10.2.0/oui
Log file location : /app/oracle/product/10.2.0/cfgtoollogs/OPatch/OPatch2010
-02-20_14-48-27PM.log

Patch history file:
/app/oracle/product/10.2.0/cfgtoollogs/OPatch/OPatch_history.txt

List of Homes on this system:

Home name= agent10g, Location= “/app/agent10g”
Inventory load failed… OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
Oracle Home dir. path does not exist in Central Inventory
Oracle Home is a symbolic link
Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

OPatch failed with error code 73

5. As seen by the error message, the OPatch utility is picking up the incorrect inventory location from the file OraInst.loc. Open up the OraInst.loc file, correct the location of your inventory directory, and re-execute OPatch.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch apply lib .so file not writable: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. In this article we will cover the error which would be received if the file permissions in your Oracle Home are not correctly set and a work-around to continue your patch installation.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You receive the following error or similar error during installation.

Running prerequisite checks…
Prerequisite check “CheckApplicable” failed.
The details are:

Patch 8568398:
Copy Action: Desctination File “/app/oracle/product/10.2.0/lib/libjox10.so”
is not writeable.
‘oracle.rdbms, 10.2.0.4.0’: Cannot copy file from ‘libjox10.so’ to
‘/app/oracle/product/10.2.0/lib/libjox10.so’

UtilSession failed: Prerequisite check “CheckApplicable” failed.

OPatch failed with error code 73
$

5. The OPatch utility was unable to update one of the lib files for installation, due to a file permission error. To resolve this issue, change directories to your ORACLE_HOME/lib directory.

$ cd /app/oracle/product/10.2.0/lib/

6. Check the existence of the lib file in question with the command ls.

$ ls libjox10.so
-r-xr-xr-x 1 fpdfqt dba 20041728 Jan 07 2009 libjox10.so

7. Make a backup copy of this lib file with the command cp.

$ cp libjox10.so libjox10.so_bak

8. Change permission on the lib file in question.

$ chmod 777 libjox10.so
$

8. Attempt re-installation of your Oracle patch with the OPatch utility.

OPatch napply -skip_subset -skip_duplicate

Return Code = 0

The local system has been patched and can be restarted.

UtilSession: N-Apply done.

OPatch succeeded.
$

As seen above the patch set is successfully installed.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

Oracle OUI installer fails with operating system version verification:

In some OS version the Oracle Universal Installer will fail with verification of OS. You can by pass this failure with the -ignoresysprereqs tag while execution runInstaller. The following procedure demonstrates the use of this tag.

1. Move to the location of you Oracle binary installer files in this case we have stored our Oracle binaries under /opt/oracle/software/linux/10.2.0.1/database

cd /opt/oracle/software/hp/10.2.0.1/database

2. List the files located under this directory.

myhpux:> ls
doc response stage
install runInstaller welcome.html
myhpux:>

3. If you are performing a remote installation, insure to set your display variable to the appropriate IP address of you client machine. Example: If my client machines IP is 192.168.0.110

myhpux:> export DISPLAY=192.168.0.110:0.0

4. Execute the runInstaller shell script to begin your installation.

myhpux:> ./runInstaller
Starting Oracle Universal Installer…

Checking installer requirements…

Checking operating system version: must be B.11.23. Actual B.11.31
Failed < <<< Exiting Oracle Universal Installer, log for this session can be found at /tmp/OraInstall2010-03-21_08-25-19AM/installActions2010-03-21_08-25-19AM.log mylinux:>

5. NOTE: The installer has failed with with an OS verification error, even though the OS is a higher level then required.

6. Re-execute the runInstaller shell script with the tag -ignoresysprereqs and the Oracle Universal Installer will start as normal.

myhpux:> ./runInstaller -ignoresysprereqs
Starting Oracle Universal Installer…

Checking installer requirements…

Checking operating system version: must be B.11.23. Actual B.11.31
Failed < <<< >>> Ignoring required pre-requisite failures. Continuing…

Preparing to launch Oracle Universal Installer from
/tmp/OraInstall2010-03-21_08-54-42AM. Please wait …myhpux:> Oracle Universal
Installer, Version 10.2.0.1.0 Production
Copyright (C) 1999, 2005, Oracle. All rights reserved.

The OUI (Oracle Universal Installer) ignores the OS version and starts up normally to complete your Oracle installation.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch using 64 bit linux CPU on a 32 bit linux Oracle home: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. When installing any oracle patch set it is important to know the bit count of your current Oracle binaries. In this article we will cover the error which would be received when you attempt to install a 64 bit patch on a 32 bit Oracle home

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You are under the assumption that you have a 64 bit Oracle home which is platform ID 226. However, you’re true Oracle home is 32 bit or platform ID 46. The following error message is the result.

OPatch2010-03-02_02-29-19AM.log:Platform IDs supported by patch are: 226 Patch (
8836667 ) is not applicable on current platform.
OPatch2010-03-02_02-29-19AM.log:Platform IDs supported by patch are: 226 Patch (
8836684 ) is not applicable on current platform.
ISM :> vi OPatch2010-03-02_02-29-19AM.log
Platform ID needed is : 46
Platform IDs supported by patch are: 226 Patch ( 9173253 ) is not applicable on
current platform.
Platform ID needed is : 46
Platform IDs supported by patch are: 226
SEVERE:OUI-67073:UtilSession failed: Prerequisite check
“CheckPatchApplicableOnCurrentPlatform” failed.
INFO:Finishing UtilSession at Sun Feb 28 02:33:02 EDT 2010
INFO:Stack Description: java.lang.RuntimeException: Prerequisite check
“CheckPatchApplicableOnCurrentPlatform” failed.
INFO:StackTrace: oracle.OPatch.OPatchSessionHelper.runApplyPrereqs(OPatchSession
Helper.java:4173)
INFO:StackTrace: oracle.OPatch.OPatchutil.NApply.process(NApply.java:2057)
INFO:StackTrace: oracle.OPatch.OPatchutil.OUSession.napply(OUSession.java:868)
INFO:StackTrace: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO:StackTrace:
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO:StackTrace: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMetho
dAccessorImpl.java:25)
INFO:StackTrace: java.lang.reflect.Method.invoke(Method.java:324)
INFO:StackTrace: oracle.OPatch.UtilSession.process(UtilSession.java:313)
INFO:StackTrace: oracle.OPatch.OPatchSession.main(OPatchSession.java:1993)
INFO:StackTrace: oracle.OPatch.OPatch.main(OPatch.java:630)

5. The solution is to logon to www.metalink.oracle.com and download the correct bit version for your platform.

Larry Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch platform id 46-linux not 59-hpux: Code 73

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. Oracle Corporation uses a numbering system for its patch sets which do not change across differing OS layers. Though the patch number would be the same for differing operating systems, the actual binary files are specific. In this article we will cover the error which would be received when you attempt to apply a CPU for HPUX on a LINUX OS.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. You receive the following error.

Platform ID needed is : 46
Platform IDs supported by patch are: 59 Patch ( 9173253 ) is not applicable on
current platform.
Platform ID needed is : 46
Platform IDs supported by patch are: 59
UtilSession failed: Prerequisite check “CheckPatchApplicableOnCurrentPlatform”
failed.

OPatch failed with error code 73

5. The error produced specifies the current platform ID is 46 – LINUX, however you are attempting to apply a CPU for platform ID of 59 –HPUX.

6. The resolution is to download the correct patch from www.metalink.oracle.com for your specific OS.

Larry Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com

OPatch utility error due to incorrect option: Code 14

Oracle’s OPatch utility is used for applying interim CPU patches to maintain the security of your RDBMS. In this article we will cover the error which would be received if you pass an unknown variable to the OPatch utility. This error message will appear regardless of OS you are trying to apply.

1. Logon to your Oracle database server as the Oracle software owner.

2. Change directories to the location of your CPU patch and unzip the file.

unzip p9119226_10204_.zip

3. Change directories into your unzipped patch directory which is named with the CPU number you are applying.

cd 9119226
OPatch napply -skip_subset -skip_duplicate

4. Execute OPatch napply with the wrong tag –skip_subnet instead of –skip_subset.

mylinux:> OPatch napply -skip_subnet -skip_duplicate
Invoking OPatch 11.2.0.1.2

Oracle Interim Patch Installer version 11.2.0.1.2
Copyright (c) 2010, Oracle Corporation. All rights reserved.

Syntax Error… Unrecognized Command or Option: failed to parse arguments
“unknown option ‘-skip_subnet'”
Please use the option ‘OPatch -help’ to get correct syntax

OPatch failed with error code 14
mylinux:>

5. Above the OPatch utility errors out with code 14, “UNKOWN OPTION”. Reviewing the tags used, you can see that skip_subset is misspelled. NOTE: This error will occur if a misspelling is present in the tag or you give the utility a tag which does not exist.

6. Re-execute the OPatch utility with correct tags and the utility will complete successfully.

mylinux:> OPatch napply -skip_subset -skip_duplicate
Invoking OPatch 11.2.0.1.2

Oracle Interim Patch Installer version 11.2.0.1.2
Copyright (c) 2010, Oracle Corporation. All rights reserved.

UTIL session

Patch : 9119226

Do you want to proceed? [y|n]

Response = y
OPatch Session completed without warnings.

OPatch completed without warnings.
mylinux:>

This completes the correction of OPatch utility error code 14.

Larry J Catt, OCP 9i, 10g
oracle@allcompute.com
www.allcompute.com