Running Commands Through Batch File...

Dear All,
Can anyone help me how to run commands including connecting to Sqlplus,create schema,grant user and alter user, grant dba alltogether through Batchfile..
I have connected to sqlplus by using sqlplus "system/test@instance"
but on including create tablespace new datafile'D:\app\Sreejesh\oradata\Tablespace\new.tbs' size 1024m autoextend on next 500m; it is not responding..
Please advice..

0d2ecaa8-3418-461c-bf28-ab1c801f10a0 wrote:
Dear All,
Can anyone help me how to run commands including connecting to Sqlplus,create schema,grant user and alter user, grant dba alltogether through Batchfile..
I have connected to sqlplus by using sqlplus "system/test@instance"
but on including create tablespace new datafile'D:\app\Sreejesh\oradata\Tablespace\new.tbs' size 1024m autoextend on next 500m; it is not responding..
Please advice..
Can you debug code that you cannot see?
Neither can anyone else.

Similar Messages

  • When triggering a UBE filter to run an external batch file, it doesn't work, although the rule is triggered.

    UBE filters are not running a batch file as
    an external program. The batch file is located in the postoffice spool
    directory and has the correct permissions.
    <P>
    Change the RUN command to REJECT to check that it was actually triggered.
    <P>
    <B>Background:</B>
    <P>
    Example:
    <P>
    filter.cfg is as follows:
    <P>
    :Test Channel-To "ecxpert@host\.domain\.com" RUN "test.bat"<BR>
    :sendback Channel-To "ecxpert@host\.domain\.com" COPY "pvtest1@host\.domain\.com"
    <P>
    filter.opt is as follows:
    <P>
    # To parse header fields as well as envelope fields remove the comment (#) from the following<BR>
    # line. See Help for more information<BR>
    parseheader:1
    <P>
    test.bat resides in C:\Netscape\Suitespot\MailServer\Spool and is as follows:
    <P>
    date /t >> test.txt
    <P>
    This would be 100% correct for any Unix system, with the addition of a top line
    to the script determining what shell to use. However, with NT, shell type
    definition is not part of a batch file.
    Correcting the UBE filter in filter.cfg to read as follows cures the problem:
    <P>
    :Test Channel-To "ecxpert@host\.domain\.com" RUN "cmd.exe /c test.bat"
    <BR>
    :sendback Channel-To "ecxpert@host\.domain\.com" COPY "pvtest1@host\.domain\.com"
    <P>
    The following also works:
    <P>
    :Test Channel-To "ecxpert@host\.domain\.com" RUN "cmd.exe /c date /t test.txt"<BR>
    :sendback Channel-To "ecxpert@host\.domain\.com" COPY "pvtest1@host\.domain\.com"
    <P>
    The reasoning behind this is that batch files are scripts for CMD.EXE, the
    NT Shell, and therefore cannot be executed directly. CMD.EXE has the /C
    switch to run a following command, or batch file, and exit on completion.
    <P>
    Another solution would be to write an executable program in BASIC or any
    other chosen language to perform the same functions. However, do compile it to an
    executable before trying to use it since, for example, a *.BAS file will
    run in Windows but it means nothing to Messaging Server.

    Look at the documentation of Runtime.exec()
    There are versions of that method that allow you to specify the name of an executable (the name of your batch file) and also an array of strings with environment parameters. I've never used this myself, but it should work like this (lookup the documentation!):
    Runtime.getRuntime().exec("bla.bat", new String[] { "ROOTDIR=" + rootdir });

  • Running executable in batch file as administrator when UAC is high

    Hi Team,
    I have a requirement of running executable in batch file by passing the current windows login username as parameters. Below is the content of my batch file:
    cmd /c start setup.exe http://testsite:7001/mobile  %username%  %username%
    But, when the UAC is set high in windows 7 machine, this executable is not running properly, and giving me warnings. And, if I am running the same start command after opening command prompt as administrator, then executable is running smoothly.
    So, is there any way I can run the executable as administrator by giving some options in batch file, when UAC is high?
    I tried runas option, but its prompting for admin password, which we can't provide as users will not know.
    Do we have some option in batch file as 'Run As Administrator' right click option, where it doesn't prompt for password but run the file with admin privilege?
    Thanks,
    Tina Soni

    Hi,
    When using Runas command, you can add a switch option /savecred
    /savecred will make it ask for admin password on the first run only, after that it should be saved
    Yolanda Zhu
    TechNet Community Support

  • How to write sql command in batch file

    hi,
    i m using oracle 9i on windows. i want to know how can i write sql command on batch file. i want to use a batch file to use sql command like shutdowm & startup command and any select command too.
    so plz tell how can i do it ?
    thxs

    superdba wrote:
    thxs u all , i got it at i wanted to do.
    thaks u all for yr precious time.
    thxsYou've 67 questions with 63 UNanswered. Please mark this question as "answered" and give points to the users whose answer you accept as "helpful" or "correct"
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • How to run the emca batch file

    Hello,
    I would just like to know how to run the emca batch file for a single test database on my PC with SID = ORCL1.
    Hope someone can help me.
    Thanks!

    Hi
    If you mean running EMCA as batch file and test something.
    I think the best way is to write OS level script to handle this

  • DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER Error while running multiple instances of SSIS through batch files.

    I have an SSIS package which loads data from an Excel file into a SQL Database. This SSIS package is triggered by a batch file. 
    As part of a load test, I have created 20 batch files that run the same package for a different Excel file. 
    To have these batch files run together, I have created 2 master batch files, one to run them sequentially (using CALL) and the to run them parallely (using START). I do have any issues in both of them.
    But when I try to run 5 instances of the same batch file run concurrently (using START XYZ.bat 5 times) only 1 succeeds. CALL XYZ.bat 5 times has no issues. 
    Is it because during START, the Excel file is opened by 1 batch file and unavailable to the other 4 instances? If yes, then why doesn't SSIS throw an error when I run the package through BIDS keeping the Excel file opened? Is there something I can do to
    overcome a FAILURE?
    Nelton D'Souza MS BI Developer

    Yes, it seems that since you open the same file from multiple processes the error occurs due to the sharing violation.
    I guess you will get the error opening several Excel files from BIDS trying to read / write to it if you have two BIDS so it is consistent. Excel disallows multiple access paths by its design.
    Arthur My Blog

  • Please help how to run System commands and batch files thru java program

    Sir,
    I want execute OS commands like dir,cls..etc and batch files,.exe filesthru java program.
    I have tried it sofar thru Runtime.getRuntime().exec("execute.bat");
    but it is not working.anybody knows about how to run the system commands thru java please give me the code.
    thank you,
    regards,
    j.mouli

    I've seen other posts with this questions, and answers. Unfortunately I didn't pay much attention. But the basic idea is to exec command.com and pass the specifc batch or command as an argument.

  • Run sql query through batch file

    how to create a batch file so that on running the batch file,
    I should get into the database using username and password and create the table and insert values inside that table

    kindly, if you are using windows you can create 2 files as following:
    a.bat
    b.sql
    put the files under spacific folder for example d:\bat folder
    -first file a.bat will contain the following:
    sqlplus apps/apps@yourdb @d:\bat\B.sql
    exit
    -second file b.sql will contain any sql statments you want as following:
    create table a (a1 number, a2 varchar2(100))
    insert into a (a1,a2) values(1,'Test')
    commit
    exit;
    hope this help you
    Regards ...
    Edited by: shedo76 on 28/04/2012 03:14 ص

  • Running a windows batch file on the middle teir

    Hi, I am converting a client/server Forms app to 10iAS (9.0.4). in Client Server mode, one of the forms calls a batch file that runs on the client. The same batch file must now run on the middle teir app server where iAS is installed, not the client's computer (no need for WebUtil).
    No change was made to the batch file, and it can be run with supplied params at the command prompt on the iAS server. However, when run through the web app, the batch file is failing. It is being executed, but when it hits this line:
    FOR %%F in (%1\arp*.w) do type %%F | gawk -f ARKeys.awk | gawk -f SMSar.awk
    it fails.
    Q: is there a different method to program DOS batch files wheb being called from the Forms server?

    Hi, I am converting a client/server Forms app to 10iAS (9.0.4). in Client Server mode, one of the forms calls a batch file that runs on the client. The same batch file must now run on the middle teir app server where iAS is installed, not the client's computer (no need for WebUtil).
    No change was made to the batch file, and it can be run with supplied params at the command prompt on the iAS server. However, when run through the web app, the batch file is failing. It is being executed, but when it hits this line:
    FOR %%F in (%1\arp*.w) do type %%F | gawk -f ARKeys.awk | gawk -f SMSar.awk
    it fails.
    Q: is there a different method to program DOS batch files wheb being called from the Forms server?

  • Iam not able to run a simple batch file from within java

    This is how my code looks like.
    It does'nt give me any error but I dont see the output from batch file which is suposed to be a simple redirection of dir command...
    package mypackage1;
    import java.io.File;
    public class RunBatch
    public RunBatch()
    try{
    Runtime rt = Runtime.getRuntime();
    String cmd = "generate_invoice";
    String path = "C:\\application\\Maps\\Reports";
    File file = new File(path);
    String[] envp = {""};
    String[] args = {"C:\\application\\Maps\\Reports\\generate_invoice.bat"};
    System.out.println("************ executing batch ");
    Process proc = rt.exec(args);
    System.out.println("************ batch executed ");
    }catch(Exception e)
    e.printStackTrace();
    * @param args
    public static void main(String[] args)
    RunBatch runBatch = new RunBatch();
    }

    Runtime.exec() only can run executable files. Batch file is not an executable - it is a script executed by command interpreter (cmd.exe). So, you should execute "c:\windows\system32\cmd.exe /c C:\application\Maps\Reports\generate_invoice.bat".
    Denis
    http://www.excelsior-usa.com/jet.html
    JVM with AOT compilation

  • DOS command for batch file

    Hi All,
    anybody knows how to call a batch file from java
    is there any DOS command aor dll file like url.dll by wich i can call my batch file from a java file
    or may be some body can tell me how to use FileUploadProtocal to call a batch file from java
    Please help me
    ASAP
    Thanks in advance

    Actuly I got these lines from a frnd
    String loadPath = "rundll10 url.dll,FileProtocolHandler D:\\a.bat";
    Process process = Runtime.getRuntime().exec(loadPath);
    but my original code was
    try{
         boolean imported = true;
         String _cmd = "cmd /c ";
         cmd =cmd+"sqlldr ";
         cmd = cmd + " userid=" + userId + "/" + passwd + "@"+ tnsEntry;
         cmd = cmd + " control=" + controlFilePath;
         cmd = cmd + " log=sql.log skip=1";
         System.out.println(_cmd);
         String envArr[] = new String[2];
         envArr[0] = "ORACLE_HOME=" + System.getProperty("ORACLE_HOME");
         envArr[1] = "PATH=" + System.getProperty("PATH");
              try{
                   Runtime r = Runtime.getRuntime();
         Process process = r.exec(_cmd);
              catch(RuntimeException re )
                   System.out.println("Failed to runtime run the process.123.."+re);
    it was not working even i m not getting any error or excep. so I tried that two lines above.
    but still frustating results

  • Irregular delay while running a dos batch file using a servlet class

    i used RunTime( ) class to execute a dos-batch file containing some commands like changing the directory, running an exe(executable.exe) file...etc in a servlet class. while this servlet class is invoked, the exe file(executable.exe) is run after irregular delay at different trials.
    Note: When this batch file is run in a stand alone java class, it is working fine.
    what can be the possible cause of this prob? Help me in this.

    It's ok - I've found the answer.
    I'll post it here for anyone else who is interested.
    The problem stemmed from the fact that I had to put the path to javaw.exe in quotes, as the batch file is dynamically generated from the user's environment, and then run. The user's system properties gives a path to java home using a full path name, which WinNT/Win2K doesn't like.
    The following batch file content solves it, closing the DOS box after starting javaw.exe. Before this part of my batch file, there is just some file copying that goes on for the autoupdate process.
    set PATH=%PATH%;"D:\Program Files\JavaSoft\JRE\1.3.1\bin"
    start /B javaw.exe -Dmyapp.home=C:\myapp myapp.client.MyAppClient subSys
    exit
    The parameter subSys is just a command line parameter that MyApp.java looks for, so not relevant for everyone.
    /B prevents a second DOS box from opening.
    exit simply closes the DOS box once the javaw.exe process has started.
    Too easy! Although I can't believe how difficult it was to find information about this. Hopefully it will be of benefit to others.

  • ACH RUN F110 THROUGH BATCH JOB

    Hello,
    Is there a way, we can run the ACH Incoming Payment (Customers) through a scheduled batch job for the TCode F110?
    I've configured the Incoming and Outgoing Payments successfully and I've been struggling with automating the Payment Run for the Incoming Payment(Customers). We're planning to keep running the Payable (Vendors) manually through F110.
    Thanks in advance
    Salman

    Hello Nitin,
    It is working but now I am able to either create proposal through batch job or I can do payment run through the job.
    Is there a way I could do a payment proposal and payment run through same job or through two jobs?
    Thank You
    Salman

  • Run Form using Batch file

    Hiii
    how can run a form using batch file (.bat) .. .
    ???

    i forget to say that am using Developer 10g R2 ...
    another question is what should i start when using the batch file other than the
    OC4J instance .....

  • Run Command through Java Program.

    I am giving ping command in exec method of Runtime().
    But ping syntax is different for linux and windows. So when I run command on windows it wasn't worked. I am giving command --> ping -c5 ipaddress . This works fine for linux but in windows, there is no -c option. So is there any solution to overcome this situation?
    please reply ASAP.
    Thanks,
    Raj

    I am writing code that runs ping command on all OS.
    Ping syntax different for different OS (like
    windows,linux,solaris etc).
    I don't want to check for each OS and run command
    specific to that OS.
    I want to write a generic program so ping command
    execute regardless of which OS. This is self-contradictory. You can't use one command line string on different platforms if they don't support this one command string.
    The ping command is different (concretely, this -c option you mention is indeed not supported on Windows - what does it do anyway?) on different OS.
    So, you basically have two options:
    - You use only a subset of the ping options, one that does run on all your platforms (I actually expect ping to be pretty portable anyway but...).
    - Or you do use platform specific options like -c, in which case there's no way around checking the running OS and generating a specific command line.
    Can I use system calls in my program to execute the
    ping command, If yes, how?Rephrase please.

Maybe you are looking for

  • Where can I find XP x64 drivers for Portege R500 - hotkey / power management?

    Where can I find downloads that will enable power management or hotkey support for my Portege R500? I have already installed drivers for everything except fingerprint reader (don't want), tpm (really don't want), and hdd motion sensor (tos620a) (not

  • Problem with SQL Developer (Version 1.5.4)

    Dear All, I have two questions as stated below while using the SQL Developer: 1) I have installed the application to a few PCs; while others are using the system without problems, on my PC, whenever I have entered / opened a SQL scripts on my SQL Loa

  • Photoshop an unexpected and unrecoverable problem has occurred photoshop will now exit

    I have the above mentioned error on photoshop CS5. I reset preference, checked my Fonts, did all online troubleshooting that I could find to no avail. I now want to reinstall and tracked down my original discs but I am not sure which one to use. One

  • Java Virtual Machine Specification

    Hi all, Is there any online resource on the java virtual machine specification which is up to date? I just bought a book on that topic, but the publication date is 1999 :(.

  • RoboHelp won't display WYSYWIG

    I am running RoboHelp 5.  Last week, I accidentally opened two instances of RH.  I closed one, and have not been able to view my topics, which are listed in the Topics tab, in WYSYWIG.  What can I do?  Thanks  Niesa