[20180226]exp 无法dirct的情况.txt

简介: [20180226]exp 无法dirct的情况.txt http://blog.csdn.net/leshami/article/details/9146023 传统路径导出 VS 直接路径导出(oracle exp direct=y) 1、两者的差异 a、 Conventional path Export     传统路径模式使用SQL SELECT语句抽取表数据。

[20180226]exp 无法dirct的情况.txt

http://blog.csdn.net/leshami/article/details/9146023

传统路径导出 VS 直接路径导出(oracle exp direct=y)

1、两者的差异
a、 Conventional path Export
    传统路径模式使用SQL SELECT语句抽取表数据。数据从磁盘读入到buffer cache缓冲区中,行被转移到评估缓冲区。
    在此之后根据SQL表达式,将记录返回给导出客户端,然后写入到dump文件。
  
b、Direct path Export
   直接导出模式,数据直接从磁盘中读取到导出session的PGA中,行被直接转移到导出session的私有缓冲区,从而跳过SQL命令处理层。
   避免了不必要的数据转换。最后记录返回给导出客户端,写到dump文件。
     
2、性能问题
a、直接路径导出方式比传统路径方式具有更优的性能,速度更快,因为绕过了SQL命令处理部分。
b、直接路径导出方式支持RECORDLENGTH参数(最大为64k),该参数值通常建议设置为系统I/O或者DB_BLOCK_SIZE的整数倍
c、影响直接路径导出的具体因素(DB_BLOCK_SIZE,列的类型,I/O性能,即数据文件所在的磁盘驱动器是否单独于dump文件所在的磁盘驱动器)
d、无论是直接路径导出还是传统路径导出产生的dump,在使用imp方式导入时,会耗用相同的时间(注:我认为导入设置更大buffer可以加快导入)

--//看看那些情况无法direct导出.

1.环境:
SCOTT@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

create table t ( a number);
insert into t values(1);
insert into t values(2);
insert into t values(3);
commit;
alter table t add ( c number default 10 not null);

2.测试1:
--//如果存在alter table t add ( c number default 10 not null);的情况,直接路径导出会出问题.
$ exp scott/book file=t.dmp tables=t direct=y RECORDLENGTH=65535
SCOTT@book> alter table t add ( c number default 10 not null);
Table altered.

SCOTT@book> alter table t rename to t1;
Table altered.

$ imp scott/book tables=T file=t.dmp buffer=1048576
Import: Release 11.2.0.4.0 - Production on Mon Feb 26 16:52:37 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via direct path
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SCOTT
. importing SCOTT's objects into SCOTT
. . importing table                            "T"
IMP-00019: row rejected due to ORACLE error 1400
IMP-00003: ORACLE error 1400 encountered
ORA-01400: cannot insert NULL into ("SCOTT"."T"."C")
Column : 1
Column :
IMP-00019: row rejected due to ORACLE error 1400
IMP-00003: ORACLE error 1400 encountered
ORA-01400: cannot insert NULL into ("SCOTT"."T"."C")
Column : 2
Column :
IMP-00019: row rejected due to ORACLE error 1400
IMP-00003: ORACLE error 1400 encountered
ORA-01400: cannot insert NULL into ("SCOTT"."T"."C")
Column : 3
Column :           0 rows imported
Import terminated successfully with warnings.

SCOTT@book> select * from t;
no rows selected

--//如果要使用direct要检查sys.ecol$;表.看看是否这样定义的表.

SCOTT@book> column BINARYDEFVAL format a10
SCOTT@book> select * from sys.ecol$;
   TABOBJ#     COLNUM BINARYDEFV
---------- ---------- ----------
     90387          2 C10B

SCOTT@book> select object_id,data_object_id,owner,object_name from dba_objects where DATA_OBJECT_ID=90387;
OBJECT_ID DATA_OBJECT_ID OWNER  OBJECT_NAME
---------- -------------- ------ --------------------
     90387          90387 SCOTT  T1
--//实际上数据如果不是保存块中的情况,diect都会存在问题.

3.测试2:

SCOTT@book> create table t ( a number,b blob );
Table created.

SCOTT@book> insert into t values(1,'a');
1 row created.

SCOTT@book> insert into t values (2,lpad('a',4000,'a'));
1 row created.

SCOTT@book> commit ;
Commit complete.

$ exp scott/book file=t.dmp tables=t direct=y RECORDLENGTH=65535
Export: Release 11.2.0.4.0 - Production on Mon Feb 26 17:07:43 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified tables via Direct Path ...
Table T will be exported in conventional path.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. . exporting table                              T          2 rows exported
Export terminated successfully without warnings.

--//注意看下划线包含lob类型,导致变成conventional path.

SCOTT@book> create table empx as select * from emp ;
Table created.


$ exp scott/book file=t.dmp tables=empx,t direct=y RECORDLENGTH=65535 buffer=10485760
Export: Release 11.2.0.4.0 - Production on Mon Feb 26 17:26:29 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified tables via Direct Path ...
. . exporting table                           EMPX         14 rows exported
Table T will be exported in conventional path.
. . exporting table                              T          2 rows exported
Export terminated successfully without warnings.

--//表empx采用direct导出,表t采用conventional导出,这就是为什么也要设置buffer的缘故.这样可以照顾传统路径的导出.
--//继续测试导入的情况.

SCOTT@book> alter table empx rename to empy;
Table altered.

SCOTT@book> alter table t rename to t1;
Table altered.

