Description
There are many ways to create dataguard, this article is divided into one of the ways, 10g/11g are applicable.
This paper creates an Oracle 11g Dataguard physical repository through the Rman target Master library and the local auxiliary library through a local backup recovery data file.
First, the environment introduction
1. Primary database environment
Operating system version: OEL5.8 x64
Database version: Oracle 11.2.0.3 x64
Database name: ORCL
Database SID:ORCL
Db_unique_name:orcl
Instance_name:orcl
2. Prepare the Storehouse environment
Operating system version: OEL5.8 x64
Database version: Oracle 11.2.0.3 x64 (Oracle database software only installed, no NETCA DBCA)
Database name: Slave
Database Sid:slave
Db_unique_name:slave
Instance_name:slave
3. Dataguard Boot Sequence
Boot sequence: First set up the library, and then restart the main library
Off order: First off Main library, after Guan Beiku
Second, the primary database environment preparation
1. Main Library Environment contrast
Re-create password file
# su-oracle
$ orapwd file= '/U01/APP/ORACLE/PRODUCT/11.2.0/DB_1/DBS/ORAPWORCL ' password=oracle entries=10 force=y
2. Modify configuration Lisener listening files
Note: Add DGMGRL static listener configuration to lay the groundwork for the later DG broker configuration.
More Wonderful content: http://www.bianceng.cn/database/Oracle/
$ cat/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
LISTENER =
(Description_list =
(DESCRIPTION =
(address = (PROTOCOL = TCP) (HOST = 192.168.233.200) (PORT = 1521))
(address = (PROTOCOL = IPC) (KEY = EXTPROC1521))
)
)
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Global_dbname = ORCL)
(Oracle_home =/u01/app/oracle/product/11.2.0/db_1)
(Sid_name = ORCL)
)
)
Adr_base_listener =/u01/app/oracle
4. Modify Configuration Tnsname.ora File
Description: ORCL is the service name of the main library, and DG is the service name of the standby library.
$ vi/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
ORCL =
(DESCRIPTION =
(address = (PROTOCOL = TCP) (HOST = 192.168.233.200) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = ORCL)
)
)
SLAVE =
(DESCRIPTION =
(address = (PROTOCOL = TCP) (HOST = 192.168.233.150) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = slave)
)
)
5. Modify the configuration of the stereotypes file mode
1), check whether the database is in the file state
sql> archive log list;
sql> shutdown immediate;
sql> startup Mount;
sql> ALTER DATABASE Archivelog;
sql> ALTER DATABASE open;
2), the main library is set to FORCE LOGGING mode
sql> ALTER DATABASE force logging;
Sql> select force_logging from V$database;
For
---
YES
6. Modify the main library parameter file
Sql>
Alter system set Instance_name= ' ORCL ' scope=spfile;
Alter system set Db_unique_name= ' ORCL ' scope=spfile;
Alter system set local_listener= ' ORCL ' scope=spfile;
Alter system set log_archive_config= ' dg_config= (orcl,slave) ';
Alter system set log_archive_dest_1= ' Location=/u01/archivelog/valid_for= (all_logfiles,all_roles) db_unique_name= Orcl ' Scope=spfile;
Alter system set log_archive_dest_2= ' Service=slave lgwr async valid_for= (online_logfiles,primary_role) db_unique_name =slave ' Scope=spfile;
Alter system set log_archive_format= ' Arch_%r_%t_%s.arc ' scope=spfile;
Alter system set fal_client= ' ORCL ' scope=spfile;
Alter system set fal_server= ' slave ' scope=spfile;
alter system set Standby_file_management=auto;
ALTER DATABASE ADD standby logfile Group 4 '/u01/app/oracle/oradata/orcl/standby_redo04.log ' size 50M;
ALTER DATABASE ADD standby logfile Group 5 '/u01/app/oracle/oradata/orcl/standby_redo05.log ' size 50M;
ALTER DATABASE ADD standby logfile Group 6 '/u01/app/oracle/oradata/orcl/standby_redo06.log ' size 50M;
ALTER DATABASE ADD standby logfile Group 7 '/u01/app/oracle/oradata/orcl/standby_redo07.log ' size 50M;
sql> shutdown immediate;
Sql> startup;
#准备一些测试数据, just create a table structure