oracle逻辑备份恢复exp.imp篇.doc

上传人:文库蛋蛋多 文档编号:2394971 上传时间:2023-02-17 格式:DOC 页数:8 大小:28.50KB
返回 下载 相关 举报
oracle逻辑备份恢复exp.imp篇.doc_第1页
第1页 / 共8页
oracle逻辑备份恢复exp.imp篇.doc_第2页
第2页 / 共8页
oracle逻辑备份恢复exp.imp篇.doc_第3页
第3页 / 共8页
oracle逻辑备份恢复exp.imp篇.doc_第4页
第4页 / 共8页
oracle逻辑备份恢复exp.imp篇.doc_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《oracle逻辑备份恢复exp.imp篇.doc》由会员分享,可在线阅读,更多相关《oracle逻辑备份恢复exp.imp篇.doc(8页珍藏版)》请在三一办公上搜索。

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 输入缓冲区大小,可以默认也可以自定义,如果数据文件较大,建议设置的大一些

21、。Export file created by EXPORT:V10.02.01 via conventional pathimport 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

22、 table data (yes/no): yes 导入表数据,如果选NO,则导入表结构Import entire export file (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: 回车,进行导入数据. importing CHARGEs objects into CHARGE. . importing table BALANCE 0 rows imported. . importing table BALANCEFINISHED 0 rows importedAbout to enable constraints.Import terminated successfully without warnings.导入成功,没有任何告警。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号