ORACLE資料庫忘記SYS和SYSTEM密碼,SYSTEM被鎖定怎麼辦?

來源:互聯網
上載者:User

標籤:

本人忘性太大,竟然將ORACLE的Sys使用者和system使用者密碼搞忘,而且多次嘗試登入system後,造成system被鎖定。

經過一番嘗試,終於解決。過程如下:

首先,重建sys密碼檔案。重建方式為:

1、開啟cmd命令視窗;

2、執行orapwd命令,其用法為:

C:\WINDOWS\system32>orapwd

Usage: orapwd file=<fname> entries=<users> force=<y/n> ignorecase=<y/n> nosysdba=<y/n>

 

  where

    file - name of password file (required),

    password - password for SYS will be prompted if not specified at command line,

    entries - maximum number of distinct DBA (optional),

    force - whether to overwrite existing file (optional),

    ignorecase - passwords are case-insensitive (optional),

    nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).

file選項為檔案全路徑,檔案名稱為PWD+資料庫執行個體名+“.ora”。password為新設定的密碼。

我執行的命令格式如下:

C:\WINDOWS\system32>orapwd file=D:\Oracle\product\11.2.0\dbhome_1\database\PWD****.ora password=****** entries=5 force=y

(注意,執行重建密碼檔案命令之前,最好將原來的檔案備份一下)

執行命令後,新的密碼檔案會覆蓋原有的密碼檔案。

重啟ORACLE資料庫服務後,就可以用新的密碼登入SYS了。

 

下一步解決system使用者鎖定問題。

在CMD命令視窗中,用sqlplus串連資料庫。

C:\Documents and Settings\Administrator>sqlplus sys/***** as sysdba

其中**部分為登入密碼。

然後執行命令,將system解鎖。

SQL>alter user system account unlock;

最後修改system使用者的密碼。

SQL>alter user system identified by **********;

其中***部分為新的密碼。

至此system已被解鎖且可採用新的密碼登入。

原文連結:http://www.lhtry.net/Blog/Detail?id=19

 

ORACLE資料庫忘記SYS和SYSTEM密碼,SYSTEM被鎖定怎麼辦?

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.