ORACLE DATAGUARD 10g WITH ASM CONFIGURATION


Oracle Dataguard ensures high availability, data protection, and disaster recovery for enterprise data. Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Data Guard maintains these standby databases as transactionally consistent copies of the production database. Then, 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, minimizing the downtime associated with the outage. Data Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of data protection and data availability.

this is step by step to configure ODG on ASM configuration (copy this artikel to notepad or editor to easy read ):

Prereq :

– 2 virtual machine(DBSERVER and DBSERVERDRC) with OEL 5.5 and Oracle database 10gR2 (ASM Storage : +DATA and +FRA).

+DATA for database file and +FRA for recovery area.

– Database with SID : “blackowl” are configured on DBSERVER and at DBSERVERDRC just software oracle only

ENABLE FORCE LOGGING ON PRIMARY

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

[oracle@DBSERVER ~]$ hostname

DBSERVER

[oracle@DBSERVER ~]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVER ~]$ sqlplus / as sysdba;

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 12:15:16 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> alter database force logging;

Database altered.

SQL>exit

ENABLE ARCHIVE LOG MODE ON PRIMARY

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

[oracle@DBSERVER ~]$ sqlplus / as sysdba;

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 12:15:16 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> archive log list;

Database log mode              No Archive Mode

Automatic archival             Disabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     0

Current log sequence           1

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount;

ORACLE instance started.

Total System Global Area  205520896 bytes

Fixed Size                  2019608 bytes

Variable Size             100667112 bytes

Database Buffers          100663296 bytes

Redo Buffers                2170880 bytes

Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     0

Next log sequence to archive   1

Current log sequence           1

SQL>

CRETAE SLR (STANDBY REDO LOG) ON PRIMARY (n+1)

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

[oracle@DBSERVER ~]$ sqlplus / as sysdba;

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 12:15:16 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> select group#,bytes from v$log;

GROUP#      BYTES

———- ———-

1   52428800

2   52428800

3   52428800

SQL> alter database add standby logfile group 11 size 52428800;

Database altered.

SQL> alter database add standby logfile group 12 size 52428800;

Database altered.

SQL> alter database add standby logfile group 13 size 52428800;

Database altered.

SQL> alter database add standby logfile group 14 size 52428800;

Database altered.

SQL>

BACKUP PRIMARY DATABASE on PRIMARY

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

[root@DBSERVER ~]# mkdir -p /oracle/stage

[root@DBSERVER ~]# chown -R oracle:oinstall /oracle/stage

[root@DBSERVER ~]# chmod -R 775 /oracle/stage

[root@DBSERVER ~]# su – oracle

[oracle@DBSERVER ~]$ cd /oracle

[oracle@DBSERVER oracle]$ ls -al

total 16

drwxr-xr-x   3 root   root     4096 Oct 15 12:29 .

drwxr-xr-x  27 root   root     4096 Oct 15 12:29 ..

drwxrwxr-x   2 oracle oinstall 4096 Oct 15 12:29 stage

[oracle@DBSERVER oracle]$

[oracle@DBSERVER oracle]$ rman target /

Recovery Manager: Release 10.2.0.1.0 – Production on Sat Oct 15 12:30:22 2011

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

connected to target database: BLACKOWL (DBID=398996180)

RMAN> backup database format ‘/oracle/stage/blackowl_db_%U’;

Starting backup at 15-OCT-11

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=154 devtype=DISK

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

input datafile fno=00001 name=+DATA/blackowl/datafile/system.302.764596709

input datafile fno=00003 name=+DATA/blackowl/datafile/sysaux.296.764596711

input datafile fno=00002 name=+DATA/blackowl/datafile/undotbs1.301.764596711

input datafile fno=00004 name=+DATA/blackowl/datafile/users.300.764596713

channel ORA_DISK_1: starting piece 1 at 15-OCT-11

channel ORA_DISK_1: finished piece 1 at 15-OCT-11

piece handle=/oracle/stage/blackowl_db_01mp5ml4_1_1 tag=TAG20111015T123547 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:25

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

including current control file in backupset

including current SPFILE in backupset

channel ORA_DISK_1: starting piece 1 at 15-OCT-11

