Execute exp&imp command by store procedure

Dear all,
I have some statements to run before and after exp&impdata.
Is there anyway to execute exp&imp command in store procedure,Pls show me.
example
CREATE OR REPLACE PROCEDURE test
BEGIN
update ....
exp user/passwd ....
delete ...
END ;
Oracle 10g on solaris10
Thank you for advance
Chara

Hi,
Since you are working with Oracle10gm you may check DBMS_DATAPUMP:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_datpmp.htm
Or like any shell command, you can use java programs.
Saad,
http://saadnayef.blogspot.com

Similar Messages

  • Execute Unix Mail Command from Store Procedure

    Hi Colleagues!
    I designed a store procedure that Monitoring some Critical tables in my Oracle 8.0.6.1.0 Database But I need to send some Emails from the Store Procedures to Information System Staff when the amount of rows increase too much. I read about UTL_SMTP but my database version is too old to run this package. Also I have the option of Maildemo8i that execute MS Oulook from a Client System But I looking to Send it from my Database(OS HPUX). So please take a look of this issue and I will appreciate any help.
    Your Friend.
    Emmanuel Carrillo Trejos.
    LNB, Republic of Panama(Central America).
    P.D. You can email to: [email protected]

    Do you mean that you want to execute mail or mailx unix commands to send mails.If i am right then probably you are looking for a way to execute operating system commands from your procedure.
    You can refer this link if you want to do that. You need java support in your Oracle database and i believe that Oracle 8 does have jvm running in the instance.
    http://asktom.oracle.com/pls/ask/f?p=4950:8:5079825575573830264::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:952229840241
    Thank you!

  • Export / import  exp / imp commands Oracle 10gXE on Ubuntu

    I have Oracle 10gXE installed on Linux 2.6.32-28-generic #55-Ubuntu, and I need soe help on how to export / import the base with exp / imp commands. The commands seems to be installed on */usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin* directory but I cannot execute them.
    The error message I got =
    No command 'exp' found, did you mean:
    Command 'xep' from package 'pvm-examples' (universe)
    Command 'ex' from package 'vim' (main)
    Command 'ex' from package 'nvi' (universe)
    Command 'ex' from package 'vim-nox' (universe)
    Command 'ex' from package 'vim-gnome' (main)
    Command 'ex' from package 'vim-tiny' (main)
    Command 'ex' from package 'vim-gtk' (universe)
    Command 'axp' from package 'axp' (universe)
    Command 'expr' from package 'coreutils' (main)
    Command 'expn' from package 'sendmail-base' (universe)
    Command 'epp' from package 'e16' (universe)
    exp: command not found
    Is there something I have to do ?

    Hi,
    You have not set environment variables correctly.
    http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25144/toc.htm#BABDGCHH
    And of course that sciprt have small hickup, so see
    http://ubuntuforums.org/showpost.php?p=7838671&postcount=4
    Regards,
    Jari

  • How to execute Operating System commands from Stored procedure.

    Any help on how to execute Operating System commands from stored procedures will be appreciated.
    Nanditha.

    Search the forums for 'External Procedure' and you will find example code that has been posted before.

  • How to execute EXP backup command of Oracle from JSP

    hi frens !!!
    i want a method by which i can call an EXP command of oracle in JSP.
    thanks and regards
    Allwyn

    No, you don't want that. Your JSP should not know that there is such a thing as a database.

  • PL/SQL: how to execute host-/system command without ext. procedure call

    Hello,
    I would like to execute a systemcall out of a PL/SQL-package (e.g. execute a shell script). Seems like that this is just possible with a external procedure call.
    Are there any other solutions available?
    Rgds
    JH

    With 10g you can use DBMS_SCHEDULER: see Re: Guide to External Jobs on 10g with dbms_scheduler e.g. scripts,batch fi

  • How to execute unix command from ODI Procedure

    Hi,
    I am trying to execute below unix command from ODI Procedure (Command on Target tab) but I am getting the error "java.io.IOException: Cannot run program "cd": error=2, No such file or directory" but when I try to execute the same command using OdiOSCommand, it is executing successfully. I don't want to use shell script to execute this command. Is there any specific syntax am I missing to execute this command from ODI procedure?
    cd /project3/tmt/;ls *.dmp > dmplist.lst
    Please help me on this...
    Thanks
    MT

    Hi nahlikh,
    Thank you for the reply.
    I used below command in Procedure but still getting the same error as "java.io.IOException: Cannot run program "OdiOSCommand": error=2, No such file or directory".
    OdiOSCommand "-COMMAND=cd /project3/tmt/;ls *.dmp > dmplist.lst"
    as I mentioned earlier if I use the command cd /project3/tmt/;ls *.dmp > dmplist.lst in OdiOSCommand tool it is executing successfully without any issues.
    any thoughts appreciated to get a solution for this issue.
    Thanks
    MT

  • Executing OS command from sql procedure

    i want to execute an OS command from the procedure, can i do this way? looks like it is not executing the command move....
    declare
    begin
    dbms_output.put_line(' moving...');
    host;
    move c:\file1\test.txt C:\moved
    exit;
    /

    True. But that job is going to run in a separate session, some time after the current transaction commits (depending on the number of jobs queued up to run). So if you need to pass information back from the job, or you want the procedure to handle exceptions thrown by the job, or you want to tie job related failures back to a particular application level event, or you want the rest of your procedure to wait for the operating system command to finish, using the DBMS_SCHEDULER for this sort of thing is going to require a fair amount of additional coordination/ monitoring/ infrastructure code. It's certainly not a Herculean task to write that additional code, and it's reasonable in some situations, but the Java stored procedure approach strikes me as substantially easier to deal with in most cases.
    Justin

  • Imp command

    i want to import a dmp file which contains 3 tables to a user named "test", i opened a cmd window and i wrote “imp” then i specified the file path, but when i connect to that user i can not find the tables that were exported in the dmp file although at the cmd window there were not any error or warning while executing the imp command, any help??

    Is the import log file contents generated ...as expected...???
    I mean specific export file imported to specific db user... according to the log file....????
    Are there any errors....????
    Sim

  • Exp/Imp In Oracle 10g client

    Hi All,
    I want to take one schema export from Oracle 10g Client. I am in new Oracle 10g.
    In oracle 9i, we can using exp/imp command for Export and Import from Client itself.
    I heard about in Oracle 10g, we can use Expdb/Impdb in Server only. Is there any possibility to take exp/imp in Client also.
    Pls help me...
    Cheers,
    Moorthy.GS

    To add up to expdb from oracle client
    NETWORK_LINK
    Default: none
    Purpose
    Enables an export from a (source) database identified by a valid database link. The data from the source database instance is written to a dump file set on the connected database instance.
    Syntax and Description
    NETWORK_LINK=source_database_link
    The NETWORK_LINK parameter initiates an export using a database link. This means that the system to which the expdp client is connected contacts the source database referenced by the source_database_link, retrieves data from it, and writes the data to a dump file set back on the connected system.
    The source_database_link provided must be the name of a database link to an available database. If the database on that instance does not already have a database link, you or your DBA must create one. For more information about the CREATE DATABASE LINK statement, see Oracle Database SQL Reference.
    If the source database is read-only, then the user on the source database must have a locally managed tablespace assigned as the default temporary tablespace. Otherwise, the job will fail. For further details about this, see the information about creating locally managed temporary tablespaces in the Oracle Database Administrator's Guide.
    Restrictions
    When the NETWORK_LINK parameter is used in conjunction with the TABLES parameter, only whole tables can be exported (not partitions of tables).
    The only types of database links supported by Data Pump Export are: public, fixed-user, and connected-user. Current-user database links are not supported.
    Example
    The following is an example of using the NETWORK_LINK parameter. The source_database_link would be replaced with the name of a valid database link that must already exist.
    expdp hr/hr DIRECTORY=dpump_dir1 NETWORK_LINK=source_database_linkDUMPFILE=network_export.dmp LOGFILE=network_export.log

  • How to execute Linux OS command  from ODI

    We have installed Oracle data integrator on windows machine and want to execute linux OS command in a procedure or scenario from ODI .
    How could i do that ?
    I can see os command elements but they do not work, only windows commands work.There should be linux technology i think

    Obviously you can execute Unix OS commands only on Unix OS. Why do you expect Windows to understand it?
    The solution in your case would be executing your ODI scenarios with an Agent installed on Unix machine.
    Cheers

  • HOW TO EXECUTE A STORE PROCEDURE THAT RETURN MULTIPLE ROWS FROM A QUERY

    I NEED TO CREATE AND USE A STORE PROCEDURE THAT IS GOING TO DO A SELECT STATEMENT AN THE RESULT OF THE SELECT STATEMENT IS RETURN IN SOME WAY TO THE REQUESTER.
    THIS CALL IS MADE BY AN EXTERNAL LANGUAGE, NOT PL/SQL OR FORMS APPLICATION. USING FOR EXAMPLE ODBC AND VISUAL BASIC. WHAT I NEED TO DO IS ADD A DATA ACCESS LAYER TO MY APPLICATION AND I ALREADY HAVE IT DONE FOR MS SQL SERVER, BUT I NEED THE SAME FUNCTIONALITY ACCESSING AN ORACLE DATABASE.
    FLOW:
    1. VB CREATE A ODBC CONNECTION TO A ORACLE DATABASE
    2. VB EXECUTE A STORE PROCEDURE
    3. THE STORE PROCEDURE RETURNS TO THE VB APPLICATION THE RESULT OF THE QUERY THAT IS INSIDE OF THE STORE PROCEDURE.(I.E. THE STORE PROCEDURE IS A BASIC SELECT, NOTHING COMPLEX)
    4. VB DISPLAY THE RESULT IN A GRID
    FOR SURE I CAN DO THE SELECT DIRECTLY TO ORACLE, BUT FOR PERFORMANCE REASONS AND SCALABILITY, I'LL LIKE IT TO DO IT USING A STORE PROCUDURES
    IS THIS POSIBLE?, HOW?
    THANKS

    Certainly, it's possible. First, define a stored procedure that includes an OUT parameter which is a REF CURSOR. Then, call the stored procedure via ODBC omitting the OUT parameter from the list of parameters. IT will automatically be returned as a result set. Syntax for both is below...
    CREATE PROCEDURE foo (inParam in varchar2, resultSet OUT REF CURSOR )
    In ODBC:
    {call foo( 'someData' )}
    Justin

  • Execute store procedure( in Id, in out RefCursor), and data fetched in ref cursor should be sent out as excel sheet.

    I am trying to make a ssis package that get the data calling the store proc with two param one is ID and other is Sys_refcursor. Say Store Proc as ListName(Id int, myCur sys_refcursor), which gets the datas with the conditions inside it.
    REATE OR REPLACE PROCEDURE schemaName.LISTNAME (P_ID  IN INT, LST_NAME_REFCUR   IN OUT SYS_REFCURSOR)
    IS
    P_NAMESOURCE_ID INT;
    BEGIN
        SELECT SOURCE_ID INTO P_NAMESOURCE_ID FROM SEARCHING_TABLE ST WHERE ST.ID = P_ID;           
                   IF (P_NAMESOURCE_ID=1)
                   THEN
                      OPEN LST_SOURCE_REFCUR FOR 
                            SELECT ST.ID,
                                   ST.TRANSACTION_DATE AS TRAN_DATE,
              IF (P_NAMESOURCE_ID=1)
                   THEN 
                      OPEN LST_SOURCE_REFCUR FOR             ....     
    then i need to get the data from that refcursor and fetch those data to excel sheet to a virtual directory.
    Any help would be appreciated. I am new to SSIS. and i need to do this assignment this friday. 

    Hi 11srk,
    To fetch data from Oracle store procedure, you can use a Script Component as source to call the Oracle stored procedure by using System.Data.OracleClient OracleDataReader, and get the rows and add them to the pipeline buffer. For more information, please
    see:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/1d0b3a1b-8792-469c-b0d1-f2fbb9e9ff20/dump-oracle-ref-cursor-into-ms-sql-staging-table-using-ssis
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/fcdaa97e-8415-4c3e-8ffd-1ad45b590d57/executing-an-oracle-stored-procedure-from-ssis?forum=sqlintegrationservices
    http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracledatareader(VS.90).aspx  
    Regards,
    Mike Yin
    TechNet Community Support

  • Executing operating system command within trigger or procedure

    Hello
    Can some one help me out as how to execute operating system command (unix or windows ex.. stop,start,cc,del or copy etc...) in a trigger or procedure.
    My requirement is, if some predefined error occure then listener listener should be stopped automatically.
    Thanks in advance
    kvss

    Here is some code to tell you how to do:
    First a small Java program that taker a string as a parameter and executes it as an os-command
    import java.lang.Runtime;
    import java.lang.Process;
    public class Commands extends Object {
    * Constructor
    public Commands() {
    // On NT the command should be like this "cmd /c del c:\temp\readme.txt"
    // exec execute('cmd /c del c:\temp\readme.txt');
    public static void execute (String cmd ) {
    try {
    Process p = Runtime.getRuntime().exec(cmd);
    try {
    p.waitFor();
    catch (java.lang.InterruptedException intex ) {
    intex.printStackTrace();
    System.out.println("Return = "+ p.exitValue());
    System.out.println(" Done ...");
    catch ( java.io.IOException iox) {
    iox.printStackTrace();
    ===================end of java ====
    Use loadjava to load it into the database and create a pl/sql wrapper around the java code.
    See the manual about loadjava details.
    Log in to sqlplus as SYSTEM and create a role for this purpose e.g. 'JAVA_ROLE'
    and exec the following as SYSTEM or SYS to make sure the user has the the needed privs.
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.io.FilePermission','<<ALL FILES>>','read,write,execute,delete');
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.lang.RuntimePermission','writeFileDescriptor',null);
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.lang.RuntimePermission','readFileDescriptor',null);
    and you're done.

  • Execute EXP command in SQL or PL/SQL window

    Hi,
    Sorry
    Regards
    Sanjit
    Edited by: userSanjit on Jun 2, 2009 2:47 PM

    You cannot use exp or imp commands from PL/SQL.
    Why don't you use [DATA Pump|http://www.oracle-base.com/articles/10g/OracleDataPump10g.php]? If you are using 10g then you can easily incorporated that in your environment.
    Regards.
    Satyaki De.

Maybe you are looking for

  • Regarding the SAP big tables in ECC 6.0

    Hi, We are having SAP ECC 6.0 running on Oracle 10.2g database. Please can anyone of you give fine details on the big tables as below. What are they? Where are they being used? Do they need to be so big? Can we clean them up? Table          Size TST0

  • Workflow Definition For SUS Invoice BUS2234

    Hello Guys: One quick question, is it possible to create a WF for the invoice which is created by the Supplier?? I mean for the BUS2234 Object. I have been looking trough the SAP Workflow configuration and there is no standard WF for this document. T

  • Incorporating a Wordpress Blog into iWeb

    Hi, I'm aware of using an iFrame + code which I've tried. However iWeb has quite a narrow layout and cannot show all of the Wordpress page. So I'm wondering if others have encounted this. Is it a matter of choosing the right Wordpress theme (currentl

  • Stupid airport... please help me

    Ok so my internet connection *****, ten fold. I'm so frustrated by how low and crappy it is I'm ready to throw my MacBook across the room. My roommate gets excellent internet connection and my boyfriend gets pretty good internet, and all three of us

  • HT1296 SMS messages are stored where?

    Just synced my iphone 4S to ITunes for the first time. Wondering if all of my SMS have also backed up and if so, where/how are they stored. Any assistance appreciated.