1、如果密码文件不存在,则重创建密码文件:
oracle@linux-254:~/product/11gR1/db> orapwd file=/opt/oracle/product/11gR1/db/dbs/orapweconf force=y password=oracle
密码文件命名最好是以:orapwORACLE_SID的形式命令
force=y为覆盖的意思
password=oracle就是你实际登录密码了。
2、如果密码文件存在,也可以使用上一步进行覆盖,因为有时这个密码文件会被损坏
oracle@linux-254:~/product/11gR1/db> sqlplus /nolog
SQL*Plus: Release 11.1.0.7.0 - Production on Thu Oct 20 17:14:36 2011
Copyright (c) 1982, 2008, Oracle. All rights reserved.
SQL> connect sys as sysdba
Enter password:
Connected.
SQL> grant sysdba to sys;
Grant succeeded.
SQL> select * from v$pwfile_users;
USERNAME
--------------------------------------------------------------------------------
SYSDBA SYSOPER SYSASM
--------------- --------------- ---------------
SYS
TRUE TRUE FALSE
这样之后就可以使用PL/SQL工具以SYSDBA权限登录数据库了。