top of page
  • Writer's pictureBalaaji Dhananjayan

Registering a Database in Server Control (srvctl)

Updated: Jun 27, 2020

There are times if the database is not build using DBCA or not upgraded using DBUA, the database resource may not be registered with your "Oracle Restart". In this case we may have to register our database resource.

I had recently upgraded one of my database from to using manual upgrade method and after the DB upgrade is done, I tried to add new services to the database.

Below is what I faced.

$ srvctl status service  -d mydb

PRCD-1120 : The resource for database myowndb could not be found.
PRCR-1001 : Resource ora.myowndb.db does not exist

$ srvctl config database -d myowndb

PRCD-1120 : The resource for database myowndb could not be found.
PRCR-1001 : Resource ora.myowndb.db does not exist

This simple means, your "Oracle Restart" doesn't know of such database resource.

Let's register the database now.

$ srvctl add database -d mydb -o $ORACLE_HOME

Check if the resource is added to Server Control

standalone /app/oracle > srvctl config database -d MYDB
Database unique name: MYDB
Database name:
Oracle home: /app/oracle/product/12.2
Oracle user: oracle
Password file:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Disk Groups:
OSDBA group: dba
OSOPER group: dba
Database instance: MYDB

Now lets try to add new service

$ srvctl add service -s myservice -d mydb
$ srvctl status service -d mydb
Service MYSERVICE is running

The same way, we should also be able to register listener as well.

$ srvctl add listener -l mydb_mylsnr -p TCP:1521 -s -o $ORACLE_HOME
$ srvctl config listener -l mydb_myslsnr

Home: /app/oracle/product/12.2
End points: TCP:1521

If you are not using the default location for listener.ora file, set the TNS_ADMIN value using the “setenv” option.

$ srvctl setenv listener -l mydb_mylsnr -T TNS_ADMIN=$TNS_ADMIN

Similarly, if the database requires any special environment variable to be set before starting, using the “setenv” for database as well.

$ srvctl setenv database -d $ORACLE_SID -T ORA_NLS10=$ORA_NLS10

The “getenv” option shows the environment variables defined for the component.

$ srvctl getenv listener -l mydb_mylsnr

$ srvctl getenv database -d $ORACLE_SID


Hope this was helpful.


Balaaji Dhananjayan

972 views0 comments

Recent Posts

See All


bottom of page