Wu Yuxiong - natural born ORACLE database study notes: data export and import

create directory dump_dir as 'd:\dump';
grant read,write on directory dump_dir to scott;
--在cmd下
expdp scott/1qaz2wsx directory=dump_dir dumpfile=tab.dmp tables=emp,dept
expdp system/1qaz2wsx directory = dump_dir dumpfile=schema.dmp schemas = scott,hr
expdp system/1qaz2wsx directory = dump_dir dumpfile = tablespace.dmp tablespaces = tbsp_1
expdp system/1qaz2wsx directory=dump_dir dumpfile=fulldatabase.dmp full=y
expdp scott/1qaz2wsx directory=dump_dir dumpfile=content.dmp content=data_only
expdp scott/1qaz2wsx directory=dump_dir dumpfile=query.dmp tables=dept query='where deptno=10'
impdp system/1qaz2wsx directory=dump_dir dumpfile=tab.dmp tables=scott.dept,scott.emp remap_schema=scott:system
impdp system/1qaz2wsx directory=dump_dir dumpfile=schema.dmp schemas=scott remap_schema=scott:system;
impdp system/1qaz2wsx directory=dump_dir dumpfile=tablespace.dmp tablespaces=tbsp_1
impdp system/1qaz2wsx directory=dump_dir dumpfile=fulldatabase.dmp full=y
impdp scott/1qaz2wsx directory=dump_dir dumpfile=sqlfile.dmp sqlfile=test.sql
impdp system/1qaz2wsx directory=dump dumpfile=tran_datafiles.dmp transport_datafiles='d:\OracleData\test.dbf'
- In sqlplus environment, 
 the Create  the Table Student
 (stuno number(4),
 stuname varchar2(20),
 sex varchar2(4),
 old number(4)
 );

- - cmd at ambient 
sqlldr System / 1qaz2wsx Control = D: \ Data \ student.ctl log = D: \ Data \ stu_log

1001 East 30 male and
1002 female happy 25
1003 JACK M 23
1004 ROSE Female 20

- In sqlplus environment, 
the Create  the Table persons
(code number(4),
name varchar2(20),
sex varchar2(4),
old number(4)
);

- at ambient cmd 
sqlldr System / 1qaz2wsx Control = D: \ Data \ persons.ctl

1005, east, female, 26
1006, West, male, 25
1007, Happy, male, 24-
1008, mary, female, 20

- Create a directory 
the Create Directory dump_dir AS  ' d: \ dump ' ;

- to authorize hr 
Grant  the Read , the Write ON Directory dump_dir to hr;



- In the table cmd deriving 
the expdp HR / HR Directory = dump_dir the dumpfile = tab.dmp Tables = the Employees
- introducing at cmd 
the impdp Scott / 1qaz2wsx Directory = dump_dir the dumpfile = tab.dmp Tables = the HR.EMPLOYEES remap_schema = HR: Scott

Guess you like

Origin www.cnblogs.com/tszr/p/12206906.html