• No results found

Standby Database

N/A
N/A
Protected

Academic year: 2021

Share "Standby Database"

Copied!
12
0
0

Loading.... (view fulltext now)

Full text

(1)

In sweet memories of my ever loving brother "kutty thambi " ARUN KUMAR

ORACLE DBA

H A P P I N E S S I S R E A L W H E N S H A R E D

Home About Me Useful Queries Useful Scripts Disclaimer

M O N D A Y , F E B R U A R Y 2 7 , 2 0 1 2

Step by Step document to Create Physical Standby Database from Active Database

using RMAN

Step by step document to create a physical standby database using RMAN DUPLICATE FROM ACTIVE DATABASE command without shutting down the primary and using primary active database files (No need to take backup)

Database Name :- WHITE Primary db_unique_name :- WHITE standby db_unique_name :- BLACK

Primary Database Server Name :- DC1 Standby Database Server Name :- DC2

Steps:-

1.Make the necessary changes to the primary database. a. Enable force logging.

b. Creating the password file if one does not exist. c. Create standby redologs.

d. Modify the parameter file suitable for Dataguard.

e. Change the database to archivelog mode if it is in no archivelog mode. 2. Ensure that the sql*net connectivity is working fine.

----if not add an entry for database in TNSNAMES.ORA and LISTENER.ORA file for primary and standby database. 3. Create the standby database over the network using the active(primary) database files.

a.create a password file for standby database

The username is required to be SYS and the password needs to be the same on the Primary and Standby. The password file name must match the instance name/SID used at the standby site, not the DB_NAME. b. Create the initialization parameter file for the standby database (auxiliary database)

c. Create the necessary mount points or the folders for the database files

d. Run the standby creation ON STANDBY by connecting to primary as target database.

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 'white','black' set db_unique_name='black' set db_file_name_convert='/white/','/black/' set log_file_name_convert='/white/','/black/' set control_files='+DATA/black/controlfile/control01.ctl' set log_archive_max_processes='5' set fal_client='black' set fal_server='white' set standby_file_management='AUTO' set log_archive_config='dg_config=(white,black)' set log_archive_dest_1='service=white ASYNC valid_for=

all documents have been done in my testing environment. If you find any mistakes, please inform me to rectify my mistakes. Thanks for reading my blog post and your appreciation.

Rajeshkumar Govindarajan. "knowing is knowledge"

"Do something (anything). If you don't do anything, you won't get anywhere. Make it your hobby, not a chore, but above all have fun!" G O O G L E B L O G S E A R C H Loading... A R C H I V E S ▼  2012 (6) ►  September (1) ►  May (1) ▼  February (1)

Step by Step document to Create Physical Standby D...

►  January (3)

►  2011 (7)

►  2010 (46)

►  2009 (58)

defeat the defeat before defeat defeats you.

“Give a man a fish and you feed him for a day.

Teach a

man to fish and you feed him for a lifetime.”

P O P U L A R P O S T S

Oracle 10gR2 RAC Installation in Linux 5, RHEL5 using VMware Server2

Step by Step, document for creating Physical Standby Database, 10g DATA GUARD

BDUMP, UDUMP, ALERT LOG FILES IN ORACLE 11G

(2)

(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=white' ;

}

4. Check the log shipping and apply.

Demo:-

SQL> alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(white,black)'; SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=+DATA/archivelog/white/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=white';

SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=black LGWR ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=black';

SQL> alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE; SQL> alter system set FAL_SERVER=black;

SQL> alter system set FAL_CLIENT=white; SQL> alter system set

DB_FILE_NAME_CONVERT='+DATA/black/datafile/','+DATA/white/datafile/','+DATA/black/te mpfile/','+DATA/white/tempfile/' scope=spfile;

SQL> alter system set

LOG_FILE_NAME_CONVERT='+DATA/black/onlinelog/','+DATA/white/onlinelog/' scope=spfile;

SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=+DATA/archivelog/white/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=white';

SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=black LGWR ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=black';

SQL> alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE; SQL> alter system set FAL_SERVER=black;

SQL> alter system set FAL_CLIENT=white; SQL> alter system set

DB_FILE_NAME_CONVERT='+DATA/black/datafile/','+DATA/white/datafile/','+DATA/black/te mpfile/','+DATA/white/tempfile/' scope=spfile;

SQL> alter system set

LOG_FILE_NAME_CONVERT='+DATA/black/onlinelog/','+DATA/white/onlinelog/' scope=spfile;

System altered. SQL> archive log list;

Database log mode No Archive Mode Automatic archival Disabled

Archive destination /u01/app/oracle/product/11.2.0/db_1/dbs/arch Oldest online log sequence 13

Current log sequence 15

SQL> select force_logging from v$database; FOR

--- NO

SQL> Alter database force logging;

SQL> select force_logging from v$database; FOR

--- YES

SQL> select log_mode from v$database; LOG_MODE

--- NOARCHIVELOG

SQL> select name,database_role,db_unique_name from v$database; NAME DATABASE_ROLE DB_UNIQUE_NAME

--- --- --- WHITE PRIMARY white

SQL> select name from v$datafile; NAME

--- +DATA/white/datafile/system.324.776321695

+DATA/white/datafile/sysaux.337.776321703

Recover a Dropped or Deleted Table Using RMAN Backup

ORA-00283: ORA-00314: ORA-00312: Error and solution

-create lost controlfile

Configuration of 10g Data Guard Broker and Observer for Switchover

ORA-01591: lock held by in-doubt distributed transaction

RMAN-03002: failure of Duplicate Db command RMAN-03015: error occurred in stored script Memory Script RMAN-06053: RMAN-06025

SYSAUX datafile or tablespace corrupted or lost no backup available

S U B S C R I B E V I A E M A I L

Subscribe to oracle dba by Email

F O L L O W E R S

H E L P C H I L D R E N A N D O R P H A N S

L A B E L S

9I concepts

10g concepts

RAC CONCEPTS

rman

dataguard

CLUSTERWARE

11g concepts Cloning Installation OCR Database creationUpgradation and Migration

(3)

+DATA/white/datafile/undotbs1.336.776321707 +DATA/white/datafile/users.335.776321707 SQL> col member for a65

SQL> select a.member,b.bytes/1024/1024 from v$Logfile a,v$log b where a.group#=b.group#; MEMBER --- B.BYTES/1024/1024 --- +DATA/white/onlinelog/group_3.302.776321951 5 +DATA/white/onlinelog/group_2.322.776321951 5 +DATA/white/onlinelog/group_1.311.776321949 5

SQL> select name from v$tempfile; NAME

--- +DATA/white/tempfile/temp.321.776321963

Adding standby redolog files.

SQL> alter database add standby logfile size 5m; Database altered.

SQL> alter database add standby logfile size 5m; Database altered.

SQL> alter database add standby logfile size 5m; Database altered.

SQL> alter database add standby logfile size 5m; Database altered.

SQL> col member for a56

SQL> select member,type from v$logfile;

MEMBER TYPE --- --- +DATA/white/onlinelog/group_3.302.776321951 ONLINE +DATA/white/onlinelog/group_2.322.776321951 ONLINE +DATA/white/onlinelog/group_1.311.776321949 ONLINE +DATA/white/onlinelog/group_4.358.776324285 STANDBY +DATA/white/onlinelog/group_5.456.776324299 STANDBY +DATA/white/onlinelog/group_6.331.776324299 STANDBY +DATA/white/onlinelog/group_7.318.776324301 STANDBY 7 rows selected. SQL>

follow the below steps, if your database is in no archivelog, or else no need to shutdown the database

======================================================== SQL> shu immediate

Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount

ORACLE instance started.

Total System Global Area 1456349184 bytes Fixed Size 1336568 bytes Variable Size 855640840 bytes Database Buffers 587202560 bytes Redo Buffers 12169216 bytes Database mounted.

SQL> alter database archivelog; Database altered.

SQL> alter database open; Database altered.

SQL> create pfile='/tmp/init.ora' from spfile; File created.

=======================================================

add the following entry in the listener.ora file on primary database LISTENER =

(4)

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.2.101 )(PORT = 1521)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = white ) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1) (SID_NAME = white) ) ) ================================================== tnsnames.ora file on both machines

