-- 创建新用户
CREATE USER c##newuser IDENTIFIED BY password;
-- 授予连接数据库和创建会话的权限
GRANT CREATE SESSION TO c##newuser;
-- 授予创建表和序列的权限
GRANT CREATE TABLE, CREATE SEQUENCE TO c##newuser;
-- 授予创建视图的权限
GRANT CREATE VIEW TO c##newuser;
-- 授予创建存储过程和函数的权限
GRANT CREATE PROCEDURE, CREATE FUNCTION TO c##newuser;
-- 授予创建触发器的权限
GRANT CREATE TRIGGER TO c##newuser;
-- 授予管理表和序列的权限
GRANT ALTER ANY TABLE, ALTER ANY SEQUENCE TO c##newuser;
-- 授予管理视图的权限
GRANT DROP ANY VIEW, COMMENT ANY VIEW TO c##newuser;
-- 授予管理存储过程和函数的权限
GRANT DROP ANY PROCEDURE, DROP ANY FUNCTION, COMMENT ANY PROCEDURE, COMMENT ANY FUNCTION TO c##newuser;
-- 授予管理触发器的权限
GRANT DROP ANY TRIGGER, COMMENT ANY TRIGGER TO c##newuser;
-- 授予查询所有表的权限
GRANT SELECT ANY TABLE TO c##newuser;
-- 授予查询系统视图的权限
GRANT SELECT ANY DICTIONARY TO c##newuser;
-- 授予插入、更新和删除表中数据的权限
GRANT INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE TO c##newuser;
-- 授予使用DBMS_OUTPUT输出的权限
GRANT EXECUTE ON DBMS_OUTPUT TO c##newuser;
-- 授予创建序列的权限
GRANT CREATE ANY SEQUENCE TO c##newuser;
-- 授予创建用户和角色的权限
GRANT CREATE USER, CREATE ROLE TO c##newuser;
-- 授予管理用户和角色的权限
GRANT ALTER USER, ALTER ROLE, DROP USER, DROP ROLE TO c##newuser;
-- 授予管理角色权限的权限
GRANT MANAGE ANY ROLE TO c##newuser;
-- 授予管理系统权限的权限
GRANT MANAGE ANY PRIVILEGE TO c##newuser;
-- 授予创建表空间的权限
GRANT CREATE TABLESPACE TO c##newuser;
-- 授予管理表空间的权限
GRANT ALTER TABLESPACE, MANAGE TABLESPACE TO c##newuser;
-- 授予创建临时表的权限
GRANT CREATE TEMPORARY TABLES TO c##newuser;
-- 授予创建视图的权限
GRANT CREATE VIEW TO c##newuser;
-- 授予管理视图的权限
GRANT DROP VIEW TO c##newuser;
-- 授予创建程序包和程序的权限
GRANT CREATE ANY PROCEDURE, CREATE ANY PACKAGE TO c##newuser;
-- 授予管理程序包和程序的权限
GRANT DROP ANY PROCEDURE, ALTER ANY PROCEDURE, EXECUTE ANY PROCEDURE,
DROP ANY PACKAGE, ALTER ANY PACKAGE, EXECUTE ANY PACKAGE TO c##newuser;
-- 授予创建索引的权限
GRANT CREATE ANY INDEX TO c##newuser;
-- 授予管理索引的权限
GRANT ALTER ANY INDEX, DROP ANY INDEX TO c##newuser;
-- 授予创建对象权限
GRANT CREATE SYNONYM, CREATE DATABASE LINK, CREATE PUBLIC SYNON
评论已关闭