使用duplicate克隆資料庫
用途
1
建立物理備庫
2
克隆資料庫
會自動為其分配新的DBID,由於Redo log無法歸檔,因此須執行point-in-time recovery
相比傳統的手工copy,duplicate自動化了一系列工作
建立引數檔案(可選)
自動從active database搜尋滿足until條件的controlfile並mount,restore資料檔案並使用增量備份或archive log恢復到指定時間點;
重啟資料庫至nomount,新建控制檔案(新DBID)
Open resetlogs資料庫
操作型別
有兩種方式:
Active duplication
Backup-based duplication
限制
Source/target db必須位於同一OS平臺,32bit/64bit屬於同一平臺
至少需要一個auxiliary channel
Active duplication:source/auxiliary例項 使用相同的sysdba密碼
如果操作失敗,將auxiliary instance置為nomount重新執行,會跳過已經完成的資料檔案;也可使用noresume忽略此功能;
引數
For standby— 建立standby,如果複製spfile則指定db_unique_name;不可與to database_name共存;dorecover會在restore資料庫後進行recover;如果連線了catalog資料庫會自動被註冊;
Backup location— 指定備份集的路徑,沒有rman target/catalog連線時使用
Logfile— 指定online redo,用於non-standby
Nofilenamecheck— 不執行datafile/online redo名字檢查,當source/target的檔案路徑一致時使用,否則會抱錯,因為rman無法分辨不同host;當source/target為同一host則不要使用;
Password file— 複製source db的密碼檔案覆蓋auxiliary instance,只用於active database;如果指定for standby,預設自動複製;
Spfile— 複製source db的spfile
Source Database Files |
Active Database |
Backup-Based |
Control files |
Copied from source database when FOR STANDBY specified; otherwise re-created |
Restored from backups when FOR STANDBY specified or duplication without a connection to the target database; otherwise re-created |
Data files |
Copied from source database (unless excluded with a SKIP option) |
Restored from backups (unless excluded with a SKIP option) |
Temp files |
Re-created (see ) |
Re-created (see ) |
Online redo log files |
Re-created |
Re-created |
Standby redo log files |
Re-created when FOR STANDBY specified and defined on primary database |
Re-created when FOR STANDBY specified and defined on primary database |
Archived redo log files |
Copied from source database, but only if needed for the duplication |
Obtained from backups or cataloged copies, but only if needed for the duplication |
Server parameter file |
Copied from source database (see SPFILE clause in ) |
Restored from backup if SPFILE clause is specified (see ) |
Flashback log files |
Not re-created |
Not re-created |
Block change tracking file |
Not re-created |
Not re-created |
Password file |
Copied by default for standby databases; for nonstandby databases, copied only if PASSWORD FILE option is specified |
Not re-created |
Backups and other files in fast recovery area |
Not copied |
Not copied |
--建立standby
DUPLICATE TARGET DATABASE
FOR STANDBY
FROM ACTIVE DATABASE
PASSWORD FILE
SPFILE
PARAMETER_VALUE_CONVERT '/disk1', '/disk2'
SET DB_FILE_NAME_CONVERT '/disk1','/disk2'
SET LOG_FILE_NAME_CONVERT '/disk1','/disk2'
SET DB_UNIQUE_NAME 'dup1'
SET SGA_MAX_SIZE 200M
SET SGA_TARGET 125M;
--克隆資料庫
DUPLICATE DATABASE TO dupdb
UNTIL TIME "TO_DATE('11/01/2007 14:00:00', 'MM/DD/YYYY HH24:MI:SS')"
SPFILE
BACKUP LOCATION '/prod_backups'
NOFILENAMECHECK;
DUPLICATE TARGET DATABASE TO dupdb
FROM ACTIVE DATABASE
SPFILE
PARAMETER_VALUE_CONVERT '/oracle/oradata/prod/', '+DISK1'
SET DB_CREATE_FILE_DEST +DISK1;
RUN
{
ALLOCATE AUXILIARY CHANNEL newdb DEVICE TYPE sbt;
DUPLICATE TARGET DATABASE TO newdb
PFILE ?/dbs/initNEWDB.ora
UNTIL TIME 'SYSDATE-1' # specifies incomplete recovery
SKIP TABLESPACE example, history # skip desired tablespaces
DB_FILE_NAME_CONVERT ('/h1/oracle/dbs/trgt/','/h2/oracle/oradata/newdb/')
LOGFILE
GROUP 1 ('/h2/oradata/newdb/redo01_1.f',
'/h2/oradata/newdb/redo01_2.f') SIZE 4M,
GROUP 2 ('/h2/oradata/newdb/redo02_1.f',
'/h2/oradata/newdb/redo02_2.f') SIZE 4M,
GROUP 3 ('/h2/oradata/newdb/redo03_1.f',
'/h2/oradata/newdb/redo03_2.f') SIZE 4M REUSE;
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15480802/viewspace-763451/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用RMAN建立Duplicate資料庫資料庫
- 2.10.1.2 使用CloneDB克隆資料庫資料庫
- 【RMAN】使用duplicate本地複製資料庫資料庫
- 2.10.1.3 使用 CloneDB克隆資料庫後續資料庫
- 2.10.1.1 有關使用CloneDB克隆資料庫資料庫
- 使用rman的命令duplicate複製資料庫資料庫
- 2.10 克隆資料庫資料庫
- 【RMAN】使用RMAN duplicate複製同機資料庫資料庫
- 【DATAGUARD 學習】使用duplicate 建立物理standby 資料庫資料庫
- 透過Oracle的duplicate database to 【newsid】實現資料庫克隆;OracleDatabase資料庫
- 【轉】RMAN建立duplicate資料庫資料庫
- 靜默建立oracle資料庫及克隆資料庫Oracle資料庫
- 克隆資料庫之使用者管理複製(三)資料庫
- 克隆資料庫之使用者管理複製(二)資料庫
- 克隆資料庫之使用者管理複製(一)資料庫
- 使用RMAN Duplicate方法搭建異名資料庫實驗資料庫
- 使用RMAN高階應用之Duplicate複製資料庫資料庫
- 使用RMAN duplicate 建立standby資料庫(RAC或單機)資料庫
- ORACLE DUPLICATE建立物理standby資料庫Oracle資料庫
- Oracle 之 Duplicate 複製資料庫Oracle資料庫
- DUPLICATE遠端複製資料庫資料庫
- duplicate資料庫的操作步驟資料庫
- RMAN duplicate 建立standby RAC資料庫資料庫
- Oracle 11gR2 使用RMAN Duplicate複製資料庫Oracle資料庫
- Oracle11gR2使用RMAN duplicate複製資料庫Oracle資料庫
- 克隆資料庫之RMAN複製(二)資料庫
- 克隆資料庫之RMAN複製(一)資料庫
- duplicate複製資料庫(rac-rac)資料庫
- duplicate rman複製資料庫技術資料庫
- 恢復之RAC資料庫DUPLICATE(一)資料庫
- 2.10.3 使用 Oracle Automatic Storage Management (Oracle ASM) 克隆資料庫OracleASM資料庫
- 一次使用duplicate建立測試資料庫的過程資料庫
- Oracle 如何快速的 duplicate 一個資料庫Oracle資料庫
- RMAN duplicate from active database 複製資料庫Database資料庫
- Duplicate 複製資料庫實驗過程資料庫
- Rman duplicate資料庫複製(單系統)資料庫
- 【RMAN】使用RMAN duplicate複製同機資料庫遇到的問題資料庫
- 用RMAN執行DUPLICATE資料庫操作——RMAN使用者手冊資料庫