暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

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

原创 Anbob 2011-05-12
1221
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.
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论