环境:Oracle10g、Red Hat 4,Oracle运行在归档模式。
场景:恢复未备份的数据文件。
具体步骤:
1、新建表空间testts,并建个表,插入些数据
SQL> create tablespace testts datafile '/home/oracle/oracle/product/oradata/orcl/testts01.dbf' size 10m;
Tablespace created.
SQL> create table testTab tablespace testts
2 as select * from scott.emp;
Table created.
SQL> select count(*) from testTab;
COUNT(*)
----------
14
SQL> commit;
Commit complete.
2、关库、删除数据文件,模拟数据文件损坏,注意没有备份哟
SQL> shutdown abort
SQL> !rm -f /home/oracle/oracle/product/oradata/orcl/testts01.dbf
3、尝试打开数据库
SQL> startup
ORACLE instance started.
Total System Global Area 130023424 bytes
Fixed Size 1218100 bytes
Variable Size 67111372 bytes
Database Buffers 58720256 bytes
Redo Buffers 2973696 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: '/home/oracle/oracle/product/oradata/orcl/testts01.dbf'
会提示数据文件无法找到。
5、重建数据文件,尝试打开数据库。
SQL> alter database create datafile '/home/oracle/oracle/product/oradata/orcl/testts01.dbf';
Database altered.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: '/home/oracle/oracle/product/oradata/orcl/testts01.dbf'
此时数据文件是个空的,当然需要介质恢复
6、介质恢复
SQL> recover database;
Media recovery complete.
7、打开数据库,查检数据是否恢复
SQL> alter database open;
Database altered.
SQL> select count(*) from testTab;
COUNT(*)
----------
14
全部数据都恢复回来了。
分享到:
相关推荐
1852-lab5.cpp
ZOL_Android-v10.09.02-full_encrypted_zol-ask_15_align.apk
程序可直接使用收发数据,如果遇到程序死循环,请一定仔细检查w5500的硬件电路,尤其与单片机通信的SPI接口,确保电路没问题,因为程序中会一直扫描socket,如果硬件连接不上,未收到返回值,会一直死循环。
后勤员工集体宿舍安全文明入住承诺书.docx
评标委员会成员评标意见表.doc
中国285个地级市实际和名义GDP-最新出炉.zip
Y2-63~400接线盒图纸
空间杜宾模型和检验和省市空间权重矩阵-最新出炉.zip
中国地图特辑数据-最新出炉.zip
空间计量超全学习资料-最新出炉.zip
环保、数字化词频分析-最新出炉.zip
PHISON PATA Application Tool适用于使用PHISON主控的SSD固态硬盘量产使用,可恢复出厂状态升级固件等。 注意是固态硬盘的量产工具,非U盘的。
11份常用面板数据-最新出炉.zip
锡柴生产物流仿真模型SPP 生产物流AGV调度算法
全球高程数据-最新出炉.zip
地理距离数据集-最新出炉.zip
c语言下通用的配置文件读写操作代码,可跨平台。
mysql
人工智能对抗生成网络学习路线图
SuperMarket Analysis.xlsx