================================================== BLACK =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = dc2.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = black) ) ) WHITE = (DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = dc1.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = white) ) ) ============================================================= [oracle@dc1 admin]$ tnsping white

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 27-FEB-2012 05:46:29 Copyright (c) 1997, 2009, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =

dc1.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = white)))

OK (50 msec)

[oracle@dc1 admin]$ tnsping black

TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 27-FEB-2012 05:46:33 Copyright (c) 1997, 2009, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =

dc2.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = black))) OK (10 msec) [oracle@dc1 admin]$ ========================================================= [oracle@dc1 dbs]$ scp orapwwhite dc2:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwblack orapwwhite 100% 1536 1.5KB/s 00:00 [oracle@dc1 dbs]$ ========================================================== [oracle@dc1 dbs]$ scp /tmp/init.ora dc2:/u01/app/oracle/product/11.2.0/db_1/dbs/initblack.ora init.ora 100% 1333 1.3KB/s 00:00 [oracle@dc1 dbs]$

SQL> show parameter spfile;

NAME TYPE VALUE

(5)

spfile string +DATA/white/spfilewhite.ora SQL> archive log list;

Database log mode Archive Mode Automatic archival Enabled

Archive destination +DATA/archivelog/white/ Oldest online log sequence 16

Next log sequence to archive 18 Current log sequence 18 SQL>

follow below steps on machine two for creating standby database =================================================

[oracle@dc2 ~]$ cd /u01/app/oracle/product/11.2.0/db_1/dbs/ [oracle@dc2 dbs]$ cat initblack.ora

white.__db_cache_size=587202560 white.__java_pool_size=16777216 white.__large_pool_size=16777216

white.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment white.__pga_aggregate_target=587202560 white.__sga_target=872415232 white.__shared_io_pool_size=0 white.__shared_pool_size=234881024 white.__streams_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/white/adump' *.audit_trail='db' *.compatible='11.2.0.0.0' *.control_files='+DATA/white/controlfile/current.310.776321931' *.db_block_size=8192 *.db_create_file_dest='+DATA' *.db_domain='' *.db_file_name_convert='+DATA/black/datafile/','+DATA/white/datafile/','+DATA/black/ tempfile/','+DATA/white/tempfile/' *.db_name='white' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=whiteXDB)' *.fal_client='WHITE' *.fal_server='BLACK' *.log_archive_config='DG_CONFIG=(white,black)' *.log_archive_dest_1='LOCATION=+DATA/archivelog/white/ VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=white'

*.log_archive_dest_2='SERVICE=black LGWR ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=black' *.log_archive_dest_state_1='ENABLE' *.log_file_name_convert='+DATA/black/onlinelog/','+DATA/white/onlinelog/' *.memory_target=1449132032 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1' [oracle@dc2 dbs]$ ===================================

after editing the pfile parameter required for standby database =================================

black.__db_cache_size=587202560 black.__java_pool_size=16777216 black.__large_pool_size=16777216

black.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment black.__pga_aggregate_target=587202560 black.__sga_target=872415232 black.__shared_io_pool_size=0 black.__shared_pool_size=234881024 black.__streams_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/black/adump' *.audit_trail='db' *.compatible='11.2.0.0.0' *.control_files='+DATA/black/controlfile/current.310.776321931' *.db_block_size=8192

(6)

*.db_create_file_dest='+DATA' *.db_domain='' *.db_file_name_convert='+DATA/white/datafile/','+DATA/black/datafile/','+DATA/white/ tempfile/','+DATA/black/tempfile/' *.db_name='white' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=blackXDB)' *.fal_client='BLACK' *.fal_server='WHITE' *.log_archive_config='DG_CONFIG=(white,black)' *.log_archive_dest_1='LOCATION=+DATA/archivelog/black/ VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=black'

*.log_archive_dest_2='SERVICE=white LGWR ASYNC VALID_FOR= (ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=white' *.log_archive_dest_state_1='ENABLE' *.log_file_name_convert='+DATA/white/onlinelog/','+DATA/black/onlinelog/' *.memory_target=1449132032 *.open_cursors=300 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1' ========================================== add an entry in the /etc/oratab file black:/u01/app/oracle/product/11.2.0/db_1:N add the following lines to the listener.ora file LISTENER =

