{"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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"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-related-posts":[{"id":18,"url":"https:\/\/bijoos.com\/oraclenotes\/2011\/18\/","url_meta":{"origin":67,"position":0},"title":"Rename Diskgroup in ASM","author":"Biju","date":"September 26, 2011","format":false,"excerpt":"Rename ASM Diskgroup [11gR2]In 11gR2 it is possible to rename an ASM diskgroup. This is especially useful when performing database copy using OS level LUN mirroring technologies. The renamedg command is used to rename diskgroups. It has the following options:$ renamedg -helpParsing parameters..phase\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Phase to execute,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (phase=ONE|TWO|BOTH), default BOTHdgname\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Diskgroup\u2026","rel":"","context":"In &quot;Infrastructure &amp; Exadata&quot;","block_context":{"text":"Infrastructure &amp; Exadata","link":"https:\/\/bijoos.com\/oraclenotes\/category\/infrastructure-exadata\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1501,"url":"https:\/\/bijoos.com\/oraclenotes\/2015\/1501\/","url_meta":{"origin":67,"position":1},"title":"Oracle Tidbits &#8211; February 2015","author":"Biju","date":"March 1, 2015","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d (#oratidbit) published at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on weekdays\u00a0in February\u00a02015. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you of its existence and use\u2026\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1459,"url":"https:\/\/bijoos.com\/oraclenotes\/2014\/1459\/","url_meta":{"origin":67,"position":2},"title":"Oracle Tidbits &#8211; October 2014","author":"Biju","date":"October 31, 2014","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d published at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on all weekdays\u00a0in October\u00a02014. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you of its existence and use\u2026\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1497,"url":"https:\/\/bijoos.com\/oraclenotes\/2015\/1497\/","url_meta":{"origin":67,"position":3},"title":"Oracle Tidbits &#8211; January 2015","author":"Biju","date":"February 1, 2015","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d (#oratidbit) published at\u00a0https:\/\/www.facebook.com\/oraclenotes\u00a0on weekdays\u00a0in January 2015. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you of its existence and\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2044,"url":"https:\/\/bijoos.com\/oraclenotes\/2012\/2044\/","url_meta":{"origin":67,"position":4},"title":"Using Flashback during repeated load tests","author":"Biju","date":"December 8, 2012","format":false,"excerpt":"We are in the middle of migrating several databases to a new data center. One of the requirement is to do rigorous load and stress tests on the new servers to make sure they can handle the load and the configuration is correct. For this purpose, there are several load\/stress\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/bijoos.com\/oraclenotes\/category\/oracledb\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2091,"url":"https:\/\/bijoos.com\/oraclenotes\/2017\/2091\/","url_meta":{"origin":67,"position":5},"title":"Oracle Tidbits &#8211; September 2017 #oratidbit","author":"Biju","date":"October 1, 2017","format":false,"excerpt":"\u201cOracle *daily* TidBits\u201d (#oratidbit) published on Facebook, Twitter, and Google+\u00a0during weekdays\u00a0in September 2017. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well\u2026 Hope you find these helpful to learn something new or to remind you\u2026","rel":"","context":"In &quot;TidBits &amp; Quick Tips&quot;","block_context":{"text":"TidBits &amp; Quick Tips","link":"https:\/\/bijoos.com\/oraclenotes\/category\/tidbits\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2017\/02\/oratidbit.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_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}]}}