Oracle表空间、用户建立SQL

来源:互联网 发布:时时彩组三预测软件 编辑:程序博客网 时间:2024/06/05 20:09
 
--建立名为ph_pro的profile,如果已存在不需要再次建立
create profile ph_pro limit
sessions_per_user unlimited
cpu_per_session unlimited
cpu_per_call    unlimited
connect_time    unlimited
idle_time       
60
logical_reads_per_session unlimited
logical_reads_per_call    unlimited
private_sga unlimited
composite_limit unlimited;
 
--建立表空间
CREATE tablespace publichealth_data DATAFILE 'E:oracle_table_spacepublichealthpublichealth_data.dbs' SIZE 100M
 
DEFAULT STORAGE(
  INITIAL 
409600
  
NEXT 51200 
  MINEXTENTS 
1 
  MAXEXTENTS unlimited
  PCTINCREASE 
1
 )
ONLINE;

--建立临时表空间
CREATE TEMPORARY TABLESPACE publichealth_data_tmp
TEMPFILE 
'E:oracle_table_spacepublichealthpublichealth_data_tmp.dbs' SIZE 50M EXTENT 
MANAGEMENT LOCAL UNIFORM SIZE 1M;
 
--建立用户
create user publichealth identified by publichealth default tablespace publichealth_data 
temporary  tablespace publichealth_data_tmp  
quota unlimited 
on publichealth_data 
quota 10M 
on system
profile ph_pro;

--修改用户角色
alter user publichealth default role all;
--为用户授权
grant connect,resource to publichealth;
原创粉丝点击