ASM DATAGUARD

ASM DATAGUARD:

PRIMARY SIDE
PFILE

rcl.__db_cache_size=184549376
orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__shared_pool_size=88080384
orcl.__streams_pool_size=0
*.audit_file_dest='/database/oraeng/app/oracle/product/10.2.0/admin/orcl/adump'
*.background_dump_dest='/database/oraeng/app/oracle/product/10.2.0/admin/orcl/bdump'
*.compatible='10.2.0.3.0'
*.control_files='+DG1/orcl/controlfile/current.261.664328141','+DG1/orcl/controlfile/current.260.664328143'
*.core_dump_dest='/database/oraeng/app/oracle/product/10.2.0/admin/orcl/cdump'
*.db_block_size=8192
*.db_create_file_dest='+DG1'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='orcl'
#db_recovery_file_dest='+DG1'
#db_recovery_file_dest_size=1073741824
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.job_queue_processes=10
#local_listener='LISTENER_ORCL'
#log_archive_dest_1='LOCATION=+DG1/'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=285212672
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/database/oraeng/app/oracle/product/10.2.0/admin/orcl/udump'



db_unique_name=prim
log_archive_config='dg_config=(prim,stan)'
log_archive_dest_1='LOCATION=+DG1/orcl/arch
VALID_FOR=(all_logfiles,all_roles) db_unique_name=prim'
#log_archive_dest_3='LOCATION=+DG1/orcl/arch4
#VALID_FOR=(standby_logfiles,standby_role) db_unique_name=prim'
log_archive_dest_2='SERVICE=to_slist LGWR SYNC AFFIRM REOPEN=60
VALID_FOR=(online_logfiles,primary_roles) db_unique_name=stan'
#log_archive_dest_state_3=enable
                                                              44,1  log_archive_dest_state_1=enable
log_archive_dest_state_2=enable
FAL_SERVER=to_slist
FAL_CLIENT=plist
standby_file_management=auto
db_file_name_convert='+DG1/orcl/datafile/','+DG1/sorcl/datafile/'
log_file_name_convert='+DG1/orcl/onlinelog/','+DG1/sorcl/onlinelog/'
#remote_archive_enable=receive
standby_archive_dest='+DG1/sorcl/arch'
LOCK_NAME_SPACE=orcl

LISTENER.ORA

SID_LIST_plist =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = /database/oraeng/app/oracle/product/10.2.0)
    )
  )

plist =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = sondba.oracle.com)(PORT = 1521))
    )
  )


TNSNAMES.ORA

to_slist =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sondba.oracle.com)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME=sorcl)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
    )
    (CONNECT_DATA =
      (SID = sorcl)
    )
  )


STANDBY SIDE

PFILE

orcl.__db_cache_size=184549376
orcl.__java_pool_size=4194304
orcl.__large_pool_size=4194304
orcl.__shared_pool_size=88080384
orcl.__streams_pool_size=0
*.audit_file_dest='/database/oraeng/app/oracle/product/10.2.0/admin/orcl/adump'
*.background_dump_dest='/database/oraeng/app/oracle/product/10.2.0/admin/orcl/bdump'
*.compatible='10.2.0.3.0'
*.control_files='+dg1/sorcl/controlfile/standbycont.ctl'
*.core_dump_dest='/database/oraeng/app/oracle/product/10.2.0/admin/orcl/cdump'
*.db_block_size=8192
*.db_create_file_dest='+DG1'
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='orcl'
#db_recovery_file_dest='+DG1'
#db_recovery_file_dest_size=1073741824
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.job_queue_processes=10
#local_listener='LISTENER_ORCL'
#log_archive_dest_1='LOCATION=+DG1/'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=285212672
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/database/oraeng/app/oracle/product/10.2.0/admin/orcl/udump'



db_unique_name=stan
log_archive_config='DG_CONFIG=(prim,stan)'

log_archive_dest_3='LOCATION=+DG1/sorcl/arch3
VALID_FOR=(online_logfiles,all_roles) db_unique_name=stan'
log_archive_dest_1='LOCATION=+DG1/sorcl/arch
VALID_FOR=(standby_logfiles,standby_role) db_unique_name=stan'
log_archive_dest_2='SERVICE=to_plist LGWR SYNC AFFIRM reopen=60
VALID_FOR=(online_logfiles,primary_role) db_unique_name=prim'
log_archive_dest_state_1=enable
log_archive_dest_state_2=enable
log_archive_dest_state_3=enable
FAL_SERVER=to_plist
FAL_CLIENT=slist
standby_file_management=auto
db_file_name_convert='+DG1/sorcl/datafile','+DG1/orcl/datafile'
log_file_name_convert='+DG1/sorcl/onlinelog','+DG1/orcl/onlinelog'
#remote_archive_enable=true
standby_archive_dest='+DG1/orcl/arch'
LOCK_NAME_SPACE=sorcl







LISTENER.ORA

SID_LIST_slist =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = sorcl)
      (ORACLE_HOME = /database/oraeng/app/oracle/product/10.2.0)
    )
  )

slist =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = sondba.oracle.com)(PORT = 1522))
    )
  )

TNSNAMES.ORA
to_plist =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sondba.oracle.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME=orcl)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
    )
    (CONNECT_DATA =
      (SID = orcl)
    )
  )


