How to Estimate Export File Size Without Creating Dump File
来源:互联网 发布:淘宝店铺修改发货地址 编辑:程序博客网 时间:2024/06/11 02:57
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;
/
- How to Estimate Export File Size Without Creating Dump File
- How To Validate A DataPump Export (EXPDP) Dump File ? (文档 ID 2113967.1) 转到底部 -------------------
- How to Create Dump File for Applications
- Kgraph-how to compute index file size
- Export To File
- EXPORT TO XLSX-FILE
- How to export files from rpm file on ubuntu system
- How to export class from xml schema file
- How to interpret a Linux core dump file
- How to Dump Redo Log File Information [ID 1031381.6]
- How to manually create a crash dump file
- How To Find Large File Size On Linux
- How to check the size of file/directory ?
- How to Export/import database dump correctly
- SQLite Tutorial 4 : How to export SQLite file into CSV or Excel file
- export data to csv file
- export data to tsv file
- export data to xml file
- 终于有人把O2O、C2C、B2B、B2C的区别讲透了
- 腾讯云服务器装MYSQL数据库浏览器访问乱码问题
- 如何高效的访问内存
- 左值引用与右值引用
- 前端开发案例——COOKIE/SESSION机制(一)
- How to Estimate Export File Size Without Creating Dump File
- 1 单例模式
- java面试题(六)
- android studio 2.2 NDK开发经验总结及相关错误汇总(旧版NDK开发转新版NDK开发经验)
- elasticserch +kibana+marvel+sense
- redis aof文件解析成命令
- sublime text 3
- C++17引入的模块为什么能加快编译速度?
- 使用c#发送邮件