Oracle 11gR2 logical standby Database Construction

Source: Internet
Author: User

Oracle 11.2.0.1 logical standby database environment setup

First, create a physical standby database. After creating a physical standby database, it is best to create a separate spfile.

Stop the redo application on the physical standby Database

Alter database recover managed STANDBY database cancel;

When logminer is generated on the master database, several switching logs are generated and the error is ignored.

Execute dbms_logstdby.build;

Convert physical standby database to logical standby Database

Alter database recover to logical standby orcl; <-- db_name Parameter

Shutdown immediate

Startup mount

SELECT db_unique_name, open_mode, database_role, switchover_status, guard_status, protection_mode from v $ DATABASE;

Rebuilding the password file of the logical standby on the slave Database

Orapwd file = $ ORACLE_HOME/dbs/orapwstby password = oracle entries = 5 ignorecase = y force = y

Modify parameters on the slave Database

Alter system set log_archive_dest_1 = 'location =/u01/oradata/arch/stby valid_for = (online_logfiles, all_roles) db_unique_name = stby ';

Alter system set log_archive_dest_2 = 'location =/u01/oradata/arch valid_for = (standby_logfiles, standby_roles) db_unique_name = stby ';

Create backup log on the slave Database

Alter database add standby logfile group 4 ('/u01/oradata/stby/standbylj01.log') size 20 M reuse;

Alter database add standby logfile group 5 ('/u01/oradata/stby/standbylj02.log') size 20 M reuse;

Alter database add standby logfile group 6 ('/u01/oradata/stby/standbylj03.log') size 20 M reuse;

Select member from v $ logfile;

Enable logical standby on the slave Database

Alter database open resetlogs;

Alter database start logical standby apply immediate;

Slave database check

Select instance_name, status from v $ instance;

SELECT db_unique_name, open_mode, database_role, switchover_status, guard_status, protection_mode from v $ DATABASE;

Select group #, sequence #, used, status from v $ standby_log;

Test

Create on master database

Create table scott. t4 (id int );

Insert into scott. t4 values (4 );

Commit;

Alter system switch logfile;

Query on the logical standby database later

Select * from scott. t4;

Related Article

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.