Stalk BrainSurface @

  • Facebook Page: 113995341985805
  • FeedBurner: brainsurface
  • Twitter: brainsurface
  • YouTube: brainsurface
  • External Link: paper.li/brainsurface/oracle-java-headlines

Like BrainSurface?

Joomla Templates and Joomla Extensions by JoomlaVision.Com

My SocialSurface

BlogSurface LIVE

Oracle R12 Financials ONLINE Training by highly experienced and versatile faculty.

New to Oracle Financials?? Get trained from the best instructor known  to have trained novices as experts in this field.  Training comes with exhaus ...
Readmore...

IOUG Virtualization SIG: Virtualization Events at COLLABORATE12

Virtualization Events at COLLABORATE 12 - IOUG Forum Sunday 4-5pm IOUG Virtualization SIG Meet and Greet (Surf F) 5-7pm IOUG We ...
Readmore...

Don’t let COLLABORATE12 slip away – Register NOW!

Special Registration Code : AP03 (Expires 04/06/2012) Registration URL: http://ioug.org/c12 Sign Up, learn from and interact wit ...
Readmore...

Interview Question

Oracle Database Administration (DBA): 1. What is an Oracle Instance? 2. What information is stored in Control File? 3. When you start an Oracle DB ...
Readmore...

Building a new oracle server for practice

So i've been working on building my own home server and it was going well until I tested the components I purchased from new egg. I bought: MSI mo ...
Readmore...

Data Guard by RMAN

============DATA GUARD=================
———–
===========PRIMARY STEPS=================

<oracle.root>chown -R oracle:oinstall /u01

SQL>alter database force logging;

rman>backup database plus archivelog;     OR (backup database include current controlfile for standby plus archivelog;)
rman>backup current controlfile for standby;

====>”Transfer backup to standby”
====> Now first create folder on standby like mkdir 2011_03_25;
====> Transfer the backup on standby server on same location

[root@sameer 2011_04_29]#
scp -p * umer.com:/u01/app/oracle/flash_recovery_area/ORCL/backupset/2011_04_29/

1. SQL>alter system set db_unique_name=’pri’ scope=spfile;

2. SQL>alter system set log_archive_dest_1=’LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=pri’;

3. SQL>alter system set log_archive_dest_2=’SERVICE=standby LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=standby’;

4. SQL>alter system set fal_server=standby;

5. SQL>alter system set fal_client=pri;

6. SQL>create net services for primary(pri)

============STANDBY Steps=================

<oracle.root>chown -R oracle:oinstall /u01

optional–SQL>create pfile from spfile;  or just set parameter by alter command on nomout

1. SQL>alter system set log_archive_dest_1=’LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby’;

2. SQL>alter system set log_archive_dest_2=’SERVICE=standby LGWR SYNC AFFIRM VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) db_unique_name=pri’;

3. SQL>alter system set fal_server=pri;

4. SQL>alter system set fal_client=standby;

5. SQL>alter system set db_unique_name=’standby’ scope=spfile;

6. SQL>create net services for standby (standby)

==========STANDBY SERVER==============
————-

>startup nomount  // if you have create pfile the “startup nomount pfile (change pfile)

rman
rman>connect target sys/oracle@pri
rman>connect auxiliary /
rman>duplicate target database for standby nofilenamecheck;

SQL>

SQL>recover managed standby database disconnect from session;
SQL>select sequence#, applied from v$archived_log;

“This command for check error for pri or standby”
SQL>select error from v$archive_dest;

“This command use for check status standby database from pri
SQL>select * from v$dataguard_status;

=======FOR REAL TIME APPLY==========

———-Add logfile PRI———–

SQL>alter database add standby logfile group 4 ‘/u01/app/oracle/oradata/orcl/redo04.log’ size 50m;
SQL>alter database add standby logfile group 5 ‘/u01/app/oracle/oradata/orcl/redo05.log’ size 50m;
SQL>alter database add standby logfile group 6 ‘/u01/app/oracle/oradata/orcl/redo06.log’ size 50m;

———-Add logfile STANDBY———-

mount mode
SQL>recover managed standby database cancel;

SQL>alter database add standby logfile group 4 ‘/u01/app/oracle/oradata/orcl/redo04.log’ size 50m;
SQL>alter database add standby logfile group 5 ‘/u01/app/oracle/oradata/orcl/redo05.log’ size 50m;
SQL>alter database add standby logfile group 6 ‘/u01/app/oracle/oradata/orcl/redo06.log’ size 50m;
SQL> recover managed  standby database disconnect using current logfile;

If u have create user or table on pri then u can check on standby
================================================================

SQL> recover managed standby database cancel;
SQL>alter database open read only;
SQL>select user_name from dba_users;

mount mode
=======protection mode===========
——-On primary database——-
SQL>alter database set standby database to maximize protection;
SQL>alter database set standby database to maximize availability;
SQL>alter database set standby database to maximize performance;

on standby to see (Real time apply);
=================================
SQL> recover managed standby database cancel;
SQL>recover managed standby database using current logfile;

– Convert primary database to standby
SQL>CONNECT sys/change_on_install@prim1 AS SYSDBA
SQL>ALTER DATABASE COMMIT TO SWITCHOVER TO STANDBY;

– Shutdown primary database
SQL>SHUTDOWN IMMEDIATE;

– Mount old primary database as standby database
STARTUP NOMOUNT PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora
SQL>ALTER DATABASE MOUNT STANDBY DATABASE;
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;

– Convert standby database to primary
SQL>CONNECT sys/change_on_install@stby1 AS SYSDBA
SQL>ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;

– Shutdown standby database
SHUTDOWN IMMEDIATE;

– Open old standby database as primary
STARTUP PFILE=C:\Oracle\Admin\TSH1\pfile\init.ora

How to connect with Dataguard at standby
—————————————
SQL>Startup mount
SQL>ALTER DATABASE RECOVER  managed standby database disconnect;
SQL>ALTER DATABASE RECOVER  managed standby database disconnect using current logfile;

Logical Standby
===============

standby
SQL>alter database recover managed standby database cancel;

pri
SQL>alter system set log_archive_dest_3=’LOCATION=/u01 VALID_FOR=(standby_logfiles,standby_ROLE) DB_UNIQUE_NAME=pri’;
SQL>alter system set undo_retention=3600;
SQL>EXECUTE DBMS_LOGSTDBY.BUILD;

standby
SQL>Alter database recover to logical standby ora;
SQL>alter system set db_name=ora scope=spfile;
SQL>shu immedite
[oracle@oracle dbs]$ orapwd file=ORAPWora password=oracle entries=5 force=y
SQL>statrtup mout;
SQL>Alter database open resetlogs;
SQL>Alter database start logical standby apply immediate;

by Engr pawan kumar
pawankella@yahoo.com

This entry was posted in Data Guard, My Blogs and tagged . Bookmark the permalink.

One Response to Data Guard by RMAN

  1. pawan says:

    Perfect Document of data guard

Leave a Reply