oracle password file 命名規則

關於oracle密碼檔的一點學習[2008/9/3]
【字體:  】【列印

創建密碼檔的命令


    orapwd  file=<>  password=<> entries=最大數目


    這裏的file命名規則在unix/linux下 orapw<ORACLE_SID>,在windows下為 pwd<SID>.ora

 1. Log in as the Oracle software owner.


    2. Use the orapwd utility to create the password file as follows:$ $ORACLE_HOME/bin/orapwd file=filename password=password entries=max_users……
    filename The name of the file in which password information is written
    The name of the file must be orapwsid, and you must supply the full path name. Its contents are encrypted. Typically, the password file is created in the $ORACLE_HOME/dbs directory.
    請注意黑體字, 所以unix環境中, password file 一定是要用 orapw<SID>, 沒有例外。


    2. windows 環境:
    查了Platform. Guide 10g Release 2 (10.2) for Microsoft Windows (32-Bit) (沒查64-bit)
    To create and populate a password file:


    (1). Create a password file with the Password Utility:
    C:> orapwd FILE=PWDsid.ora PASSWORD=password ENTRIES=max_users 
    where
     | FILE specifies the password filename. 
    | SID identifies the database instance. 
    | PASSWORD sets the password for account SYS. 
    | ENTRIES sets maximum number of entries in password file. This corresponds to maximum number of distinct users allowed to connect to the database simultaneously with either the SYSDBA or the SYSOPER DBA privilege.


    (2). Set initialization parameter file parameter REMOTE_LOGIN_PASSWORDFILE to exclusive, shared, or none.
    In search of the password file, Oracle Database looks in the registry for the value of parameter 
    ORA_SID_PWFILE. If no value is specified, then it looks in the registry for the 
    value of parameter ORA_PWFILE, which points to a file containing usernames,
    passwords, and privileges. If that is not set, then it uses the default:
    ORACLE_BASEORACLE_HOMEDATABASEPWDsid.ORA. 
    The default value is shared.


    請注意黑體字, windows 環境中, 很大的部分是基於 registry 中變數 ora_sid_pwfile 或者 ora_pwfile 的設置, 缺省的值, 正如paulyibinyi兄弟指出的, 是 pwd<SID>.ora (unix中是沒有這個。ora尾碼的)。


    二、在windows下對於connect /as sysdba及其它用戶可以不用密碼就能登錄的問題


    1.這是因為oracle採用了 OS認證的方式,具體的可以查看 sqlnet.ora具體同容如下
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    將其改成SQLNET.AUTHENTICATION_SERVICES= (NONE)
    這樣就是oracle認證方式了


    2.因為用的OS認證方式,可以在作業系統->控制面版->電腦管理->用戶 將當前用戶的屬性組 ORA_DBA去掉,這時如果沒有用戶名及密碼則不可以。 
    如下:
    SQL> connect /as sysdba ERROR:ORA-01031: insufficient privileges
    SQL> connect sys/oracle as sysdba
    已連接。


    三、利用alter user identified by ……來修改密碼alter user sys identified by abc一下,就連資料庫中的密碼和密碼檔中的密碼一起改成abc了;


    四、如果密碼檔丟失瞭如何辦?


    利用 orapwd重新創建一個就可以了。



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章