Oracle 数据的导入和导出
数据导出:
?1 将数据库TEST完全导出,用户名system 密码manager 导出到D:\daochu.dmp中
?? exp system/manager@TEST file=d:\daochu.dmp full=y
?2 将数据库中system用户与sys用户的表导出
?? exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)
?3 将数据库中的表inner_notify、notify_staff_relat导出
??? exp aichannel/aichannel@TESTDB2 file= d:\datanewsmgnt.dmp tables=(inner_notify,notify_staff_relat)?
?4 将数据库中的表table1中的字段filed1以"00"打头的数据导出
?? exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=" where filed1 like '00%'"
?
? 上面是常用的导出,对于压缩,既用winzip把dmp文件可以很好的压缩。
? 也可以在上面命令后面 加上 compress=y 来实现。
数据的导入
?1 将D:\daochu.dmp 中的数据导入 TEST数据库中。
?? imp system/manager@TEST? file=d:\daochu.dmp
?? imp aichannel/aichannel@TEST? full=y? file=d:\datanewsmgnt.dmp ignore=y
?? 上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。
?? 在后面加上 ignore=y 就可以了。
?2 将d:daochu.dmp中的表table1 导入
?imp system/manager@TEST? file=d:\daochu.dmp? tables=(table1)
?
IMP:
template IAS Template to be usedsilent silent: display banner information, default is Nmetrics metrics: display performance information, default is Nuserid user/password to connect to oracle: no defaultrecordlength record length of file: optional, default is system dependentbuffer array fetch buffer size: default is EXUAFCH (4096)file export file names: format is (file1, file2...) default is EXPDAT.DMPfull export entire database: default is Ngrants export grants option: default is Yrows export rows option: default is Ycompress compact extents option: default is Ytrace trace option: enable sql_trace and timed_stat, default is Nresumable enable resumable session : default is Nresumable_timeout resumable_timeout: wait time for resumableresumable_name resumable string: SQL statements to be resumableowner users to export: format is '(user1, user2, .., userN)'tables tables to export: format is '(table1, table2, ..., tableN)'parfile parameter file: name of file that contains parameter specificationsindexes export indexes option: default is Yinctype incremental export option: (incremental, cumulative or complete)record option to record incremental/cumulative export: default is Yconstraints export table constraints option: default is Yconsistent provide read-consistency for the entire export: default is Nhelp help: display descriptions on export parameters, default is Nlog log export messages to specified filestatistics analyze option: (estimate, cumulative, none)feedback feedback in rows default is EXUFDBdirect direct path option: default is Npoint_in_time_recover point-in-time recover option: default is Ntts_full_check TTS perform strict test for objects in recovery set: default is Ntablespaces tablespaces to transport or recover: format is '(ts1, ts2, ..., tsN)'query query used to select a subset of rows for a tablefilesize file size: the size of export dump filestransport_tablespace transportable tablespace option: default is Ntriggers export triggers option: default is Yimpparfile file to create as paramfile for IMP for transportable tablespacesfile_format format of export file namesflashback_time database time to be used for flashback export: no defaultflashback_scn system change number to be used for flashback export: no defaultobject_consistent Provides consistency for registered objects during execution of procedureal callback: default is NExport: Release 11.2.0.1.0 - Production on 星期一 9月 17 19:17:01 2012Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.?