D:\Users\xiaomaimiao>sqlplus sys/lhr@192.168.1.31/orastrac as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Jul 15 11:36:54 2017
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
注意多个数据库实例时候,setORACLE_SID='',
1、检查sqlnet.ora(WINDOWS下位于%ORACLE_HOME%NETWORK\ADMIN目录)是否包含这句:SQLNET.AUTHENTICATION_SERVICES=(NTS),没有的话加上,linux的话可以没有这个文件或者为这样SQLNET.AUTHENTICATION_SERVICES = (ALL)
2、检查登陆windows的用户(administrator或安装oracle时候使用的用户)是不是在包含在ORA_DBA组中,域用户没有连上域服务器时就可能出现这种现象。
3、要保证remote_login_passwordfile参数= EXCLUSIVE .
4、看看是否需要使用orapassw生成口令文件,口令文件是否存在
C:\Users\Administrator> orapwd file="E:\oracle\ora8i\DATABASE\PWDortest.ORA" password=lhr
[oracle@robinson dbs]$ orapwd file=$ORACLE_HOME/dbs/orapworcl password=oracle force=y
一种解决方法案例:
1、检查系统参数:
SQL> show parameter password
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
2、
select * from v$pwfile_users;
SQL>
为空
3、
SQL> grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled
4、建立password文件
D:/>orapwd file="D:/oracle/product/10g/db_1/database/PWDoratest.ora" password=gp oswong entries=10
5、
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE
SYS正常显示出来。
6、重新在远程以SYSDBA登录,可正常使用。
如果口令文件创建的有问题,也是会报如下的错误:
ora-01031:insufficient privileges
口令文件的命名格式应为orapwsid,并且sid是区分大小写的。由于Target Database连接Auxiliary Database时需要验证口令,
如果违反了以上规则,将会提示ORA-01031: insufficient privileges。
我在用linux创建duplicate数据库的时候 就是因为口令文件创建的路径和名称不对才遇到这个错误