ITeye博客

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

shang · 2013-12-08 16:38 · Oracle · 数据库 · Markdown

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;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。