oracle删除表空间文件后无法登录数据库用户问题解决

背景:因为测试库需要导入较大的表数据,导入后需要删掉,并且释放磁盘空间。结果删除后无法登录普通用户了。

解决过程:参考https://blog.csdn.net/jccyww/article/details/50766603

[oracle@jie ~]$ sqlplus /nolog


SQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 29 16:05:31 2016


Copyright (c) 1982, 2009, Oracle.  All rights reserved.


SQL> conn /as sysdba
Connected to an idle instance.


SQL> startup
ORACLE instance started.

Total System Global Area 4.2950E+11 bytes
Fixed Size                 30164616 bytes
Variable Size            2.9528E+10 bytes
Database Buffers         3.9943E+11 bytes
Redo Buffers              506703872 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 18 - see DBWR trace file
ORA-01110: data file 18: '/u01/app/19.3.0/oradata/IOMAPP/GXYD_IM_TAB_04.dbf'

SQL> alter database datafile 18 offline drop;  --这里的6是根据上面错误信息里的data file 18


Database altered.


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery


SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 19 - see DBWR trace file
ORA-01110: data file 19: '/u01/app/19.3.0/oradata/IOMAPP/GXYD_IM_TAB_05.dbf'

删除了多少个数据库文件重复操作就行。

SQL> alter database datafile 19 offline drop;

Database altered.

一直到alter database open;提示成功为止。

SQL>  alter database open;

Database altered.

然后重启数据库就行

SQL> exist

sqlplus /nolog


SQL> conn /as sysdba
Connected.

SQL> shutdown immediate
Database closed.
Database dismounted.

ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 4.2950E+11 bytes
Fixed Size                 30164616 bytes
Variable Size            2.9528E+10 bytes
Database Buffers         3.9943E+11 bytes
Redo Buffers              506703872 bytes
Database mounted.
Database opened.
SQL> exit

重启下监听

lsnrctl stop --停止监听

lsnrctl start --启动监听

lsnrctl reload --重启监听

lsnrctl status --查看监听状态

  • 20
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值