expdp tjxtcgs/IP69#tj100ora@ora69 dumpfile='SCHEMAS_TJXTCGS_FILE%date:~,4%-%date:~5,2%-%date:~8,2%.dmp' logfile='PM_NOFILE%date:~,4%-%date:~5,2%-%date:~8,2%.log' SCHEMAS=TJXTCGS
exp tjXXXXs/0000 file=E:oracleoradataorcldtj_2010_2005_dm001.dmp tables=dtj_2005_dm001,dtj_2006_dm001,dtj_2007_dm001,dtj_2008_dm001,dtj_2009_dm001,dtj_20010_dm001
xxxxxxxxxx
1
1
exp tjXXXXs/0000 file=E:oracleoradataorcldtj_2010_2005_dm001.dmp tables=dtj_2005_dm001,dtj_2006_dm001,dtj_2007_dm001,dtj_2008_dm001,dtj_2009_dm001,dtj_20010_dm001
(1)表方式,将指定表的数据导出/导入。
导出:
导出一张或几张表:
代码
exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2
exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2
xxxxxxxxxx
3
1
exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2
2
3
exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2
如果是分区表
代码
exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1:tablespaces1,table2:tablespaces2
exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1:tablespaces1,table2:tablespaces2
xxxxxxxxxx
3
1
exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1:tablespaces1,table2:tablespaces2
2
3
exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1:tablespaces1,table2:tablespaces2
导出某张表的部分数据
代码
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1 query=”where col1=’…’
and col2 <…”
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1 query=”where col1=’…’
and col2 <…”
xxxxxxxxxx
5
1
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1 query=”where col1=’…’
2
and col2 <…”
3
4
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1 query=”where col1=’…’
5
and col2 <…”
导入:
导入一张或几张表
代码
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
xxxxxxxxxx
3
1
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
2
3
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1,table2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
如果是分区表
代码
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1:tablespaces1,table2:tablespaces2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1:tablespaces1,table2:tablespaces2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
xxxxxxxxxx
3
1
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1:tablespaces1,table2:tablespaces2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
2
3
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log tables=table1:tablespaces1,table2:tablespaces2 fromuser=dbuser touser=dbuser2 commit=y ignore=y
(2)用户方式,将指定用户的所有对象及数据导出/导入。
导出:
代码
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=(xx, yy)
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=(xx, yy)
xxxxxxxxxx
3
1
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=(xx, yy)
2
3
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=(xx, yy)
只导出数据对象,不导出数据 (rows=n )
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=user rows=n
xxxxxxxxxx
1
1
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=user rows=n
代码
imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
xxxxxxxxxx
3
1
imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
2
3
imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
(3)全库方式,将数据库中的所有对象导出/导入导出:
代码
exp user/pwd file=/dir/xxx.dmp log=xxx.log full=ycommit=y ignore=y
exp user/pwd file=/dir/xxx.dmp log=xxx.log full=ycommit=y ignore=y
x
1
exp user/pwd file=/dir/xxx.dmp log=xxx.log full=ycommit=y ignore=y
2
3
exp user/pwd file=/dir/xxx.dmp log=xxx.log full=ycommit=y ignore=y
导入:
代码
imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
1
imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2