PRIMARY SIDE

RMAN>backup database plus archivelog;

RMAN>backup current controlfile for standby format
               '+DG1/sorcl/controlfile/standbycont.ctl';                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               



  
STANDBY SIDE

SQL> startup nomount


ORACLE instance started.

Total System Global Area  285212672 bytes
Fixed Size                  1267068 bytes
Variable Size              92277380 bytes
Database Buffers          188743680 bytes
Redo Buffers                2924544 bytes


[oracle10g@sondba ~]$ rman target sys/abc@to_plist auxiliary sys/abc@to_slist

Recovery Manager: Release 10.2.0.4.0 - Production on Wed Sep 3 06:36:35 2008

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

connected to target database: ORCL (DBID=1192108876)
connected to auxiliary database: ORCL (not mounted)

RMAN> duplicate target database for standby dorecover nofilenamecheck;

Starting Duplicate Db at 03-SEP-08
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=155 devtype=DISK

contents of Memory Script:
{
   set until scn  550872;
   restore clone standby controlfile;
   sql clone 'alter database mount standby database';
}
executing Memory Script

executing command: SET until clause

Starting restore at 03-SEP-08
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece +DG1/sorcl/controlfile/standbycont.ctl
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=+DG1/sorcl/controlfile/standbycont.ctl tag=TAG20080903T060509
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
output filename=+DG1/sorcl/controlfile/standbycont.ctl
Finished restore at 03-SEP-08

sql statement: alter database mount standby database
released channel: ORA_AUX_DISK_1
WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to diskgroup only.

contents of Memory Script:
{
   set until scn  550872;
   set newname for tempfile  1 to
 "+dg1";
   switch clone tempfile all;
   set newname for datafile  1 to
 "+dg1";
   set newname for datafile  2 to
 "+dg1";
   set newname for datafile  3 to
 "+dg1";
   set newname for datafile  4 to
 "+dg1";
   set newname for datafile  5 to
 "+dg1";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

renamed temporary file 1 to +dg1 in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 03-SEP-08
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=155 devtype=DISK

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DG1
restoring datafile 00002 to +DG1
restoring datafile 00003 to +DG1
restoring datafile 00004 to +DG1
restoring datafile 00005 to +DG1
c0hannel ORA_AUX_DISK_1: reading from backup piece /database/oraeng/app/oracle/product/10.2.0/dbs/0djpl09n_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/database/oraeng/app/oracle/product/10.2.0/dbs/0djpl09n_1_1 tag=TAG20080903T055046
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:15
Finished restore at 03-SEP-08

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy recid=10 stamp=664439921 filename=+DG1/stan/datafile/system.320.664439845
datafile 2 switched to datafile copy
input datafile copy recid=11 stamp=664439921 filename=+DG1/stan/datafile/undotbs1.323.664439849
datafile 3 switched to datafile copy
input datafile copy recid=12 stamp=664439921 filename=+DG1/stan/datafile/sysaux.321.664439847
datafile 4 switched to datafile copy
input datafile copy recid=13 stamp=664439921 filename=+DG1/stan/datafile/users.324.664439851
datafile 5 switched to datafile copy
input datafile copy recid=14 stamp=664439921 filename=+DG1/stan/datafile/example.322.664439849

contents of Memory Script:
{
   set until scn  550872;
   recover
   standby
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 03-SEP-08
using channel ORA_AUX_DISK_1

starting media recovery

archive log thread 1 sequence 38 is already on disk as file +DG1/orcl/arch/1_38_664392681.dbf
archive log filename=+DG1/orcl/arch/1_38_664392681.dbf thread=1 sequence=38
media recovery complete, elapsed time: 00:00:03
Finished recover at 03-SEP-08
Finished Duplicate Db at 03-SEP-08

RMAN> exit


Recovery Manager complete.


SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY

SQL> select open_mode from v$database;

OPEN_MODE
----------
MOUNTED


SQL> alter database add standby logfile group 4 '+DG1/stan/stanlog/group_4.log' size 50m;

Database altered.

SQL> alter database add standby logfile group 5 '+DG1/stan/stanlog/group_5.log' size 50m;

Database altered.

SQL> alter database add standby logfile group 6 '+DG1/stan/stanlog/group_6.log' size 50m;

Database altered.

SQL> select group#,status from v$standby_log;

    GROUP# STATUS
---------- ----------
         4 UNASSIGNED
         5 UNASSIGNED
         6 UNASSIGNED

SQL> alter database recover managed standby database using current logfile;






Switch over:

Ø  No users are connected  primary database at the time of switchover


                                                           
Primary
Standby

SQL> select switchover_status from v$database;

SWITCHOVER_STATUS
--------------------
TO STANDBY
SQL> select switchover_status from v$database;

SWITCHOVER_STATUS
--------------------
TO PRIMARY


SQL> alter database commit to switchover to physical standby;

Database altered.



Comes out from recover managed mode
                Shut immediate



SQL> alter database commit to switchover to physical primary;

Database altered.





Startup nomount

Shut immediate

Startup
SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PRIMARY

SQL> alter database mount standby                 database;

SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY


SQL> alter database recover managed standby database disconnect;






No comments: