Ask Me

Data-Guard Set up using ASM On Oracle 11GR2


:: Data-Guard Set up using ASM On Oracle 11GR2
              
               Oracle Data Guard is one of the most effective and comprehensive data availability, data protection and disaster recovery solutions available today for enterprise data.Oracle Data Guard is the management, monitoring, and automation software infrastructure that creates, maintains, and monitors one or more standby databases to protect enterprise data from failures, disasters, errors, and corruptions.Data Guard maintains these standby databases as transitional consistent copies of the production database. These standby databases can be located at remote disaster recovery sites thousands of miles away from the production data center, or they may be located in the same city, same campus, or even in the same building. If the production database becomes unavailable because of a planned or an unplanned outage, Data Guard can switch any standby database to the production role, thus minimizing the downtime associated with the outage, and preventing any data loss.
Available as a feature of the Enterprise Edition of the Oracle Database, Data Guard can be used in combination with other Oracle High Availability (HA) solutions such as Real Application Clusters (RAC), Oracle Flashback and Oracle Recovery Manager (RMAN), to provide a very high level of data protection and data availability that is unprecedented in the industry.

Step By Step Guide to Configure 11gR2 dataguard Primary Database Side Set Up

SQL> select force_logging from v$database;
FOR
---
NO
SQL> alter database force logging;
Database altered.

SQL> alter database add standby logfile '+DATA' SIZE 50M;
Database altered.
SQL> alter database add standby logfile '+DATA' SIZE 50M;
Database altered.
SQL> alter database add standby logfile '+DATA' SIZE 50M;
Database altered.
SQL> alter system set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST';
System altered.
SQL> alter system set log_archive_config='dg_config=(colldb_pm,colldb_st)';
System altered.
SQL> alter system set log_archive_dest_2='service=colldb_st async valid_for=(online_logfile,primary_role) db_unique_name=colldb_st';
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_FORMAT='%t_%s_%r.arc' SCOPE=SPFILE;
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=30;
System altered.
SQL> ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;
System altered.
SQL> ALTER SYSTEM SET FAL_SERVER=colldb_st
  2  ;
System altered.
SQL> ALTER SYSTEM SET DB_FILE_NAME_CONVERT='+DATA','+DATA' scope=spfile;
System altered.
SQL> ALTER SYSTEM SET log_FILE_NAME_CONVERT='+DATA','+DATA' scope=spfile;
System altered.
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;
System altered.
SQL>
SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/db11g_stby.ctl';
Database altered.
SQL> CREATE PFILE='/tmp/initDB11G_stby.ora' FROM SPFILE;
File created.
SQL>
SQL> alter system set FAL_SERVER=colldb_st;
System altered.
SQL> alter system set FAL_CLIENT=colldb_pm;
System altered.
SQL>



Stand by Database Set up:


#############################################
Database Name :- COLLDB
Primary db_unique_name :- COLLDB_PM
Standby db_unique_name :- COLLDB_ST
############################################
*On standby* Add listener entry   Listener file will be found in GRID_HOME/network/admin
SID_LIST_LISTENER =
   (SID_LIST =
       (SID_DESC =
          (ORACLE_HOME= /u/oracle/server/database203/)
          (SID_NAME = colldb)
          (GLOBAL_DBNAME= colldb)
   )
   (SID_DESC =
      (global_dbname = colldb)
      (ORACLE_HOME = /u/oracle/server/database203)
      (sid_name = colldb)
       )
    )
After that tnsping each service name  on both the servers
Add entries to tnsnames.ora to both nodes  TNSNAMES.ORA will be found in ORACLE_HOME/network/admin  on both servers
COLLDB_PM =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = Test1.imslab.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = colldb_pm)
    )
  )
COLLDB_ST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = Test2.imslab.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = COLLDB)
    )
  )
Step 9::
 Copy Password file onto standby or create password file with same password
copy password file primary to stand by
orapwd file=/u/oracle/server/database203/dbs/orapwcolldb force=y entries=5 password=sys
orapwd file=/u/oracle/server/database203/dbs/orapwcolldb force=y entries=5 password=sys
Step 10:: 
Location ORACLE_HOME/dbs/initcolldb
Create  Standby Pfile
 Only one parameter needed - > DB_NAME
 DB_NAME=TESTMP2
Step 11:: 

