文章来源于:
http://www.cnblogs.com/kelantas/archive/2011/02/18/1958173.html
[oracle@guohuias3 dbs]$ sqlplus sys
/
kelantas@orcl
as
sysdba
SQL * Plus : Release 10.2 . 0.1 . 0 - Production on Fri Feb 18 20 : 40 : 24 2011
Copyright (c) 1982 , 2005 , Oracle . All rights reserved .
ERROR :
ORA - 01031 : insufficient privileges
Enter user - name :
SQL * Plus : Release 10.2 . 0.1 . 0 - Production on Fri Feb 18 20 : 40 : 24 2011
Copyright (c) 1982 , 2005 , Oracle . All rights reserved .
ERROR :
ORA - 01031 : insufficient privileges
Enter user - name :
以internal的方式登入
[oracle@guohuias3 oracle]$ sqlplus
/
nolog
SQL * Plus : Release 10.2 . 0.1 . 0 - Production on Fri Feb 18 20 : 13 : 41 2011
Copyright (c) 1982 , 2005 , Oracle . All rights reserved .
SQL > connect / as sysdba
Connected .
SQL > show parameter password;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL > grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1 :
ORA - 01994 : GRANT failed : password file missing or disabled
SQL > select * from v $pwfile_users ;
no rows selected
SQL * Plus : Release 10.2 . 0.1 . 0 - Production on Fri Feb 18 20 : 13 : 41 2011
Copyright (c) 1982 , 2005 , Oracle . All rights reserved .
SQL > connect / as sysdba
Connected .
SQL > show parameter password;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL > grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1 :
ORA - 01994 : GRANT failed : password file missing or disabled
SQL > select * from v $pwfile_users ;
no rows selected
发现没有password文件;
检查password文件是否正确
[oracle@guohuias3 dbs]$ cd
$ORACLE_HOME
/
dbs
[oracle@guohuias3 dbs]$ ls - l orapw *
- rw - r ----- 1 oracle oinstall 5120 Jul 9 2010 orapwAUXY . pwd
- rw - r ----- 1 oracle oinstall 2560 Feb 18 20 : 26 orapworcl
[oracle@guohuias3 dbs]$ ls - l orapw *
- rw - r ----- 1 oracle oinstall 5120 Jul 9 2010 orapwAUXY . pwd
- rw - r ----- 1 oracle oinstall 2560 Feb 18 20 : 26 orapworcl
检查当前 $ORACLE_SID=ORCL
发现password文件的orcl是小写的,把它改正过来
[oracle@guohuias3 dbs]$ mv orapworcl orapwORCL
并再次查询相关视图:
SQL > select * from v $pwfile_users ;
USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE
并再次查询相关视图:
SQL > select * from v $pwfile_users ;
USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE
可以看到有对应的password文件了。
现在再次登入
[oracle@guohuias3 dbs]$ sqlplus sys
/
kelantas@orcl
as
sysdba
SQL * Plus : Release 10.2 . 0.1 . 0 - Production on Fri Feb 18 20 : 51 : 05 2011
Copyright (c) 1982 , 2005 , Oracle . All rights reserved .
Connected to :
Oracle Database 10g Enterprise Edition Release 10.2 . 0.1 . 0 - Production
With the Partitioning , OLAP and Data Mining options
SQL >
SQL * Plus : Release 10.2 . 0.1 . 0 - Production on Fri Feb 18 20 : 51 : 05 2011
Copyright (c) 1982 , 2005 , Oracle . All rights reserved .
Connected to :
Oracle Database 10g Enterprise Edition Release 10.2 . 0.1 . 0 - Production
With the Partitioning , OLAP and Data Mining options
SQL >
问题解决了。
之后我这边又出现了ora-01017:用户名 口令无效 登陆被拒绝:
dos命令登陆sqlplus执行下面命令即可。
SQL>alter user 用户名 identified by 密码;