Oracle 11g中解決被鎖定的scott使用者的方法

來源:互聯網
上載者:User

Oracle 11g中解決被鎖定的scott使用者的方法

Oracle 11g中修改被鎖定的使用者:scott

在安裝完Oracle10g和建立完oracle資料庫之後,想用資料庫內建的使用者scott登入,看看串連是否成功。

在cmd命令中,用“sqlplus  scott/ tiger”登入時,老是提示如下資訊: ERROR:ORA-28000:賬戶已被鎖定。

在cmd命令提示字元中可直接登入oracle,輸入如下命令:

sqlplus / as sysdba;

接著執行如下命令:

SQL> alter user scott account unlock;

顯示使用者已更改,這樣就完成解鎖的操作。

接下來,你還可以重新給scott這個使用者設定密碼

修改scott的登入密碼:

SQL> alter user scott identified by grace;

顯示使用者已更改,(grace為新的密碼)

這樣就OK了,測試一下scott/grace能否成功登入

SQL> conn scott/grace

顯示已串連。


初學Oracle 資料庫的小總結:

在cmd命令中輸入sqlplus可以串連資料庫,其格式為:

sqlplus 使用者名稱/密碼 

如:sqlplus scott/tiger;

在SQL Plus 中輸入conn可以串連資料庫,其格式為:

SQL> conn 使用者名稱/密碼

如:conn scott/tiger;

在SQL Plus修改普通使用者密碼,其格式為:

aler user 使用者名稱 identified by 密碼

如:alter user scott identified by grace;

Oracle中給使用者加鎖與解鎖的代碼:

SQL> alter user 使用者名稱 account lock;(加鎖)

SQL> alter user 使用者名稱 account unlock;(解鎖)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.