今天想关闭部署在windows 2012 r2环境下oracle 12c 双节点rac中的节点2里的一个pdb:
通过cmd执行sqlplus命令:
sql>alter pluggable database scmdb close;
一直卡在这里,过了很久都没响应,通过查看告警日志也没发现什么提示:
Wed Apr 26 09:23:24 2017
alter pluggable database scmdb close
于是,直接终止了关闭。
突然,一种不详的预感从我脑中闪过:这个pdb肯定出问题了!
于是,通过
sql>show pdbs;
看到scmdb的状态为READ WRITE,但是
sql> alter session set container=scmdb;
出现了ORA-01155错误……
好吧,果然不出我所料。。。
遇到这种情况怎么办?而且之前也没遇到过
没错,我先查看了官方的说明:
ORA-01155: the database is being opened,closed,mounted or dismounted
Cause: The requested operation needs the instance to be in a particular state but the state is being changed.
Action:Wait for the open,close,mount,or dismount to complete then retry the operation. If necessary,a SHUTDOWN ABORT will always work.
额,Oracle官方建议我们静观其变,或者是SHUTDOWN ABORT。
因为不知道要什么时候才能完成,而且急于测试,所以我选择了SHUTDOWN ABORT,然并卵……
为什么会没用呢?我在这里找到了答案
Oracle 12c 多租户:PDB 支持 abort 关闭么?
SID SERIAL# CON_ID
---------- ---------- ----------
1980 31763 5
2130 2312 5
系统已更改。
sql> alter system kill session '2130,2312';
alter system kill session '2130,2312'
*
第 1 行出现错误:
ORA-00031: 标记要终止的会话
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB MOUNTED
4 PTMSDB READ WRITE NO
5 SCMDB READ WRITE NO
sql>
sql> alter session set container=scmdb;
会话已更改。
Active process user '' program 'PSEUDO'
SHUTDOWN: Active sessions prevent database close operation
Shutdown did not complete in 60 minutes
ORA-1013 signalled during: alter pluggable database scmdb close...
opidcl aborting process unknown ospid (22344) as a result of ORA-28