Executing sqlplus_exec_template.sql script

Hi,
I am wondering if anyone is using sqlplus_exec_template to execute process flows successfully. I can execute Process flow using this script but somehow the SQL*PLUS hangs after the process if complete. Could anyone help me please...

could you able to use OWB Runtime Audit Browser, if so go there and see what's the status of that process
and use some e-mail in the processflow between the activities
and check the wb_rt_errors..tables, where you can see the status
also check the v$locked_object with v$lock&v$session...
any of these one set you can get thru. it ..
if you need more details on the specific one just post a repy...
Thanks,
Gladson

Similar Messages

  • How to execute a sql script in dbms_job?

    how to execute a sql script in dbms_job?

    See my response to Re: how to execute a sql script file in procedure or trigger.
    Cheers, APC

  • Execute an SQL Script from Java (myScript.sql) ?

    Hello!
    I am a writing an SQL Script so that I can re-create my database on another server (im using my laptop to test it on first though).
    I'm connecting to mySQL server using JDBC which works fine, but I was wondering
    how can I run an entire script file, say myScript.sql from within a Java class??
    (an SQL Script is simply a file containing the regular SQL commands and expressions that you might enter at an sql command line prompt)
    example of an SQL Scritp: myScript.sql>>
    //#create new db
    CREATE DATABASE sample_db;
    //#set active db
    USE sample_db;
    //#set table paramaters
    CREATE TABLE monkeys
    (name CHAR(20),
      age INT UNSIGNED,
      sex ENUM('M','F')
    //#create standard monkeys
    INSERT INTO monkeys(name,age,sex) VALUES("Sammy",10,"M");
    INSERT INTO monkeys(name,age,sex) VALUES("Muncht",12,"M");
    INSERT INTO monkeys(name,age,sex) VALUES("Jill",8,"F");
    //#get recordset
    SELECT * FROM monkeys WHERE age < 50;Thanks for your help!

    The way I understand it is that your mysql.sql script file uses ';' as a delimeter between statements. So now what you can do is that read the whole file and put it inside a string/stringbuffer. Now put this string/stringbuffer to a stringTokenizer with delimeter set as ';'. this way you will recieve your exact statements without scratching your heads as where the statements begin/ends. :-)
    Now once you have your statements than its just a matter of executing them against the database.
    hope this helps.

  • SAP ECC6 sr3 upgrade error in executing MSSCONCHECK.SQL script

    Hello all,
      I am facing this error which is very annoying , I am executing Prepare Upgrade script for ECC6 SR3 from SAP 4.7 Sr2 with windows 2003 server and MSSQL 2005 server as backend. I am facing below error
    Enter one of these options [continue] := continue
          SAPup message
    SAPup> SQL-scripts must be executed by the NT user account T47VMHOST2\t47adm.
           Check your installation of the integrated security procedure
           on host t47vmhost2 and make sure that a login for the NT user
           T47VMHOST2\t47adm exists with the following rules:
           - user T47VMHOST2\t47adm owns the role System Administrators
           - user T47VMHOST2\t47adm has the default database T47
    SAPup> Integrated security installed correctly?
                - "no"
                - "yes"
    Enter one of these options [no] := yes
    Executing script MSSCONCHECK ...
    MSSCONCHECK: Connection check failed for the user specified
          SAPup message
    SAPup> Errors were found in the logfile MSSCONCHECK.LOG
           after execution of the script MSSCONCHECK.SQL.
    SAPup> SAPup cannot proceed until these errors are fixed.
           Please, examine MSSCONCHECK.LOG, fix reported errors and then call R3UP a
    gain
    I have done a number of changes in system i checked the SIDadm user is assigned a default DB T47 and has said role assigned allready.
    I restarted the system after changes and started the prepare batch file again but with sme probelm again. so can anybody guide me on this. I seen a number of threads but there is no any concrete solution providedby them.
    will really appreciate any reply.
    Mani

    Hello Julia,
      i read those note but everything seems normal to me on my PC; it has remote access enabled, t47vmhost2/t47adm is the user configured (although its not a domain configuration (installation) but t47vmhost2 is the computer name. So its kind of local user defined in SQL with said authorization. below is the log from file MSSCONCHECK.LOG
    [SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2].
    [SQL Native Client]Login timeout expired
    [SQL Native Client]An error has occurred while establishing a connection to the server. When
    connecting to SQL Server 2005, this failure may be caused by the fact that under the default
    settings SQL Server does not allow remote connections.
    I am still stuck in ?
    Can you please verify if i am using right DVDs
    51033495_1     NW 7.0 SR3 Languages DE,EN,ES,FR,IT,NL
    51033494_3     NW 7.0 SR3 Upgrade Export 3 of 3
    51033494_2     NW 7.0 SR3 Upgrade Export 2 of 3
    51033494_1     NW 7.0 SR3 Upgrade Export 1 of 3
    51033512_14     NW 7.0 SR3 Upgrade Master Windows Server on x64 64bit
    51033508_8     NW 7.0 SR3 Kernel 7.00 Windows Server on x64 64bit Upg ABAP
    Pleas help
    Mani

  • How to execute a .SQL script file?

    Hi
    I'm sure this question has been answered already, however I was unable to find an answer using the search tool.
    Using c# I'd like to run a .sql file. The sql file contains multiple sql statements, some of which are broken over multiple lines. I tried reading in the file and tried executing the file using ODP.NET ... however I don't think ExecuteNonQuery is really designed to do this.
    So I tried using sqlplus via spawning a process ... however unless I spawned the process with UseShellExecute set to true sqlplus would hang and never exit. Here's the code that DOESN'T WORK.
    Process p = new Process();
    p.StartInfo.UseShellExecute = false;
    p.StartInfo.RedirectStandardOutput = true;
    p.StartInfo.FileName = "sqlplus";
    p.StartInfo.Arguments = string.Format("xx/xx@{0} @{1}", in_database, s);
    p.StartInfo.CreateNoWindow = true;
    bool started = p.Start();
    p.WaitForExit();
    WaitForExit never returns .... Unless I set UseShellExecute to true. A side effect of UseShellExecute is that you can no capture the redirected output.
    This must be such a common thing to do, I'm hoping someone has a solution to this.
    Thanks
    Rich

    If by "SQL script" you mean run a program that resides outside the database (a file of the format whatever.sql) then the answer is with difficulty. We can use extproc calls to run c libraries or embedded java to execute host-style commands but it's a lot of pfaffing about.
    The easiest solution is to bring the SQL commands into the database as a stored procedure. If you still need to be able to run the script externally then rewrite that to call the same stored procedure. However, if the .SQL file includes OS calls then you will have to choose either Java or extproc, depending on what it is the script actuually does. If you want more focused advice you'll need to give us details.
    Cheers, APC

  • File Ownership while executing sql script from stored procedure

    We have a test_command.sql script which is spooling the result into a file. From database we have one Store Procedure(run_sql) which is
    calling and executing the .sql script.
    When we are calling the sql script directly from the database, i e SQL > @/dccops/test_command.sql it is creating the
    file under the Ownership of OS user which is connected to the system.
    The problem we are facing is when we are executing the stored procedure i e exec run_sql(), the file is creating under
    Oracle User.
    Could u please suggest me a solution inorder to create the output file under the user who is logged to the OS.

    First of all, your usage of IM speak is NOT appreciated. Please do not address anyone as if they were a 12-year old.
    'Our Applcation is in C. So we have to call the procedure to run the sql script.'
    This is just utter nonsense!
    Oracle has Pro*C which allows Embedded SQL in C. There is also OCI (Oracle Call Interface) to call Oracle directly in C, and there is OCCI, to do the same in C++.
    Apart from that, Oracle has Ole DB for Windows platforms, to allow for a .NET compatible interface to Oracle.
    There is NO NEED AT ALL to call PL/SQL to run a SQL script.
    Sybrand Bakker
    Senior Oracle DBA

  • Problem executing SQL scripts

    Hi,
    I am unable to execute any SQL script in my APEX application.
    I uploaded a SQL Script using the SQL Workshop->SQL Scripts->Upload option.
    this is the script tat i uploaded :
    SELECT COUNT(*),'PROJECT_TEAM' FROM PROJECT_TEAM
    SELECT COUNT(*),'PROJECTS' FROM PROJECTS
    SELECT COUNT(*),'PROJECT_TASK_DETAILS' FROM PROJECT_TASK_DETAILS
    But when I click on the Run button, the script doesn't execute and also I am unable to edit the script tat i uploaded.
    Any thoughts on whr I am goin wrong or any solutions??
    Thanks,
    Janani

    Hi Janani,
    You can exec one select statement each time.
    Best,
    Othman

  • What tool I need to download to execute SQL scripts inOracle? please Help!

    I'm a SQL Server developer trying to pratice SQL scriptinging in ORACLE environment. Can any subject matter expert let me know exactly which tool I need to download to experiment with SQL scripting? It's kind of confusing as ORACLE has so many components. If I'm correct, SQL Plus might be the tool and PL/SQL is the ORACLE version of SQL language/scripting. I know that i can download 180 days of evaluation version software. Can someone tell me the exact link of the oracle tool where I can execute my SQL scripts?
    Thank you so much in advanced.
    Thanks
    Syed Islam

    Try Oracle Express Edition (XE)
    Completely free.
    You can use SQL*Plus, but coming from Windows/SQL world, you'll definitely enjoy using SQL Developer as well. That's a separate download. You'll have a worksheet, visual query builder, object navigator/browser, etc - much like you see in SSMS.

  • Executing sql scripts from url

    A nice feature of isqlplus was that we could execute a sql script stored on a
    server from a browser on a client, using dynamic. Is ther any comparable
    facility in APEX for executing a sql script from a browser?

    Hi!
    Here are some other threads to look at. Make sure to also look at the blog at the bottom of the 2nd thread. In the forum search set the date range to "all" and search on "run_cmd". You might have to look thru a few pages but there are several threads.
    How to execute sqlplus command in html_db
    Re: Returning dbms_output.putline type output to apex page
    Re: RUN A DOS BATCH FILE FROM PLSQL...
    Also go to ASKTOM (Tom Kyte) and search on "run_cmd":
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3361193268672
    This will give you several ideas!
    Let us know if you can't get it working.
    Dave Venus

  • Calling sql script in plsql procedure

    Hello,
    I have a sql script named mytest.sql and i want to execute this from a stored procedure.
    following is the contents of this script
    spool d:\mytestsql.txt
    select * from tab;
    spool off
    Actually i want my sql script to run daily to export some tables data.
    I can execute this script from a sql prompt but i want to run it from enterprise manager.
    I am using oracle 10gR2 on windows2000 system.
    Any idea about scheduling the sql script to run automatically??
    How to execute this sql script from a plsql procedure??
    Thanks

    Hi all,
    Thanks for all the replies. I have found the solution with external procedures.
    Following is the complete step by step guide.
    1. Create the OSCommand Java Class using the following statement:
    connect as any user:
    create or replace and compile java source named oscommand as
    import java.io.*;
    public class OSCommand{
    public static String Run(String Command){
    try{
    Runtime.getRuntime().exec(Command);
    return("0");
    catch (Exception e){
    System.out.println("Error running command: " + Command +
    "\n" + e.getMessage());
    return(e.getMessage());
    2. Create the following Wrapper Function using the following statement:
    CREATE or REPLACE FUNCTION OSCommand_Run(Command IN STRING)
    RETURN VARCHAR2 IS
    LANGUAGE JAVA
    NAME 'OSCommand.Run(java.lang.String) return int';
    3. connect as sys
    Execute dbms_java.grant_permission( 'FKHALID','SYS:java.io.FilePermission', '<<ALL FILES>>','execute');
    execute dbms_java.grant_permission( 'FKHALID','SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '*' );
    execute dbms_java.grant_permission( 'FKHALID','SYS:java.lang.RuntimePermission', 'readFileDescriptor', '*' );
    commit;
    note: here fkhalid is the oracle user.
    connect as fkhalid user:
    Declare
    expdp_cmd Varchar2(2000);
    Begin
    expdp_cmd := OSCommand_Run('cmd /c sqlplus fkhalid@mtcedwt/pwd @d:\ORA_DUMPS\mydbexp.sql');
    DBMS_OUTPUT.Put_Line(expdp_cmd);
    End;
    In Unix
    Set Serverout On
    Declare
    x Varchar2(2000);
    Begin
    x := OSCommand_Run('/home/test/myoscommand.sh')
    DBMS_OUTPUT.Put_Line(x);
    End;
    I will check the dbms_scheduler also and will let you know the results.
    Thanks

  • OEM12c Job - Run a SQL Script from a central location against multiple targets

    Hi All:
    I need to execute a SQL script that can be run as OEM Job against multiple targets from a single location so that the output csv files are all in that central location. My problem is that the sql script job documentation says "Make sure that the script file is installed in the appropriate location on all targets". Is anyone aware of a way I can do this so that the SQl script is executed from a location on my OMS console?
    Cheers

    Hi
    Create SQL job to run against on the server. Save those results (csv) file in local target. And crete one OS job, to collect all csv files into your OMS Console.
    Regards
    Krishnan

  • Running a sql script from stored procedure

    Hi everyone!
    Has anybody tell me how to execute a sql script from a stored
    procedure!
    Thanks in advance!
    Sasa

    >
    Hi everyone!
    Has anybody tell me how to execute a .sql file from a stored
    procedure!
    Thanks in advance!
    Sasa Sorry, a .sql file!!

  • Security context issue when executing a SQL command in SQLCMD

    Simplified core issue below:
    I have myscript.sql that has:
    SELECT name FROM Sys.Databases
    GO
    USE mydatabase
    GO
    EXEC mystoredprocedure 'myparameter'
    GO
    When I open cmd.exe and use:
    SQLCMD -S localhost\myinstance -i script.sql
    It executes fine.
    When I open cmd.exe in C# using the Process class and execute the same command I get the following error:
    name
    master
    tempdb
    model
    msdb
    mydatabase
    (5 rows affected)
    Msg 916, Level 14, State 1, Server localhost\myinstance, Line 1
    The server principal "NT AUTHORITY\SYSTEM" is not able to access the database "mydatabase" under the current security context.
    Msg 2812, Level 16, State 62, Server localhost\myinstance, Line 1
    Could not find stored procedure 'mystoredprocedure'.
    And now the detailed explaination:
    I created an MSI which installs my custom application.
    During the bootstrap process, SQL Server 2012 Express is installed using the following parameters:
    /INSTANCEID="SQLEXPRESS"
    /ACTION="Install"
    /FEATURES=SQLEngine,Replication
    /HELP="False"
    /INDICATEPROGRESS="False"
    /Q="True"
    /QS="False"
    /ROLE="AllFeatures_WithDefaults"
    /ENU="True"
    /ERRORREPORTING="False"
    /SQMREPORTING=0
    /INSTANCENAME="SQLEXPRESS"
    /AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
    /AGTSVCSTARTUPTYPE="Disabled"
    /ISSVCSTARTUPTYPE="Automatic"
    /ISSVCACCOUNT="NT AUTHORITY\NetworkService"
    /ASSVCSTARTUPTYPE="Automatic"
    /ASCOLLATION="Latin1_General_CI_AS"
    /ASDATADIR="Data"
    /ASBACKUPDIR="Backup"
    /ASTEMPDIR="Temp"
    /ASCONFIGDIR="Config"
    /ASPROVIDERMSOLAP="1"
    /SQLSVCSTARTUPTYPE="Automatic"
    /FILESTREAMLEVEL="0"
    /ENABLERANU="True"
    /SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"
    /SQLSVCACCOUNT="NT Authority\Network Service"
    /SECURITYMODE="SQL"
    /ADDCURRENTUSERASSQLADMIN="True"
    /RSSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
    /RSSVCSTARTUPTYPE="Automatic"
    /RSINSTALLMODE="FilesOnlyMode"
    /HIDECONSOLE
    /IACCEPTSQLSERVERLICENSETERMS
    /SAPWD="***************"
    The MSI then executes an Installer class DLL written in C# which restores a database to the SqlExpress instance.
    When the restore is completed, the Installer class then uses the Process class to launch CMD.exe and execute the SQL script using SQLCMD.
    Process vProcess = new Process();
    ProcessStartInfo vStartInfo = new ProcessStartInfo("cmd.exe");
    vStartInfo.Arguments = "/c set path=%path%;" + Context.Parameters["TargetDir"] + "\\; && sqlcmd -S LocalHost\\myinstance -i myscript.sql";
    vProcess.StartInfo = vStartInfo;
    vProcess.Start();
    vProcess.WaitForExit(30000);
    This is where I get the error mentioned above.
    However if I execute the same command manually by opening CMD.exe from the RUN command, it executes perfectly.
    I can not use -U or -P to supply a user / password, I MUST use integrated security.
    Additional info:
    Previously SQL Server 2008 Express has been in use for the bootstrapper, and this issue did not occur.
    The database the MSI restores is also built from SQL Server 2008. (Will be built from 2012 in the future.)
    Installation is performed on an account with administrative rights.
    Running the installer AS Administrator does not fix the issue.
    Any help would be greatly appreciated, as well please let me know if additional info is required.
    Thank you

    I'm having a similar issue where I'm using a batch file to execute commands to a group of servers. I can use the batch commands when updating MyDatabase but get the security context error when I try to update MyDatabase with a join to TheirDatabase except
    on servers where I am sysadmin.   Like I said, I can update MyDatabase as long as I don't join to TheirDatabase.
    Update A
    Set A.CCMCoderStaffSID = IsNull(B.StaffSID, -1)
    From MyDatabase.[R_Encounter].[VejdPfcsLinkageDataF19610x5] A
    Left Join ThierDatabase.Staff.Staff B on
    A.Sta3n = B.Sta3n and A.[CCMCoderF200IEN]= B.StaffIEN
    Error:
    Msg 916, Level 14, State 1, Server R04PHIDWH58, Line 1
    The server principal "MyDomain\ME" is not able to access the database "TheirDatabase" under the current security context.
    Line from batch:
    sqlcmd -S Server54 -d MyDatabase -i D:\ETLDevelopment\R04\Me\querytools\%RAWTablesScript%  -o D:\ETLDevelopment\R04\Me\UpdateSIDV1.txt

  • How to upgrade the schema on both the sites using sql scripts?

    Hi Experts,
    I need some help.
    I have two sites SITE A and SITEB, on both the sites GG is installed and running (DML Bi- directional replication). I have schema SCHEMA1 on both the sites which are configured for replication and replication is working from last one year.
    Now I wanted to upgrade the SCHEMA1 on both the sites. There are three .sql script which has many SQL commands like create table, create sequence, create procedure, insert record etc. I wanted to run that SQL file one both the sites.
    So should I stop all the process on both the sites SITEA and SITE B (including manager process) ,execute the SQL scripts on both the sites and then start the process again ? Will it work?
    Is there any other best way to do this?
    Could you please suggest the steps so that I can successfully execute theses scripts on both the site to upgrade the schema1.

    There is no blanket answer here; it depends. Main questions are:
    1. Do the SQL scripts update existing tables?
    2. Are you replicating DDL in one direction? (DDL should only be replicated one way even when doing bi-directional, do DDL should only be issued on the node capturing DDL
    3. Are you using a wildcard (*) from table names or using an explicit list?
    Easiest thing is if you're replicating DDL from A to B and apply DDL to A only. This assumes that the application writing to these tables can handle DDL changes under the covers. If these are new tables supporting new application features then you would simply enable said features after apply sql files.
    From there it gets more complicated and would need answers to the above questions before going down each line of logic. But try to remember what's really going on here. Data in one form (DDL) is being captured and send along. If the "shape" (DDL) of that data changes then the extract and replicat need to update their meta data to handle it correctly. If change data encounters a different shape than what's cached then you will become out of sync.
    I'm not sure if that makes sense but again, the answers to the questions above will be indicate where more detailed explanations should be focused. In short, we need more detail about what those scripts do and your current setup.
    Good luck,
    -joe

  • Loading pl/sql scripts into OWB and running it

    Hi,
    Does anyone have an example for loading and executing PL/SQL Scripts in OWB?.
    Thanks
    Mehdi

    Hi Mehdi,
    Can you be more specific about what you want to achieve?
    Do you mean running a package that OWB generated as a mapping?
    Or running some external code?
    Please check the User Guide, especially chapters 6 (Creating Mappings), 9 (Using Oracle Warehouse Builder Transformations) and 11 (Deploying to Target Schemas and Executing ETL Logic).
    Good luck, Patrick

Maybe you are looking for

  • Navigon: portrait / landscape

    i just purchased the app (and recently installed the 1.1.0 update) and it works like it should for me (san diego, ca), havent had any real problems yet. im not sure if anyone else has had this issue, but my car mount is mounted in a landscape mode. w

  • Document Attachments flow from BOM to WIP

    Hi All, We want the attachments flow from BOM to WIP or Org Items to WIP, 1. Component Items Created and assigned to Org - Attachments uploaded here. 2. A BOM created - Upload attachments here or the attachments should flow from Items to BOM. 3. When

  • Switching database to archive log mode

    1.When I switch the database to archive log mode, I have to do full offline(consistent) backup. 2.When the database is working in archive log mode I can do inconsistent(online) backups. Why is there consistent backup needed after swiching to archive

  • Looking up JNDI names

    Hi, I got "NoInitialContextException" when i tried to execute a session bean client by making the look up my is follows client program import javax.naming.*; import javax.ejb.*; import java.util.*; public class AdviceClient public static void main(St

  • 7.4: "Skype has stopped working"

    when I open skype and sign in it works for a few seconds and then fades out and windows gives me a message saying "skype has stopped working" and then tells me that they will notify me if a solution to the problem is found (yeah right). I tried renam