你的位置:首页 > 数据库

[数据库]oracle创建表空间、用户及授权的sql脚本


CREATE TABLESPACE 表空间 DATAFILE
'D:\oracle11g\oradata\pana\物理文件' SIZE 1M AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT MANUAL;

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

CREATE USER 用户
IDENTIFIED BY VALUES '35CC57B23E8092CD'
DEFAULT TABLESPACE 表空间
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;

-----------------------------------------------------------------------
-- 3 Roles for PJHIS 授权
GRANT CONNECT TO 用户 WITH ADMIN OPTION;
GRANT DBA TO 用户 WITH ADMIN OPTION;
GRANT RESOURCE TO 用户 WITH ADMIN OPTION;
ALTER USER 用户 DEFAULT ROLE ALL;
-- 5 System Privileges for PJHIS
GRANT CREATE SESSION TO 用户 WITH ADMIN OPTION;
GRANT CREATE VIEW TO 用户 WITH ADMIN OPTION;
GRANT DELETE ANY TABLE TO 用户 WITH ADMIN OPTION;
GRANT EXECUTE ANY PROCEDURE TO 用户 WITH ADMIN OPTION;
GRANT INSERT ANY TABLE TO 用户 WITH ADMIN OPTION;
GRANT SELECT ANY SEQUENCE TO 用户 ;
GRANT SELECT ANY TABLE TO 用户 WITH ADMIN OPTION;
GRANT UNLIMITED TABLESPACE TO 用户 WITH ADMIN OPTION;
GRANT UPDATE ANY TABLE TO 用户 WITH ADMIN OPTION;
-- 2 Tablespace Quotas for PJHIS
ALTER USER 用户 QUOTA UNLIMITED ON 用户 ;
ALTER USER 用户 QUOTA UNLIMITED ON 用户 ;