channel ORA_DISK_1: finished piece 1 at 15-OCT-11

piece handle=/oracle/stage/blackowl_db_02mp5mpl_1_1 tag=TAG20111015T123547 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:11

Finished backup at 15-OCT-11

RMAN> backup archivelog all format ‘/oracle/stage/blackowl_arc_%U’;

Starting backup at 15-OCT-11

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archive log backupset

channel ORA_DISK_1: specifying archive log(s) in backup set

input archive log thread=1 sequence=1 recid=1 stamp=764599187

channel ORA_DISK_1: starting piece 1 at 15-OCT-11

channel ORA_DISK_1: finished piece 1 at 15-OCT-11

piece handle=/oracle/stage/blackowl_arc_03mp5msj_1_1 tag=TAG20111015T123947 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04

Finished backup at 15-OCT-11

RMAN> backup current controlfile for standby format ‘/oracle/stage/blackowl_control.bkp’;

Starting backup at 15-OCT-11

using channel ORA_DISK_1

channel ORA_DISK_1: starting full datafile backupset

channel ORA_DISK_1: specifying datafile(s) in backupset

including standby control file in backupset

channel ORA_DISK_1: starting piece 1 at 15-OCT-11

channel ORA_DISK_1: finished piece 1 at 15-OCT-11

piece handle=/oracle/stage/blackowl_control.bkp tag=TAG20111015T124055 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 15-OCT-11

[oracle@DBSERVER stage]$ cd /oracle/stage

[oracle@DBSERVER stage]$ ls -al

total 580212

drwxrwxr-x  2 oracle oinstall      4096 Oct 15 12:40 .

drwxr-xr-x  3 root   root          4096 Oct 15 12:29 ..

-rw-r—–  1 oracle oinstall  47257088 Oct 15 12:39 blackowl_arc_03mp5msj_1_1

-rw-r—–  1 oracle oinstall   7110656 Oct 15 12:40 blackowl_control.bkp

-rw-r—–  1 oracle oinstall 532013056 Oct 15 12:38 blackowl_db_01mp5ml4_1_1

-rw-r—–  1 oracle oinstall   7143424 Oct 15 12:38 blackowl_db_02mp5mpl_1_1

[oracle@DBSERVER stage]$

CHANGES PARAMETER FILE ON PRIMARY

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

[oracle@DBSERVER stage]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVER stage]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 12:45:13 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> show parameter spfile;

NAME                                 TYPE        VALUE

———————————— ———– ——————————

spfile                               string      +DATA/blackowl/spfileblackowl.

ora

SQL>

SQL> create pfile=’/home/oracle/pfile_primary_blackowl.bak’ from spfile=’+DATA/blackowl/spfileblackowl.ora’;

File created.

SQL> exit

[oracle@DBSERVER stage]$ cd ~

[oracle@DBSERVER ~]$ pwd

/home/oracle

[oracle@DBSERVER ~]$ vi pfile_primary_blackowl.bak

blackowl.__db_cache_size=100663296

blackowl.__java_pool_size=4194304

blackowl.__large_pool_size=4194304

blackowl.__shared_pool_size=92274688

blackowl.__streams_pool_size=0

*.audit_file_dest=’/oraclebase/admin/blackowl/adump’

*.background_dump_dest=’/oraclebase/admin/blackowl/bdump’

*.compatible=’10.2.0.1.0′

*.control_files=’+DATA/blackowl/controlfile/current.306.764596821′,’+FRA/blackowl/controlfile/current.330.764596823′

*.core_dump_dest=’/oraclebase/admin/blackowl/cdump’

*.db_block_size=8192

*.db_create_file_dest=’+DATA’

*.db_domain=”

*.db_file_multiblock_read_count=16

*.db_name=’blackowl’

*.db_recovery_file_dest=’+FRA’

*.db_recovery_file_dest_size=2147483648

*.dispatchers='(PROTOCOL=TCP) (SERVICE=blackowlXDB)’

*.job_queue_processes=10

*.open_cursors=300

*.pga_aggregate_target=68157440

*.processes=150

*.remote_login_passwordfile=’EXCLUSIVE’

*.sga_target=204472320

