Merhaba bu yazımızda, 2 Nodlu bir RAC veritabanımızı primary database ve bu veritabanımıza standalone bir veritabanını da physical standby database olarak eklemeyi planlıyorum. Yapılacak adımları genel olarak aşağıda başlıkları ile yazalım sonra bu başlıkları adım adım uygulayarak ilerleyelim.
PRIMARY İçin Yapılacak İşlemler
- Primary Ve Standby Veritabanlarımızı inceleyelim.
- Enable Force Logging
- Password File dosyasını Primaryden Standby Tarafında Kopyalanması.
- Standby Redo Log Ayarları Primary Veritabanı Tarafında Yapılır.
- Primary Archive Log Modda Olduğu Kontrol Edilir.
- Primary Veriatabanı Inıtialization Parameterelerini Ayarlanması
- Primary Veritabanı LISTENER Kontrol Edilmesi
- Primary Veritabanı için TNS Ayarlanması
STANDBY İçin Yapılacak İşlemler
- Standby Veriatabanı Inıtialization Parameterelerini Ayarlanması
- Standby için Gerekli Dizinleri Oluşturma
- Standby ORATAB Düzenleme
- Startup nomount
- Standby LISTENER Ayarlaması
- Standby TNS Ayarları ve TNS kontrolleri.
- TNS Connection Doğrulama
- RMAN Duplicate Komutunun Çalıştırılması.
- Standby Redo Log Kontrolleri.
- Standby tarafında spfile oluşturulması
- Stanby MPR Enable yapılması.
PRIMARY İçin Yapılacak İşlemler
- Primary Ve Standby Veritabanlarımızı inceleyelim
Primary Veritabanımız
Platform : Linuxx86_64
Server Name : rac1.ttnet.com
DB Version : Oracle 19.3.0.0
File system : ASM
Disk Groups : +DATA,+FRA
Database Name : racdb
DB_UNIQUE_NAME : racdb
INSTANCES : rac1,rac2
ORACLE_SID1-2 : racdb1-racdb2
Oracle Home Path : /u01/app/oracle/product/19.3.0.0/db
Primary Cluster Durumu
[oracle@rac1 ~]$ crsctl check cluster -all
**************************************************************
rac1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
rac2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
[oracle@rac1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.chad
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.net1.network
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.ons
ONLINE ONLINE rac1 STABLE
ONLINE ONLINE rac2 STABLE
ora.proxy_advm
OFFLINE OFFLINE rac1 STABLE
OFFLINE OFFLINE rac2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 ONLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.FRA.dg(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac2 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac2 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE rac1 Started,STABLE
2 ONLINE ONLINE rac2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE rac1 STABLE
2 ONLINE ONLINE rac2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE rac2 STABLE
ora.qosmserver
1 ONLINE ONLINE rac2 STABLE
ora.rac1.vip
1 ONLINE ONLINE rac1 STABLE
ora.rac2.vip
1 ONLINE ONLINE rac2 STABLE
ora.racdb.db
1 ONLINE ONLINE rac1 Open,HOME=/u01/app/o
racle/product/19.3.0
.0/db,STABLE
2 ONLINE ONLINE rac2 Open,HOME=/u01/app/o
racle/product/19.3.0
.0/db,STABLE
ora.scan1.vip
1 ONLINE ONLINE rac1 STABLE
ora.scan2.vip
1 ONLINE ONLINE rac2 STABLE
ora.scan3.vip
1 ONLINE ONLINE rac2 STABLE
--------------------------------------------------------------------------------
Standby Veritabanı
Platform : Linuxx86_64
Server Name : standbydb1.ttnet.com
DB Version : Oracle 19.3.0.0
File system : ASM
Disk Groups : +DATA,+FRA
Database Name : racdb
DB_UNIQUE_NAME : RACDBSTB
INSTANCES : standbydb1
ORACLE_SID : racdb
Oracle Home Path : /u01/app/oracle/product/19.0.0.0/db
2. Primary Database Enable Force Logging
SQL> select name, open_mode,cdb from v$database;
NAME OPEN_MODE CDB
--------- -------------------- ---
RACDB READ WRITE NO
SQL> select force_logging from v$database;
FORCE_LOGGING
---------------------------------------
NO
SQL> ALTER DATABASE FORCE LOGGING;
Database altered.
SQL> select force_logging from v$database;
FORCE_LOGGING
---------------------------------------
YES
3. Password File dosyasını Primaryden Standby Tarafında Kopyalanması
[oracle@rac2 ~]$ asmcmd
ASMCMD> pwd
+DATA/RACDB/PASSWORD
ASMCMD> ls
pwdracdb.261.1059316923
ASMCMD> pwcopy pwdracdb.261.1059316923 /tmp
[oracle@rac2 tmp]$ chown oracle:oinstall pwdracdb.261.1059316923
oracle@rac2 tmp]$ scp -p pwdracdb.261.1059316923 oracle@standbydb1:/u01/app/oracle/product/19.0.0.0/db/dbs/orapwracdb
4. Standby Redo Log Ayarları Primary Veritabanı Tarafında Yapılır.
Standby Redo logları primary tarafında oluşturuken, primary veritabanı online logları ile aynı boyutta olmak zorundadır. Fakat her grup için bir fazla sayıda oluşturulması önerilir.
(max logfiles +1) x2, her theread için bu sayıda standby redo log file oluşturulur. RMAN Duplicate komutu çalıştırıldığında bu log dosyaları otomatik olarak standby tarafına taşınacaktır.
SQL> set lines 180
SQL> col MEMBER for a60
SQL> select b.thread#, a.group#, a.member, b.bytes FROM v$logfile a, v$log b WHERE a.group# = b.group#;
THREAD# GROUP# MEMBER BYTES
---------- ---------- ------------------------------------------------------------ ----------
1 1 +DATA/RACDB/ONLINELOG/group_1.263.1059316937 209715200
1 1 +FRA/RACDB/ONLINELOG/group_1.257.1059316939 209715200
1 2 +DATA/RACDB/ONLINELOG/group_2.264.1059316941 209715200
1 2 +FRA/RACDB/ONLINELOG/group_2.258.1059316943 209715200
2 3 +DATA/RACDB/ONLINELOG/group_3.271.1059318871 209715200
2 3 +FRA/RACDB/ONLINELOG/group_3.259.1059318873 209715200
2 4 +DATA/RACDB/ONLINELOG/group_4.272.1059318877 209715200
2 4 +FRA/RACDB/ONLINELOG/group_4.260.1059318879 209715200
Eğer OMF kullanıyor isek Standby redo log file oluşturuken isim vermemize gerek yoktur. Log file dosyalarımız 200 MB büyüklüğündedir. O halde ; her bir thread için 200M lik 4 adet standby log file eklememiz gerekmektedir.
SQL> alter database add standby logfile thread 1 group 5 size 200M, group 6 size 200M, group 7 size 200M, group 8 size 200M;
Database altered.
alter database add standby logfile thread 2 group 9 size 200M, group 10 size 200M, group 11 size 200M, group 12 size 200M;
Database altered.
select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_ CON_ID
---------- ------- ------- ------------------------------------------------------------ --- ----------
1 ONLINE +DATA/RACDB/ONLINELOG/group_1.263.1059316937 NO 0
1 ONLINE +FRA/RACDB/ONLINELOG/group_1.257.1059316939 YES 0
2 ONLINE +DATA/RACDB/ONLINELOG/group_2.264.1059316941 NO 0
2 ONLINE +FRA/RACDB/ONLINELOG/group_2.258.1059316943 YES 0
3 ONLINE +DATA/RACDB/ONLINELOG/group_3.271.1059318871 NO 0
3 ONLINE +FRA/RACDB/ONLINELOG/group_3.259.1059318873 YES 0
4 ONLINE +DATA/RACDB/ONLINELOG/group_4.272.1059318877 NO 0
4 ONLINE +FRA/RACDB/ONLINELOG/group_4.260.1059318879 YES 0
5 STANDBY +DATA/RACDB/ONLINELOG/group_5.258.1061553937 NO 0
5 STANDBY +FRA/RACDB/ONLINELOG/group_5.284.1061553939 YES 0
6 STANDBY +DATA/RACDB/ONLINELOG/group_6.279.1061553941 NO 0
GROUP# STATUS TYPE MEMBER IS_ CON_ID
---------- ------- ------- ------------------------------------------------------------ --- ----------
6 STANDBY +FRA/RACDB/ONLINELOG/group_6.285.1061553943 YES 0
7 STANDBY +DATA/RACDB/ONLINELOG/group_7.280.1061553947 NO 0
7 STANDBY +FRA/RACDB/ONLINELOG/group_7.286.1061553951 YES 0
8 STANDBY +DATA/RACDB/ONLINELOG/group_8.281.1061553993 NO 0
8 STANDBY +FRA/RACDB/ONLINELOG/group_8.287.1061553995 YES 0
9 STANDBY +DATA/RACDB/ONLINELOG/group_9.282.1061554049 NO 0
9 STANDBY +FRA/RACDB/ONLINELOG/group_9.288.1061554051 YES 0
10 STANDBY +DATA/RACDB/ONLINELOG/group_10.283.1061554053 NO 0
10 STANDBY +FRA/RACDB/ONLINELOG/group_10.289.1061554057 YES 0
11 STANDBY +DATA/RACDB/ONLINELOG/group_11.284.1061554059 NO 0
11 STANDBY +FRA/RACDB/ONLINELOG/group_11.290.1061554063 YES 0
GROUP# STATUS TYPE MEMBER IS_ CON_ID
---------- ------- ------- ------------------------------------------------------------ --- ----------
12 STANDBY +DATA/RACDB/ONLINELOG/group_12.285.1061554067 NO 0
12 STANDBY +FRA/RACDB/ONLINELOG/group_12.291.1061554071 YES 0
24 rows selected.
5. Primary Archive Log Modda Olduğu Kontrol Edilir
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 28
Next log sequence to archive 29
Current log sequence 29
Veritabanımız archive log modda değilse archive log moda almamız gerekir. https://www.farukcevik.com.tr/oracle-backup-rman-1/.
6. Primary Veriatabanı Inıtialization Parameterelerini Ayarlanması
Data Guard parametreleri ve teorik kısmı ile ilgili yazım. Kullanılan parameterelerin açıklamaarı bu yazıda bulabilirsiniz. https://www.farukcevik.com.tr/data-guard-mimarisi/.
Parametreleri değiştirmeden önce herhangi bir şeyi yanlış yapma ihtimalimize karşın, pfile olarak spfile ın bir yedeğini alalım.
SQL> create pfile='/home/oracle/initRACDB_BeforeDG.ora.bck' from spfile;
File created.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(RACDB,RACDBSTB)' scope=both sid='*';
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+FRA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=RACDB' scope=both sid='*';
System altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FRA
Oldest online log sequence 28
Next log sequence to archive 29
Current log sequence 29
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=RACDBSTB LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=RACDBSTB' scope=both sid='*';
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1=ENABLE scope=both sid='*';
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=both sid='*';
System altered.
SQL> ALTER SYSTEM SET DB_FILE_NAME_CONVERT='RACDBSTB','RACDB' SCOPE=SPFILE sid='*';
System altered.
SQL> ALTER SYSTEM SET LOG_FILE_NAME_CONVERT='RACDBSTB','RACDB' SCOPE=SPFILE sid='*';
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO scope=both sid='*';
System altered.
SQL> create pfile='/home/oracle/initRACDBafter.ora' from spfile;
File created.
[oracle@rac2 ~]$ cat initRACDBafter.ora
racdb1.__data_transfer_cache_size=0
racdb2.__data_transfer_cache_size=0
racdb1.__db_cache_size=587202560
racdb2.__db_cache_size=570425344
racdb1.__inmemory_ext_roarea=0
racdb2.__inmemory_ext_roarea=0
racdb1.__inmemory_ext_rwarea=0
racdb2.__inmemory_ext_rwarea=0
racdb1.__java_pool_size=0
racdb2.__java_pool_size=0
racdb1.__large_pool_size=16777216
racdb2.__large_pool_size=16777216
racdb1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
racdb2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
racdb1.__pga_aggregate_target=402653184
racdb2.__pga_aggregate_target=402653184
racdb1.__sga_target=1174405120
racdb2.__sga_target=1174405120
racdb1.__shared_io_pool_size=50331648
racdb2.__shared_io_pool_size=50331648
racdb1.__shared_pool_size=503316480
racdb2.__shared_pool_size=520093696
racdb1.__streams_pool_size=0
racdb2.__streams_pool_size=0
racdb1.__unified_pga_pool_size=0
racdb2.__unified_pga_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/racdb/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='19.0.0'
*.control_files='+DATA/RACDB/CONTROLFILE/current.262.1059316937','+FRA/RACDB/CONTROLFILE/current.256.1059316937'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_file_name_convert='RACDBSTB','RACDB'
*.db_name='racdb'
*.db_recovery_file_dest='+FRA'
*.db_recovery_file_dest_size=7851m
*.dg_broker_start=FALSE
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=racdbXDB)'
family:dw_helper.instance_mode='read-only'
racdb1.instance_number=1
racdb2.instance_number=2
*.local_listener='-oraagent-dummy-'
*.log_archive_config='DG_CONFIG=(RACDB,RACDBSTB)'
*.log_archive_dest_1='LOCATION=+FRA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=RACDB'
*.log_archive_dest_2='SERVICE=RACDBSTB LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=RACDBSTB'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_file_name_convert='RACDBSTB','RACDB'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_target=369m
*.processes=300
*.remote_login_passwordfile='exclusive'
*.sga_target=1107m
*.standby_file_management='AUTO'
racdb2.thread=2
racdb1.thread=1
*.undo_tablespace='UNDOTBS1'
racdb1.undo_tablespace='UNDOTBS1'
racdb2.undo_tablespace='UNDOTBS2'
7. Primary Veritabanı LISTENER Kontrol Edilmesi
[oracle@rac1 ~]$ ps -ef|grep tns
root 15 2 0 05:05 ? 00:00:00 [netns]
oracle 10346 1 0 09:21 ? 00:00:00 /u01/app/19.3.0.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
oracle 10524 1 0 09:22 ? 00:00:02 /u01/app/19.3.0.0/grid/bin/tnslsnr ASMNET1LSNR_ASM -no_crs_notify -inherit
oracle 10555 1 0 09:22 ? 00:00:00 /u01/app/19.3.0.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
oracle 16582 3123 0 14:35 pts/1 00:00:00 grep --color=auto tns
[oracle@rac1 ~]$ lsnrctl stat
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 11-JAN-2021 14:34:21
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 11-JAN-2021 09:21:59
Uptime 0 days 5 hr. 12 min. 21 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/19.3.0.0/grid/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=150.150.100.11)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=150.150.100.13)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_FRA" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "racdb" has 1 instance(s).
Instance "racdb1", status READY, has 1 handler(s) for this service...
Service "racdbXDB" has 1 instance(s).
Instance "racdb1", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@rac1 ~]$ lsnrctl status LISTENER_SCAN1
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 11-JAN-2021 14:36:47
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 11-JAN-2021 09:22:02
Uptime 0 days 5 hr. 14 min. 45 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/19.3.0.0/grid/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/rac1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=150.150.100.15)(PORT=1521)))
Services Summary...
Service "racdb" has 2 instance(s).
Instance "racdb1", status READY, has 1 handler(s) for this service...
Instance "racdb2", status READY, has 1 handler(s) for this service...
Service "racdbXDB" has 2 instance(s).
Instance "racdb1", status READY, has 1 handler(s) for this service...
Instance "racdb2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@rac1 ~]$ cat /u01/app/19.3.0.0/grid/network/admin/listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))) # line added by Agent
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ASMNET1LSNR_ASM=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_ASMNET1LSNR_ASM=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_ASMNET1LSNR_ASM=SUBNET # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=OFF # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN2=OFF # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN3=OFF # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET # line added by Agent
***DİĞER NODE İÇİN BAKALIM
[oracle@rac2 tmp]$ cat /u01/app/19.3.0.0/grid/network/admin/listener.ora
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))) # line added by Agent
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ASMNET1LSNR_ASM=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ASMNET1LSNR_ASM)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_ASMNET1LSNR_ASM=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_ASMNET1LSNR_ASM=SUBNET # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN1=OFF # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER=SUBNET # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN2=OFF # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_SCAN3=OFF # line added by Agent - Disabled by Agent because REMOTE_REGISTRATION_ADDRESS is set
9. Primary Veritabanı için TNS Ayarlanması
[oracle@rac1 ~]$ cat /u01/app/oracle/product/19.3.0.0/db/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.3.0.0/db/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RACDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan-rac.ttnet.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb)
)
)
RACDBSTB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standbydb1.ttnet.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdbstb)(UR=A)
)
)
--DİĞER NODE İÇİNDE ";
[oracle@rac2 tmp]$ cat /u01/app/oracle/product/19.3.0.0/db/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.3.0.0/db/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RACDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan-rac.ttnet.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb)
)
)
RACDBSTB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standbydb1.ttnet.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdbstb)(UR=A)
)
)
--TNSPING
[oracle@rac1 ~]$ tnsping RACDBSTB
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 11-JAN-2021 19:36:00
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = standbydb1.ttnet.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdbstb)(UR=A)))
[oracle@rac2 ~]$ tnsping RACDBSTB
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 11-JAN-2021 19:36:38
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = standbydb1.ttnet.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdbstb)(UR=A)))
Primary Tarafında şimdilik yapacaklarımız bukadardı. Şimdi Standby tarafındaki ayarlarımızı yapalım.
STANDBY İçin Yapılacak İşlemler
- Standby Veriatabanı Inıtialization Parameterelerini Ayarlanması
- Standby için Gerekli Dizinleri Oluşturma
- Standby ORATAB Düzenleme
- Startup nomount
- Standby LISTENER Ayarlaması
- Standby TNS Ayarları ve TNS kontrolleri.
- TNS Connection Doğrulama
- RMAN Duplicate Komutunun Çalıştırılması.
- Standby Redo Log Kontrolleri.
- Standby tarafında spfile oluşturulması
- Stanby MPR Enable yapılması.
- Standby Veriatabanı Inıtialization Parameterelerini Ayarlanması
cat /u01/app/oracle/product/19.3.0.0/db/dbs/initracdb.ora
*.db_name='racdb'
*.db_unique_name='RACDBSTB'
*.audit_file_dest='/u01/app/oracle/admin/RACDBSTB/adump'
*.log_archive_config='DG_CONFIG=(RACDB,RACDBSTB)'
*.db_recovery_file_dest='+FRA'
*.log_archive_dest_1='LOCATION=+FRA VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=RACDBSTB'
*.log_archive_dest_2='SERVICE=RACDB LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=RACDB'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.db_recovery_file_dest_size=7851m
*.db_file_name_convert='RACDB','RACDBSTB'
*.log_file_name_convert='RACDB','RACDBSTB'
2. Standby için Gerekli Dizinleri Oluşturma
$ORACLE_BASE/admin/$ORACLE_SID/adump dizinini oluşturulmalı
[oracle@standbydb1 dbs]$ mkdir -p /u01/app/oracle/admin/RACDBSTB/adump
3. Standby ORATAB Düzenleme
[oracle@standbydb1 dbs]$ echo "RACDB:/u01/app/oracle/product/19.3.0.0/db:N" >> /etc/oratab
[oracle@standbydb1 dbs]$ echo "RACDBSTB:/u01/app/oracle/product/19.3.0.0/db:N" >> /etc/oratab
4. Startup nomount
SQL> startup nomount pfile='/u01/app/oracle/product/19.3.0.0/db/dbs/initracdb.ora';
ORACLE instance started.
Total System Global Area 243268216 bytes
Fixed Size 8895096 bytes
Variable Size 180355072 bytes
Database Buffers 50331648 bytes
Redo Buffers 3686400 bytes
SQL>
5. Standby LISTENER Ayarlaması
[oracle@standbydb1 ~]$ ps -ef|grep tns
root 15 2 0 17:54 ? 00:00:00 [netns]
oracle 10257 12540 0 23:38 pts/0 00:00:00 grep --color=auto tns
oracle 13463 1 0 22:25 ? 00:00:00 /u01/app/19.3.0.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
[oracle@standbydb1 ~]$ lsnrctl stat
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 11-JAN-2021 23:47:11
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 11-JAN-2021 22:25:02
Uptime 0 days 1 hr. 22 min. 9 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/19.3.0.0/grid/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/standbydb1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=standbydb1.ttnet.com)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "+ASM_FRA" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "RACDBSTB" has 2 instance(s).
Instance "racdb", status UNKNOWN, has 1 handler(s) for this service...
Instance "racdb", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
[oracle@standbydb1 ~]$ cat /u01/app/oracle/product/19.3.0.0/db/network/admin/listener.ora
#Backup file is /u01/app/oracle/crsdata/standbydb1/output/listener.ora.bak.standbydb1.oracle line added by Agent
# listener.ora Network Configuration File: /u01/app/oracle/product/19.0.0.0/db/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standbydb1.ttnet.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER1=ON # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER1=ON # line added by Agent
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = RACDBSTB)
(ORACLE_HOME = /u01/app/oracle/product/19.3.0.0/db)
(SID_NAME = racdb)
)
)
6. Standby TNS Ayarları ve TNS kontrolleri
cat /u01/app/oracle/product/19.3.0.0/db/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.3.0.0/db/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RACDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan-rac.ttnet.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb)
)
)
RACDBSTB=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standbydb1.ttnet.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RACDBSTB)(UR=A)
)
)
--TNSPING Kontrolleri
[oracle@standbydb1 ~]$ tnsping racdb
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 11-JAN-2021 23:49:07
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = scan-rac.ttnet.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = racdb)))
OK (0 msec)
[oracle@standbydb1 ~]$ tnsping racdbstb
TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 11-JAN-2021 23:49:42
Copyright (c) 1997, 2019, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = standbydb1.ttnet.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = RACDB)(UR=A)))
OK (0 msec)
7. TNS Connection Doğrulama
Primary Tarafında
[oracle@rac1 ~]$ sqlplus SYS/Welcome1@racdb as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 11 16:10:35 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@rac1 ~]$ sqlplus SYS/Welcome1@RACDBSTB as sysdba
. .s
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 11 16:11:02 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
Standby için deneyelim
[oracle@standbydb1 ~]$ sqlplus SYS/Welcome1@racdb as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 11 16:12:42 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select * from dual;
D
-
X
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@standbydb1 ~]$ sqlplus SYS/Welcome1@standbydb as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 11 16:13:09 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
8. RMAN Duplicate Komutunun Çalıştırılması
[oracle@rac1 ~]$ rman target SYS/Welcome1 auxiliary SYS/Welcome1@racdbstb
Recovery Manager: Release 19.0.0.0.0 - Production on Tue Jan 12 00:17:33 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: RACDB (DBID=1056933702)
connected to auxiliary database: RACDB (not mounted)
RMAN> duplicate target database for standby from active database nofilenamecheck;
Starting Duplicate Db at 13-JAN-21
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=44 device type=DISK
contents of Memory Script:
{
backup as copy reuse
passwordfile auxiliary format '/u01/app/oracle/product/19.3.0.0/db/dbs/orapwracdb' ;
}
executing Memory Script
Starting backup at 13-JAN-21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=118 instance=racdb1 device type=DISK
Finished backup at 13-JAN-21
contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format '+FRA/RACDBSTB/CONTROLFILE/current.256.1061730223';
sql clone "create spfile from memory";
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set control_files =
''+FRA/RACDBSTB/CONTROLFILE/current.256.1061730223'' comment=
''Set by RMAN'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Starting backup at 13-JAN-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=+FRA/RACDBSTB/CONTROLFILE/current.256.1061730223 tag=TAG20210113T130342
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-JAN-21
sql statement: create spfile from memory
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 243268216 bytes
Fixed Size 8895096 bytes
Variable Size 180355072 bytes
Database Buffers 50331648 bytes
Redo Buffers 3686400 bytes
sql statement: alter system set control_files = ''+FRA/RACDBSTB/CONTROLFILE/current.256.1061730223'' comment= ''Set by RMAN'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 243268216 bytes
Fixed Size 8895096 bytes
Variable Size 180355072 bytes
Database Buffers 50331648 bytes
Redo Buffers 3686400 bytes
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05529: warning: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.
contents of Memory Script:
{
set newname for tempfile 1 to
"+DATA";
switch clone tempfile all;
set newname for datafile 1 to
"+DATA";
set newname for datafile 2 to
"+DATA";
set newname for datafile 3 to
"+DATA";
set newname for datafile 4 to
"+DATA";
set newname for datafile 5 to
"+DATA";
set newname for datafile 6 to
"+DATA";
backup as copy reuse
datafile 1 auxiliary format
"+DATA" datafile
2 auxiliary format
"+DATA" datafile
3 auxiliary format
"+DATA" datafile
4 auxiliary format
"+DATA" datafile
5 auxiliary format
"+DATA" datafile
6 auxiliary format
"+DATA" ;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to +DATA in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 13-JAN-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/RACDB/DATAFILE/system.265.1059316947
output file name=+DATA/RACDBSTB/DATAFILE/system.257.1061730307 tag=TAG20210113T130505
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/RACDB/DATAFILE/undotbs1.267.1059316961
output file name=+DATA/RACDBSTB/DATAFILE/undotbs1.258.1061730331 tag=TAG20210113T130505
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA/RACDB/DATAFILE/sysaux.266.1059316957
output file name=+DATA/RACDBSTB/DATAFILE/sysaux.259.1061730357 tag=TAG20210113T130505
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=+DATA/RACDB/DATAFILE/tbs_fdba.275.1060428897
output file name=+DATA/RACDBSTB/DATAFILE/tbs_fdba.260.1061730381 tag=TAG20210113T130505
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/RACDB/DATAFILE/undotbs2.269.1059316969
output file name=+DATA/RACDBSTB/DATAFILE/undotbs2.261.1061730389 tag=TAG20210113T130505
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DATA/RACDB/DATAFILE/users.270.1059316973
output file name=+DATA/RACDBSTB/DATAFILE/users.262.1061730395 tag=TAG20210113T130505
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 13-JAN-21
sql statement: alter system archive log current
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1061730398 file name=+DATA/RACDBSTB/DATAFILE/system.257.1061730307
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=1061730398 file name=+DATA/RACDBSTB/DATAFILE/sysaux.259.1061730357
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=1061730398 file name=+DATA/RACDBSTB/DATAFILE/undotbs1.258.1061730331
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=1061730398 file name=+DATA/RACDBSTB/DATAFILE/undotbs2.261.1061730389
datafile 5 switched to datafile copy
input datafile copy RECID=5 STAMP=1061730398 file name=+DATA/RACDBSTB/DATAFILE/users.262.1061730395
datafile 6 switched to datafile copy
input datafile copy RECID=6 STAMP=1061730398 file name=+DATA/RACDBSTB/DATAFILE/tbs_fdba.260.1061730381
Finished Duplicate Db at 13-JAN-21
9. Standby Redo Log Kontrolleri.
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_ CON_ID
---------- ------- ------- -------------------------------------------------- --- ----------
1 ONLINE +FRA/RACDBSTB/ONLINELOG/group_1.257.1061724659 YES 0
2 ONLINE +FRA/RACDBSTB/ONLINELOG/group_2.258.1061724661 YES 0
3 ONLINE +FRA/RACDBSTB/ONLINELOG/group_3.259.1061724661 YES 0
4 ONLINE +FRA/RACDBSTB/ONLINELOG/group_4.260.1061724661 YES 0
5 STANDBY +FRA/RACDBSTB/ONLINELOG/group_5.261.1061724661 YES 0
6 STANDBY +FRA/RACDBSTB/ONLINELOG/group_6.262.1061724661 YES 0
7 STANDBY +FRA/RACDBSTB/ONLINELOG/group_7.263.1061724663 YES 0
8 STANDBY +FRA/RACDBSTB/ONLINELOG/group_8.264.1061724663 YES 0
9 STANDBY +FRA/RACDBSTB/ONLINELOG/group_9.265.1061724663 YES 0
10 STANDBY +FRA/RACDBSTB/ONLINELOG/group_10.266.1061724665 YES 0
11 STANDBY +FRA/RACDBSTB/ONLINELOG/group_11.267.1061724667 YES 0
GROUP# STATUS TYPE MEMBER IS_ CON_ID
---------- ------- ------- -------------------------------------------------- --- ----------
12 STANDBY +FRA/RACDBSTB/ONLINELOG/group_12.268.1061724671 YES 0
12 rows selected.
10. Standby tarafında spfile oluşturulması
SQL> create spfile from pfile;
File created.
SQL> shu immediate;
SQL> startup mount;
ORACLE instance started.
Total System Global Area 243268216 bytes
Fixed Size 8895096 bytes
Variable Size 180355072 bytes
Database Buffers 50331648 bytes
Redo Buffers 3686400 bytes
Database mounted.
11 Stanby MPR Enable yapılması.
SQL> select name,open_mode,database_role,cdb from v$database;
NAME OPEN_MODE DATABASE_ROLE CDB
--------- -------------------- ---------------- ---
RACDB MOUNTED PHYSICAL STANDBY NO
SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
1 30 29 1
2 14 13 1
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
1 30 30 0
2 14 14 0
Primary Tarafı için
SQL> select name,open_mode,database_role,cdb from v$database;
NAME OPEN_MODE DATABASE_ROLE CDB
--------- -------------------- ---------------- ---
RACDB READ WRITE PRIMARY NO
Verfy
Primary RAC Instance 2
SQL> select thread#,max(sequence#) from v$archived_log where archived='YES' group by thread#;
THREAD# MAX(SEQUENCE#)
---------- --------------
1 30
2 14
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered.
SQL> /
System altered.
SQL> /
System altered.
SQL> select thread#,max(sequence#) from v$archived_log where archived='YES' group by thread#;
THREAD# MAX(SEQUENCE#)
---------- --------------
1 31
2 17
Standby Verify
SQL> select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#;
THREAD# MAX(SEQUENCE#)
---------- --------------
1 31
2 16
SQL> SELECT ARCH.THREAD# "Thread", ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
Thread Last Sequence Received Last Sequence Applied Difference
---------- ---------------------- --------------------- ----------
1 31 31 0
2 17 17 0
Evet her şey gayet düzgün çalışıyor.
Bir yanıt yazın