1 CDB$ROOT
1.1 连接
oracle@hostname:/home/oracle>sqlplus / as sysdba
SQL>show con_name
SQL>show pdbs
1.2 切换
SQL>alter session set container=cdb$root;
SQL>show con_id
1.3 表空间
SQL>select * from v$tablespace order by con_id;
2 PDB
2.1 切换
SQL>alter session set container=pdb;
SQL>show con_id
SQL>show con_name
2.2 启动 | 关闭
关闭
alter pluggable database all close immedaite;
启动
alter pluggable database all open;
2.3 Except
alter pluggable database all except pdba open;
alter pluggable database all except pdba close immediate;
2.4 触发器
CDB实例启动后,CDB内的所有PDB都处于MOUNT模式。
create trigger open_pdb
after startup on database
begin
execute immediate 'alter pluggable database all open';
end;
/