设为首页 收藏本站
查看: 645|回复: 0

[经验分享] oracle passwdfile-pl

[复制链接]

尚未签到

发表于 2018-9-13 09:49:44 | 显示全部楼层 |阅读模式
  password file(密码文件):
  验证拥有sysdba权限的用户登录时的密码校验;
  ******************************************************
  Oracle的验证机制:
  1.密码验证
  2.操作系统验证
  3.数据库验证
  2.操作系统验证
  如果一个用户,能够正常登录,那么不再需要数据库验证,就能够登录数据库的这种情况
  称之为操作系统验证;
  一种以sysdba身份,登录数据库,需要该用户属于dba组即可;
  另外一种是普通数据库用户的操作系统验证;
  a.验证sysdba权限用户的操作系统验证
  --创建一个新用户newora:
  [root@db253 mnt]# useradd newora
  [root@db253 mnt]# id newora
  uid=778(newora) gid=778(newora) groups=778(newora)
  --添加一个附加组dba
  [root@db253 mnt]# usermod -a -G dba newora
  [root@db253 mnt]# id newora
  uid=778(newora) gid=778(newora) groups=778(newora),1100(dba)
  --设置系统用户密码
  [root@db253 mnt]# passwd newora
  Changing password for user newora.
  New UNIX password:
  BAD PASSWORD: it is based on a dictionary word
  Retype new UNIX password:
  passwd: all authentication tokens updated successfully.
  --需要设置对应的环境变量
  [root@db253 mnt]# su - newora
  [newora@db253 ~]$ sqlplus / as sysdba
  -bash: sqlplus: command not found
  [root@db253 mnt]# cp /home/oracle/.bash_profile /home/newora/.bash_profile
  cp: overwrite `/home/newora/.bash_profile'? y
  --注意:第一,用户肯定要属于dba组;
  第二,设定用户的对应权限
  [root@db11g ~]# su - newora
  [newora@db11g ~]$ sqlplus / as sysdba
  Connected to:
  Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
  SYS@orcl11g>
  b.普通的数据库用户,也能实现操作系统验证
  --首先,查看操作系统认证的前缀
  SYS@orcl11g> show parameter os_authent_prefix
  NAME                                 TYPE        VALUE
  ------------------------------------ ----------- --------
  os_authent_prefix                    string      ops$
  [root@db253 mnt]# useradd ora
  [root@db253 mnt]# usermod -a -G oinstall ora
  [root@db253 mnt]# id ora
  uid=779(ora) gid=779(ora) groups=779(ora),1000(oinstall)
  [root@db253 mnt]# passwd ora
  Changing password for user ora.
  New UNIX password:
  BAD PASSWORD: it is based on a dictionary word
  Retype new UNIX password:
  passwd: all authentication tokens updated successfully.
  [root@db253 mnt]# cp /home/oracle/.bash_profile  /home/ora/.bash_profile
  cp: overwrite `/home/ora/.bash_profile'? y
  --创建一个数据库用户:
  SYS@orcl11g> create user "OPS$ORA" identified externally
  2  default tablespace users temporary tablespace temp
  3  quota unlimited on users;
  User created.
  SYS@orcl11g> grant create session to "OPS$ORA";
  Grant succeeded.
  [oracle@db253 ~]$ su - ora
  Password:
  [ora@db253 ~]$ sqlplus /nolog
  SQL*Plus: Release 11.2.0.3.0 Production on Sun Jun 16 14:07:12 2013
  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
  @> conn /
  Connected.
  OPS$ORA@orcl11g> show user;
  USER is "OPS$ORA"
  OPS$ORA@orcl11g>
  注意:
  SYS@orcl11g> show parameter os_authent
  NAME                                 TYPE        VALUE
  ------------------------------------ ----------- ------------------------------
  os_authent_prefix                    string      ops$
  remote_os_authent                    boolean     FALSE
  remote_os_authent: 远程操作系统验证
  SYS@orcl11g> alter system set remote_os_authent=true scope=spfile;
  System altered.
  服务器端地址:192.168.3.253
  ora:oracle
  客户端地址:192.168.3.109
  ora:123
  [ora@localhost ~]$ sqlplus /nolog
  SQL*Plus: Release 11.2.0.3.0 Production on Tue Jun 11 18:55:37 2013
  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
  @> conn /@orcl253
  Connected.
  OPS$ORA@orcl253>
  ***********************************************************
  密码文件验证
  密码文件存在的位置:
  $ORACLE_HOME/dbs
  密码文件的命名规则:
  orapw
  密码文件的文件类型以内容:
  [oracle@db253 dbs]$ file orapworcl11g
  orapworcl11g: data
  [oracle@db253 dbs]$ strings orapworcl11g
  ]\[Z
  ORACLE Remote Password file
  INTERNAL
  87C5F4BF47942D0E
  e^D_
  4CCF4A082AD3F312
  SCOTT
  F894844C34402B67
  密码文件存在的意义:
  保存超级用户(sysdba)的用户名和口令
  超级用户的密码审核不能依赖于数据库内部。
  超级用户,具有启动数据库的能力。如果数据库没有启动,就无法验证。
  网络使用sys用户登录数据库,要用到密码文件:
  [oracle@db11g dbs]$ sqlplus sys/oracle@172.16.254.254:1521/orcl11g.neves.com as sysdba
  SYS@172.16.254.254:1521/orcl11g.neves.com>
  密码文件丢了:
  [oracle@db11g dbs]$ rm -f orapworcl11g
  [oracle@db11g dbs]$ sqlplus sys/oracle@172.16.254.254:1521/orcl11g.neves.com as sysdba
  SQL*Plus: Release 11.2.0.3.0 Production on Mon Sep 23 14:41:22 2013
  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
  ERROR:
  ORA-01031: insufficient privileges
  密码文件重建:
  [oracle@db253 dbs]$ orapwd file=$ORACLE_HOME/dbs/orapworcl11g password=Oracle321
  [oracle@db253 dbs]$ ls orapworcl11g
  orapworcl11g
  [oracle@db253 dbs]$ strings orapworcl11g
  ]\[Z
  ORACLE Remote Password file
  INTERNAL
  8CA787CEFE8024B2
  IY}d
  41981DB57414C1B4
  2n F
  修改sys用户密码两种方式:
  1.重建密码文件
  2.数据库内部
  alter user sys identified by "Oracle123";


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-577452-1-1.html 上篇帖子: Oracle 中ROWNUM用法总结,ROWNUM 与 ROWID 区别 下篇帖子: Oracle 增加修改删除字段
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表