oracle
1.数据泵
sqlplus / as sysdba
create or replace directory my_dump_aps as '/usr/oracle/dump_bak'
grant read,write on directory my_dump_aps to oracle用户;
grant exp_full_datebase,imp_full_database to oracle用户;
exit;
expdp 用户名/密码 directory=my_dump_aps dumpfile=aps.dmp schema=用户名 logfile=aps.log
create temporary tablespace aps_data_temp
tempfile 'uo1/app/oracle/oradata/ORCL/aps_data_temp.dbf'
size 512m
autoextend on
next 64m maxsize unlimited
extent management local;
create tablespace aps_data
datafile 'uo1/app/oracle/oradata/ORCL/aps_data.dbf'
size 512m
autoextend on
next 64m maxsize unlimited
extent management local;
create user aps identified by aps
default tablespace aps_data
temporary tablespace aps_data_temp;
grant connect,resource to aps;
grant read,write on directory my_dump_aps to aps;
impdp aps/aps directory=my_dump_aps dumpfile=aps.dmp logfile=aps.log remap_schema=aps:aps
remap_tablespace=users:aps_data
alter user 用户名 temporary tablespace 表空间;
alter user 用户名 default tablespace 表空间;
drop tablespace APS_DATA_TEMP including CONTENTS and datafiles;
2.非数据泵 exp/imp
1.完全导出
exp sys/sys@orcl file=/home/lcm/dump/test.dmp log=/home/lcm/dump/test.log full=y buffer=64000
2.用户模式
exp sys/sys@orcl file=/home/lcm/dump/test.dmp log=/home/lcm/dump/test.log owner=sys buffer=64000
3.表模式
exp sys/sys@orcl file=/home/lcm/dump/test.dmp log=/home/lcm/dump/test.log owner=sys tables=(test) buffer=64000
1.完全导入
imp sys/sys@orcl file=/home/lcm/dump/test.dmp log=/home/lcm/dump/test.log full=y ignore=y buffer=64000
2.用户模式
imp sys/sys@orcl file=/home/lcm/dump/test.dmp log=/home/lcm/dump/test.log fromuser=sys touser=sys buffer=64000
3.表模式
imp sys/sys@orcl file=/home/lcm/dump/test.dmp log=/home/lcm/dump/test.log fromuser=sys tables=(test) buffer=64000