使用RMAN backup和restore方式部署物理備庫
本文件不包含以下內容:
主資料庫配置、引數、建立相關目錄、監聽器配置、tnsnames.ora配置、密碼檔案配置等,只列出主要步驟
一、主:
建立/u01/oracle_backup目錄:
備份引數檔案:
SQL> create pfile='/u01/oracle_backup/initlis.ora' from spfile;
備份資料:
rman target /
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
建立/u01/oracle_backup目錄:
備份引數檔案:
SQL> create pfile='/u01/oracle_backup/initlis.ora' from spfile;
備份資料:
rman target /
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
backup as compressed backupset format '/u02/orabackup/level0/ncf_db%U' database plus archivelog;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
備份控制檔案:
run{
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
備份控制檔案:
run{
allocate channel c1 type disk;
backup format '/u02/orabackup/level0/control%U' current controlfile for standby;
release channel c1;
}
二、複製備份檔案到備庫主機,也就是/u01/oracle_backup
二、複製備份檔案到備庫主機,也就是/u01/oracle_backup
三、備:
按需修改目標端引數檔案
rman target /
RMAN> startup nomount;
RMAN> restore standby controlfile from '/u01/oracle_backup/control1bqgo42a_1_1';
RMAN> sql 'alter database mount standby database';
restore資料庫
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
restore database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
recover資料庫
RMAN> list backup of archivelog all;
找到要恢復到的最大序列號,比如有36的話,那就應該until 37
RMAN> recover database until sequence 37;
RMAN> exit
sqlplus / as sysdba;
SQL> alter database recover managed standby database using current logfile disconnect;
SQL> alter database recover managed standby database cancel;
SQL> alter database open;
SQL> alter database recover managed standby database using current logfile disconnect;
按需修改目標端引數檔案
rman target /
RMAN> startup nomount;
RMAN> restore standby controlfile from '/u01/oracle_backup/control1bqgo42a_1_1';
RMAN> sql 'alter database mount standby database';
restore資料庫
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
restore database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
}
recover資料庫
RMAN> list backup of archivelog all;
找到要恢復到的最大序列號,比如有36的話,那就應該until 37
RMAN> recover database until sequence 37;
RMAN> exit
sqlplus / as sysdba;
SQL> alter database recover managed standby database using current logfile disconnect;
SQL> alter database recover managed standby database cancel;
SQL> alter database open;
SQL> alter database recover managed standby database using current logfile disconnect;
在主庫上多切換幾次日誌,使用以下命令檢查備庫狀態:
select process,status from v$managed_standby;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26194851/viewspace-2120137/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 轉貼_RMAN-DBMS_BACKUP_RESTOREREST
- RMAN DUPLICATE建立DataGuard物理備庫
- How to restore and recover a database from an RMAN backup_881395.1RESTDatabase
- dataguard回顧之安裝———使用rman建立物理備庫
- RMAN : Consistent Backup, Restore and Recovery using RMAN (Doc ID 162855.1)REST
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- db2備份恢復(backup restore)DB2REST
- RMAN-06100: no channel to restore a backup or copy of datafileREST
- 通過RMAN Duplicate建立Oracle物理standby備庫Oracle
- 使用RMAN DUPLICATE...FROM ACTIVE DATABASE命令來建立DataGuard物理備庫Database
- Backup And Recovery User's Guide-備份RMAN備份-使用RMAN備份備份集GUIIDE
- 刪除表空間,有rman全備的恢復(使用dbms_backup_restore來進行恢復)REST
- 使用RMAN建立物理Standby資料庫資料庫
- 使用dbms_backup_restore進行資料庫恢復REST資料庫
- 在物理備庫上部署閃回資料庫資料庫
- RMAN-06023 no backup or copy of datafile 1 found to restoreREST
- 備份恢復統計資訊 backup and restore statsREST
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份資料庫檔案GUIIDE資料庫
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份控制檔案GUIIDE資料庫
- 10 管理物理和快照備庫
- 【DG】備庫RMAN還原方式搭建DG(不使用duplicate命令)
- SQL Server Backup & RestoreSQLServerREST
- TFS Express backup and restoreExpressREST
- backup and restore tipsREST
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份表空間和資料檔案GUIIDE資料庫
- rman備份驗證(之restore validate)REST
- 由某公司案例進一步掌握rman備份與恢復backup restore recovery系列一REST
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-RMAN備份的目的GUIIDE資料庫
- 使用begin backup備份資料庫資料庫
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-為RMAN備份指定TAGGUIIDE資料庫
- 使用 RMAN DUPLICATE...FROM ACTIVE DATABASE 建立物理備用資料庫的分步指南Database資料庫
- Backup And Recovery User's Guide-備份資料庫-使用RMAN備份歸檔重做日誌GUIIDE資料庫
- postgresql物理備份工具pg_rman的使用詳解SQL
- Cold backup and restore the entire databaseRESTDatabase
- Backup And Recovery User's Guide-備份資料庫-RMAN備份概覽-為RMAN備份指定格式GUIIDE資料庫
- 使用RMAN備份資料庫資料庫
- 應對RMAN-06026錯誤,使用dbms_backup_restore進行恢復REST
- 【DG】怎麼使用Data Pump備份物理備庫