4. Activate the physical standby database.
4.1 active standby database
SQL>
ALTER DATABASE ACTIVATE STANDBY DATABASE;
Database altered.
SQL>
aletr log 會產生以下的訊息
AUDIT_TRAIL initialization parameter is changed back to its original value as specified in the parameter file.
ACTIVATE STANDBY: Complete - Database mounted as primary
Completed: ALTER DATABASE ACTIVATE STANDBY DATABASE
4.2 確認control file 狀態
SQL>
select CONTROLFILE_TYPE from v$database;
CONTROL
-------
CURRENT
4.3 open database
SQL>
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;
ALTER DATABASE OPEN;
aletr log 會產生以下的訊息
Completed: ALTER DATABASE OPEN
4.4 確認database 狀態
SQL>
select status from v$thread ;
STATUS
------
OPEN
5 6 7 一連串的測試 自已體會
5. 手動 bind ip for DB VIP
6. 修改listener.ora /etc/hosts
7. 連線確認 DB 可正常讀取
該注意
lisrctl IP VIP是否正確
/etc/hosts VIP對是否正確
sqlnet.ora db的白名單是否正確
8. 還原 Physical cold standby database
8.1 重啟 database on mount mode
SQL>
shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
startup mount
ORACLE instance started.
Total System Global Area 776646656 bytes
Fixed Size 2257272 bytes
Variable Size 507514504 bytes
Database Buffers 260046848 bytes
Redo Buffers 6828032 bytes
Database mounted.
SQL>
8.2 flashback database to before open
SQL>
FLASHBACK DATABASE TO RESTORE POINT BEFORE_OPEN_STANDBY;
Flashback complete.
aletr log 會產生以下的訊息 FLASHBACK DATABASE TO RESTORE POINT BEFORE_OPEN_STANDBY
Flashback Restore Start
Flashback Restore Complete
Completed: FLASHBACK DATABASE TO RESTORE POINT BEFORE_OPEN_STANDBY
8.3 可以確認control file type 為 backup
SQL>
select controlfile_type from v$database ;
CONTROL
-------
BACKUP
8.4 轉換 database 為 physical standby
SQL>
ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Database altered.
aletr log 會產生以下的訊息
Completed: ALTER DATABASE CONVERT TO PHYSICAL STANDBY
8.5 重啟 standby database on mount mode
SQL>
shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL>
startup mount
ORACLE instance started.
Total System Global Area 776646656 bytes
Fixed Size 2257272 bytes
Variable Size 507514504 bytes
Database Buffers 260046848 bytes
Redo Buffers 6828032 bytes
Database mounted.
SQL>
8.6 重啟 standby databas apply
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT USING CURRENT LOGFILE;
Database altered.
aletr log 會產生以下的訊息
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT USING CURRENT LOGFILE
9. 恢復primary database 歸檔至standby database
SQL>
alter system set log_archive_dest_state_2=enable ;
System altered.
SQL>
aletr log 會產生以下的訊息
******************************************************************
LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2
******************************************************************
10. Drop the restore point
10 .1 drop and off
SQL>
DROP RESTORE POINT BEFORE_OPEN_STANDBY;
alter database flashback off;
Restore point dropped.
Database altered.
aletr log 會產生以下的訊息
Drop guaranteed restore point BEFORE_OPEN_STANDBY
Guaranteed restore point BEFORE_OPEN_STANDBY dropped
Completed: alter database flashback off
10.2 再重啟一次並恢復連線
SQL>
shutdown immediate;
startup mount;
ORACLE instance started.
Total System Global Area 776646656 bytes
Fixed Size 2257272 bytes
Variable Size 507514504 bytes
Database Buffers 260046848 bytes
Redo Buffers 6828032 bytes
Database mounted.
SQL>
SQL>
alter database recover managed standby database using current logfile disconnect from session;
Database altered.
11 恢復 檢查
SQL>
select log_mode , OPEN_MODE , DATABASE_ROLE from v$database;
select SWITCHOVER_STATUS , PROTECTION_MODE , PROTECTION_LEVEL from v$database;
LOG_MODE OPEN_MODE DATABASE_ROLE
------------ -------------------- ----------------
ARCHIVELOG MOUNTED PHYSICAL STANDBY
SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL
-------------------- -------------------- --------------------
NOT ALLOWED MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE
沒有留言:
張貼留言