*.undo_management=’AUTO’

*.undo_tablespace=’UNDOTBS1′

*.user_dump_dest=’/oraclebase/admin/blackowl/udump’

#==============parameter ODG======================

*.DB_NAME=’blackowl’

*.DB_UNIQUE_NAME=’blackowl’

*.FAL_CLIENT=’blackowl’

*.FAL_SERVER=’blackowlstby’

*.LOG_ARCHIVE_CONFIG=’DG_CONFIG=(blackowl,blackowlstby)’

*.log_archive_dest_2=’SERVICE=blackowlstby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=blackowlstby’

*.log_archive_dest_state_2=’DEFER’

*.LOG_ARCHIVE_FORMAT=’%t_%s_%r.arc’

*.LOG_ARCHIVE_MAX_PROCESSES=30

*.LOG_FILE_NAME_CONVERT=’blackowlstby’,’blackowl’

*.DB_FILE_NAME_CONVERT=’blackowlstby’,’blackowl’

*.REMOTE_LOGIN_PASSWORDFILE=’EXCLUSIVE’

*.STANDBY_FILE_MANAGEMENT=’AUTO’

[oracle@DBSERVER ~]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVER ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 12:55:17 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> shut immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup pfile=’/home/oracle/pfile_primary_blackowl.bak’;

ORACLE instance started.

SQL> show parameter log_archive_dest_2;

NAME                                 TYPE        VALUE

———————————— ———– ——————————

log_archive_dest_2                   string      SERVICE=blackowlstby LGWR ASYN

C VALID_FOR=(ONLINE_LOGFILES,P

RIMARY_ROLE) DB_UNIQUE_NAME=bl

ackowlstby

SQL> create spfile=’+DATA/blackowl/spfileblackowl.ora’ from pfile=’/home/oracle/pfile_primary_blackowl.bak’;

File created.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL>

SQL>

SQL> startup;

ORACLE instance started.

Total System Global Area  205520896 bytes

Fixed Size                  2019608 bytes

Variable Size             100667112 bytes

Database Buffers          100663296 bytes

Redo Buffers                2170880 bytes

Database mounted.

Database opened.

SQL> show parameter log_archive_dest_2;

NAME                                 TYPE        VALUE

———————————— ———– ——————————

log_archive_dest_2                   string      SERVICE=blackowlstby LGWR ASYN

C VALID_FOR=(ONLINE_LOGFILES,P

RIMARY_ROLE) DB_UNIQUE_NAME=bl

ackowlstby

SQL>

SQL> show parameter LOG_FILE_NAME_CONVERT;

NAME                                 TYPE        VALUE

———————————— ———– ——————————

log_file_name_convert                string      blackowlstby, blackowl

SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

CREATE PARAMETER FILE FOR STANDBY ON PRIMARY

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

[oracle@DBSERVER ~]$ cd /home/oracle

[oracle@DBSERVER ~]$ ls

pfile_primary_blackowl.bak

[oracle@DBSERVER ~]$ cp pfile_primary_blackowl.bak pfile_standby_blackowl.bak

[oracle@DBSERVER ~]$ ls

pfile_primary_blackowl.bak  pfile_standby_blackowl.bak

[oracle@DBSERVER ~]$ vi pfile_standby_blackowl.bak

blackowl.__db_cache_size=100663296

blackowl.__java_pool_size=4194304

blackowl.__large_pool_size=4194304

blackowl.__shared_pool_size=92274688

blackowl.__streams_pool_size=0

*.audit_file_dest=’/oraclebase/admin/blackowl/adump’

*.background_dump_dest=’/oraclebase/admin/blackowl/bdump’

*.compatible=’10.2.0.1.0′

#*.control_files=’+DATA/blackowl/controlfile/current.306.764596821′,’+FRA/blackowl/controlfile/current.330.764596823′

*.core_dump_dest=’/oraclebase/admin/blackowl/cdump’

*.db_block_size=8192

*.db_create_file_dest=’+DATA’

*.db_domain=”

*.db_file_multiblock_read_count=16

*.db_name=’blackowl’

*.db_recovery_file_dest=’+FRA’

*.db_recovery_file_dest_size=2147483648

