oracle exp/imp 導(dǎo)入導(dǎo)出命令
(1)表方式,將指定表的數(shù)據(jù)導(dǎo)出/導(dǎo)入。
導(dǎo)出:
導(dǎo)出一張或幾張表:
代碼
$ 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
如果是分區(qū)表
代碼
$ 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
導(dǎo)出某張表的部分?jǐn)?shù)據(jù)
代碼
$ 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 \<…\”
導(dǎo)入:
導(dǎo)入一張或幾張表
代碼
$ 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
如果是分區(qū)表
代碼
$ 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
(2)用戶方式,將指定用戶的所有對象及數(shù)據(jù)導(dǎo)出/導(dǎo)入。
導(dǎo)出:
代碼
$ 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)
只導(dǎo)出數(shù)據(jù)對象,不導(dǎo)出數(shù)據(jù) (rows=n )
$ exp user/pwd file=/dir/xxx.dmp log=xxx.log owner=user rows=n
導(dǎo)入:
代碼
imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
mmit=y ignore=y
imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
commit=y ignore=y
(3)全庫方式,將數(shù)據(jù)庫中的所有對象導(dǎo)出/導(dǎo)入導(dǎo)出:
代碼
$ 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
導(dǎo)入:
代碼
$ imp user/pwd file=/dir/xxx.dmp log=xxx.log fromuser=dbuser touser=dbuser2
posted on 2010-07-14 16:51 魯勝迪 閱讀(53955) 評(píng)論(2) 編輯 收藏