expdp&impdp使用多个DUMPFILE

$ expdp hr SCHEMAS=hr DIRECTORY=dpump_dir1 DUMPFILE=dpump_dir2:exp1.dmp, exp2%U.dmp PARALLEL=3

指定DUMPFILE时可以指定多个文件用逗号分隔,如果未给扩展名.xxx则会自动加上.dmp,这时每个parallel进程会使用一个文件,另外如果同时指定了FILESIZE ,则dumpfile在达到指定大小时会自动切换文件。如果指定的多个文件没用完,没用的文件将废弃不用

Although it is possible to specify multiple files using the DUMPFILE parameter, the export job may only require a subset of those files to hold the exported data. The dump file set displayed at the end of the export job shows exactly which files were used. It is this list of files that is required to perform an import operation using this dump file set. Any files that were not used can be discarded.

也可以通过下面变量来指定模板文件,这样dumpfile会根据需求自动创建dumpfile文件了

Substitution Variable

Meaning

%U

The substitution variable is expanded in the resulting file names into a 2-digit, fixed-width, incrementing integer starting at 01 and ending at 99. If a file specification contains two substitution variables, both are incremented at the same time. For example, exp%Uaa%U.dmp would resolve to exp01aa01.dmp, exp02aa02.dmp, and so forth.

%d, %D

Specifies the current day of the month from the Gregorian calendar in format DD.

Note: This substitution variable cannot be used in an import file name.

%m, %M

Specifies the month in the Gregorian calendar in format MM.

Note: This substitution variable cannot be used in an import file name.

%t, %T

Specifies the year, month, and day in the Gregorian calendar in this format: YYYYMMDD.

Note: This substitution variable cannot be used in an import file name.

%l, %L

Specifies a system-generated unique file name.

The file names can contain a substitution variable (%L), which implies that multiple files may be generated. The substitution variable is expanded in the resulting file names into a 2-digit, fixed-width, incrementing integer starting at 01 and ending at 99 which is the same as (%U). In addition, the substitution variable is expanded in the resulting file names into a 3-digit to 10-digit, variable-width, incrementing integers starting at 100 and ending at 2147483646. The width field is determined by the number of digits in the integer.

For example if the current integer was 1, exp%Laa%L.dmp would resolve to

exp01aa01.dmp

exp02aa02.dmp

and so forth up until 99. Then, the next file name would have 3 digits substituted:

exp100aa100.dmp

exp101aa101.dmp

and so forth up until 999 where the next file would have 4 digits substituted. The substitution will continue up to the largest number substitution allowed, which is 2147483646.

%y, %Y

Specifies the year in this format: YYYY. Note: This substitution variable cannot be used in an import file name.

dumpfile内有足够信息定位具体文件,dumpfile的文件名,位置以及顺序都可以与导出时不同

Sufficient information is contained within the files for Import to locate the entire set, provided the file specifications in the DUMPFILE parameter encompass the entire set. The files are not required to have the same names, locations, or order that they had at export time.

$ impdp hr DIRECTORY=dpump_dir1 DUMPFILE=dpump_dir2:exp1.dmp, exp2%U.dmp

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
expdpimpdpOracle 数据库中用来导出和导入数据的工具。 expdpOracle 数据库中用来导出数据的工具,它可以将数据库中的表、索引、视图、存储过程等数据导出到一个文件中。expdp 命令的语法如下: ``` expdp username/password@connect_string DIRECTORY=directory_name DUMPFILE=dump_file_name SCHEMAS=schema_name [TABLES=table_name [,table_name ...]] ``` 其中,`username/password@connect_string` 是连接字符串;`DIRECTORY` 指定导出文件的路径;`DUMPFILE` 指定导出文件文件名;`SCHEMAS` 指定需要导出的数据库用户,可以导出多个用户;`TABLES` 可选参数,指定需要导出的表名。 impdpOracle 数据库中用来导入数据的工具,它可以将 expdp 导出的数据文件导入到数据库中。impdp 命令的语法如下: ``` impdp username/password@connect_string DIRECTORY=directory_name DUMPFILE=dump_file_name SCHEMAS=schema_name [TABLES=table_name [,table_name ...]] ``` 其中,`username/password@connect_string` 是连接字符串;`DIRECTORY` 指定导入文件的路径;`DUMPFILE` 指定导入文件文件名;`SCHEMAS` 指定需要导入的数据库用户,可以导入多个用户;`TABLES` 可选参数,指定需要导入的表名。 需要注意的是,在使用 expdpimpdp 工具时,需要先创建一个目录(DIRECTORY),并授权给数据库用户使用。授权的命令如下: ``` CREATE DIRECTORY directory_name AS 'directory_path'; GRANT READ, WRITE ON DIRECTORY directory_name TO user_name; ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值