*.dispatchers='(PROTOCOL=TCP) (SERVICE=blackowlXDB)’

*.job_queue_processes=10

*.open_cursors=300

*.pga_aggregate_target=68157440

*.processes=150

*.remote_login_passwordfile=’EXCLUSIVE’

*.sga_target=204472320

*.undo_management=’AUTO’

*.undo_tablespace=’UNDOTBS1′

*.user_dump_dest=’/oraclebase/admin/blackowl/udump’

#==============parameter ODG======================

*.control_files=’+DATA’,’+FRA’

*.DB_NAME=’blackowl’

*.DB_UNIQUE_NAME=’blackowlstby’

*.FAL_CLIENT=’blackowlstby’

*.FAL_SERVER=’blackowl’

*.LOG_ARCHIVE_CONFIG=’DG_CONFIG=(blackowlstby,blackowl)’

*.log_archive_dest_2=’SERVICE=blackowl LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=blackowl’

*.log_archive_dest_state_1=’ENABLE’

*.log_archive_dest_state_2=’ENABLE’

*.LOG_ARCHIVE_FORMAT=’%t_%s_%r.arc’

*.LOG_ARCHIVE_MAX_PROCESSES=30

*.LOG_FILE_NAME_CONVERT=’blackowl’,’blackowlstby’

*.DB_FILE_NAME_CONVERT=’blackowl’,’blackowlstby’

*.REMOTE_LOGIN_PASSWORDFILE=’EXCLUSIVE’

*.STANDBY_FILE_MANAGEMENT=’AUTO’

[oracle@DBSERVER ~]$ pwd

/home/oracle

[oracle@DBSERVER ~]$ ls

pfile_primary_blackowl.bak  pfile_standby_blackowl.bak

[oracle@DBSERVER ~]$ cp pfile_standby_blackowl.bak /oracle/stage

COPY THE FILES RMAN BACKUP, CONTROL FILE, PFILE TO STANDBY

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

on standby :

[root@DBSERVERDRC ~]# mkdir -p /oracle/stage

[root@DBSERVERDRC ~]# chown -R oracle:oinstall /oracle/stage

[root@DBSERVERDRC ~]# chmod -R 775 /oracle/stage

[root@DBSERVERDRC ~]# su – oracle

[oracle@DBSERVERDRC ~]$ cd /oracle

[oracle@DBSERVERDRC oracle]$ ls -al

total 16

drwxr-xr-x   3 root   root     4096 Oct 15 12:29 .

drwxr-xr-x  27 root   root     4096 Oct 15 12:29 ..

drwxrwxr-x   2 oracle oinstall 4096 Oct 15 12:29 stage

[oracle@DBSERVERDRC oracle]$

on primary :

[oracle@DBSERVER ~]$ cd /oracle/stage

[oracle@DBSERVER stage]$ ls

blackowl_arc_03mp5msj_1_1  blackowl_control.bkp  blackowl_db_01mp5ml4_1_1  blackowl_db_02mp5mpl_1_1  pfile_standby_blackowl.bak

[oracle@DBSERVER stage]$ ls -al

total 580216

drwxrwxr-x  2 oracle oinstall      4096 Oct 15 14:02 .

drwxr-xr-x  3 root   root          4096 Oct 15 12:29 ..

-rw-r—–  1 oracle oinstall  47257088 Oct 15 12:39 blackowl_arc_03mp5msj_1_1

-rw-r—–  1 oracle oinstall   7110656 Oct 15 12:40 blackowl_control.bkp

-rw-r—–  1 oracle oinstall 532013056 Oct 15 12:38 blackowl_db_01mp5ml4_1_1

-rw-r—–  1 oracle oinstall   7143424 Oct 15 12:38 blackowl_db_02mp5mpl_1_1

-rw-r–r–  1 oracle oinstall      1659 Oct 15 14:02 pfile_standby_blackowl.bak

[oracle@DBSERVER stage]$ scp * oracle@DBSERVERDRC:/oracle/stage

oracle@dbserverdrc’s password:

blackowl_arc_03mp5msj_1_1     100%   45MB   9.0MB/s   00:05

blackowl_control.bkp          100% 6944KB   6.8MB/s   00:01

