使用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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- db2備份恢復(backup restore)DB2REST
- Oracle 12c 使用RMAN搭建物理備庫(RAC to RAC)Oracle
- Oracle rac使用nid和dbms_backup_restore包修改dbid和dbnameOracleREST
- 【DG】備庫RMAN還原方式搭建DG(不使用duplicate命令)
- DBMS_BACKUP_RESTORE.DBMS_BACKUP_RESTORE用於特殊情況下的恢復REST
- guarantee restore points-Flashback after RMAN restoreREST
- 使用RMAN備份資料庫資料庫
- postgresql物理備份工具pg_rman的使用詳解SQL
- cdc目標端資料庫初始化(backup restore)資料庫REST
- [20190228]Backup Restore Throttle sleep.txtREST
- 10 管理物理和快照備庫
- oracle資料庫使用rman備份指令碼Oracle資料庫指令碼
- RMAN加密備份的三種方式加密
- RMAN restore validate database報ORA-19693RESTDatabase
- 【RMAN】在備庫執行rman備份時報錯RMAN-06820 ORA-17629
- 12 使用RMAN備份和恢復檔案
- rman 還原歸檔日誌(restore archivelogRESTHive
- Oracle:Failover 到物理備庫OracleAI
- RMAN備份整庫和歸檔日誌的方法
- Using V$BACKUP_ASYNC_IO / V$BACKUP_SYNC_IO to Monitor RMAN PerformanceORM
- 用begin backup的方式遷移資料庫資料庫
- 利用RMAN備份重建資料庫資料庫
- PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.16.00.00 in TARGET database isSQLPackageRESTDatabase
- HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another NoRESTDatabase
- You may fail to backup log or restore log after TDE certification/key rotation.AIREST
- Oracle 11G RAC複製備庫RMAN-03002 RMAN-05501 RMAN-03015 RMAN-03009 RMAN-10038Oracle
- 【RMAN】RMAN備份至ASMASM
- ORACLE DG從庫 Rman備份恢復Oracle
- [20211020]改變備庫的rman配置.txt
- 理解RMAN backup database plus archivelog delete all input命令DatabaseHivedelete
- 【RMAN】RMAN的備份保留策略
- DBMS_BACKUP_RESTORE用於特殊情況下的恢復(轉)REST
- RMAN-03009: failure of backup command on ORA_DISK_1 channelAI
- 使用Handy Backup 6.2進行資料備份方法
- 如何使用Hyper Backup備份資料至異地
- milvus-backup安裝部署
- rman如何在備庫執行一致性備份
- Nexus私有maven庫部署和使用Maven
- SqlServer 備份集和備份片以及mirror的backup_set_idSQLServer