{"id":2179,"date":"2014-08-08T15:56:57","date_gmt":"2014-08-08T12:56:57","guid":{"rendered":"http:\/\/blog.yavor.info\/?p=2179"},"modified":"2014-08-06T15:58:00","modified_gmt":"2014-08-06T12:58:00","slug":"ora-28000-the-account-is-locked-%d0%bf%d0%be%d0%bd%d1%8f%d0%ba%d0%be%d0%b3%d0%b0","status":"publish","type":"post","link":"http:\/\/blog.yavor.info\/?p=2179","title":{"rendered":"&#8222;ORA-28000: the account is locked&#8220; &#8211; \u043f\u043e\u043d\u044f\u043a\u043e\u0433\u0430???"},"content":{"rendered":"<p>\u0422\u043e\u0432\u0430 \u043c\u0435 \u0438\u0437\u043d\u0435\u043d\u0430\u0434\u0430, \u0447\u0435\u0441\u0442\u043d\u043e!<\/p>\n<p>\u0415\u0434\u0438\u043d \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b \u043c\u0438 \u0441\u0435 \u043e\u043f\u043b\u0430\u043a\u0430, \u0447\u0435 \u0441\u0438 \u0435 \u043e\u0431\u044a\u0440\u043a\u0430\u043b \u043f\u0430\u0440\u043e\u043b\u0430\u0442\u0430 \u043d\u044f\u043a\u043e\u043b\u043a\u043e \u043f\u044a\u0442\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0432\u0430 ORA-28000. \u041f\u0440\u0435\u0434\u0438 \u0434\u0430 \u0433\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430, \u0440\u0435\u0448\u0438\u0445 \u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f \u043a\u0430\u043a\u0432\u043e \u0435 \u0441\u0442\u0430\u043d\u0430\u043b\u043e &#8211; \u043d\u0430\u043b\u0438 \u0432\u0441\u0435 \u043f\u0430\u043a \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438\u0442\u0435 \u0441\u0430 \u0441\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438&#8230;<\/p>\n<pre class=\"brush:sql\">\r\nSQL> select account_status from dba_users where username = 'xxx';\r\n\r\nACCOUNT_STATUS\r\n--------------------------------\r\nOPEN\r\n<\/pre>\n<p>A! \u0428\u0430\u0445 \u0441 \u043f\u0435\u0448\u043a\u0430\u0442\u0430. \u0418 \u0437\u0430\u043f\u043e\u0447\u043d\u0430 \u0435\u0434\u0438\u043d \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440&#8230;<br \/>\n&#8211; \u0410\u043c\u0430 \u0441\u0438\u0433\u0443\u0440\u0435\u043d \u043b\u0438 \u0441\u0438 \u0447\u0435 \u0435 \u043d\u0430 \u0442\u0430\u0437\u0438 \u0431\u0430\u0437\u0430?<br \/>\n&#8211; \u0414\u0430!<br \/>\n<em>(\u0432\u0441\u0435 \u043f\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0445 \u043d\u0430 \u0432\u0441\u0438\u0447\u043a\u0438 \u0431\u0430\u0437\u0438, \u0434\u043e \u043a\u043e\u0438\u0442\u043e \u0438\u043c\u0430 \u0434\u043e\u0441\u0442\u044a\u043f &#8211; \u043d\u0430\u0432\u0441\u044f\u043a\u044a\u0434\u0435 \u0435 OPEN)<\/em><br \/>\n&#8211; \u0410\u043c\u0430 \u0441\u0438\u0433\u0443\u0440\u0435\u043d \u043b\u0438 \u0441\u0438 \u0447\u0435 \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0448 \u0442\u043e\u0437\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b?<br \/>\n&#8211; \u0414\u0430!!<br \/>\n<em>(\u0432\u0441\u0435 \u043f\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0445 \u0432\u0441\u0438\u0447\u043a\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438 &#8211; \u0430\u043c\u0438 \u0438\u043c\u0430 \u0441\u0438 \u043d\u044f\u043a\u043e\u0439 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438, \u043d\u043e \u043e\u0442 \u043c\u0435\u0441\u0435\u0446\u0438)<\/em><br \/>\n&#8211; \u0410\u043c\u0430 \u0441\u0438\u0433\u0443\u0440\u0435\u043d \u043b\u0438 \u0441\u0438 \u0447\u0435 \u0435 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u0437\u0438 \u0433\u0440\u0435\u0448\u043a\u0430?<br \/>\n&#8211; \u0414\u0430!!! \u0412\u0435\u0434\u043d\u044a\u0436 \u043c\u0438\u043d\u0430\u0432\u0430, \u0442\u0440\u0438-\u0447\u0435\u0442\u0438\u0440\u0438 \u043f\u044a\u0442\u0438 \u043c\u0438 \u0434\u0430\u0432\u0430 \u0442\u0430\u0437\u0438 \u0433\u0440\u0435\u0448\u043a\u0430!<br \/>\n&#8211; WTF???<br \/>\n\u0422\u043e\u0432\u0430, \u0447\u0435 <em>\u043f\u043e\u043d\u044f\u043a\u043e\u0433\u0430<\/em> \u043c\u0438\u043d\u0430\u0432\u0430 \u043c\u0435 \u0432\u0442\u0440\u0435\u0449\u0438 \u043e\u0449\u0435 \u043f\u043e\u0432\u0435\u0447\u0435. \u041a\u0430\u043a, \u043f\u043e \u0434\u044f\u0432\u043e\u043b\u0438\u0442\u0435, \u0441\u0442\u0430\u0432\u0430 \u0442\u043e\u0432\u0430? \u0410\u043a\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f \u0431\u0435\u0448\u0435 \u043d\u0430 \u043f\u043e-\u043c\u0430\u043b\u043a\u043e \u0442\u043e 1000 \u043a\u043c, \u0449\u044f\u0445 \u0434\u0430 \u043f\u043e\u0438\u0441\u043a\u0430\u043c \u043b\u0438\u0447\u043d\u043e \u0434\u0430 \u0434\u043e\u0439\u0434\u0435 \u0434\u0430 \u043c\u0438 \u043f\u043e\u043a\u0430\u0436\u0435.<br \/>\n\u041d\u043e \u0442\u043e\u0432\u0430 \u043d\u044f\u043c\u0430\u0448\u0435 \u0434\u0430 \u043c\u0438 \u043f\u043e\u043c\u043e\u0433\u043d\u0435&#8230;<br \/>\n\u041f\u043e\u043c\u043e\u043b\u0438\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f \u0434\u0430 \u0441\u0435 \u0437\u0430\u043a\u0430\u0447\u0438 \u043d\u0430 Primary \u0431\u0430\u0437\u0430\u0442\u0430 (\u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0430 Active DataGuard), \u0437\u0430 \u0434\u0430 \u043c\u043e\u0433\u0430 \u0434\u0430 \u0432\u0438\u0434\u044f \u043a\u0430\u043a\u0432\u043e \u043f\u0438\u0448\u0435 \u0432 DBA_AUDIT_SESSION. \u041d\u0438\u043a\u0430\u043a\u044a\u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c &#8211; \u0432\u0441\u0438\u0447\u043a\u0438 \u043b\u043e\u0433\u0438\u043d\u0438 \u0431\u044f\u0445\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u0438.<\/p>\n<p>\u0422\u043e\u0433\u0430\u0432\u0430 \u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u0441\u043d\u0430 \u043a\u0430\u043a\u0432\u043e \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0442\u0438\u044f \u0442\u0430\u0440\u0438\u043a\u0430\u0442\u0438 \u043e\u0442 Oracle. \u0412\u0435\u0434\u043d\u044a\u0436 \u043a\u0430\u0442\u043e \u0438\u043c\u0430\u0445 \u0432\u044f\u0440\u043d\u043e\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043c\u0438\u0440\u0430\u043d\u0435\u0442\u043e \u043d\u0430 \u043d\u043e\u0442\u0430\u0442\u0430 \u043c\u0438 \u043e\u0442\u043d\u0435 \u043f\u043e-\u043c\u0430\u043b\u043a\u043e \u0442\u043e 2 \u043c\u0438\u043d\u0443\u0442\u0438<\/p>\n<blockquote><p>\n<strong>ORA-28000 &#8222;the account is locked&#8220; in the standby database, even after the account was unlocked in the primary. (Doc ID 1600401.1)<\/strong><\/p>\n<p><em>Applies to:<\/em><br \/>\nOracle Database &#8211; Enterprise Edition &#8211; Version 11.1.0.6 to 11.2.0.4 [Release 11.1 to 11.2]<br \/>\nInformation in this document applies to any platform.<\/p>\n<p><em>Symptoms<\/em><br \/>\nA user&#8217;s account in an Active Dataguard standby database is locked, for example as a result of multiple logon attempts with a wrong password to that standby database.  The user attempts to logon and gets an error ORA-28000 &#8222;the account is locked&#8220;.  The database administrator unlock this user&#8217;s account in the primary database.  Still, the user cannot connect to the standby, getting the same error ORA-28000.<\/p>\n<p><em>Cause<\/em><br \/>\nA privileged user (a database administrator) must unlock account in the standby database.  It is not enough to unlock the same account in the primary database.  This is because the standby is open read-only and cannot update any tables.  When a user&#8217;s account has to be locked on the standby database, it is locked only in memory there.<\/p>\n<p><em>Solution<\/em><br \/>\nA privileged user (sysdba, the database administrator) must logon to the standby and unlock the account there.  A message ORA-28015 &#8222;Account unlocked, but the database is open for read-only access&#8220; confirms that the account is now unlocked in the standby database.  From then on, the user can logon to the standby database without getting any error.\n<\/p><\/blockquote>\n<p>\u0422\u043e\u0432\u0430 \u043e\u0431\u044f\u0441\u043d\u0438 \u043d\u0435 \u0441\u0430\u043c\u043e \u0437\u0430\u0449\u043e \u0432 DBA_USERS \u0432\u0441\u0438\u0447\u043a\u043e \u0435 \u043d\u0430\u0440\u0435\u0434, \u043d\u043e \u0438 \u0437\u0430\u0449\u043e \u043f\u043e\u043d\u044f\u043a\u043e\u0433\u0430 \u0443\u0441\u043f\u044f\u0432\u0430<br \/>\n&#8211; \u043f\u044a\u0440\u0432\u043e, \u043f\u043e\u043d\u0435\u0436\u0435 \u0431\u0430\u0437\u0430\u0442\u0430 \u0435 read-only, \u0437\u0430\u043a\u043b\u044e\u0447\u0432\u0430\u043d\u0435\u0442\u043e \u043d\u0435 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0441\u0435 \u043e\u0442\u0440\u0430\u0437\u0438 \u0432 DBA_USERS (\u0434\u0435\u043c\u0435\u043a USER$). \u0417\u0430 \u0442\u043e\u0432\u0430 \u043a\u0430\u0442\u043e \u043f\u0438\u0442\u0430\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0442\u0430 \u0432\u0441\u0438\u0447\u043a\u043e \u0435 \u043d\u0430\u0440\u0435\u0434 &#8211; \u0442\u0430\u043c \u043d\u044f\u043c\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0437\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0432\u0430\u043d\u0435\u0442\u043e, \u0442\u044f \u0441\u0435 \u043f\u0430\u0437\u0438 \u0441\u0430\u043c\u043e \u0432 \u043f\u0430\u043c\u0435\u0442\u0442\u0430 \u043d\u0430 ADG instance. \u041a\u043e\u0435\u0442\u043e \u0435 \u043d\u044f\u043a\u0430\u043a\u044a\u0432 \u0441\u0442\u0440\u0430\u043d\u0435\u043d \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441&#8230;<br \/>\n&#8211; \u043f\u043e\u043d\u0435\u0436\u0435 \u0431\u0430\u0437\u0430\u0442\u0430 \u0435 RAC, \u0430 \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0442\u043e\u0432\u0430 \u0442\u0430\u0439\u043d\u043e \u043c\u0435\u0441\u0442\u0435\u043d\u0446\u0435 \u0432 \u043f\u0430\u043c\u0435\u0442\u0442\u0430 \u043d\u0435 \u0435 \u0437\u0430\u0449\u0438\u0442\u0435\u043d\u0430 \u043e\u0442 cache fusion, \u0443\u0441\u043f\u0435\u0445\u0430 \u0432 \u043b\u043e\u0433\u0432\u0430\u043d\u0435\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438 \u043e\u0442 \u0442\u043e\u0432\u0430 \u043d\u0430 \u043a\u043e\u0439 \u043d\u043e\u0434 \u0449\u0435 \u043f\u043e\u043f\u0430\u0434\u043d\u0435\u0448. \u0417\u0430 \u0442\u043e\u0432\u0430 \u043f\u043e\u043d\u044f\u043a\u043e\u0433\u0430 \u0441\u0442\u0430\u0432\u0430, \u0430 \u043f\u043e\u043d\u044f\u043a\u043e\u0433\u0430 &#8211; \u043d\u0435.<br \/>\n&#8211; \u043f\u043e\u043d\u0435\u0436\u0435 \u043d\u0430 \u0431\u0430\u0437\u0430\u0442\u0430 \u043d\u044f\u043c\u0430 \u043a\u043e\u0439-\u0437\u043d\u0430\u0435-\u043a\u0430\u043a\u044a\u0432 load, \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043a\u0430\u0447\u0438\u043b\u0438\u0442\u0435 \u0441\u0435 \u0441\u0435\u0441\u0438\u0438 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u044f \u043d\u0430 &#8222;\u043d\u0435-\u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f&#8220; \u043d\u043e\u0434, \u043a\u043e\u043b\u043a\u043e\u0442\u043e \u0438 \u043c\u0438\u0437\u0435\u0440\u043d\u043e \u043d\u0430\u0442\u043e\u0432\u0430\u0440\u0432\u0430\u043d\u0435 \u0434\u0430 \u043f\u0440\u0430\u0432\u044f\u0442, \u0441\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u044a\u0447\u043d\u0438, \u0437\u0430 \u0434\u0430 \u043c\u043e\u0436\u0435 server-side load-balancing \u0434\u0430 \u0433\u043e \u0445\u0432\u044a\u0440\u043b\u044f \u043f\u043e-\u0447\u0435\u0441\u0442\u043e \u043a\u044a\u043c &#8222;\u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f&#8220;. \u0417\u0430\u0442\u043e\u0432\u0430 \u0441\u0440\u0435\u0434\u043d\u043e 1 \u043e\u0442 4 \u043b\u043e\u0433\u0438\u043d\u0430 \u043c\u0438\u043d\u0430\u0432\u0430.<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435\u0442\u043e &#8211; \u043f\u0443\u0441\u043d\u0430\u0445 \u0438 \u043d\u0430 \u0434\u0432\u0430\u0442\u0430 \u043d\u043e\u0434\u0430 \u043d\u0430 ADG:<\/p>\n<pre class=\"brush:sql\">\r\nSQL> alter user xxx account unlock;\r\nalter user xxx account unlock\r\n*\r\nERROR at line 1:\r\nORA-28015: Account unlocked, but the database is open for read-only access\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0422\u043e\u0432\u0430 \u043c\u0435 \u0438\u0437\u043d\u0435\u043d\u0430\u0434\u0430, \u0447\u0435\u0441\u0442\u043d\u043e! \u0415\u0434\u0438\u043d \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b \u043c\u0438 \u0441\u0435 \u043e\u043f\u043b\u0430\u043a\u0430, \u0447\u0435 \u0441\u0438 \u0435 \u043e\u0431\u044a\u0440\u043a\u0430\u043b \u043f\u0430\u0440\u043e\u043b\u0430\u0442\u0430 \u043d\u044f\u043a\u043e\u043b\u043a\u043e \u043f\u044a\u0442\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0432\u0430 ORA-28000. \u041f\u0440\u0435\u0434\u0438 \u0434\u0430 \u0433\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430, \u0440\u0435\u0448\u0438\u0445 \u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f \u043a\u0430\u043a\u0432\u043e \u0435 \u0441\u0442\u0430\u043d\u0430\u043b\u043e &#8211; \u043d\u0430\u043b\u0438 \u0432\u0441\u0435 \u043f\u0430\u043a \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438\u0442\u0435 \u0441\u0430 \u0441\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u0435\u043b\u0438&#8230; SQL> select account_status from dba_users where username = &#8216;xxx&#8217;; ACCOUNT_STATUS &#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211; OPEN A! \u0428\u0430\u0445 \u0441 \u043f\u0435\u0448\u043a\u0430\u0442\u0430. \u0418 \u0437\u0430\u043f\u043e\u0447\u043d\u0430 <a href='http:\/\/blog.yavor.info\/?p=2179' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/posts\/2179"}],"collection":[{"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2179"}],"version-history":[{"count":6,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/posts\/2179\/revisions"}],"predecessor-version":[{"id":2185,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=\/wp\/v2\/posts\/2179\/revisions\/2185"}],"wp:attachment":[{"href":"http:\/\/blog.yavor.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2179"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.yavor.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}