blackowl_db_01mp5ml4_1_1      100%  507MB   2.7MB/s   03:08

blackowl_db_02mp5mpl_1_1      100% 6976KB   2.3MB/s   00:03

pfile_standby_blackowl.bak    100% 1659     1.6KB/s   00:00

[oracle@DBSERVER stage]$

ESTABLISH CONNECTIVITY BETWEEN PRIMARY AND STANDBY

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

on standby :

[oracle@DBSERVERDRC oracle]$ cd //oraclebase/oracle/network/admin/

[oracle@DBSERVERDRC admin]$ ls

initAP2T.ora  initorcl.ora  listener.ora  samples  shrept.lst  sqlnet.log  tnsnames.ora

[oracle@DBSERVERDRC admin]$ vi tnsnames.ora

# tnsnames.ora Network Configuration File: /oraclebase/oracle/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

BLACKOWL =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = DBSERVER)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = blackowl)

)

)

BLACKOWLSTBY =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = DBSERVERDRC)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = blackowlstby)

)

)

EXTPROC_CONNECTION_DATA =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

(CONNECT_DATA =

(SID = PLSExtProc)

(PRESENTATION = RO)

)

)

[oracle@DBSERVERDRC admin]$

on primary :

[oracle@DBSERVER stage]$ cd /oraclebase/oracle/network/admin/

[oracle@DBSERVER admin]$ ls

listener.ora  samples  shrept.lst  sqlnet.log  tnsnames.ora

[oracle@DBSERVER admin]$ cat tnsnames.ora

[oracle@DBSERVER admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File: /oraclebase/oracle/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

BLACKOWL =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = DBSERVER)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = blackowl)

)

)

BLACKOWLSTBY =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = DBSERVERDRC)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = blackowlstby)

)

)

EXTPROC_CONNECTION_DATA =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

(CONNECT_DATA =

(SID = PLSExtProc)

(PRESENTATION = RO)

)

)

on standby :

[oracle@DBSERVERDRC admin]$ tnsping blackowl

TNS Ping Utility for Linux: Version 10.2.0.1.0 – Production on 15-OCT-2011 14:26:43

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = DBSERVER)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = blackowl)))

OK (10 msec)

on primary :

[oracle@DBSERVER admin]$ tnsping blackowlstby

TNS Ping Utility for Linux: Version 10.2.0.1.0 – Production on 15-OCT-2011 14:23:07

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = DBSERVERDRC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = blackowlstby)))

OK (10 msec)

START THE STANDBY INSTANCE AND USE RMAN DUPLICATE TO CREATE DATABASE

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

on standby :

[oracle@DBSERVERDRC stage]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 15-OCT-2011 14:30:36

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DBSERVERDRC)(PORT=1521)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 10.2.0.1.0 – Production

Start Date                15-OCT-2011 12:14:51

Uptime                    0 days 2 hr. 15 min. 45 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /oraclebase/oracle/network/admin/listener.ora

Listener Log File         /oraclebase/oracle/network/log/listener.log

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DBSERVERDRC)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

Services Summary…

Service “+ASM” has 1 instance(s).

Instance “+ASM”, status BLOCKED, has 1 handler(s) for this service…

Service “+ASM_XPT” has 1 instance(s).

Instance “+ASM”, status BLOCKED, has 1 handler(s) for this service…

Service “PLSExtProc” has 1 instance(s).

Instance “PLSExtProc”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

[oracle@DBSERVERDRC stage]$

[oracle@DBSERVERDRC admin]$ cd ~

[oracle@DBSERVERDRC ~]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVERDRC ~]$ cd /oracle/stage

[oracle@DBSERVERDRC stage]$ ls

blackowl_arc_03mp5msj_1_1  blackowl_db_01mp5ml4_1_1  pfile_standby_blackowl.bak

blackowl_control.bkp       blackowl_db_02mp5mpl_1_1

[oracle@DBSERVERDRC stage]$

[oracle@DBSERVERDRC stage]$ mkdir -p /oraclebase/admin/blackowl/adump

[oracle@DBSERVERDRC stage]$ mkdir -p /oraclebase/admin/blackowl/bdump

