2017年7月24日 星期一

SRVCTL command

1. For single database in ASM:
# srvctl status database -d <db_unique_name>
# srvctl status listener

# srvctl stop database -d <db_unique_name> -o immediate
# srvctl stop listener
# srvctl start listener
# srvctl start database -d <db_unique_name>

# srvctl status database -d <db_unique_name>
# srvctl status listener

2. For RAC database in Filesystem or ASM
If service name is PROD, instance name is PROD1 (hostname is HOST1) and PROD2 (hostname is HOST2)

# srvctl status database -d PROD
# srvctl status listener

# srvctl stop database -d PROD -o immediate
or
# srvctl stop instance -d PROD -i PROD1,PROD2 -o immediate

# srvctl stop listener
or
# srvctl stop listener -n HOST1

# srvctl start listener
or
# srvctl start listener -n HOST1

# srvctl start database -d PROD
or
# srvctl start instance -d PROD -i PROD1,PROD2

# srvctl status database -d <db_unique_name>
# srvctl status listener

Reference:
https://docs.oracle.com/html/E25494_01/restart005.htm#srvstartdb1