{"id":457,"date":"2013-09-27T19:36:23","date_gmt":"2013-09-28T02:36:23","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=457"},"modified":"2013-09-28T05:38:37","modified_gmt":"2013-09-28T12:38:37","slug":"ora-01031-error-when-using-sqlplus","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/ora-01031-error-when-using-sqlplus\/","title":{"rendered":"ORA-01031 ERROR when Using Sqlplus"},"content":{"rendered":"

Normally when you install the Oracle database software you should not have any problems like this but this happened to me because I cloned a system and it happens that we use different \"dba\" groups on different servers.<\/p>\n

As I understand it the install binaries are linked to the \"oinstall\" or \"dba\" or your equivalent group specific to your environment used at the time of the install. So if you run the same binaries on a different server you lose the luxury of doing an un-authenticated login with sqlplus. This was difficult to track down so I documented my fix.<\/p>\n

You can simulate this error very easily by taking your user out of the \"dba\" group or removing the group completely.<\/p>\n

Error message\u00a0<\/strong>ORA-01031: insufficient privileges<\/span>\u00a0\u00a0as follow:<\/strong><\/p>\n

\r\n$ sqlplus \/ as sysdba\r\nSQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 26 11:28:33 2013\r\nCopyright (c) 1982, 2011, Oracle.  All rights reserved.\r\nERROR:\r\nORA-01031: insufficient privileges\r\nEnter user-name: ^C\r\n<\/pre>\n

Temporarily you can fix it by adding your user to the group you know worked on the source system:<\/strong><\/p>\n

\r\n# grep ag \/etc\/group\r\nagprd::313:agprd_o\r\nagdev1::305:agprd_o\r\n\r\n$ sqlplus \/ as sysdba\r\nSQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 26 11:28:58 2013\r\nCopyright (c) 1982, 2011, Oracle.  All rights reserved.\r\nConnected to an idle instance.\r\n<\/pre>\n

Permanent fix as follow. \u00a0Update the config.s file and relink.<\/strong><\/p>\n

\r\n$ tail -1 \/etc\/group\r\n#agdev1::305:agprd_o\r\n\r\n$ pwd\r\n\/u01\/app\/oracle\/product\/11.2.0\/dbhome_1\/rdbms\/lib\r\n$ diff config.s \/tmp\/config.s\r\n23c23\r\n< .ascii "agprd\0"\r\n---\r\n> .ascii "agdev1\0"\r\n\r\n$ relink as_installed\r\n\r\n$ sqlplus \/ as sysdba\r\nSQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 26 11:55:29 2013\r\nCopyright (c) 1982, 2011, Oracle. All rights reserved.\r\nConnected to an idle instance.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

Normally when you install the Oracle database software you should not have any problems like this but this happened to<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-oracle"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=457"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/457\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}