[oracle@DBSERVERDRC stage]$ mkdir -p /oraclebase/admin/blackowl/cdump

[oracle@DBSERVERDRC stage]$ mkdir -p /oraclebase/admin/blackowl/udump

[oracle@DBSERVERDRC stage]$

[oracle@DBSERVERDRC stage]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 14:35:15 2011

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

Connected to an idle instance.

SQL> create spfile from pfile=’/oracle/stage/pfile_standby_blackowl.bak’;

File created.

SQL> startup nomount;

ORACLE instance started.

Total System Global Area  205520896 bytes

Fixed Size                  2019608 bytes

Variable Size             100667112 bytes

Database Buffers          100663296 bytes

Redo Buffers                2170880 bytes

SQL>exit

[oracle@DBSERVERDRC stage]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVERDRC stage]$ rman target sys/oracle@blackowl auxiliary /

Recovery Manager: Release 10.2.0.1.0 – Production on Sat Oct 15 14:40:43 2011

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

connected to target database: BLACKOWL (DBID=398996180)

connected to auxiliary database: BLACKOWL (not mounted)

RMAN> duplicate target database for standby;

Starting Duplicate Db at 15-OCT-11

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: sid=156 devtype=DISK

contents of Memory Script:

{

restore clone standby controlfile;

sql clone ‘alter database mount standby database’;

}

executing Memory Script

Starting restore at 15-OCT-11

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 /oracle/stage/blackowl_control.bkp

channel ORA_AUX_DISK_1: restored backup piece 1

piece handle=/oracle/stage/blackowl_control.bkp tag=TAG20111015T124055

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07

output filename=+DATA/blackowlstby/controlfile/current.300.764606489

output filename=+FRA/blackowlstby/controlfile/backup.299.764606491

Finished restore at 15-OCT-11

sql statement: alter database mount standby database

released channel: ORA_AUX_DISK_1

contents of Memory Script:

{

set newname for tempfile  1 to

“+DATA/blackowlstby/tempfile/temp.299.764596863”;

switch clone tempfile all;

set newname for datafile  1 to

“+DATA/blackowlstby/datafile/system.302.764596709”;

set newname for datafile  2 to

“+DATA/blackowlstby/datafile/undotbs1.301.764596711”;

set newname for datafile  3 to

“+DATA/blackowlstby/datafile/sysaux.296.764596711”;

set newname for datafile  4 to

“+DATA/blackowlstby/datafile/users.300.764596713”;

restore

check readonly

clone database

;

}

executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to +DATA/blackowlstby/tempfile/temp.299.764596863 in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 15-OCT-11

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: sid=156 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 +DATA/blackowlstby/datafile/system.302.764596709

restoring datafile 00002 to +DATA/blackowlstby/datafile/undotbs1.301.764596711

restoring datafile 00003 to +DATA/blackowlstby/datafile/sysaux.296.764596711

restoring datafile 00004 to +DATA/blackowlstby/datafile/users.300.764596713

channel ORA_AUX_DISK_1: reading from backup piece /oracle/stage/blackowl_db_01mp5ml4_1_1

channel ORA_AUX_DISK_1: restored backup piece 1

piece handle=/oracle/stage/blackowl_db_01mp5ml4_1_1 tag=TAG20111015T123547

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:06

Finished restore at 15-OCT-11

contents of Memory Script:

{

switch clone datafile all;

}

executing Memory Script

datafile 1 switched to datafile copy

input datafile copy recid=5 stamp=764606570 filename=+DATA/blackowlstby/datafile/system.299.764606505

datafile 2 switched to datafile copy

input datafile copy recid=6 stamp=764606570 filename=+DATA/blackowlstby/datafile/undotbs1.297.764606505

datafile 3 switched to datafile copy

input datafile copy recid=7 stamp=764606570 filename=+DATA/blackowlstby/datafile/sysaux.298.764606505

datafile 4 switched to datafile copy

input datafile copy recid=8 stamp=764606570 filename=+DATA/blackowlstby/datafile/users.296.764606507

Finished Duplicate Db at 15-OCT-11

RMAN>exit

CREATE SRL (STANDBY REDOLOG ) ON STANDBY

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

