(一)數(shù)據(jù)庫備份
備份前需要關(guān)閉全部應(yīng)用,并進行數(shù)據(jù)庫checkpoint和crchive log current操作,數(shù)據(jù)庫無外部程序鏈接的前提下進行全備,確保數(shù)據(jù)庫一致性。
備份恢復(fù)詳細操作步驟如下:
lsnrctl stop
export ORACLE_SID=oracle11
sqlplus /nolog
conn / as sysdba
alter system checkpoint;
alter system archive log current
exit
rman target /
backup database format '/home/oracle/rman/%U'
exit
lsnrctl start
等待10分鐘左右數(shù)據(jù)庫備份完畢(根據(jù)庫的大小而定),備份集在/oracle/rman目錄下
(二)數(shù)據(jù)庫恢復(fù)
數(shù)據(jù)庫在備份前關(guān)閉所有應(yīng)用進行全庫備份,因此進行回退恢復(fù)時無需恢復(fù)歸檔日志,直接通過備份集進行回退恢復(fù)即可,
su - oracle
export ORACLE_SID=oracle11
rman target /
shutdown immediate
startup mount
restore database
alter database open
提示:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1: '/app/oracle/oradata/oracle11/system01.dbf'
RECOVER DATAFILE '/app/oracle/oradata/oracle11/system01.dbf'
recover tablespace system;
RECOVER DATABASE;
ALTER DATABASE OPEN;(完成恢復(fù))
文章標(biāo)題:恢復(fù)還原測試
本文網(wǎng)址:
http://weahome.cn/article/jjcjdd.html