{"id":1230,"date":"2014-06-06T09:19:42","date_gmt":"2014-06-06T01:19:42","guid":{"rendered":"http:\/\/www.yallonking.com\/?p=1230"},"modified":"2014-06-07T10:40:15","modified_gmt":"2014-06-07T02:40:15","slug":"%e5%af%86%e7%a0%81%e6%96%87%e4%bb%b6%e5%af%bc%e8%87%b4sys%e7%94%a8%e6%88%b7as-sysdba%e6%97%a0%e6%b3%95%e7%99%bb%e9%99%86","status":"publish","type":"post","link":"http:\/\/www.yallonking.com\/?p=1230","title":{"rendered":"\u5bc6\u7801\u6587\u4ef6\u5bfc\u81f4sys\u7528\u6237as sysdba\u65e0\u6cd5\u767b\u9646"},"content":{"rendered":"<p>\u5bc6\u7801\u6587\u4ef6\u5bfc\u81f4sys\u7528\u6237as sysdba\u65e0\u6cd5\u767b\u9646<br \/>\n\u73b0\u8c61\u5982\u4e0b\uff1a<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\n[oracle@test1 ~]$ sqlplus system\/oracle@prod\r\n\r\nSQL*Plus: Release 10.2.0.1.0 - Production on Fri May 30 10:58:46 2014\r\n\r\nCopyright (c) 1982, 2005, Oracle.  All rights reserved.\r\n\r\n\r\nConnected to:\r\nOracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production\r\nWith the Partitioning, OLAP and Data Mining options\r\n\r\nSQL&gt; exit\r\nDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production\r\nWith the Partitioning, OLAP and Data Mining options\r\n[oracle@test1 ~]$ sqlplus system\/oracle@prod as sysdba\r\n\r\nSQL*Plus: Release 10.2.0.1.0 - Production on Fri May 30 10:58:50 2014\r\n\r\nCopyright (c) 1982, 2005, Oracle.  All rights reserved.\r\n\r\nERROR:\r\nORA-01031: insufficient privileges\r\n\r\n\r\nEnter user-name: \r\n<\/pre>\n<p>\u6ce8\u610f\uff1a\u6b64\u5904\u5f00\u59cb\u62a5\u9519\uff01<\/p>\n<p>\u67e5\u770b\u76d1\u542c\u72b6\u6001<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\n[oracle@test1 admin]$ lsnrctl status\r\n\r\nLSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-MAY-2014 10:57:02\r\n\r\nCopyright (c) 1991, 2005, Oracle.  All rights reserved.\r\n\r\nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1521)))\r\nSTATUS of the LISTENER\r\n------------------------\r\nAlias                     LISTENER\r\nVersion                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production\r\nStart Date                30-MAY-2014 10:24:53\r\nUptime                    0 days 0 hr. 32 min. 8 sec\r\nTrace Level               off\r\nSecurity                  ON: Local OS Authentication\r\nSNMP                      OFF\r\nListener Parameter File   \/u01\/app\/oracle\/product\/10.2.0\/db_1\/network\/admin\/listener.ora\r\nListener Log File         \/u01\/app\/oracle\/product\/10.2.0\/db_1\/network\/log\/listener.log\r\nListening Endpoints Summary...\r\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1521)))\r\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))\r\nServices Summary...\r\nService &quot;plsextproc&quot; has 1 instance(s).\r\n  Instance &quot;plsextproc&quot;, status UNKNOWN, has 1 handler(s) for this service...\r\nService &quot;prod&quot; has 1 instance(s).\r\n  Instance &quot;prod&quot;, status UNKNOWN, has 1 handler(s) for this service...\r\nThe command completed successfully\r\n[oracle@test1 admin]$ lsnrctl status lsnr2\r\n\r\nLSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-MAY-2014 10:57:05\r\n\r\nCopyright (c) 1991, 2005, Oracle.  All rights reserved.\r\n\r\nConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1526)))\r\nSTATUS of the LISTENER\r\n------------------------\r\nAlias                     lsnr2\r\nVersion                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production\r\nStart Date                30-MAY-2014 10:25:02\r\nUptime                    0 days 0 hr. 32 min. 3 sec\r\nTrace Level               off\r\nSecurity                  ON: Local OS Authentication\r\nSNMP                      OFF\r\nListener Parameter File   \/u01\/app\/oracle\/product\/10.2.0\/db_1\/network\/admin\/listener.ora\r\nListener Log File         \/u01\/app\/oracle\/product\/10.2.0\/db_1\/network\/log\/lsnr2.log\r\nListening Endpoints Summary...\r\n  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1526)))\r\nServices Summary...\r\nService &quot;prod&quot; has 1 instance(s).\r\n  Instance &quot;prod&quot;, status READY, has 4 handler(s) for this service...\r\nService &quot;prod_XPT&quot; has 1 instance(s).\r\n  Instance &quot;prod&quot;, status READY, has 4 handler(s) for this service...\r\nThe command completed successfully\r\n<\/pre>\n<p>\u67e5\u770b\u5f53\u524d\u7528\u6237\u7ec4\u6743\u9650<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\n[oracle@test1 ~]$ id\r\nuid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)\r\n<\/pre>\n<p>\u67e5\u770btnsnames.ora\u6587\u4ef6<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\n[oracle@test1 admin]$ cat tnsnames.ora \r\nLSNR2=\r\n (DESCRIPTION=\r\n  (ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1526)))\r\n\r\n\r\nprod= \r\n (DESCRIPTION= \r\n   (ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1521))\r\n   (CONNECT_DATA= \r\n     (SERVICE_NAME=prod)\r\n         (SERVER=dedicated))) \r\n\r\nprod_s= \r\n (DESCRIPTION= \r\n   (ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1526))\r\n   (CONNECT_DATA= \r\n     (SERVICE_NAME=prod)\r\n         (SERVER=shared))) \r\n\r\n[oracle@test1 admin]$ cat listener.ora \r\nLISTENER=\r\n  (DESCRIPTION=\r\n    (ADDRESS_LIST=\r\n      (ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1521))\r\n      (ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))\r\nSID_LIST_LISTENER=\r\n  (SID_LIST=\r\n    (SID_DESC=\r\n      (GLOBAL_DBNAME=prod)\r\n      (ORACLE_HOME=\/u01\/app\/oracle\/product\/10.2.0\/db_1)\r\n      (SID_NAME=prod))\r\n    (SID_DESC=\r\n      (SID_NAME=plsextproc)\r\n      (ORACLE_HOME=\/u01\/app\/oracle\/product\/10.2.0\/db_1)\r\n      (PROGRAM=extproc)))\r\n\r\nLSNR2=\r\n (DESCRIPTION=\r\n  (ADDRESS=(PROTOCOL=tcp)(HOST=test1)(PORT=1526)))\r\n<\/pre>\n<p>\u67e5\u770bsqlnet.ora\u6587\u4ef6  <\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\n[oracle@test1 admin]$ cat sqlnet.ora \r\nNAMES.DIRECTORY_PATH = (TNSNAMES,EZCONNECT)\r\n<\/pre>\n<p>\u67e5\u770b\u5404\u53c2\u6570\u8bbe\u7f6e<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\nSQL&gt; show parameter local\r\n\r\nNAME                                 TYPE        VALUE\r\n------------------------------------ ----------- ------------------------------\r\nlocal_listener                       string      lsnr2\r\nlog_archive_local_first              boolean     TRUE\r\nSQL&gt; show parameter remote\r\n\r\nNAME                                 TYPE        VALUE\r\n------------------------------------ ----------- ------------------------------\r\nremote_archive_enable                string      true\r\nremote_dependencies_mode             string      TIMESTAMP\r\nremote_listener                      string\r\nremote_login_passwordfile            string      EXCLUSIVE\r\nremote_os_authent                    boolean     FALSE\r\nremote_os_roles                      boolean     FALSE  \r\n\r\n<\/pre>\n<p>\u67e5\u770b\u5bc6\u7801\u6587\u4ef6<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\n[oracle@test1 dbs]$ ls -l orapwPROD \r\n-rw-r----- 1 oracle oinstall 5120 May 30 10:26 orapwPROD\r\n<\/pre>\n<p>\u67e5\u770boracle\u7528\u6237\u6743\u9650<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\nSQL&gt; sho user\r\nUSER is &quot;SYSTEM&quot;\r\nSQL&gt; select * from v$pwfile_users;\r\n\r\nno rows selected\r\n\r\nSQL&gt; grant dba to system;        \r\n\r\nGrant succeeded.\r\n\r\nSQL&gt; select * from v$pwfile_users;\r\n\r\nno rows selected\t\r\nSQL&gt; conn \/as sysdba\r\nConnected.\r\nSQL&gt; show user \r\nUSER is &quot;SYS&quot;\r\nSQL&gt; select * from v$pwfile_users;\r\n\r\nno rows selected\r\n\r\nSQL&gt; grant sysdba to sys;\r\ngrant sysdba to sys\r\n*\r\nERROR at line 1:\r\nORA-01994: GRANT failed: password file missing or disabled\r\n<\/pre>\n<p>\u6ce8\u610f\uff0c\u6b64\u5904\u53d1\u73b0\u5bc6\u7801\u6587\u4ef6\u4e0d\u6b63\u786e\uff01<\/p>\n<p>\u91cd\u5efa\u5bc6\u7801\u6587\u4ef6\u5e76\u6388\u6743<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\n[oracle@test1 dbs]$ rm -rf orapwPROD \r\n[oracle@test1 dbs]$ env|grep ORACLE_SID\r\nORACLE_SID=prod\r\n[oracle@test1 dbs]$ orapwd file=$ORACLE_HOME\/dbs\/orapwprod password=oracle\r\n[oracle@test1 dbs]$ ls -l orapwprod \r\n-rw-r----- 1 oracle oinstall 1536 May 30 11:09 orapwprod\r\n\r\nSQL&gt; show user \r\nUSER is &quot;SYS&quot;\r\nSQL&gt; grant sysdba to sys;\r\n\r\nGrant succeeded.\r\n\r\nSQL&gt; select * from v$pwfile_users;\r\n\r\nUSERNAME                       SYSDB SYSOP\r\n------------------------------ ----- -----\r\nSYS                            TRUE  TRUE\r\nSQL&gt; grant sysdba to system;\r\n\r\nGrant succeeded.\r\n\r\nSQL&gt; conn system\/oracle\r\nConnected.\r\nSQL&gt; select * from v$pwfile_users;\r\n\r\nUSERNAME                       SYSDB SYSOP\r\n------------------------------ ----- -----\r\nSYS                            TRUE  TRUE\r\nSYSTEM                         TRUE  FALSE\r\n<\/pre>\n<p>\u5982\u4e0b\uff0c\u6d4b\u8bd5\u6b63\u5e38\u3002<\/p>\n<pre class=\"wp-code-highlight prettyprint\">\r\n[oracle@ocm1 ~]$ sqlplus system\/oracle@prod as sysdba\r\n\r\nSQL*Plus: Release 10.2.0.1.0 - Production on Fri May 30 11:21:42 2014\r\n\r\nCopyright (c) 1982, 2005, Oracle.  All rights reserved.\r\n\r\n\r\nConnected to:\r\nOracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production\r\nWith the Partitioning, OLAP and Data Mining options\r\n\r\nSQL&gt; exit\r\nDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production\r\nWith the Partitioning, OLAP and Data Mining options\r\n[oracle@ocm1 ~]$ sqlplus system\/oracle@prod \r\n\r\nSQL*Plus: Release 10.2.0.1.0 - Production on Fri May 30 11:21:46 2014\r\n\r\nCopyright (c) 1982, 2005, Oracle.  All rights reserved.\r\n\r\n\r\nConnected to:\r\nOracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production\r\nWith the Partitioning, OLAP and Data Mining options\r\n\r\nSQL&gt; exit\r\nDisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production\r\nWith the Partitioning, OLAP and Data Mining options\r\n<\/pre>\n<p><strong>\u6ce8\u610f\uff1a\u5bc6\u7801\u6587\u4ef6\u5728linux\u4e0b\u547d\u540d\u5e94\u8be5\u662forapw<$ORACLE_SID>\uff0c\u5e76\u4e14\u5176\u4e2d\u7684<$ORACLE_SID> \u662f\u4e25\u683c\u533a\u5206\u5927\u5c0f\u5199\u7684\u3002<\/strong><br \/>\n\u53c2\u8003\u7684\u6587\u6863\uff1aTroubleshooting ORA-1031: Insufficient Privileges While Connecting As SYSDBA (\u6587\u6863 ID 730067.1)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bc6\u7801\u6587\u4ef6\u5bfc\u81f4sys\u7528\u6237as sysdba\u65e0\u6cd5\u767b\u9646 \u73b0\u8c61\u5982\u4e0b\uff1a [oracle@test1 ~]$ sqlplu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[36],"tags":[261,263,262],"_links":{"self":[{"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/posts\/1230"}],"collection":[{"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1230"}],"version-history":[{"count":2,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/posts\/1230\/revisions"}],"predecessor-version":[{"id":1232,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=\/wp\/v2\/posts\/1230\/revisions\/1232"}],"wp:attachment":[{"href":"http:\/\/www.yallonking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1230"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.yallonking.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}