on standby :

[oracle@DBSERVERDRC stage]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 14:44:23 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> select * from v$instance;

INSTANCE_NUMBER INSTANCE_NAME

————— —————-

HOST_NAME

—————————————————————-

VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT

—————– ——— ———— — ———- ——- —————

LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO

———- — —————– —————— ——— —

1 blackowl

DBSERVERDRC

10.2.0.1.0        15-OCT-11 MOUNTED      NO           1 STARTED

ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO

*drop existing standby log file because RMAN duplicate from primary:

SQL> alter database drop standby logfile group 11;

Database altered.

SQL>  alter database drop standby logfile group 12;

Database altered.

SQL>  alter database drop standby logfile group 13;

Database altered.

SQL>  alter database drop standby logfile group 14;

Database altered.

*then create new standby redolog for standby

SQL> alter database add standby logfile group 11 size 52428800;

Database altered.

SQL> alter database add standby logfile group 12 size 52428800;

Database altered.

SQL> alter database add standby logfile group 13 size 52428800;

Database altered.

SQL> alter database add standby logfile group 14 size 52428800;

Database altered.

SQL> select * from v$logfile;

GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————–

IS_

3         ONLINE

+DATA/blackowlstby/onlinelog/group_3.303.764596845

NO

3         ONLINE

+FRA/blackowlstby/onlinelog/group_3.327.764596849

NO

GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————–

IS_

2         ONLINE

+DATA/blackowlstby/onlinelog/group_2.304.764596835

NO

2         ONLINE

+FRA/blackowlstby/onlinelog/group_2.328.764596841

GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————–

IS_

NO

1         ONLINE

+DATA/blackowlstby/onlinelog/group_1.305.764596825

NO

1         ONLINE

GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————–

IS_

+FRA/blackowlstby/onlinelog/group_1.329.764596831

NO

11         STANDBY

+DATA/blackowlstby/onlinelog/group_11.295.764606921

NO

GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————–

IS_

11         STANDBY

+FRA/blackowlstby/onlinelog/group_11.298.764606927

YES

12         STANDBY

+DATA/blackowlstby/onlinelog/group_12.294.764606945

NO

GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————–

IS_

12         STANDBY

+FRA/blackowlstby/onlinelog/group_12.297.764606947

YES

13         STANDBY

+DATA/blackowlstby/onlinelog/group_13.293.764606961

GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————–

IS_

NO

13         STANDBY

+FRA/blackowlstby/onlinelog/group_13.292.764606963

YES

14         STANDBY

GROUP# STATUS  TYPE

———- ——- ——-

MEMBER

——————————————————————————–

IS_

+DATA/blackowlstby/onlinelog/group_14.292.764606977

NO

14         STANDBY

+FRA/blackowlstby/onlinelog/group_14.264.764606979

YES

14 rows selected.

COPY THE PASSWORD FILE FROM PRIMARY TO STANDBY

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

on primary :

[oracle@DBSERVER stage]$ cd /oraclebase/oracle/dbs/

[oracle@DBSERVER dbs]$ ls

ab_+ASM.dat      hc_orcl.dat       init.ora    orapwblackowl      snapcf_PRIMA.f

hc_ap2t.dat      hc_PRIMA.dat      lk+ASM      snapcf_ap2t.f      spfileap2t.ora.bak

hc_+ASM.dat      initblackowl.ora  lkBLACKOWL  snapcf_blackowl.f  spfile+ASM.ora

hc_blackowl.dat  initdw.ora        orapw+ASM   snapcf_orcl.f

[oracle@DBSERVER dbs]$ scp orapwblackowl oracle@DBSERVERDRC:/oraclebase/oracle/dbs

oracle@dbserverdrc’s password:

orapwblackowl                                      100% 1536     1.5KB/s   00:00

[oracle@DBSERVER dbs]$

on standby :

[oracle@DBSERVERDRC stage]$ cd /oraclebase/oracle/dbs/

[oracle@DBSERVERDRC dbs]$ ls

ab_+ASM.dat      initap2t.ora.bak  lk+ASM          orapwMYSTD

hc_ap2t.dat      initdw.ora        lkBLACKOWLSTBY  orapworcl