$ imp scott/book file=t.dmp tables=empx,t direct=y RECORDLENGTH=65535 buffer=10485760
LRM-00101: unknown parameter name 'direct'
IMP-00022: failed to process parameters, type 'IMP HELP=Y' for help
IMP-00000: Import terminated unsuccessfully
--//导入不支持direct参数,实际上导入不需要direct.

$ imp scott/book file=t.dmp tables=empx,t  RECORDLENGTH=65535 buffer=10485760
Import: Release 11.2.0.4.0 - Production on Mon Feb 26 17:43:59 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via direct path
~~~~~~~~~~~~~~~~~~~~~~~~ oracle似乎知道导致采用direct path.
import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SCOTT
. importing SCOTT's objects into SCOTT
. . importing table                         "EMPX"         14 rows imported
. . importing table                            "T"          2 rows imported
Import terminated successfully without warnings.

--//很明显RECORDLENGTH=65535是一个无效参数,导入要加快速度要使用buffer参数.

相关实践学习
阿里云云原生数据仓库AnalyticDB MySQL版 使用教程
云原生数据仓库AnalyticDB MySQL版是一种支持高并发低延时查询的新一代云原生数据仓库,高度兼容MySQL协议以及SQL:92、SQL:99、SQL:2003标准,可以对海量数据进行即时的多维分析透视和业务探索,快速构建企业云上数据仓库。 了解产品 https://www.aliyun.com/product/ApsaraDB/ads
目录
相关文章
|
SQL 关系型数据库 MySQL
SyncNavigator数据库同步软件8.4.1 中文版
SyncNavigator是一款专门用于SqlServer、Mysql数据同步的软件,由国内顶级开发团队开发完成,经历8年逐步完善,目前具备强大的数据同步功能,国内很多大型连锁超市,企业,公司都在用SyncNavigator数据同步软件进行着数据同步服务。
5942 0
|
4月前
|
人工智能 安全 IDE
AI Agent框架终极对决:通义灵码、OpenClaw、Hermes功能、性能与成本深度评测
2026年,AI Agent(智能体)已从概念走向大规模落地,成为个人与企业提升效率、实现自动化的核心工具。面对市场上百花齐放的Agent框架,开发者与企业往往面临选型难题。通义灵码、OpenClaw、Hermes作为当前最具代表性的三大框架,分别代表了IDE原生、开源通用、自进化轻量三种不同的技术路线与产品哲学。本文将从核心定位、架构设计、核心能力、部署方式、资源消耗、安全与成本、适用场景等多个维度,对三大框架进行深度实战对比,帮助用户清晰认知差异,精准选择最适合自身需求的AI Agent解决方案。
499 1
|
3月前
|
人工智能 JSON JavaScript
开发者指南:如何高效导出豆包AI对话记录并进行智能体数据迁移
本文探讨了将豆包AI对话记录完整导出的技术思路,分析了DOM渲染机制带来的挑战,并介绍了浏览器脚本、自动化框架、浏览器扩展等实现路径。重点说明了数据预加载、格式化与JSON/Markdown导出的通用流程,以及导出数据在模型微调、跨平台迁移中的后续利用方法,同时强调了数据安全与合规使用注意事项。
|
4月前
|
人工智能 自然语言处理 安全
2026企业级Agent解决方案,主流agent平台评测与选型指南
本文聚焦2026年企业级AI Agent规模化落地关键期,提出开发效率、安全合规、生态集成三大选型标尺,深度剖析主流架构。阿里云瓴羊Agent凭借NL2Data混合技术、全链路智能能力及深厚企业底座,成为数据密集型行业首选,助力企业实现“懂业务、守底线、通全局”的智能升级。(239字)
|
7月前
|
人工智能 自然语言处理 运维
企业建设智能客服系统要多少钱?瓴羊Quick Service助力企业降本增效(2026年3月最新)
2026年,智能客服已成业务增长引擎。瓴羊Quick Service基于通义千问大模型,提供SaaS+PaaS混合架构,年费万元起,支持弹性计费、零运维、小时级冷启动与无感迭代,大幅压缩隐性成本,让企业轻量高效构建高智能客服系统。(239字)
|
9月前
|
人工智能 安全 算法
从Prompt工程师到Agent指挥官:AI时代的权力重构
本文阐述AI范式从2023年“提示工程”(咒语师)向2026年“AI Agent指挥官”的历史性跃迁:技术门槛降低、生产力升维为自主闭环、协作模式转向人机军团协同。指挥官需掌握系统架构、工具编排与批判审计能力,在权力重构中重掌创造力主导权。(239字)
579 2
|
10月前
|
JSON 算法 Java
淘宝商品详情API系列的核心接口详细说明
淘宝商品详情API系列的核心接口为taobao.item.get,该接口用于获取淘宝或天猫商品的详细信息,包括商品标题、价格、库存、描述、图片等关键字段。以下是该接口的详细说明:
|
SQL Shell 网络安全
vulnhub靶机实战_DC-8
本文介绍DC-8靶机渗透全过程,涵盖环境搭建、信息扫描、SQL注入、密码爆破、反向Shell获取及提权。利用sqlmap与john工具破解用户凭据,通过Web表单执行命令并获取root权限,最终读取flag完成渗透测试。
1557 0
|
前端开发 测试技术 UED
使用Selenium WebDriver模拟用户操作防止滑动条验证
在进行Web自动化测试时,经常会遇到各种前端验证机制,如滑动条验证,这些机制设计用来防止自动化脚本模拟用户行为。在本文中,我们将探讨如何使用Selenium WebDriver来模拟用户操作,以规避这些验证机制。