oracle8i误删除临时表空间后的恢复

事故原因如下:
因磁盘空间达到95%,一同事去清理临时数据和log时,错误的执行了如下命令,清空了临时数据文件。

cat /dev/null > /opt/oracle/oradata/openview/OPC_TEMP_1.dbf
cat /dev/null > /opt/oracle/oradata/openview/OPC_TEMP_1.dbf
cat /dev/null > /opt/oracle/oradata/openview/OPC_TEMP_1.dbf
操作完後过段时间導致數據庫當機。

之后我在启动的时候报错如下:

Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
LICENSE_MAX_USERS = 0
Starting up ORACLE RDBMS Version: 8.1.7.0.0.
System parameters with non-default values:
  processes                = 50
  shared_pool_size         = 120000000
  control_files            = /opt/oracle/oradata/openview/control01.ctl, /opt/oracle/oradata/openview/control02.ctl, /opt/oracle/oradata/openview/control03.ctl
  db_block_buffers         = 550
  db_block_size            = 8192
  compatible               = 8.1.7.0.0
  log_archive_start        = FALSE
  log_archive_dest         = /opt/oracle/admin/openview/arch
  log_archive_format       = T%TS%S.ARC
  log_buffer               = 65536
  log_checkpoint_interval  = 99999
  db_files                 = 50
  db_file_multiblock_read_count= 8
  dml_locks                = 100
  rollback_segments        = r01, r02, r03, r04
  remote_os_authent        = TRUE
  db_name                  = openview
  open_cursors             = 500
  os_authent_prefix        =
  background_dump_dest     = /opt/oracle/admin/openview/bdump
  user_dump_dest           = /opt/oracle/admin/openview/udump
  max_dump_file_size       = 10240
  core_dump_dest           = /opt/oracle/admin/openview/cdump
PMON started with pid=2
DBW0 started with pid=3
LGWR started with pid=4
CKPT started with pid=5
SMON started with pid=6
RECO started with pid=7
Fri Jun 21 08:18:51 2013
ALTER DATABASE   MOUNT
Fri Jun 21 08:18:55 2013
Successful mount of redo thread 1, with mount id 2788845359.
Fri Jun 21 08:18:55 2013
Database mounted in Exclusive Mode.
Completed: ALTER DATABASE   MOUNT
Fri Jun 21 08:18:55 2013
ALTER DATABASE OPEN
Fri Jun 21 08:18:55 2013
Errors in file /opt/oracle/admin/openview/udump/ora_10395_openview.trc:
ORA-01110: data file 5: '/opt/oracle/oradata/openview/OPC_TEMP_1.dbf'
ORA-01115: IO error reading block from file 5 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
ORA-01110: data file 2: '/opt/oracle/oradata/openview/temp_1.dbf'
ORA-01115: IO error reading block from file 2 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
Fri Jun 21 08:18:55 2013
Errors in file /opt/oracle/admin/openview/udump/ora_10395_openview.trc:
ORA-01110: data file 21: '/opt/oracle/oradata/openview/OPC_TEMP_2.dbf'
ORA-01115: IO error reading block from file 21 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
ORA-01110: data file 2: '/opt/oracle/oradata/openview/temp_1.dbf'
ORA-01115: IO error reading block from file 2 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
ORA-1110 signalled during: ALTER DATABASE OPEN...
Fri Jun 21 08:20:09 2013
重新执行:
alter database open
Fri Jun 21 08:20:31 2013
Errors in file /opt/oracle/admin/openview/udump/ora_10401_openview.trc:
ORA-01110: data file 5: '/opt/oracle/oradata/openview/OPC_TEMP_1.dbf'
ORA-01115: IO error reading block from file 5 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
ORA-01110: data file 2: '/opt/oracle/oradata/openview/temp_1.dbf'
ORA-01115: IO error reading block from file 2 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
Fri Jun 21 08:20:31 2013
Errors in file /opt/oracle/admin/openview/udump/ora_10401_openview.trc:
ORA-01110: data file 21: '/opt/oracle/oradata/openview/OPC_TEMP_2.dbf'
ORA-01115: IO error reading block from file 21 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
ORA-01110: data file 2: '/opt/oracle/oradata/openview/temp_1.dbf'
ORA-01115: IO error reading block from file 2 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
ORA-1110 signalled during: alter database open
...
select status,instance_name from v$instance;
发现数据库在mounted状态下,仍然无法正常启动。
recover database;也不行。

