Oracle-dataguard series: The logical standby constructs

Source: Internet
Author: User

Get ready:

Confirm objects and statements can be standby supported

Make sure that the rows of the tables in the primary library can be uniquely identified

Environment:

Operating system: RED HAT LINUX ENTERPRISE 5

oracle:11.2.0.1.0

PRIMARY:

ip:192.168.1.11

Sid:test

Db_unique_name:test

Installation path:/oracle/oracle/product/11.2.0/dbhome_1

Local Archive path:/oracle/oradata/test/archive

Physics STANDBY:

ip:192.168.1.12

Sid:dgtest

Db_unique_name:dgtest

Installation path:/oracle/oracle/product/11.2.0/dbhome_1

Local Archive path:/oracle/oradata/dgtest/dgtest/archive

LOGICAL STANDBY:

ip:192.168.1.15

Sid:logicdg

Db_unique_name:logicdg

Installation path:/oracle/oracle/product/11.2.0/dbhome_1

Local Archive path:/oracle/oradata/logicdg/local-archive

This example tests the use of physical standby logic standby to add a logical standby to an already existing dataguard environment.

The original Dataguard environment can refer to:

http://xin23.blog.51cto.com/1827266/504066

The process of creating a new physical standby can also be referenced in this article. No longer repeat here.

The current environment is:

primary:192.168.1.11

physics:192.168.1.12

Logical:192.168.1.15 (currently a physical standby. Pending conversion)

1. Modify the primary initialization parameter file (only the modified part is listed)

*.log_archive_dest_state_2=defer

*.log_archive_dest_state_3=defer

*.log_archive_config= ' dg_config= (TEST,DGTEST,LOGICDG) '

*.log_archive_dest_2= ' service=test12 arch valid_for= (online_logfiles,primary_role) db_unique_name=dgtest '

*.log_archive_dest_3= ' service=test15 arch valid_for= (online_logfiles,primary_role) DB_UNIQUE_NAME=LOGICDG '

*.fal_server=test11

*.fal_client=test12

*.standby_file_management=auto

*.db_file_name_convert= '/oracle/oradata/test ', '/oracle/oradata/dgtest/dgtest ', '/oracle/oradata/test ', '/

ORACLE/ORADATA/LOGICDG '

*.log_file_name_convert= '/oracle/oradata/test ', '/oracle/oradata/dgtest/dgtest ', '/oracle/oradata/test ', '/

ORACLE/ORADATA/LOGICDG '

2. View two physical standby sync states

Physics> select sequence#,applied from V$archived_log;

sequence# applied

---------- ---------

YES

YES

YES

YES

YES

YES

YES

7 rows selected.

-----------------------------------------------------------------------------

Logical> select sequence#,applied from V$archived_log;

sequence# applied

---------- ---------

YES

YES

YES

YES

YES

YES

6 rows selected.

3. Canceling the redo application of the physical standby to be converted

logical> ALTER DATABASE recover managed standby database cancel;

Database altered.

4.primary Dictionary of data generation

Primary> Execute dbms_logstdby.build;

Pl/sql procedure successfully completed.

5. Convert physical standby to logical standby

Logical> ALTER DATABASE recover to logical standby LOGICDG;

Database altered.

logical> shutdown Immediate

Ora-01507:database not mounted

ORACLE instance shut down.

Logical> Startup Mount

ORACLE instance started.

Total System Global area 2488635392 bytes

Fixed Size 2215904 bytes

Variable Size 1392508960 bytes

Database buffers 1090519040 bytes

Redo buffers 3391488 bytes

Database mounted.

6. Adjust the initialization parameters of standby

Logical> alter system set log_archive_dest_1= ' Location=/oracle/oradata/logicdg/local-archive valid_for= (online_ Logfiles,all_roles)

2 DB_UNIQUE_NAME=LOGICDG ';

System altered.

Logical> alter system set log_archive_dest_5= ' Location=/oracle/oradata/logicdg/archive valid_for= (standby_ Logfiles,standby_role)

2 DB_UNIQUE_NAME=LOGICDG ';

System altered.

7.resetlogs Way to open a database

logical> ALTER DATABASE open resetlogs;

Database altered.

8. Application Redo

Create Standby Redologs

logical> ALTER DATABASE Add standby logfile Group One '/oracle/oradata/logicdg/standbyredo11.log ' size 100m;

Database altered.

logical> ALTER DATABASE Add standby logfile Group '/oracle/oradata/logicdg/standbyredo12.log ' size 100m;

Database altered.

logical> ALTER DATABASE Add standby logfile Group '/oracle/oradata/logicdg/standbyredo13.log ' size 100m;

Database altered.

Start Redo real-time application

Logical> ALTER DATABASE start logical standby apply immediate;

Database altered.

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.