вторник, 26 октября 2010 г.

Data Guard Broker



1. На primary:

[oradb]$ more listener.ora
SID_LIST_LISTENERDGMGRL=
(SID_LIST=
(SID_DESC=
(SID_NAME=testasm)
(GLOBAL_DBNAME=testasm_p_DGMGRL.mydomain.com)
(ORACLE_HOME=/u01/app/oradb/product/10.2.0/db_1)
)
)

LISTENERDGMGRL =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = server-1.mydomain.com)(PORT = 1522))
)
)

[oradb]$ more tnsnames.ora
TESTASM_P =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = server-1.mydomain.com)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testasm_p_DGMGRL.mydomain.com)
)
)

TESTASM_S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = server-2.mydomain.com)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testasm_s_DGMGRL.mydomain.com)
)
)

[oradb]$


2. На standby

[oradb]$ more listener.ora
SID_LIST_LISTENERDGMGRL=
(SID_LIST=
(SID_DESC=
(SID_NAME=testasm)
(GLOBAL_DBNAME=testasm_s_DGMGRL.mydomain.com)
(ORACLE_HOME=/u01/app/oradb/product/10.2.0/db_1)
)
)

LISTENERDGMGRL =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = server-2.mydomain.com)(PORT = 1522))
)
)
[oradb]$

[oradb]$ more tnsnames.ora
TESTASM_P =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = server-1.mydomain.com)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testasm_p_DGMGRL.mydomain.com)
)
)

TESTASM_S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = server-2.mydomain.com)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testasm_s_DGMGRL.mydomain.com)
)
)

[oradb]$


3. Создание конфигурации

на primary:

SQL> show parameter DG_BROKER_START

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_start boolean FALSE

SQL> alter system set DG_BROKER_START=true scope=both;

System altered.

SQL> show parameter DG_BROKER_START

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_start boolean TRUE

SQL> exit

на standby:

SQL> show parameter DG_BROKER_START

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_start boolean FALSE

SQL> alter system set DG_BROKER_START=true scope=both;

System altered.

SQL> show parameter DG_BROKER_START

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_start boolean TRUE

SQL>


[oradb]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.4.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@TESTASM_P
Connected.
DGMGRL> create configuration 'brokerdg' as
> primary database is testasm_p
> connect identifier is TESTASM_P;

Configuration "brokerdg" created with primary database "testasm_p"
DGMGRL>


DGMGRL> add database testasm_s as
> connect identifier is TESTASM_S
> maintained as physical;

Database "testasm_s" added
DGMGRL>
DGMGRL> show configuration

Configuration
Name: brokerdg
Enabled: NO
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
testasm_p - Primary database
testasm_s - Physical standby database

Current status for "brokerdg":
DISABLED

DGMGRL> enable configuration;
Enabled.
DGMGRL>
DGMGRL> show configuration

Configuration
Name: brokerdg
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
testasm_p - Primary database
testasm_s - Physical standby database

Current status for "brokerdg":
SUCCESS
DGMGRL>

DGMGRL> switchover to testasm_p
Performing switchover NOW, please wait...
Operation requires shutdown of instance "testasm" on database "testasm_s"
Shutting down instance "testasm"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires shutdown of instance "testasm" on database "testasm_p"
Shutting down instance "testasm"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "testasm" on database "testasm_s"
Starting instance "testasm"...
ORACLE instance started.
Database mounted.
Operation requires startup of instance "testasm" on database "testasm_p"
Starting instance "testasm"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "testasm_p"
DGMGRL>

4.Удаление конфигурации

[oradb]$ dgmgrl
DGMGRL for Linux: Version 10.2.0.4.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@TESTASM_P
Connected.
DGMGRL> show configuration;

Configuration
Name: brokerdg
Enabled: YES
Protection Mode: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
testasm_p - Primary database
testasm_s - Physical standby database

Current status for "brokerdg":
SUCCESS

DGMGRL> REMOVE DATABASE testasm_s;
Removed database "testasm_s" from the configuration
DGMGRL> REMOVE CONFIGURATION;
Removed configuration
DGMGRL> show configuration;
Error: ORA-16532: Data Guard broker configuration does not exist

Configuration details cannot be determined by DGMGRL
DGMGRL>


Комментариев нет:

Отправить комментарий