首页 » ORACLE » V$PWFILE_USERS没有数据,sys无法登录

V$PWFILE_USERS没有数据,sys无法登录

V$PWFILE_USERS 列出的是password文件里已授予sysdba、sysoper权限的用户,如果查询没有记录,那就有可能没有了password文件了,没有了密码文件当然sqlplus sys/xx as sysdba这种用sys用sysdba用户就无法登录了,这里又涉及到了oracle的认证方式,分为系统认证与密码文件认证,这个在以前的文章有写http://www.anbob.com/?p=416

SQL*Plus: Release 10.2.0.4.0 – Production on Wed Jun 24 17:58:48 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Enter user-name: / as sysdba

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from V$PWFILE_USERS;

USERNAME SYSDB SYSOP
—————————— —– —–
SYS TRUE TRUE

SQL> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> !mv orapwv102 temp-orapwv102

SQL> startup
ORACLE instance started.

Total System Global Area 276824064 bytes
Fixed Size 1266996 bytes
Variable Size 109054668 bytes
Database Buffers 159383552 bytes
Redo Buffers 7118848 bytes
Database mounted.
Database opened.
SQL> select * from V$PWFILE_USERS;

no rows selected

SQL> !mv temp-orapwv102 orapwv102

SQL> select * from V$PWFILE_USERS;

USERNAME SYSDB SYSOP
—————————— —– —–
SYS TRUE TRUE

如果密码文件丢了也没关系,平时也没有备份的必要,再重建一个就可以,用orapwd,命令如:
orapwd file=filename password=password entries=max_users
密码文件一般保存在$ORACLE_HOME/DBS(DATABASE)目录下,命名为pwd.ora

Note: Do not remove or modify the password file if you have a database or instance mounted using REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE (or SHARED). If you do, you will be unable to reconnect remotely using the password file. Even if you replace it, you cannot use the new password file, because the timestamps and checksums will be wrong.

打赏

目前这篇文章有2条评论(Rss)评论关闭。

  1. Ariel Stainbrook | #1
    2011-12-21 at 06:20

    Valuable info. Lucky me I found your site by accident, and I’m stunned why this coincidence didn’t came about in advance! I bookmarked it.

  2. Kaleigh | #2
    2011-06-16 at 11:49

    Wow, your post makes mine look felbee. More power to you!