SQL> conn sys/xxxdb@xxxdb as sysdba
ERROR:
ORA-01031: insufficient privileges
原因:没有密码文件
orapwd oracle@standby:~/product/10.2/db_1/network/admin> oerr ora 1031
01031, 00000, "insufficient privileges"
// *Cause: An attempt was made to change the current username or password
// without the appropriate privilege. This error also occurs if
// attempting to install a database without the necessary operating
// system privileges.
// When Trusted Oracle is configure in DBMS MAC, this error may occur
// if the user was granted the necessary privilege at a higher label
// than the current login.
// *Action: Ask the database administrator to perform. the operation or grant
// the required privileges.
// For Trusted Oracle users getting this error although granted the
// the appropriate privilege at a higher label, ask the database
// administrator to regrant the privilege at the appropriate label.
oracle@standby:~/product/10.2/db_1/network/admin>
SQL> conn / as sysdba
Connected.
SQL> show parameter remot
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_archive_enable string true
remote_dependencies_mode string TIMESTAMP
remote_listener string
remote_login_passwordfile string EXCLUSIVEremote_os_authent boolean FALSE
remote_os_roles boolean FALSE
SQL>
SQL> grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled
SQL> grant dba to sys;
Grant succeeded.
SQL> select * from session_roles;
no rows selected
oracle@standby:~/product/10.2/db_1/dbs> orapwd
Usage: orapwd file= password= entries= force= nosysdba= where file - name of password file (mand), password - password for SYS (mand), entries - maximum number of distinct DBA, force - whether to overwrite existing file (opt), nosysdba - whether to shut out the SYSDBA logon (opt for Database Vault only). There are no spaces around the equal-to (=) character. 下面通过ORAPWD工具新建一个密码文件,指定一个新的密码:
$ cd $ORACLE_HOME/dbs
$ orapwd file=orapwbjtest password=newpasswd entries=100
其中password用来设置SYS用户密码,而entries表示密码文件中可以保存多少条记录。
需要注意,这个值并不是一个确切的数量,真正可以保存的记录数可能会有所出入,这和1个操作系统块能保存多少条记录有关系。
oracle@standby:~/product/10.2/db_1/dbs>
orapwd file=orapwxxxdb password=xxxdb oracle@standby:~/product/10.2/db_1/dbs> cat orapwxxxdb
]\[ZORACLE Remote Password fileNTERNAD0830AC0E3C3D9D2SYS163AF67D38AAF55Foracle@standby:~/product/10.2/db_1/dbs>
SQL>
conn sys/xxxdb@xxxdb as sysdbaConnected.
参看:http://yangtingkun.itpub.net/post/468/482002
http://www.comp.dit.ie/btierney/oracle11gdoc/server.111/b28310/dba007.htm
Example
The following command creates a password file named orapworcl that allows up to 30 privileged users with different passwords.
orapwd FILE=orapworcl ENTRIES=30
ORAPWD Command Line Argument Descriptions
The following sections describe the ORAPWD command line arguments.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/77164/viewspace-668562/
,如需转载,请注明出处,否则将追究法律责任。