Export with query option

Hi all!
I need export different tables from my 10.2.0.4 database using expdp. Some of this tables, needs be under different conditions. How can I prepare my parameter file for this export?
Table1 --> query: where valid=1
Table2 --> query: where valid=1 and secure=0
Table3 --> query: where valid=1 and secure=1
Thanks a lot!!!

I'm a bit confused about parameter file ...
*1. ways to export*
There are 3 ways to export, you can use parameter file but there is no need for it (personally I never use it)
a. using expdp
b. using PL/SQL
c. external table
*2. what to export*
you simply use QUERY clause to specify where conditions, for example if you want to use (a) then it would look like this
$ expdp query=employees:"where salary>10000" tables=employeesif if you want to use parameter file
TABLES:emp_salary
DUMPFILE=dump_dir
QUERY= emp_salary:"WHERE emp_id IN (SELECT id from emp
where join_date> to_date('2004-01-01','YYYY-MM-DD')
AND dept='SALSE')"here are some useful links
Part I http://www.orafaq.com/node/65
Part II http://www.orafaq.com/node/67
Part III http://www.orafaq.com/node/74
http://www.rampant-books.com/art_nanda_datapump.htm

Similar Messages

  • Help with export with query option

    I need help with an export with query option.
    I have a script that includes the following
    auddate=`date '+20%y%m%d'`
    file="cal_shrlgpa"$auddate".dmp"
    exp / file=$file tables=shrlgpa query\=" where shrlgpa_pidm in (Select sztahbr_pidm from purdue.sztahbr where sztahbr_to_extract\=\'Y\' and sztahbr_export_status\=\'N\')\"
    echo 'cal export file created:'$file
    when I run the script, I get the following error:
    cal_export_tables.sh[7]: 0403-057 Syntax error at line 7 : `"' is not matched.
    Can somone help me with the query option?

    I made the suggested change:
    exp / file=$file tables=shrlgpa query=" where shrlgpa_pidm in (Select sztahbr_pidm from purdue.sztahbr where sztahbr_to_extract=\'Y\' and sztahbr_export_status=\'N\')"
    and got the following error:
    LRM-00116: syntax error at 'sztahbr_to_extra' following 'where'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    Shannon

  • Syntax for taking export with 'Query' parameter

    Hi all
    Please help me regarding syntax for taking export with query parameter

    Hi
    exp file=d:\exp.dmp log=d:\exp.log tables=scott.emp query='where empno=10'
    exp file=d:\exp.dmp log=d:\exp.log tables=scott.emp query='where ename='''SCOTT''Salman

  • Export with query problem

    Hello,
    I have to export three tables out of my database with a query. I started the export with following command (on a Windows testing machine).
    exp.exe userid=ccq/xxx@KDG file=C:\download\export\NEW.dmp tables= qem_message, qem_messagestatlog, qw_text query=””"where qem_message.messagebody > 739409 AND qem_message.pkey = qem_messagestatlog.pkey AND qem_message.messagebody = qw_text.qwkey" log=C:\download\export\NEW.log
    I have got the following error:
    . . Export of the table QEM_MESSAGE
    EXP-00056: ORACLE-error 904 found
    ORA-00904: Unknown columnname
    I think the problem is the query statement. All the columns are written right. Is there an error in the statement or is it impossible to execute such statement in an export?

    Hi,
    you have to use export one time at a time with query parameter
    consider
    SQL> host type d:\query.txt
    query="where emp.deptno = dept.deptno
           and emp.sal > 1000
           or dept.deptno = 40"
    SQL> host exp scott/tiger file=d:\tt.dmp tables=(EMP,DEPT) PARFILE=d:\query.txt
    Export: Release 10.1.0.2.0 - Production on Thu Feb 1 17:11:11 2007
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    . . exporting table                            EMP
    EXP-00056: ORACLE error 904 encountered
    ORA-00904: "DEPT"."DEPTNO": invalid identifier
    . . exporting table                           DEPT
    EXP-00056: ORACLE error 904 encountered
    ORA-00904: "EMP"."SAL": invalid identifier
    Export terminated successfully with warnings.
    SQL>regards
    Taj

  • Export using query option

    Good morning everyone,
    I am currently trying to an export on a table with a where clause of value1= 1 or value1 = 2. When I do this I find the export to be extremely slow. But if I do two exports ie. one export with value1=1 and another export with value1=2 they are quite fast. Now when I do this it is done in two dmp files. Is there a way of doing two exports on the same table into one dmp file without losing any data?? Thank you in advance.
    Troy

    Hi;
    Please see:
    Issue with data pump "Query" parameter
    Export/Import DataPump Parameter QUERY Specification
    http://arjudba.blogspot.com/2008/04/exportimport-datapump-parameter-query.html
    Also see:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_export.htm#i1006293
    Regard
    Helios

  • Export with save option

    Hi,
    Iam using IR 11 version. I have written script for exporting chart and pivot data.I used command button to export.Whenever i clik on the command button its exporting successfully but i want to save the files in different locations.for example.. if i clik on the command button it should ask for where to save the file.
    script which i have written for export files..in this where i need to keep the save option???
    try{
    ActiveDocument.Sections["C_TTT"].Export("C:\\TTT.jpeg",bqExportFormatJPEG)
    ActiveDocument.Sections["P_TTT"].Export("C:\\TTT.csv",bqExportFormatCSV)
    Alert("exported successfully")
    }catch(e)
    Alert("Failed To Export")
    }

    When you click on a method in the Script Editor it tells you the required and optional parameters in the lower left corner of the editor.
    And if you click Help after clicking on the Method you get the following:
    Export (Method)
    Applies To:
    ChartSection object, (CubeQuery) QuerySection object, DataModelSection object, Document object, DashboardSection object, OLAPQuerySection object, PivotSection object, QuerySection object, ResultsSection object, Section object, TableSection object, ReportSection object
    Description:
    Creates a file with the information from a section object. Files can be created using the standard data formats from the BqExportFileFormat constant group.
    Note:
    For UNIX users of the Export and ExportToStream methods,Interactive Reporting Web Client and Interactive Reporting Web Client reference the umask command of the user running the Interactive Reporting Service to determine the three-digit octal code. This code defines the read-write-execute permissions to be turned off. Typically, umask is used in .login or .profile and in the Bourne and C shells. It is a built-in command.
    Syntax:
    Expression.Export(Filename As String, [optional] FileFormat As BqExportFileFormat, [optional]IncludeHeaders As Boolean], [optional] Boolean Prompt), [optional] BqEncoding Encoding)wayne

  • LR 5.3 export with resize option not resizing

    Hello!
    Just updated my LR to 5.3 from the CC and noticed a weird problem that I never encountered before in LR4 or 5.x (before 5.3 that is).
    I usually export pictures from RAW format to either TIFF or JPG (100% quality) and depending on purpose I use batch resizing, e.g. 1080 pixels on short edge ... well that whole Resize setting gets ignored by LR 5.3! It still exports full size (full RAW size in this case) into JPG or TIFF, but it won't resize ... is it a bug or I am doing something wrong here?
    EDIT:
    I found out that I checked the "Don't enlarge" box in Export dialog under Resizing, that's when resizing was not working. After I unchecked it then it works fine, but still what does that have to do with anything if we are talking about downsampling images from 5184x3456 pixels to 1620x1080 ...

    It's a (reported) bug. Exportant provides a fix for it.

  • Error In Query Level export with  multiple conditions

    When i am running the following Query for Export with i am getting the result.
    C:\Documents and Settings\ITL>exp scott/tiger@orcl tables=(emp) QUERY='"WHERE deptno > 10 and sal !=2850"' LOG=log011.log FILE=exp.dmp
    Export: Release 10.2.0.1.0 - Production on Wed Jan 30 10:01:27 2013
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    . . exporting table EMP 10 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    Export terminated successfully with warnings.
    But When I run with The following condition then it shows the following error...
    C:\Documents and Settings\ITL>exp scott/tiger@orcl tables=(emp) QUERY='"WHERE deptno > 10 and job!='CLERK' "' LOG=log011.log FILE=Exp01.dmp
    LRM-00111: no closing quote for value ' LOG=log01'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    EXP-00000: Export terminated unsuccessfully
    C:\Documents and Settings\ITL>exp scott/tiger@orcl tables=(emp) QUERY="WHERE deptno > 10 and job!='CLERK'" LOG=log5.log FILE=exp01.dmp
    LRM-00112: multiple values not allowed for parameter 'query'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    EXP-00000: Export terminated unsuccessfully
    Please suggest a solution for it.

    966523 wrote:
    Padma.... wrote:
    Hi,
    The single quotes used for CLERK are causing the issue most probably.
    C:\Documents and Settings\ITL>exp scott/tiger@orcl tables=(emp) QUERY='"WHERE deptno > 10 and job!='CLERK' "' LOG=log011.log FILE=Exp01.dmp
    try replacing with this
    C:\Documents and Settings\ITL>exp scott/tiger@orcl tables=(emp) QUERY='"WHERE deptno > 10 and job!=''CLERK'' "' LOG=log011.log FILE=Exp01.dmp
    Two single quotes(not double quotes) in the place of one single quote for CLERK.
    Thanks
    Padma...Thanks A Lot...if/when you place all inside control file, then you do not have to worry about such complications

  • ORACLE 8I EXPORT의 QUERY OPTION 기능

    제품 : ORACLE SERVER
    작성날짜 : 2000-09-19
    Oracle 8i EXPORT의 Query Option 기능
    ====================================
    Oracle 8i에서는 export 작업 수행 시 Query Option을 이용하여 테이블의
    부분적인 추출이 가능하다.
    SQL> select empno, ename, job, sal from emp order by job;
    EMPNO ENAME JOB SAL
    7788 SCOTT ANALYST 3000
    7902 FORD ANALYST 3000
    9999 홍길동 ANALYST 2000
    7369 SMITH CLERK 800
    7876 ADAMS CLERK 1100
    7934 MILLER CLERK 1300
    7900 JAMES CLERK 950
    7566 JONES MANAGER 2975
    7782 CLARK MANAGER 2450
    7698 BLAKE MANAGER 2850
    7839 KING PRESIDENT 5000
    7499 ALLEN SALESMAN 1600
    7654 MARTIN SALESMAN 1250
    7844 TURNER SALESMAN 1500
    7521 WARD SALESMAN 1250
    위와 같이 구성된 EMP 테이블에서 만일 'MANAGER'로 JOB을 가진 사원중 SAL
    컬럼이 2500이상인 레코드를 export하고 싶다면, 다음과 같이 수행하면 된다.
    % exp scott/tiger tables=emp query=\"where job=\'MANAGER\' and sal\>=2500\"
    Export: Release 8.1.5.0.1 - Production on Tue Sep 19 16:14:15 2000
    About to export specified tables via Conventional Path ...
    . . exporting table EMP 2 rows
    exported
    Export terminated successfully without warnings.
    한글 컬럼에 대해서도 동일한 where 조건에 지정이 가능하다.
    % exp scott/tiger tables=emp query=\"where ename like \'홍%\'\"
    V8.1.5 버젼에서 제공되는 Query 옵션의 특징:
    1. 테이블 레벨의 export 명령어에서만 가능하다.
    2. Direct 옵션과 함께 사용될 수 없다.
    3. Nested 테이블을 갖는 테이블에는 적용할 수 없다.
    4. Partition 테이블에 대한 export에도 적용가능하다.
    5. Import 명령에는 적용되지 않는다.

    Thanks Guys,
    I am still a bit lost though...
    It may be simply a matter of me finding Oracle 8i so I can do what I need to do.
    Where can I get Orcale 8i from? Does anybody have it? The oracle site only has a version back to 9.2 I queried with a employee from Oracle University here in Australia, and he suggested asking in the forums.
    Just so you know what I'm trying to do:
    Data Server:
    Running Aix with Oracle 7.14... actually could be 7.41 - I'll check today.
    This system will not be upgraded to any later version of Orcale, because systems are in place, and core systems at our other sites have to be the same. (my project is a local one)
    Web Server:
    Running XP profession with IIS and using ASP (active server pages)
    Currently running Oracle 10g, and ASP code connects to the local database on this machine via an ODBC connection.
    At the moment, I have scripts on the Aix server that dumps data from Oracle 7.x into a .csv file.
    Then, I have scripts that copy those csv files to the XP server, and they are imported to the local Oracle 10g database.
    To display this data on the website, I use ASP via the odbc connection to query the local database on the XP server.
    As said in my previous post, there must be an easier way to do this.
    I need a local database on the XP server too, and am thinking the best way is to downgrade to 8i.
    Can anybody tell me where I can get 8i to try this out? I have been trying to reasearch this for a while now without luck. Any help would be appreciated, and thanks for those who have replied so far.
    -Tom

  • Use of QUERY option in 9iRel2 Export utility

    Hi All,
    Is it possible to use a query option to the export utility of the form below assuming I am exporting a table called test1:
    query="(test1.col1,test1/col2) not in (select test2.col1,test2.col2 from test2)"
    I am not sure if it is allowed to reference another table in the query clause, test2 in the example above....?
    Thanks

    I don't have a 9iR2 environment with me right now but this works on 10gR2. And I have no reason to believe that it would not work in 9iR2.
    SQL> select * from a;
            ID
             1
             2
    SQL> select * from b;
            ID
             2
    SQL> $
    Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.
    C:\>exp sysadm/itbagain@qo810 tables=(A) query='where id not in (select id from b)'
    Export: Release 10.2.0.4.0 - Production on Wed Sep 8 14:17:49 2010
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Release 10.2.0.4.0 - Production
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    . . exporting table                              A          1 rows exported
    Export terminated successfully without warnings.
    C:\>

  • EXPORT 시 QUERY OPTION에 대한 사용 예(ORACLE 8I 이상)

    제품 : ORACLE SERVER
    작성날짜 : 2004-03-17
    EXPORT 시 QUERY OPTION에 대한 사용 예(ORACLE 8I 이상)
    ============================================
    PURPOSE
    ============
    oracle 8i에서 export 시 query option에 대한 사용 예
    8i에서 export의 query syntax 를 이용하여 table data의 한 부분만 exporting 이 가능
    - 8i 에서 select 문장의 where 절을 사용하는 것처럼 export 시에 부분적으로 table data 를 받아 낼수 있는 기능을 소개 한다.
    - Direct 옵션은 사용될 수 없다..
    - where 절에 해당하는 export utility는 query parameter 를 사용한다.
    UNIX syntax:
    - Example:
    1.SCOTT.Emp table의 ename 이 JAME과 비슷한 이름의 data 를 export ..
    exp scott/tiger query=\"where ename like \'JAME%\'\" tables=emp file=exp.dmp log=exp.log
    2. employee와 cust table에서 new york 주의 data 만 export ..
    exp scott/tiger query=\"where st=\'NY\'\" tables=(employee,cust) file=exp.dmp log=exp.log
    query 문장에서 UNIX reserved characters( ", ', ,< .. 등) 를 사용하는 경우에는 escape ('\') 을 반드시 사용해야 한다.
    예)query=\"where JOB = \'SALESMAN\' and salary \< 1600\"
    더 중요한 것은 command line에서 export option을 사용할때는 반드시 escape 이 있어야 하나
    parfile을 사용할때는 eacape이 불필요하다.
    예를 보면 .. p라는 이름의 file을 다음과 같이 생성
    tables=emp query="where job='SALESMAN'"
    parfile을 이용해서 export 를 실행해 보면
    [rmtdchp6]/apac/rdbms/64bit/app/oracle/product/9.2.0> exp scott/tiger parfile=p
    Export: Release 9.2.0.4.0 - Production on Wed Mar 17 00:12:34 2004
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.4.0 - Production
    Export done in US7ASCII character set and AL16UTF16 NCHAR character set
    server uses KO16KSC5601 character set (possible charset conversion)
    About to export specified tables via Conventional Path ...
    . . exporting table EMP 4 rows exported
    와 같이 정상 처리 됨을 알수 있다.
    만일 command line에서 위의 내용을 실행하게 되면 다음과 같이 error 를 만난다.
    exp scott/tiger tables=emp query="where job='SALESMAN'"
    LRM-00101: unknown parameter name 'job'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    EXP-00000: Export terminated unsuccessfully
    command line에는 query 내에 single(')나 double quotes(") 를 사용한다면 반드시 double quotes(") 를 사용하여
    query 문을 묶어야 한다.그러나 query 내에서 single ('')나 double quotes(") 를 사용하지 않는다면 single quotes (')을 사용하여
    query 문을 수행할 수도 있다..
    다음 예를 보면..
    1>exp scott/tiger tables=emp query=\'where deptno=20\'
    Export: Release 9.2.0.4.0 - Production on Wed Mar 17 00:22:00 2004
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.4.0 - Production
    Export done in US7ASCII character set and AL16UTF16 NCHAR character set
    server uses KO16KSC5601 character set (possible charset conversion)
    About to export specified tables via Conventional Path ...
    . . exporting table EMP 4 rows exported
    2>exp scott/tiger tables=emp query=\'where job=\'SALESMAN\'\'
    LRM-00112: multiple values not allowed for parameter 'query'
    EXP-00019: failed to process parameters, type 'EXP HELP=Y' for help
    EXP-00000: Export terminated unsuccessfully
    즉.. 정리를 하자면
    command line에서 query 내에 '," 을사용하지 않는 다면 '나 " 으로 query option을 사용할수 있다
    query=\'where deptno = 20\'
    query=\"where deptno = 20\"
    query=\'where deptno \< 2\'
    (이 경우 single 이나 double quotes 을 둘다 사용할수 있다.)
    parfile을 사용하는 경우에는 다음과 같이 단순하게 사용이 가능하다.
    query='where deptno = 20'
    query="where deptno = 20"
    query='where deptno < 20'
    WINDOWS NT / 2000 와 NETWARE syntax:
    다음의 자료를 참조바란다.
    Example:
    EXP demo/demo tables=emp file=exp1.dmp query="""where deptno>30"""
    double quotes(") 를 둘러 싸는 경우에는 space 가있으면 안된다.
    parfile의 사용은 다음과 같이 하시면 됩니다.
    file=exp66.dmp
    query="where deptno > 20"
    tables=(emp)
    log=log66.txt
    userid=scott/tiger
    Explanation
    Windows NT or Win2000의 경우 command line에서는 3 double quotes 이 필요하고
    'PARFILE 을 사용하는 경우에는 double quotes(") 한번만 필요함
    Reference Documents
    Oracle8i Utilities guide
    Note:91864.1

  • "An error occurred while attempting to load this plug-in."  I donloaded the Nik Collection, but when I try "export with preset" the only preset as an option is HDR Efex Pro 2.  The other plug ins appear in my applications folder, but I get the error messa

    I downloaded the Nik Collection, but when I try "export with preset" the only preset as an option is HDR Efex Pro 2.  The other plug ins appear in my applications folder, but I get the error message at the start of this post...I can us, say, Silver Efex stand alone, but I want to use as a plug in...can anyone help please..?

    Hi,
    Follow these instructions: Accessing the plug-ins from host applications - Nik Collection Help

  • How to hide/disable option "Export In Query Ready Mode" in HTML FR reports (workspace)version 11.1.1.3

    Hi all,
    is there a way to hide or disable the option "Export In Query Ready Mode" for HTML FR reports (workspace) version 11.1.1.3.
    Thanks in advance!
    Regards
    Tej.

    Hi Tej,
    The feature, "to hide or disable the option "Export In Query Ready Mode"  has been introduced in Financial Reporting 11.1.2.3.
        Logon to EPM Workspace.
        Open menu File > Preferences > Financial Reporting.
        The new option, called "Disabled" is available for Query Ready Mode. If selected will disable Query Ready mode completely.
    Thanks,
    Krish

  • How to hide/disable option "Export In Query Ready Mode" in HTML FR reports

    Hi all,
    is there a way to hide or disable the option "Export In Query Ready Mode" for HTML FR reports?
    Thanks in advance!
    Regards
    André

    Yes, it is a cool feature but I didnt ask for it :-) Besides it doesnt work completely without errors/warnings:
    If i click on the link and then on open (save xls works fine) an error message occurs: "Could not open 'http://<servername>/hr/hrget/modules/com/hyperion/reporting/web/office/HROfficeReport.jsp/test.xls?gridname=grid1&iInstanceId=18885&format=excel.2002&viewAs=query&previewDone=true&promptDone=true'"
    After click on OK another error message occurs:
    "Microsoft Excel cannot access the file 'http://<servername>/hr/hrget/modules/com/hyperion/reporting/web/office/HROfficeReport.jsp/test.xls?gridname=grid1&iInstanceId=18885&format=excel.2002&viewAs=query&previewDone=true&promptDone=true'. There are several possible reasons:
    The file name or path does not exist.
    The file is being used by another program.
    The workbook you are trying to save has the same name as a currently open workbook.
    After click on OK the XLS export opens correctly but the messages are annoying. Perhaps anybody can help me ;-)
    Thanks and kind regards
    Andre

  • FR 11.1.1.3 "export to query ready mode" option not working

    Hi All,
    We have a scenario where few users are not able to use the "export to query ready mode" option after running an FR report.
    For some reason the save dialog box doesnt open or doesnt pop up when this option is ticked.
    Note that this issue comes only on running FR Essbase reports. (for FR HFM reports it works fine)
    Does any body have any resolution to this.
    Kindly advise.

    Hi,
    Can anybody explain me the option of this *"Export in Query ready mode"*???
    Is there any document through which I can understand???
    Thanks
    Sourabh
    Edited by: CM on May 11, 2011 6:32 AM

Maybe you are looking for

  • BW Performance & troubleshooting role

    Dear SDN! I would like to know is it advisable for an rather inexperienced certified BW person to be deployed solo to a major customer who needs someone experienced to look into the cause of the BW performance and other problems experienced by users

  • Airport Help

    Hello, im planing on getting a new mac pro. I would like to connect my current (PM G5) and the new computer wirelessly. How would i connect my power mac g5 to wireless internet and printing if it doesn't have an airport card?

  • Blackberry Messenger e-mail confirmati​on?

    I recieved an e-mail (to both of my e-mail addresses) from Blackberry last night, this is what it read: "Hello, Thank you for using BlackBerry Messenger. To help prevent unauthorized use of this email address, we need to confirm its ownership. Please

  • How to correct errors at install CS5

    At the end of install of CS5 I got following error Exit Code: 6 Please see specific errors and warnings below for troubleshooting. For example,  ERROR: DS003, DW050 ... WARNING: DW017, DW066 ... Dans common file I found: Adobe® Application Manager® S

  • How to send ProRes FCP footage to iDVD and get a quality result

    Hello, I am editing on FCP5, for which I used a USB to transfer my ProRes footage. I want to use one of the themes in iDVD as a menu page for my final project, and understand that to do this I will have to export my FCP footage via QuickTime. I am wo