PDB 支持 abort 关闭么
发布网友
发布时间:2022-04-25 15:41
我来回答
共1个回答
热心网友
时间:2022-04-11 06:31
1 Container Database (CDB)
对于CDB,启动和关闭与之前传统的方式一样,具体语法如下:
STARTUP[NOMOUNT | MOUNT | RESTRICT | UPGRADE | FORCE | READ ONLY]
SHUTDOWN[IMMEDIATE | ABORT]
要注意,在12c数据库创建完成后,默认情况下使用sqlplus / as sysdba 登录连接的是CDB。
[oracle@Ora12c~]$ sqlplus / as sysdba
SQL*Plus:Release 12.1.0.1.0 Proction on Thu Apr 24 17:50:34 2014
Copyright(c) 1982, 2013, Oracle. All rightsreserved.
Connectedto:
OracleDatabase 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Proction
Withthe Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL>
SQL>select con_id, dbid, guid, name , open_mode from v$pdbs;
CON_ID DBID GUID NAME OPEN_MODE
---------- ------------------------------------------ ------------------------------ ----------
2 4088301206 F7C1E3C96BBF0585E0430A01A8C05459PDB$SEED READ ONLY
3 426143573 F7C209EB1DFC0854E0430A01A8C0B787 PDBCNDBA READ WRITE
我们现在连接的是CDB,即root container。
我们关闭CDB:
SQL>shutdown immediate
Databaseclosed.
Databasedismounted.
ORACLEinstance shut down.
我们关闭CDB之前PDB 是没有关闭的,所以这个操作也会把PDB 关闭掉。
SQL>startup
ORACLEinstance started.
TotalSystem Global Area 1269366784 bytes
FixedSize 2287912 bytes
VariableSize 788530904 bytes
DatabaseBuffers 469762048 bytes
RedoBuffers 8785920 bytes
Databasemounted.
Databaseopened.
SQL> select con_id, dbid, guid, name , open_modefrom v$pdbs;
CON_ID DBID GUID NAME OPEN_MODE
---------- ------------------------------------------ ------------------------------ ----------
2 4088301206F7C1E3C96BBF0585E0430A01A8C05459 PDB$SEED READ ONLY
3 426143573 F7C209EB1DFC0854E0430A01A8C0B787 PDBCNDBA MOUNTED
注意这里的PDB,在CDB 启动之,PDB 是自动启动到mount状态,而不是OPEN。 所以我们还需要手工去open它,当然,也可以通过在CDB中配置触发器来自动open。