facebook twitter youtube facebook facebook facebook

E-Mail : info@askmlabs.com

Phone : +1.215.353.8306

Latest Post

Blocking And Unblocking OEM Agent in OEM 12c

Written By askMLabs on Monday, December 31, 2012 | 9:02 AM

In this present short demo, i am going to show you how to block and unblock an oem agent manually in oem 12c. There might be various reasons an oem agent may into a blocked state and this demo shows you how to unblock it.

The reasons that the agent may go into blocked state are ..
If there is any network break between oem agent and oms server
If there is any space issue on oms server and oem agent can't upload the metrics data to oms server


This demo does not contain any voice and the navigations are self explanatory. Leave your comments if you have any doubts.





Thanks

SRI

Oracle OpenWorld 2012 Update

Written By askMLabs on Monday, October 1, 2012 | 5:16 PM

Larry Ellison's major  announcements in OracleOpenWorld-2012

  1. IaaS  => Infrastructure as a Service

  2. Private Clouds

  3. Oracle Database 12c

  4. Exadata X3 machine.




Thanks
SRIKRISHNA MURTHY

COPY Schema into Same Database with impdp

Written By askMLabs on Thursday, June 7, 2012 | 4:10 PM

In this article I am going to explain the procedure to copy a schema to a different schema in the same database without exporting the source schema. This procedure works fine if you want to copy the schema to a different database.
  1. Create a directory pointing to any physical directory on the server 
  2. Create a loopback database link. It means, you have to create a database link pointing to the same database.  
NOTE : If your requirement is to copy schema to a different schema, create a database link pointing to target database. 
  1. Use the impdp to copy schema to another schema.
Assume that the database name is DB-A. I am trying to copy a schema SCOTT to a different schema SCOTT_NEW in the same database.

SQL> create a directory TEST_DIR as ‘/xxxx/exp-dir/’;
SQL> create a database link SCOTT_DB_LINK connect to SYSTEM identified by  xxxxxxx using ‘DB-A’;
If you are trying to copy schema to a different database , say DB-B , create database link as follows.
SQL> create a database link SCOTT_DB_LINK connect to system identified by xxxxx using ‘DB-B’;
(NOTE : We should be able to resolve the alias DB-A to database A and DB-B to database B.)

Verify the database link
SQL> select * from dual@SCOTT_DB_LINK;
Use the following syntax to copy schema,
impdp system/xxxxxx schemas=SCOTT directory=TEST_DIR network_link=SCOTT_DB_LINK  remap_schema=SCOTT:SCOTT_NEW logfile=TEST_DIR:SCOTT_NEW.log
Verify the new schema with the source schema with following commands.
SQL> select object_type,count(1) from dba_objects where owner='SCOTT' and status='INVALID' group by object_type;
SQL> select object_type,count(1) from dba_objects where owner='SCOTT_NEW' and status='INVALID' group by object_type;
SQL> select object_name,object_type from dba_objects where owner='SCOTT' and status='INVALID';
SQL> select object_name,object_type from dba_objects where owner='SCOTT_NEW' and status='INVALID';
Observations:
We are eliminating the creation of dump file, by using database link with the parameter network_link

Hope it helps
SRI 

12c oem template export and import using emcli

Written By askMLabs on Tuesday, May 15, 2012 | 2:28 PM

This demo explains the steps to export and import a template in oem 12c using emcli command line tool.





Thanks
SRI

Oracle VM templates for Cloud Control

Written By askMLabs on Wednesday, May 2, 2012 | 12:22 PM

CLOUD CONTROL INTEGRATION WITH OVM

Written By askMLabs on Tuesday, May 1, 2012 | 8:47 AM

OEM 12C CLOUD CONTROL INTEGRATION WITH OVM
  1. Configure Oracle Software Library    
  2. Setting up the infrastructure for Online mode   
  3. Setup MOS(My Oracle Support) Credentials    
  4. Deploying the Cloud Plug-ins    
  5. Deploying the Cloud Plug-ins to the Management Server    
  6. Deploying the Oracle Virtualization Plug-in to the Management Agent 
  7. Oracle VM Manager 3.0 Registration Prerequisites    
  8. Registering the Oracle VM Manager in oem 12c    
  9. Synchronizing the OVM Manager Targets    
Configure Oracle Software Library
  1. Oracle Software Library (Software Library) is a repository that stores software patches, virtual appliance images, reference gold images, application software and their associated directive scripts.
    Verify whether you already have the Software Library configured. If not follow the below steps to configure:
    From the Enterprise menu, select Provisioning and Patching, then click Software Library.
    From there choose actions > administration.
    If there is nothing configured yet, click Add then choose OMS Shared Filesystem location.






Upon addition of the location, a job executes to configure the Software Library. Under this location, all required entities for EMs features like Provisioning, Patching, and Cloud Management are populated.
Once the job is successful, you will see the components configured in the Software Library.
To view the Software Library, navigate to: Enterprise Manager > Patching and Provisioning > Software Library






  1. Setting up the infrastructure for Online mode

    If the enterprise manager is configured to connect to MOS , plugins or patches can be automatically downloaded. Follow the following sequence of steps ..
    1. Set up connection to MOS (Online Mode)
      Check to see if the connection to My Oracle Support is set to "Online". Navigate to
      Setup > Provisioning and Patching > Offline Patching.



       
    2. The connection setting has to be "Online". If not set, set it to Online and click Apply.



       
    3. Select the adjacent tab My Oracle Support and Proxy Connection



       
    4. Configure your Proxy Connection to connect to My Oracle Support. Provide the required Proxy Server, Port and Realm details, then click Apply.

       
    5. Once the configuration is done, click Test to check if the connectivity works correctly.

  2. Setup MOS(My Oracle Support) Credentials




  3. Deploying the Cloud Plug-ins

    Plug-ins must first be downloaded to the OMS using Self Update before they can be deployed. To enable monitoring of virtualization targets, you must download the plug-ins and deploy them. The following plug-ins must be deployed on the Management Server:
  • Oracle Virtualization
  • Oracle Cloud Application
  • Oracle Chargeback and Capacity Planning
  • Oracle Exalogic


Select one of the above plugins (list specified above) , then click Download. The Schedule Download dialog appears. In this example, "Oracle Virtualization" plug-in is selected.


Then it changes the status from "Available" to "Downloaded"
Repeat the same step to all the other plugins (Oracle Cloud Application, Oracle Chargeback and Capacity Planning, Oracle Exalogic)
Once an entity has been downloaded to the Software Library, it is ready to be applied to your installation. Select an update from the list whose status is Downloaded, then click Apply.




You will be redirected to the plug-in deployment page.


  1. Deploying the Cloud Plug-ins to the Management Server

    Complete the below steps to all the plugins mentioned in step 4.
    Select the plugin and deploy it on OMS. Right click the plugin ->Deploy on->Management server




    Plugin pre-requisites will be executed. After successful pre-requisite checks, click on deploy.
    NOTE : OMS will be bounced now.
    Once the OMS is up, navigate to Setup->Extensibility->Plug-in . The Plugin version on OMS is now 12.1.0.2.


  1. Deploying the Oracle Virtualization Plug-in to the Management Agent



Click on Add to add the management agent where plugin will be deployed


Once you have selected the agents, click continue
It runs the plugin pre-requisites and click next
Click Deploy, to deploy the plug-in on the agents
  1. Oracle VM Manager 3.0 Registration Prerequisites

    The following prerequisites must be meet before Oracle VM Manager can be registered in Oracle Enterprise Manager 12c Cloud Control.
    1. The Oracle Virtualization plug-in must be install and enabled on the Oracle Management Service.
    2. The Oracle VM Manager host must have the Oracle Management Agent (OMA) and be a monitored target in Oracle Enterprise Manager 12c Cloud Control.
    3. The Oracle VM Manager host must have the Oracle Virtualization plug-in.
    4. The preferred credentials for the Oracle VM Manager host must be configured in Oracle Enterprise Manager 12c Cloud Control.
    5. The Oracle Management Service and the Oracle VM Manager host must have consistent name resolution using DNS with both forward and reverse lookups.
  2. Registering the Oracle VM Manager in oem 12c










