软讯网络 > 冲浪宝典 > 网络资源 > 日记 [2006年05月25日]数据备份中的常见命令
【标 题】:日记 [2006年05月25日]数据备份中的常见命令
【关键字】:
2006,05,25
【来 源】:http://www.cublog.cn/u/19562/showart.php?id=117888
日记 [2006年05月25日]数据备份中的常见命令
exp
#用user_name1导出属于user_name2的表,user_name1需要DBA
exp user_name1/user_psw@Db_name owner=user_name2 rows=y indexes=n compress=n buffer=65536 feedback=100000 volsize=0 file=dmpfile_name.dmp
log=dmpfile_name.log
#用user_name导出table_name的表
exp user_name1/user_psw@Db_name tables=table_name rows=y indexes=n compress=y buffer=65536 feedback=100000 volsize=0 file=./dmpfile_name.dmp log=./dmpfile_name.log
imp
#用user_name导入expdat.dmp的数据
imp user_name/user_psw@Db_name file=./dmpfile_name.dmp buffer=65536 fromuser outuser_name touser inuser_name
* dmpfile_name.dmp 如果用ftp传输 需要用bin,否则无法正常imp
* 默认情况会导入inuser_name的default tablespace ,so first u must be do this:
alter user inuser_name default
tablespace [default tablespace];
如果您不知道该用户的默认表空间,可以用
select default_tablespace from dba_users where username=upper('label'); (需要DBA)
美丽的分割线3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#3#
use pipe
% mknod /tmp/imp_pipe p # Make the pipe
% cd /fs_with_25gig_freespace
% cat xaa xab xac > /tmp/imp_pipe & # Put files into the pipe
% imp user/passwd file=/tmp/imp_pipe # And import
% mknod /tmp/exp_pipe p # Make the pipe
% cd /fs_with_25gig_freespace # Make sure disk has space
% split -b2047m < /tmp/exp_pipe & # Split input to 2Gb chunks
% exp user/passwd file=/tmp/exp_pipe full=y # Export to the pipe
pipe is great1!1!1!