Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The use of query parameters in Oracle 11g expdp

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The query parameter is provided in expdp, which can be used when you need to export part of the data in the table conditionally, just like the where condition in the select statement.

Database version

Zx@ORCL > select * from v$version BANNER----Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit ProductionPL/SQL Release 11.2.0.4.0-ProductionCORE11.2.0.4. 0ProductionTNS for Linux: Version 11.2.0.4.0-ProductionNLSRTL Version 11.2.0.4.0-Production

Create a test table

Zx@ORCL > create table E1 (id number,name varchar2 (20)), Table created.zx@ORCL > create table e2 (id number,birthday date), Table created.

Insert test data

Zx@ORCL > insert into E1 select level,lpad (level,20,'*') from dual connect by level commit;Commit complete.zx@ORCL > insert into e2 select level,sysdate-50+level from dual connect by level commit;Commit complete.

Create a directory

Zx@ORCL > create directory dir as'/ home/oracle/';Directory created.zx@ORCL > host

Test using query export

Note: if the query condition is in parfile, you do not need to escape with'\'.

[oracle@rhel6 ~] $expdp zx/zx directory=dir dumpfile=e1.dmp tables=zx.e1 query=zx.e1:\ "where idselect dbms_flashback.get_system_change_number from dual;GET_SYSTEM_CHANGE_NUMBER---- 2179047zx@ORCL > select count (*) from E1; COUNT (*)-100

Delete part of the data

Zx@ORCL > delete from E1 where idcommit;Commit complete.zx@ORCL > host

Test query and flashback_scn

[oracle@rhel6 ~] $expdp zx/zx directory=dir dumpfile=e1_1.dmp tables=zx.e1 query=zx.e1:\ "where id\"

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report