Table 1
Oracle VM Manager Registration Page TitleEntry Selections and Entry Syntax
  1. Name
The name entered in the "Name" text box is displayed on the Infrastructure Cloud page.
  1. EM Agent URL
The EM Agent URL is selected by clicking the magnifying glass icon. A pop-up window will appear, select the Oracle VM Manager agent from the list. The EM Agent URL syntax is: "https://<AGENT-FQDN>:3872/emd/main/"
Note: The Oracle VM Manager host can be selected as long as the host is managed target by OEM with the Oracle Virtualization plug-in.
  1. Oracle VM Manager Core
Enter "http://<ORACLE VM MANAGER HOST FQDN>:7001" in the
Oracle VM Manager Core URL text box.
  1. Automatic Synchronization
Select the Automatic Synchronization check box to enable automated synchronization between OEM and the Oracle VM API Core.
  1. Monitoring Credentials for Oracle VM Manager
Enter the Oracle VM Manager admin user name and the admin
password in the Monitoring Credentials for Oracle VM Manager text fields.
  1. Administration Credentials for Oracle VM Manager / Use Administration Credentials
Enter the Oracle VM Manager admin user name and the admin password in the Administration Credentials for Oracle VM Manager text fields.


Select the Use Administration Credentials check box.
  1. Oracle VM Manager Console URL
Enter the non-SSL Oracle VM Manager URL, i.e.http://<ORACLE VM MANAGER HOST FQDN>:7001/ovm/console/faces/login.jspx in the Oracle VM Manager Console URL text box.
  1. Submit
Once all of the information has been entered, click the Submit button to start the registration job.
  1. Synchronizing the OVM Manager Targets



Cloud Control OEM 12c Installation

Written By askMLabs on Saturday, April 28, 2012 | 6:30 PM

OEM 12C CLOUD CONTROL INSTALLATION
  1. Software
  2. OS installation
  3. Database Installation
  4. Oem 12c Prerequisites
    1. Hardware Requirements
    2. Operating System Requirements
    3. Package Requirements
    4. Kernel Parameter Requirements
    5. Library Requirements
    6. Operating System Groups and Users Requirements
    7. Unique Host Name and Static IP Address Requirements
    8. Temporary Directory Space Requirements
    9. Central Inventory Requirements
    10. UMASK Value Requirements
    11. File Descriptor Requirements
    12. Existing Database Version Requirements
    13. Host File Requirements
    14. Port Requirements
    15. Internet Connection Requirements
  5. 5.Oem 12c Installation Procedure
  6. 6.Verification Checks
  7. 7.Starting and Stopping oem 12c Services


 1. Software
The required software for the oem 12c cloud control are :
  • Oracle Linux 6.1 (x86_64)  Download
  • Oracle Database 11gR2 (x86_64)  Download
  • Enterprise Manager Cloud Control 12c (12.1.0.1) (x86_64) with BP1 patch Download
2. OS installation :
Oracle Linux 6.1 (x86_64) installation :

3. Database Installation :
Oracle Database 11gR2 installation :
Below links help to install database
4. Oem 12c Prerequisites :
4.1. Hardware Requirements :
CPU, RAM, Heap Size, and Hard Disk Space requirements vary depending on the type of installation we are choosing. Please review the here to know the exact hardware requirements.

4.2. Operating System Requirements :
Ensure that you install Enterprise Manger Cloud Control only on certified operating system as mentioned in the Enterprise Manager Certification Matrix.

4.3. Package Requirements :
make-3.81binutils-2.17.50.0.6gcc -4.1.1libaio-0.3.106glibc-common-2.3.4libstdc++ -4.1.1setarch-1.6sysstat-5.0.5rng-utils-2.0libXtst-1.0.1-3.1(x86_64)xorg-x11-utils (This package is required only for GUI-based interactive installation, and not for silent installation)

In addition, install the 32-bit version as well as the 64-bit version of glibc-devel-2.5-49 to avoid any linking errors while installing the OMS. The installer checks for this package, so if this package is not installed, the installer displays an error.

4.4 Kernel Parameter Requirements:
For installing an OMS or a Management Agent on Unix operating systems (32-bit or 64-bit), set the kernel.shmmax parameter to a value 1 byte less than 4 GB or 4294967295.

To verify the value assigned to kernel.shmmax parameter, run the following command:
cat /proc/sys/kernel/shmmax
 To set the value for kernel.shmmax parameter, run the following command:
sysctl -w kernel.shmmax=<new value>

4.5.       Library Requirements :
Install glibc-2.5.12 package

4.6 Operating System Groups and Users Requirements:
# /usr/sbin/groupadd oinstall# /usr/sbin/useradd -g oinstall oracle# passwd oracle
4.7. Unique Host Name and Static IP Address Requirements :
Ensure that you check the network configuration to verify that the host on which you are installing resolves to a unique host name and a static IP address that is visible to other hosts in the network.
You must use a static IP address. If you use a dynamic IP address, the installation might fail.
Ensure that the host name specified in /etc/hosts file is unique, and that it maps to the correct IP address. Following is the recommended format of the /etc/hosts file:
<ip address> <fully_qualified_host_name> <short_host_name>

If the DNS server is configured, then it should resolve the host name for the OMS machine correctly. For example, all these command must return the same output:
nslookup host1nslookup host1.foo.comnslookup 141.81.5.71
4.8. Temporary Directory Space Requirements :
Ensure that you allocate 400 MB of space for a temporary directory where the executables can be copied.

4.9. Central Inventory Requirements :
Ensure that you allocate 100 MB of space for the central inventory directory.
 Also ensure that the central inventory directory is not on a shared file system. If it is already on a shared file system, then switch over to a non-shared file system by following the instructions outlined in My Oracle Support note 1092645.1.
To determine whether the Oracle Inventory group exists, enter the following command:
     $ more /etc/oraInst.loc     If the oraInst.loc file exists, then the output from this command looks like:     inventory_loc=/u01/app/oracle/oraInventory     inst_group=oinstall
4.10.UMASK Value Requirements:
Ensure that you set the default file mode creation mask (umask) to 022 in the shell startup file.

4.11.File Descriptor Requirements :
If the current value is less than 4096, then as root user, update the /etc/security/limits.conf file as shown below:
         <UID> soft nofile 4096         <UID> hard nofile 4096
4.12. Existing Database Version Requirements :
Ensure that the database is patched with all the Patch Set Updates (PSU) or Critical Patch Updates (CPU) released for that release. Also ensure that you apply the patches.
If you use Oracle Database 11g Release 2 (11.2.0.1), then ensure that you apply the patches for bugs 10014178 and 8799099.
If you use Oracle Database 11g Release 1 (11.1.0.7), then ensure that you apply Patch Set Update 2 and the patches for bugs 8644757 and 7525072.
The database can also have the Automatic Memory Management (AMM) feature enabled.

4.13. Host File Requirements :
Ensure that the host name specified in the /etc/hosts file is unique, and ensure that it maps to the correct IP address of that host. Otherwise, the installation can fail on the product-specific prerequisite check page.
The following is the recommended format of the /etc/hosts file:
<ip> <fully_qualified_host_name> <short_host_name>

4.14. Port Requirements :
Ensure that the ports you assign (within the given range) to the following components are free and available:

