oracle 12C RAC 服务的启停

前端之家收集整理的这篇文章主要介绍了oracle 12C RAC 服务的启停前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
单节点数据库启停
srvctlstopinstance-dvmtoradb-ivmtoradb1
srvctlstopinstance-dvmtoradb-ivmtoradb2
srvctlstart instance-dvmtoradb-ivmtoradb1
srvctlstart instance-dvmtoradb-ivmtoradb2
启动/停止所有实例及其启用的服务
srvctlstartdatabase-dvmtoradb
srvctlstopdatabase-dvmtoradb

关闭所有PDB
sql> alter session set container=CDB$ROOT;
sql> alter pluggable database all close;

停止/启动节点集群服务,须要以root用户
[grid@vmtrac1bin]$pwd
/u01/app/12.1.0/grid/bin

./crsctlstopcluster-all -----停止所有节点集群服务
./crsctlstopcluster -------停止本节点集群服务
oracle 12C与11G一样默认开机自启动集群服务
关闭顺序 :关闭PDB----->关闭数据库------>关闭集群服务 ( 关闭PDB 在关闭数据库实例,否则smon将有一个自动回复过程)
启动顺序:开机自启动集群服务查看集群服务器是否正常---------->打开数据库--------->启动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>alterpluggabledatabaSEOpen;

sql>selectname,open_modefromv$pdbs;

NAMEOPEN_MODE
----------------------------------------
SSMIS2READWRITE

sql>altersessionsetcontainer=ssmis3;

sql>alterpluggabledatabaSEOpenreadonly;(read only 模式)

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;
原文链接:https://www.f2er.com/oracle/213707.html

猜你在找的Oracle相关文章