Oracle 11g ile gelen çok güzel ve kullanışlı bir özelliktir.Bu özellik ile yedek database (physical standby darabase ) de, okuma ve yazma işlemi yapabiliriz.Snapshot Standby Database ,physical standby database in read-write moda alınmasıyla elde edilir.Snapshot standby da ,loglar alınır arşivlenir fakat uygulanmaz. Snapshot Standby Physical Standby a dönüştürüldüğü andan itibaren loglar uygulanmaya başlar.
Physical Standby Database’i Snaphost Standby Database’e dönüştürme adımları aşağıdaki gibidir;
* İlk olarak Physical standby database’i flashback moda almamız gerekmektedir.
SQL> select flashback_on from v$database;
FLASHBACK_ON
NO
DGMGRL> connect sys/sys
Connected.
DGMGRL> edit database 'dgstandby' set state='apply-off';
Succeeded.
Exit
sqlplus
SQL> alter database flashback ON;
Database altered.
DGMGRL> connect sys/sys
Connected.
DGMGRL> edit database 'dgstandby' set state='apply-on';
Succeeded.
Exit
sqlplus
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
YES
* İkinci adım physical standby ın snapshot standby database’e çevrilmesi. Aşağıda ki işlemler primary database’de yapılmaktadır.
[oracle]/home/oracle --> dgmgrl
DGMGRL for Linux: Version 11.1.0.6.0 - Production Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/sys
Connected.
DGMGRL> show configuration
Configuration
Name: primary.localhost
Enabled: YES
Protection Mode: MaxPerformance
Databases:
primary - Primary database
dgstandby - Physical standby database
Fast-Start Failover: DISABLED
Current status for " primary.localhost ":
SUCCESS
DGMGRL> convert database 'dgstandby' to snapshot standby;
Converting database "dgstandby" to a Snapshot Standby database, please wait...
Database " dgstandby " converted successfully
[oracle]/home/oracle --> dgmgrl
DGMGRL for Linux: Version 11.1.0.6.0 - ProductionCopyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/sys
Connected.
DGMGRL> show configuration
Configuration
Name: primary.localhost
Enabled: YES
Protection Mode: MaxPerformance
Databases:
primary - Primary database
dgstandby - Snapshot standby database
Fast-Start Failover: DISABLED
Current status for " primary.localhost ":
SUCCESS
* Snapshot Standby’ ı test edebiliriz,
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
---------- ----------------
READ WRITE SNAPSHOT STANDBY
SQL> select status,sequence#,block# from v$managed_standby where client_process='LGWR';
STATUS SEQUENCE# BLOCK#
------------ ---------- ----------
IDLE 478 8
SQL> insert into test values (290,'24.04.2008');
1 row created.
SQL> commit;
Commit complete.
SQL> select status,sequence#,block# from v$managed_standby where client_process= 'LGWR';
STATUS SEQUENCE# BLOCK#
------------ ---------- ----------
IDLE 478 115
* Snapshot Standby’ın Physical Standby database dönüştürülmesi,
Primary Database ‘de,
DGMGRL> convert database 'dgstandby' to physical standby;
Converting database "dgstandby" to a Physical Standby database, please wait...
Operation requires shutdown of instance " dgstandby " on database " dgstandby "
Shutting down instance " dgstandby "...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance " dgstandby " on database " dgstandby "
Starting instance " dgstandby "...
DGMGRL> show configuration
Configuration
Name: primary.localhost
Enabled: YES
Protection Mode: MaxPerformance
Databases:
primary - Primary database
dgstandby - Physical standby database
* Physical Standby Kontrolü;
SQL> startup mount
ORACLE instance started.
Total System Global Area 836976640 bytes
Fixed Size 1303132 bytes
Variable Size 213912996 bytes
Database Buffers 616562688 bytes
Redo Buffers 5197824 bytes
Database mounted.
SQL> alter database open read only;
Database altered.
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
---------- ----------------
READ ONLY PHYSICAL STANDBY
SQL> select * from deneme;
ID TARIH
---------- ----------
169 29-01-2008
169 29-01-2008
172 15-02-2008
172 29-01-2008
172 15-02-2008
5 rows selected.
* Son adım olarak physical standby ‘ı flashback off moda alıyoruz.
DGMGRL> edit database 'dgstandby' set state='apply-off';
Succeeded.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 836976640 bytes
Fixed Size 1303132 bytes
Variable Size 213912996 bytes
Database Buffers 616562688 bytes
Redo Buffers 5197824 bytes
Database mounted.
SQL> alter database flashback off;
Database altered.
DGMGRL> edit database 'dgstandby' set state='apply-on';
Succeeded.
Teşekkürler...
Hiç yorum yok:
Yorum Gönder