How to run multiple parallel sql scripts?

I try to execute multiple sql scripts parallel to the short run of the process via sqlplus. Are there opportunities to do? LINUX ORACLE 5. XX

I do it too via Scheduler, but now I need to do this via sqlplus or shell + sqlplus?

How do I start using shell script several xterminals and ech session begins all the sql scripts?

nohup./SQL1.sh &

nohup./sql2.sh &

nohup./SQL3.sh &

The '&' causes the script1.sh to run in the background so that the command prompt is returned immediately.  This means that sql2.sh can start immediately and at the same time as sql1.sh.  It doesn't have to wait for sql1.sh.   This assumes that there are no dependencies between scripts!  This meets your need to run scripts in parallel.

The nohup untie your shell script.  So, even if you disconnect, the script continues to run.  Without the nohup, if you were to close your session before the end of the scripts running, they would get fired.

Hemant K Collette

Tags: Database

Similar Questions

  • How to run multiple sql statements

    Hi all

    I wonder if I can run multiple sql statements in one shot with > >, immediate run

    for example:

    I set the variable as X: = sql statement
    Y: = sql statement
    z: = sql statement

    can I execute immediate (X, Y, Z);

    If yes how? and if not what other possible

    Thank you

    Beginning with the codes of Ganesh

    DECLARE
       l_statement                 VARCHAR2 (2000);
       v_passwd                    VARCHAR2 (200);
       v_username                  VARCHAR2 (200) := 'test';
       v_pwd_key                   VARCHAR2 (200) := 'lwty23';
       v_dblink_name               VARCHAR2 (2000);
       v_dblink_drop               VARCHAR2 (2000);
       v_dblink_create             VARCHAR2 (2000);
       v_dblink_check_connection   VARCHAR2 (2000);
       l_number                    NUMBER;
    BEGIN
       --<>
       FOR c_instance IN (SELECT *
                            FROM v_oracle_instances
                           WHERE environment = 'Developement')
       LOOP
          SELECT encpwd_owner.display_db_encpwd (v_username,
                                                 c_instance.host_name,
                                                 c_instance.instance_name,
                                                 v_pwd_key)
            INTO v_passwd
            FROM DUAL;
    
          v_dblink_name := c_instance.host_name || '_' || c_instance.instance_name;
          v_dblink_create :=
                ' CREATE DATABASE LINK '
             || v_dblink_name
             || ' CONNECT TO '
             || v_username
             || ' '
             || 'IDENTIFIED BY '
             || v_passwd
             || ' USING'
             || ' ''(DESCRIPTION=
    (ADDRESS=(PROTOCOL=TCP)(HOST= '
             || c_instance.host_name
             || ')(PORT='
             || c_instance.LISTENER_PORT
             || '))(CONNECT_DATA=(SID='
             || c_instance.instance_name
             || ')))''';
          v_dblink_check_connection := 'select 1 from global_name@' || v_dblink_name || '.QCM';    --- Notice this change. I am simply selecting 1. That should be enough to test the database link.
          v_dblink_drop := 'drop database link ' || v_dblink_name || '.QCMTLAF';
    
          -- l_statement := 'BEGIN ' || v_dblink_create ';' || v_dblink_check_connection ';' || v_dblink_drop '; END ;'
    
          BEGIN
              EXECUTE IMMEDIATE (v_dblink_create);
              DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Created');
         EXCEPTION
            WHEN others THEN
               dbms_output.put_line( 'Failed to create the database link ' || v_dblink_name  );
               dbms_output.put_line( dbms_utility.format_error_backtrace() );
               INSERT INTO error_table( column_list )
                 VALUES( <> );
         END;
    
          EXECUTE IMMEDIATE (v_dblink_check_connection) INTO l_number;    --- Notice this.
    
          DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Tested');
    
          BEGIN
             EXECUTE IMMEDIATE (v_dblink_drop);
             DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Dropped');
          EXCEPTION
             WHEN others THEN
               dbms_output.put_line( 'Failed to drop the database link ' || v_dblink_name  );
               dbms_output.put_line( dbms_utility.format_error_backtrace() );
               INSERT INTO error_table( column_list )
                 VALUES( <> );
         END;
       END LOOP;
    END;
    

    But I agree with the comment that others have grown up is not really wise to create and drop a database like that link.

    Justin

  • How to break in a SQL script.

    I'm using Oracle 11 g. I run a sql script called Queries.sql. The script has a lot of create and insert. I want to put a few delays in the execution of the script (e.g. delays 5 seconds) for that I can watch the output because the script is run. How to do this?

    Hello

    EXEC  dbms_lock.sleep (5);
    

    goes into pause for 5 seconds. You don't have any EXECUTE privileges on dbms_lock; Otherwise, log in as SYS and grant them or ask your DBA to grant them for you.

    Another thing to do is the SQL * Plus command:

    ACCEPT  dmy  PROMPT "Press [Enter] to continue ..."
    

    who waits indefinitely as the user presses the key [Enter] before continuing.

    Published by: Frank Kulash, April 26, 2011 19:59

  • run in parallel sql statement block

    Hello
    I'm looking for a way to run 2 blocks from the sql statement at the same time in sqlplus

    Block1
    drop table CTSGLOB_TABLE;
    create the table CTSGLOB_TABLE select * from CTSGLOB_VIEW;
    create index TEMPS_CTSGLOB_IDX ON CTSGLOB_TABLE("TEMPS");
    create index ORGA_CTSGLOB_IDX ON CTSGLOB_TABLE("ORGA");
    create index RUBSRH_CTSGLOB_IDX ON CTSGLOB_TABLE("RUBSRH");

    Block2
    drop table CTSGLOB_TABLE_2;
    create the table CTSGLOB_TABLE_2 select * from CTSGLOB_VIEW_2;
    create index TEMPS_CTSGLOB_IDX_2 ON CTSGLOB_TABLE_2("TEMPS");
    create index ORGA_CTSGLOB_IDX_2 ON CTSGLOB_TABLE_2("ORGA");
    create index RUBSRH_CTSGLOB_IDX_2 ON CTSGLOB_TABLE_2("RUBSRH");

    I know that I can open 2 client session to run, but I would like to know another way.

    Best regards
    Jean-Marc

    Well, that depends on what you mean exactly when you say "run 2 blocks from the sql statement at the same time in sqlplus '...
    You can also copy all statements in a sql script and run that, just.
    If this isn't what you want, then please explain why.

  • How to run multiple copies of distilling on the same machine?

    What version of Adobe PDF Converter do I need to run multiple copies of distilling on the same machine?

    I see that Distiller Server is EOL so what should I use to accomplish the same task.

    Hi mmaraffi,

    You will not be able to run multiple copies of Distiller, because this is a violation of the EULA.

    Let me know the version of Acrobat is installed on your computer?

    Kind regards

    Nicos

  • How to run the application startup script before the start of telnet (inetd)

    Hello

    I need to run my application startup script before the beginning of Telnet users on the server. At the present time, the script is at /etc/rc2.d/S98startup which is not useful.

    Thanks in advance...

    Published by: user4027740 on April 7, 2012 12:41

    I am inclined to ask 'why', but I refrain...

    The problem you'll have is that 'telnet' (really inetd) will be started by SMF and your app startup is a legacy script. I don't know of anyway to you allows to map addictive SMF one departure inherited. The only solution is to write a start of SMF for your application and do inetd:default require your application to be online before you start.

  • How to run multiple Powershell scripts in PowerCLI

    I have a large number of scripts that I would run into lots of PowerCLI. I found a way to call some Powershell scripts from a file of commands like the following (with the permission of Jan Egil Ring), which works very well except for scripts PowerCLI where a connection to a VC or ESX Server must be established before the script can be executed:

    PowerShell-command '& C:\MyScripts\script1.ps1 '.

    PowerShell-command '& C:\MyScripts\script2.ps1 '.

    PowerShell-command '& C:\MyScripts\script3.ps1 '.

    If a VC connection is on using Connect-VIServer PowerCLI, then scripts can each be run from the prompt without connection information and credentials, however, if scripts are placed in a file of DOS commands, it is necessary to place an order Connect-VIServer in each script, which will prompt you for credentials every time , so if I have 10 scripts, I will have to enter the credentials of 10 times. Is it possible to establish the connection and then run a set of Powershell scripts, or is there a way to integrate the identification information in the script so that it will connect to the VI server without asking confirmation?

    Thank you

    Ed Z

    2 options 1 persist credentials on disk, you can find the code on poshcode.org to do.

    Option 2 is to use - Session when using Connect-VIServer. The session is stored in the variable $defaultVIServer. If write you it to a file you can load this file and re-use this same session, assuming that it is still valid (i.e. it has not expired.)

  • How to run the PL SQL function on click of a button

    Hello

    I have problem with run SQL PS function on click of a button. I have create a new button and call the function STANJA.insert_into_log_fun1('cc'); "Value of the button application", a Type of Source select button request = 'SQL PL Expression or function.
    Problem is that this function is executed at the loading of the page, but not to the click. I don't want to perform this function on loading the page, only when I click the button.

    Does anyone have idea how can I solve this problem?
    Thank you very much.

    Alter this process > status > when you press the button > choose the button you want the pcoss to run on.

    RAL

  • Run the PL/SQL Script

    I am trying to run the following script from pl/sql with sql developer:


    declare

    Start
    Dbms_output.put_line ("'Hello world!");
    end;


    but I'm so: "anonymous block filled" and not the message expected...

    What can I do?

    Thank you!

    You need to activate the "DBMS output.

    One way to do, is "View/DBMS Output" and add new Dbms output tab by clicking on "+" more singing.

    And the re - run the script.

  • How to run multiple simulators run on different PCs

    I'm working on an application where I have several clients to communicate through BBM, the imam surveys using sdk 6.o BBM surveys

    He has only two simulators, I tried to run another instance of another PC Simulator, change batch simulators file settings, configure the IP address of the computer where MDS is changed running.also app-param = regSrcPort = 9784 and also changed the pin code of this instance.

    My bat file (sim3.bat) simulators is like thi

    fledge.exe/app = Jvm.dll / Pocket = 9800/session for partner = Sim1/app-param = JvmAlxConfigFile:9800.xml/data-port = 0x4d44/data-port = 0x4d4e /pin = 0x2100000A/app-param = regVersion = 3/app-param = regDestIP/app-param = (ip address of the pc running Simulator MDS) = regDestPort = / app-param 19781 = regSrcPort = 19784/app-param = DisableSyncServiceRecord/title = ' Simulator of BlackBerry 9800-3 '.

    but communication is not good, I can only receive message but cannot send from this instance...

    can someone help me how to communicate b'w all these instances of simulators...

    Hey,.

    I have resolved, in fact I forgot to set the config of Mds

    http://docs.BlackBerry.com/en/developers/deliverables/25813/Run_the_MDS_Simulator_1347972_11.jsp

    Before you start: End task, Configure the simulator of BlackBerry MDS to use unlimited strength encryption. If you use the BlackBerry MDS Simulator on one computer other than the BlackBerry Smartphone Simulator, in therimpublic.propertyfile (by default, in C:\Program Research In Motion\BlackBerry JDE 6.0.0\MDS\config), changing theUDP.send.host

    value to the IP address of the computer running the BlackBerry MDS Simulator.

    It's only question...

    now it is perfect. b'w multipal instances of simulators on different PCs.

  • How to run multiple simultaneous backups with VDR 1.2

    I have several VDR 1.2 devices, using every two CIFS shares for data warehouses.  I did not any changes in the .ini on devices file (the file does exist), but I am only able to write a backup at a time.  If I try to run a job manually all-in-one runs, it fails with a message telling me to look under "Reports" error messages.  However, there is nothing there.  I also can not save/restore the integrity checks are running.  It was also a problem of point 1.1, but it would actually give an error message that they data store was busy.

    I tried to import a whole new camera VDR and by attaching it to a new data store - same result.

    Does anyone have an idea what might happen?

    Thank you.

    Allen Beddingfield

    Systems engineer

    The University of Alabama

    Yes, exactly. We first had a VDR with 12 GB of RAM and 4 vCPUs and were not able to run several jobs once. Now, we decided to create two VDR each 4 GB RAM Max. Now, everything works!

    See you soon

    Nils

  • Run the database sql script

    Is this possible in some form?

    < = 'name' datasource cfquery name = "dsn" >
    #query.sqlstatement # < / cfquery >

    Yes, if you mean creating a query string, and then using them in a cfquery. Usually, you will need to place the text of the query in a PreserveSingleQuotes() function if you have settings that are placed in single quotes, something like this


    #PreserveSingleQuotes (sqlstatement) #.

    Phil

  • How to run SQL and export the results to Excel

    My task is to run a custom SQL script and create an Excel file through SQL Developer running from the command line (called by a scheduled script). Is this possible using SQL Developer?

    First, the thing I will try is to run a report user-defined in SQL Developer and save the results in an Excel file. Only 16000 result lines, but took 10 minutes to do the export and still cannot complete. Is there another way to do it?

    Thank you very much.

    Can't be done, but this is requested already exchanging SQL Developer, you can vote here and add weight to the possible future implementation.

    Kind regards
    K.

  • call a batch file in the sql scripts

    Hi friends,
    I'm looking for a way to call any batch file in sql scripts. I avoid using the DBMS_SCHEDULER package because my application server and database server are deparaments.
    I use the sql script using the server.plz application.


    Ah, I see. Of course, this explains everything.

    Now to be serious: there is no way to run a batch SQL script. The Tools that present SQL statements to the database are often able to do; host in SQL * Plus may issue commands to the OS, the host of builtin forms is it too and with dbms_scheduler , you can run a shell script on the database server.

    So depending on the tools you use, there are several ways to run the OS commands. So far you didn't tell us what you want to do with what tools in the version you want to do. So to only answer is: it is not possible. You cannot run a simple SQL command script.

    see you soon

  • Output is not as expected (getting wrapped) for a simple sql script

    Hello

    I try to run a simple sql script with a few queries including a semi colon output (;) when text file separated that later - I can open in excel.

    My SQL file contains in part the code - below

    SELECT
    "PORTFOLIO" | « ; » ||
    "CONTRACT # | « ; » ||
    "CONS_INV #" | « ; » ||
    "CUSTOMER #" | « ; » ||
    "CLIENT_NAME | « ; » ||
    'MESSAGE ' | « ; » ||
    "REQUEST_ID" | « ; » ||
    "BILL_TO_COUNTRY" | « ; » ||
    "BILL_TO_ADDRESS1" | « ; » ||
    "BILL_TO_ADDRESS2" | « ; » ||
    "BILL_TO_ADDRESS3" | « ; » ||
    "BILL_TO_ADDRESS4" | « ; » ||
    "BILL_TO_CITY" | « ; » ||
    "BILL_TO_POSTAL_CODE" | « ; » ||
    "BILL_TO_STATE" | « ; » ||
    "BILL_TO_PROVINCE" | « ; » ||
    "BILL_TO_COUNTY" | « ; » ||
    "SHIP_TO_COUNTRY | « ; » ||
    "SHIP_TO_ADDRESS1" | « ; » ||
    "SHIP_TO_ADDRESS2" | « ; » ||
    "SHIP_TO_ADDRESS3" | « ; » ||
    "SHIP_TO_ADDRESS4" | « ; » ||
    "SHIP_TO_CITY" | « ; » ||
    "SHIP_TO_POSTAL_CODE" | « ; » ||
    "SHIP_TO_STATE | « ; » ||
    "SHIP_TO_PROVINCE" | « ; » ||
    "SHIP_TO_COUNTY" | « ; » ||
    "INVOICE_DATE | « ; » ||
    "INVOICE_CREATION_DATE" | « ; » ||
    "PARTIALLY_DROPPED" | « ; » ||
    "AMOUNT".
    OF the double
    /
    SELECT "DOUBLE
    /
    SELECT "error Code" | « ; » ||' Error message "OF the DOUBLE
    /

    SELECT lookup_code. « ; » || Description
    OF fnd_lookup_values
    WHERE lookup_type = 'CUST_ERROR. '
    /

    The issue I'm facing is that the output of the competitive program file comes out bit so enter each line only 132 characters in a line and therefore gets pushed in the next row in excel.

    Output-

    PORTFOLIO; CONTRACT #; CONS_INV #; CUSTOMER #; CLIENT_NAME; MESSAGE; REQUEST_ID; BILL_TO_COUNTRY; BILL_TO_ADDRESS1; BILL_TO_ADDRESS2; BILL_TO_A
    DDRESS3; BILL_TO_ADDRESS4; BILL_TO_CITY; BILL_TO_POSTAL_CODE; BILL_TO_STATE; BILL_TO_PROVINCE; BILL_TO_COUNTY; SHIP_TO_COUNTRY; SHIP_TO_ADDR
    ESS1; SHIP_TO_ADDRESS2; SHIP_TO_ADDRESS3; SHIP_TO_ADDRESS4; SHIP_TO_CITY; SHIP_TO_POSTAL_CODE; SHIP_TO_STATE; SHIP_TO_PROVINCE; SHIP_TO_COUN
    TY; INVOICE_DATE; INVOICE_CREATION_DATE; PARTIALLY_DROPPED; AMOUNT


    Please advice on all of the commands that I can use in the script sql in order to expand the output page or any other workaround solutions!
    Please answer as soon as possible if you can help me!

    Thank you!

    SQL * MORE?

    SQL> set lin 1000
    SQL> spool your_file_out.csv
    SQL> your_query
    SQL> spool off
    

    Kind regards
    Malakshinov Sayan

Maybe you are looking for