Admin Server HTTP SSL Port = 7101 - 7200
Enterprise Manager Upload HTTP Port = 4889 - 4898
Enterprise Manager Upload HTTP SSL Port = 1159, 4899 - 4908
Enterprise Manager Central Console HTTP Port = 7788 - 7798
Enterprise Manager Central Console HTTP SSL Port = 7799 - 7809

Oracle Management Agent Port = 3872, 1830 - 1849

To verify if a port is free, run the following command:
      On Unix:
      netstat -anp | grep <port no>

4.15. Internet Connection Requirements :
Oracle recommends that the host from where you are running the installer have a connection to the Internet so that the configuration information can be automatically collected and uploaded to My Oracle Support.

5. Oem 12c Installation Procedure :




6.Verification Checks : 
Access the following URL with sysman user and navigate to different pages to verify everything looks good.
https://<hostname with FQDN>:7803/em

7. Starting and Stopping oem 12c services : 
Use the following commands to start all components :
$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
$ export OMS_HOME=/u01/app/oracle/Middleware/oms
$ export AGENT_HOME=/u01/app/oracle/Middleware/agent/core/12.1.0.1.0
# Start everything
$ $ORACLE_HOME/bin/sqlplus '/as sysdba'
SQL> startup
$lsnrctl start listener
$ $OMS_HOME/bin/emctl start oms
$ $AGENT_HOME/bin/emctl start agent
Use the following commands to stop all components :
$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
$ export OMS_HOME=/u01/app/oracle/Middleware/oms
$ export AGENT_HOME=/u01/app/oracle/Middleware/agent/core/12.1.0.1.0
# Stop everything
$  $OMS_HOME/bin/emctl stop oms -all
$  $AGENT_HOME/bin/emctl stop agent
$ $ORACLE_HOME/bin/sqlplus '/as sysdba'
SQL> shut immediate
$ $lsnrctl stop listener

 Hope it helps
SRI

Renaming A Datafile In A Physical Standby Environment

Written By askMLabs on Monday, February 20, 2012 | 2:45 PM

In this article we will see how to rename a datafile in a physical standby setup. Most structural changes made to a primary database are automatically propagated through redo data to a physical standby database. Some structural and configuration changes at primary database requires manual intervention at a physical standby database.

When you rename one or more datafiles in the primary database, the change is not propagated to the standby database. Therefore, if you want to rename the same datafiles on the standby database, you must manually make the equivalent modifications on the standby database because the modifications are not performed automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.



1. Verify primary and standby databases and also change the initialization parameter STANDBY_FILE_MANAGEMENT from AUTO to MANUAL.

On Primary :


SQL> select name,db_unique_name,database_role,switchover_status from v$database;

NAME      DB_UNIQUE_NAME                 DATABASE_ROLE    SWITCHOVER_STATUS
--------- ------------------------------ ---------------- --------------------
ORCL      orcl                           PRIMARY          TO STANDBY

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/flash_recovery_area/orcl/
Oldest online log sequence     524
Next log sequence to archive   526
Current log sequence           526
SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PRIMARY          TO STANDBY

SQL> sho parameter STANDBY_FILE_MANAGEMENT

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_file_management              string      AUTO
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;

System altered.

SQL> sho parameter STANDBY_FILE_MANAGEMENT

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_file_management              string      MANUAL


On Standby :


SQL> select name,db_unique_name,database_role,switchover_status from v$database;

NAME      DB_UNIQUE_NAME                 DATABASE_ROLE    SWITCHOVER_STATUS
--------- ------------------------------ ---------------- --------------------
ORCL      sbyorcl                        PHYSICAL STANDBY NOT ALLOWED

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/flash_recovery_area/sbyorcl/
Oldest online log sequence     524
Next log sequence to archive   0
Current log sequence           526
SQL> select database_role,switchover_status from v$database;

DATABASE_ROLE    SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY NOT ALLOWED

SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

SEQUENCE# APPLIED
---------- ---------
517 YES
518 YES
519 YES
520 YES
521 YES
522 YES
523 YES
524 YES
525 IN-MEMORY

9 rows selected.

SQL> sho parameter STANDBY_FILE_MANAGEMENT

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_file_management              string      AUTO
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;

System altered.

SQL> sho parameter STANDBY_FILE_MANAGEMENT

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_file_management              string      MANUAL
SQL>


2. Verify the tablespace to which the datafile belongs and make it offline. This step is performed on primary database.


SQL> select file_name from dba_data_files where tablespace_name='EXAMPLE';

FILE_NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/orcl/example01.dbf

SQL> alter tablespace example offline;

Tablespace altered.


3. Rename the datafile to new location and bring tablespace back online. This step is performed on primary database.


[oracle@dgaskmpri01 OPatch]$ mv /home/oracle/app/oracle/oradata/orcl/example01.dbf  /tmp/askm/example01_temp.dbf
[oracle@dgaskmpri01 OPatch]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Tue Nov 22 05:47:17 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter tablespace example rename datafile '/home/oracle/app/oracle/oradata/orcl/example01.dbf' to '/tmp/askm/example01_temp.dbf';

Tablespace altered.

SQL> alter tablespace example online;

Tablespace altered.

SQL> select file_name from dba_data_files where tablespace_name='EXAMPLE';

FILE_NAME
--------------------------------------------------------------------------------
/tmp/askm/example01_temp.dbf

SQL>


4. Verify the same  tablespace on standby database.


SQL> select ts#,name from v$tablespace where name='EXAMPLE';

TS# NAME
---------- ------------------------------
6 EXAMPLE

SQL> select name from v$datafile where ts#=6;

NAME
--------------------------------------------------------------------------------
/home/oracle/app/oracle/oradata/sbyorcl/example01.dbf

SQL>


5. Stop recovery on standby database and shut it down.


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

Database altered.

SQL> shut immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL>


6. Rename the datafile on standby database.


[oracle@dgaskmsby01 askm]$ mv /home/oracle/app/oracle/oradata/sbyorcl/example01.dbf /tmp/askm/example01_temp.dbf
[oracle@dgaskmsby01 askm]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Tue Nov 22 05:53:49 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area  456146944 bytes
Fixed Size                  1344840 bytes
Variable Size             343935672 bytes
Database Buffers          104857600 bytes
Redo Buffers                6008832 bytes
Database mounted.
SQL> alter database rename file '/home/oracle/app/oracle/oradata/sbyorcl/example01.dbf' to '/tmp/askm/example01_temp.dbf';

Database altered.

SQL> select name from v$datafile where ts#=6;

NAME
--------------------------------------------------------------------------------
/tmp/askm/example01_temp.dbf


7. Keep standby database in recovery mode.


SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

Database altered.


8. Set initialization parameter STANDBY_FILE_MANAGEMENT value back to AUTO.

On Primary :


SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;

System altered.


On Standby :


SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;

System altered.


Reference :

Renaming a Datafile in the Primary Database

MOS ID : 733796.1

Hope It Helps

SRI

Using expdp To Export From Physical Standby Database

Written By askMLabs on Thursday, February 16, 2012 | 2:08 PM

In this article, we will discuss the steps to use expdp on physical standby database. There may be some situations where you don’t want your production database loaded with the expdp operation. The other option you have in a standby setup is that you can use your standby database for export operations. But in a physical standby database, the database is in recovery mode and if we want to open the database for expdp operation, we can open the physical standby database in read only mode. Expdp operation needs to create and maintain a master table which needs requires the physical standby database opened in read write mode.

So we have an option in expdp to export standby database. We can use expdp parameter NETWORK_LINK from any non standby database to export database.

  1. Verify primary and Standby Databases

  2. Cancel recovery and Open standby database in Read only Mode

  3. Create a physical directory on primary server to keep export dump files

  4. Create DB Link, Oracle Directory and test it.

  5. Execute expdp on primary server.




1. Verify primary and Standby Databases :

On Primary :


SQL> select name,db_unique_name,database_role,switchover_status from v$database;

