创建表空间文件

--1 创建表空间文件
--1.1 创建ASIT 实体表空间

CREATE SMALLFILE TABLESPACE "ASIT_DATA_TBS"
DATAFILE 'D:\ORACLE\ORA_DATA\ASIT_DATA_TBS_001' SIZE 1000M AUTOEXTEND ON NEXT 10M MAXSIZE 2000M
LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;

--以上修改说明 'D:\ORACLE\ORA_DATA\ASIT_DATA_TBS_001'为你的表空间存储路径及表空间文件名(如果路径不存在必须先创建路径,否则会报错的),其中表空间文件名为"ASIT_DATA_TBS_001";
-- SIZE 1000M 为创建表空间大小 1000M 
---NEXT 10M 为自己扩展大小  
--MAXSIZE 10000M 充许自己扩展大小

--1.2 创建ASIT 临时表空间
CREATE SMALLFILE TEMPORARY TABLESPACE "ASIT_TEMP"
TEMPFILE 'D:\ORACLE\ORA_DATA\ASIT_TEMP_001' SIZE 500M AUTOEXTEND ON NEXT 100M MAXSIZE 2000M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M ;

--1.3 创建 DATACENTER 实体表空间
CREATE SMALLFILE TABLESPACE "DATACENTER"
DATAFILE 'D:\ORACLE\ORA_DATA\DATACENTER_001' SIZE 2000M AUTOEXTEND ON NEXT 10M MAXSIZE 5000M
LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;

--1.4 创建 DATACENTER_TEMP 临时表空间
CREATE SMALLFILE TEMPORARY TABLESPACE "DATACENTER_TEMP"
TEMPFILE 'D:\ORACLE\ORA_DATA\DATACENTER_TEMP_001' SIZE 500M AUTOEXTEND ON NEXT 100M MAXSIZE 2000M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M ;

--1.3 创建 SOURCEDATA 实体表空间
CREATE SMALLFILE TABLESPACE "SOURCEDATA"
DATAFILE 'D:\ORACLE\ORA_DATA\SOURCEDATA_001' SIZE 500M AUTOEXTEND ON NEXT 10M MAXSIZE 2000M
LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;

--1.4 创建 SOURCEDATA 临时表空间
CREATE SMALLFILE TEMPORARY TABLESPACE "SIS_TEMP"
TEMPFILE 'D:\ORACLE\ORA_DATA\SIS_TEMP_001' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 1000M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M ;



--2 创建用户信息
--2.1 Create the user
create user ASIT
  identified by "ASIT"
  default tablespace ASIT_DATA_TBS
  temporary tablespace ASIT_TEMP
  profile DEFAULT;
-- Grant/Revoke role privileges
grant connect to ASIT;
grant dba to ASIT;
-- Grant/Revoke system privileges
grant create any table to ASIT;
grant create any view to ASIT;
grant delete any table to ASIT;
grant execute any procedure to ASIT;
grant insert any table to ASIT;
grant select any sequence to ASIT;
grant select any table to ASIT;
grant unlimited tablespace to ASIT;
grant update any table to ASIT;

--2.2 Create the user
create user DATACENTER
  identified by "DATACENTER"
  default tablespace DATACENTER
  temporary tablespace DATACENTER_TEMP
  profile DEFAULT;
-- Grant/Revoke object privileges
grant select, insert, update, delete, references, alter, index on ASIT.ASIT_TARGET_COMPARE_RESULT to DATACENTER;
-- Grant/Revoke role privileges
grant connect to DATACENTER;
grant dba to DATACENTER;
grant resource to DATACENTER;
-- Grant/Revoke system privileges
grant import full database to DATACENTER with admin option;
grant unlimited tablespace to DATACENTER;


--2.3 Create the user
create user SOURCEDATA
  identified by "SOURCEDATA"
  default tablespace SOURCEDATA
  temporary tablespace SIS_TEMP
  profile DEFAULT;
-- Grant/Revoke role privileges
grant connect to SOURCEDATA;
grant dba to SOURCEDATA;
-- Grant/Revoke system privileges
grant unlimited tablespace to SOURCEDATA;


3、进行导数据
--导入数据
imp DATACENTER/DATACENTER@ASIT file=E:\ASIT_DATA\DATACENTER_0608.dmp  log=E:\ASIT_DATA\DATACENTER_0608_IMP.log  fromuser=datacenter_fs touser=datacenter ignore=y


imp ASIT/ASIT@ASIT file=E:\ASIT_DATA\ASIT_0608.dmp  log=E:\ASIT_DATA\ASIT_0608_IMP.log  fromuser=ASIT_FS touser=ASIT ignore=y


请手工导入Z004SOURCEDATA.sql文件


--导完成数据后需要修改如下表信息
-- ASIT用户下 M_RS_DATASOURCE

数据库创建完成后,请直接部署tomcat6 就可以了。
关于程序配置怎么修改请参考相关文档。

你可能感兴趣的:(导入数据,表空间,tablespace,imp)