Archive for September, 2011

Upgrading a database manually from to linux

September 28, 2011 2 comments

Steps for upgrading a database manually

backup up the database

rman "target / nocatalog"
BACKUP DATABASE FORMAT 'some_backup_directory%U' TAG before_upgrade;
BACKUP CURRENT CONTROLFILE FORMAT 'controlfile location and name';

Prepare the new oracle home

Copy the spfile and password file from $OLD_ORACLE_HOME/dbs to $NEW_ORACLE_HOME

If you are upgrading a cluster database , then set the CLUSTER_DATABASE initialization parameter to false

Upgrade the database

1. Shutdown the instance


2. Amend the entry in /etc/oratab for the database you are upgrading to point to the new home

3. The following environment variables point to the Oracle Database 11g Release 2 ( directories:

4. Log in to the system as the owner of the Oracle Database 11g Release 2 ( Oracle home directory

5. At a system prompt, change to the ORACLE_HOME/rdbms/admin directory

6. Start SQL*Plus.

7. Connect to the database instance as a user with SYSDBA privileges.

8. Start the instance by issuing the following command:


9. Set the system to spool results to a log file for later verification of success:
SQL> spool /tmp/upgrade.log

10. Run the Pre-Upgrade Information Tool by executing the utlu112i.sql script:
SQL> @utlu112i.sql

11. Run the catupgrd.sql script:
SQL> @catupgrd.sql

12. Restart the instance to reinitialize the system parameters for normal operation.

13. Run utlu112s.sql, the Post-Upgrade Status Tool, which provides a summary of the upgrade at the end of the spool log.
Run utlu112s.sql to display the results of the upgrade as follows:
SQL> @utlu112s.sql

14. Run catuppst.sql, located in the ORACLE_HOME/rdbms/admin directory, to perform upgrade actions that do not require
the database to be in UPGRADE mode:
SQL> @rdbms/admin/catuppst.sql

15. Run utlrp.sql to recompile any remaining stored PL/SQL and Java code.
SQL> @utlrp.sql

Verify that all expected packages and classes are valid:
SQL> SELECT count(*) FROM dba_invalid_objects;
SQL> SELECT distinct object_name FROM dba_invalid_objects;

16. Exit SQL*Plus.

17. If you are upgrading a cluster database from releases 10.2, 11.1, or, then upgrade the database configuration in Oracle Clusterware using the following command:

$ srvctl upgrade database -d db-unique-name -o oraclehome
where db-unique-name is the database name assigned to it (not the instance name), and oraclehome is the Oracle home location in which the database is being upgraded.

Rerunning the Upgrade

You can rerun the upgrade with the catupgrd.sql script as described in the following steps.

To rerun the upgrade

1.Shut down the database as follows:

2.Restart the database in UPGRADE mode:

3.Set the system to spool results to a log file for later verification of success:

SQL> SPOOL upgrade.log
4.Rerun catupgrd.sql:

SQL> @catupgrd.sql

You can rerun the catupgrd.sql script as many times as necessary. The first time you run the script, there should be no error messages returned. If you rerun the script, then the ORA-00001 message is displayed. You can safely ignore this message.
5.Rerun utlu112s.sql:

SQL> @utlu112s.sql


Cancelling the Upgrade

If you completed the steps in “Backing Up the Database” to back up your database,
then the easiest way to cancel the upgrade is to restore that backup as described in the following procedure.

To cancel the upgrade by restoring the previous backup

1.Log in to the system as the owner of the Oracle home directory of the previous release.

2.Sign on to RMAN:

rman “target / nocatalog”
3.Issue the following RMAN commands:

    RESTORE CONTROLFILE FROM ‘save_controlfile_location’;
    RESTORE DATABASE FROM TAG before_upgrade

Categories: Oracle

cloning an oracle 11g R2 home

September 27, 2011 Leave a comment

Check the oracle home to clone

[oracle@uk-yo-dbmon01 OPatch]$./opatch lsinv

Check the Oracle home size

 [oracle@uk-yo-dbmon01 db_1]$ cd /oracle/app/product/11.2.0/db_1
 [oracle@uk-yo-dbmon01 db_1]$ du -h . | tail -1


Create the directory structre on the remote server and change the ownership to oracle

[oracle@uk-yo-dbmon02 db_1]$mkdir -p /u01/app/oracle/product/

[oracle@uk-yo-dbmon02 db_1]$chown -R oracle:oinstall /oracle

On the source server zip the contents of the oracle home and transfer to the remote server

[oracle@uk-yo-dbmon01 db_1]$cd /oracle/app/product/11.2.0/db_1

[oracle@uk-yo-dbmon01 db_1]$tar cvf - . | ( ssh  uk-yo-dbmon01 "cd /oracle/app/product/11.2.0/db_1 ; tar xvf -" )

Check the total size on the remote server of the Oracle Home

 [oracle@uk-yo-dbmon02 db_1]$ cd /oracle/app/product/11.2.0/db_1

 [oracle@uk-yo-dbmon02 db_1]$ du -h . | tail -1


Start the cloning process using OUI

if the remote server has been cloned from the source server you need to detach the inventory

[oracle@uk-yo-dbmon02 db_1] $ cd /oracle/app/product/11.2.0/dbhome_1/oui/bin
[oracle@uk-yo-dbmon02 db_1] $./runInstaller -detachHome ORACLE_HOME="/oracle/app/product/11.2.0/db_1"

once the invetory is detached you can run the cloning process

[oracle@uk-yo-dbmon02 db_1]$./runInstaller -clone -silent -ignorePreReq ORACLE_HOME="/oracle/app/product/11.2.0/db_1" ORACLE_HOME_NAME="OraDb11g_home1" ORACLE_BASE="/oracle/app" OSDBA_GROUP=dba OSOPER_GROUP=dba

To find your Oracle_home_name , locate your  location of  your oraInventory from /etc/oraInst.loc and then view the contents of the /u01/app/oraInventory/ContentsXML/inventory.xml  file

execute as root the script

[oracle@uk-yo-dbmon02 db_1]$/oracle/app/product/11.2.0/dbhome_1/

Check the Cloned Home

[oracle@uk-yo-dbmon02 OPatch]$]$ opatch lsinv

Post Clone tasks

Update $ORACLE_HOME/network/admin and $ORACLE_HOME/dbs so that they match the source server

useful document from oracle

Cloning An Existing Oracle11g Release 2 (11.2.0.x) RDBMS Installation Using OUI [ID 1221705.1]
Connect as SYSDBA on 11.2 Cloned Home Gives “ORA-1031: Insufficient Privileges” Error [ID 1061788.1]
Cloning A Database Home And Changing The User/Group That Owns It [ID 558478.1]

Categories: Oracle

Install Oracle Grid Control 11g on Linux 64 Bit

September 14, 2011 Leave a comment

Download the following patches from Oracle

Grid software

Weblogic Software 



Invoke the software like

<Java_home>/bin/java -d64 -jar wls1032_generic.jar

Once the install is done  , you need to apply patch WDJ7   p9438213   to the WLS home before installing grid control . refer to note 1072763.1 for instructions to apply online/offline patch to WLS

Additional notes not mentioned in the metalink note

If you run the script as follows

./ -prod_dir=/u01/oracle/Middleware/wlserver_10.3 -patch_download_dir=/u01/oracle/Middleware/utils/bsu/cache_dir -patchlist=4D53,NIXN, ,XLXA -verbose -install -log=/tmp/error.log

and it  fails with errors –

Encountered unrecognized patch ID: 4D53

Encountered unrecognized patch ID: NIXN

Encountered unrecognized patch ID: XLXA

To fix this –

Rename the file patch-catalog_15563.xml as patch-catalog.xml in the cache_dir .

This completes the installation of web logic

Install Grid Control

Before you install grid control , make sure you have a database to install the grid control repository

Make sure the following parameters are set

sessions_cached_cursors  > = 200

log_buffer > =  10485760

processes > = 500

Grid  control also requires 200Mb  of undo tablespace

Also you will have to deconfigure dbconsole if its installed on the database

Single instance  

<Database_Oracle_Home>/bin/emca -deconfig dbcontrol db -repos drop -SYS_PWD <sys password> -SYSMAN_PWD <sysman_password>

RAC database

<Database_Oracle_Home>/bin/emca -deconfig dbcontrol db -repos drop  -cluster -SYS_PWD <sys password> -SYSMAN_PWD <sysman_password>

Go to the download location and invoke the ./runInstaller

For further instruction of Grid Install  refer to Oracle note  ID 1059516.1

Once you install has finished  you should be able to connect to the following URLS

Use the following URL to access:

1. Enterprise Manager Grid Control URL: <a href=""></a>

2. Admin Server URL: <a href=""></a>

The following details need to be provided during the additional OMS install:

1. Admin Server Hostname:

2. Admin Server Port: 7101

Other issues you will encouter with GRID control as as follows

After installing Grid Control, you may see the target “/secFarm_GCDomain/GCDomain/EMGC_ADMINSERVER/FMW Welcome Page Application(” reported as DOWN:

Steps to fix this issue

Patch 9431704 fixes this issue and is available via Oracle My Support. make sure you download the correct version of the patch or it will fail to install, also download the latest version of OPATCH from oracle support

Check the version of the software by running opatch lsinventory

Stop all Oracle Management Server processes:

Unzip patch 9431704

Set ORACLE_HOME to Middleware oracle_common directory and apply patch:

Start OMS processes:

After  applying this one-off patch, FMW Welcome Page Application should no longer be reported as down:

Another issue  reported on Grid console is

Incident (BEA-101020 [HTTP]) detected in …/user_projects/domains/GCDomain/servers/EMGC_OMS1/adr/diag/ofm/GCDomain/EMGC_OMS1/alert/log.xml

To resolve the above issue to need to apply a couple of patches to the agent  see oracle note 1139600.1

Download patch 9882856  , part of the patch you need to shut the agent down ,if you encounter the following error

Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.

You need to set the following env variables

export ORACLE_HOME=/u01/app/oracle/agent11g/
export LD_LIBRARY_PATH=/u01/app/oracle/agent11g/lib


You will also need to add the follwing so that the WLS incidents that match this regx are filtered

Edit the AGENT_HOME/sysman/config/  file and add the following


To manually clear the exisiting or old alert  you need to download and apply patch 9914120

another issue you may encounter is

EMD runCollection error:
host_storage::storage_reporting_data:snmhsutl.c:executable nmhs should have root suid enabled

Refer to oracle note ID 435793.1 , you probably forgot to run  from the agent home

specific to my environment after running i still had the above issue , the problem was that the /u01 mount where  the oracle software was installed was mounted with the nosuid .

useful documents from Oracle metalink

How to Download and Apply the Recommended WLS patch on WLS for 11g grid Control Installation or Upgrade [ ID 1072763.1]

How to Install Web Logic Server for Installing 11g grid Control [ ID 1063762.1]

NOTE:1059516.1 – Step by Step Installation of Enterprise Manager Grid Control
NOTE:1063112.1 – Grid Control 11g: Example for Installing WebLogic Server 10.3.2 on OEL 5.3 x86_64
NOTE:1063587.1 – Case Study – Installing Grid Control – Installation of jdk1.6 0n Linux x86_64 Before Installing WebLogic Server 10.3.2
NOTE:1064495.1 – Grid Control 11g: How to Install on OEL5.3 x86_64 with a Repository Database
NOTE:1071392.1 – How to de-install Web Logic Server (WLS) 10.3 ?
NOTE:1072763.1 – How to Download and Apply the Recommended WLS patch WDJ7 on WLS for 11g Grid Control Installation or Upgrade

Categories: Grid

ORA-00922: missing or invalid option

September 8, 2011 Leave a comment

if you get the above error when you create a database from the gui, make sre you have used a more user friendly password for sys and system

Check out the log file /u01/app/oracle/cfgtoollogs/dbca/<DBNAME>trace.log

[Thread-36] [ 2011-09-08 16:57:10.530 BST ] [SQLEngine.setSpool:1945]  old Spool  = null
[Thread-36] [ 2011-09-08 16:57:10.530 BST ] [SQLEngine.setSpool:1946]  Setting Spool  = /u01/app/oracle/cfgtoollogs/dbca/ORAREPOPR/postScripts.log
[Thread-36] [ 2011-09-08 16:57:10.530 BST ] [SQLEngine.setSpool:1947]  Is spool appendable? --> true
[Thread-36] [ 2011-09-08 16:57:11.508 BST ] [ClonePostCreateScripts.executeImpl:284]  OraNLSLanguage: ENGLISH
[Thread-42] [ 2011-09-08 16:57:11.521 BST ] [BasicStep.handleNonIgnorableError:430]  <a href="mailto:oracle.sysman.assistants.util.UIMessageHandler@28a7bd7a:messageHandler">oracle.sysman.assistants.util.UIMessageHandler@28a7bd7a:messageHandler</a>
[Thread-42] [ 2011-09-08 16:57:11.521 BST ] [BasicStep.handleNonIgnorableError:431]  ORA-00922: missing or invalid option




Categories: Oracle