数据库部署——表空间和用户的创建

1 表空间的创建

--用户默认表空间
CREATE TABLESPACE JGCRM LOGGING DATAFILE '/opt/oracle/oradata/crmii/jgcrm/JGCRM.ORA' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED PERMANENT EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

--用户默认临时表空间,最大扩展10G
CREATE TEMPORARY  TABLESPACE JGCRM_TMP TEMPFILE   '/opt/oracle/oradata/crmii/jgcrm/JGCRM_TMP.ORA'  SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 10240M EXTENT MANAGEMENT LOCAL;

2 表空间的删除

DROP TABLESPACE JGCRM;

3 用户的创建

drop user JGCRM cascade  --删除用户
create user JGCRM  --创建用户
  identified by abs   --设置密码
  default tablespace JGCRM  --指定表空间
  temporary tablespace JGCRM_TMP  --指定临时表空间
  profile DEFAULT
  quota unlimited on JGCRM
  quota 5m on system;
grant select on DBA_OBJECTS to JGCRM;
grant execute on DBMS_OUTPUT to JGCRM;
grant execute on DBMS_STATS to JGCRM;
grant select on OBJ$ to JGCRM;
grant select on SCHEDULER$_JOB to JGCRM;
grant select on V_$DB_OBJECT_CACHE to JGCRM;
grant select on V_$SESSION to JGCRM;
grant select on V_$SESSTAT to JGCRM;
grant select on V_$STATNAME to JGCRM;
grant connect to JGCRM;
grant alter any procedure to JGCRM;
grant alter any sequence to JGCRM;
grant alter any table to JGCRM;
grant analyze any to JGCRM;
grant comment any table to JGCRM;
grant create any job to JGCRM;
grant create any procedure to JGCRM;
grant create any sequence to JGCRM;
grant create synonym to JGCRM;
grant create table to JGCRM;
grant create view to JGCRM;
grant debug any procedure to JGCRM;
grant debug connect session to JGCRM;
grant delete any table to JGCRM;
grant drop any procedure to JGCRM;
grant drop any sequence to JGCRM;
grant drop any table to ECIF;
grant execute any procedure to JGCRM;
grant insert any table to JGCRM;
grant select any sequence to JGCRM;
grant select any table to JGCRM;
grant unlimited tablespace to JGCRM;
grant update any table to JGCRM;

 

你可能感兴趣的:(工作,学习)