SRVCTL is known as server control utility, which is used to add, remove,relocate and manage different crs services or components in RAC database.

1. STOP DATABASE :

SYNTAXsrvctl stop database -d db_name [-o stop_options] where stop_options is normal/immediate(default)/transactional/abort

e.g

2. START DATABASE
SYNTAXsrvctl start database -d db_name [-o start_options] where start_option is nomount/mount/open(default)

e.g

3. STOP AN INSTANCE

SYNTAXsrvctl stop instance -d db_unique_name [-i “instance_name_list”]} [-o stop_options] [-f]
e.g

4. START AN INSTANCE

SYNTAXsrvctl start instance -d db_unique_name [-i “instance_name_list”} [-o start_options]
e.g

5. REMOVING DB FROM CRS:
SYNTAXsrvctl remove database -d db_unique_name [-f] [-y] [-v]
e.g

6. ADDING DB IN CRS :
SYNTAXsrvctl add database -d db_unique_name -o ORACLE_HOME [-p spfile]
e.g

7. REMOVING AN INSTANCE FROM CRS:
SYNTAXsrvctl remove instance -d DB_UNIQUE_NAME -i INSTANCE_NAME
e.g

8.ADDING AN INSTANCE TO CRS:
SYNTAXsrvctl add instance –d db_unique_name –i inst_name -n node_name
e.g

9. Enable/disable auto restart of the instance

10. Enable/disable auto restart of the database

11. ADDING A SERVICE:

SYNTAXsrvctl add servicec -d {DB_NAME} -s {SERVICE_NAME} -r {“preferred_list”} -a {“available_list”} [-P {BASIC | NONE | PRECONNECT}]

e.g

12.REMOVING A SERVICE:

SYNTAXsrvctl remove service -d {DB_NAME} -s {SERVICE_NAME}
e.g

13. START A SERVICE
SYNTAXsrvctl start servicec -d {DB_NAME} -s {SERVICE_NAME}
e.g

14. START A SERVICE

SYNTAXsrvctl stop servicec -d {DB_NAME} -s {SERVICE_NAME}
e.g

15. RELOCATE A SERVICE

SYNTAXsrvctl relocate service -d {database_name} -s {service_name} -i {old_inst_name} -r {new_inst_name}

EXAMPLE: (Relocating service PRDB_SRV from PREDB2 to PREDB1)

16. Check the status of service
SYNTAXsrvctl status service -d {database_name} -s {service_name}

17. Check the configuration of service
SYNTAXsrvctl config service -d {database_name} -s {service_name}

18. Check scan listener configuration

19. Modify scan_listener port:

20. Manage MGMTDB in oracle 12c:

21. Enable trace for srvctl commands:

22. Set environment variables through srvctl.

23. Check status and config of ASM instance: