[Oracle] Data Guard series (5)-create a logical standby Database

Source: Internet
Author: User

[Oracle] Data Guard series (5)-create a logical standby database 1. stop the log application service [SQL] SYS @ jkka> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; Database altered on the physical STANDBY DATABASE. 2. reset the master database to prepare for future role conversion (switchover). The logical standby database is different from the physical standby database. logs are generated during SQL application, that is, online redo logs of the logical Standby database. Therefore, the logical Standby database must not only archive the Standby logs transmitted from the primary database, but also archive the online logs generated by the Standby database. Next we assume that log_archive_dest_1 specifies the archiving path of standby logs, and log_archive_dest_3 specifies the archiving path of online logs. Although the master database does not need to configure two archive paths, we recommend that you configure them in the master database to facilitate possible role conversion in the future. First, check the log_archive_dest_1 of the current master database: [SQL] SYS @ JKKA> show parameter log_archive_dest_1 NAME TYPE VALUE =----------- invalid parameter string location =/data/oradata/jkka/archivelog valid_for = (all_logfiles, all_roles) db_unique_name = jkka the valid_for attribute must be modified to only apply to online logs: [SQL] SYS @ JKKA> alter system set log_archive_dest_1 = 'location =/data/oradata/jkka /Archivelog valid_for = (online_logfiles, all_roles) db_unique_name = jkka '; System altered. then create a standby archive directory on the OS, and the newly added log_archive_dest_3 points to it: [SQL] SYS @ JKKA> alter system set log_archive_dest_3 = 'location =/data/oradata/jkka/archstandby VALID_FOR = (STANDBY_LOGFILES, STANDBY_ROLE) DB_UNIQUE_NAME = jkka '; System altered. SYS @ JKKA> alter system set log_archive_dest_state_3 = enable; System altered. 3. build a LogMiner dictionary in the master database [SQL] SYS @ JKKA> EXECUTE DBMS_LOGSTDBY.BUILD; PL/SQL procedure successfully completed. 4. convert a physical standby database to a logical standby Database [SQL] SYS @ jkka> ALTER DATABASE RECOVER TO LOGICAL STANDBY jkka2; Database altered. note: The preceding jkka2 is the db_name of the new logical standby database. It must be different from the db_name of the primary database, which is different from the physical standby database. After the preceding statement is executed successfully, the db_name of the standby database is changed to the new name jkka2, the Standby database is closed, and the database is restarted to the mount state for the modification to take effect: [SQL] SQL> shutdown immediate SQL> startup mount 5. this step is similar to step 2. First, check the configuration of the current log_archive_dest_1: [SQL] NAME TYPE VALUE types ------------------------------------ log_archive_dest_1 string location =/data/oradata/jkka/archivelog valid_for = (all_logfiles, all_roles) db_unique_name = jkka2 the valid_for attribute must be modified to only apply to online logs: [SQL] SYS @ jkka> alter system set log_archive_dest_1 = 'location =/data/oradata/jkka/archivelog valid_for = (online_logfiles, all_roles) db_unique_name = jkka2; System altered. token remains unchanged: [SQL] name type value types ------------- export log_archive_dest_2 string service = jkkapri ASYNC VALID_FOR = (ONLINE_LOGFILES, PRIMARY_ROLE) db_unique_name = jkka creates a standby archive directory on the OS, the new log_archive_dest_3 points to it: [SQL] SYS @ jkka> alter system set log_archive_dest_3 = 'location =/data/oradata/jkka/archstandby VALID_FOR = (STANDBY_LOGFILES, STANDBY_ROLE) DB_UNIQUE_NAME = jkka2 '; System altered. SYS @ jkka> alter system set log_archive_dest_state_3 = enable; System altered. 6) You have enabled the logical standby database in resetlogs mode [SQL] alter DATABASE open resetlogs; ALTER database START LOGICAL STANDBY APPLY IMMEDIATE;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.