最后确定清空的数据文件及所在表空间后做如下操作:

alter database datafile '/opt/oracle/oradata/openview/temp_1.dbf' offline drop
Fri Jun 21 08:56:45 2013
Completed: alter database datafile '/opt/oracle/oradata/openv
Fri Jun 21 08:57:02 2013
alter database open
Fri Jun 21 08:57:02 2013
Errors in file /opt/oracle/admin/openview/udump/ora_19584_openview.trc:
ORA-01110: data file 21: '/opt/oracle/oradata/openview/OPC_TEMP_2.dbf'
ORA-01115: IO error reading block from file 21 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
ORA-01110: data file 5: '/opt/oracle/oradata/openview/OPC_TEMP_1.dbf'
ORA-01115: IO error reading block from file 5 (block # 1)
ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
Additional information: 1
Additional information: 1
Fri Jun 21 08:57:02 2013
ORA-1110 signalled during: alter database open
...
Fri Jun 21 08:57:50 2013
alter database datafile '/opt/oracle/oradata/openview/OPC_TEMP_1.dbf' offline drop
Fri Jun 21 08:57:50 2013
Completed: alter database datafile '/opt/oracle/oradata/openv
Fri Jun 21 08:58:00 2013
alter database open
ORA-1110 signalled during: alter database open
...
Fri Jun 21 08:58:24 2013
alter database datafile '/opt/oracle/oradata/openview/OPC_TEMP_2.dbf' offline drop
Fri Jun 21 08:58:24 2013
Completed: alter database datafile '/opt/oracle/oradata/openv
Fri Jun 21 08:58:33 2013
alter database open
Beginning crash recovery of 1 threads
Fri Jun 21 08:58:33 2013
Thread recovery: start rolling forward thread 1
Recovery of Online Redo Log: Thread 1 Group 1 Seq 93032 Reading mem 0
  Mem# 0 errs 0: /opt/oracle/oradata/openview/redo01.log
Recovery of Online Redo Log: Thread 1 Group 2 Seq 93033 Reading mem 0
  Mem# 0 errs 0: /opt/oracle/oradata/openview/redo02.log
Fri Jun 21 08:58:34 2013
Thread recovery: finish rolling forward thread 1
Thread recovery: 551 data blocks read, 249 data blocks written, 1508 redo blocks read
Crash recovery completed successfully
Fri Jun 21 08:58:34 2013
Thread 1 advanced to log sequence 93034
Thread 1 opened at log sequence 93034
  Current log# 3 seq# 93034 mem# 0: /opt/oracle/oradata/openview/redo03.log
Successful open of redo thread 1.
Fri Jun 21 08:58:34 2013
SMON: enabling cache recovery
SMON: enabling tx recovery
Fri Jun 21 08:58:35 2013
Completed: alter database open

最終數據庫打開ok;接著開始重建臨時數據文件及表空:
alter tablespace opc_temp add tempfile '/opt/oracle/oradata/openview/OPC_TEMP_3.dbf' SIZE 100M
Fri Jun 21 09:13:42 2013
ORA-3217 signalled during: alter tablespace opc_temp add tempfile '/opt/oracl...
Fri Jun 21 09:15:16 2013
DROP TABLESPACE TEMP
Fri Jun 21 09:15:16 2013
Completed: DROP TABLESPACE TEMP
Fri Jun 21 09:26:12 2013
create temporary tablespace temp tempfile '/opt/oracle/oradata/openview/temp_1.dbf[D[D[D[2[C[C[C[C' size 100M
Fri Jun 21 09:26:40 2013
Completed: create temporary tablespace temp tempfile '/opt/or

alter tablespace opc_temp add tempfile '/opt/oracle/oradata/openview/OPC_TEMP_1.dbf' size 200M
Fri Jun 21 09:32:46 2013
ORA-3217 signalled during: alter tablespace opc_temp add tempfile '/opt/oracl...

drop tablespace opc_temp
Fri Jun 21 09:38:57 2013
Completed: drop tablespace opc_temp
Fri Jun 21 09:41:21 2013
create temporary tablespace opc_temp tempfile '/opt/oracle/oradata/openview/OPC_TEMP_1.dbf' size 200M
Fri Jun 21 09:41:21 2013
Completed: create temporary tablespace opc_temp tempfile '/op

 

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28612416/viewspace-764490/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28612416/viewspace-764490/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值