




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、oracle逻辑备份恢复 exp/imp篇1.数据导出工具expexp是客户端工具,该工具不仅可以在oracle客户端使用,还可以在oracle服务器端使用。当在oracle客户端使用exp工具时,必须带有连接字符串;当在oracle服务器端使用exp工具时,可以不带字符串。导出包括导出表、导出方案、导出数据库三种模式。(1)导出表导出表是指使用exp工具将一个或多个表的结构和数据存储到os文件中,导出表是使用tables选项来完成的。普通用户可以导出其自身方案的所有表,但如果要导出其他方案的表,则要求该用户必须具有exp_full_database角色或dba角色。另外当导出表时,默认情况下
2、会导出相应表上的所有索引、触发器、约束。下面以system用户导出scott.dept表为例,示例如下:exp system/oraclecharge table=scott.dept,scott.emp file=tab1.dmp(2)导出方案导出方案是指使用exp工具将一个或多个方案中的所有对象记数据存储到os文件中,导出表是使用owner选项来完成的。普通用户可以导出其自身方案,但如果要导出其他方案,则要求该用户必须具有dba角色或exp_full_database角色。当用户要导出其自身方案的所有对象时,可以不指定owner选项,下面以system用户导出scott方案的所有对象为例,
3、示例如下:exp system/oraclecharge owner=scott file=schemal.dmp以上为命令行方式进行数据的导出,exp工具还可以以交互的方式进行数据导出。(1)导出表(交互方式)oracleora-asm3 dbs$ expexport: release 10.2.0.1.0 - production on 星期一 6月 16 16:24:26 2008copyright (c) 1982, 2005,oracle. all rights reserved.username: charge 输入用户名password: 输入密码connected to:ora
4、cledatabase 10g enterprise edition release 10.2.0.1.0 - productionwith the partitioning, olap and data mining optionsenter array fetch buffer size: 4096 输入缓冲区大小,可以默认也可以自定义,如果数据文件较大,建议设置的大一些。export file: expdat.dmp charge01.dmp 输入导出的文件名,必须以”.dmp”文件做为扩展名。(2)u(sers), or (3)t(ables): (2)u t 输入导出类型,默认为用户
5、(也就是方案),在此输入t,为导出表export table data (yes/no): yes 是否导出表中的数据,如果选no,则导出表结构。compress extents (yes/no): yes 是否对数据压缩export done in zhs16gbk character set and al16utf16 nchar character setabout to export specified tables via conventional path .table(t) or partition(t:p) to be exported: (return to quit) cl
6、ients 输入表名开始导出clients表数据. . exporting table clients 10 rows exportedtable(t) or partition(t:p) to be exported: (return to quit) 如果没有要导出的数据时,按回车退出。export terminated successfully without warnings.提示导出成功,没有任何告警。(2)导出方案(交互方式)oracleora-asm3 dbs$ expexport: release 10.2.0.1.0 - production on 星期一 6月 16 16:
7、23:47 2008copyright (c) 1982, 2005, oracle. all rights reserved.username: charge 输入用户名password: 输入密码connected to: oracle database 10g enterprise edition release 10.2.0.1.0 - productionwith the partitioning, olap and data mining optionsenter array fetch buffer size: 4096 输入缓冲区大小,可以默认也可以自定义,如果数据文件较大,建
8、议设置的大一些。export file: expdat.dmp charge.dmp 输入导出的文件名,必须以”.dmp”做为扩展名。(2)u(sers), or (3)t(ables): (2)u u 输入导出类型,默认为用户(方案),可以直接回车,也可以输入u。export grants (yes/no): yes 导入权限export table data (yes/no): yes 是否导出表中的数据,如果选no,则导出表结构。compress extents (yes/no): yes 是否对数据压缩export done in zhs16gbk character set and
9、al16utf16 nchar character set. exporting pre-schema procedural objects and actions. exporting foreign function library names for user charge. exporting public type synonyms. exporting private type synonyms. exporting object type definitions for user chargeabout to export charges objects . exporting
10、database links. exporting sequence numbers. exporting cluster definitions. about to export charges tables via conventional path . . exporting table balance 0 rows exported. . exporting table balancefinished 0 rows exported. exporting synonyms. exporting views. exporting stored procedures. exporting
11、operators. exporting referential integrity constraints. exporting triggers. exporting indextypes. exporting bitmap, functional and extensible indexes. exporting posttables actions. exporting materialized views. exporting snapshot logs. exporting job queues. exporting refresh groups and children. exp
12、orting dimensions. exporting post-schema procedural objects and actions. exporting statisticsexport terminated successfully without warnings.提示导出成功,没有任何告警。2.数据导入工具imp(1)导入表导入表是指使用工具imp将exp文件中的表结构及其数据转载到数据库中,导入表是使用tables选项来完成的。普通用户可以直接导入其拥有的表,但如果要将表导入到其他用户中,则要求该用户必须具有imp_full_database角色或dba角色。注意,如果要将
13、表导入到其他用户中,则需要指定fromuser和touser选项,示例如下:impscott/oraclechargefile=tab2.dmp tables=dept.empimpsystem/oraclechargefile=tab2.dmp tables=dept.emp fromuser=scott touser=system如上所示,第一示例表示将文件tab2.dmp中dept和emp表的结构和数据导入到scott用户中;第二个示例表示文件tab2.dmp中scott用户的dept和emp表导入system用户中。(2)导入方案导入方案是指使用工具imp将exp文件中的特定方案的所有
14、对象及数据转载到数据库中。普通用户可以直接导入其自身方案,并且在导入时需要提供userid和file选项即可。但如果要将一个方案的所有对象导入到其他方案中,则要求该用户必须具有imp_full_database角色,并且必须提供fromuser和touser选项。示例如下:impscott/oraclechargefile=schema2.dmpimpsystem/oraclechargefile=schema2.dmp fromuser=scott touser=system如上所示,第一示例表示将文件schema 2.dmp中scott用户的所有对象及数据导入到scott用户中;第二个示例
15、表示文件schema 2.dmp中scott用户的所有对象及数据导入system用户中。以上为命令行方式进行数据的导出,exp工具还可以以交互的方式进行数据导出。(1)导入表(交互方式)oracleora-asm3 $ impimport: release 10.2.0.1.0 - production on 星期一 6月 16 16:40:10 2008copyright (c) 1982, 2005, oracle. all rights reserved.username: charge 输入用户名password: 输入密码connected to: oracle database 1
16、0g enterprise edition release 10.2.0.1.0 - productionwith the partitioning, olap and data mining optionsimport file: expdat.dmp charge.dmp 输入要导入的数据文件enter insert buffer size (minimum is 8192) 30720 输入缓冲区大小,可以默认也可以自定义,如果数据文件较大,建议设置的大一些。export file created by export:v10.02.01 via conventional pathimpo
17、rt done in zhs16gbk character set and al16utf16 nchar character setlist contents of import file only (yes/no): no 只列出导入文件的内容ignore create error due to object existence (yes/no): no 由于对象已存在, 忽略创建错误import grants (yes/no): yes 导入权限import table data (yes/no): yes 导入表数据,如果选no,则导入表结构import entire export f
18、ile (yes/no): no 导入整个导出文件username: charge 要导入方案的名称enter table(t) or partition(t:p) names. null list means all tables for userenter table(t) or partition(t:p) name or . if done: clients 输入要导入的表名enter table(t) or partition(t:p) name or . if done: 如果没有要导入的表时,直接回车,进行导入. importing charges objects into ch
19、arge. importing charges objects into charge. . importing table clients 10 rows importedimport terminated successfully without warnings.导入成功,没有告警。(2)导入方案(交互方式)oracleora-asm3 $ impimport: release 10.2.0.1.0 - production on 星期一 6月 16 17:17:54 2008copyright (c) 1982, 2005, oracle. all rights reserved.us
20、ername: charge 输入用户名称password: 输入密码connected to: oracle database 10g enterprise edition release 10.2.0.1.0 - productionwith the partitioning, olap and data mining optionsimport file: expdat.dmp charge.dmp 输入要导入的数据文件enter insert buffer size (minimum is 8192) 30720 输入缓冲区大小,可以默认也可以自定义,如果数据文件较大,建议设置的大一些。export file created by export:v10.02.01 via conventional pathimport done in zhs16gbk character se
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 单双缸活塞买卖合同
- 2025ff直播平台主播转公会合同
- 2025企业食堂食品原材料供货合同
- 租赁电子合同
- 2025年爆破工程试题及答案
- 2025年有限空间作业安全实操考试题库及答案
- 2025年有限空间作业安全风险管控措施模拟试题及答案
- 产品定量包装管理办法
- 规范贷款机构管理办法
- 礼宾部外卖管理办法
- 环境标志产品技术要求 房间空气调节器(HJ 2535-2013代替HJ-T304-2006)
- 矿山支护工安全培训课件
- 冠寓公寓运营管理手册
- 装配工基本技能培训
- 民谣酒馆项目融资计划书
- 新概念张云生讲解的笔记
- 焊工施工方案大全
- 大班数学《年妈妈的故事》课件
- 汕头市房地产租赁合同
- 药物制剂技术专业
- 小学生课堂常规课件
评论
0/150
提交评论