解决oracle误删除dbf文件而不能启动的问题

本文介绍了解决Oracle数据库误删除dbf文件后无法启动的问题,通过执行特定步骤来修复数据库,确保其正常运行。具体包括:关闭数据库、进入mount模式、重新定义并移除损坏的数据文件、重新开启数据库并验证修复效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决oracle误删除dbf文件而不能启动的问题

2013年09月26日 oracle, 数据库⁄ 共 1543字 ⁄ 字号 小 中 大 暂无评论 ⁄ 阅读 155 views 次

首先这种方法不能恢复你误删除的数据,只是一种能让数据库正常启动的方案。

由于误操作删除了oracle数据库的dbf文件,启动数据库的时候报错

SQL> startup pfile=’/ytxt/oracle/product/10.2.0/db_1/dbs/initshutu.ora’;
ORACLE instance started.

Total System Global Area 3290345472 bytes
Fixed Size    2217832 bytes
Variable Size 2332035224 bytes
Database Buffers  939524096 bytes
Redo Buffers   16568320 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 5 - see DBWR trace file
ORA-01110: data file 5: ’/ytxt/oracle/oradata/shutu/TYBOOKDB.dbf’
蛋疼,无奈就找解决办法。

执行以下步骤即可解决:

SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
启动mount模式,由于本机器有点问题所有startup mount起不来,一般都是可以的,所以不只能用下面的命令起来
SQL> startup mount;
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address ’(ADDRESS=(PROTOCOL=TCP)(HOST=sc-orc-1.tylib.com)(PORT=1521))’

SQL>  startup pfile=’/ytxt/oracle/product/10.2.0/db_1/dbs/initshutu.ora’ mount;
ORACLE instance started.

Total System Global Area 3290345472 bytes
Fixed Size    2217832 bytes
Variable Size 2332035224 bytes
Database Buffers  939524096 bytes
Redo Buffers   16568320 bytes
Database mounted.
SQL> alter database datafile  ’/ytxt/oracle/oradata/shutu/TYBOOKDB.dbf’ offline drop;

Database altered.

SQL> alter database open;

Database altered.

停止数据库,然后启动数据库看看成功没有:

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup  pfile=’/ytxt/oracle/product/10.2.0/db_1/dbs/initshutu.ora’;
ORACLE instance started.

Total System Global Area 3290345472 bytes
Fixed Size    2217832 bytes
Variable Size 2332035224 bytes
Database Buffers  939524096 bytes
Redo Buffers   16568320 bytes
Database mounted.
Database opened.
完全没问题。此问题已解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值