hc_+ASM.dat      init.ora          lkMYSTD         pfileforstanby.bak

hc_blackowl.dat  init.ora.ori      lkORCLSTBY      snapcf_orcl.f

hc_MYSTD.dat     initorcl.ora      orapwap2t       spfile+ASM.ora

hc_orcl.dat      lkAP2T            orapw+ASM       spfileblackowl.ora

initap2t.ora     lkAP2TSTBY        orapwblackowl   spfileMYSTD.ora

[oracle@DBSERVERDRC dbs]$

START THE MRP PROCESSES (DATAGUARD)

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

on primary :

[oracle@DBSERVER stage]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVER stage]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 14:53:37 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> alter system set log_archive_dest_state_2=ENABLE;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     1

Next log sequence to archive   3

Current log sequence           3

SQL>

SQL> exit

on standby :

[oracle@DBSERVERDRC stage]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVERDRC dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 15:09:25 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> recover managed standby database using current logfile disconnect;

Media recovery complete.

SQL>

CHECK DATAGUARD RUNNING WELL BOTH PRIMARY AND STANDBY

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

on standby :

*check alert log

[oracle@DBSERVERDRC bdump]$ pwd

/oraclebase/admin/blackowl/bdump

[oracle@DBSERVERDRC bdump]$ tail -20 alert_blackowl.log

RFS[2]: Assigned to RFS process 14729

RFS[2]: Identified database type as ‘physical standby’

Sat Oct 15 15:09:50 2011

Redo Shipping Client Connected as PUBLIC

— Connected User is Valid

RFS[3]: Assigned to RFS process 14731

RFS[3]: Identified database type as ‘physical standby’

Sat Oct 15 15:09:51 2011

Managed Standby Recovery starting Real Time Apply

Media Recovery Waiting for thread 1 sequence 1 (in transit)

Sat Oct 15 15:09:52 2011

Completed: ALTER DATABASE RECOVER  managed standby database using current logfile disconnect

Sat Oct 15 15:09:53 2011

RFS[2]: Archived Log: ‘+FRA/blackowlstby/archivelog/2011_10_15/thread_1_seq_2.258.764608191’

Sat Oct 15 15:10:00 2011

RFS[3]: Archived Log: ‘+FRA/blackowlstby/archivelog/2011_10_15/thread_1_seq_1.259.764608191’

Sat Oct 15 15:10:02 2011

Media Recovery Log +FRA/blackowlstby/archivelog/2011_10_15/thread_1_seq_1.259.764608191

Media Recovery Log +FRA/blackowlstby/archivelog/2011_10_15/thread_1_seq_2.258.764608191

Media Recovery Waiting for thread 1 sequence 3

[oracle@DBSERVERDRC bdump]$

*check with query

oracle@DBSERVERDRC stage]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVERDRC dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 15:09:25 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

SEQUENCE# FIRST_TIM NEXT_TIME

———- ——— ———

1 15-OCT-11 15-OCT-11

2 15-OCT-11 15-OCT-11

SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

SEQUENCE# APP

———- —

1 YES

2 YES

on primary :

[oracle@DBSERVER dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 15:13:42 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     1

Next log sequence to archive   3

Current log sequence           3

SQL> alter system switch logfile;

System altered.

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     2

Next log sequence to archive   4

Current log sequence           4

SQL>

*check again on standby

oracle@DBSERVERDRC stage]$ echo $ORACLE_SID

blackowl

[oracle@DBSERVERDRC dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 – Production on Sat Oct 15 15:09:25 2011

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production

With the Partitioning, OLAP and Data Mining options

SQL> SELECT SEQUENCE#, FIRST_TIME, NEXT_TIME FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

SEQUENCE# FIRST_TIM NEXT_TIME

———- ——— ———

1 15-OCT-11 15-OCT-11

2 15-OCT-11 15-OCT-11

3 15-OCT-11 15-OCT-11

SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;

SEQUENCE# APP

———- —

1 YES

2 YES

3 YES

=========FINISH and THANKS========


Advertisements

One thought on “ORACLE DATAGUARD 10g WITH ASM CONFIGURATION

  1. excellent documen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s