'데이터 가드'에 해당되는 글 1건

 

1.ADG DGMGRL

  • Data Guard 를 관리하기 위한 CLI (command line interface) 이다.

    수동으로 관리하게 되면 장애시점에서 수동으로 Primary, standby를 바꿔줘야 하지만 한번 설정하게 되면 자동으로 관리를 해주는 controller입니다.

       

2.DGMGRL 접속 및 명령어

localhost@orcl : /home/oracle> dgmgrl sys/oracle

DGMGRL for Linux: Version 11.2.0.3.0 - Production

   

Copyright (c) 2000, 2009, Oracle. All rights reserved.

   

Welcome to DGMGRL, type "help" for information.

Connected.

DGMGRL>

DGMGRL>

DGMGRL> help

   

The following commands are available:

   

add Adds a standby database to the broker configuration

connect Connects to an Oracle database instance

convert Converts a database from one type to another

create Creates a broker configuration

disable Disables a configuration, a database, or fast-start failover

edit Edits a configuration, database, or instance

enable Enables a configuration, a database, or fast-start failover

exit Exits the program

failover Changes a standby database to be the primary database

help Displays description and syntax for a command

quit Exits the program

reinstate Changes a database marked for reinstatement into a viable standby

rem Comment to be ignored by DGMGRL

remove Removes a configuration, database, or instance

show Displays information about a configuration, database, or instance

shutdown Shuts down a currently running Oracle database instance

sql Executes a SQL statement

start Starts the fast-start failover observer

startup Starts an Oracle database instance

stop Stops the fast-start failover observer

switchover Switches roles between a primary and standby database

   

Use "help <command>" to see syntax for individual commands

   

DGMGRL>

   

   

3.DGMGRL Configuration 생성

[Primary DB]

   

ocp@orcl : /home/oracle> dgmgrl sys/oracle

DGMGRL for Linux: Version 11.2.0.3.0 - Production

   

Copyright (c) 2000, 2009, Oracle. All rights reserved.

   

Welcome to DGMGRL, type "help" for information.

Connected.

   

DGMGRL>

create configuration 'test_DG' as

primary database is 'orcl'

connect identifier is 'orcl';

   

Error:

ORA-16525: the Data Guard broker is not yet available

ORA-06512: at "SYS.DBMS_DRS", line 157

ORA-06512: at line 1

   

[해결방안]

Database dg_broker_start 모두 false이므로 위와 같은 Error 발생함.

Primary, standby 모두 true 변경(DG Broker start)

Alter system set dg_broker_start=true;

   

DGMGRL> show configuration;

   

Configuration - test_DG

   

Protection Mode: MaxPerformance

Databases:

orcl - Primary database

   

Fast-Start Failover: DISABLED

   

Configuration Status:

DISABLED

   

  

[Primary DB] - standby DB 추가

   

DGMGRL>

add database 'stby' as

connect identifier is 'stby';

   

Database "stby" added

   

   

DGMGRL> show configuration;

   

Configuration - test_DG

   

Protection Mode: MaxPerformance

Databases:

orcl - Primary database

stby - Physical standby database

   

Fast-Start Failover: DISABLED

   

Configuration Status:

DISABLED

   

DGMGRL> enable configuration;

Enabled.

   

DGMGRL> show configuration;

   

Configuration - test_DG

   

Protection Mode: MaxPerformance

Databases:

orcl- Primary database

stby- Physical standby database

   

Fast-Start Failover: DISABLED

   

Configuration Status:

SUCCESS

  

   

   

4.DGMGRL Switch Over

  • 장애가 발생할 경우 Primary DB-> standby DB Switch Over 기능

DGMGRL> switchover to stby;

Performing switchover NOW, please wait...

New primary database "stby" is opening...

Operation requires shutdown of instance "orcl" on database "orcl"

Shutting down instance "orcl"...

ORACLE instance shut down.

Operation requires startup of instance "orcl" on database "orcl"

Starting instance "orcl"...

ORACLE instance started.

Database mounted.

Database opened.

Switchover succeeded, new primary is "stby"

   

   

[참고문헌]

http://h391106.tistory.com/231

http://docs.oracle.com/cd/B19306_01/server.102/b14239/concepts.htm

http://h391106.tistory.com/238

http://download.oracle.com/docs/cd/E11882_01/server.112/e17023/dgmgrl.htm

   

블로그 이미지

운명을바꾸는자

IT와 함께 살아가는 삶

,