(DESCRIPTION_LIST = (DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.2.102)(PORT = 1521)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = black ) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1) (SID_NAME = black) ) )

add the below entries on both nodes tnsnames.ora file # tnsnames.ora Network Configuration

File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools.

BLACK =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = dc2.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = black) ) ) WHITE = (DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = dc1.localdomain)(PORT = 1521)) (CONNECT_DATA =

(SERVER = DEDICATED) (SERVICE_NAME = white) )

)

[oracle@dc2 admin]$ . oraenv ORACLE_SID = [black] ? black

The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 is /u01/app/oracle

[oracle@dc2 admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 27 05:59:50 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved.

(7)

Connected to an idle instance. SQL> startup nomount

ORA-00304: requested INSTANCE_NUMBER is busy

to resolve this issue add db_unique_name='black' in the pfile of standby database. ORA-09925: Unable to create audit trail file

Linux Error: 2: No such file or directory Additional information: 9925

to resolve this issue create adump directory

[oracle@dc2 dbs]$ mkdir -p /u01/app/oracle/admin/black/adump SQL> startup nomount

ORACLE instance started.

Total System Global Area 1456349184 bytes Fixed Size 1336568 bytes Variable Size 855640840 bytes Database Buffers 587202560 bytes Redo Buffers 12169216 bytes SQL>

SQL> conn sys/oracle@white as sysdba; Connected.

SQL> conn sys/oracle@black as sysdba; ERROR:

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

-- to resolve this issue need to check/add the below entries in listener.ora file. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = black ) (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1) (SID_NAME = black) ) )

Warning: You are no longer connected to ORACLE. SQL> conn sys/oracle@black as sysdba;

ERROR:

ORA-12528: TNS:listener: all appropriate instances are blocking new connections --- to resolve blocking new connections shutdown the database and startup nomount the standby database again will resolve it.

SQL> conn sys/oracle@black as sysdba; Connected.

SQL>

SQL> conn sys/oracle@black as sysdba; Connected.

SQL>

create standby database from active primary database using RMAN [oracle@dc2 dbs]$ . oraenv

ORACLE_SID = [oracle] ? black

The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 is /u01/app/oracle

[oracle@dc2 dbs]$ rman target sys/oracle@white auxiliary sys/oracle@black Recovery Manager: Release 11.2.0.1.0 - Production on Mon Feb 27 06:11:51 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: WHITE (DBID=3671326283)

connected to auxiliary database: WHITE (not mounted) RMAN> run {

allocate channel p1 type disk; allocate channel p2 type disk; allocate channel p3 type disk; allocate channel p4 type disk;

allocate auxiliary channel stby type disk;

duplicate target database for standby from active database spfile

parameter_value_convert 'white','black' set db_unique_name='black'

set db_file_name_convert='/white/','/black/' set log_file_name_convert='/white/','/black/'

(8)

set control_files='+DATA/black/controlfile/control01.ctl' set log_archive_max_processes='5' set fal_client='black' set fal_server='white' set standby_file_management='AUTO' set log_archive_config='dg_config=(white,black)' ; } 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> using target database control file instead of recovery catalog

allocated channel: p1

channel p1: SID=55 device type=DISK allocated channel: p2

channel p2: SID=40 device type=DISK allocated channel: p3

channel p3: SID=1 device type=DISK allocated channel: p4

channel p4: SID=39 device type=DISK allocated channel: stby

channel stby: SID=32 device type=DISK Starting Duplicate Db at 27-FEB-12 contents of Memory Script:

