如何管理数据库权限与角色-创新互联
下面一起来了解下如何管理数据库权限与角色,相信大家看完肯定会受益匪浅,文字在精不在多,希望如何管理数据库权限与角色这篇短内容是你想要的。
我们提供的服务有:网站制作、成都网站建设、微信公众号开发、网站优化、网站认证、兴山ssl等。为数千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的兴山网站制作公司授予用户的系统权限 SQL> grant create table,create sequence,create view to tpcc; Grant succeeded. 查询授予用户的系统权限 SQL> col grantee for a20 SQL> col privilege for a30 SQL> col admin_option for a15 SQL> select * from dba_sys_privs where grantee ='TPCC'; GRANTEE PRIVILEGE ADMIN_OPTION --------------- ------------------------------ --------------- TPCC CREATE TABLE NO TPCC UNLIMITED TABLESPACE NO TPCC CREATE VIEW NO TPCC ALTER SESSION NO TPCC CREATE SEQUENCE NO 撤销授予用户的系统权限 SQL> revoke create sequence from tpcc; Revoke succeeded. SQL> select * from dba_sys_privs where grantee ='TPCC'; GRANTEE PRIVILEGE ADMIN_OPTION --------------- ------------------------------ --------------- TPCC CREATE TABLE NO TPCC UNLIMITED TABLESPACE NO TPCC CREATE VIEW NO TPCC ALTER SESSION NO 授予用户的对象权限 SQL> grant select on scott.emp to tpcc; Grant succeeded. 查询授予用户的对象权限 SQL> col owner for a20 SQL> col table_name for a20 SQL> col grantee for a15 SQL> col grantor for a15 SQL> col privilege for a30 SQL> select grantee,owner,table_name,grantor,privilege from dba_tab_privs where grantee = 'TPCC'; GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE --------------- -------------------- -------------------- --------------- ------------------------------ TPCC SYS DBMS_LOCK SYS EXECUTE TPCC SCOTT EMP SCOTT SELECT 撤销授予用户的对象权限 SQL> revoke select on scott.emp from tpcc; Revoke succeeded. SQL> select grantee,owner,table_name,grantor,privilege from dba_tab_privs where grantee = 'TPCC'; GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE --------------- -------------------- -------------------- --------------- ------------------------------ TPCC SYS DBMS_LOCK SYS EXECUTE 查询数据库的角色 SQL> col role for a30 SQL> select * from dba_roles; ROLE PASSWORD_REQUIRED AUTHENTICATION_TYPE ------------------------------ ------------------------ --------------------------------- CONNECT NO NONE RESOURCE NO NONE DBA NO NONE SELECT_CATALOG_ROLE NO NONE EXECUTE_CATALOG_ROLE NO NONE DELETE_CATALOG_ROLE NO NONE EXP_FULL_DATABASE NO NONE IMP_FULL_DATABASE NO NONE LOGSTDBY_ADMINISTRATOR NO NONE DBFS_ROLE NO NONE AQ_ADMINISTRATOR_ROLE NO NONE 查询授予角色的权限 SQL> select * from role_sys_privs where role in ('CONNECT','RESOURCE'); ROLE PRIVILEGE ADMIN_OPTION ------------------------------ ------------------------------ --------------- RESOURCE CREATE SEQUENCE NO RESOURCE CREATE TRIGGER NO RESOURCE CREATE CLUSTER NO RESOURCE CREATE PROCEDURE NO RESOURCE CREATE TYPE NO CONNECT CREATE SESSION NO RESOURCE CREATE OPERATOR NO RESOURCE CREATE TABLE NO RESOURCE CREATE INDEXTYPE NO 查询授予用户的角色 SQL> col admin_option for a15 SQL> col default_role for a15 SQL> col granted_role for a30 SQL> select * from dba_role_privs where grantee = 'TPCC'; GRANTEE GRANTED_ROLE ADMIN_OPTION DEFAULT_ROLE --------------- ------------------------------ --------------- --------------- TPCC RESOURCE NO YES TPCC CONNECT NO YES 查询用户获得的权限 SQL> conn tpcc/tpcc Connected. SQL> select * from session_privs; PRIVILEGE ------------------------------ CREATE SESSION ALTER SESSION UNLIMITED TABLESPACE CREATE TABLE CREATE CLUSTER CREATE VIEW CREATE SEQUENCE CREATE PROCEDURE CREATE TRIGGER CREATE TYPE CREATE OPERATOR PRIVILEGE ------------------------------ CREATE INDEXTYPE看完如何管理数据库权限与角色这篇文章后,很多读者朋友肯定会想要了解更多的相关内容,如需获取更多的行业信息,可以关注我们的行业资讯栏目。
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
本文标题:如何管理数据库权限与角色-创新互联
本文来源:http://scjbc.cn/article/diceco.html