重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2857|回复: 1
打印 上一主题 下一主题

12c 数据泵导入时禁止生成日志的参数disable_archive_logging

[复制链接]
跳转到指定楼层
楼主
发表于 2016-7-17 18:28:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
早就希望数据泵导入时能够有nologging的功能,省去很多归档日志的消耗。从Oracle Database 12c开始终于有了该功能,就是使用参数DISABLE_ARCHIVE_LOGGING。从字面上就能看出它的用处吧,禁用归档日志!

在执行导入操作时,对象的记录日志属性会被设置为NO,导入操作结束后日志属性还原。

1,采用压缩方式导出hr用户数据
[oracle@snow ~]$ expdp dp/dp directory=dp_dir dumpfile=hrc.dmp logfile=hrc.log schemas=hr compression=all

对比一下压缩前后的差距,不到一半的空间。
[oracle@snow ~]$ ll
total 64024
-rw-r--r--. 1 oracle oinstall      945 Feb  8 18:33 12cpfile.ora
-rw-r-----. 1 oracle oinstall   176128 Feb  9 16:09 20150226_1.dmp
-rw-r-----. 1 oracle oinstall     1549 Feb  9 16:09 20150226_1.log
-rw-r-----. 1 oracle oinstall   237568 Feb  9 16:00 20150226.dmp
-rw-r--r--. 1 oracle oinstall     1613 Feb  8 20:00 createdb.sql
drwxr-xr-x. 7 oracle oinstall     4096 Jun 10  2013 database
-rw-r-----. 1 oracle oinstall     1618 Feb  9 16:00 export.log
-rw-r--r--. 1 oracle oinstall      154 Feb  9 16:09 flashback.par
-rw-r-----. 1 oracle oinstall 64253952 Feb  9 09:56 full.dmp
-rw-r-----. 1 oracle oinstall    29419 Feb  9 10:04 full.log
-rw-r-----. 1 oracle oinstall   241664 Feb  9 16:43 hrc.dmp  <压缩数据
-rw-r-----. 1 oracle oinstall     2568 Feb  9 16:43 hrc.log
-rw-r-----. 1 oracle oinstall   577536 Feb  9 15:22 hr.dmp   <非压缩数据
-rw-r-----. 1 oracle oinstall     2549 Feb  9 15:22 hr.log
-rw-r-----. 1 oracle oinstall     1721 Feb  9 15:32 import.log
-rw-r--r--. 1 oracle oinstall       88 Feb  9 14:43 pro.par
[oracle@snow ~]$
[oracle@snow ~]$
[oracle@snow ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Mon Feb 9 16:47:39 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SYS@ora12c >drop user hr cascade;

User dropped.

SYS@ora12c >exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@snow ~]$

导入数据时开启transform=disable_archive_logging:Y 避免生成归档日志
[oracle@snow ~]$ impdp dp/dp directory=dp_dir dumpfile=hrc.dmp \
> transform=disable_archive_logging:Y

Import: Release 12.1.0.1.0 - Production on Mon Feb 9 16:49:16 2015

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Master table "DP"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "DP"."SYS_IMPORT_FULL_01":  dp/******** directory=dp_dir dumpfile=hrc.dmp transform=disable_archive_logging:Y
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "HR"."COUNTRIES"                            5.218 KB      25 rows
. . imported "HR"."DEPARTMENTS"                          5.437 KB      27 rows
. . imported "HR"."EMPLOYEES"                            8.773 KB     107 rows
. . imported "HR"."JOBS"                                 5.445 KB      19 rows
. . imported "HR"."JOB_HISTORY"                          5.304 KB      10 rows
. . imported "HR"."LOCATIONS"                            6.046 KB      23 rows
. . imported "HR"."REGIONS"                              4.851 KB       4 rows
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Job "DP"."SYS_IMPORT_FULL_01" successfully completed at Mon Feb 9 16:49:29 2015 elapsed 0 00:00:11

但是,对create table,alter table,也要产生日志,create index不会产生日志。


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

沙发
 楼主| 发表于 2016-7-17 18:28:50 | 只看该作者
这个功能不错哈。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-5-2 23:17 , Processed in 0.080285 second(s), 18 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表