Oracle Standby Database Activate Primary
Primary veri tabanında database ve instance name sorguluyorum
SQL> select name from v$database; NAME ——— ORCL SQL> select instance from v$thread; INSTANCE ——————————————————————————– orcl |
Standby veri tabanında aynı sorguyu çalıştırıyorum
SQL> select name from v$database; NAME ——— ORCL SQL> select instance from v$thread; INSTANCE ——————————————————————————– orcldg |
Standby Veri tabanının database role durumunu sorguluyorum
SQL> SELECT OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE FROM V$DATABASE; OPEN_MODE PROTECTION_MODE DATABASE_ROLE ——————– ——————– —————- MOUNTED MAXIMUM PERFORMANCE PHYSICAL STANDBY |
Her iki veri tabanı acık durumda primary veri tabanını kapatıyorum daha sonra standby database’i primary yapıcam
Primary Database
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. |
Standby Database Mount modda aşağıdaki adımlar standby veri tabanında yapılmıstır
1.Adım
SQL> alter database recover managed standby database cancel; Database altered. |
2.Adım (opsiyonel)
SQL> RECOVER STANDBY DATABASE; ORA-00279: change 993786 generated at 03/31/2020 10:46:03 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/archive/1_19_1034163819.arc ORA-00280: change 993786 for thread 1 is in sequence #19 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} CANCEL Media recovery cancelled. |
3.Adım
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH; Database altered. |
4.Adım
SQL> ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE; Database altered. |
5.Adım Veri Tabanı primary oldu
SQL> SELECT OPEN_MODE,PROTECTION_MODE,DATABASE_ROLE FROM V$DATABASE; OPEN_MODE PROTECTION_MODE DATABASE_ROLE ——————– ——————– —————- MOUNTED MAXIMUM PERFORMANCE PRIMARY |
6.Adım Veri tabanı açıldı
SQL> ALTER DATABASE OPEN; Database altered. |
Instancename Değiştirme
Instance name orcldg olarak gorunuyor. Bunu orcl olarak değiştiricem. Oncelikle .bash_profile içinde tanımlı olan ORACLE_UNQNAME=orcl; ve ORACLE_SID=orcl; olarak değiştiriyorum
/u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora olarak değiştiriyorum
initorcl.ora editleyip *.db_unique_name=’orcl’ olarak değiştiriyorum
create spfile from pfile; Güncel spfile file yaratıyorum
Veri tabanını acıyorum sorunsuz sekilde acıldı
SQL> startup; ORACLE instance started. Total System Global Area 1653518336 bytes Fixed Size 2253784 bytes Variable Size 1006636072 bytes Database Buffers 637534208 bytes Redo Buffers 7094272 bytes Database mounted. Database opened. |
Listener Servisi orcl olarak calıstı
[oracle@oradg11 ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 – Production on 31-MAR-2020 11:18:08 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oradg11.localdomain)(PORT=1521))) STATUS of the LISTENER ———————— Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 – Production Start Date 31-MAR-2020 11:11:34 Uptime 0 days 0 hr. 6 min. 34 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/oradg11/listener/alert/log.xml Listening Endpoints Summary… (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oradg11.localdomain)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary… Service “orcl” has 1 instance(s). Instance “orcl”, status READY, has 1 handler(s) for this service… Service “orclXDB” has 1 instance(s). Instance “orcl”, status READY, has 1 handler(s) for this service… The command completed successfully |
Database adını ve instance ismini tekrar kontrol ediyorum
SQL> select name from v$database; NAME ——— ORCL SQL> select instance from v$thread; INSTANCE ——————————————————————————– orcl |