环境:
OS:AIX 5.3
DB:11.2.0.1
1.为某个表空间添加数据文件
alter tablespace TPS_HXL
add datafile '/u01/app/oracle/oradata/oracl/hxl02.dbf' size 50m
;
2.日志切换
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
System altered
3.关闭数据库后删除步骤1创建的数据文件
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
$rm /u01/app/oracle/oradata/oracl/hxl02.dbf
4.尝试打开数据库
SQL> startup
ORACLE instance started.
Total System Global Area 626327552 bytes
Fixed Size 2209376 bytes
Variable Size 209717664 bytes
Database Buffers 411041792 bytes
Redo Buffers 3358720 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u01/app/oracle/oradata/oracl/hxl02.dbf'
提示数据文件hxl02.dbf找不到
5.创建该数据文件
SQL> alter database create datafile '/u01/app/oracle/oradata/oracl/hxl02.dbf';
Database altered.
6.尝试打开数据库
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/u01/app/oracle/oradata/oracl/hxl02.dbf'
这里提示需要恢复
7.恢复数据库
SQL> recover database;
Media recovery complete.
SQL> alter database open;
Database altered.
说明:
以上场景必须是:
1.该数据文件是新创建的,之前都没有备份过(RMAN备份)
2.创建该数据文件之后的归档日志必须完整.
阅读(4382) | 评论(0) | 转发(0) |