orapwd建立密码及验证方法

orapwd file=$ORACLE_HOME/dbs/orapwSID password=xx
file名的格式必须是orapw+ORACLE_SID,否则不会正常

[oracle@GI_Softwareonly_64 dbs]$ orapwd
Usage: orapwd file= entries= force= ignorecase= nosysdba=
  where
    file - name of password file (required),
    password - password for SYS will be prompted if not specified at command line,
    entries - maximum number of distinct DBA (optional),
    force - whether to overwrite existing file (optional),
    ignorecase - passwords are case-insensitive (optional),
    nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).    
  There must be no spaces around the equal-to (=) character.



CREATE DATABASE TDB
   USER SYS IDENTIFIED BY sys_password
   ....
虽然会有sys用户,且用户状态OPNE,但是
$ORACLE_HOME/dbs下面 不会有密码文件
SQL> select * from v$pwfile_users没有结果
sqlplus sys/XX@PROD1 as sysdba报错权限不够
sqlplus sys/XX@PROD1无法登陆,提示需要sysdba或sysopen
SQL> grant sysdba to sys报错ORA-01994: GRANT failed: password file missing or disabled
一旦$ORACLE_HOME/dbs下面有密码文件,则alter user sys identified时,ls -tl时,密码文件的时间会变成alter user sys identified的执行时间

试验证明1:
先使用orapwd建立了密码A,再使用create database user sys建立了密码B,真正的密码是A,使用密码B登录时sqlplus sys/B@prod_s as sysdba是会报错ORA-01017: invalid username/password; logon denied,使用密码A登录时sqlplus sys/A@prod_s as sysdba正常
试验证明2:CREATE DATABASE TDB USER SYSTEM发现,system用户自动有DBA权限了



比如ORACLE_SID=PROD1,对应的tns也是PROD1
1、
sqlplus sys/XX@PROD1 as sysdba
报错ORA-01017: invalid username/password; logon denied,说明正常配置,只是sys后面的密码XX错误了
报错ORA-01031: insufficient privileges,说明没有配置成功

2、
SQL> select * from v$pwfile_users;
有结果,说明正常配置
没有结果,说明没有配置成功




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30126024/viewspace-2146901/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30126024/viewspace-2146901/

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值