| 導購 | 订阅 | 在线投稿
分享
 
 
 

Oracle數據庫9i DataGuard的安裝與維護

來源:互聯網  2008-06-12 07:23:56  評論

一、安裝

環境:

Primary 數據庫:sun01

Standby 數據庫:sun02

Oracle_Sid:bnet

1. 拷貝$ORACLE_BASE 到新機器上

2. 讓Primary數據庫處于歸檔模式,對Primary數據庫做一個Rman熱備份

startup mount

alter database archivelog;

archive log list;

rman target sys/oracle

backup database format "/....";

3.創建Data Guard數據庫控制文件

alter database create standby controlfile as '/....ctl';

4.設置監聽

Primary:

bnetguard =

( (DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = sun02)(PORT = 1522))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = bnet)

)

)

Standby:

listener.ora

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))

)

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = sun01)(PORT = 1522))

)

)

)

tnsname.ora

bnet =

( (DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = sun02)(PORT = 1522))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = bnet)

)

)

5. 設置主機參數

alter database force logging;

主庫強制歸檔

主機參數:

fal_client=bnetguard

fal_server=bnet

standby_file_management=auto

remote_login_passwordfile=exclusive

備機參數:

db_file_name_convert

log_file_name_convert

standby_file_management='AUTO'

standby_archive_dest=/export/home/oracle/oradata/bnet/arch

6.創建standby 數據庫

orapwd

sqlplus "sys/oracle as sysdba"

startup nomount pfile='''

alter database mount standby database;

exit

rman target sys/oracle nocatalog

restore database

7.設置自動歸檔

alter system set log_archive_dest_2='server=bnetguard reopen=200'

8.啓動Data Guard自動恢複狀態

sqlplus "sys/oracle as sysdba"<

recover managed standby database;

exit

EOF

9.測試

alter system archive log current;

二、維護:

使Standby 數據庫處與 read-only狀態

reover cancel/recover managed standby database cancel;

取消恢複模式

alter database open read only;

啓動數據庫到只讀狀態

recover standby database;

使數據庫切換到恢複模式

recover managed standby database time out 15;

如果超過15分鍾沒有傳日志

Restarting dead background process QMN0

"Restarting dead background process QMN" message can continually

appear in the alert log during startup in RAC environment.

Workaround:

Set aq_tm_processes=0 in the init.ora.

It can be set to desired value through

"alter system set aq_tm_processes=n" once the database is open completely.

alter database activate standby database;

一、安裝 環境: Primary 數據庫:sun01 Standby 數據庫:sun02 Oracle_Sid:bnet 1. 拷貝$ORACLE_BASE 到新機器上 2. 讓Primary數據庫處于歸檔模式,對Primary數據庫做一個Rman熱備份 startup mount alter database archivelog; archive log list; rman target sys/oracle backup database format "/...."; 3.創建Data Guard數據庫控制文件 alter database create standby controlfile as '/....ctl'; 4.設置監聽 Primary: bnetguard = ( (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = sun02)(PORT = 1522)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bnet) ) ) Standby: listener.ora LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = sun01)(PORT = 1522)) ) ) ) tnsname.ora bnet = ( (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = sun02)(PORT = 1522)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bnet) ) ) 5. 設置主機參數 alter database force logging; 主庫強制歸檔 主機參數: fal_client=bnetguard fal_server=bnet standby_file_management=auto remote_login_passwordfile=exclusive 備機參數: db_file_name_convert log_file_name_convert standby_file_management='AUTO' standby_archive_dest=/export/home/oracle/oradata/bnet/arch 6.創建standby 數據庫 orapwd sqlplus "sys/oracle as sysdba" startup nomount pfile=''' alter database mount standby database; exit rman target sys/oracle nocatalog restore database 7.設置自動歸檔 alter system set log_archive_dest_2='server=bnetguard reopen=200' 8.啓動Data Guard自動恢複狀態 sqlplus "sys/oracle as sysdba"< recover managed standby database; exit EOF 9.測試 alter system archive log current; 二、維護: 使Standby 數據庫處與 read-only狀態 reover cancel/recover managed standby database cancel; 取消恢複模式 alter database open read only; 啓動數據庫到只讀狀態 recover standby database; 使數據庫切換到恢複模式 recover managed standby database time out 15; 如果超過15分鍾沒有傳日志 Restarting dead background process QMN0 "Restarting dead background process QMN" message can continually appear in the alert log during startup in RAC environment. Workaround: Set aq_tm_processes=0 in the init.ora. It can be set to desired value through "alter system set aq_tm_processes=n" once the database is open completely. alter database activate standby database;
󰈣󰈤
王朝萬家燈火計劃
期待原創作者加盟
 
 
 
>>返回首頁<<
 
 
 
 
 熱帖排行
 
 
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有