Logical standby is built on physical standby
Oracle10g Physical DataGuard detailed construction process
-- Stop the log application on standby
SQL> alter database recover managed standby database cancel;
Database altered.
-- Modify the log_archive_dest_3 parameter of the master database. The online log archiving path is used when the master database is switched to the slave database.
SQL> alter system set log_archive_dest_3 = 'location =/u01/app/oracle/oradata/dbserver/arch valid_for = (standby_logfiles, standby_role) db_unique_name = dbserver ';
System altered.
SQL> alter system set log_archive_dest_state_3 = enable;
System altered.
-- The master database is executed, and alert. log displays Logminer Bld: Done
SQL> execute dbms_logstdby.build;
PL/SQL procedure successfully completed.
-- Modify the log_archive_dest_3 parameter of the standby database, and archive the online logs of the standby Database
SQL> alter system set log_archive_dest_3 = 'location =/u01/app/oracle/oradata/standby/arch valid_for = (standby_logfiles, standby_role) db_unique_name = standby ';
System altered.
SQL> alter system set log_archive_dest_state_3 = enable;
System altered.
-- If the standby database does not have a temporary tablespace, it needs to be created.
-- Convert the physical standby database to the logical standby database on the standby end. The last standby is the name of the logical standby database.
SQL> select status from v $ instance;
STATUS
------------
MOUNTED
SQL> select database_role from v $ database;
DATABASE_ROLE
----------------
PHYSICAL STANDBY
SQL> startup mount force
ORACLE instance started.
Total System Global Area 612368384 bytes
Fixed Size 2085872 bytes
Variable Size 167775248 bytes
Database Buffers 436207616 bytes
Redo Buffers 6299648 bytes
Database mounted.
SQL> alter database recover to logical standby;
Database altered.
SQL> select status from v $ instance;
STATUS
------------
STARTED
SQL> startup mount force
ORACLE instance started.
Total System Global Area 612368384 bytes
Fixed Size 2085872 bytes
Variable Size 167775248 bytes
Database Buffers 436207616 bytes
Redo Buffers 6299648 bytes
Database mounted.
SQL> select database_role from v $ database;
DATABASE_ROLE
----------------
LOGICAL STANDBY
SQL> alter database open resetlogs;
Database altered.
SQL> select name from v $ database;
NAME
---------
STANDBY
-- Switch logfile in the master database
SQL> alter system switch logfile;
System altered.
SQL>/
System altered.
SQL>/
System altered.
SQL>/
System altered.
SQL>/
System altered.
SQL>/
System altered.
-- Standby alert. log
RFS [3]: Assigned to RFS process 10806
RFS [3]: Identified database type as 'logical standby'
Mon Mar 3 13:10:28 2014
RFS LogMiner: Client enabled and ready for notification
RFS [3]: Successfully opened standby log 6: '/u01/app/oracle/oradata/standby/standby03.log'
Mon Mar 3 13:10:28 2014
RFS LogMiner: Client enabled and ready for notification
Mon Mar 3 13:11:21 2014
RFS LogMiner: Client enabled and ready for notification
Mon Mar 3 13:11:22 2014
Primary database is in maximum performance mode
RFS [2]: Successfully opened standby log 5: '/u01/app/oracle/oradata/standby/standby02.log'
Mon Mar 3 13:11:33 2014
RFS LogMiner: Client enabled and ready for notification
Mon Mar 3 13:11:34 2014
Primary database is in maximum performance mode
RFS [2]: Successfully opened standby log 5: '/u01/app/oracle/oradata/standby/standby02.log'
-- Enable real-time applications in the standby Database
SQL> alter database start logical standby apply immediate;
Database altered.