你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle密码文件

[日期:2013-08-17] 来源:Linux社区  作者:robinson_0612 [字体:大 中 小]

六、导致密码文件内容修改的几种方式:

1.使用orapwd建立,修改密码文件,不建议使用

2.使用alter user sys identified by <>

3.使用grant sysdba to <>或grant sysoper to <>或revoke sysdba |sysoper from <>

 

七、查看密码文件内容 */

 

[Oracle@robinson dbs]$ strings orapworcl

]/[Z

ORACLE Remote Password file

INTERNAL

F7AC0C5E9C3C37AB

E100B964899CDDDF

 

--当sys密码不记得可以使用OS系统身份认证登陆到sqlplus,再使用alter user修改密码

SQL> alteruser sys identified by oracle;

 

User altered

--再次查看密码文件与上一次对比,已经发生变化

SQL> ho strings orapworcl

]/[Z

ORACLE Remote Password file

INTERNAL

AB27B53EDC5FEF41

8A8F025737A9097A

 

 

--通过授予权限来修改密码,密码文件中多出了scott的信息

SQL> grant sysdbato scott;

 

Grant succeeded.

 

SQL> ho strings orapworcl

]/[Z

ORACLE Remote Password file

INTERNAL

AB27B53EDC5FEF41

8A8F025737A9097A

SCOTT

F894844C34402B67

 

 

--注意此处中登陆后,显示的账户信息还是sys,而不是scott,但此时的scott已经具备了sys权限

[oracle@robinson dbs]$ sqlplus scott/tiger@orclas sysdba

 

SQL*Plus: Release 10.2.0.1.0- Production on Fri Apr 9 11:56:09 2010

 

Copyright (c) 1982, 2005, Oracle.All rights reserved.

 

 

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0- Production

With the Partitioning, OLAPand Data Mining options

 

SQL> show user

USER is "SYS"

 

/*

八、sysdba与sysoper的区别*/

SQL> select* from system_privilege_mapwhere name like '%SYS%';

 

PRIVILEGE NAMEPROPERTY

---------- ---------------------------------------- ----------

-3 ALTER SYSTEM0

-4 AUDIT SYSTEM0

-83 SYSDBA0

-84 SYSOPER0

 

--下面的链接是两者不同的权限说明

http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/dba.htm#sthref137

The manner in which you are authorized to use these privileges depends upon the methodof authentication that you use.

 

When you connect with SYSDBA or SYSOPER privileges, you connectwith a default schema,

not with theschema that is generally associatedwith your username.

For SYSDBA this schemais SYS; for SYSOPER the schema is PUBLIC.

--两者的schema不同

SQL> show user

USER is "SYS"

SQL> conn /as sysoper

Connected.

SQL> show user

USER is "PUBLIC"

 

--查看密码文件视图,可以得到哪些用户为sysdba,哪些用户为sysoper

SQL> select* from v$pwfile_users;

 

USERNAMESYSDB SYSOP

------------------------------ ----- -----

SYSTRUETRUE

SCOTTTRUEFALSE

USER1FALSE TRUE

--下面演示了使用不同的角色来登陆

SQL> conn scott/tiger@orclas sysdba

Connected.

SQL> conn scott/tiger@orclas sysoper/*scott的sysop列为false*/

ERROR:

ORA-01031: insufficient privileges

 

 

Warning: You are no longer connected to ORACLE.

SQL> conn user1/user1@orclas sysdba

ERROR:

ORA-01031: insufficient privileges

 

 

SQL> conn user1/user1as sysoper

Connected.

/*

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

linux
相关资讯       Oracle密码  Oracle密码文件 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款