使用SYS使用者遠端登陸報許可權不足的解決:ORA-01031: insufficient privileges

還不算暈發表於2013-11-15

1.監聽及tnsnames.ora正常,普通使用者使用服務名可以登陸資料庫。

[oracle@orale admin]$ cat tnsnames.ora
mypl =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.22.55)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = mypl)
    )
  )
[oracle@orale admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 15-NOV-2013 22:30:55
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                15-NOV-2013 20:13:45
Uptime                    0 days 2 hr. 17 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/diag/tnslsnr/orale stener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orale)(PORT=1521)))
Services Summary...
Service "mypl" has 1 instance(s).
  Instance "mypl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@orale admin]$ sqlplus xiaoming/xiaoming@mypl
SQL*Plus: Release 11.2.0.1.0 Production on Fri Nov 15 22:26:52 2013
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
#########################################################################

2.使用SYS使用者登陸報許可權不足--上一步驗證了監聽及tnsnames.ora是正確的。

[oracle@orale admin]$ sqlplus sys/oracle@mypl as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Fri Nov 15 22:27:31 2013
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name:
##########################################

3.檢查$ORACLE_HOME/dbs目錄下的密碼檔案,當前例項名是mypl。

[oracle@orale dbs]$ ls
hc_DBUA0.dat  init.ora  spfilemypl.ora
hc_mypl.dat  orapwocm    peshm_plocp_0
檢查發現密碼檔案格式與當前例項名不符。
此時可以重建密碼檔案或者將orapwocm重命令為orapwmypl

建立密碼檔案--注意WINDOWS下和LINUX下的密碼檔案格式是不一樣的
注意:WIN下資料夾名和LINUX下不一樣。WIN下$ORACLE_HOME/database  LINUX下是:$ORACLE_HOME\dbs\
如例項名為orcl,則WINDOWS下密碼檔案格式為:PWDorcl.ORA   LINUX下為orapworcl
如下建立密碼檔案,密碼為oracle,例項名為orapwbys3
orapwd  file=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwbys3  password=oracle entries=3 force=y

4.重命令為用SYS使用者可以正常登陸--就不演示了。

相關文章