NAME      DB_UNIQUE_NAME                 DATABASE_ROLE    SWITCHOVER_STATUS
--------- ------------------------------ ---------------- --------------------
ORCL      orcl                           PRIMARY          TO STANDBY


SQL> arcvhive log list
SP2-0734: unknown command beginning "arcvhive l..." - rest of line ignored.
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/flash_recovery_area/orcl/
Oldest online log sequence     522
Next log sequence to archive   524
Current log sequence           524
SQL>



On Standby :


SQL> select name,user,database_role,switchover_status from v$database;

NAME      USER                           DATABASE_ROLE    SWITCHOVER_STATUS
--------- ------------------------------ ---------------- --------------------
ORCL      SYS                            PHYSICAL STANDBY NOT ALLOWED


SQL> select name,db_unique_name,database_role,switchover_status from v$database;

NAME      DB_UNIQUE_NAME                 DATABASE_ROLE    SWITCHOVER_STATUS
--------- ------------------------------ ---------------- --------------------
ORCL      sbyorcl                        PHYSICAL STANDBY NOT ALLOWED


SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /home/oracle/app/oracle/flash_recovery_area/sbyorcl/
Oldest online log sequence     522
Next log sequence to archive   0
Current log sequence           524
SQL>



2. Cancel recovery and Open standby database in Read only Mode :


SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
sbyorcl          MOUNTED


SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database open read only;

Database altered.

SQL> select instance_name, status from v$instance;

INSTANCE_NAME    STATUS
---------------- ------------
sbyorcl          OPEN


SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY


SQL>


3. Create a physical directory on primary server to keep export dump files :


[oracle@dgaskmpri01 ~]$ mkdir /tmp/askm
[oracle@dgaskmpri01 ~]$ chmod 777 /tmp/askm
[oracle@dgaskmpri01 ~]$



4. Create DB Link, Oracle Directory and test it :


