oracle 连接失败问题——错误方式删除表空间文件

本文介绍了一种常见的Oracle数据库启动失败的情况,错误信息包括ORA-01034和ORA-27101等,并提供了详细的步骤来解决这个问题,包括如何正确地离线并删除丢失的数据文件。

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

出现以下错误

错误信息:

连接失败

ORA-01034: ORACLE not available

ORA-27101:shared memory realm does not exist

Linux-x86_64 Error: 2: No such file or directory

Process ID: 0

Session ID: 0 Serial number: 0


主要原因是手动将创建的表空间文件删除了。

解决方法:

登陆到命令行终端

SQL>sqlplus /nolog

SQL>conn sys / as sysdba

SQL>startup

通过startup命令,会出现错误信息

Total System Global Area  409194496 bytes
Fixed Size                  2213856 bytes
Variable Size             306186272 bytes
Database Buffers           96468992 bytes
Redo Buffers                4325376 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/opt/app/oracle/oradata/osa/music.dbf'

SQL>shutdown normal

ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL>startup mount

ORACLE instance started.


Total System Global Area  409194496 bytes
Fixed Size                  2213856 bytes
Variable Size             306186272 bytes
Database Buffers           96468992 bytes
Redo Buffers                4325376 bytes
Database mounted.

SQL> alter database open;

alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/opt/app/oracle/oradata/osa/music.dbf'

SQL>alter database datafile 7 offline drop;

Database altered.

SQL>shutdown normal

ORA-01109: database not open
Database dismounted.

SQL>startup

ORACLE instance started.
Total System Global Area  409194496 bytes
Fixed Size                  2213856 bytes
Variable Size             306186272 bytes
Database Buffers           96468992 bytes
Redo Buffers                4325376 bytes
Database mounted.
Database opened.

完成即可连接数据库。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值