oracle data guard

Upload: diego-valladolid

Post on 16-Oct-2015

49 views

Category:

Documents


0 download

TRANSCRIPT

  • Appendix APractices and Solutions

  • Oracle Database 11g: Data Guard Administration A - 2

    Table of Contents Practices for Lesson 1: Introduction to Oracle Data Guard ................................................ 4 Practices for Lesson 2: Creating a Physical Standby Database by Using SQL and RMAN Commands ........................................................................................................... 5

    Practice 2-1: Preparing the Primary Database ................................................................ 6 Practice 2-2: Creating the Physical Standby Database ................................................. 12 Practice 2-3: Verifying That the Physical Standby Database Is Performing Correctly 27

    Practices for Lesson 3: Oracle Data Guard Broker: Overview ......................................... 29 Practices for Lesson 4: Creating a Data Guard Broker Configuration ............................. 30

    Practice 4-1: Setting the DG_BROKER_START Initialization Parameter .................. 31 Practice 4-2: Creating a Listener Service for the Primary Database ............................ 33 Practice 4-3: Creating a Listener Service for the Standby Database ............................ 36 Practice 4-4: Creating an Oracle Net Service Name for the Primary Database ............ 39 Practice 4-5: Creating an Oracle Net Service Name for the Standby Database ........... 42 Practice 4-6: Creating the Broker Configuration .......................................................... 45 Practice 4-7: Enabling the Broker Configuration ......................................................... 47

    Practices for Lesson 5: Creating a Physical Standby Database by Using Enterprise Manager Grid Control ..................................................................................................... 48

    Practice 5-1: Installing the Oracle Management Agent ................................................ 49 Practice 5-2: Configuring Monitoring Credentials for Your Primary Database ........... 61 Practice 5-3: Configuring Monitoring Credentials for Your Standby Database ........... 62 Practice 5-4: Adding a Physical Standby Database to Your Configuration ................. 63 Practice 5-5: Verifying the Broker Configuration ........................................................ 72 Practice 5-6: Deleting the Database .............................................................................. 75

    Practices for Lesson 6: Creating a Logical Standby Database ......................................... 77 Practice 6-1: Creating a Logical Standby Database ...................................................... 78 Practice 6-2: Implementing SQL Apply Filtering ........................................................ 82

    Practices for Lesson 7: Configuring Data Protection Modes ............................................ 86 Practice 7-1: Setting the Data Protection Mode by Using DGMGRL .......................... 87 Practice 7-2: Setting the Data Protection Mode by Using Enterprise Manager Grid Control .......................................................................................................................... 91

    Practices for Lesson 8: Monitoring a Data Guard Broker Configuration ........................ 96 Practice 8-1: Viewing Log File Details ........................................................................ 97 Practice 8-2: Using DGMGRL to Monitor the Configuration .................................... 101

    Practices for Lesson 9: Optimizing a Data Guard Configuration ................................... 106 Practice 9-1: Configuring Network Compression of Redo Data ................................ 107

    Practices for Lesson 10: Using Flashback Database in a Data Guard Configuration ..... 109 Practice 10-1: Configuring Flashback Database on the Primary Database ................ 110 Practice 10-2: Configuring Flashback Database on the Standby Database ................ 111

    Practices for Lesson 11: Performing Role Transitions ................................................... 112 Practice 11-1: Performing Switchover by Using DGMGRL ...................................... 113 Practice 11-2: Performing Switchover by Using Enterprise Manager ........................ 119

    Practices for Lesson 12: Enabling Fast-Start Failover .................................................... 121 Practice 12-1: Enabling Fast-Start Failover ................................................................ 122 Practice 12-2: Starting the Observer ........................................................................... 124

  • Oracle Database 11g: Data Guard Administration A - 3

    Practice 12-3: Testing Fast-Start Failover .................................................................. 126 Practice 12-4: Switching Back to Your Primary Database ......................................... 130 Practice 12-5: Stopping the Observer and Disabling Fast-Start Failover ................... 132

    Practices for Lesson 13: Creating and Managing a Snapshot Standby Database ........... 134 Practice 13-1: Verifying Flashback Database on the Physical Standby Database ...... 135 Practice 13-2: Converting the Physical Standby Database to a Snapshot Standby Database ...................................................................................................................... 137 Practice 13-3: Updating the Databases and Verifying Redo Shipment ...................... 138 Practice 13-4: Converting the Snapshot Standby Database to a Physical Standby Database ...................................................................................................................... 140

    Practices for Lesson 14: Using Oracle Active Data Guard ............................................. 145 Practice 14-1: Using Real-Time Query....................................................................... 146 Practice 14-2: Enabling Block Change Tracking........................................................ 151

    Practices for Lesson 15: Backup and Recovery Considerations in an Oracle Data Guard Configuration ................................................................................................................ 152

    Practice 15-1: Creating the Recovery Catalog ............................................................ 153 Practice 15-2: Registering Your Database in the Recovery Catalog .......................... 155 Practice 15-3: Configuring RMAN Parameters .......................................................... 158 Practice 15-4: Recovering a Data File in Your Primary Database ............................. 163

    Practices for Lesson 16: Managing Client Connectivity ................................................ 168 Practice 16-1: Creating a Service ................................................................................ 169 Practice 16-2: Creating an AFTER STARTUP Trigger ............................................. 171 Practice 16-3: Creating an Oracle Net Service Name on Your Primary Database Host..................................................................................................................................... 172 Practice 16-4: Creating an Oracle Net Service Name on Your Standby Database Host..................................................................................................................................... 174 Practice 16-5: Testing Your Implementation .............................................................. 175

    Practices for Lesson 17: Patching and Upgrading Databases in a Data Guard Configuration ................................................................................................................ 181

  • Oracle Database 11g: Data Guard Administration A - 4

    Practices for Lesson 1: Introduction to Oracle Data Guard

    There are no practices for Lesson 1, Introduction to Oracle Data Guard.

  • Oracle Database 11g: Data Guard Administration A - 5

    Practices for Lesson 2: Creating a Physical Standby Database by Using SQL and RMAN Commands

    In the practices for Lesson 2, Creating a Physical Standby Database by Using SQL and RMAN Commands, you create a physical standby database by using SQL and RMAN commands. Use this page to record information about the databases in your configuration. Primary Database Database Name: _________________________________________________ Instance Name: _________________________________________________ Database Unique Name: __________________________________________ Target Name: ___________________________________________________ Host: __________________________________________________________ Oracle Home: ____________________________________________________ Standby Database Database Name: _________________________________________________ Instance Name: _________________________________________________ Database Unique Name: __________________________________________ Target Name: ___________________________________________________ Host: __________________________________________________________ Oracle Home: ____________________________________________________ Standby Database Database Name: _________________________________________________ Instance Name: _________________________________________________ Database Unique Name: __________________________________________ Target Name: ___________________________________________________ Host: __________________________________________________________ Oracle Home: ____________________________________________________ Standby Database Database Name: _________________________________________________ Instance Name: _________________________________________________ Database Unique Name: __________________________________________ Target Name: ___________________________________________________ Host: __________________________________________________________ Oracle Home: ____________________________________________________

  • Oracle Database 11g: Data Guard Administration A - 6

    Practice 2-1: Preparing the Primary Database In this practice, you verify that the primary database is configured correctly to support a physical standby database. Your primary database is named pcprmy, where nn represents the number of the PC you are using in the classroom. You create a standby database named pcsby1, where nn represents the number of the PC that you are using in the classroom (and your primary database is on). For example, if you are using PC 5, your primary database is pc05prmy and your standby database is pc05sby1. 1) Open a terminal window. Change to the labs directory. Verify that the

    ORACLE_SID environment variable is set to your primary database. Invoke SQL*Plus and connect as SYSDBA to your primary database. Determine if FORCE LOGGING is enabled. If it is not enabled, enable FORCE LOGGING mode. [oracle@edt3r17p0-pc00prmy ~]$ cd labs [oracle@edt3r17p0-pc00prmy labs]$ echo $ORACLE_SID pc00prmy [oracle@edt3r17p0-pc00prmy labs]$ [oracle@edt3r17p0-pc00prmy labs]$ sqlplus / as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Mon Oct 15 15:05:44 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options SQL> SELECT force_logging FROM v$database; FOR --- NO SQL> ALTER DATABASE FORCE LOGGING; Database altered. SQL> SELECT force_logging FROM v$database; FOR --- YES

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 7

    2) Configure the standby redo logs on the primary database. You can use the

    cr_sby_redologs.sql script. SQL> @cr_sby_redologs SQL> ALTER DATABASE ADD STANDBY LOGFILE 2 '/u01/app/oracle/oradata/pc00prmy/srl01.log' size 52428800 3 / Database altered. SQL> ALTER DATABASE ADD STANDBY LOGFILE 2 '/u01/app/oracle/oradata/pc00prmy/srl02.log' size 52428800 3 / Database altered. SQL> ALTER DATABASE ADD STANDBY LOGFILE 2 '/u01/app/oracle/oradata/pc00prmy/srl03.log' size 52428800 3 / Database altered. SQL> ALTER DATABASE ADD STANDBY LOGFILE 2 '/u01/app/oracle/oradata/pc00prmy/srl04.log' size 52428800 3 / Database altered.

    3) Set the LOG_ARCHIVE_CONFIG and LOG_ARCHIVE_DEST_1 initialization parameters on the primary database. You must specify the name of your primary database and your standby database; do not use the names shown in the examples. Note: Be sure to leave a blank space before each of the attributes of LOG_ARCHIVE_DEST_1. SQL> alter system set log_archive_config = 'dg_config=(pc00prmy,pc00sby1)'; System altered. SQL> show parameter log_archive_config NAME TYPE VALUE

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 8

    -------------------- --------- ----------------------------- log_archive_config string dg_config=(pc00prmy,pc00sby1) SQL> alter system 2 set log_archive_dest_1 = 3 'service=pc00sby1 async 4 valid_for=(online_logfile,primary_role) 5 db_unique_name=pc00sby1'; System altered. SQL> show parameter log_archive_dest_1 NAME TYPE VALUE -------------------- ------- ----------------------------- log_archive_dest_1 string service=pc00sby1 async valid_for=(online_logfile, primary_role) db_unique_name=pc00sby1 Note: Output formatted for legibility

    4) Configure the ARCHIVELOG mode and enable automatic archiving. SQL> archive log list Database log mode No Archive Mode Automatic archival Disabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 41 Current log sequence 43 SQL> SHUTDOWN IMMEDIATE Database closed. Database dismounted. ORACLE instance shut down. SQL> STARTUP MOUNT ORACLE instance started. Total System Global Area 627732480 bytes Fixed Size 1301728 bytes Variable Size 448791328 bytes Database Buffers 171966464 bytes Redo Buffers 5672960 bytes Database mounted. SQL> ALTER DATABASE ARCHIVELOG; Database altered. SQL> ALTER DATABASE OPEN; Database altered.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 9

    5) Increase the size of the flash recovery area to 5 GB. Exit SQL*Plus. SQL> alter system set db_recovery_file_dest_size = 5G; System altered. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options [oracle@edt3r17p0-pc00prmy labs]$

    6) Invoke RMAN and log in to your primary database. [oracle@edt3r17p0-pc00prmy labs]$ rman Recovery Manager: Release 11.1.0.6.0 - Production on Tue Nov 27 02:25:22 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. RMAN> connect target / connected to target database: PC00PRMY (DBID=1159023676)

    7) Make a whole database backup, including archived redo log files. Exit RMAN. RMAN> backup database plus archivelog; Starting backup at 27-NOV-07 current log archived using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=116 device type=DISK channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=27 RECID=1 STAMP=639713780 input archived log thread=1 sequence=28 RECID=2 STAMP=639714352 channel ORA_DISK_1: starting piece 1 at 27-NOV-07 channel ORA_DISK_1: finished piece 1 at 27-NOV-07 piece handle=/u01/app/oracle/flash_recovery_area/PC00PRMY/backupset/2007_11_27/o1_mf_annnn_TAG20071127T022553_3np7g7l5_.bkp tag=TAG20071127T022553 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 27-NOV-07

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 10

    Starting backup at 27-NOV-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/app/oracle/oradata/pc00prmy/system01.dbf input datafile file number=00002 name=/u01/app/oracle/oradata/pc00prmy/sysaux01.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/pc00prmy/undotbs01.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/pc00prmy/example01.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/pc00prmy/users01.dbf channel ORA_DISK_1: starting piece 1 at 27-NOV-07 channel ORA_DISK_1: finished piece 1 at 27-NOV-07 piece handle=/u01/app/oracle/flash_recovery_area/PC00PRMY/backupset/2007_11_27/o1_mf_nnndf_TAG20071127T022600_3np7ghlp_.bkp tag=TAG20071127T022600 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25 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 including current SPFILE in backup set channel ORA_DISK_1: starting piece 1 at 27-NOV-07 channel ORA_DISK_1: finished piece 1 at 27-NOV-07 piece handle=/u01/app/oracle/flash_recovery_area/PC00PRMY/backupset/2007_11_27/o1_mf_ncsnf_TAG20071127T022600_3np7kd6s_.bkp tag=TAG20071127T022600 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 27-NOV-07 Starting backup at 27-NOV-07 current log archived using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=29 RECID=3 STAMP=639714461 channel ORA_DISK_1: starting piece 1 at 27-NOV-07 channel ORA_DISK_1: finished piece 1 at 27-NOV-07 piece handle=/u01/app/oracle/flash_recovery_area/PC00PRMY/backupset/2007_11_27/o1_mf_annnn_TAG20071127T022741_3np7kmgx_.bkp tag=TAG20071127T022741 comment=NONE

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 11

    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 27-NOV-07 RMAN> exit Recovery Manager complete. [oracle@edt3r17p0-pc00prmy labs]$

  • Oracle Database 11g: Data Guard Administration A - 12

    Practice 2-2: Creating the Physical Standby Database In this practice, you create a physical standby database. Note: Be sure to verify the information you enter into fields in Oracle Net Manager before proceeding to the next page. 1) On your primary database system, use Oracle Net Manager to create an Oracle Net

    service name for your physical standby database. a) Launch Net Manager. [oracle@edt3r17p0-pc00prmy labs]$ netmgr b) Expand Local. Select Service Naming and click the green plus sign in the left

    navigation bar.

    c) Enter pcsby1 in the Net Service Name field and click Next.

    Note: For the value of nn, enter the number of the PC to which you are assigned.

    d) Select TCP/IP (Internet Protocol) and click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 13

    e) Enter the fully qualified host name of the machine on which you are creating your physical standby database and 12001 in the port number field. Click Next. Note: edt3r17p2.us.oracle.com is used only as an example.

    f) Enter pcsby1.us.oracle.com in the Service Name field and click

    Next.

    g) Click Finish.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 14

    h) Select File > Save Network Configuration to save the information to the tnsnames.ora file. Your tnsnames.ora file should have entries similar to the following:

    PC00PRMY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = edt3r17p0.us.oracle.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pc00prmy.us.oracle.com) ) ) PC00SBY1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = edt3r17p2.us.oracle.com)(PORT = 12001)) ) (CONNECT_DATA = (SERVICE_NAME = pc00sby1.us.oracle.com) ) ) i) Exit Oracle Net Manager.

    2) Open a terminal window and use telnet to connect to the machine on which your physical standby database will be created. Log in as the oracle user with a password of oracle. [oracle@edt3r17p0-pc00prmy labs]$ xhost + [oracle@edt3r17p0-pc00prmy labs]$ telnet

    3) Launch Oracle Net Manager to configure an entry for your standby database in the listener.ora file. a) Expand Local. b) Expand Listeners. c) Select LISTENER1. d) Select Database Services in the list. e) Click Add Database. f) Enter pcsby1.us.oracle.com in the Global Database Name field.

    Accept the default for the Oracle Home Directory. Enter pcsby1 in the SID field.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 15

    g) Select File > Save Network Configuration. h) Select File > Exit.

    4) On the same machine (the one on which you are creating your standby database), invoke the listener control utility to start the LISTENER1 listener. [oracle@edt3r17p2-pc02prmy ~]$ lsnrctl start listener1 LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 19-OCT-2007 14:32:25 Copyright (c) 1991, 2007, Oracle. All rights reserved. Starting /u01/app/oracle/product/11.1.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.1.0.6.0 - Production System parameter file is /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/edt3r17p2/listener1/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edt3r17p2.us.oracle.com)(PORT=12001))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC12001))) STATUS of the LISTENER ------------------------ Alias LISTENER1 Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production Start Date 19-OCT-2007 14:32:25 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 16

    Listener Parameter File /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/edt3r17p2/listener1/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC12001))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edt3r17p2.us.oracle.com)(PORT=12001))) Services Summary... Service "pc00sby1.us.oracle.com" has 1 instance(s). Instance "pc00sby1", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully [oracle@edt3r17p2-pc02prmy ~]$

    5) Return to the terminal window for your primary database system. Change to the $ORACLE_HOME/dbs directory and view the contents of the directory. [oracle@edt3r17p0-pc00prmy ~]$ cd $ORACLE_HOME/dbs [oracle@edt3r17p0-pc00prmy dbs]$ ls hc_pc00db11.dat init.ora orapwpc00db11 spfilepc00db11.ora hc_pc00prmy.dat lkPC00DB11 orapwpc00prmy spfilepc00prmy.ora initdw.ora lkPC00PRMY snapcf_pc00prmy.f [oracle@edt3r17p0-pc00prmy dbs]$

    6) FTP to the host where your standby database will be created. Specify a username of oracle and a password of oracle to log on. [oracle@edt3r17p0-pc00prmy dbs]$ ftp edt3r17p2 Connected to edt3r17p2.us.oracle.com. 220 edt3r17p2.us.oracle.com FTP server (Version wu-2.6.1-20) ready. 530 Please login with USER and PASS. 530 Please login with USER and PASS. KERBEROS_V4 rejected as an authentication type Name (edt3r17p2:oracle): oracle 331 Password required for oracle. Password: 230 User oracle logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp>

    7) FTP your primary database password file to the standby database system. Exit the FTP session. ftp> put orapwpc00prmy local: orapwpc00prmy remote: orapwpc00prmy 227 Entering Passive Mode (10,150,21,130,31,89)

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 17

    150 Opening BINARY mode data connection for orapwpc00prmy. 226 Transfer complete. 2048 bytes sent in 6e-05 seconds (3.3e+04 Kbytes/s) ftp> quit

    8) Return to your standby database system window. Rename the password file you copied from your primary database system so that it can be used for your physical standby database. Also relocate it to the $ORACLE_HOME/dbs directory. Verify that you have successfully moved it and named it correctly. [oracle@edt3r17p2-pc02prmy ~]$ ls agent_installmedia Desktop diary labs oradiag_oracle orapwpc00prmy [oracle@edt3r17p2-pc02prmy ~]$ mv orapwpc00prmy $ORACLE_HOME/dbs/orapwpc00sby1 [oracle@edt3r17p2-pc02prmy ~]$ cd $ORACLE_HOME/dbs [oracle@edt3r17p2-pc02prmy dbs]$ ls hc_pc02db11.dat init.ora orapwpc00sby1 snapcf_pc02prmy.f hc_pc02prmy.dat lkPC02DB11 orapwpc02db11 spfilepc02db11.ora initdw.ora lkPC02PRMY orapwpc02prmy spfilepc02prmy.ora

    9) On the standby database host, create an initialization parameter file named initpcsby1.ora containing a single parameter: DB_NAME=pcsby1. [oracle@edt3r17p2-pc02prmy dbs]$ vi initpc00sby1.ora [oracle@edt3r17p2-pc02prmy dbs]$ more initpc00sby1.ora DB_NAME=pc00sby1 [oracle@edt3r17p2-pc02prmy dbs]$

    10) On the standby database host, change to the /u01/app/oracle/admin directory. Create the pcsby1 directory. [oracle@edt3r17p2-pc02prmy ~]$ cd /u01/app/oracle/admin [oracle@edt3r17p2-pc02prmy admin]$ ls pc02db11 pc02prmy [oracle@edt3r17p2-pc02prmy admin]$ mkdir pc00sby1

    11) Change to the pcsby1 directory and create the adump directory. [oracle@edt3r17p2-pc02prmy admin]$ cd pc00sby1 [oracle@edt3r17p2-pc02prmy pc00sby1]$ mkdir adump

    12) On the standby host, create the pcsby1 directory in $ORACLE_BASE/oradata for the data files. [oracle@edt3r17p2-pc02prmy pc00sby1]$ cd $ORACLE_BASE/oradata [oracle@edt3r17p2-pc02prmy oradata]$ mkdir pc00sby1

    13) On the standby host, set the ORACLE_SID environment variable to pcsby1 and start the instance in NOMOUNT mode with the text initialization parameter file. Exit SQL*Plus.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 18

    [oracle@edt3r17p2-pc02prmy oradata]$ export ORACLE_SID=pc00sby1 [oracle@edt3r17p2-pc00sby1 oradata]$ echo $ORACLE_SID pc00sby1 [oracle@edt3r17p2-pc00sby1 oradata]$ sqlplus / as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Wed Oct 31 03:30:31 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount pfile=$ORACLE_HOME/dbs/initpc00sby1.ora ORACLE instance started. Total System Global Area 150667264 bytes Fixed Size 1298472 bytes Variable Size 92278744 bytes Database Buffers 50331648 bytes Redo Buffers 6758400 bytes SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options [oracle@edt3r17p2-pc00sby1 oradata]$ exit

    14) On the primary database host, verify that the ORACLE_SID environment variable is set to pcprmy. [oracle@edt3r17p0-pc00prmy dbs]$ echo $ORACLE_SID pc00prmy [oracle@edt3r17p0-pc00prmy dbs]$

    15) On the primary database host, change to the $HOME/labs directory. Verify that the cr_phys_sby1.txt script contains the correct values for your primary and standby databases.

    16) Invoke RMAN and connect as SYSDBA to the target database. Connect to the auxiliary database. [oracle@edt3r17p0-pc00prmy labs]$ rman Recovery Manager: Release 11.1.0.6.0 - Production on Wed Oct 31 10:09:51 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. RMAN> connect target sys/oracle

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 19

    connected to target database: PC00PRMY (DBID=3303427449) RMAN> connect auxiliary sys/oracle@pc00sby1 connected to auxiliary database: PC00SBY1 (not mounted) RMAN>

    17) Execute the cr_phys_sby1.txt script. RMAN> @cr_phys_sby1.txt RMAN> run { 2> allocate channel prmy1 type disk; 3> allocate channel prmy2 type disk; 4> allocate channel prmy3 type disk; 5> allocate channel prmy4 type disk; 6> allocate auxiliary channel stby type disk; 7> duplicate target database for standby from active database 8> spfile 9> parameter_value_convert 'pc00prmy','pc00sby1' 10> set db_unique_name='pc00sby1' 11> set db_file_name_convert='/pc00prmy/','/pc00sby1/' 12> set log_file_name_convert='/pc00prmy/','/pc00sby1/' 13> set control_files='/u01/app/oracle/oradata/pc00sby1.ctl' 14> set log_archive_max_processes='5' 15> set fal_client='pc00sby1' 16> set fal_server='pc00prmy' 17> set standby_file_management='AUTO' 18> set log_archive_config='dg_config=(pc00prmy,pc00sby1)' 19> set log_archive_dest_1='service=pc00prmy ASYNC 20> valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=pc00prmy' 21> ; 22> } using target database control file instead of recovery catalog allocated channel: prmy1 channel prmy1: SID=123 device type=DISK allocated channel: prmy2 channel prmy2: SID=126 device type=DISK allocated channel: prmy3 channel prmy3: SID=113 device type=DISK allocated channel: prmy4 channel prmy4: SID=116 device type=DISK

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 20

    allocated channel: stby channel stby: SID=98 device type=DISK Starting Duplicate Db at 31-OCT-07 contents of Memory Script: { backup as copy reuse file '/u01/app/oracle/product/11.1.0/db_1/dbs/orapwpc00prmy' auxiliary format '/u01/app/oracle/product/11.1.0/db_1/dbs/orapwpc00sby1' file '/u01/app/oracle/product/11.1.0/db_1/dbs/spfilepc00prmy.ora' auxiliary format '/u01/app/oracle/product/11.1.0/db_1/dbs/spfilepc00sby1.ora' ; sql clone "alter system set spfile= ''/u01/app/oracle/product/11.1.0/db_1/dbs/spfilepc00sby1.ora''"; } executing Memory Script Starting backup at 31-OCT-07 Finished backup at 31-OCT-07 sql statement: alter system set spfile= ''/u01/app/oracle/product/11.1.0/db_1/dbs/spfilepc00sby1.ora'' contents of Memory Script: { sql clone "alter system set audit_file_dest = ''/u01/app/oracle/admin/pc00sby1/adump'' comment= '''' scope=spfile"; sql clone "alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=pc00sby1XDB)'' comment= '''' scope=spfile"; sql clone "alter system set db_unique_name = ''pc00sby1'' comment= '''' scope=spfile"; sql clone "alter system set db_file_name_convert = ''/pc00prmy/'', ''/pc00sby1/'' comment= '''' scope=spfile"; sql clone "alter system set log_file_name_convert = ''/pc00prmy/'', ''/pc00sby1/'' comment= '''' scope=spfile"; sql clone "alter system set control_files = ''/u01/app/oracle/oradata/pc00sby1.ctl'' comment= '''' scope=spfile"; sql clone "alter system set log_archive_max_processes = 5 comment=

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 21

    '''' scope=spfile"; sql clone "alter system set fal_client = ''pc00sby1'' comment= '''' scope=spfile"; sql clone "alter system set fal_server = ''pc00prmy'' 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=(pc00prmy,pc00sby1)'' comment= '''' scope=spfile"; sql clone "alter system set log_archive_dest_1 = ''service=pc00prmy ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=pc00prmy'' comment= '''' scope=spfile"; shutdown clone immediate; startup clone nomount ; } executing Memory Script sql statement: alter system set audit_file_dest = ''/u01/app/oracle/admin/pc00sby1/adump'' comment= '''' scope=spfile sql statement: alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=pc00sby1XDB)'' comment= '''' scope=spfile sql statement: alter system set db_unique_name = ''pc00sby1'' comment= '''' scope=spfile sql statement: alter system set db_file_name_convert = ''/pc00prmy/'', ''/pc00sby1/'' comment= '''' scope=spfile sql statement: alter system set log_file_name_convert = ''/pc00prmy/'', ''/pc00sby1/'' comment= '''' scope=spfile sql statement: alter system set control_files = ''/u01/app/oracle/oradata/pc00sby1.ctl'' comment= '''' scope=spfile sql statement: alter system set log_archive_max_processes = 5 comment= '''' scope=spfile sql statement: alter system set fal_client = ''pc00sby1'' comment= '''' scope=spfile

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 22

    sql statement: alter system set fal_server = ''pc00prmy'' 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=(pc00prmy,pc00sby1)'' comment= '''' scope=spfile sql statement: alter system set log_archive_dest_1 = ''service=pc00prmy ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=pc00prmy'' comment= '''' scope=spfile Oracle instance shut down connected to auxiliary database (not started) Oracle instance started Total System Global Area 627732480 bytes Fixed Size 1301728 bytes Variable Size 364905248 bytes Database Buffers 255852544 bytes Redo Buffers 5672960 bytes contents of Memory Script: { backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/pc00sby1.ctl'; sql clone 'alter database mount standby database'; } executing Memory Script Starting backup at 31-OCT-07 channel prmy1: starting datafile copy copying standby control file output file name=/u01/app/oracle/product/11.1.0/db_1/dbs/snapcf_pc00prmy.f tag=TAG20071031T144257 RECID=5 STAMP=637465377 channel prmy1: datafile copy complete, elapsed time: 00:00:03 Finished backup at 31-OCT-07 sql statement: alter database mount standby database contents of Memory Script: { set newname for tempfile 1 to "/u01/app/oracle/oradata/pc00sby1/pc00prmy/temp01.dbf"; switch clone tempfile all; set newname for datafile 1 to

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 23

    "/u01/app/oracle/oradata/pc00sby1/pc00prmy/system01.dbf"; set newname for datafile 2 to "/u01/app/oracle/oradata/pc00sby1/pc00prmy/sysaux01.dbf"; set newname for datafile 3 to "/u01/app/oracle/oradata/pc00sby1/pc00prmy/undotbs01.dbf"; set newname for datafile 4 to "/u01/app/oracle/oradata/pc00sby1/pc00prmy/users01.dbf"; set newname for datafile 5 to "/u01/app/oracle/oradata/pc00sby1/pc00prmy/example01.dbf"; backup as copy reuse datafile 1 auxiliary format "/u01/app/oracle/oradata/pc00sby1/pc00prmy/system01.dbf" datafile 2 auxiliary format "/u01/app/oracle/oradata/pc00sby1/pc00prmy/sysaux01.dbf" datafile 3 auxiliary format "/u01/app/oracle/oradata/pc00sby1/pc00prmy/undotbs01.dbf" datafile 4 auxiliary format "/u01/app/oracle/oradata/pc00sby1/pc00prmy/users01.dbf" datafile 5 auxiliary format "/u01/app/oracle/oradata/pc00sby1/pc00prmy/example01.dbf" ; sql 'alter system archive log current'; } executing Memory Script executing command: SET NEWNAME renamed tempfile 1 to /u01/app/oracle/oradata/pc00sby1/pc00prmy/temp01.dbf in control file executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting backup at 31-OCT-07 channel prmy1: starting datafile copy input datafile file number=00001 name=/u01/app/oracle/oradata/pc00prmy/pc00prmy/system01.dbf channel prmy2: starting datafile copy input datafile file number=00002 name=/u01/app/oracle/oradata/pc00prmy/pc00prmy/sysaux01.dbf

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 24

    channel prmy3: starting datafile copy input datafile file number=00003 name=/u01/app/oracle/oradata/pc00prmy/pc00prmy/undotbs01.dbf channel prmy4: starting datafile copy input datafile file number=00005 name=/u01/app/oracle/oradata/pc00prmy/pc00prmy/example01.dbf output file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/example01.dbf tag=TAG20071031T144312 RECID=0 STAMP=0 channel prmy4: datafile copy complete, elapsed time: 00:00:45 channel prmy4: starting datafile copy input datafile file number=00004 name=/u01/app/oracle/oradata/pc00prmy/pc00prmy/users01.dbf output file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/users01.dbf tag=TAG20071031T144312 RECID=0 STAMP=0 channel prmy4: datafile copy complete, elapsed time: 00:00:03 output file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/undotbs01.dbf tag=TAG20071031T144312 RECID=0 STAMP=0 channel prmy3: datafile copy complete, elapsed time: 00:01:15 output file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/sysaux01.dbf tag=TAG20071031T144312 RECID=0 STAMP=0 channel prmy2: datafile copy complete, elapsed time: 00:03:13 output file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/system01.dbf tag=TAG20071031T144312 RECID=0 STAMP=0 channel prmy1: datafile copy complete, elapsed time: 00:03:30 Finished backup at 31-OCT-07 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=637426012 file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/system01.dbf datafile 2 switched to datafile copy input datafile copy RECID=6 STAMP=637426012 file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/sysaux01.dbf datafile 3 switched to datafile copy input datafile copy RECID=7 STAMP=637426012 file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/undotbs01.dbf datafile 4 switched to datafile copy

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 25

    input datafile copy RECID=8 STAMP=637426012 file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/users01.dbf datafile 5 switched to datafile copy input datafile copy RECID=9 STAMP=637426012 file name=/u01/app/oracle/oradata/pc00sby1/pc00prmy/example01.dbf Finished Duplicate Db at 31-OCT-07 released channel: prmy1 released channel: prmy2 released channel: prmy3 released channel: prmy4 RMAN> **end-of-file** RMAN>

    18) Exit your RMAN session and log in to SQL*Plus on your primary database system. RMAN> exit Recovery Manager complete. [oracle@edt3r17p0-pc00prmy labs]$ sqlplus / as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Wed Oct 31 15:46:35 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options SQL>

    19) Perform a log switch on the primary database. SQL> alter system switch logfile; System altered. SQL>

    20) Open a terminal window for the system that your physical standby database is on. Set the ORACLE_SID environment variable to pcsby1. Change to the labs directory. Log in to SQL*Plus as the SYSDBA user. Start Redo Apply. [oracle@edt3r17p2-pc02prmy oradata]$ export ORACLE_SID=pc00sby1 [oracle@edt3r17p2-pc00sby1 oradata]$ echo $ORACLE_SID

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 26

    pc00sby1 [oracle@edt3r17p2-pc00sby1 oradata]$ cd $HOME/labs [oracle@edt3r17p2-pc00sby1 labs]$ sqlplus / as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Wed Oct 31 15:52:54 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options SQL> alter database recover managed standby database 2 using current logfile disconnect; Database altered.

  • Oracle Database 11g: Data Guard Administration A - 27

    Practice 2-3: Verifying That the Physical Standby Database Is Performing Correctly In this practice, you verify that the standby database is performing correctly. 1) On the standby database, identify the existing archived redo log files. Use the

    query_archived_log.sql file. SQL> @query_archived_log SQL> SELECT sequence#, first_time, next_time 2 FROM v$archived_log 3 ORDER BY sequence# 4 / SEQUENCE# FIRST_TIM NEXT_TIME ---------- --------- --------- 12 31-OCT-07 01-NOV-07 13 01-NOV-07 01-NOV-07

    2) On the primary database, perform a few log switches. SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered. SQL> alter system switch logfile; System altered.

    3) On the standby database, verify that the new redo data was received and archived. SQL> @query_archived_log SQL> SELECT sequence#, first_time, next_time 2 FROM v$archived_log 3 ORDER BY sequence# 4 / SEQUENCE# FIRST_TIM NEXT_TIME ---------- --------- --------- 12 31-OCT-07 01-NOV-07 13 01-NOV-07 01-NOV-07 14 01-NOV-07 01-NOV-07 15 01-NOV-07 01-NOV-07 16 01-NOV-07 01-NOV-07

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 28

    4) On the standby database, verify that the new archived redo log files were applied. You can use the query_applied_log.sql file. SQL> @query_applied_log SQL> SELECT sequence#, applied 2 FROM v$archived_log 3* ORDER BY sequence#; SEQUENCE# APP ---------- --- 12 YES 13 YES 14 YES 15 YES 16 YES

  • Oracle Database 11g: Data Guard Administration A - 29

    Practices for Lesson 3: Oracle Data Guard Broker: Overview

    There are no practices for Lesson 3, Oracle Data Guard Broker: Overview.

  • Oracle Database 11g: Data Guard Administration A - 30

    Practices for Lesson 4: Creating a Data Guard Broker Configuration

    In the practices for Lesson 4, Creating a Data Guard Broker Configuration, you create a broker configuration.

  • Oracle Database 11g: Data Guard Administration A - 31

    Practice 4-1: Setting the DG_BROKER_START Initialization Parameter In this practice, you set the DG_BROKER_START initialization parameter to TRUE for your primary database and physical standby database. 1) Invoke SQL*Plus on your primary database system. Connect to your primary

    database as the SYSDBA user and check the value of DG_BROKER_START. [oracle@edt3r17p0-pc00prmy labs]$ sqlplus / as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Wed Oct 31 16:12:04 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options SQL> show parameter dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ------------- dg_broker_start boolean FALSE

    2) Set the DG_BROKER_START parameter to TRUE. SQL> alter system set dg_broker_start=true; System altered. SQL> show parameter dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ------------- dg_broker_start boolean TRUE

    3) Open a terminal window for the system that your standby database is on. Set the ORACLE_SID environment variable to pcsby1. Invoke SQL*Plus on your standby database system. Connect to your physical standby database as the SYSDBA user and check the value of DG_BROKER_START. [oracle@edt3r17p2-pc00sby1 labs]$ sqlplus / as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Wed Oct 31 16:13:54 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 32

    Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options SQL> show parameter dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ------------- dg_broker_start boolean FALSE SQL>

    4) Set the value of DG_BROKER_START to TRUE in your standby database. SQL> alter system set dg_broker_start=true; System altered. SQL> show parameter dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ------------- dg_broker_start boolean TRUE

  • Oracle Database 11g: Data Guard Administration A - 33

    Practice 4-2: Creating a Listener Service for the Primary Database In this practice, you define a listener service for the primary database that includes the db_unique_name_DGMGRL.db_domain values for the GLOBAL_DBNAME. Note: Be sure to verify the information that you enter into fields in Oracle Net Manager before proceeding to the next page. 1) Open a terminal window to the system that your primary database is on. Launch

    Oracle Net Manager. [oracle@edt3r17p0-pc00prmy labs]$ netmgr

    2) Expand Local. 3) Expand Listeners. 4) Select LISTENER. 5) Select Database Services in the list. 6) Click Add Database. 7) Enter pcprmy_DGMGRL.us.oracle.com in the Global Database Name

    field. Accept the default value for the Oracle Home Directory. Enter pcprmy in the SID field.

    8) Select File > Save Network Configuration. 9) Select File > Exit. 10) Shut down the LISTENER listener. Restart the LISTENER listener.

    [oracle@edt3r17p0-pc00prmy labs]$ lsnrctl stop LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 20-NOV-2007 01:52:55 Copyright (c) 1991, 2007, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) The command completed successfully [oracle@edt3r17p0-pc00prmy labs]$ lsnrctl start

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 34

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 20-NOV-2007 02:03:38 Copyright (c) 1991, 2007, Oracle. All rights reserved. Starting /u01/app/oracle/product/11.1.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.1.0.6.0 - Production System parameter file is /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/edt3r17p0/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edt3r17p0.us.oracle.com)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production Start Date 20-NOV-2007 02:03:38 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/edt3r17p0/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edt3r17p0.us.oracle.com)(PORT=1521))) Services Summary... Service "pc00prmy_DGMGRL.us.oracle.com" has 1 instance(s). Instance "pc00prmy", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 35

    11) Ensure that your listener.ora file contains entries similar to the following: [oracle@edt3r17p0-pc00prmy labs]$ more $ORACLE_HOME/network/admin/listener.ora # listener.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = pc00prmy_DGMGRL.us.oracle.com) (ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1) (SID_NAME = pc00prmy) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = edt3r17p0.us.oracle.com)(PORT = 1521)) ) )

  • Oracle Database 11g: Data Guard Administration A - 36

    Practice 4-3: Creating a Listener Service for the Standby Database In this practice, you define a listener service for the standby database that includes the db_unique_name_DGMGRL.db_domain value for the GLOBAL_DBNAME. Note: Be sure to verify the information you enter into fields in Oracle Net Manager before proceeding to the next page. 1) Open a terminal window to the system that your standby database is on. Launch

    Oracle Net Manager. [oracle@edt3r17p2-pc00sby1 labs]$ netmgr

    2) Expand Local. 3) Expand Listeners. 4) Select LISTENER1. 5) Select Database Services in the list. 6) Click Add Database. 7) Enter pcsby1_DGMGRL.us.oracle.com in the Global Database Name

    field. Accept the default value for the Oracle Home Directory. Enter pcsby1 in the SID field.

    8) Select File > Save Network Configuration. 9) Select File > Exit. 10) Shut down the LISTENER1 listener. Restart the LISTENER1 listener.

    [oracle@edt3r17p2-pc00sby1 labs]$ lsnrctl stop listener1

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 37

    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 31-OCT-2007 16:27:32 Copyright (c) 1991, 2007, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC12001))) The command completed successfully [oracle@edt3r17p2-pc00sby1 labs]$ [oracle@edt3r17p2-pc00sby1 labs]$ lsnrctl start listener1 LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 31-OCT-2007 16:33:49 Copyright (c) 1991, 2007, Oracle. All rights reserved. Starting /u01/app/oracle/product/11.1.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.1.0.6.0 - Production System parameter file is /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/edt3r17p2/listener1/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edt3r17p2.us.oracle.com)(PORT=12001))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC12001))) STATUS of the LISTENER ------------------------ Alias LISTENER1 Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production Start Date 31-OCT-2007 16:33:49 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/edt3r17p2/listener1/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC12001))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edt3r17p2.us.oracle.com)(PORT=12001))) Services Summary...

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 38

    Service "pc00sby1.us.oracle.com" has 1 instance(s). Instance "pc00sby1", status UNKNOWN, has 1 handler(s) for this service... Service "pc00sby1_DGMGRL.us.oracle.com" has 1 instance(s). Instance "pc00sby1", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully [oracle@edt3r17p2-pc00sby1 labs]$

    11) Ensure that your listener.ora file (in $ORACLE_HOME/network/admin) contains entries similar to the following: [oracle@edt3r17p2-pc00sby1 admin]$ more listener.ora LISTENER1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = edt317p2.us.oracle.com)(PORT = 12001)) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = pc02prmy_DGMGRL.us.oracle.com) (ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1) (SID_NAME = pc02prmy) ) ) SID_LIST_LISTENER1 = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = pc00sby1.us.oracle.com) (ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1) (SID_NAME = pc00sby1) ) (SID_DESC = (GLOBAL_DBNAME = pc00sby1_DGMGRL.us.oracle.com) (ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1) (SID_NAME = pc00sby1) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = edt317p2.us.oracle.com)(PORT = 1521)) ) )

  • Oracle Database 11g: Data Guard Administration A - 39

    Practice 4-4: Creating an Oracle Net Service Name for the Primary Database In this practice, you define an Oracle Net service name for the primary database on the system on which your physical standby database is created. Note: Be sure to verify the information you enter into fields in Oracle Net Manager before proceeding to the next page. 1) On the system on which your physical standby database is created, invoke Oracle Net

    Manager. 2) Expand Local. Select Service Naming and click the green plus sign in the left

    navigation pane. 3) Enter pcprmy in the Net Service Name field and click Next.

    4) Select TCP/IP (Internet Protocol) and click Next. 5) Enter the fully qualified host name of the machine that your primary database is on

    and click Next. The screenshot shows an example. Be sure to enter the host name that you are using.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 40

    6) Enter pcprmy.us.oracle.com in the Service Name field and click Next.

    7) Click Finish. 8) Select File > Save Network Configuration to save the information to the

    tnsnames.ora file. 9) Exit Oracle Net Manager.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 41

    10) Ensure that your tnsnames.ora file has entries similar to the following: PC02PRMY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = edt3r17p2.us.oracle.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pc02prmy.us.oracle.com) ) ) PC00PRMY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = edt3r17p0.us.oracle.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = pc00prmy.us.oracle.com) ) )

  • Oracle Database 11g: Data Guard Administration A - 42

    Practice 4-5: Creating an Oracle Net Service Name for the Standby Database In this practice, you define an Oracle Net service name for the standby database on the system on which the standby database is created. Note: Be sure to verify the information you enter into fields in Oracle Net Manager before proceeding to the next page. 1) On the system on which your physical standby database is created, invoke Oracle Net

    Manager. 2) Expand Local. Select Service Naming and click the green plus sign. 3) Enter pcsby1 in the Net Service Name field and click Next.

    4) Select TCP/IP (Internet Protocol) and click Next. 5) Enter the fully qualified host name of the machine that your physical standby

    database is on. Change the port number to 12001. Click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 43

    6) Enter pcsby1.us.oracle.com in the Service Name field and click Next.

    7) Click Finish. 8) Select File > Save Network Configuration to save the information to the

    tnsnames.ora file. 9) Exit Oracle Net Manager.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 44

    10) Ensure that your tnsnames.ora file has entries similar to the following: PC00PRMY = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = edt3r17p0.us.oracle.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = pc00prmy.us.oracle.com) ) ) PC00SBY1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = edt3r17p2.us.oracle.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = pc00sby1.us.oracle.com) ) )

    11) Invoke SQL*Plus for your physical standby database and set the LOCAL_LISTENER parameter to pcsby1. Be sure to set the ORACLE_SID environment variable to pcsby1 before invoking SQL*Plus. SQL> alter system set local_listener=pc00sby1; System altered.

  • Oracle Database 11g: Data Guard Administration A - 45

    Practice 4-6: Creating the Broker Configuration In this practice, you create a Data Guard broker configuration. 1) On your primary database system, invoke DGMGRL and connect to your primary

    database. [oracle@edt3r17p0-pc00prmy labs]$ dgmgrl DGMGRL for Linux: Version 11.1.0.6.0 - Production Copyright (c) 2000, 2005, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. DGMGRL> connect sys/oracle Connected. DGMGRL>

    2) Create a broker configuration named DGConfig1 and include a profile for the primary database. DGMGRL> create configuration 'DGConfig1' as > primary database is 'pc00prmy' > connect identifier is pc00prmy; Configuration "DGConfig1" created with primary database "pc00prmy" DGMGRL>

    3) Display information about the configuration. DGMGRL> show configuration Configuration Name: DGConfig1 Enabled: NO Protection Mode: MaxPerformance Databases: pc00prmy - Primary database Fast-Start Failover: DISABLED Current status for "DGConfig1": DISABLED DGMGRL>

    4) Add your physical standby database to the broker configuration. DGMGRL> add database 'pc00sby1' as > connect identifier is pc00sby1; Database "pc00sby1" added DGMGRL>

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 46

    5) Verify that the pcsby1 database was added to the configuration. DGMGRL> show configuration; Configuration Name: DGConfig1 Enabled: NO Protection Mode: MaxPerformance Databases: pc00prmy - Primary database pc00sby1 - Physical standby database Fast-Start Failover: DISABLED Current status for "DGConfig1": DISABLED DGMGRL>

  • Oracle Database 11g: Data Guard Administration A - 47

    Practice 4-7: Enabling the Broker Configuration In this practice, you enable the broker configuration. 1) Enable the entire configuration.

    DGMGRL> enable configuration; Enabled.

    2) Verify that the configuration was successfully enabled. If you receive a warning message (WARNING: ORA-16610 Set Property in Progress) or (WARNING: ORA-16610 Command "Broken automatic health check" in Progress), wait a few minutes and issue the SHOW CONFIGURATION command again. DGMGRL> show configuration Configuration Name: DGConfig1 Enabled: YES Protection Mode: MaxPerformance Databases: pc00prmy - Primary database pc00sby1 - Physical standby database Fast-Start Failover: DISABLED Current status for "DGConfig1": SUCCESS DGMGRL>

    Note: If you receive one of the following messages Warning: ORA-16607: one or more databases have failed or Warning: ORA-16792: configurable property value is inconsistent with database setting, you may need to restart one or both of your database instances. Discuss your situation with your course instructor.

  • Oracle Database 11g: Data Guard Administration A - 48

    Practices for Lesson 5: Creating a Physical Standby Database by Using Enterprise Manager Grid Control

    In the practices for Lesson 5, Creating a Physical Standby Database by Using Enterprise Manager Grid Control, you use Enterprise Manager Grid Control to create a physical standby database.

  • Oracle Database 11g: Data Guard Administration A - 49

    Practice 5-1: Installing the Oracle Management Agent In this practice, you install the Oracle Management Agent so that you can use Enterprise Manager Grid Control. Your instructor will provide the name of the machine that Enterprise Manager Grid Control is installed on. Record the name of the machine here and in step 7: ______________________________________________________________________ 1) On your primary database host machine, open a terminal window and log on as the

    oracle user with a password of oracle. 2) Oracle Enterprise Manager Grid Control software is staged in the

    $HOME/agent_installmedia directory. Change to the agent_installmedia/Disk1/linux/agent directory. [oracle@edt3r17p0-pc00prmy ~]$ cd agent_installmedia/Disk1/linux/agent

    3) Invoke the Oracle Universal Installer. [oracle@edt3r17p2-pc00prmy agent]$ ./runInstaller Starting Oracle Universal Installer... Checking installer requirements... Checking operating system version: must be redhat-3, redhat-4 or SuSE-9 Passed All installer requirements met. Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-01-22_11-26-41AM. Please wait ...

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 50

    4) On the Specify Installation Type page, select Additional Management Agent and

    click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 51

    5) Accept the default location for the parent directory and click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 52

    6) The Product-Specific Prerequisite Checks page is displayed. Click Next to continue.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 53

    7) Enterprise Manager Grid Control host machine: ____________________________

    On the Specify Oracle Management Service Location page, provide the name of the host machine as provided by your instructor. Click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 54

    8) On the Specify Agent Registration Password page, enter oracle1 in the Password

    field. Click Next. Be sure you have entered the password of oracle1 before clicking Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 55

    9) On the Oracle Configuration Manager Registration page, click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 56

    10) Click Install on the Summary page.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 57

    11) Note that the Install page shows the progress of the installation.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 58

    12) The Execute Configuration scripts dialog box appears. Open a terminal window

    and switch to the root user. In the Oracle University classroom, the password of the root user is oracle.

    13) Execute the script as instructed in the dialog box. Accept the default values when

    prompted. [oracle@edt3r17p0-pc00prmy ~]$ su - Password: [root@edt3r17p0 ~]# cd /u01/app/oracle/OracleHomes/agent10g [root@edt3r17p0 agent10g]# ./root.sh Running Oracle10 root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/OracleHomes/agent10g Enter the full pathname of the local bin directory: [/usr/local/bin]: The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]:

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 59

    The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. Finished product-specific root actions. [root@edt3r17p0 agent10g]#

    14) After the script is completed, return to the Execute Configuration scripts dialog box and click OK. The Configuration Assistants page appears.

    15) The End of Installation page appears. Click Exit to exit the Oracle Universal Installer.

    Click Yes to confirm.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 60

  • Oracle Database 11g: Data Guard Administration A - 61

    Practice 5-2: Configuring Monitoring Credentials for Your Primary Database In this practice, you configure monitoring credentials for your primary database. 1) Open your browser and invoke Enterprise Manager by entering the following URL:

    http://:4889/em 2) Log in to Enterprise Manager Grid Control with a username of sysman and

    password of oracle1. 3) The Grid Control home page appears. Click the Targets tab. 4) The Hosts page appears. Ensure that your primary database host appears in the list.

    Click Databases. 5) The Databases page appears. Select your primary database from the list of databases

    (by clicking the option button) and click Configure. 6) Select SYSDBA in the Role list. Enter sys in the Monitor Username field. Enter

    oracle in the Monitor Password field. Click Test Connection. 7) After you receive a message that the connection test was successful, click Next. 8) The Configure Database Instance: Review page appears. Click Submit on this page. 9) A page displays the message Target saving is in progress. 10) You receive a message that the properties were updated. Click OK. 11) The Databases page is updated with the status for your configured database. Ensure

    that the status for your database is Up before proceeding to the next practice.

  • Oracle Database 11g: Data Guard Administration A - 62

    Practice 5-3: Configuring Monitoring Credentials for Your Standby Database In this practice, you configure credentials for monitoring your standby database. Note: Before beginning this practice, you must confirm that the Oracle Management Agent is successfully installed on your standby database host. 1) On the Databases page, select your standby database (by clicking the option button)

    and click Configure. 2) Select SYSDBA in the Role list. Enter sys in the Monitor Username field and

    oracle in the Monitor Password field. Enter 12001 in the Port field 3) Click Test Connection. You should receive a message indicating that the connection

    test was successful. Click Next. 4) On the Configure Database Instance: Review page, click Submit. A page displays the

    message Target saving is in progress. 5) The Database Instance Configuration Result page appears. Click OK. 6) You are returned to the Databases page. Ensure that the status for your database is

    Up before proceeding to the next practice.

  • Oracle Database 11g: Data Guard Administration A - 63

    Practice 5-4: Adding a Physical Standby Database to Your Configuration In this practice, you add a new physical standby database to your configuration by using Enterprise Manager Grid Control. 1) Select your primary database by clicking the link on the Databases page. 2) Click Maintenance. Select Setup and Manage in the Data Guard section of the

    Maintenance page. 3) Enter database login credentials (SYS as SYSDBA) if requested. 4) Click Add Standby Database.

    5) On the Add Standby Database page, select Create a new physical standby database

    and click Continue.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 64

    6) On the Add Standby Database: Backup Type page, select Perform a live backup of

    the primary database and click Next.

    7) On the Add Standby Database: Backup Options page, accept the default location for

    the backup files directory. Accept the default option to delete the files after the standby database creation. Enter the host credentials (Username: oracle and Password: oracle) and select Save as Preferred Credential. Click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 65

    8) On the Add Standby Database: Database Location page, enter pcsby2 in the

    Instance Name field. Select the same host that you used for your other physical standby database. Click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 66

    9) On the Add Standby Database: File Locations page, accept the default to transfer

    files. Scroll down the page.

    10) In the Standby Database File Locations section, select Keep file names and

    locations the same as the primary database and click Customize.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 67

    11) On the File Locations: Customize Tablespace Storage page, change the directory

    location to pcsby2 for all file locations, in all sections (Datafiles, Tempfiles, Log Files, Control Files, and Directory Objects) as necessary. Click OK.

    12) On the Warning page, click Yes.

    13) You are returned to the Add Standby Database: File Locations page. Click Next. 14) On the Add Standby Database Configuration page, enter pcsby2 in the

    Database Unique Name and Target Name fields. Accept the default for the Standby Archive Location. Click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 68

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 69

    15) On the Add Standby Database Review page, review the information about the

    standby database to be created. If you are satisfied with the configuration information, click Finish or click Back to make changes. The Processing: Add Standby Database page appears.

    Note: If Enterprise Manager remains on this page for more than 10 minutes, click the Jobs tab to verify that the job is started.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 70

    16) You are returned to the Data Guard Overview page. Select Real Time: 1 Minute

    Refresh in the View Data list to easily view the progress of standby database creation. You can also click the Creation in progress link to monitor standby database creation.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 71

    17) After the standby database creation is completed, not that the new physical standby

    database is listed in the Standby Databases section.

  • Oracle Database 11g: Data Guard Administration A - 72

    Practice 5-5: Verifying the Broker Configuration In this practice, you use Enterprise Manager Grid Control to verify your configuration. 1) In the Additional Administration section of the Data Guard Overview page, click

    Verify Configuration. The Processing: Verify page is displayed. The Processing: Verify Completed page displays the results of the verify operation.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 73

    2) Click OK to return to the Data Guard Overview page. 3) As indicated in the Detailed Results pane, you must execute the Verify a second time.

    Click Verify Configuration. 4) Click OK to create the recommended standby redo logs. After the standby redo logs

    are created, you are returned to the Data Guard Overview page.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 74

  • Oracle Database 11g: Data Guard Administration A - 75

    Practice 5-6: Deleting the Database In this practice, you delete the pcsby2 database in preparation for later practices. 1) Select your pcsby2 database (by clicking the option button) on the Data

    Guard Overview page and click Remove to remove your pcsby2 database from Data Guard broker control.

    2) On the Confirmation page, click Yes. You receive a confirmation message that the

    database has been removed from the Data Guard configuration.

    3) Click the Databases tab to return to the Databases page. 4) Click the link for your pcsby2 database. 5) The database home page is displayed. Click the Shutdown button to shut down your

    pcsby2 database instance. 6) Enter the host credentials and the database credentials. Click OK.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 76

    7) On the Startup/Shutdown: Specify Operation page, select Shutdown the database and click Continue.

    8) Click Yes to confirm the shutdown operation. The Startup/Shutdown: Activity

    Information page is displayed. 9) When the shutdown operation is complete, you are returned to the database home

    page. You receive a message that your database has been shut down. Click the Databases tab to return to the Databases page.

    10) Select your pcsby2 database on the Databases page and click Remove to remove it from Enterprise Manager Grid Control.

    11) Click Yes to confirm. You receive a confirmation message.

  • Oracle Database 11g: Data Guard Administration A - 77

    Practices for Lesson 6: Creating a Logical Standby Database

    In the practices for Lesson 6, Creating a Logical Standby Database, you use Enterprise Manager Grid Control to create a logical standby database.

  • Oracle Database 11g: Data Guard Administration A - 78

    Practice 6-1: Creating a Logical Standby Database In this practice, you create a logical standby database and add it to your configuration. 1) Select your primary database on the Databases pages. 2) Select Setup and Manage in the Data Guard section of the Maintenance page. 3) Click Add Standby Database. 4) On the Add Standby Database page, select Create a new logical standby database

    and click Continue.

    5) In the Add Standby Database: Backup Type section, accept the default of Perform a

    live backup of the primary database. In the SQL Apply Unsupported Tables section, select Table Columns and Data Types in the list and click Go to see the unsupported tables.

    6) For this practice, you can accept the unsupported columns. Click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 79

    7) On the Add Standby Database: Backup Options page, accept the default location for

    the backup files directory. Accept the default option to delete the files after standby database creation. Enter the host credentials and select Save as Preferred Credential. Click Next.

    8) On the Add Standby Database: Database Location page, enter pcsby3 in the Instance Name field. Select the same host that you used for your physical standby databases. Click Next.

    9) On the Add Standby Database: File Locations page, accept the default to transfer files.

    10) In the Standby Database File Locations section, select Keep file names and locations the same as the primary database and click Customize.

    11) On the File Locations: Customize Tablespace Storage page, change the directory location to pcsby3 for all file locations on the page as necessary. Click OK.

    12) On the Warning page, click Yes. 13) You are returned to the Add Standby Database: File Locations page. Click Next. 14) On the Add Standby Database Configuration page, enter pcsby3 in the

    Database Name, Database Unique Name, and Target Name fields. Accept the default for the Standby Archive Location. Click Next.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 80

    15) On the Add Standby Database Review page, review the information about the logical

    standby database to be created. If you are satisfied with the configuration information, click Finish. Otherwise, click Back to make changes. The Processing: Add Standby Database page appears.

    16) You are returned to the Data Guard Overview page. Select Real Time: 1 Minute

    Refresh in the View Data list to easily view the progress of the logical standby database creation.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu. (continued)

    Oracle Database 11g: Data Guard Administration A - 81

    17) After the standby database creation is completed, the new logical standby database is listed in the Standby Databases section. Proceed to the next step when the status for your logical standby database is Normal.

    18) Verify your configuration by clicking Verify Configuration. 19) Click OK to return to the Data Guard page.

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu.

    Oracle Database 11g: Data Guard Administration A - 82

    Practice 6-2: Implementing SQL Apply Filtering In this practice, you test SQL Apply filtering. Because the users want to use some tables in the logical standby database to report against for historical purposes, you need to configure SQL Apply so that certain DML statements are not executed against those tables on the logical standby database. You decide to test this feature by creating a new table on the primary database. 1) Open a terminal window for your primary database and change to the labs

    directory. [oracle@edt3r17p0-pc00prmy agent]$ cd $HOME/labs [oracle@edt3r17p0-pc00prmy labs]$

    2) Invoke SQL*Plus and connect as the SYSDBA user. [oracle@edt3r17p0-pc00prmy labs]$ sqlplus / as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Tue Feb 12 03:53:43 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options SQL>

    3) Unlock the HR user account and set the password to hr. (lowercase) SQL> ALTER USER hr IDENTIFIED BY hr ACCOUNT UNLOCK; User altered.

    4) Connect as the HR user with a password of hr. SQL> connect hr/hr Connected.

    5) Execute the cr_emp_name.sql script to create a table named HR.EMP_NAME. You use this table to test the SQL Apply filtering feature. Exit SQL*Plus. SQL> set echo on SQL> @cr_emp_name SQL> CREATE TABLE hr.emp_name 2 AS SELECT first_name, last_name 3 FROM hr.employees

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu.

    Oracle Database 11g: Data Guard Administration A - 83

    4 WHERE 1=2 5 / Table created.

    6) Return to Enterprise Manager Grid Control and navigate to the Data Guard page. 7) Select your logical standby database and click Edit. 8) Click Standby Role Properties. 9) Expand Show Advanced Properties.

    10) Click Add in the Skip Table Entries section.

    11) Enter information as shown in the following screen so that SQL Apply does not

    execute DML statements for the HR.EMP_NAME table:

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu.

    Oracle Database 11g: Data Guard Administration A - 84

    12) Click OK. 13) Verify the information in the Skip Table Entries section and click Apply. A success

    message is displayed.

    14) In your primary database session, log in to DGMGRL as the SYS user. 15) Verify the setting of the LsbyASkipCfgPr property. Exit DGMGRL.

    DGMGRL> show database pc00sby3 LsbyAskipCfgPr; LsbyASkipCfgPr = ''DML', 'HR', 'EMP_NAME', null'

    16) In your primary database session, log in to SQL*Plus as the HR user again. Execute the ins_emp_name.sql script to insert two rows in the HR.EMP_NAME table. SQL> @ins_emp_name SQL> INSERT INTO hr.emp_name 2 VALUES ('Don', 'Miller') 3 / 1 row created. SQL> INSERT INTO hr.emp_name 2 VALUES ('Sally', 'Hebert') 3 / 1 row created. SQL> COMMIT 2 /

  • Error! Utilice la pestaa Inicio para aplicar Heading 2 al texto que desea que aparezca aqu.

    Oracle Database 11g: Data Guard Administration A - 85

    Commit complete.

    17) Connect to your primary database as the SYSDBA user. SQL> connect / as sysdba Connected.

    18) Force a log switch on your primary database. SQL> alter system switch logfile; System altered.

    19) Open a terminal window and telnet to the machine that your standby database is on. Log in as the oracle user with a password of oracle.

    20) Change to the labs directory. Set the ORACLE_SID environment variable to pcsby3. [oracle@edt3r17p2-pc00sby1 labs]$ export ORACLE_SID=pc00sby3

    21) Invoke SQL*Plus on your logical standby database and log in as the HR user. [oracle@edt3r17p2-pc00sby3 labs]$ sqlplus hr/hr SQL*Plus: Release 11.1.0.6.0 - Production on Tue Feb 12 04:19:45 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, Oracle Label Security, OLAP, Data Mining and Real Application Testing options

    22) Query the HR.EMP_NAME table to verify that no rows were inserted in the table. SQL> SELECT count(*) FROM emp_name; COUNT(*) ---------- 0

    23) Exit SQL*Plus on your standby database.

  • Oracle Database 11g: Data Guard Administration A - 86

    Practices for Lesson 7: Configuring Data Protection Modes

    In the practices for Lesson 7, Configuring Data Protection Modes, you configure protection modes based on specific business requirements.

  • Oracle Database 11g: Data Guard Administration A - 87

    Practice 7-1: Setting the Data Protection Mode by Using DGMGRL In this practice, you set the data protection mode as appropriate to the business requirements. Maximum performance is the default protection mode and provides the highest level of data protection that is possible without affecting the performance of the primary database. This is accomplished by allowing a transaction to commit as soon as the redo data needed to recover that transaction is written to the local online redo log. You have determined that you need to change the data protection mode to ensure that the redo data needed to recover each transaction is written to both the local online redo log and the standby redo log on at least one standby database before the transaction commits. You also want to configure the protection mode so that the primary database does not shut down if a fault prevents it from writing its redo stream to a remote standby redo log. Change the protection mode to maximum availability so that your configuration meets these requirements. 1) Invoke DGMGRL on your primary database host and connect to your primary

    database. [oracle@edt3r17p0-pc00prmy admin]$ dgmgrl DGMGRL for Linux: Version 11.1.0.6.0 - Production Copyright (c) 2000, 2005, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. DGMGRL> connect sys/oracle Connected.

    2) Use the SHOW CONFIGURATION command to check the current protection mode for your configuration. DGMGRL> show configuration Configuration Name: DGConfi