[oracle@dgaskmpri01 ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.2.0.2.0 Production on Tue Nov 22 04:25:18 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> conn system/xxxxx
Connected.
SQL> create database link db_sbyorcl connect to system identified by oracle using 'sbyorcl';


Database link created.

SQL> select db_unique_name from v$database;

DB_UNIQUE_NAME
------------------------------
orcl


SQL> select db_unique_name from v$database@db_sbyorcl;

DB_UNIQUE_NAME
------------------------------
sbyorcl


SQL> create directory sby_dump_dir as '/tmp/askm';

Directory created.

SQL>


5. Execute expdp on primary server :


[oracle@dgaskmpri01 askm]$ expdp system/oracle full=y directory=sby_dump_dir network_link=db_sbyorcl dumpfile=sby_db.dmp logfile=sby_db.log

Export: Release 11.2.0.2.0 - Production on Tue Nov 22 04:50:05 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_FULL_01":  system/******** full=y directory=sby_dump_dir network_link=db_sbyorcl dumpfile=sby_db.dmp logfile=sby_db.log
Estimate in progress using BLOCKS method...
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 183.1 MB
Processing object type DATABASE_EXPORT/TABLESPACE


.....
.....
....


ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_METADATA", line 7564
ORA-39127: unexpected error from call to export_string :=SYS.DBMS_CUBE_EXP.SCHEMA_INFO_EXP('OE',0,1,'11.02.00.00.00',newblock)
ORA-04045: errors during recompilation/revalidation of SYS.DBMS_CUBE_EXP
ORA-16000: database open for read-only access
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_CUBE_EXP"
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_METADATA", line 7564
Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.UNLOAD_METADATA [PROCACT_SCHEMA:"OE"]
ORA-08181: specified number is not a valid system change number
ORA-06512: at "SYS.DBMS_METADATA", line 5466


ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 8358


----- PL/SQL Call Stack -----
object      line  object
handle    number  name
0x34f7b2c0     19208  package body SYS.KUPW$WORKER
0x34f7b2c0      8385  package body SYS.KUPW$WORKER
0x34f7b2c0      2935  package body SYS.KUPW$WORKER
0x34f7b2c0      9054  package body SYS.KUPW$WORKER
0x34f7b2c0      1688  package body SYS.KUPW$WORKER
0x34d28650         2  anonymous block


Job "SYSTEM"."SYS_EXPORT_FULL_01" stopped due to fatal error at 04:55:56

[oracle@dgaskmpri01 askm]$ expdp system/oracle attach=SYS_EXPORT_FULL_01

Export: Release 11.2.0.2.0 - Production on Tue Nov 22 05:03:32 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


Job: SYS_EXPORT_FULL_01
Owner: SYSTEM
Operation: EXPORT
Creator Privs: TRUE
GUID: B2533E2386512016E040A8C022010D27
Start Time: Tuesday, 22 November, 2011 5:03:43
Mode: FULL
Instance: orcl
Max Parallelism: 1
EXPORT Job Parameters:
Parameter Name      Parameter Value:
CLIENT_COMMAND        system/******** full=y directory=sby_dump_dir network_link=db_sbyorcl dumpfile=sby_db.dmp logfile=sby_db.log
State: IDLING
Bytes Processed: 0
Current Parallelism: 1
Job Error Count: 0
Dump File: /tmp/askm/sby_db.dmp
bytes written: 950,272


Worker 1 Status:
Process Name: DW00
State: UNDEFINED
Object Schema: OE
Object Type: DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
Completed Objects: 36
Worker Parallelism: 1


Export> kill_job
Are you sure you wish to stop this job ([yes]/no): yes


[oracle@dgaskmpri01 askm]$ clear
[oracle@dgaskmpri01 askm]$



I got error while exporting the database. This is identified as bug in 10g and 11gR1. As per the oracle documentation, it is rectified in 11gR2, but I am still getting this issue on 11gR2. I need to further investigate it. Comments and Feedbacks are accepted pls Smile

Reference:

How to use Data Pump Export (expdp) to export from Physical Standby Database [ID 1356592.1]

Thanks

SRI

Creating Snapshot Standby Database

Written By askMLabs on Tuesday, January 17, 2012 | 12:00 PM

In this article we will see the detailed steps to create a snapshot standby database. Snapshot standby database is new in database 11g and we will create snapshot standby database from physical standby database. This snapshot standby database is fully updatable database and it is opened for read write operation. When the snapshot database is created from physical standby database, redo logs are still transferred to standby site but are not applied.

The practical use of snapshot standby database is in the situation where if you want to clone a production database for testing something, you can convert physical standby database to snapshot standby database which is as close as to the production database wrt data, do required testing on the snapshot standby database and convert it back to physical standby database. When you convert the snapshot standby database back to the physical standby database, all the modifications done to snapshot database will be lost and it is synchronized with the primary database by applying all the pending redo logs transferred but not applied on the standby database.

I assume that I have a physical standby database setup and data guard broker is configured to manage standby database.
  1. Convert Physical Standby Database To Snapshot Database
  2. Verify Snapshot Standby Database
  3. Do Some Testing In Snapshot Database
  4. Convert Snapshot Database Back To Physical Standby Database
  5. Verify the Modifications Done In Step 3.



1. Convert Physical Standby Database To Snapshot Database :
[oracle@dgaskmpri01 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle
Connected.
DGMGRL> show configuration;
Configuration - askm_config
Protection Mode: MaxPerformance
Databases:
orcl - Primary database
sbyorcl - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show database sbyorcl;
Database - sbyorcl
Role: PHYSICAL STANDBY Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: OFF
Instance(s):
sbyorcl
Database Status:
SUCCESS
DGMGRL> convert database sbyorcl to snapshot standby;
Converting database "sbyorcl" to a Snapshot Standby database, please wait...
Database "sbyorcl" converted successfully
DGMGRL> show configuration;
Configuration - askm_config
Protection Mode: MaxPerformance
Databases:
orcl - Primary databasesbyorcl - Snapshot standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show database sbyorcl;
Database - sbyorcl
Role: SNAPSHOT STANDBY
Intended State: APPLY-OFF
Transport Lag: 0 seconds
Apply Lag: 3 minutes 43 seconds
Instance(s):
sbyorcl
Database Status:
SUCCESS
DGMGRL>


2. Verify Snapshot Standby Database :
[oracle@dgaskmsby01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sun Nov 27 04:00:41 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
SNAPSHOT STANDBY
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL>


3. Do Some Testing In Snapshot Database :
For testing on snapshot standby database, I will do the following modifications on the snapshot standby database and verify the same changes again after converting snapshot database back to physical standby database.
  • Drop any existing user 
  • Create a new tablespace 
  • Resize datafile size
[oracle@dgaskmsby01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Sun Nov 27 04:01:51 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
SNAPSHOT STANDBY
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
READ WRITE
SQL> drop user scott cascade;
User dropped.
SQL> select file_name,tablespace_name,bytes/1024/1024 from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME BYTES/1024/1024
------------------------------ ---------------
/home/oracle/app/oracle/oradata/sbyorcl/users01.dbf
USERS 210
/home/oracle/app/oracle/oradata/sbyorcl/undotbs01.dbf
UNDOTBS1 143
/home/oracle/app/oracle/oradata/sbyorcl/sysaux01.dbf
SYSAUX 1105
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME BYTES/1024/1024
------------------------------ ---------------
/home/oracle/app/oracle/oradata/sbyorcl/system01.dbf
SYSTEM 806
/home/oracle/app/oracle/oradata/sbyorcl/example01.dbf
EXAMPLE 82
/home/oracle/app/oracle/oradata/sbyorcl/APEX_1246426611663638.dbf
APEX_1246426611663638 2
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME BYTES/1024/1024
------------------------------ ---------------
/home/oracle/app/oracle/oradata/sbyorcl/APEX_1265209995679366.dbf
APEX_1265209995679366 8
7 rows selected.
SQL> create tablespace test datafile '/home/oracle/app/oracle/oradata/sbyorcl/test01.dbf' size 10m;
Tablespace created.
SQL> !ls -lrt /home/oracle/app/oracle/oradata/sbyorcl/test01.dbf
-rw-rw---- 1 oracle oracle 10493952 Nov 27 04:06 /home/oracle/app/oracle/oradata/sbyorcl/test01.dbf
SQL> alter database datafile '/home/oracle/app/oracle/oradata/sbyorcl/users01.dbf' resize 500m;
Database altered.
SQL> select file_name,tablespace_name,bytes/1024/1024 from dba_data_files where tablespace_name='USERS';
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME BYTES/1024/1024
------------------------------ ---------------
/home/oracle/app/oracle/oradata/sbyorcl/users01.dbf
USERS 500
SQL>

4. Convert Snapshot Database Back To Physical Standby Database :
DGMGRL> show configuration;
Configuration - askm_config
Protection Mode: MaxPerformance
Databases:
orcl - Primary databasesbyorcl - Snapshot standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show database sbyorcl;
Database - sbyorcl
Role: SNAPSHOT STANDBY
Intended State: APPLY-OFF
Transport Lag: 0 seconds
Apply Lag: 3 minutes 43 seconds
Instance(s):
sbyorcl
Database Status:
SUCCESS
DGMGRL> convert database sbyorcl to physical standby;
Converting database "sbyorcl" to a Physical Standby database, please wait...
Operation requires shutdown of instance "sbyorcl" on database "sbyorcl"
Shutting down instance "sbyorcl"...
Database closed.
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "sbyorcl" on database "sbyorcl"
Starting instance "sbyorcl"...
ORACLE instance started.
Database mounted.
Continuing to convert database "sbyorcl" ...
Operation requires shutdown of instance "sbyorcl" on database "sbyorcl"
Shutting down instance "sbyorcl"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "sbyorcl" on database "sbyorcl"
Starting instance "sbyorcl"...
ORACLE instance started.
Database mounted.
Database "sbyorcl" converted successfully
DGMGRL> show configuration;
Configuration - askm_config
Protection Mode: MaxPerformance
Databases:
orcl - Primary databasesbyorcl - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> show database sbyorcl;
Database - sbyorcl
Role: PHYSICAL STANDBY Intended State: APPLY-ON
Transport Lag: 27 seconds
Apply Lag: (unknown)
Real Time Query: OFF
Instance(s):
sbyorcl
Database Status:
SUCCESS
DGMGRL>
5. Verify the Modifications Done In Step (3) :
SQL> connect /as sysdba
Connected.
SQL> select database_role from v$database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SQL> select open_mode from v$database;
OPEN_MODE
--------------------
MOUNTED
SQL> alter database open;
Database altered.
SQL> select username from dba_users where username='SCOTT';
USERNAME
------------------------------
SCOTT
SQL> select tablespace_name from dba_tablespaces where tablespace_name='TEST';
no rows selected
SQL> !ls -lrt /home/oracle/app/oracle/oradata/sbyorcl/test01.dbfls: /home/oracle/app/oracle/oradata/sbyorcl/test01.dbf: No such file or directory
SQL> select file_name,tablespace_name,bytes/1024/1024 from dba_data_files where tablespace_name='USERS';
FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME BYTES/1024/1024
------------------------------ ---------------
/home/oracle/app/oracle/oradata/sbyorcl/users01.dbf
USERS 210
SQL>

Please leave me your comments if you have any doubts.

Hope this helps
SRI

Applying PSU In A Data Guard Physical Standby Configuration

Written By askMLabs on Sunday, January 1, 2012 | 2:42 PM

In this article, I will explain step by step instructions to apply PSU patch to a data guard environment. The latest available PSU patch to RDBMS is 11.2.0.2.4 Patch Set Update (PSU) ie Patch:12827726
  1. Disable Log Shipping From Primary To Standby 
  2. Shutdown All The Standby Database Services
  3. Apply PSU patch to Standby Database
  4. Mount The Standby Database
  5. Stop Primary Database Services
  6. Apply PSU Patch To Primary Database
  7. Start Primary Database 
  8. Re-Enable Log Shipping
  9. Put Standby Database In Recovery Mode 
  10. Verify The PSU Patch Application.
1. Disable Log Shipping From Primary To Standby :
Assuming that the data guard broker is configured and Disabling log shipping using DGMGRL.
Verifying Data Guard Health Status:
[oracle@dgaskmpri01 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> conn sys/oracle
Unrecognized command "conn", try "help"
DGMGRL>
DGMGRL>
DGMGRL> connect sys/oracle
Connected.
DGMGRL> show configuration
Configuration - askm_config
Protection Mode: MaxPerformance
Databases:
orcl - Primary database
sbyorcl - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> switchover to 'sbyorcl';
Performing switchover NOW, please wait...
New primary database "sbyorcl" is opening...
Operation requires shutdown of instance "orcl" on database "orcl"
Shutting down instance "orcl"...
ORACLE instance shut down.
Operation requires startup of instance "orcl" on database "orcl"
Starting instance "orcl"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "sbyorcl"
DGMGRL> show configuration
Configuration - askm_config
Protection Mode: MaxPerformance
Databases:
sbyorcl - Primary database
orcl - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> switchover to 'orcl';
Performing switchover NOW, please wait...
New primary database "orcl" is opening...
Operation requires shutdown of instance "sbyorcl" on database "sbyorcl"
Shutting down instance "sbyorcl"...
ORACLE instance shut down.
Operation requires startup of instance "sbyorcl" on database "sbyorcl"
Starting instance "sbyorcl"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "orcl"
DGMGRL>
Disable Log Shipping :
DGMGRL> show database verbose orcl;
Database - orcl
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
orcl
Properties:
DGConnectIdentifier = 'orcl'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'sbyorcl, orcl'
LogFileNameConvert = '/home/oracle/app/oracle/flash_recovery_area/sbyorcl/, /home/oracle/app/oracle/flash_recovery_area/orcl/'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'orcl'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgaskmpri01.localdomain)(PORT=1525))(CONNECT_DATA=(SERVICE_NAME=orcl_DGMGRL.localdomain)(INSTANCE_NAME=orcl)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/app/oracle/flash_recovery_area/orcl/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
DGMGRL> edit database orcl set state='LOG-TRANSPORT-OFF';
Succeeded.
DGMGRL> show database verbose orcl;
Database - orcl
Role: PRIMARY
Intended State: TRANSPORT-OFF
Instance(s):
orcl
Properties:
DGConnectIdentifier = 'orcl'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'sbyorcl, orcl'
LogFileNameConvert = '/home/oracle/app/oracle/flash_recovery_area/sbyorcl/, /home/oracle/app/oracle/flash_recovery_area/orcl/'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'orcl'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgaskmpri01.localdomain)(PORT=1525))(CONNECT_DATA=(SERVICE_NAME=orcl_DGMGRL.localdomain)(INSTANCE_NAME=orcl)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/app/oracle/flash_recovery_area/orcl/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
DGMGRL>
2. Shutdown All The Standby Database Services :
Stop Listener :

[oracle@dgaskmsby01 ~]$ lsnrctl stop LISTENER_SBY
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 23-NOV-2011 04:02:19
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1525)))
The command completed successfully
[oracle@dgaskmsby01 ~]$ lsnrctl status LISTENER_SBY
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 23-NOV-2011 04:02:29
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1525)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgaskmsby01.localdomain)(PORT=1525)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@dgaskmsby01 ~]$
Stop Recovery On Standby Server:
[oracle@dgaskmsby01 ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Wed Nov 23 04:02:39 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL>

Shutdown Standby Server:
SQL> shut immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL>

3. Apply PSU patch to Standby Database :
Verify opatch version :

[oracle@dgaskmsby01 dbhome_2]$ which opatch
/usr/bin/which: no opatch in (/usr/java/latest/bin:/usr/java/latest/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/app/oracle/product/11.2.0/dbhome_2/bin:/home/oracle/bin)
[oracle@dgaskmsby01 dbhome_2]$ export PATH=$PATH:$ORACLE_HOME/OPatch
[oracle@dgaskmsby01 dbhome_2]$ which opatch
~/app/oracle/product/11.2.0/dbhome_2/OPatch/opatch
[oracle@dgaskmsby01 dbhome_2]$ opatch -help
Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation. All rights reserved.
Usage: opatch [ -help ] [ -r[eport] ] [ command ]
command := apply
lsinventory
lspatches
napply
nrollback
rollback
query
version
prereq
util
<global_arguments> := -help Displays the help message for the command.
-report Print the actions without executing.
example:
'opatch -help'
'opatch -help -fmw'
'opatch auto -help'
'opatch apply -help'
'opatch lsinventory -help'
'opatch lspatches -help'
'opatch napply -help'
'opatch nrollback -help'
'opatch rollback -help'
'opatch prereq -help'
'opatch util -help'
OPatch succeeded.
[oracle@dgaskmsby01 dbhome_2]$

Check For One-Off Patch Conflicts :
[oracle@dgaskmsby01 12827726]$ pwd
/tmp/askm/12827726
[oracle@dgaskmsby01 12827726]$ cd ..
[oracle@dgaskmsby01 askm]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./12827726
Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /home/oracle/app/oracle/product/11.2.0/dbhome_2
Central Inventory : /home/oracle/app/oraInventory
from : /home/oracle/app/oracle/product/11.2.0/dbhome_2/oraInst.loc
OPatch version : 11.2.0.1.9
OUI version : 11.2.0.2.0
Log file location : /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_04-18-51AM.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
[oracle@dgaskmsby01 askm]$

Apply PSU Patch :
[oracle@dgaskmsby01 askm]$ cd 12827726/
[oracle@dgaskmsby01 12827726]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation. All rights reserved.
Oracle Home : /home/oracle/app/oracle/product/11.2.0/dbhome_2
Central Inventory : /home/oracle/app/oraInventory
from : /home/oracle/app/oracle/product/11.2.0/dbhome_2/oraInst.loc
OPatch version : 11.2.0.1.9
OUI version : 11.2.0.2.0
Log file location : /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_04-19-20AM.log
Applying interim patch '12827726' to OH '/home/oracle/app/oracle/product/11.2.0/dbhome_2'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/home/oracle/app/oracle/product/11.2.0/dbhome_2')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Patching component oracle.rdbms.rsf, 11.2.0.2.0...
Patching component oracle.rdbms, 11.2.0.2.0...
Copying file to "/home/oracle/app/oracle/product/11.2.0/dbhome_2/psu/11.2.0.2.4/catpsu.sql"
Copying file to "/home/oracle/app/oracle/product/11.2.0/dbhome_2/psu/11.2.0.2.4/catpsu_rollback.sql"
Copying file to "/home/oracle/app/oracle/product/11.2.0/dbhome_2/cpu/scripts/patch_8837510.sql"
Copying file to "/home/oracle/app/oracle/product/11.2.0/dbhome_2/cpu/scripts/emdb_recomp_invalids.sql"
Patching component oracle.sysman.console.db, 11.2.0.2.0...
Patching component oracle.sysman.oms.core, 10.2.0.4.3...
Patching component oracle.ldap.rsf, 11.2.0.2.0...
Patching component oracle.rdbms.dv, 11.2.0.2.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.2.0...
Patching component oracle.sysman.plugin.db.main.repository, 11.2.0.2.0...
Patching component oracle.rdbms.rman, 11.2.0.2.0...
Patching component oracle.sdo.locator, 11.2.0.2.0...
Patch 12827726 successfully applied
Log file location: /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_04-19-20AM.log
OPatch succeeded.
[oracle@dgaskmsby01 12827726]$ grep -i error /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_04-19-20AM.log
[Back up for restore] : Back up 49 files for Oracle Home restore in case of patching error.
[Nov 23, 2011 4:27:28 AM] OUI-67049:Updating archive file "/home/oracle/app/oracle/product/11.2.0/dbhome_2/lib/libnnz11.a" with "lib/libnnz11.a/ssl_hshk_priv_onerror.o"
[Nov 23, 2011 4:30:50 AM] Deleted the file "/home/oracle/app/oracle/product/11.2.0/dbhome_2/.patch_storage/12827726_Sep_21_2011_05_09_52/scratch/ssl_hshk_priv_onerror.o"
[oracle@dgaskmsby01 12827726]$

NOTE: Don’t run the script “catbundle.sql” as a part of applying PSU patch on standby database. We will run this script only on primary database and the redo logs will carry these changes to all the standby databases in the data guard configuration.

4. Mount The Standby Database :
Start Standby Listener :

[oracle@dgaskmsby01 12827726]$ clear
[oracle@dgaskmsby01 12827726]$ lsnrctl start LISTENER_SBY
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 23-NOV-2011 04:51:18
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting /home/oracle/app/oracle/product/11.2.0/dbhome_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.2.0 - Production
System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora
Log messages written to /home/oracle/app/oracle/product/11.2.0/dbhome_2/log/diag/tnslsnr/dgaskmsby01/listener_sby/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dgaskmsby01.localdomain)(PORT=1525)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1525)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SBY
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 23-NOV-2011 04:51:19
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/product/11.2.0/dbhome_2/log/diag/tnslsnr/dgaskmsby01/listener_sby/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dgaskmsby01.localdomain)(PORT=1525)))
Services Summary...
Service "sbyorcl_DGMGRL.localdomain" has 1 instance(s).
Instance "sbyorcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@dgaskmsby01 12827726]$

Mount Standby Database :
[oracle@dgaskmsby01 12827726]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Wed Nov 23 04:51:31 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 456146944 bytes
Fixed Size 1344840 bytes
Variable Size 343935672 bytes
Database Buffers 104857600 bytes
Redo Buffers 6008832 bytes
Database mounted.
SQL>

NOTE : Don’t put the database in recover mode. We will start standby recovery mode after applying the PSU patch on primary database.

5. Stop Primary Database Services :
Stop Primary Listener :

[oracle@dgaskmpri01 askm]$ lsnrctl stop LISTENER_PRI
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 23-NOV-2011 04:52:45
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1525)))
The command completed successfully
[oracle@dgaskmpri01 askm]$
Stop Primary Database :
[oracle@dgaskmpri01 askm]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Wed Nov 23 04:52:52 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

6. Apply PSU Patch To Primary Database :
Check OPatch Version :

[oracle@dgaskmpri01 dbhome_2]$ opatch -help
Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation. All rights reserved.
Usage: opatch [ -help ] [ -r[eport] ] [ command ]
command := apply
lsinventory
lspatches
napply
nrollback
rollback
query
version
prereq
util
<global_arguments> := -help Displays the help message for the command.
-report Print the actions without executing.
example:
'opatch -help'
'opatch -help -fmw'
'opatch auto -help'
'opatch apply -help'
'opatch lsinventory -help'
'opatch lspatches -help'
'opatch napply -help'
'opatch nrollback -help'
'opatch rollback -help'
'opatch prereq -help'
'opatch util -help'
OPatch succeeded.
[oracle@dgaskmpri01 dbhome_2]$

Check For One-Off Patch Conflicts :
[oracle@dgaskmpri01 12827726]$ pwd
/tmp/askm/12827726
[oracle@dgaskmpri01 12827726]$ cd ..
[oracle@dgaskmpri01 askm]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./12827726
Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /home/oracle/app/oracle/product/11.2.0/dbhome_2
Central Inventory : /home/oracle/app/oraInventory
from : /home/oracle/app/oracle/product/11.2.0/dbhome_2/oraInst.loc
OPatch version : 11.2.0.1.9
OUI version : 11.2.0.2.0
Log file location : /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_04-54-27AM.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
[oracle@dgaskmpri01 askm]$

Apply PSU Patch :
[oracle@dgaskmpri01 askm]$ cd 12827726/
[oracle@dgaskmpri01 12827726]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation. All rights reserved.
Oracle Home : /home/oracle/app/oracle/product/11.2.0/dbhome_2
Central Inventory : /home/oracle/app/oraInventory
from : /home/oracle/app/oracle/product/11.2.0/dbhome_2/oraInst.loc
OPatch version : 11.2.0.1.9
OUI version : 11.2.0.2.0
Log file location : /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_04-56-28AM.log
Applying interim patch '12827726' to OH '/home/oracle/app/oracle/product/11.2.0/dbhome_2'
Verifying environment and performing prerequisite checks...
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/home/oracle/app/oracle/product/11.2.0/dbhome_2')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Patching component oracle.rdbms.rsf, 11.2.0.2.0...
Patching component oracle.rdbms, 11.2.0.2.0...
Copying file to "/home/oracle/app/oracle/product/11.2.0/dbhome_2/psu/11.2.0.2.4/catpsu.sql"
Copying file to "/home/oracle/app/oracle/product/11.2.0/dbhome_2/psu/11.2.0.2.4/catpsu_rollback.sql"
Copying file to "/home/oracle/app/oracle/product/11.2.0/dbhome_2/cpu/scripts/patch_8837510.sql"
Copying file to "/home/oracle/app/oracle/product/11.2.0/dbhome_2/cpu/scripts/emdb_recomp_invalids.sql"
Patching component oracle.sysman.console.db, 11.2.0.2.0...
Patching component oracle.sysman.oms.core, 10.2.0.4.3...
Patching component oracle.ldap.rsf, 11.2.0.2.0...
Patching component oracle.rdbms.dv, 11.2.0.2.0...
Patching component oracle.rdbms.dbscripts, 11.2.0.2.0...
Patching component oracle.sysman.plugin.db.main.repository, 11.2.0.2.0...
Patching component oracle.rdbms.rman, 11.2.0.2.0...
Patching component oracle.sdo.locator, 11.2.0.2.0...
Patch 12827726 successfully applied
Log file location: /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_04-56-28AM.log
OPatch succeeded.
[oracle@dgaskmpri01 12827726]$ grep -i error /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_04-56-28AM.log
[Back up for restore] : Back up 49 files for Oracle Home restore in case of patching error.
[Nov 23, 2011 5:06:28 AM] OUI-67049:Updating archive file "/home/oracle/app/oracle/product/11.2.0/dbhome_2/lib/libnnz11.a" with "lib/libnnz11.a/ssl_hshk_priv_onerror.o"
[Nov 23, 2011 5:09:51 AM] Deleted the file "/home/oracle/app/oracle/product/11.2.0/dbhome_2/.patch_storage/12827726_Sep_21_2011_05_09_52/scratch/ssl_hshk_priv_onerror.o"
[oracle@dgaskmpri01 12827726]$

7. Start Primary Database :
Start Primary Listener :

[oracle@dgaskmpri01 admin]$ lsnrctl start LISTENER_PRI
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 23-NOV-2011 05:33:53
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting /home/oracle/app/oracle/product/11.2.0/dbhome_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.2.0 - Production
System parameter file is /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora
Log messages written to /home/oracle/app/oracle/product/11.2.0/dbhome_2/log/diag/tnslsnr/dgaskmpri01/listener_pri/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dgaskmpri01.localdomain)(PORT=1525)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1525)))
STATUS of the LISTENER
------------------------
Alias LISTENER_PRI
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 23-NOV-2011 05:33:53
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/product/11.2.0/dbhome_2/log/diag/tnslsnr/dgaskmpri01/listener_pri/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1525)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dgaskmpri01.localdomain)(PORT=1525)))
Services Summary...
Service "orcl_DGMGRL.localdomain" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@dgaskmpri01 admin]$

Start Primary Database In Restrict Mode :
[oracle@dgaskmpri01 12827726]$ cd $ORACLE_HOME/rdbms/admin
[oracle@dgaskmpri01 admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Wed Nov 23 05:10:59 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup restrict
ORACLE instance started.
Total System Global Area 456146944 bytes
Fixed Size 1344840 bytes
Variable Size 398461624 bytes
Database Buffers 50331648 bytes
Redo Buffers 6008832 bytes
Database mounted.
Database opened.
SQL>
Run Post PSU Patch Script catbundle.sql :
SQL> @catbundle psu apply
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Generating apply and rollback scripts...
Check the following file for errors:
/home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/catbundle/catbundle_PSU_ORCL_GENERATE_2011Nov23_05_12_04.log
Apply script: /home/oracle/app/oracle/product/11.2.0/dbhome_2/rdbms/admin/catbundle_PSU_ORCL_APPLY.sql
Rollback script: /home/oracle/app/oracle/product/11.2.0/dbhome_2/rdbms/admin/catbundle_PSU_ORCL_ROLLBACK.sql
PL/SQL procedure successfully completed.
Executing script file...
SQL> COLUMN spool_file NEW_VALUE spool_file NOPRINT
SQL> SELECT '/home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/catbundle/' || 'catbundle_PSU_' || name || '_APPLY_' || TO_CHAR(SYSDATE, 'YYYYMonDD_hh24_mi_ss', 'NLS_DATE_LANGUAGE=''AMERICAN''') || '.log' AS spool_file FROM v$database;
SQL> SPOOL &spool_file
SQL> exec dbms_registry.set_session_namespace('SERVER')
PL/SQL procedure successfully completed.
SQL> PROMPT Processing EM Repository...
Processing EM Repository...
SQL> ALTER SESSION SET current_schema = SYSMAN;
Session altered.
SQL> @?/sysman/admin/emdrep/sql/db/latest/policy/config_util_pkgdef.sql
SQL> Rem drv: <create type="pkgdefs"/>
SQL> Rem
SQL> Rem $Header: emdb/source/oracle/sysman/emdrep/sql/db/latest/policy
.....
....
.....
10 'PSU',
11 'PSU 11.2.0.2.4');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/catbundle/catbundle_PSU_ORCL_APPLY_2011Nov23_05_12_17.log
SQL>

Register Listener and Disable Restricted Mode :
SQL> alter system register;
System altered.
SQL> alter system disable restricted session;
System altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dgaskmpri01 admin]$

8. Re-Enable Log Shipping :
[oracle@dgaskmpri01 admin]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle
Connected.
DGMGRL> edit database orcl set state='ONLINE';
Succeeded.
DGMGRL> show database verbose orcl;
Database - orcl
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
orcl
Properties:
DGConnectIdentifier = 'orcl'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'sbyorcl, orcl'
LogFileNameConvert = '/home/oracle/app/oracle/flash_recovery_area/sbyorcl/, /home/oracle/app/oracle/flash_recovery_area/orcl/'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'orcl'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dgaskmpri01.localdomain)(PORT=1525))(CONNECT_DATA=(SERVICE_NAME=orcl_DGMGRL.localdomain)(INSTANCE_NAME=orcl)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/app/oracle/flash_recovery_area/orcl/'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
DGMGRL>

9. Put Standby Database In Recovery Mode :
[oracle@dgaskmsby01 admin]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Wed Nov 23 05:38:27 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION
*
ERROR at line 1:
ORA-01153: an incompatible media recovery is active
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
Database altered.
SQL>
10. Verify The PSU Patch Application:
On Primary :

[oracle@dgaskmpri01 trace]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Wed Nov 23 05:39:39 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
---------------- --------------------
PRIMARY TO STANDBY
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /home/oracle/app/oracle/flash_recovery_area/orcl/
Oldest online log sequence 28
Next log sequence to archive 30
Current log sequence 30
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL>
SQL> col action_time for a30
SQL> col action for a25
SQL> col namespace for a10
SQL> col version for a10
SQL> col bundle_series for a5
SQL> col id for 9999999
SQL> set linesize 120
SQL> select ACTION_TIME,ACTION,NAMESPACE,VERSION,BUNDLE_SERIES,ID from registry$history;
ACTION_TIME ACTION NAMESPACE VERSION BUNDL ID
------------------------------ ------------------------- ---------- ---------- ----- --------
02-OCT-10 11.34.43.691423 AM VIEW INVALIDATE 8289601
02-OCT-10 11.34.44.547808 AM UPGRADE SERVER 11.2.0.2.0
02-OCT-10 11.35.33.441827 AM APPLY SERVER 11.2.0.2 PSU 0
23-NOV-11 05.13.44.279446 AM APPLY SERVER 11.2.0.2 PSU 4
SQL>
On Standby :
[oracle@dgaskmsby01 admin]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Wed Nov 23 05:40:25 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select database_role,switchover_status from v$database;
DATABASE_ROLE SWITCHOVER_STATUS
---------------- --------------------
PHYSICAL STANDBY NOT ALLOWED
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /home/oracle/app/oracle/flash_recovery_area/sbyorcl/
Oldest online log sequence 30
Next log sequence to archive 0
Current log sequence 32
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# APPLIED
---------- ---------
1 YES
...
...
29 YES
30 YES
SEQUENCE# APPLIED
---------- ---------
31 IN-MEMORY
45 rows selected.
SQL> select ACTION_TIME,ACTION,NAMESPACE,VERSION,BUNDLE_SERIES,ID from registry$history;
select ACTION_TIME,ACTION,NAMESPACE,VERSION,BUNDLE_SERIES,ID from registry$history
*
ERROR at line 1:
ORA-01219: database not open: queries allowed on fixed tables/views only
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@dgaskmsby01 admin]$ clear
[oracle@dgaskmsby01 admin]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.1.9
Copyright (c) 2011, Oracle Corporation. All rights reserved.
Oracle Home : /home/oracle/app/oracle/product/11.2.0/dbhome_2
Central Inventory : /home/oracle/app/oraInventory
from : /home/oracle/app/oracle/product/11.2.0/dbhome_2/oraInst.loc
OPatch version : 11.2.0.1.9
OUI version : 11.2.0.2.0
Log file location : /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/opatch2011-11-23_05-43-55AM.log
Lsinventory Output file location : /home/oracle/app/oracle/product/11.2.0/dbhome_2/cfgtoollogs/opatch/lsinv/lsinventory2011-11-23_05-43-55AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.2.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 12827726 : applied on Wed Nov 23 04:29:17 PST 2011
Unique Patch ID: 14019830
Created on 21 Sep 2011, 05:09:52 hrs PST8PDT
Bugs fixed:
10158965, 10031806, 12635537, 9746210, 9744252, 9956713, 10356513
10204358, 10378005, 10170431, 11853815, 10222719, 12639177, 9591812
10127360, 9443361, 10035737, 10384285, 12846268, 9873405, 12846269
11069199, 12670165, 10245086, 10159846, 10205230, 10052141, 10039731
11818335, 12371955, 10040921, 12366627, 10077191, 11827088, 11785938
10219576, 10258337, 11707699, 10264680, 10094823, 10209232, 11695333
9881076, 10278372, 10281887, 10621169, 10048701, 9078442, 11057263
10157249, 9735237, 10317487, 10219583, 10636231, 10310299, 11065646
10055063, 10368698, 12340939, 10079168, 10233732, 8223165, 10264696
10142909, 9953542, 10052956, 10080579, 11699057, 12620422, 10285022
10329146, 10332589, 11666137, 10110863, 9869401, 12828071, 10019218
10229719, 9539440, 10373381, 11724984, 10239480, 10411618, 11670161
9724970, 10399808, 10113990, 10312847, 11893621, 10084145, 10367188
11800170, 11695285, 10285394, 10157402, 9651350, 10299224, 10151017
11724916, 10190642, 12586486, 9564886, 12586487, 10129643, 12586488
12586489, 10018789, 10248523, 9715581, 9770451, 11889177, 10425676
9683047, 10180307, 10126094, 10396041, 10132870, 10094201, 10193846
11664046, 10324294, 9414040, 12586490, 9819805, 12586491, 9795214
12586492, 12586493, 12586494, 10142788, 12586495, 11830776, 9905049
11674898, 10419984, 12586496, 11830777, 6892311, 11830778, 10358019
12431716, 10422126, 10200404, 11651810, 10102506, 11067567, 12827726
11733179, 10229886, 10040531, 10155605, 10326338, 10356782, 10082277
10051315, 10218814, 9788588, 10278773, 12326246, 10622001, 11707302
10230571, 9966609, 12419321, 12546006, 10137324, 9771278, 10013431
10228151, 10324526, 11894889, 10238786, 10217802, 10061015, 9572787
10332111, 10227288, 10623249, 10073683, 12639234, 11664719, 9735282
9748749, 10022980, 10237773, 11800854, 12419331, 11674485, 10097711
10187168, 6523037, 10648873, 10053725, 8685446
--------------------------------------------------------------------------------
OPatch succeeded.
[oracle@dgaskmsby01 admin]$

NOTE : The same procedure can be used for Patchsets/CPU patch application.
Reference: How do you apply a Patchset,PSU or CPU in a Data Guard Physical Standby configuration [ID 278641.1]

Hope It Helps
SRI
 
Support :
Copyright © 2013. askMLabs - All Rights Reserved
Proudly powered by Blogger