2013년 11월 21일 목요일

Configure Protection Mode & Fast-Start Failover , Observer Start

  • Setting the Configuration Protection Mode
DGMGRL> EDIT DATABASE 'SUICAPR' SET PROPERTY 'LogXptMode'='SYNC';
DGMGRL> EDIT DATABASE 'SUICASB' SET PROPERTY 'LogXptMode'='SYNC';
DGMGRL> EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;
  • Setting Database Properties
EDIT DATABASE 'SUICAPR' SET PROPERTY 'StaticConnectIdentifier' = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=suica-1.gamechu.jp)(PORT=1543))(CONNECT_DATA=(SERVICE_NAME=SUICAPR_DGB)(INSTANCE_NAME=SUICAPR)(SERVER=DEDICATED)))';

EDIT DATABASE 'SUICASB' SET PROPERTY 'StaticConnectIdentifier' = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=suica-2.gamechu.jp)(PORT=1543))(CONNECT_DATA=(SERVICE_NAME=SUICASB_DGB)(INSTANCE_NAME=SUICASB)(SERVER=DEDICATED)))';
 
  • Enable Flashback Database on the primary and target standby databases
ALTER SYSTEM SET UNDO_RETENTION=3600 SCOPE=SPFILE;
ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' SCOPE=SPFILE;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
SHOW PARAMETER UNDO;
ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320 SCOPE=BOTH;
ALTER DATABASE ARCHIVELOG;
--ALTER SYSTEM SET db_recovery_file_dest_size=<size>;
--ALTER SYSTEM SET db_recovery_file_dest=<directory-specification>;
ALTER DATABASE FLASHBACK ON;
ALTER DATABASE OPEN;
----
scope = both : memory, spfile => 현재 적용
scope = spfile : spfile => db restart 후 적용
ALTER SYSTEM SET UNDO_RETENTION=3600 scope=both;
ALTER SYSTEM SET UNDO_MANAGEMENT='AUTO' scope=spfile;
ALTER SYSTEM SET db_recovery_file_dest_size=100G scope=both;
ALTER SYSTEM SET db_recovery_file_dest='/backup/flash_recovery_area' scope=both;
alter system set db_domain='' scope=spfile;

-------------------------------------------------
col db_unique_name for a10
col protection_mode for a20
col flashback_on for a10
col open_mode for a10
col database_role for a20
SELECT DB_UNIQUE_NAME,PROTECTION_MODE,FLASHBACK_ON,OPEN_MOdE,DATABASE_ROLE FROM V$DATABASE
  • enable Fast-Start Failover
DGMGRL>enable fast_start failover;
show fast_start failover;
-- trouble shoot
start observer 
Oracle Error : DGM-16954: Unable to open and lock the Observer configuration file

Cause: The Observer configuration file cannot be opened or cannot be locked for exclusive access.

Action: Make sure the Observer has the correct operating system privileges to write the file and there is no other Observer that is using the same file. Try the command again.

  • ★★★★★ Execute SwitchOver ★★★★★
-- in primary
[oracle@suica-1 ~]$ dgmgrl /DGMGRL> show configuration
Configuration - SUICA
  Protection Mode: MaxAvailability
  Databases:
    SUICAPR - Primary database
    SUICASB - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS

DGMGRL> switchover to 'SUICASB'
shutdown immediate;
--startup nomount;
--alter database mount standby database;
alter database open;

  • ★★★★★ Execute Fast-Start Failover ★★★★★
-- primary
sql> shutdown abort
-- new primary
DGMGRL> reinstate database 'SUICAPR';show configuration;
Configuration - SUICA
  Protection Mode: MaxAvailability
  Databases:
    SUICASB - Primary database
    SUICAPR - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS
 
DGMGRL> show fast_start failover
Fast-Start Failover: ENABLED
  Threshold:        30 seconds
  Target:           SUICASB
  Observer:         (none)
  Lag Limit:        30 seconds (not in use)
  Shutdown Primary: TRUE
  Auto-reinstate:   TRUE
Configurable Failover Conditions
  Health Conditions:
    Corrupted Controlfile          YES
    Corrupted Dictionary           YES
    Inaccessible Logfile            NO
    Stuck Archiver                  NO
    Datafile Offline               YES
  Oracle Error Conditions:
    (none)
 

  • start observer
start observer file="/oracle/orabase/observer/suica_fsfo.dat"
start observer file="/oracle/orabase/observer/tomato_fsfo.dat"
 
oracle   21957     1  0 Sep07 ?        00:00:01 dgmgrl -logfile /oracle/orabase/observer/suica.log                    START OBSERVER FILE='/oracle/orabase/observer/suica.dat';
oracle   21991     1  0 Sep07 ?        00:00:02 dgmgrl -logfile /oracle/orabase/observer/tomato.log                     START OBSERVER FILE='/oracle/orabase/observer/tomato.dat';
 
------ troubleshoot
dgmgrl /
[P001 08/19 16:03:40.45] Authentication failed.
DGM-16979: Unable to log on to the primary or standby database as SYSDBA
Failed.
answer>
dgmgrl>connect sys/xxxxx@suicapr
--------
DGM-16954: Unable to open and lock the Observer configuration file
Failed.
Cause: The Observer configuration file cannot be opened or cannot be locked for exclusive access.

Action: Make sure the Observer has the correct operating system privileges to write the file and there is no other Observer that is using the same file. Try the command again.
 

댓글 없음:

댓글 쓰기