Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Common statements of Oracle permission [transfer]

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Http://www.cnblogs.com/ningvsban/p/3606239.html body {font-family:-apple-system, BlinkMacSystemFont, 'Segoe WPC',' Segoe UI', 'HelveticaNeue-Light',' Ubuntu', 'Droid Sans', sans-serif; font-size: 14px; line-height: 1.6 } Oracle user rights commonly used statements commonly used System Privilegescreate session connection database create table table building create view view building synonyms create procedure building procedures, functions, package create trigger building triggers create cluster clustering examples

Create a user and grant the user authorization rights.

Create user ken identified by ken

Granted permissions with admin option

Grant create session, create table to ken with admin option

Grant permissions without with admin option

Grant create view to ken

Create a new tom user

Create user tom identified by tom

Authorization to tom after logging in with ken user, the statement was executed successfully

Grant create session, create table to tom; Grant succeeded. For tom authorization, statement execution failed grant create view to tom; grant create view to tom * ERROR at line 1: ORA-01031: insufficient privileges

Reclaim permission

Note note that recycling permissions are not cascading.

Reclaim login permissions from ken

Revoke create session from ken

At this point, tom can still log in, but Ken cannot log in

ERROR: ORA-01045: user KEN lacks CREATE SESSION privilege; logon denied

Commonly used Object Privilegealterdeleteselectinsertupdateindexreferencesexecute to view Object Privilege in the system

Select distinct privilege from dba_tab_privs

View the Object Privilege that a user has

Select grantor, owner, table_name, privilege from dba_tab_privs where grantee = 'TOM'

The grantor can be the owner of the object or a sys and system user.

Grant select on t to tom

Grant all permissions

Grant all on emp to monkey

Grant column permissions

Grant update on emp (sal) to monkey

Grant execute permission for a package

Grant execute on dbms_transaction to ken

To build an index in another schema, you must have the following permissions

Grant index on scott.emp to blake

Reclaim object permissions

Revoke select on emp from blake

Note Recycling Object Privilege results in cascaded recycling.

Role

The role Role, which defines a set of permissions.

Query the permissions that the role has

Select * from role_sys_privs where role=' role name'

Select * from role_sys_privs where role='CONNECT'

Select * from role_sys_privs where role='RESOURCE'

DBA role

The dba role has all system permissions, as well as with admin option options, and the default dba users are sys and system, which can grant any system permissions to other users. However, it should be noted that the dba role does not have the privileges of sysdba and sysoper (starting and shutting down the database)

Note generally speaking, after the user is created, it is enough to give the connect role and resource.

Custom role creation role (not validated)

Create role role name not identified

Establish roles (database validation)

Create role role name identified by password

Role authorization

Grant create session to role name with admin option grant select on scott.emp to role name; grant insert, update, delete on scott.emp to role name

Assign a role

Grant role name to blake with admin option

Select * from dba_roles

Select privilege, admin_option from role_sys_privs where role=' role name'

Select granted_role, default_role from dba_role_privs where grantee = 'user name'

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report