Startup Standby
sqlplus / as sysdba
startup nomount

Stand Db creation:

From Standby database run these commands
[oracle@Test2 ~]$ rman target sys/sys@colldb_pm auxiliary sys/sys@colldb_st
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Nov 27 16:52:41 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: COLLDB (DBID=3477737225)
connected to auxiliary database: COLLDB (not mounted)
RMAN>
run 
{
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'colldb_pm','colldb_st'
set db_unique_name='stbydv1'
set db_file_name_convert='+DATA','+DATA'
set log_file_name_convert='+DATA','+DATA'
set control_files='+DATA'
set log_archive_max_processes='5'
set fal_client='colldb_st'
set fal_server='colldb_pm'
set standby_file_management='AUTO'
set log_archive_config='dg_config=(colldb_pm,colldb_st)'
set log_archive_dest_2='service=colldb_pm ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=colldb_pm'
nofilenamecheck;
release channel prmy1;
release channel prmy2;
release channel prmy3;
release channel prmy4;
}
OUTPUT 
RMAN> run
2> {
3> allocate channel prmy1 type disk;
4> allocate channel prmy2 type disk;
5> allocate channel prmy3 type disk;
6> allocate channel prmy4 type disk;
7> allocate auxiliary channel stby type disk;
8> duplicate target database for standby from active database
9> spfile
10> parameter_value_convert 'colldb_pm','colldb_st'
11> set db_unique_name='colldb_st'
12> set db_file_name_convert='+DATA','+DATA'
13> set log_file_name_convert='+DATA','+DATA'
14> set control_files='+DATA'
15> set log_archive_max_processes='5'
16> set fal_client='colldb_st'
17> set fal_server='colldb_pm'
18> set standby_file_management='AUTO'
19> set log_archive_config='dg_config=(colldb_pm,colldb_st)'
20> set log_archive_dest_2='service=colldb_pm ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=colldb_pm'
21> nofilenamecheck;
22> release channel prmy1;
23> release channel prmy2;
24> release channel prmy3;
25> release channel prmy4;
26> }
allocated channel: prmy1
channel prmy1: SID=85 device type=DISK
allocated channel: prmy2
channel prmy2: SID=73 device type=DISK
allocated channel: prmy3
channel prmy3: SID=83 device type=DISK
allocated channel: prmy4
channel prmy4: SID=79 device type=DISK
allocated channel: stby
channel stby: SID=20 device type=DISK
Starting Duplicate Db at 27-NOV-13
contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u/oracle/server/database203/dbs/orapwcolldb' auxiliary format
 '/u/oracle/server/database203/dbs/orapwcolldb'   targetfile
 '+DATA/colldb/spfilecolldb.ora' auxiliary format
 '/u/oracle/server/database203/dbs/spfilecolldb.ora'   ;
   sql clone "alter system set spfile= ''/u/oracle/server/database203/dbs/spfilecolldb.ora''";
}
executing Memory Script
Starting backup at 27-NOV-13
Finished backup at 27-NOV-13
sql statement: alter system set spfile= ''/u/oracle/server/database203/dbs/spfilecolldb.ora''
contents of Memory Script:
{
   sql clone "alter system set  db_unique_name =
 ''colldb_st'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''+DATA'', ''+DATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''+DATA'', ''+DATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''+DATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_max_processes =
 5 comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_client =
 ''colldb_st'' comment=
 '''' scope=spfile";
   sql clone "alter system set  fal_server =
 ''colldb_pm'' comment=
 '''' scope=spfile";
   sql clone "alter system set  standby_file_management =
 ''AUTO'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_config =
 ''dg_config=(colldb_pm,colldb_st)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_archive_dest_2 =
 ''service=colldb_pm ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=colldb_pm'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script
sql statement: alter system set  db_unique_name =  ''colldb_st'' comment= '''' scope=spfile
sql statement: alter system set  db_file_name_convert =  ''+DATA'', ''+DATA'' comment= '''' scope=spfile
sql statement: alter system set  log_file_name_convert =  ''+DATA'', ''+DATA'' comment= '''' scope=spfile
sql statement: alter system set  control_files =  ''+DATA'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_max_processes =  5 comment= '''' scope=spfile
sql statement: alter system set  fal_client =  ''colldb_st'' comment= '''' scope=spfile
sql statement: alter system set  fal_server =  ''colldb_pm'' comment= '''' scope=spfile
sql statement: alter system set  standby_file_management =  ''AUTO'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_config =  ''dg_config=(colldb_pm,colldb_st)'' comment= '''' scope=spfile
sql statement: alter system set  log_archive_dest_2 =  ''service=colldb_pm ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=colldb_pm'' comment= '''' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area    1657225216 bytes
Fixed Size                     1345324 bytes
Variable Size               1040189652 bytes
Database Buffers             603979776 bytes
Redo Buffers                  11710464 bytes
allocated channel: stby
channel stby: SID=23 device type=DISK
contents of Memory Script:
{
   sql clone "alter system set  control_files =
  ''+DATA/colldb_st/controlfile/current.258.832613087'' comment=
 ''Set by RMAN'' scope=spfile";
   backup as copy current controlfile for standby auxiliary format  '+DATA/colldb_st/controlfile/current.259.832613087';
   sql clone "alter system set  control_files =
  ''+DATA/colldb_st/controlfile/current.259.832613087'' comment=
 ''Set by RMAN'' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script
sql statement: alter system set  control_files =   ''+DATA/colldb_st/controlfile/current.258.832613087'' comment= ''Set by RMAN'' scope=spfile
Starting backup at 27-NOV-13
channel prmy1: starting datafile copy
copying standby control file
output file name=/u/oracle/server/database203/dbs/snapcf_colldb.f tag=TAG20131127T172446 RECID=5 STAMP=832613087
channel prmy1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 27-NOV-13
sql statement: alter system set  control_files =   ''+DATA/colldb_st/controlfile/current.259.832613087'' comment= ''Set by RMAN'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area    1657225216 bytes
Fixed Size                     1345324 bytes
Variable Size               1040189652 bytes
Database Buffers             603979776 bytes
Redo Buffers                  11710464 bytes
allocated channel: stby
channel stby: SID=23 device type=DISK
contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.
contents of Memory Script:
{
   set newname for tempfile  1 to
 "+data";
   switch clone tempfile all;
   set newname for datafile  1 to
 "+data";
   set newname for datafile  2 to
 "+data";
   set newname for datafile  3 to
 "+data";
   set newname for datafile  4 to
 "+data";
   backup as copy reuse
   datafile  1 auxiliary format
 "+data"   datafile
 2 auxiliary format
 "+data"   datafile
 3 auxiliary format
 "+data"   datafile
 4 auxiliary format
 "+data"   ;
   sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to +data in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 27-NOV-13
channel prmy1: starting datafile copy
input datafile file number=00001 name=+DATA/colldb/datafile/system.256.832173859
channel prmy2: starting datafile copy
input datafile file number=00002 name=+DATA/colldb/datafile/sysaux.257.832173861
channel prmy3: starting datafile copy
input datafile file number=00003 name=+DATA/colldb/datafile/undotbs1.258.832173861
channel prmy4: starting datafile copy
input datafile file number=00004 name=+DATA/colldb/datafile/users.259.832173861
output file name=+DATA/colldb_st/datafile/undotbs1.263.832613107 tag=TAG20131127T172500
channel prmy3: datafile copy complete, elapsed time: 00:00:15
output file name=+DATA/colldb_st/datafile/users.262.832613107 tag=TAG20131127T172500
channel prmy4: datafile copy complete, elapsed time: 00:00:15
output file name=+DATA/colldb_st/datafile/system.257.832613101 tag=TAG20131127T1
channel prmy1: datafile copy complete, elapsed time: 00:00:45
output file name=+DATA/colldb_st/datafile/sysaux.256.832613101 tag=TAG20131127T1
channel prmy2: datafile copy complete, elapsed time: 00:00:45
Finished backup at 27-NOV-13
sql statement: alter system archive log current
contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=832613147 file name=+DATA/colldb_st/datafile/s
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=832613147 file name=+DATA/colldb_st/datafile/s
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=832613147 file name=+DATA/colldb_st/datafile/u
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=832613147 file name=+DATA/colldb_st/datafile/u
Finished Duplicate Db at 27-NOV-13
released channel: prmy1
released channel: prmy2
released channel: prmy3
released channel: prmy4
released channel: stby
RMAN>

Oracle Data-guard Switch Over Using DGMGRL

 

Recover Standby database using RMAN with no new data files added on primary after standby started un-sync:

            

  • Make sure you stop the managed recovery process (MRP) before going ahead with further steps.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
  • On the STANDBY DATABASE, find the SCN which will be used for the incremental backup at the primary database. You need to use the ‘lowest SCN’ from the the 3 queries below :

SQL> SELECT CURRENT_SCN FROM V$DATABASE;

CURRENT_SCN
--------------
2551854

SQL> select min(fhscn) from x$kcvfh;

MIN(FHSCN)
----------------
2551855

SQL> select min(f.fhscn) from x$kcvfh f, v$datafile d
      where f.hxfil =d.file#
        and d.enabled != 'READ ONLY'     ;

MIN(F.FHSCN)
----------------
2551855

  • You need to use the ‘lowest SCN‘ from the the 3 queries,In RMAN, connect to the PRIMARY database and create an incremental backup from the SCN derived in the previous step;
RMAN> backup incremental from scn 2551854 database format '/backup/incr/inc_hmprd_%U';

Starting backup at 11-SEP-17

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=114 device type=DISK
backup will be obsolete on date 18-SEP-17
archived logs will not be kept or backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=+DATA/hmprod_edc/datafile/mgmt_tablespace.270.854660305
input datafile file number=00001 name=+DATA/hmprod/datafile/system.260.854642671
input datafile file number=00002 name=+DATA/hmprod/datafile/sysaux.265.854642671
input datafile file number=00003 name=+DATA/hmprod/datafile/undotbs1.264.854642673
input datafile file number=00007 name=+DATA/hmprod_edc/datafile/mgmt_ad4j_ts.274.854660335
input datafile file number=00005 name=+DATA/hmprod_edc/datafile/mgmt_ecm_depot_ts.267.854660297
input datafile file number=00008 name=+DATA/hmprod_edc/datafile/btest.273.946830037
input datafile file number=00004 name=+DATA/hmprod/datafile/users.263.854642673
channel ORA_DISK_1: starting piece 1 at 11-SEP-17
channel ORA_DISK_1: finished piece 1 at 11-SEP-17
piece handle=/backup/incr/inc_hmprd_94se6sub_1_1 tag=TAG20170911T153329 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:09:38

using channel ORA_DISK_1
backup will be obsolete on date 18-SEP-17
archived logs will not be kept or backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 11-SEP-17
channel ORA_DISK_1: finished piece 1 at 11-SEP-17
piece handle=/backup/incr/inc_hmprd_95se6tgs_1_1 tag=TAG20170911T153329 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
Finished backup at 11-SEP-17
RMAN-08591: WARNING: invalid archived log deletion policy

RMAN>


  • Transfer all backup sets created on the primary system to the standby system using SCP or FTP .
  • On the STANDBY catalog the backup pieces:

RMAN> catalog start with '/backup/incr/';

using target database control file instead of recovery catalog
searching for all files that match the pattern /backup/incr/

List of Files Unknown to the Database
=====================================
File Name: /backup/incr/inc_hmprd_94se6sub_1_1
File Name: /backup/incr/inc_hmprd_95se6tgs_1_1

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /backup/incr/inc_hmprd_94se6sub_1_1
File Name: /backup/incr/inc_hmprd_95se6tgs_1_1


  • Recover the STANDBY database with the cataloged incremental backup then shutdown database and open in nomount mode .
RMAN> recover database noredo;

Starting recover at 11-SEP-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: +DATA/hmprod_ndc/datafile/system.256.854646189
destination for restore of datafile 00002: +DATA/hmprod_ndc/datafile/sysaux.272.854646191
destination for restore of datafile 00003: +DATA/hmprod_ndc/datafile/undotbs1.271.854646191
destination for restore of datafile 00004: +DATA/hmprod_ndc/datafile/users.270.854646191
destination for restore of datafile 00005: +DATA/hmprod_ndc/datafile/mgmt_ecm_depot_ts.264.854660485
destination for restore of datafile 00006: +DATA/hmprod_ndc/datafile/mgmt_tablespace.263.854660517
destination for restore of datafile 00007: +DATA/hmprod_ndc/datafile/mgmt_ad4j_ts.262.854660573
destination for restore of datafile 00008: +DATA/hmprod_ndc/datafile/btest.273.946849219
channel ORA_DISK_1: reading from backup piece /backup/incr/inc_hmprd_94se6sub_1_1
channel ORA_DISK_1: piece handle=/backup/incr/inc_hmprd_94se6sub_1_1 tag=TAG20170911T153329
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:08:36

Finished recover at 11-SEP-17

RMAN> SHUTDOWN IMMEDIATE ;

database dismounted
Oracle instance shut down

RMAN> STARTUP NOMOUNT;

connected to target database (not started)
Oracle instance started

Total System Global Area     418484224 bytes

Fixed Size                     1345352 bytes
Variable Size                335546552 bytes
Database Buffers              75497472 bytes
Redo Buffers                   6094848 bytes
  • In RMAN, connect to the PRIMARY database and create a standby control file backup and transfer to standby server using scp or ftp.
RMAN> BACKUP CURRENT CONTROLFILE FOR STANDBY FORMAT '/backup/incr/inc_hmprd_controlfile';

Starting backup at 11-SEP-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including standby control file in backup set
channel ORA_DISK_1: starting piece 1 at 11-SEP-17
channel ORA_DISK_1: finished piece 1 at 11-SEP-17
piece handle=/backup/incr/inc_hmprd_controlfile tag=TAG20170911T154741 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 11-SEP-17

Starting Control File and SPFILE Autobackup at 11-SEP-17
piece handle=+DATA/autobackup/control_c-281670268-20170911-01 comment=NONE
Finished Control File and SPFILE Autobackup at 11-SEP-17

  • Take a backup of location of datafile at standby in case the datafiles name/location are different than the primary.
SQL> spool datafile_names_step8.txt
set lines 200
col name format a60
select file#, name from v$datafile order by file# ;
spool off
  • From RMAN, connect to STANDBY database and restore the standby control file , then stop database and start with mount .
RMAN> RESTORE STANDBY CONTROLFILE FROM '/backup/incr/inc_hmprd_controlfile';

Starting restore at 11-SEP-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=25 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DATA/hmprod_ndc/controlfile/current.257.854646135
Finished restore at 11-SEP-17

RMAN> shutdown;

Oracle instance shut down

RMAN> STARTUP MOUNT;

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     418484224 bytes

Fixed Size                     1345352 bytes
Variable Size                335546552 bytes
Database Buffers              75497472 bytes
Redo Buffers                   6094848 bytes
For record type BACKUP PIECE RECIDS from 5 to 82 are re-used before resync

  • Since the controlfile is restored from PRIMARY, the datafile locations in STANDBY controlfile will be same as PRIMARY database, so catalog datafiles in STANDBY will do the necessary rename operations. Perform the below step in STANDBY for each diskgroup where the datafile directory structure between primary and standby are different.
RMAN> CATALOG START WITH '+DATA/HMPROD_NDC/DATAFILE/'
List of Files Unknown to the Database
=====================================
File Name: +data/spfilehmprod.ora
File Name: +data/HMPROD_NDC/TEMPFILE/TEMP.265.854647317
File Name: +data/HMPROD_NDC/ONLINELOG/group_1.261.854646417
File Name: +data/HMPROD_NDC/ONLINELOG/group_2.260.854646431
File Name: +data/HMPROD_NDC/ONLINELOG/group_3.259.854646441
File Name: +data/HMPROD_NDC/ONLINELOG/group_4.258.854646449
File Name: +data/HMPROD_NDC/ONLINELOG/group_5.267.854646461
File Name: +data/HMPROD_NDC/ONLINELOG/group_6.266.854646471
File Name: +data/HMPROD_NDC/DATAFILE/SYSTEM.256.854646189
File Name: +data/HMPROD_NDC/DATAFILE/SYSAUX.272.854646191
File Name: +data/HMPROD_NDC/DATAFILE/UNDOTBS1.271.854646191
File Name: +data/HMPROD_NDC/DATAFILE/USERS.270.854646191
File Name: +data/HMPROD_NDC/DATAFILE/MGMT_ECM_DEPOT_TS.264.854660485
File Name: +data/HMPROD_NDC/DATAFILE/MGMT_TABLESPACE.263.854660517
File Name: +data/HMPROD_NDC/DATAFILE/MGMT_AD4J_TS.262.854660573
File Name: +data/HMPROD_NDC/DATAFILE/BTEST.273.946849219
File Name: +data/HMPROD_NDC/CONTROLFILE/Current.269.854646135

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +data/HMPROD_NDC/TEMPFILE/TEMP.265.854647317
File Name: +data/HMPROD_NDC/DATAFILE/SYSTEM.256.854646189
File Name: +data/HMPROD_NDC/DATAFILE/SYSAUX.272.854646191
File Name: +data/HMPROD_NDC/DATAFILE/UNDOTBS1.271.854646191
File Name: +data/HMPROD_NDC/DATAFILE/USERS.270.854646191
File Name: +data/HMPROD_NDC/DATAFILE/MGMT_ECM_DEPOT_TS.264.854660485
File Name: +data/HMPROD_NDC/DATAFILE/MGMT_TABLESPACE.263.854660517
File Name: +data/HMPROD_NDC/DATAFILE/MGMT_AD4J_TS.262.854660573
File Name: +data/HMPROD_NDC/DATAFILE/BTEST.273.946849219
  • Switch the datafiles to its correct names at the standby site :
RMAN> SWITCH DATABASE TO COPY;

datafile 1 switched to datafile copy "+DATA/hmprod_ndc/datafile/system.256.854646189"
datafile 2 switched to datafile copy "+DATA/hmprod_ndc/datafile/sysaux.272.854646191"
datafile 3 switched to datafile copy "+DATA/hmprod_ndc/datafile/undotbs1.271.854646191"
datafile 4 switched to datafile copy "+DATA/hmprod_ndc/datafile/users.270.854646191"
datafile 5 switched to datafile copy "+DATA/hmprod_ndc/datafile/mgmt_ecm_depot_ts.264.854660485"
datafile 6 switched to datafile copy "+DATA/hmprod_ndc/datafile/mgmt_tablespace.263.854660517"
datafile 7 switched to datafile copy "+DATA/hmprod_ndc/datafile/mgmt_ad4j_ts.262.854660573"
datafile 8 switched to datafile copy "+DATA/hmprod_ndc/datafile/btest.273.946849219"
  • On standby database, clear all standby redo log groups and start MRP .
SQL> ALTER DATABASE CLEAR LOGFILE GROUP [group no];

Database altered.
SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Media recovery complete.


Recovery failed while applying RMAN incremental backup on standby

 

 RMAN> recover database noredo;

Starting recover at 11-SEP-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=51 device type=DISK
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: +DATA/hmprod_ndc/datafile/system.256.854646189
destination for restore of datafile 00002: +DATA/hmprod_ndc/datafile/sysaux.272.854646191
destination for restore of datafile 00003: +DATA/hmprod_ndc/datafile/undotbs1.271.854646191
destination for restore of datafile 00004: +DATA/hmprod_ndc/datafile/users.270.854646191
destination for restore of datafile 00005: +DATA/hmprod_ndc/datafile/mgmt_ecm_depot_ts.264.854660485
destination for restore of datafile 00006: +DATA/hmprod_ndc/datafile/mgmt_tablespace.263.854660517
destination for restore of datafile 00007: +DATA/hmprod_ndc/datafile/mgmt_ad4j_ts.262.854660573
destination for restore of datafile 00008: +DATA/hmprod_ndc/datafile/btest.273.946849219
channel ORA_DISK_1: reading from backup piece /backup/incr/inc_hmprd_94se6sub_1_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/11/2017 15:50:50
ORA-19870: error while restoring backup piece /backup/incr/inc_hmprd_94se6sub_1_1
ORA-19573: cannot obtain exclusive enqueue for datafile 6


Solution :
Make sure you have stopped redo apply before starting recovery process.

SQL > alter database recover managed standby database cancel;
 



Oracle Enterprise Manager (OEM) Cloud Control Installation

 

Pre-requisites for installing oracle enterprise manager cloud control.

Server requirements (4GB Physical memory , 4Gb Swap memory , 40Gb space on any mount point and should be owned by oracle.
Install required packages (as per oracle database installation).
configure soft limit and hard limits as per oracle requirements.
configure proper kernel parameters.
Make several directories for installation.
If You have already repository database you can use the same . if not create a new database then follow steps to avoid errors during installation.
Go to $ORACLE_HOME/bin/emca -deconfig dbcontrol -repos drop (enter database name , sys and sysman passoword .


Then follow the below steps.





















    Popular Posts