• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Techgoeasy

Techgoeasy

Learn Oracle, PHP, HTML,CSS,Perl,UNIX shell scripts

  • Home
  • Oracle
    • Oracle database
    • Oracle Ebusiness Suite
    • Oracle weblogic
    • Oracle Performance Tuning
    • Oracle Hyperion
    • Oracle Cloud Tutorials
  • SQL
  • interview questions
  • Linux
  • PHP and HTML
  • Downloads
  • General
Home » Oracle » Oracle Database » srvctl commands

srvctl commands

August 8, 2022 by techgoeasy Leave a Comment

srvctl commands is an important tool to manage the Oracle database in the RAC environment and Oracle restarts env(Single node env with ASM). This can be used to stop, start, find status and other things in the cluster or the server. Let’s review those command

Table of Contents

  • srvctl commands
  • srvctl config database
  • srvctl start database
  • srvctl start instance
  • srvctl stop database
  • srvctl stop instance
  • srvctl status database
  • srvctl add database
  • srvctl add instance
  • srvctl remove database
  • srvctl remove instance

srvctl commands

srvctl is a utility in $ORACLE_HOME/bin and it has various options. You can find all the options using the below command

srvctl -help

This can be used to list databases, config databases, check the status of the database and many others.

srvctl config database

srvctl config database is the command to list all the databases registered in the Oracle RAC cluster or Oracle restart environment. There is no such command as srvctl list databases. It is the srvctl config database command

srvctl config database
Example
srvctl config database
TESTDB
TESTDB19

If you want to see the detailed configuration for a particular database, then the command is

srvctl config database  -d <db name> -a
Example 
srvctl config database -d  TESTDB -a

srvctl start database

srvctl start database is used to start the database. Here is the full command line

srvctl start database -d <db name> 
Example
srvctl start database -d TESTDB

srvctl start instance

In the previous command, it will start all the instances of the database, If you want to start a particular instance, then we can use the below command

srvctl start  instance -d <db name> -i <instance name>
Example
srvctl start instance  - d TESTDB -i TESTDB1

srvctl stop database

srvctl stop database is used to stop the database. Here is the full command line

srvctl stop database -d <db name>
Example
srvctl stop database -d TESTDB

It is also possible to use the options for stopping like this

srvctl stop database -d TESTDB -i normal
srvctl stop database -d TESTDB -i abort
srvctl stop database -d TESTDB -immediate

srvctl stop instance

In the previous command, it will stop all the instances of the database, If you want to stop a particular instance, then we can use the below command

srvctl stop  instance -d <db name> -i <instance name>
Example
srvctl stop instance  - d TESTDB -i TESTDB1

srvctl status database

srvctl status database is used to check the status of the database. It will show the status of all the instances of an Oracle RAC and the status of an instance of the Non -RAC

srvctl status database -d <db name>
Example
srvctl status database -d TESTDB

If you want to see more information, you can add -verbose to it

srvctl status database -d <db name> -verbose
Example 
srvctl status database -d TESTDB -verbose

srvctl add database

This command can be used to add a database in the srvctl registry

srvctl add database -d < db unique name>  -o <oracle home location> -p <spfile location> -db <db name
Example
srvcrtl add database -d TESTDG -i /u01/ap/product/db_home1 -p +DATA/TESTDG/parameterfile/spfileTESETDG.ora

srvctl add instance

This command is used to add an instance after adding a database

srvctl add instance -d < db  name>  -i <instance name> -n <node name>
Example
srvctl add instance -d TESTDB -i TESTDG1 -i technode1
srvctl add instance -d TESTDB -i TESTDG2 -i technode2

In the case of Non-RAC, we can remove option the node option

srvctl remove database

we can remove the database using the below command

srvctl remove database -d <db name> -f -y
Example
srvctl remove database -d TESTDG -f -y

srvctl remove instance

If you want to just remove one instance, we can use the below command

srvctl remove instance -d <db name> - i <instance name>

Hope you like this post on srvctl commands

SSH Putty commands : Putty is a widely used tool to connect with a Linux servers..Here are 41 Useful SSH Putty commands to help you manage Linux with examples.
oracle Cluster command : This page list down the common oracle Cluster command like srvctl ,oicfg,cluvfy,ocrconfig,crsctl,crs_stats,oclumon clusterware

Filed Under: Oracle, Oracle Database

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar



Subscribe to our mailing list

Enter your email address to subscribe to this blog and receive notifications of new posts by email

Recent Posts

  • How to check Stale statistics
  • Java web start(JWS) in R12
  • How to delete the archive logs in Oracle
  • How to generate sql monitor report in Oracle
  • How to find the long running (longops session) in Oracle

Copyright © 2023 : TechGoEasy

  • Hire me
  • Privacy Policy
  • Contact Us
  • New? Start Here
  • About Us