单节点数据库启停
srvctlstopinstance-dvmtoradb-ivmtoradb1
srvctlstopinstance-dvmtoradb-ivmtoradb2
srvctlstart instance-dvmtoradb-ivmtoradb1
srvctlstart instance-dvmtoradb-ivmtoradb2
启动/停止所有实例及其启用的服务
srvctlstartdatabase-dvmtoradb
srvctlstopdatabase-dvmtoradb
关闭所有PDB
停止/启动节点集群服务,须要以root用户
[grid@vmtrac1bin]$pwd
/u01/app/12.1.0/grid/bin
./crsctlstopcluster-all -----停止所有节点集群服务
./crsctlstopcluster -------停止本节点集群服务
oracle 12C与11G一样默认开机自启动集群服务
启动顺序:开机自启动集群服务查看集群服务器是否正常---------->打开数据库--------->启动PDB(默认是在mount状态下)
sql>selectname,open_modefromv$pdbs;
NAMEOPEN_MODE
----------------------------------------
PDB$SEEDREADONLY
SSMIS1MOUNTED
SSMIS2MOUNTED
SSMIS3MOUNTED
在CDB模式下启动PDB
sql>alterpluggabledatabaseSSMIS1open;
Pluggabledatabasealtered.
sql>selectname,open_modefromv$pdbs;
NAMEOPEN_MODE
----------------------------------------
PDB$SEEDREADONLY
SSMIS1READWRITE
SSMIS2MOUNTED
SSMIS3MOUNTED
在PDB模式下启动
sql>altersessionsetcontainer=ssmis2;
sql>selectname,open_modefromv$pdbs;
NAMEOPEN_MODE
----------------------------------------
SSMIS2READWRITE
sql>altersessionsetcontainer=ssmis3;
sql>selectname,open_modefromv$pdbs;
NAMEOPEN_MODE
----------------------------------------
SSMIS3READONLY
关闭PDB
sql>altersessionsetcontainer=ssmis3;
sql>shutdownimmediate;
PluggableDatabaseclosed.
sql>selectname,open_modefromv$pdbs;
NAMEOPEN_MODE
----------------------------------------
SSMIS3MOUNTED
在CDB下以sys用户创建PDB开机自启动触发器
CREATETRIGGERopen_all_pdbs
AFTERSTARTUPONDATABASE
BEGIN
EXECUTEIMMEDIATE'alterpluggabledatabaseallopen';
ENDopen_all_pdbs;