Beruflich Dokumente
Kultur Dokumente
D67579
May 2010
Edition 3.0
D52161GC30
Activity Guide
Administration
Oracle Database 11g: Data Guard
Donna K. Keesling This document contains proprietary information and is protected by copyright and
other intellectual property laws. You may copy and print this document solely for your
own use in an Oracle training course. The document may not be modified or altered in
Technical Contributors any way. Except where your use constitutes "fair use" under copyright law, you may
and Reviewers not use, share, download, upload, copy, print, display, perform, reproduce, publish,
license, post, transmit, or distribute this document in whole or in part without the
Todd Bao express authorization of Oracle.
Harald van Breederode The information contained in this document is subject to change without notice. If you
Michael Cebulla find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Joel Goodman warranted to be error-free.
Uwe Hesse
Restricted Rights Notice
Pete Jones
If this documentation is delivered to the United States Government or anyone using
Nitin Karkhanis
the documentation on behalf of the United States Government, the following notice is
Frank Kobylanski applicable:
Sadhana Kyathappala U.S. GOVERNMENT RIGHTS
Stephen Moriarty The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
disclose these training materials are restricted by the terms of the applicable Oracle
Javier Saiz license agreement and/or the applicable U.S. Government contract.
Madhavi Siddireddy
Trademark Notice
Jim Spiller
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names
Milgred Tumolo
may be trademarks of their respective owners.
Branislav Valny
Jean-Francois Verrier
Pam Welford
Editors
Aju Kumar
Amitha Narayan
Nita Pavitran
Graphic Designer
Satish Bettegowda
Publishers
Syed Imtiaz Ali
Sumesh Koshy
Veena Narasimhan
unarski inzenjering d.o.o use only
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Use this page to record information about the databases in your configuration.
You create a standby database named pc<nn>sby1, 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. Set the environment
variables for your primary database using the oraenv utility. Invoke SQL*Plus and
-66connect as to your primary database. Determine if
mode.FORCELOGGING is
enabled. If it is not enabled, enable FORCE LOGGING
-120[oracle@EDBVR6P1- ~]$
[oracle@EDBVR6P1- labs]$. oraenv
ORACLE_SID = [oracle] ? pc01prmy
---
YES
2) Configure the standby redo logs on the primary database. You can use the
cr_sby_redologs.sql script.
SQL>
SQL> ALTER DATABASE ADD STANDBY LOGFILE '+DATA' size 52428800
2 /
2 /
Database altered.
Database altered.
SQL> ALTER DATABASE OPEN;
System altered.
SQL>
Disconnected from Oracle Database 11g Enterprise Edition
Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@EDBVR6P1-pc01prmy labs]$
7) Invoke RMAN and log in to your primary database.
[oracle@EDBVR6P1-pc01prmy labs]$ rman
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Feb 9
17:51:02 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All
rights reserved.
RMAN> connect target /
connected to target database: PC01PRMY (DBID=2580985790)
8) Make a whole database backup, including archived redo log files. Exit RMAN.
RMAN> backup database plus archivelog;
using target database control file instead of recovery catalog current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=145 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=8 RECID=1 STAMP=710531375
input archived log thread=1 sequence=9 RECID=2 STAMP=710531376
input archived log thread=1 sequence=10 RECID=3
handle=+FRA/pc01prmy/backupset/2010_02_09/annnf0_tag20100209t1piece
75159_0.267.710531519 tag=TAG20100209T175159 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
handle=+FRA/pc01prmy/backupset/2010_02_09/nnndf0_tag20100209t1piece
75202_0.268.710531523 tag=TAG20100209T175202 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
handle=+FRA/pc01prmy/backupset/2010_02_09/ncsnf0_tag20100209t1piece
75202_0.269.710531601 tag=TAG20100209T175202 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time:
channel ORA_DISK_1: starting archived log backup set using channel ORA_DISK_1
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=11 RECID=4
RMAN> exit
Recovery Manager complete.
[oracle@EDBVR6P1-pc01prmy labs]$
c) Enter pc<nn>sby1 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.
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: edbvr6p2.us.oracle.com is used only as an example.
(CONNECT_DATA = )
(SERVER = DEDICATED)
(SERVICE_NAME = pc01prmy.us.oracle.com)
)
)
PC01DB11 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
edbvr6p1.us.oracle.com)(PORT = 1521))
(CONNECT_DATA = )
(SERVER = DEDICATED)
(SERVICE_NAME = pc01db11.us.oracle.com)
)
)
PC01SBY1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
edbvr6p2.us.oracle.com)(PORT = 12001))
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
)
)
(CONNECT_DATA =
(SERVICE_NAME =
[oracle@EDBVR6P1-pc01prmy labs]$
pc01sby1.us.oracle.com)
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr:
please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edBVr6p2.us.oracle.cListening on:
om)(PORT=12001)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbvr6p2.us.oracle.cConnecting to
om)(PORT=12001)))
STATUS of the LISTENER
------------------------
Alias listener1
Version TNSLSNR for Linux: Version
11.2.0.1.0 - Production
Start Date 09-FEB-2010 18:12:06
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
ftp>
Using binary mode to transfer files.
1536 bytes sent in 4.3e-05 seconds (3.5e+04 Kbytes/s) 226 Transfer complete.
-120ftp>
221-You have transferred 1536 bytes in 1 files.
221-Total traffic for this session was 2046 bytes in 1
[oracle@EDBVR6P2-pc02prmy dbs]$
[oracle@EDBVR6P2-pc02prmy admin]$
+ASM pc02db11 pc02prmy ls
standby databases.
[oracle@EDBVR6P1-pc01prmy labs]$ }
15) Invoke RMAN and connect as SYSDBA to the target database. Connect to the
auxiliary database.
[oracle@EDBVR6P1-pc01prmy labs]$ rman
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Feb 9
18:26:16 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All
rights reserved.
RMAN> connect target sys/oracle_4U
RMAN>
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwpc01prmy' targetfile
''service=pc01prmy ASYNC
valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE)
db_unique_name=pc01prmy'' comment=
'''' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set audit_file_dest =
''/u01/app/oracle/admin/pc01sby1/adump'' comment= ''''
scope=spfile
sql statement: alter system set dispatchers =
''(PROTOCOL=TCP) (SERVICE=pc01sby1XDB)'' comment= ''''
scope=spfile
sql statement: alter system set db_unique_name =
''pc01sby1'' comment= '''' scope=spfile
sql statement: alter system set db_create_file_dest =
''+SBDAT'' comment= '''' scope=spfile
sql statement: alter system set db_recovery_file_dest =
''+SBFRA'' comment= '''' scope=spfile
sql statement: alter system set db_recovery_file_dest_size =
5G comment= '''' scope=spfile
sql statement: alter system set control_files = ''+SBDAT''
comment= '''' scope=spfile
sql statement: alter system set log_archive_max_processes =
5 comment= '''' scope=spfile
sql statement: alter system set fal_client = ''pc01sby1''
comment= '''' scope=spfile
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_pc01proutput file
my.f tag=TAG20100209T182739 RECID=1 STAMP=710533659
channel prmy1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 09-FEB-10
sql statement: alter system set control_files =
''+SBDAT/pc01sby1/controlfile/current.257.710533699'' comment=
''Set by RMAN'' scope=spfile
Oracle instance shut down
name=+SBDAT/pc01sby1/datafile/undotbs1.259.710533719output file
name=+SBDAT/pc01sby1/datafile/example.260.710533719output file
Connected to:
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL>
19) Open a terminal window for the system that your physical standby database is on.
Add an entry for the standby database to the
utility to set your environment variables. Change to the /etc/oratab file. Use
the oraenv labs directory.
Log in to SQL*Plus as the SYSDBA user. Start Redo Apply.
[oracle@EDBVR6P1-pc01prmy ~]$oraclessh edbvr6p2
oracle@edbvr6p2's password:
Last login: Tue Feb 9 18:14:31 2010 from
edBVr6p1.us.oracle.com
[oracle@EDBVR6P2- ~]$ vi /etc/oratab
<< insert a new entry per instructions >>
[oracle@EDBVR6P2- ~]$ cat /etc/oratab
..
+ASM:/u01/app/oracle/product/11.2.0/grid:N
pc02db11:/u01/app/oracle/product/11.2.0/dbhome_1:N
Connected to:
Copyright (c) 1982, 2009, Oracle. All rights reserved.
System altered.
System altered.
3) On the standby database, verify that the new redo data was received and archived.
SQL> @query_archived_log
6 rows selected.
17 09-FEB-10 09-FEB-10
Configuration
In the practices for Lesson 4, “Creating a Data Guard Broker Configuration,” you create a
broker configuration.
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbvr6p1.us.oracle.cConnecting to
om)(PORT=12001)))
The command completed successfully
[oracle@EDBVR6P1-+ASM labs]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 22-FEB-
2010 09:52:05
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/grid/bin/tnslsnr:
please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edBVr6p1.us.oracle.cListening on:
om)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) Connecting to
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version
11.2.0.1.0 - Production
Start Date 22-FEB-2010 09:52:06
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edBVr6p1.us.oracle.c
om)(PORT=1521)))
Services Summary...
Instance "Service "pc01prmy_DGMGRL.us.oracle.com" has 1 instance(s).
pc01prmy", status UNKNOWN, has 1 handler(s) for
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbvr6p2.us.oracle.cConnecting to
om)(PORT=12001)))
The command completed successfully
[oracle@EDBVR6P2-pc01sby1 ~]$ lsnrctl start listener1
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 09-FEB-
2010 18:57:59
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr:
please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=edBVr6p2.us.oracle.cListening on:
om)(PORT=12001)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbvr6p2.us.oracle.cConnecting to
om)(PORT=12001)))
STATUS of the LISTENER
------------------------
Alias listener1
Version TNSLSNR for Linux: Version
11.2.0.1.0 - Production
Start Date 09-FEB-2010 18:57:59
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
LISTENER1 =
(DESCRIPTION =
_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
(SID_DESC = )
(GLOBAL_DBNAME = pc01sby1_DGMGRL.us.oracle.com)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = pc01sby1)
)
)
ADR_BASE_LISTENER1 = /u01/app/oracle
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
7) Click Finish.
8) Select File > Save Network Configuration to save the information to the
tnsnames.ora file.
(CONNECT_DATA = )
(SERVER = DEDICATED)
(SERVICE_NAME = pc02prmy.us.oracle.com)
)
)
PC01PRMY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
edbvr6p1.us.oracle.com)(PORT = 1521))
-253 (CONNECT_DATA =
) (SERVICE_NAME = pc01prmy.us.oracle.com)
)
)
PC02DB11 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
edbvr6p2.us.oracle.com)(PORT = 1521))
(CONNECT_DATA = )
(SERVER = DEDICATED)
(SERVICE_NAME = pc02db11.us.oracle.com)
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
)
)
[oracle@EDBVR6P2-pc01sby1 ~]$
(continued)
7) Click Finish.
8) Select File > Save Network Configuration to save the information to the
tnsnames.ora file.
9) Exit Oracle Net Manager.
(CONNECT_DATA = )
(SERVER = DEDICATED)
(SERVICE_NAME = pc02prmy.us.oracle.com)
)
)
PC01PRMY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
edbvr6p1.us.oracle.com)(PORT = 1521))
-373 -120 (CONNECT_DATA =
) (SERVICE_NAME = pc01prmy.us.oracle.com)
)
)
PC02DB11 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
edbvr6p2.us.oracle.com)(PORT = 1521))
(CONNECT_DATA = )
(SERVER = DEDICATED)
(SERVICE_NAME = pc02db11.us.oracle.com)
)
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
)
PC01SBY1 =
(DESCRIPTION =
(ADDRESS_LIST =
edbvr6p2.us.oracle.com)(PORT =
(ADDRESS = (PROTOCOL = TCP)(HOST =
12001))
(continued)
)
(CONNECT_DATA =
(SERVICE_NAME = pc01sby1.us.oracle.com)
)
)
[oracle@EDBVR6P2-pc01sby1 ~]$
11) Invoke SQL*Plus for your physical standby database and set the LOCAL_LISTENER
2) Create a broker configuration named DGConfig1 and include a profile for the
primary database.
DGMGRL> create configuration 'DGConfig1' as
Configuration - DGConfig1
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
u01/app/oracle/OracleHomes/agent10g/rdbms/install/sbs/olsoidsytool.sbs
ORACLE_HOME=/u01/app/oracle/OracleHomes/agent10g-clone -forceClone
34 REPOSITORY_URL=http:// 33 # vx0326.us.oracle.com:4889/em/upload
35
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
..
..
6) Run the root.sh script from the Oracle home directory of the Management Agent.
Note: Do not overwrite the files in the /usr/local/bin directory because the
versions in the Agent home are 10g versions, and the installed scripts are 11g
versions.
[oracle@EDBVR6P1- labs]$ su -
Password: oracle
/u01/app/oracle/OracleHomes/agent10g/root.sh[root@EDBVR6P1 ~]#
Running Oracle10 root.sh script...
The following environment variables are set as:
it? (y/n)
10.2.0.5.0.
RESPONSE_FILE=/u01/app/oracle/OracleHomes/agent10g/response_fiACTION=Configure MODE=Perform
INV_PTR_LOC=/u01/app/oracle/OracleHomes/agent10g/oraInst.locle RERUN=TRUE
COMPONENT_XML={oracle.sysman.top.agent.10_2_0_1_0.xml}
Perform - mode is starting for action: Configure
ions2010-02-09_07-34-56-PM.log
[oracle@EDBVR6P1- labs]$
8) Set up the environment variables for the Agent home and secure the agent. The
/usr/local/bin/agent.env script has been provided to assist in setting the
environment variables.
[oracle@EDBVR6P1- labs]$ . agent.env
[oracle@EDBVR6P1- labs]$ emctl secure agent
Oracle Enterprise Manager 10g Release 5 Grid Control
--------------------------------------------------------------reserved.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
OMS Version
Agent Version
: 10.2.0.5.0
--------------------------------------------------------------18:18:47
-
Agent is Running and Ready
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
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://<oms_host>: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.
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
Machine
In this practice, you configure the preferred credentials for your host machine.
1) On the home page, click Preferences at the top-right corner of the page.
2) Click Preferred Credentials from the Preferences menu.
3) Click the Set Credentials Icon for the Host Target Type.
4) Under the Target Credentials sections, enter the following for your primary database
host machine:
a) Normal Username: oracle
Configuration
In this practice, you add a new physical standby database to your configuration by using
Enterprise Manager Grid Control. Note: The agent must be running on your standby
host machine before you can continue with this step!
1) Select your primary database by clicking the link on the Databases page.
2) Click Availability. Select Setup and Manage in the Data Guard section of the
Availability page.
3)Enter database login credentials (
5) On the Add Standby Database page, select Create a new physical standby database
and click Continue.
7) On the Add Standby Database: Backup Options page, accept the default number of
Concurrent File Copy Processes. Enter the Primary Host Credentials (Username:
oracle and Password: oracle) and select Save as Preferred Credential. Click
Next.
Configuration (continued)
A - 68
Oracle University and Digit racunarski inzenjering d.o.o use only
Practice 5-5: Adding a Physical Standby Database to Your
Configuration (continued)
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
12) 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.
14) After the standby database creation is completed, note that the new physical standby
database is listed in the Standby Databases section.
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.
In this practice, you delete the pc<nn>sby2 database in preparation for later practices.
1) Select your pc<nn>sby2 database (by clicking the option button) on the Data
Guard Overview page and click Remove to remove your pc<nn>sby2 database
from Data Guard broker control.
page. You receive a message that your database has been shut down. Click the
Databases tab to return to the Databases page.
Database
In the practices for Lesson 6, “Creating a Logical Standby Database,” you use Enterprise
Manager Grid Control to create 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 Availability page.
3) Click Add Standby Database.
4) On the Add Standby Database page, select Create a new logical standby database
and click Continue.
7) On the Add Standby Database: Backup Options page, accept the default number of
Concurrent File Copy Processes. Enter the Primary Host Credentials (Username:
oracle and Password: oracle) and select Save as Preferred Credential. Click
Next.
8) On the Add Standby Database: Database Location page, enter pc<nn>sby3 in the
Instance Name field. Select the same host that you used for your physical standby
databases using the flashlight icon. Enter the Standby Host Credentials (Username:
oracle and Password: oracle) and select Save as Preferred Credential. Click
Next.
9) On the Add Standby Database: ASM Instance Login page, enter the password for the
SYS user (Password: oracle_4U) for the ASM instance on the standby host. Click
Login.
10) On the Add Standby Database: File Locations page, in the Standby Database File
Locations section, select the SBDAT ASM disk group for the Database Area using the
flashlight icon. Select the SBFRA ASM disk group for the Flash Recovery Area using
the flashlight icon. Leave all other settings at the default value and click Next.
11) On the Add Standby Database Configuration page, enter pc<nn>sby3 in the
Database Name, Database Unique Name, and Target Name fields. Select the Use
SYSDBA monitoring credentials option. Click Next.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Data Guard Administration
A - 80
SQL> @cr_emp_name
SQL> CREATE TABLE hr.emp_name
2 AS SELECT first_name, last_name
3 FROM hr.employees
4 WHERE 1=2
5 /
Table created.
4) Return to Enterprise Manager Grid Control and navigate to the Data Guard page.
5) Select your logical standby database and click Edit.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
System altered.
19) Invoke SQL*Plus on your logical standby database and log in as the HR user.
[oracle@EDBVR6P2-pc01sby3 ~]$ sqlplus hr/hr
SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 11 20:31:50
2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
20) Query the HR.EMP_NAME table to verify that no rows were inserted in the table.
SQL> SELECT count(*) FROM emp_name;
COUNT(*)
----------
0
21) Exit SQL*Plus on your standby database.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Data Guard Administration
A - 88
DGMGRL> exit
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
3) Verify that the database was successfully converted by executing the SHOW
CONFIGURATION command.
DGMGRL> show configuration
Configuration - DGConfig1
Configuration Status:
SUCCESS
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
SQL*Plus as the SYSDBA user. To demonstrate that redo data is being received by
the standby database, query
database and record the value in the on the snapshot standby
BLOCK# column:
__________________________
SQL>
2
from v$managed_standby
3 where client_process='LGWR';
STATUS SEQUENCE# BLOCK#
------------ ---------- ----------
IDLE 48 172
2) Invoke SQL*Plus in your primary database window and connect as SYSDBA. Insert a
row in the HR.REGIONS table on the primary database as follows. Exit SQL*Plus.
[oracle@EDBVR6P1-pc01prmy labs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 12 13:44:49
2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Commit complete.
3) Return to your SQL*Plus session in your standby database window. Insert a row in
the HR.REGIONS table on the snapshot standby database:
SQL>
2
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
1 row created.
VALUES (20, 'Australia');
REGION_ID REGION_NAME
---------- -------------------------
20 Australia
1 Europe
2 Americas
password oracle.
[oracle@EDBVR6P1-pc01prmy labs]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.1.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL>
Connected.
2) Convert the snapshot standby database back to a physical standby database.
DGMGRL> convert database pc01sby1 to physical standby;
Converting database "pc01sby1" to a Physical Standby database,
command.
Configuration - DGConfig1
6) Check the HR.REGIONS table to verify that the change made to the primary database
was propagated to the physical standby database and to verify that the row inserted in
the HR.REGIONS table when it was a snapshot standby database is no longer in the
table. Invoke DGMGRL in your standby database window and connect as the SYS
user.
[oracle@EDBVR6P2-pc01sby1 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.1.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
7) So that you can open the database to query the HR.REGIONS table, stop Redo
Apply. Exit DGMGRL.
DGMGRL>
Succeeded.
DGMGRL> exit
8) Invoke SQL*Plus in your standby database window and connect as the SYSDBA user.
Open the physical standby database in read-only mode.
[oracle@EDBVR6P2-pc01sby1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Feb 12 14:49:22
2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
10) Shut down the physical standby database and restart it in MOUNT mode. Exit
SQL*Plus.
SQL> shutdown immediate
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Database - pc01sby1
Configuration - DGConfig1
DGMGRL> show configuration
Configuration Status:
In the practices for Lesson 8, “Using Oracle Active Data Guard,” you enable Real-Time
Query and perform queries against your physical standby database while Redo Apply is
active. You also enable block change tracking.
In this practice, you enable Real-Time Query so that you can perform queries against
your physical standby database while Redo Apply is active.
1) In your standby database window, invoke DGMGRL and connect as the SYS user
with a password of oracle_4U.
[oracle@EDBVR6P2-pc01sby1 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.1.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Database - pc01sby1
Connected to:
SQL>
Disconnected from Oracle Database 11g Enterprise Edition
Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP,
6) In your standby database window, invoke DGMGRL and connect as the SYS user
with a password of oracle_4U.
[oracle@EDBVR6P2-pc01sby1 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.1.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL>
Connected.
DGMGRL>
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Database - pc01sby1
8) In your standby database window, invoke SQL*Plus and connect as SYSDBA. Query
the HR.REGIONS table.
[oracle@EDBVR6P2-pc01sby1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 15 13:40:14
2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL>
Commit complete.
10) Return to your standby database window and query the HR.REGIONS table again. In
your standby database, you should see the new row that you inserted in the
HR.REGIONS table on your primary database.
SQL> SELECT * FROM hr.regions;
REGION_ID REGION_NAME
---------- -------------------------
10 Australia
1 Europe
2 Americas
11) Return your physical standby database to MOUNT mode. Exit SQL*Plus.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
In this practice, you enable block change tracking on your physical standby database for
fast incremental backups.
1) In your physical standby database window, invoke SQL*Plus and connect to your
physical standby database as the SYSDBA user.
[oracle@EDBVR6P2-pc01sby1 labs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 15 13:47:17
2010
2) Use the your configuration. SHOW CONFIGURATION command to check the current protection
mode for
Configuration - DGConfig1
Protection Mode: MaxPerformance
Configuration Status:
SUCCESS
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4) Open another terminal window on your primary database host. Invoke SQL*Plus and
log in as the SYS user. Use the SHOW PARAMETER command to view the value of
LOG_ARCHIVE_DEST.
SQL> show parameter log_archive_dest
<< Output formatted below for display >>
NAME TYPE VALUE
--------------------- ------- ----------------------------
USE_DB_RECOVERY_FILE_DEST
5) Return to your DGMGRL window and set the LogXptMode database property to
SYNC for your pc<nn>sby1 database.
'LogXptMode'='SYNC';DGMGRL> edit database 'pc01sby1' set property
Property "LogXptMode" updated
DGMGRL>
mode.
Succeeded.
DGMGRL>
Configuration - DGConfig1
Protection Mode: MaxAvailability
11) Use the SHOW CONFIGURATION command to verify your change to the protection
mode.
DGMGRL> show configuration
Configuration - DGConfig1
Databases:
Configuration Status:
SUCCESS
5) Click the Standby Role Properties tab. Note down the Log Transport Mode setting
(displays as Redo Transport Mode in Enterprise Manager and LogXptMode in
DGMGRL): __________________________
8) On the Change Protection Mode: Select Mode page, select Maximum Availability
and click Continue.
10) On the Confirmation: Change Protection Mode page, click Yes. The Processing:
Change Protection Mode page is displayed.
13) Click the Data Guard link to return to the Data Guard Overview page.
14) For the best network performance in the classroom, change the protection mode for
the standby database back to maximum performance.
In the practices for Lesson 10, “Performing Role Transitions,” you perform a switchover
operation by using DGMGRL and Enterprise Manager Grid Control.
3) Connect to your database as the primary database. Exit SQL*Plus. SYSDBA user and perform a log
switch on your
SQL>
Connected.
System altered.
SWITCHOVER_STATUS
--------------------
TO STANDBY
-13SQL>
Disconnected from Oracle Database 11g Enterprise Edition
Release 11.2.0.1.0 - Production
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
6) Check the state, health, and properties of the primary database by using the SHOW
LsbyPreserveCommitOrder = ''
LsbyRecordSkipErrors = ''
LsbyRecordSkipDdl = ''
LsbyRecordAppliedDdl = ''
Oracle Database 11g: Data Guard Administration A - 118
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
8) Execute the switchover command to make your physical standby database your
primary database.
DGMGRL> switchover to pc01sby1
Performing switchover NOW, please wait...
New primary database "pc01sby1" is opening...
9) Execute the configuration: SHOW CONFIGURATION command to verify the status of the
DGMGRL> show configuration
Configuration - DGConfig1
edbvr6p1.us.oracle.com
[oracle@EDBVR6P2- ~]$
. oraenv
Manager
In this practice, you perform another switchover by using Enterprise Manager Database
Control to return to your original configuration.
1) Invoke Enterprise Manager Grid Control and log in as the SYSMAN user with the
password oracle1.
2) Navigate to the Databases page and select your new primary database
(pc<nn>sby1) by clicking the appropriate Name link.
4) Select your new physical standby database (pc<nn>prmy) and click Switchover.
Database altered.
6) Verify that the Flash Recovery Area size is 5 GB.
SQL> show parameter db_recovery_file_dest_size
db_recovery_file_dest_size
big integer 5G
Database
In this practice, you configure Flashback Database on your physical standby database.
1) Invoke DGMGRL and connect as the SYS user with a password of oracle_4U.
Disable Redo Apply (the MRP process). Exit from DGMGRL.
DGMGRL>
Connected.
DGMGRL>
Succeeded.
Database altered.
SQL>
Disconnected from Oracle Database 11g Enterprise Edition
Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP,
In the practices for Lesson 12, “Enabling Fast-Start Failover,” you enable fast-start
failover and test your implementation.
Configuration Status:
SUCCESS
3) Verify that the LogXptMode property is set to ASYNC for the primary database and
the physical standby database.
DGMGRL>
LogXptMode =
'ASYNC'
DGMGRL>
LogXptMode =
'ASYNC'
4) Set the fast-start failover threshold to 90 seconds.
DGMGRL> edit configuration
Threshold: 90 seconds
Target: pc01sby1
Observer: (none)
Lag Limit: 60 seconds (not in use)
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Configuration Status:
WARNING
Note: You start the observer in the next practice.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
3) Return to your DGMGRL session on your primary database system and verify the
status of your configuration.
DGMGRL> show configuration verbose
Configuration - DGConfig1
Threshold: 90 seconds
Target: pc01sby1
Observer: EDBVR6P2
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Lag Limit:
Shutdown Primary: TRUE
60 seconds
SUCCESS
Auto-reinstate:
Configuration Status:
TRUE
Practice 12-2: Starting the Observer (continued)
Threshold: 90 seconds
Target: pc01sby1
Observer: EDBVR6P2
Lag Limit: 60 seconds
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Configurable Failover Conditions
Health Conditions:
Corrupted Controlfile YES
Corrupted Dictionary YES
Inaccessible Logfile NO
Stuck Archiver NO
Datafile Offline YES
Oracle Error Conditions:
(none)
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Data Guard Administration
A - 133
Configuration - DGConfig1
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Database - pc01sby1
9) Start the instance and MOUNT the database. Note that you may see messages in the
observer window.
SQL> startup mount
ORACLE instance started.
Total System Global Area 439406592 bytes
Fixed Size 1337072 bytes
Variable Size 411044112 bytes
Database Buffers 20971520 bytes
Redo Buffers 6053888 bytes
Database mounted.
SQL>
10) Return to the DGMGRL session for your pc<nn>sby1 database and reinstate the
pc<nn>prmy database if needed. You receive an error if it is already reinstated.
DGMGRL> REINSTATE DATABASE 'pc01prmy';
Reinstating database "pc01prmy", please wait...
Reinstatement of database "pc01prmy" succeeded
Note: It may be necessary to repeat steps 8, 9, and 10 a second time.
11) Monitor the window that you started the observer in and note that the broker may be
reinstating the database for you.
15:27:50.07 Tuesday, February 23, 2010
Initiating reinstatement for database "pc01prmy"...
Reinstating database "pc01prmy", please wait...
Error: ORA-16657: reinstatement of database in progress
Configuration - DGConfig1
Databases:
Configuration Status:
SUCCESS
Configuration - DGConfig1
lagging
Configuration Status:
Threshold: 90 seconds
Target: pc01sby1
Observer: (none)
Lag Limit: 60 seconds
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Configurable Failover Conditions
Health Conditions:
Corrupted Controlfile YES
Corrupted Dictionary YES
Inaccessible Logfile NO
Stuck Archiver NO
Datafile Offline YES
Oracle Error Conditions:
(none)
5) Disable fast-start failover.
DGMGRL>
Disabled. ;
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Threshold: 90 seconds
Target: (none)
Observer: (none)
Lag Limit: 60 seconds
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Configurable Failover Conditions
Health Conditions:
Corrupted Controlfile YES
Corrupted Dictionary YES
Inaccessible Logfile NO
Stuck Archiver NO
Datafile Offline YES
Oracle Error Conditions:
(none)
Configuration - DGConfig1
In the practices for Lesson 13, “Managing Client Connectivity,” you implement client
failover methods.
4) Check to see if the listener knows about the new service by executing the lsnrctl
services command. Although you created the service, you have not yet started it,
so the listener does not know about it.
[oracle@EDBVR6P1-pc01prmy ~]$ lsnrctl services
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 17-FEB-
2010 16:23:50
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this
service...
...
LOCAL SERVER
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
...
5) Check to see if the listener knows about the new service by executing the lsnrctl
services command. Although you created the service, you have not yet started it,
so the listener does not know about it.
[oracle@EDBVR6P2-pc01sby1 ~]$ lsnrctl services listener1
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 23-FEB-
2010 17:30:29
Copyright (c) 1991, 2009, Oracle. All rights reserved.
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbvr6p2.us.oracle.cConnecting to
om)(PORT=12001)))
this service...
Instance "pc01sby1", status READY, has 1 handler(s) for this LOCAL SERVER
service...
6) Start the PC<nn>PROD service using the srvctl utility. The service should not
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
9) On the Address 2 tab, enter the fully qualified host name of the machine that your
physical standby database is on. Enter 12001 in the Port Number field.
10) Select File > Save Network Configuration to save the information to the
tnsnames.ora file.
11) Exit Oracle Net Manager.
12)Ensure that your updated
file contains an entry similar to the following for
PC<nn>PROD.
PC01PROD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)
(HOST = edbvr6p1.us.oracle.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)
(HOST = edbvr6p2.us.oracle.com)(PORT = 12001))
-133 (CONNECT_DATA =
(SERVICE_NAME = pc01prod.us.oracle.com)
)
)
)
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Grant succeeded.
2) On your physical standby database host, connect to the primary database as the
DGTEST user by using the pc<nn>PROD service.
[oracle@EDBVR6P2-pc01sby1 ~]$ sqlplus dgtest/dgtest@pc01prod
SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 18 18:20:49
2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
----------------------------------------------------------- HOST_NAME
EDBVR6P1
4) Query V$SESSION to determine how you are connected. You can use the
query_session.sql script.
SQL>
2
from v$session
3 where username = 'DGTEST';
5) Return to your primary database host and invoke DGMGRL. Connect as the SYS user
with a password of ORACLE and perform a switchover to your PC<nn>SBY1
database. It may be necessary to restart the instance. Exit from DGMGRL.
[oracle@EDBVR6P1-pc01prmy labs]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.1.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL>
Connected.
DGMGRL> switchover to pc01sby1;
Performing switchover NOW, please wait...
New primary database "pc01sby1" is opening...
Operation requires shutdown of instance "pc01prmy" on database
6) On your primary database host, check the listener services again. PC<nn>PROD is no
longer listed.
[oracle@edbvr6p1-pc01prmy labs]$ lsnrctl services
LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 20-FEB-
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2008 01:49:42
Copyright (c) 1991, 2007, Oracle. All rights reserved.
(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) Connecting to
----------------------------------------------------------- HOST_NAME
EDBVR6P2
10) Execute the database host. Note that lsnrctl services listener1 command on your original standby
PC01PROD is now started on this host.
[oracle@EDBVR6P2-pc01sby1 ~]$ lsnrctl services listener1
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 23-FEB-
2010 17:59:38
Copyright (c) 1991, 2009, Oracle. All rights reserved.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=edbvr6p2.us.oracle.cConnecting to
om)(PORT=12001)))
Services Summary...
Service "pc01prod.us.oracle.com" has 1 instance(s).
Instance "pc01sby1", status READY, has 1 handler(s) for this
service...
Instance "pc01sby1", status READY, has 1 handler(s) for this LOCAL SERVER
service...
Database dismounted.
4) Create a tablespace named RCTS to hold the recovery catalog data. Specify a data file
with the name '+DATA' and size 30 MB. You can use the rcts_create.sql
script.
SQL> set echo on
SQL> @rcts_create
SQL> create tablespace rcts
2 datafile '+DATA' size 30M
3 /
Tablespace created.
SQL>
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
RCTS tablespace to the user. You can use the rcowner_create.sql script.
SQL>
SQL> create user rcowner identified by rcpass
2 default tablespace rcts
3 quota unlimited on rcts
4 /
User created.
Grant succeeded.
7) Invoke RMAN and connect to the pcnndb11 database as the recovery catalog
owner. Remember that the password for RCOWNER is rcpass.
[oracle@EDBVR6P1-pc01db11 labs]$ rman catalog rcowner
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Feb
23 19:24:11 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All
rights reserved.
recovery catalog database Password:
connected to recovery catalog database
RMAN> exit
RMAN>
3) Register your primary database.
RMAN> register database;
5) Use the REPORT SCHEMA FOR DB_UNIQUE_NAME command to verify the files.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Oracle Database 11g: Data Guard Administration
A - 159
============================================================== PC01PRMY
Key Thrd Seq S Low Time
------- ---- ------- - ---------
261 1 35 A 23-FEB-10
+FRA/pc01prmy/archivelog/2010_02_23/thread_1_seq_35.376.711745 Name:
947
262 1 36 A 23-FEB-10
+FRA/pc01prmy/archivelog/2010_02_23/thread_1_seq_36.377.711745 Name:
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
...
981
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TOTO '%F'; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #BACKUPSET; # default
6) Use the REPORT SCHEMA command to view additional information about your
physical standby database.
Note: Your output may vary from this example and may not include the actual data
file names.
RMAN> report schema for db_unique_name pc01sby1;
Report of database schema for database with db_unique_name
PC01SBY1
List of Permanent Datafiles
A - 163
9) Execute the SHOW ALL command to view the configuration parameters for your
physical standby database.
RMAN> show all for db_unique_name pc01sby1;
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TOTO '%F'; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #BACKUPSET; # default
12) Set the archived log deletion policy to BACKED UP 1 TIMES TO DEVICE TYPE
DISK.
RMAN> configure archivelog deletion policy to backed up 1
5) In your primary database terminal window, display the data file in the labs
directory.
[oracle@EDBVR6P1-pc01prmy labs]$ ls -la example2.dbf
-rw-r----- 1 oracle dba 5251072 Feb 23 20:03 example2.dbf
6) Move the primary database. example2.dbf file to example2.sav to simulate a failure in the
Note: ASM prevents mistakes like this from happening!
[oracle@EDBVR6P1-pc01prmy labs]$
[oracle@EDBVR6P1-pc01prmy labs]$
8) Query the HR.EMPLOYEES2 table. Because you moved the data file, you receive an
error.
SQL> select count(*) from employees2;
select count(*) from employees2
*
using target database control file instead of recovery catalog Starting backup at 23-FEB-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=135 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006
name=+SBDAT/pc01sby1/datafile/example2.320.711748401
output file name=/home/oracle/labs/newex01.dbf
00571:===================================================== RMAN-
RMAN-00569:======== ERROR MESSAGE STACK FOLLOWS============
RMAN-00571:================================================
RMAN-03009: failure of switch command on default channel at
02/23/2010 20:17:23
ORA-19623: file 6 is open
16) Take the tablespace offline to perform step 11. Take the EXAMPLE tablespace offline.
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
17) Try once again to execute the SET NEWNAME and SWITCH DATAFILE commands.
RMAN>
2> set newname for datafile 6 to
'/home/oracle/labs/newex01.dbf';
3> switch datafile 6;
4> }
executing command: SET NEWNAME
RMAN-06169: could not read file header for datafile 6 error
RMAN>
Finished recover at 23-FEB-10
media recovery complete, elapsed time: 00:00:01
20) Again try to bring the EXAMPLE2 tablespace online. Exit from RMAN.
RMAN> sql 'alter tablespace example2 online';
sql statement: alter tablespace example2 online
RMAN> exit
21) Invoke SQL*Plus and connect as the HR user. Query HR.EMPLOYEES21 again.
COUNT(*)
----------
107
22) You now need to recover the same data file on the pc<nn>sby3 database. Open a
terminal window to your standby host and set the environment variables.
[oracle@EDBVR6P2-pc03sby1 ~]$pc01sby3. oraenv
ORACLE_SID = [pc03sby1] ?
using target database control file instead of recovery catalog Starting recover at 24-FEB-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=158 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 24-FEB-10
RMAN> exit
In this practice, you use Enterprise Manager Grid Control to view information about Log
Transport and Log Apply services.
1) On the Data Guard Overview page, click Log File Details in the Performance
section.
3) Invoke DGMGRL on your primary database host and log in as SYS with a password
oracle.
[oracle@EDBVR6P1-pc01prmy ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.1.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Connected.
DGMGRL>
4) Set the state of your physical standby database to APPLY-OFF.
Succeeded. DGMGRL> edit database 'pc01sby1' set state='APPLY-OFF';
5) Exit DGMGRL.
6) Invoke SQL*Plus on your primary database host and log in as SYS with a password
password oracle.
11) Set the state of your physical standby database to APPLY-ON.
DGMGRL>
Succeeded.
12) Exit DGMGRL.
13) Return to Enterprise Manager Grid Control and refresh your page. Note the status of
Log Apply Services. All logs should have been received and applied.
Configuration - DGConfig1
Production
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
6) Click the ORA-16766: Redo Apply is stopped link in the Data Guard Status column.
7) Click the Reset button to restart Redo Apply.
Configuration - DGConfig1
Protection Mode: MaxPerformance
Configuration
In the practice for Lesson 17, “Optimizing a Data Guard Configuration,” you configure
network compression of redo data.
LOG_ARCHIVE_DEST_31 DISABLE
31 rows selected.
2) Invoke DGMGRL on your primary database host.
[oracle@EDBVR6P1-pc01prmy ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.1.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
4) Return to your SQL*Plus session and query V$ARCHIVE_DEST again. Note that
compression is set for LOG_ARCHIVE_DEST_1.
-
93SQL>
2
from v$archive_dest;
HESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
DEST_NAME
LOG_ARCHIVE_DEST_2
------------------------------ -------
LOG_ARCHIVE_DEST_1
COMPRES
ENABLE
DISABLE