[size=large][color=brown]--1.创建表空间
CREATE SMALLFILE
TABLESPACE "SAASZHONGYOU"
LOGGING
DATAFILE 'E:\ORADATA\ORCL\SAASZHONGYOU.ora' SIZE 1500M
AUTOEXTEND
ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO
--2.创建用户
CREATE USER "SAASZHONGYOU" PROFILE "DEFAULT"
IDENTIFIED BY "saaszhongyou" DEFAULT TABLESPACE "SAASZHONGYOU"
TEMPORARY TABLESPACE "TEMP"
ACCOUNT UNLOCK;
GRANT UNLIMITED TABLESPACE TO "SAASZHONGYOU";
GRANT "CONNECT" TO "SAASZHONGYOU";
GRANT "DBA" TO "SAASZHONGYOU";
GRANT "RESOURCE" TO "SAASZHONGYOU";
--3.当数据备份涉及分区表时,必须临时将目标表空间名称修改为和数据备份的表空间名称相同,以便导入分区表。
ALTER TABLESPACE SAASZHONGYOU RENAME TO SAAS;
--4.导入数据
imp saaszhongyou/saaszhongyou@orcl file=F:\databackup\SAAS_zhongyou\saas.dmp ignore=y fromuser=saas touser=saaszhongyou log=F:\databackup\SAAS_zhongyou\saas_zhongyou20100301_imp.log buffer=128000 statistics=none commit=y
--5.如果执行了第3步骤,则需要将表空间名称改为第1步的名称
修改表空间名称
alter tablespace saas rename to saaszhongyou;
--6.数据导出命令
exp username/password@orcl owner=username file=F:\filename.dmp log=F:\logfilename.log
[/color][/size]
CREATE SMALLFILE
TABLESPACE "SAASZHONGYOU"
LOGGING
DATAFILE 'E:\ORADATA\ORCL\SAASZHONGYOU.ora' SIZE 1500M
AUTOEXTEND
ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO
--2.创建用户
CREATE USER "SAASZHONGYOU" PROFILE "DEFAULT"
IDENTIFIED BY "saaszhongyou" DEFAULT TABLESPACE "SAASZHONGYOU"
TEMPORARY TABLESPACE "TEMP"
ACCOUNT UNLOCK;
GRANT UNLIMITED TABLESPACE TO "SAASZHONGYOU";
GRANT "CONNECT" TO "SAASZHONGYOU";
GRANT "DBA" TO "SAASZHONGYOU";
GRANT "RESOURCE" TO "SAASZHONGYOU";
--3.当数据备份涉及分区表时,必须临时将目标表空间名称修改为和数据备份的表空间名称相同,以便导入分区表。
ALTER TABLESPACE SAASZHONGYOU RENAME TO SAAS;
--4.导入数据
imp saaszhongyou/saaszhongyou@orcl file=F:\databackup\SAAS_zhongyou\saas.dmp ignore=y fromuser=saas touser=saaszhongyou log=F:\databackup\SAAS_zhongyou\saas_zhongyou20100301_imp.log buffer=128000 statistics=none commit=y
--5.如果执行了第3步骤,则需要将表空间名称改为第1步的名称
修改表空间名称
alter tablespace saas rename to saaszhongyou;
--6.数据导出命令
exp username/password@orcl owner=username file=F:\filename.dmp log=F:\logfilename.log
[/color][/size]