利用RMAN 建立Oracle9i RAC Data Guard
相關術語解釋:
目標伺服器: target , 需要被備份的原數據庫伺服器.這裡指primary database 伺服器 .
目錄伺服器: catalog , 儲存備份資訊的目錄伺服器, 這裡指data guard 伺服器 .
1. RMAN伺服器的配置:
以下在目錄伺服器上配置.
1.1 建立RMAN使用者表空間(表空間大小設定為500m左右即可) .
create tablespace rman_data
datafile '/u01/data/rman_data1.dbf' size 500M
extent management local uniform size 5M ;
1.2 建立RMAN使用者:
create user rman identified by rman
default tablespace rman_data
temporary tablespace temp ;
1.3 給RMAN使用者授於相關係統許可權:
grant resource, connect, recovery_catalog_owner to rman;
1.4 在目錄伺服器(即Standby Server)上設定tnsnames.ora 用於連target伺服器(Primary DB) .
tnsnames.ora 檔案中加入:
INTEL_RAC1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.161.8.81)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = intel)
(INSTANCE_NAME = intel1)
)
)
1.5 連接目標伺服器與CATALOG伺服器.
rman target sys/oracle@intel_rac1 catalog rman/rman(user/password必須為目標伺服器上的擁有sysdba許可權的使用者.如:sys)
1.6 在目標伺服器上建立CATALOG 目錄.
CREATE CATALOG
1.7 在CATALOG伺服器上註冊目標伺服器.
REGISTER DATABASE;
到這裡,RMAN備份環境已經準備好了,幷已連接至目標與目錄伺服器.
2. 建立Data Guard
2.1 COPY目標伺服器上(Primary DB Server)的初始化參數檔案及密碼檔案到Data Guard相對應目錄.
2.2 使用RMAN的Image copy複製目標伺服器上的.DBF檔案至Data Guard相應目錄.
2.2.1 使用REPORT SCHEMA可列出將要複製的所有目標數據庫上的數據檔案.
2.2.2 使用下面的SQL生成所有數據檔案的copy指令碼.
SELECT 'datafile '||''''||name||''''||' to '||''''||'/data'||name||''''||',' FROM v$datafile; 或者
SELECT 'datafile '||''''||name||''''||' to '||''''||name||''''||',' FROM v$datafile;
RMAN IMAGE COPY指令碼:
RUN {
ALLOCATE CHANNEL XXXX DEVICE TYPE DISK;
COPY
...........,
…..----- 這裡放入上面SQL生成的指令碼 .
……… ;
RELEASE CHANNEL XXXX;}
指令碼例子 (如果在Data Guard Server上檔案路徑有變化, 即與Primary DB上路徑不一樣, 我們會在生成控制檔案後, 在Data Guard DB上Mount狀態下使用 alter database rename file 更改數據檔案路徑, 指令碼中前面的檔案路徑表示Primary DB上的路徑, 後面的路徑表示Data Guard Server上的檔案路徑 ) . 有時候可能後面的路徑需要修改 。 那麼指令碼需要手工編輯。
RUN {
ALLOCATE CHANNEL XXXX DEVICE TYPE DISK;
COPY
datafile '/ocfs_data/intel/system01.dbf' to '/ocfs_data/intel/system01.dbf',
datafile '/ocfs_data/intel/undotbs01.dbf' to '/ocfs_data/intel/undotbs01.dbf',
datafile '/ocfs_data/intel/cwmlite01.dbf' to '/ocfs_data/intel/cwmlite01.dbf',
datafile '/ocfs_data/intel/drsys01.dbf' to '/ocfs_data/intel/drsys01.dbf',
datafile '/ocfs_data/intel/indx01.dbf' to '/ocfs_data/intel/indx01.dbf',
datafile '/ocfs_data/intel/tools01.dbf' to '/ocfs_data/intel/tools01.dbf',
datafile '/ocfs_data/intel/users01.dbf' to '/ocfs_data/intel/users01.dbf',
datafile '/ocfs_data/intel/xdb01.dbf' to '/ocfs_data/intel/xdb01.dbf',
datafile '/ocfs_data/intel/undotbs02.dbf' to '/ocfs_data/intel/undotbs02.dbf',
datafile '/ocfs_data/intel/base_data01.dbf' to '/ocfs_data/intel/base_data01.dbf',
datafile '/ocfs_data/intel/base_data02.dbf' to '/ocfs_data/intel/base_data02.dbf',
datafile '/ocfs_data/intel/base_data03.dbf' to '/ocfs_data/intel/base_data03.dbf',
datafile '/ocfs_data/intel/base_data04.dbf' to '/ocfs_data/intel/base_data04.dbf',
datafile '/ocfs_data/intel/base_data05.dbf' to '/ocfs_data/intel/base_data05.dbf',
datafile '/ocfs_data/intel/base_data06.dbf' to '/ocfs_data/intel/base_data06.dbf',
datafile '/ocfs_index/intel/base_idx01.dbf' to '/ocfs_index/intel/base_idx01.dbf',
datafile '/ocfs_index/intel/base_idx02.dbf' to '/ocfs_index/intel/base_idx02.dbf',
datafile '/ocfs_index/intel/base_idx03.dbf' to '/ocfs_index/intel/base_idx03.dbf',
datafile '/ocfs_data/intel/log_data01.dbf' to '/ocfs_data/intel/log_data01.dbf',
datafile '/ocfs_data/intel/log_data02.dbf' to '/ocfs_data/intel/log_data02.dbf',
datafile '/ocfs_data/intel/log_data03.dbf' to '/ocfs_data/intel/log_data03.dbf',
datafile '/ocfs_data/intel/log_data04.dbf' to '/ocfs_data/intel/log_data04.dbf',
datafile '/ocfs_data/intel/log_data05.dbf' to '/ocfs_data/intel/log_data05.dbf',
datafile '/ocfs_data/intel/log_data06.dbf' to '/ocfs_data/intel/log_data06.dbf',
datafile '/ocfs_data/intel/log_data07.dbf' to '/ocfs_data/intel/log_data07.dbf',
datafile '/ocfs_data/intel/log_data08.dbf' to '/ocfs_data/intel/log_data08.dbf',
datafile '/ocfs_index/intel/log_index01.dbf' to '/ocfs_index/intel/log_index01.dbf',
datafile '/ocfs_index/intel/log_index02.dbf' to '/ocfs_index/intel/log_index02.dbf',
datafile '/ocfs_index/intel/log_index03.dbf' to '/ocfs_index/intel/log_index03.dbf',
datafile '/ocfs_index/intel/log_index04.dbf' to '/ocfs_index/intel/log_index04.dbf',
datafile '/ocfs_index/intel/log_index05.dbf' to '/ocfs_index/intel/log_index05.dbf',
datafile '/ocfs_index/intel/log_index06.dbf' to '/ocfs_index/intel/log_index06.dbf',
datafile '/ocfs_data/intel/track_data01.dbf' to '/ocfs_data/intel/track_data01.dbf',
datafile '/ocfs_data/intel/track_data02.dbf' to '/ocfs_data/intel/track_data02.dbf',
datafile '/ocfs_data/intel/track_data03.dbf' to '/ocfs_data/intel/track_data03.dbf',
datafile '/ocfs_data/intel/track_data04.dbf' to '/ocfs_data/intel/track_data04.dbf',
datafile '/ocfs_index/intel/track_index01.dbf' to '/ocfs_index/intel/track_index01.dbf',
datafile '/ocfs_index/intel/track_index02.dbf' to '/ocfs_index/intel/track_index02.dbf',
datafile '/ocfs_index/intel/track_index03.dbf' to '/ocfs_index/intel/track_index03.dbf',
datafile '/ocfs_index/intel/track_index04.dbf' to '/ocfs_index/intel/track_index04.dbf',
datafile '/ocfs_data/intel/sn_data01.dbf' to '/ocfs_data/intel/sn_data01.dbf',
datafile '/ocfs_data/intel/sn_data02.dbf' to '/ocfs_data/intel/sn_data02.dbf',
datafile '/ocfs_data/intel/sn_data03.dbf' to '/ocfs_data/intel/sn_data03.dbf',
datafile '/ocfs_data/intel/sn_data04.dbf' to '/ocfs_data/intel/sn_data04.dbf',
datafile '/ocfs_data/intel/sn_data05.dbf' to '/ocfs_data/intel/sn_data05.dbf',
datafile '/ocfs_data/intel/sn_data06.dbf' to '/ocfs_data/intel/sn_data06.dbf',
datafile '/ocfs_data/intel/sn_data07.dbf' to '/ocfs_data/intel/sn_data07.dbf',
datafile '/ocfs_data/intel/sn_data08.dbf' to '/ocfs_data/intel/sn_data08.dbf',
datafile '/ocfs_data/intel/sn_data09.dbf' to '/ocfs_data/intel/sn_data09.dbf',
datafile '/ocfs_data/intel/sn_data10.dbf' to '/ocfs_data/intel/sn_data10.dbf',
datafile '/ocfs_data/intel/sn_data11.dbf' to '/ocfs_data/intel/sn_data11.dbf',
datafile '/ocfs_data/intel/sn_data12.dbf' to '/ocfs_data/intel/sn_data12.dbf',
datafile '/ocfs_data/intel/sn_data13.dbf' to '/ocfs_data/intel/sn_data13.dbf',
datafile '/ocfs_data/intel/sn_data14.dbf' to '/ocfs_data/intel/sn_data14.dbf',
datafile '/ocfs_data/intel/sn_data15.dbf' to '/ocfs_data/intel/sn_data15.dbf',
datafile '/ocfs_data/intel/sn_data16.dbf' to '/ocfs_data/intel/sn_data16.dbf',
datafile '/ocfs_data/intel/sn_data17.dbf' to '/ocfs_data/intel/sn_data17.dbf',
datafile '/ocfs_data/intel/sn_data18.dbf' to '/ocfs_data/intel/sn_data18.dbf',
datafile '/ocfs_index/intel/sn_idx01.dbf' to '/ocfs_index/intel/sn_idx01.dbf',
datafile '/ocfs_index/intel/sn_idx02.dbf' to '/ocfs_index/intel/sn_idx02.dbf',
datafile '/ocfs_index/intel/sn_idx03.dbf' to '/ocfs_index/intel/sn_idx03.dbf',
datafile '/ocfs_index/intel/sn_idx04.dbf' to '/ocfs_index/intel/sn_idx04.dbf',
datafile '/ocfs_index/intel/sn_idx05.dbf' to '/ocfs_index/intel/sn_idx05.dbf',
datafile '/ocfs_index/intel/sn_idx06.dbf' to '/ocfs_index/intel/sn_idx06.dbf',
datafile '/ocfs_index/intel/sn_idx07.dbf' to '/ocfs_index/intel/sn_idx07.dbf',
datafile '/ocfs_index/intel/sn_idx08.dbf' to '/ocfs_index/intel/sn_idx08.dbf',
datafile '/ocfs_index/intel/sn_idx09.dbf' to '/ocfs_index/intel/sn_idx09.dbf',
datafile '/ocfs_index/intel/sn_idx10.dbf' to '/ocfs_index/intel/sn_idx10.dbf',
datafile '/ocfs_index/intel/sn_idx11.dbf' to '/ocfs_index/intel/sn_idx11.dbf',
datafile '/ocfs_index/intel/sn_idx12.dbf' to '/ocfs_index/intel/sn_idx12.dbf',
datafile '/ocfs_index/intel/sn_idx13.dbf' to '/ocfs_index/intel/sn_idx13.dbf',
datafile '/ocfs_index/intel/sn_idx14.dbf' to '/ocfs_index/intel/sn_idx14.dbf',
datafile '/ocfs_index/intel/sn_idx15.dbf' to '/ocfs_index/intel/sn_idx15.dbf',
datafile '/ocfs_index/intel/sn_idx16.dbf' to '/ocfs_index/intel/sn_idx16.dbf',
datafile '/ocfs_index/intel/sn_idx17.dbf' to '/ocfs_index/intel/sn_idx17.dbf',
datafile '/ocfs_data/intel/ict_data01.dbf' to '/ocfs_data/intel/ict_data01.dbf',
datafile '/ocfs_data/intel/ict_data02.dbf' to '/ocfs_data/intel/ict_data02.dbf',
datafile '/ocfs_data/intel/ict_data03.dbf' to '/ocfs_data/intel/ict_data03.dbf',
datafile '/ocfs_data/intel/ict_data04.dbf' to '/ocfs_data/intel/ict_data04.dbf',
datafile '/ocfs_data/intel/ict_data05.dbf' to '/ocfs_data/intel/ict_data05.dbf',
datafile '/ocfs_index/intel/ict_idx01.dbf' to '/ocfs_index/intel/ict_idx01.dbf',
datafile '/ocfs_index/intel/ict_idx02.dbf' to '/ocfs_index/intel/ict_idx02.dbf',
datafile '/ocfs_index/intel/ict_idx03.dbf' to '/ocfs_index/intel/ict_idx03.dbf',
datafile '/ocfs_index/intel/ict_idx04.dbf' to '/ocfs_index/intel/ict_idx04.dbf',
datafile '/ocfs_index/intel/ict_idx05.dbf' to '/ocfs_index/intel/ict_idx05.dbf',
datafile '/ocfs_data/intel/rec_data01.dbf' to '/ocfs_data/intel/rec_data01.dbf',
datafile '/ocfs_data/intel/rec_data02.dbf' to '/ocfs_data/intel/rec_data02.dbf',
datafile '/ocfs_index/intel/rec_idx01.dbf' to '/ocfs_index/intel/rec_idx01.dbf',
datafile '/ocfs_index/intel/rec_idx02.dbf' to '/ocfs_index/intel/rec_idx02.dbf',
datafile '/ocfs_data/intel/wiplog_data01.dbf' to '/ocfs_data/intel/wiplog_data01.dbf',
datafile '/ocfs_data/intel/wiplog_data02.dbf' to '/ocfs_data/intel/wiplog_data02.dbf',
datafile '/ocfs_data/intel/wiplog_data03.dbf' to '/ocfs_data/intel/wiplog_data03.dbf',
datafile '/ocfs_data/intel/wiplog_data04.dbf' to '/ocfs_data/intel/wiplog_data04.dbf',
datafile '/ocfs_data/intel/wiplog_data05.dbf' to '/ocfs_data/intel/wiplog_data05.dbf',
datafile '/ocfs_data/intel/wiplog_data06.dbf' to '/ocfs_data/intel/wiplog_data06.dbf',
datafile '/ocfs_data/intel/wiplog_data07.dbf' to '/ocfs_data/intel/wiplog_data07.dbf',
datafile '/ocfs_index/intel/wiplog_idx01.dbf' to '/ocfs_index/intel/wiplog_idx01.dbf',
datafile '/ocfs_index/intel/wiplog_idx02.dbf' to '/ocfs_index/intel/wiplog_idx02.dbf',
datafile '/ocfs_index/intel/wiplog_idx03.dbf' to '/ocfs_index/intel/wiplog_idx03.dbf',
datafile '/ocfs_index/intel/wiplog_idx04.dbf' to '/ocfs_index/intel/wiplog_idx04.dbf',
datafile '/ocfs_index/intel/wiplog_idx05.dbf' to '/ocfs_index/intel/wiplog_idx05.dbf',
datafile '/ocfs_index/intel/wiplog_idx06.dbf' to '/ocfs_index/intel/wiplog_idx06.dbf',
datafile '/ocfs_index/intel/wiplog_idx07.dbf' to '/ocfs_index/intel/wiplog_idx07.dbf',
datafile '/ocfs_data/intel/undotbs01_1.dbf' to '/ocfs_data/intel/undotbs01_1.dbf',
datafile '/ocfs_data/intel/undotbs01_2.dbf' to '/ocfs_data/intel/undotbs01_2.dbf',
datafile '/ocfs_data/intel/undotbs02_1.dbf' to '/ocfs_data/intel/undotbs02_1.dbf',
datafile '/ocfs_data/intel/ict_data06.dbf' to '/ocfs_data/intel/ict_data06.dbf',
datafile '/ocfs_data/intel/undotbs02_2.dbf' to '/ocfs_data/intel/undotbs02_2.dbf',
datafile '/ocfs_data/intel/ict_data07.dbf' to '/ocfs_data/intel/ict_data07.dbf',
datafile '/ocfs_index/intel/wiplog_idx08.dbf' to '/ocfs_index/intel/wiplog_idx08.dbf',
datafile '/ocfs_data/intel/ict_data08.dbf' to '/ocfs_data/intel/ict_data08.dbf',
datafile '/ocfs_index/intel/sn_idx18.dbf' to '/ocfs_index/intel/sn_idx18.dbf',
datafile '/ocfs_index/intel/track_index05.dbf' to '/ocfs_index/intel/track_index05.dbf',
datafile '/ocfs_data/intel/ict_data09.dbf' to '/ocfs_data/intel/ict_data09.dbf' ;
RELEASE CHANNEL XXXX;}
假設指令碼檔案儲存為 rman.txt 檔案 .
說明:
需要先將將要成為dataguard伺服器的檔案存放目錄使用NFS映像至目標伺服器(Primary DB Server ) 相關目錄.
具體步驟如下:
Linux下NFS的配置
2.3. NFS server端(在此處為Data Guard伺服器)及客戶端(Primary DB Server)設定:
2.3.1 在/etc/exports 釋出掛載的目錄.
如: /data *(rw,no_root_squash)
/data為data guard server上分享的目錄,*表示允許任何主機分享,rw,no_root_squash為參數
代表意義如下:
rw: 可讀寫的許可權
ro: 只讀的許可權
no_root_squash: 登入 NFS 主機使用分享目錄的使用者,如果是 root 的話,那麼對於這個分享的目錄來說,他就具有 root 的許可權!
root_squash: 在登入 NFS 主機使用分享之目錄的使用者如果是 root 時,那麼這個使用者的許可權將被壓縮成為匿名使用者.
2.3.2 在Data Gurad DB Server上啟動兩個相關服務
#/etc/rc.d/init.d/portmap start (or:#service portmap start)
#/etc/rc.d/init.d/nfs start (or:#service nfs start)
2.3.3. NFS客戶端的設定(TARGET伺服器, 即Primary database Server )
不用其它設定,直接掛載就可以了
#mount -t nfs dataguard_server_ip:/directory /mountpoint
/mountpoint 為Primary Database Server上的掛載點 .
如:
mount -t nfs 10.161.8.83:/data /backup
在Copy datafile
`/data/xx/xx.dbf' to `/backup/data/xx/xx.dbf'中.
第一個'/data/xx/xx.dbf'是目標伺服器的數據檔案地址. `/backup/data/xx/xx.dbf'是掛載到目標伺服器上的dataguard的相應目錄.
2.4在目錄伺服器(Data Guard Server) RMAN環境下執行以上的指令碼
先rman連接目標伺服器與目錄伺服器 .
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-84420/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 利用RMAN 建立Oracle9i RAC Data Guard (updated)Oracle
- 利用RMAN 建立Oracle9i RAC Data Guard(完善版)Oracle
- Oracle RAC + Data Guard 環境搭建Oracle
- 實戰11g active data guard on rac
- Linux下的Oracle9i data guard配置過程LinuxOracle
- Implementing Oracle9i Data Guard for Higher AvailabilityOracleAI
- Oracle 11g RAC Data Guard 物理standby 建立Oracle
- Data Guard 之RMAN備份線上搭建物理standby
- oracle9i(9204)dg(data guard)_ place the standby database in manual recovery modeOracleDatabase
- DATA GUARD部署模式——DATA GUARD概念和管理模式
- 利用RMAN建立10GRAC資料庫的DATA GUARD資料庫
- 介紹ORACLE DATA GUARD——DATA GUARD概念和管理Oracle
- 使用Data Guard Broker進行Data Guard物理備用庫配置(Oracle 19c)Oracle
- Data guard搭建
- oracle data guard!!Oracle
- 2 開始實用 Oracle Data GuardOracle
- 管理ORACLE RAC GUARD——RAC GUARD概念和管理Oracle
- ORACLE RAC GUARD操作——RAC GUARD概念和管理Oracle
- oracle9i(9204)data guard(dg)_logical standby_failover操作指南OracleAI
- Oracle RAC & Data Guard搭建高可用資料庫系統方案Oracle資料庫
- ORACLE RAC GUARD故障排除——RAC GUARD概念和管理Oracle
- 定製ORACLE RAC GUARD——RAC GUARD概念和管理Oracle
- 使用ORACLE RAC GUARD命令——RAC GUARD概念和管理Oracle
- ORACLE RAC GUARD架構——RAC GUARD概念和管理Oracle架構
- Data Guard Broker系列之二:Data Guard Broker配置實戰
- creating oracle10g data guard using rman(physical db)Oracle
- using rman to creat oracle10g data guard standby db_with recoveryOracle
- DATA GUARD 簡介
- Data Guard 建立(ASM)ASM
- Oracle Data Guard配置Oracle
- ORACLE RAC GUARD配置引數——RAC GUARD概念和管理Oracle
- Oracle 11g Data Guard Enabling Active Data GuardOracle
- [Data Guard]Oracle10g Data Guard學習筆記(一)Oracle筆記
- [Data Guard]Oracle10g Data Guard學習筆記(二)Oracle筆記
- [Data Guard]Oracle10g Data Guard學習筆記(三)Oracle筆記
- ORACLE11G RAC 環境搭建物理 DATA GUARD (不用duplicate)Oracle
- RAC和Data Guard環境中修改使用者密碼密碼
- Data Guard新特性:快照備用資料庫資料庫