{

backup as copy reuse

targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwwhite' auxiliary format

'/u01/app/oracle/product/11.2.0/db_1/dbs/orapwblack' targetfile '+DATA/white/spfilewhite.ora' auxiliary format

'/u01/app/oracle/product/11.2.0/db_1/dbs/spfileblack.ora' ; sql clone "alter system set

spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfileblack.ora''"; }

executing Memory Script Starting backup at 27-FEB-12 Finished backup at 27-FEB-12 sql statement: alter system set

spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfileblack.ora'' contents of Memory Script:

{

sql clone "alter system set audit_file_dest = ''/u01/app/oracle/admin/black/adump'' comment= '''' scope=spfile";

sql clone "alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=blackXDB)'' comment= '''' scope=spfile";

sql clone "alter system set log_archive_dest_1 =

''LOCATION=+DATA/archivelog/black/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=white'' comment=

'''' scope=spfile";

sql clone "alter system set db_unique_name = ''black'' comment=

'''' scope=spfile";

sql clone "alter system set db_file_name_convert = ''/white/'', ''/black/'' comment=

'''' scope=spfile";

sql clone "alter system set log_file_name_convert = ''/white/'', ''/black/'' comment=

'''' scope=spfile";

sql clone "alter system set control_files = ''+DATA/black/controlfile/control01.ctl'' comment= '''' scope=spfile";

sql clone "alter system set log_archive_max_processes = 5 comment=

'''' scope=spfile";

sql clone "alter system set fal_client = ''black'' comment=

(9)

'''' scope=spfile";

sql clone "alter system set fal_server = ''white'' 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=(white,black)'' comment=

'''' scope=spfile";

shutdown clone immediate; startup clone nomount; }

executing Memory Script

sql statement: alter system set audit_file_dest

= ''/u01/app/oracle/admin/black/adump'' comment= '''' scope=spfile sql statement: alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=blackXDB)'' comment= '''' scope=spfile

sql statement: alter system set log_archive_dest_1

= ''LOCATION=+DATA/archivelog/black/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=white'' comment= '''' scope=spfile

sql statement: alter system set db_unique_name = ''black'' comment= '''' scope=spfile

sql statement: alter system set db_file_name_convert = ''/white/'', ''/black/'' comment= '''' scope=spfile

sql statement: alter system set log_file_name_convert = ''/white/'', ''/black/'' comment= '''' scope=spfile

sql statement: alter system set control_files

= ''+DATA/black/controlfile/control01.ctl'' comment= '''' scope=spfile sql statement: alter system set log_archive_max_processes = 5 comment= '''' scope=spfile

sql statement: alter system set fal_client = ''black'' comment= '''' scope=spfile sql statement: alter system set fal_server = ''white'' 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=(white,black)'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started) Oracle instance started

Total System Global Area 1456349184 bytes Fixed Size 1336568 bytes Variable Size 855640840 bytes Database Buffers 587202560 bytes Redo Buffers 12169216 bytes allocated channel: stby

channel stby: SID=29 device type=DISK contents of Memory Script:

{

backup as copy current controlfile for standby auxiliary format '+DATA/black/controlfile/control01.ctl';

}

executing Memory Script Starting backup at 27-FEB-12 channel p1: starting datafile copy copying standby control file

output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_white.f tag=TAG20120227T061458 RECID=1 STAMP=776326500

channel p1: datafile copy complete, elapsed time: 00:00:08 Finished backup at 27-FEB-12

contents of Memory Script: {

sql clone 'alter database mount standby database'; }

executing Memory Script

(10)

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-FEB-12 channel p1: starting datafile copy

input datafile file number=00001 name=+DATA/white/datafile/system.324.776321695 channel p2: starting datafile copy

input datafile file number=00002 name=+DATA/white/datafile/sysaux.337.776321703 channel p3: starting datafile copy

input datafile file number=00003 name=+DATA/white/datafile/undotbs1.336.776321707 channel p4: starting datafile copy

input datafile file number=00004 name=+DATA/white/datafile/users.335.776321707 output file name=+DATA/black/datafile/undotbs1.266.776326483 tag=TAG20120227T061514 channel p3: datafile copy complete, elapsed time: 00:00:08

output file name=+DATA/black/datafile/users.514.776326483 tag=TAG20120227T061514 channel p4: datafile copy complete, elapsed time: 00:00:09

output file name=+DATA/black/datafile/sysaux.518.776326483 tag=TAG20120227T061514 channel p2: datafile copy complete, elapsed time: 00:01:19

output file name=+DATA/black/datafile/system.517.776326481 tag=TAG20120227T061514 channel p1: datafile copy complete, elapsed time: 00:01:40

Finished backup at 27-FEB-12

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=1 STAMP=776326581 file name=+DATA/black/datafile/system.517.776326481 datafile 2 switched to datafile copy

input datafile copy RECID=2 STAMP=776326581 file name=+DATA/black/datafile/sysaux.518.776326483 datafile 3 switched to datafile copy

input datafile copy RECID=3 STAMP=776326581 file name=+DATA/black/datafile/undotbs1.266.776326483

(11)

datafile 4 switched to datafile copy

input datafile copy RECID=4 STAMP=776326581 file name=+DATA/black/datafile/users.514.776326483 Finished Duplicate Db at 27-FEB-12

released channel: p1 released channel: p2 released channel: p3 released channel: p4 released channel: stby RMAN> exit

Recovery Manager complete. [oracle@dc2 dbs]$

SQL> conn / as sysdba Connected.

SQL> select name from v$datafile; NAME --- +DATA/black/datafile/system.517.776326481 +DATA/black/datafile/sysaux.518.776326483 +DATA/black/datafile/undotbs1.266.776326483 +DATA/black/datafile/users.514.776326483 SQL> select name from v$tempfile; NAME

--- +DATA

SQL> col member for a56

SQL> select member,type from v$logfile;

MEMBER TYPE --- --- +DATA/black/onlinelog/group_3.587.776326583 ONLINE +DATA/black/onlinelog/group_2.519.776326583 ONLINE +DATA/black/onlinelog/group_1.516.776326583 ONLINE +DATA/black/onlinelog/group_4.520.776326583 STANDBY +DATA/black/onlinelog/group_5.522.776326583 STANDBY +DATA/black/onlinelog/group_6.535.776326583 STANDBY +DATA/black/onlinelog/group_7.534.776326583 STANDBY 7 rows selected.

SQL> select name,database_role,db_unique_name from v$database; NAME DATABASE_ROLE DB_UNIQUE_NAME

--- --- --- WHITE PHYSICAL STANDBY black

SQL>

SQL> archive log list;

Database log mode Archive Mode Automatic archival Enabled Archive destination ?/dbs/arch Oldest online log sequence 0

Next log sequence to archive 0 Current log sequence 0

SQL> alter database recover managed standby database disconnect from session; Database altered.

SQL> archive log list;

Database log mode Archive Mode Automatic archival Enabled Archive destination ?/dbs/arch Oldest online log sequence 22

Next log sequence to archive 0 Current log sequence 23 SQL>

SQL> select open_mode from v$database; OPEN_MODE

--- READ ONLY WITH APPLY Regards,

(12)

  P O S T E D B Y R A J E S H K U M A R G O V I N D A R A J A N A T M O N D A Y , F E B R U A R Y 2 7 , 2 0 1 2 L A B E L S : 1 1 G C O N C E P T S, 1 1 G R 1, 1 1 G R 2, D A T A G U A R D

N O C O M M E N T S :

Post a Comment

Subscribe to: Post Comments (Atom)

B R U C E L E E T I P S

Home

Newer Post Older Post

The spirit of the individual is determined by his dominating

thought habits.

References

Related documents

Our examination of the records shows that while the prosecution established through the testimony of SPO2 Sanchez that the sale of the prohibited drug by the accused-appellant

The Lyons High School – Colorado State University Concurrent Enrollment Program is an opportunity to complete challenging college courses while you are still in high school, which

It will trace the meaning of the veil from the colonial period through unveiling and new veiling movements of 19 th and 20 th century across the Middle East, and finally to

Study Study N Patient Follow- Treatment Adherence Mean Definition Adherent Predictors Definition Virologic design characteristics up regimen assessment adherence good/perfect

Partners from North East of Gothenburg: the Community Center Hammarkullen, the Folk High School in Angered, the Library and Citizens’ Advice Bureau operated by the City District of

This energy, however, is not a blind mechanical force, but a living, pulsating, energy-conscious- ness, so that if a thought-form or magical image is built up in the conscious

This problem is solved by determining which data is used by more than one person and storing it on a network server – a central computer that provides a storage device and

societal  levels  with  which  to  analyze  people’s  economic  cost‐benefit  analysis  on  Turkey’s  potential  EU  accession.  Table  3,  taken  from