rman整库备份还原.docx
- 文档编号:14228416
- 上传时间:2023-06-21
- 格式:DOCX
- 页数:9
- 大小:276.70KB
rman整库备份还原.docx
《rman整库备份还原.docx》由会员分享,可在线阅读,更多相关《rman整库备份还原.docx(9页珍藏版)》请在冰点文库上搜索。
rman整库备份还原
整库丢失
1登录rman
rmantarget/
2备份数据库和归档文件
backupdatabaseplusarchivelogall;
3产看备份情况
listbackup;
4模拟数据变化
createtabletest31asselect*fromdba_users;
altersystemswitchlogfile;
createtabletest32asselect*fromdba_users;
altersystemswitchlogfile;
createtabletest33asselect*fromdba_users;
5删除整个数据库
cd/home/app/oracle/oradata
rm–rfora
数据库已经损坏
6根据数据库启动流程,首先恢复spfile
viinitora.ora
i
db_name='ora'
:
wq
-bash-4.2$sqlplus/assysdba
shutimmediateforce;
还原数据库
找到备份文件
rmantarget/
进入rman设置dbid为备份片的id
setdbid=1589493431
还原数据库
恢复控制文件
restorecontrolfilefromautobackup;
设置数据库为mount状态
alterdatabasemount;
恢复数据库
restoredatabase;
recoverdatabase;
Startingrecoverat22-MAR-18
usingchannelORA_DISK_1
startingmediarecovery
archivedlogforthread1withsequence10isalreadyondiskasfile/home/archivelog/1_10_971265017.dbf
archivedlogforthread1withsequence11isalreadyondiskasfile/home/archivelog/1_11_971265017.dbf
archivedlogfilename=/home/archivelog/1_10_971265017.dbfthread=1sequence=10
archivedlogfilename=/home/archivelog/1_11_971265017.dbfthread=1sequence=11
unabletofindarchivedlog
archivedlogthread=1sequence=12
RMAN-00571:
===========================================================
RMAN-00569:
===============ERRORMESSAGESTACKFOLLOWS===============
RMAN-00571:
===========================================================
RMAN-03002:
failureofrecovercommandat03/22/201813:
57:
25
RMAN-06054:
mediarecoveryrequestingunknownarchivedlogforthread1withsequence12andstartingSCNof1879455
开始恢复在22-MAR-18
使用通道ORA_DISK_1
媒体开始复苏
以序列10为线程1的归档日志已经在磁盘上作为文件/home/archivelog/1_10_971265017.dbf。
以序列11为线程1的归档日志已经在磁盘上作为文件/home/archivelog/1_11_971265017.dbf。
归档日志文件名称=/home/archivelog_10_971265017/1。
dbf线程=1序列=10
归档日志文件名称=/home/archivelog_11_971265017/1。
dbf线程=1=11序列
无法找到归档日志。
归档日志线程=1序列=12
rman-00571:
===========================================================
rman-00569:
===============错误消息堆栈如下===============
rman-00571:
===========================================================
RMAN-03002:
故障恢复命令在03/22/201813:
57:
25。
RMAN-06054:
媒体恢复请求未知存档的线程1的归档日志,并使用序列12和启动SCN(1879455)。
报错找不到归档日志,用已下命令手动回复归档
catalogstartwith'/home/archivelog/';
刷新数据库日志
SQL>alterdatabaseopenresetlogs;
Databasealtered.
SQL>selectstatusfromv$instance;
STATUS
------------
OPEN
查看原来创建的test313233回复回来没有了
完成数据库恢复
下面是一些报错的记录
RMAN>recoverdatabase;
Startingrecoverat22-MAR-18
usingchannelORA_DISK_1
startingmediarecovery
unabletofindarchivedlog
archivedlogthread=1sequence=10
RMAN-00571:
===========================================================
RMAN-00569:
===============ERRORMESSAGESTACKFOLLOWS===============
RMAN-00571:
===========================================================
RMAN-03002:
failureofrecovercommandat03/22/201813:
55:
51
RMAN-06054:
mediarecoveryrequestingunknownarchivedlogforthread1withsequence10andstartingSCNof1878762
RMAN>catalogstartwith'/home/archivelog/';
searchingforallfilesthatmatchthepattern/home/archivelog/
ListofFilesUnknowntotheDatabase
=====================================
FileName:
/home/archivelog/1_10_971265017.dbf
FileName:
/home/archivelog/1_11_971265017.dbf
Doyoureallywanttocatalogtheabovefiles(enterYESorNO)?
yes
catalogingfiles...
catalogingdone
ListofCatalogedFiles
=======================
FileName:
/home/archivelog/1_10_971265017.dbf
FileName:
/home/archivelog/1_11_971265017.dbf
RMAN>recoverdatabase
2>;
Startingrecoverat22-MAR-18
usingchannelORA_DISK_1
startingmediarecovery
archivedlogforthread1withsequence10isalreadyondiskasfile/home/archivelog/1_10_971265017.dbf
archivedlogforthread1withsequence11isalreadyondiskasfile/home/archivelog/1_11_971265017.dbf
archivedlogfilename=/home/archivelog/1_10_971265017.dbfthread=1sequence=10
archivedlogfilename=/home/archivelog/1_11_971265017.dbfthread=1sequence=11
unabletofindarchivedlog
archivedlogthread=1sequence=12
RMAN-00571:
===========================================================
RMAN-00569:
===============ERRORMESSAGESTACKFOLLOWS===============
RMAN-00571:
===========================================================
RMAN-03002:
failureofrecovercommandat03/22/201813:
57:
25
RMAN-06054:
mediarecoveryrequestingunknownarchivedlogforthread1withsequence12andstartingSCNof1879455
RMAN>exit
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- rman 备份 还原