今天在做dg的时候在主库上使用sys连接主库总是报ora-01031:insufficient privileges的错误:
1、查看参数 remote_login_passwordfile is set to SHARED or EXCLUSIVE
SQL> show parameter remote_login_passwordfile
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
remote_login_passwordfile string EXCLUSIVE---没有问题
2、查看使用密码文件的用户中是否有sys用户
SQL> select * from v$pwfile_users;
no rows selected
SQL> grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled
没有密码文件????马上查看是否存在密码文件
[oracle@master-new dbs]$ pwd
/disk2/oracle/product/11.2.0/dbs
发现密码文件竟然是:orapwdmaildata---哎密码文件错误啊,应该是orapw开头,结果多了d,重建密码文件
orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID entries=10 password=password
那这里面的这个视图 v$pwfile_users到底有什么作用那????
http://www.xifenfei.com/2025.html--转载
一、V$PWFILE_USERS定义
V$PWFILE_USERS lists all
users
in
the password
file
, and indicates whether the user has been granted the SYSDBA, SYSOPER, and SYSASM privileges.
Column Datatype Description
USERNAM VARCHAR2(30) Name of the user that is contained
in
the password
file
SYSDBA VARCHAR2(5) Indicates whether the user can connect with SYSDBA privileges (TRUE) or not (FALSE)
SYSOPER VARCHAR2(5) Indicates whether the user can connect with SYSOPER privileges (TRUE) or not (FALSE)
SYSASM VARCHAR2(5) Indicates whether the user can connect with SYSASM privileges (TRUE) or not (FALSE)
|
二、v$pwfile_users与密码文件关系
[oracle@node1 ~]$ sqlplus /
as
sysdba
SQL*Plus: Release 11.2.0.3.0 Production
on
Sun
Dec
4 19:08:06 2011
Copyright (c) 1982, 2011, Oracle.
All
rights reserved.
Connected
to
:
Oracle
Database
11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With
the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle
Database
Vault
and
Real
Application Testing options
--查看密码文件用户权限
SQL>
select
*
from
v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS
TRUE
TRUE
FALSE
SQL> show parameter instance_name;
NAME
TYPE VALUE
------------------------------------ ----------- ------------------
instance_name string ora11g
--查看系统级别查看密码文件内容
SQL> !strings $ORACLE_HOME/dbs/orapwora11g
]\[Z
ORACLE Remote
Password
file
INTERNAL
A1174901D667F113
18698BFD1A045BCC
--创建新sysdba用户,查看视图和密码文件变化
SQL>
create
user
xff01 identified
by
xifenfei;
User
created.
SQL>
grant
sysdba
to
xff01;
Grant
succeeded.
SQL>
select
*
from
v$pwfile_users;
USERNAME SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS
TRUE
TRUE
FALSE
XFF01
TRUE
FALSE
FALSE
|