Pages

Saturday, December 11, 2010

Active Database Duplication

In Oracle 11g, the live source database can be copied over the network to the duplicate database instance without the need of a backup. RMAN automates the following steps in duplicating operation.

Duplicate the password file.
Creates a default server parameter file.
Copies the latest control file.
Mounts the controlfile.
Copies the datafiles.
Performs incomplete recovery.
Opens the duplicate database with RESETLOGS option.

Run the commands on the server running the duplicate database.

$ export ORACLE_SID=<dupdb>
$ rman TARGET sys/password@<sourcedb> AUXILIARY / cmdfile=backupdb.cmd

$ cat backupdb.cmd

run {
                DUPLICATE TARGET DATABASE TO '<dupdb>'
                FROM ACTIVE DATABASE
                PASSWORD FILE
                SPFILE
                PARAMETER_VALUE_CONVERT='<sourcedb>','<dupdb>'
                SET CONTROL_FILES='<controlfile1_path>','<controlfile2_path>'
                SET DB_FILE_NAME_CONVERT='<source_dir>','<dup_dir>'
                SET LOG_FILE_NAME_CONVERT='<source_dir>','<dup_dir>'
                SET DB_UNIQUE_NAME='<dupdb>'
                SET SGA_MAX_SIZE='<size>'
                SET SGA_TARGET='<size>'
                NOFILENAMECHECK;
       }

To create standby database

run {
                ALLOCATE CHANNEL c1 TYPE DISK;
                ALLOCATE CHANNEL c2 TYPE DISK;
                ALLOCATE AUXILIARY CHANNEL s1 TYPE DISK;
                DUPLICATE TARGET DATABASE FOR STANDBY
                FROM ACTIVE DATABASE
                PASSWORD FILE
                SPFILE
                PARAMETER_VALUE_CONVERT='<sourcedb>','<dupdb>'
                SET CONTROL_FILES='<controlfile1_path>','<controlfile2_path>'
                SET DB_FILE_NAME_CONVERT='<source_dir>','<dup_dir>'
                SET LOG_FILE_NAME_CONVERT='<source_dir>','<dup_dir>'
                SET DB_UNIQUE_NAME='<dupdb>'
                SET LOG_ARCHIVE_MAX_PROCESSES=10
                SET FAL_SERVER='<sourcedb>'
                SET STANDBY_FILE_MANAGEMENT=AUTO
                SET LOG_ARCHIVE_DEST_2='SERVICE=<sourcedb> LGWR SYNC NOAFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=<sourcedb>;
     }

             


Sunday, November 28, 2010

Agent is unable to communicate with the OMS

Sometimes the following fake alert wakes up the oncall DBA and clears itself after a couple of minutes due to the busy network.

Target Name=<host>:3872
Message=Agent is unable to communicate with the OMS. (REASON = Agent is Unreachable (REASON : Agent to OMS Communication is brokenError in request response).
Severity=Unreachable Start

Find target_guid for this target agent.
select target_guid from sysman.mgmt_targets where target_name='<host>:3872';

Increase max_inactive_time from the default value 120 sec to 240 sec.
SQL> update sysman.mgmt_emd_ping
  2  set  MAX_INACTIVE_TIME=240
  3  where target_guid='<target_guid>';