11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

332 CHAPTER 7 ■ DATA PUMPset serveroutput onCREATE OR REPLACE PROCEDURE gen_dp(p_table_name IN VARCHAR2,p_table_name_extension IN VARCHAR2 := '_dp',p_directory IN VARCHAR2 := 'oratmp',p_dumpfile IN VARCHAR2 := 'sat', -- sat = same as tablep_logfile IN VARCHAR2 := 'sat', -- sat = same as tablep_compression IN VARCHAR2 := 'disabled',p_encryption IN VARCHAR2 := 'disabled')ASv_dumpfile VARCHAR2(100) := p_dumpfile;v_logfile VARCHAR2(100) := p_logfile;v_compression VARCHAR2(30) := p_compression;v_encryption VARCHAR2(30) := p_encryption;BEGINIF v_dumpfile = 'sat' THENv_dumpfile := p_table_name||'.dmp';END IF;IF v_logfile = 'sat' THENv_logfile := p_table_name;END IF;IF lower(v_compression) = 'enabled' THENv_compression := 'compression enabled';elsif lower(v_compression) = 'disabled' THENv_compression := '';END IF;IF lower(v_encryption) = 'enabled' THENv_encryption := 'encryption enabled';ELSIF lower(v_encryption) = 'disabled' THENv_encryption := '';END IF;DBMS_OUTPUT.PUT_LINE ('create table '||p_table_name||p_table_name_extension);DBMS_OUTPUT.PUT_LINE (' organization external');DBMS_OUTPUT.PUT_LINE ('(');DBMS_OUTPUT.PUT_LINE (' type oracle_datapump ');DBMS_OUTPUT.PUT_LINE (' default directory '||p_directory);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!