数据库中exp导出方法是什么

发布时间:2021-11-10 15:35:30 作者:iii
来源:亿速云 阅读:359

本篇内容介绍了“数据库中exp导出方法是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

1.功能简介

Export和import是oracle很常用的数据迁移工具(导出/导入)。这种迁移方式采用的是逻辑迁移。实际进行操作时,export/import对应的命令是emp/imp(注意小写)。

2.迁移条件:

exp&imp支持跨版本、跨平台的迁移,还支持夸字符集的数据迁移。最重要的是,在迁移之前不需要做任何的准备工作,只需要执行exp/imp命令,指定相关参数即可完成导出/导入任务

3.查看帮助

可以通过help=y命令来调出帮助信息

[oracle@localhost u01]$ exp help=y

Export: Release 11.2.0.4.0 - Production on Tue Oct 23 02:43:45 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

USERID must be the first parameter on the command line.

Keyword    Description (Default)      Keyword      Description (Default)

--------------------------------------------------------------------------

USERID     username/password          FULL         export entire file (N)

BUFFER     size of data buffer        OWNER        list of owner usernames

FILE       output files (EXPDAT.DMP)  TABLES       list of table names

COMPRESS   import into one extent (Y) RECORDLENGTH length of IO record

GRANTS     export grants (Y)          INCTYPE      incremental export type

INDEXES    export indexes (Y)         RECORD       track incr. export (Y)

DIRECT     direct path (N)            TRIGGERS     export triggers (Y)

LOG        log file of screen output  STATISTICS   analyze objects (ESTIMATE)

ROWS       export data rows (Y)       PARFILE      parameter filename

CONSISTENT cross-table consistency(N) CONSTRAINTS  export constraints (Y)

OBJECT_CONSISTENT    transaction set to read only during object export (N)

FEEDBACK             display progress every x rows (0)

FILESIZE             maximum size of each dump file

FLASHBACK_SCN        SCN used to set session snapshot back to

FLASHBACK_TIME       time used to get the SCN closest to the specified time

QUERY                select clause used to export a subset of a table

RESUMABLE            suspend when a space related error is encountered(N)

RESUMABLE_NAME       text string used to identify resumable statement

RESUMABLE_TIMEOUT    wait time for RESUMABLE

TTS_FULL_CHECK       perform full or partial dependency check for TTS

VOLSIZE              number of bytes to write to each tape volume

TABLESPACES          list of tablespaces to export

TRANSPORT_TABLESPACE export transportable tablespace metadata (N)

TEMPLATE             template name which invokes iAS mode export

Export terminated successfully without warnings.

注:执行imp时支持的参数与上述类似,不完全相同,可以可以通过命令imp help=y进行查看

4.Exp/imp的处理模式

Exp/imp工具在使用的时候支持4中操作模式:

(1)    整库模式:导出导入整个数据库,对应FULL参数;

(2)    表空间模式:导出导入指定表空间中的对象数据,对应tablespace参数;

(3)    用户模式:导出导入用户自有对象,对应owner参数;

(4)    表模式:导出导入指定的表或分区表,对应tables参数。

5.Exp调用方式

(1)    命令行方式调用

直接执行命令

例如:$ exp scott/tiger tables=emp file=scott_emp.dmp log=scott_emp.log

(2)    参数文件方式调用

第一步,编辑一个文件

$ vi scott_emp.dat

           Tables=emp

           Buffer=20480

log=scott_emp.log

第二步,然后在执行命令时调用这个文件

$ exp scott/tiger parfile=scott_emp.dat

6.Exp导出例子说明

(1)    导出scott用户的emp表

$ exp scott/tiger tables=emp file=scott_emp.dmp log=scott_emp.log            

(2)    导出scott用户emp表中empno>100的数据

$ exp scott/tiger tables=emp query="'where empno>100'" file=scott_emp100.dmp log=scott_emp100.log

(3)    导出scott用户所有的表

$ exp scott/tiger owner=scott file=scott_tables.dmp log=scott_tables.log

(4)    全库导出

$ exp system/oracle full=y file=fulldb.dmp log=fulldb.log

7.重要参数说明

TABLES:   指定要导出那些表

QUERY:    对要导出的数据进行筛选

      SCHEMA:  指定schema(写成用户名)

      LOG:        指定产生日志文件名

      FULL:       FULL=y时,代表全库导出

      FILESIZE: 指定导出单一文件的大小

      索引、约束、授权

      GRANTS:指定对象的授权信息(访问、操作权限),默认为Y

      INDEXES:指定是否导出表的索引,默认为Y

      CONSTRAINTS:指定是否导出表的约束,默认为Y

      TRIGGERS:指定是否导出与表相关的触发器,默认为Y

“数据库中exp导出方法是什么”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!

推荐阅读:
  1. 解决exp无法导出问题
  2. Oracle11gR2用EXP导出报EXP-00011错误

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

数据库 exp

上一篇:数据库中imp导入需要考虑的问题有哪些

下一篇:Django中的unittest应用是什么

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》