7 Oracle 管理用户和安全

用户和安全概览

用户账号由一个用户名确认,定义了用户的属性包括:
- 鉴权方式
- 数据库鉴权密码
- 永久存储和临时存储的默认表空间
- 表空间配额
- 账号状态(是否锁定)
- 密码状态(是否过期)
当你创建一个用户账号时,你不仅要指定账号名称/密码/默认表空间,还要做下面:
- 赋予合适的系统权限/对象权限/角色
- 如果用户会创建数据库对象,那就给账号在将要创建对象的表空间上分配表空间配额。
Oracle建议只给每个用户执行工作必须的权限。比如,一个数据库应用程序开发人员需要创建和修改表/视图/索引/存储过程的权限,但不需要删除表空间或者恢复数据库的权限。你可以为数据库管理创建账号,然后只分配部分管理权限。
另外你或许还想创建只有应用程序使用的账号。那就是,没有人用这些账号登陆;相反,程序使用这些账号连接数据库,然后用户登陆程序。这种用户账号避免给程序用户直接登陆数据库的能力,从而避免他们无意识地造成破坏。
当你创建一个账号时,你也间接地为这个用户创建了一个schema。一个schema就是这个用户创建的数据库对象的逻辑容器。schema的名称和用户账号的名称相同,被明确地用来代指这个用户拥有的对象。hr.employees指的是hr模式中的employees表(employees表被hr拥有)。数据库对象和模式对象可以相互替换的使用。
当你删除一个用户时,你必须同时删除那个用户的模式对象,或者已经提前删除了模式对象。

预先定义的账号

所有的数据库都包括sys,system,sysman和dbsnmp管理账号。是否包含其他账号取决于安装了什么特色或选项。
为了保护管理账号不被无授权地访问,这些账号初始状态是密码过期被锁定。数据库管理员应该按“解锁账号/重置密码”指引来解锁和重置这些账号。下表简述这些账号,Oracle数据库提供的管理账号:

UsernamePasswordDescriptionSee Also
CTXSYSCTXSYSThe Oracle Text accountOracle Text Reference
DBSNMPDBSNMPThe account used by the Management Agent component of Oracle Enterprise Manager to monitor and manage the databaseOracle Enterprise Manager Grid Control Installation and Basic Configuration
MDDATAMDDATAThe schema used by Oracle Spatial for storing Geocoder and router dataOracle Spatial User’s Guide and Reference
MDSYSMDSYSThe Oracle Spatial and Oracle interMedia Locator administrator accountOracle Spatial User’s Guide and Reference
DMSYSDMSYSThe data mining account.DMSYS performs data mining operations.Oracle Data Mining Administrator’s Guide Oracle Data Mining Concepts
OLAPSYSMANAGERThe account used to create OLAP metadata structures. This account owns the OLAP Catalog (CWMLite).Oracle OLAP Application Developer’s Guide
ORDPLUGINSORDPLUGINSThe Oracle interMedia user. Plugins supplied by Oracle and third party format plugins are installed in this schema.Oracle interMedia User’s Guide
ORDSYSORDSYSThe Oracle interMedia administrator accountOracle interMedia User’s Guide
OUTLNOUTLNThe account that supports plan stability. Plan stability enables you to maintain the same execution plans for the same SQL statements. OUTLN acts as a role to centrally manage metadata associated with stored outlines.Oracle Database Performance Tuning Guide
SI_INFORMTN_SCHEMASI_INFORMTN_SCHEMAThe account that stores the information views for the SQL/MM Still Image StandardOracle interMedia User’s Guide
SYSCHANGE_ON_INSTALLThe account used to perform database administration tasks“About Administrative Accounts”
SYSMANCHANGE_ON_INSTALLThe account used to perform Oracle Enterprise Manager database administration tasks. Note that SYS and SYSTEM can also perform these tasks.Oracle Enterprise Manager Grid Control Installation and Basic Configuration
SYSTEMMANAGERAnother account used to perform database administration tasks“About Administrative Accounts”

管理角色

系统权限/对象权限/角色提供了数据库的基本安全。它们用来控制用户访问数据,限制用户执行的SQL类型。

关于权限和角色

角色是权限的分类组合,据此可以创建不同的数据库访问层级。

Privilege or RoleDescriptionExamples
System privilegeAn Oracle-defined privilege usually granted only to and by administrators. System privileges enable users to perform specific database operations.The following are examples of system privileges that can be granted to users:CREATE TABLE allows grantee to create tables in the grantee’s schema.##CREATE USER allows grantee to create users in the database.##CREATE SESSION allows grantee to connect to an Oracle database to create a user session.
Object privilegeA privilege that controls access to a specific object.The following examples are object privileges that can be granted to users:##SELECT ON hr.employees TO myuser##INSERT ON hr.employees TO myuser
RoleA group of privileges or other rolesThe following examples are Oracle-defined roles:##CONNECT is a role that Enterprise Manager automatically grants to a user when you create a user as shown in “Creating Users”. This role has the CREATE SESSION privilege.##RESOURCE extends the privileges of a user beyond those granted by the CONNECT role. It includes CREATE PROCEDURE, CREATE TRIGGER, and other system privileges.##DBA is the standard role that can be granted by an administrator to another administrator. It includes all system privileges and should only be granted to the most trusted and qualified of users. Assigning this role to a user enables the user to administer the database.You can create your own roles if you have been granted this privilege.

关于管理账号

Oracle数据库安装时以下管理账号自动创建。
- sys
- system

sys

当你创建Oracle数据库时,sys账号自动创建,并被赋予DBA角色。
数据库数据目录的所有表和视图存储在SYS模式中。这些表和视图对于Oracle数据库操作至关重要。为了维护数据目录的完整性,sys模式中的表只能由数据库更改,不能由任何用户或者数据库管理人员修改。尽管在必要的时候你可以修改数据目录设置的存储参数,你也不应该在sys用户的模式中创建任何表。
要保证大多数用户无法使用sys账号连接Oracle数据库。

system

当你创建Oracle数据库时,sys账号自动创建,并被赋予DBA角色。
system账号可以创建额外的表和试图来呈现管理信息,也可以创建很多Oracle数据库选项和工具使用的内部表和试图。
在每个Oracle数据库安装时,预先定义的DBA角色自动创建。DBA角色包含大多数数据库系统权限。DBA角色不包含SYSDBA和SYSOPER系统权限。

管理权限
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值