`
king_tt
  • 浏览: 2234181 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

How to Estimate Export File Size Without Creating Dump File

 
阅读更多

PURPOSE

-------

Estimate file size of export dumpfile without creating the actual dump file.

How to estimate export dumpfile size using pipe, /dev/null, and dd

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

This can be accomplished by using pipe to redirect exp output to dd. At the end of export, dd will report number of blocks written. This is illustrated in following steps.

1) Create a pipe called exp.pipe in /tmp directory

(syntax may differ depending on platform)

% cd /tmp

% mknod exp.pipe p

2) Start reading from exp.pipe with dd, dump output to bit bucket (/dev/null), set blocksize to 1k and execute this process in background

% dd if=/tmp/exp.pipe of=/dev/null bs=1024 &

3) Start the export, setting file=/tmp/exp.pipe

% exp scott/tiger file=/tmp/exp.pipe

4) At the end of exp, look for numbers of records written

Export terminated successfully without warnings.

5+0 records in

5+0 records out

- '5+0 records out' shows 5 records of 1024 bytes were written to the exp dumpfile.

- Step 2 specifies record size(bs) of 1024.

- Size of actual dumpfile would be 1024*5 = 5120 bytes

- Format of 'records out' is f+p, f=full blocks, p=partial block

- For example, if step 4 returns '5+1 records out'

Your actual dumpfile size will be between 5120 bytes(1024*5)

and 6144 bytes(1024*6)




for expdp:

DBMS_SPACE.UNUSED_SPACE will report all free space ABOVE HWM, so is there is lots of free space UNDER
HWM, the actual size is not accurate.

You can use DBMS_SPACE.SPACE_USAGE to get the space information UNDER HWM.

Following is an example:

set serveroutput on

DECLARE
unformatted_blocks NUMBER;
unformatted_bytes NUMBER;
fs1_blocks NUMBER;
fs1_bytes NUMBER;
fs2_blocks NUMBER;
fs2_bytes NUMBER;
fs3_blocks NUMBER;
fs3_bytes NUMBER;
fs4_blocks NUMBER;
fs4_bytes NUMBER;
full_blocks NUMBER;
full_bytes NUMBER;
BEGIN
DBMS_SPACE.SPACE_USAGE(
segment_owner => 'SCOTT',
segment_name => 'DEPT',
segment_type => 'TABLE',
unformatted_blocks => unformatted_blocks,
unformatted_bytes => unformatted_bytes,
fs1_blocks => fs1_blocks,
fs1_bytes => fs1_bytes,
fs2_blocks => fs2_blocks,
fs2_bytes => fs2_bytes,
fs3_blocks => fs3_blocks,
fs3_bytes => fs3_bytes,
fs4_blocks => fs4_blocks,
fs4_bytes => fs4_bytes,
full_blocks => full_blocks,
full_bytes => full_bytes);

dbms_output.put_line('Space usage report for <OWNER>.<TABLE_NAME>');
dbms_output.put_line('***************************************');
dbms_output.put_line('Unformatted : '||unformatted_blocks||' blocks,'||unformatted_bytes/1024/1024||' MB');
dbms_output.put_line(' 0% < Free Space < 25% : '||fs1_blocks||' blocks,'||fs1_bytes/1024/1024||' MB');
dbms_output.put_line('25% < Free Space < 50% : '||fs2_blocks||' blocks,'||fs2_bytes/1024/1024||' MB');
dbms_output.put_line('50% < Free Space < 75% : '||fs3_blocks||' blocks,'||fs3_bytes/1024/1024||' MB');
dbms_output.put_line('75% < Free Space < 100% : '||fs4_blocks||' blocks,'||fs4_bytes/1024/1024||' MB');
dbms_output.put_line('Full blocks : '||full_blocks||' blocks, '||full_bytes/1024/1024||' MB');
END;
/

分享到:
评论

相关推荐

    用Toad for Oracle的Data Dump导入和导出Schema中的数据.txt

    接下来,通过 **Database** &gt; **Export** &gt; **Data Dump Export** 菜单选项进入 Data Dump 导出窗口。在该窗口中,可以按照以下步骤进行操作: - 点击 **New Export** 创建新的导出任务。 - 在 **Schema** 标签页下...

    Oracle-Estimate the size of B-Tree Indexes

    ### Oracle-B树索引大小估算 #### 概述 本文档详细介绍了如何估算Oracle数据库中B树索引的大小。B树索引是Oracle中最常用的索引类型之一,用于提高查询性能。正确估算索引大小对于数据库设计和优化至关重要,可以...

    Learning to Estimate 3D Hand Pose from Single RGB Images

    ### 三维手姿估计从单张RGB图像学习 #### 概述 本文介绍了一种从单张RGB图像中估计三维手姿的新方法。通常情况下,低成本的深度相机和深度学习技术使得从单一深度图像中进行合理的手姿估计成为可能。...

    Foundations for Analytics with Python O-Reilly-2016-Clinton W. Brownley

    The examples illustrate how to carry out some of the most common database operations, including creating a database and table, loading data in a CSV input file into a database table, updat‐ ing ...

    Don’t hire a software developer until you read this book, 2nd Edition

    CHAPTER 20 How to estimate the cost of your MVP CHAPTER 21 Preparing to build your product CHAPTER 22 How to manage your software project CHAPTER 23 Break your app-before your customers do! SECTION8 ...

    estimate_MATLABES_

    在MATLAB编程环境中,`estimate`函数通常与信号处理、统计建模或系统辨识相关。这个函数用于估计模型参数,比如在系统辨识中,它可以帮助我们从数据中估计线性或者非线性系统的参数。`estimate`是MATLAB System ...

    ORACLE expdp-impdp使用

    expdp scott/tiger TABLES=emp ESTIMATE=STATISTICS DIRECTORY=dump DUMPFILE=a.dump ``` **6. ESTIMATE_ONLY** - **用途**: 指定是否仅估算导出作业所需的磁盘空间。 - **语法**: ```plaintext ESTIMATE_ONLY...

    oracle 导入导出命令.txt

    expdp scott/tiger TABLES=emp ESTIMATE=STATISTICS DIRECTORY=dump DUMPFILE=a.dump ``` - **解释**:此命令采用统计方法估算导出`emp`表所需的空间。 ##### 6. `ESTIMATE_ONLY` - **功能**:是否仅计算空间...

    A_Simple_Way_to_Estimate_the_Cost_of_Downtime_David_A_Patterson.pdf

    《一种简单的方法来估算停机成本》:David A. Patterson 的深入分析 David A. Patterson,在加州大学伯克利分校计算机科学系任教,提出了一种简单而有效的方法来估算计算机系统停机时间的成本。...

    oracle数据泵的使用

    EXPDP scott/tiger TABLES=emp ESTIMATE=STATISTICS DIRECTORY=dump DUMPFILE=a.dump ``` ##### 6. ESTIMATE_ONLY 选项 - **功能**:指定是否仅估算所需空间而不执行实际导出操作。 - **语法**: ```sql ...

    TCS: a computer program to estimate gene genealogies

    标题:“TCS: a computer program to estimate gene genealogies”揭示了TCS软件在估计基因系谱(gene genealogies)中的应用。基因系谱是研究生物群体中基因的演化和历史关系的有力工具。系谱估计不仅可以帮助科学...

    块方向追踪

    proposed in this paper to address the problem of how to estimate the scale and orientation changes of the target under the mean shift tracking framework. In the original mean shift tracking algorithm,...

    Manage Software Testing

    The book covers unit, system, and non-functional tests and includes examples on how to estimate the number of bugs expected to be found, the time required for testing, and the date when a release is ...

    The Clean Coder

    - When to say “No”—and how to say it - When to say “Yes”—and what yes really means Great software is something to marvel at: powerful, elegant, functional, a pleasure to work with as both a ...

    Using TEM Cell Measurements to Estimate the Maximum Radiation From PCBs With Cables Due to Magnetic Field Coupling

    ### 使用TEM单元测量估计PCB与电缆因磁场耦合产生的最大辐射 #### 摘要: 本文探讨了如何通过使用TEM(传输线电磁)单元测量技术来评估带有电缆的印刷电路板(PCB)由于磁场耦合而产生的最大辐射。...

    End-to-end Estimation of the Available Bandwidth Variation Range

    In this paper, we show how to estimate a given percentile of the avail-bw distribution at a user-specified time scale. If two estimated percentiles cover the bulk of the distribution (say 10% to 90%)...

    Oracle10g导入导出

    expdp scott/tiger TABLES=emp ESTIMATE=STATISTICS DIRECTORY=dump DUMPFILE=a.dump ``` **注意事项**: 使用`STATISTICS`选项时,导出过程将依赖于对象的最新统计信息,这有助于更准确地评估所需磁盘空间。...

    f0estimate.rar_frequency estimate

    ESTIMATE FUNDAMENTAL FREQUENCY

    pose estimate 姿态估计

    在这个"pose estimate"的示例中,我们将探讨如何利用OpenCV结合OpenGL库来实现这一功能。 首先,OpenGL是一个用于渲染2D和3D图形的应用编程接口(API),广泛用于图形硬件加速。在OpenCV中结合OpenGL,可以提高图形...

    Flow estimate

    在"Flow estimate"这个主题中,我们主要关注的是Brox等人编写的用于估计光学流的代码实现。光学流估计是解决视频处理、运动分析、自动驾驶等众多应用的关键技术。 光学流的基本原理基于物理假设:相邻帧间的相似性...

Global site tag (gtag.js) - Google Analytics