SQL脚本创建表空间、用户、密码及授权

sqlplus / as sysdba
-------------------------------

--建立永久表空间和临时表空间
CREATE TABLESPACE TBS_表空间
    DATAFILE 'pda' SIZE 1000M AUTOEXTEND ON NEXT 102400K MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE
    LOGGING
    ONLINE
    SEGMENT SPACE MANAGEMENT AUTO;


-- 新建一个用户
create user 用户名
  identified by 密码
  default tablespace TBS_表空间
  temporary tablespace temp
  profile DEFAULT;
commit;
-- 授角色权限
grant connect to 用户名 with admin option;
grant exp_full_database to 用户名 with admin option;
grant imp_full_database to 用户名 with admin option;
grant resource to 用户名 with admin option;
grant select_catalog_role to 用户名 with admin option;
-- 授系统权限
grant select any dictionary to 用户名 with admin option;
grant unlimited tablespace to 用户名 with admin option;
commit;

猜你喜欢

转载自shang.iteye.com/blog/1986816