{"id":67,"date":"2013-05-03T20:44:11","date_gmt":"2013-05-04T01:44:11","guid":{"rendered":"https:\/\/bijoos.com\/oraclenotes\/?p=67"},"modified":"2026-02-07T15:32:10","modified_gmt":"2026-02-07T21:32:10","slug":"registering-a-database-in-server-control-srvctl","status":"publish","type":"post","link":"https:\/\/bijoos.com\/oraclenotes\/2013\/67\/","title":{"rendered":"Registering a Database in Server Control (srvctl)"},"content":{"rendered":"<p>Even if you are managing a non-RAC database, in 11g, it is recommended to use \u201csrvctl\u201d commands to start and stop the database. But, if the database is not created using DBCA or not upgraded using DBUA, the database will not be registered in the \u201c<a href=\"http:\/\/docs.oracle.com\/cd\/E11882_01\/server.112\/e17120\/restart001.htm\">Oracle Restart<\/a>\u201d configuration automatically.<\/p>\n<p>Oracle Restart monitors the services registered and restarts if there is an abnormal end or can stop and start the databases during server reboot. Please read <a href=\"http:\/\/docs.oracle.com\/cd\/E11882_01\/server.112\/e17120\/restart001.htm\">Oracle Documentation<\/a> to learn more about Oracle Restart.<\/p>\n<p>When the database is not configured in Oracle Restart, and if you attempt to start or query the configuration using srvctl, you will see this error.<\/p>\n<pre class=\"lang:default decode:true\">$ srvctl config database -d myowndb\n\nPRCD-1120 : The resource for database myowndb could not be found.\nPRCR-1001 : Resource ora.myowndb.db does not exist<\/pre>\n<p>You may add the database to Oracle Restart configuration using the minimal set of parameters. For complete set of options and various srvctl options, please refer to <a href=\"http:\/\/docs.oracle.com\/cd\/E11882_01\/server.112\/e17120\/restart002.htm\">Oracle Documentation<\/a>. Here adding the database information with database name (-d option), the Oracle home location (-o option) and database parameter file (-p option). In the examples below, variables like $ORACLE_HOME, $TNS_ADMIN are used, they are setup prior. If the variables are not defined, use full path of the directory or name.<\/p>\n<pre class=\"lang:default decode:true\">$ srvctl add database -d myowndb -o $ORACLE_HOME -p $ORACLE_HOME\/dbs\/spfile$ORACLE_SID.ora<\/pre>\n<p>To query the configuration use the following command. You may use the \u201csrvctl modify\u201d option to change any of the configuration item you see below.<b>\u00a0<\/b><\/p>\n<pre class=\"lang:default decode:true\">$ srvctl config database -d $ORACLE_SID\n\nDatabase unique name: myowndb\nDatabase name:\nOracle home: \/u01\/app\/oracle\/myowndb\/11.2.0.3\nOracle user: oracle\nSpfile: \/u01\/app\/oracle\/myowndb\/11.2.0.3\/dbs\/spfilemyowndb.ora\nDomain:\nStart options: open\nStop options: immediate\nDatabase role: PRIMARY\nManagement policy: AUTOMATIC\nDatabase instance: myowndb\nDisk Groups:\nServices:<\/pre>\n<p>When registering database, it would be appropriate to register the listener also. My recommendation is to register all the services in \u201cOracle Restart\u201d. See <a href=\"http:\/\/docs.oracle.com\/cd\/E11882_01\/server.112\/e17120\/restart005.htm\">here for all the components<\/a> that can be registered with using \u201csrvctl\u201d.<\/p>\n<p>Below, listener is registered with Oracle Restart using the listener name (-l option), the port number (-p option) and the Oracle home location (-o option).<\/p>\n<pre class=\"lang:default decode:true\">$ srvctl add listener -l myowndb_myserver -p TCP:1525 -s -o $ORACLE_HOME<\/pre>\n<p>Similar to the database configuration query, the listener configuration can be queried using \u201csrvctl config\u201d command.<\/p>\n<pre class=\"lang:default decode:true\">$ srvctl config listener -l myowndb_myserver\n\nName: MYOWNDB_MYSERVER\nHome: \/u01\/app\/oracle\/myowndb\/11.2.0.3\nEnd points: TCP:1525<\/pre>\n<p>If you are not using the default location for listener.ora file, set the TNS_ADMIN value using the \u201csetenv\u201d option.<\/p>\n<pre class=\"lang:default decode:true\">$ srvctl setenv listener -l myowndb_myserver -T TNS_ADMIN=$TNS_ADMIN<\/pre>\n<p>Similarly, if the database requires any special environment variable to be set before starting, using the \u201csetenv\u201d for database as well.<\/p>\n<pre class=\"lang:default decode:true \">$ srvctl setenv database -d $ORACLE_SID -T ORA_NLS10=$ORA_NLS10<\/pre>\n<p>The \u201cgetenv\u201d option shows the environment variables defined for the component.<\/p>\n<pre class=\"lang:default decode:true \">\u00a0$ srvctl getenv listener -l myowndb_myserver\n\nMYOWNDB_MYSERVER:\nTNS_ADMIN=\/u01\/app\/common_tns\/myowndb_myserver<\/pre>\n<p><b>\u00a0<\/b><\/p>\n<pre class=\"lang:default decode:true \">$ srvctl getenv database -d $ORACLE_SID\n\nmyowndb:\nORA_NLS10=\/u01\/app\/oracle\/myowndb\/11.2.0.3\/nls\/data\/9idata<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Even if you are managing a non-RAC database, in 11g, it is recommended to use \u201csrvctl\u201d commands to start and stop the database. But, if the database is not created using DBCA or not upgraded using DBUA, the database will not be registered in the \u201cOracle Restart\u201d configuration automatically. Oracle Restart monitors the services registered &#8230; <a title=\"Registering a Database in Server Control (srvctl)\" class=\"read-more\" href=\"https:\/\/bijoos.com\/oraclenotes\/2013\/67\/\" aria-label=\"Read more about Registering a Database in Server Control (srvctl)\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[57,67],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-infrastructure-exadata","tag-oracle-restart","tag-srvctl"],"acf":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":1,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":3006,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/67\/revisions\/3006"}],"wp:attachment":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}