当前位置: 代码迷 >> SQL >> SQL脚本创建表空间、用户、密码及受权
  详细解决方案

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

热度:68   发布时间:2016-05-05 11:53:35.0
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;

  相关解决方案