Sqlplus commands from withing the batch files

Hi,
Oracle9.2
need to execute the sqlplus commands from withing the batch files without calling the .sql file separately . How it can be done ?
With Regards

Hi,
I agree with you...but as per your solution, after all you are calling the .sql file while connecting the sqlplus which I know already and I don't want to execute the sql commands like that as shown below.
For example:
for shut down the database and starting it again .sql files will be called as shown below
Note: shutdown.sql file will contain simple database shutdown command.
sqlplus -s "sys/%password%@%tnsname% as sysdba" @D:\shutdown_db.sql
and again for restarting the db i will perform as below
sqlplus -s "sys/%password%@%tnsname% as sysdba" @D:\start_db.sql
But I want to get it executed directly from the DOS batch file.
The thing is I want to execute this both the above database commands from the batch file itself without calling the .sql files separately as shown above.
is it possible, so how it can be done ?
Regards
Edited by: user640001 on Feb 9, 2011 9:53 PM

Similar Messages

  • Issuing tmadmin commands from an NT batch file

    Hi
    We have much experience running tmadmin commands in UNIX using a "here file" like this
    tmadmin << ENDOFCMDS
    psr
    pq
    quit
    ENDOFCMDS
    But now we want to deliver an applictaion on NT. Is there a comparable technique on NT?
    --Tom Hogan

    Hi,
    Try this:
    String output = new String();
    try {
         Process proc = Runtime.getRuntime().exec ("cmd /c <your_command>");
         BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
         output = in.readLine();
    catch (Exception ex) {}Hope this helps,
    Kurt.

  • Commands within the batch file?

    Is there any way to enter commands directly into the batch file which will take effect on the java application?
    For example within the java application, there is a method "reload()" and to call that method you can type "reboot" and press enter in the batch file, is that possible? Thanks.

    I run my java application with a file (run.bat) (windows xp).
    @echo off
    title Stanyer's 503 (server)
    cd bin
    java -Xmx1024m net.stanyer.server 43594
    pauseSo basically, it runs in a cmd box.

  • I am able to 'create a new version from original' but when I try to export the original, I only get a .jpg with the XMP file. The original is obviously there but why can't I access it please?

    In Aperture 3 when I right click on an image I am able to 'create new version from original' which suggests that the original is there. When I try to export the original I only get a .jpg with the XMP file. These particular images are from 2010, has the RAW file become disconnected somehow? Please, how do I get access to the RAW file for editing in Ps? Thank you. Thomasrevil.

    Sorry leonie, 'Use RAW as Original' is not an option for the image shot with the Canon.
    Then your Import settings must have been different, when you imported the Canon photos.
    You can check, if there is still a hidden raw file somewhere. If the image has been imported as a pair, you should see the "J" badge in Browser and Viewer, if you enable badge overlays. This indicates a pair, with the jpeg as original.
    Select one of those images, and then relocate the original files "File > Relocate original" to a folder, where you can inspect it. Use "File > Show in Finder" after ward. Look, don't touch .
    Then put it back, using "File > Consolidate".
    Do you see your raw files in the folder, or is only a jpeg there?

  • How to schedule the Batch file to run from task scheduler

    Hello Everyone,
    I have a batch file which kills the wscript.exe process, I am doing this manually, I need to schedule this batch file to run from task scheduler whenever the process wscript.exe reaches to specific numbers,  i.e if the wscript.exe process count in task
    manager reaches to 30,  the task schedular should execute this batch file,
    Is there a way to do so.
    dibu

    Hi,
    àI need to schedule
    this batch file to run from task scheduler whenever the process wscript.exe reaches to specific numbers.
    As I know, it will not help you to achieve this target via Scheduled Task. When configure Scheduled Task, there
    seems no Trigger option that help you specify this condition (process counts reaches to specific numbers) to trigger the batch file.
    You could consider that improve this batch file. Adding the
    Check function to the script will be a better option. For script issue, you can post it in the
    Official Scripting Guys Forum. I believe we will get a better assistance there.
    If any update, please feel free to let me know.
    Best regards,
    Justin Gu

  • For the last 2 days whenever I try to upload photos from my iPhoto page to facebook I get an error message: Bad Image There was a problem with the image file.  I haven't knowingly changed any settings on iPhoto or facebook. Can anyone help, please ?

    I need help with uploading photos from iPhoto to facebook. I could do it till 2 days ago. Now any new photo I try to upload gives me an error message:
    Bad Image
    There was a problem with the image file. 
    Please help.

    Can you drag it to the Desktop?

  • How we can create the batch file to download the data in from URL in ssis

    hi,
    any one help on one the below requirement.
    i have to create one batch file to download the report(reports is in csv format) from URL...
    requirement should be like this...
    1. we have some reports is there in the URL..
    2.when ever we execute the url, the report should be download and save it to the local folder.
    3. this requirement i have to write in the batch file
    should any one let me know how we can create the batch file for the above requirement.

    Hi Priya.N,
    If you use SQL Server Reporting Services for reporting, you can use Visakh’s suggestion to create a script file which calls Reporting Services Web Service to render a report in CSV format and save a batch file to the destination folder, and then create a
    batch file to run the rs.exe utility which can executes the .rss script file. For more information, please see:
    Report Server Web Service
    ReportExecutionService.Render Method
    rs Utility (rs.exe) (SSRS)
    If you use other reporting tools, it depends on the reporting functionality and this requirement may be not achieved.
    Regards,
    Mike Yin
    TechNet Community Support

  • Running 10.4.11 and trying to restore OS9 as well as iLife etc. I tried to install iLifer from the original disc and the computer doesn't open the install program with the .mpkg file extension. Can you help?

    Running 10.4.11 and trying to restore OS9 as well as iLife etc. I tried to install iLifer from the original disc and the computer doesn't open the install program with the .mpkg file extension. Can you help?

    Hi Barbara,
    Try Pacifist...
    http://www.charlessoft.com/
    then extract/install what you need from your Install Disc.

  • How can i stop the Action Wizard from putting the original file into the Source folder with my changed documents?

    How can i stop the Action Wizard from putting the original file into the Source folder with my changed documents?

    [discussion moved to Creating, Editing & Exporting PDFs forum]

  • Problem using Host command to call a batch file

    Hi all,
    I am trying to call a batch file with the Host command:
    host c:\test\u.bat
    where u.bat calls unix2dos.exe with a parameter of d_unix.txt.
    Bat file looks like this:
    C:\test\unix2dos.exe d_unix.txt
    PAUSE
    The bat file gets called fine, but the following error occurs (in the cmd prompt):
    T:\globals\ORACLE8\bin>C:\test\unix2dos.exe d_unix.txt
    d_unix.txt:
    Can't open file
    T:\globals\ORACLE8\bin>PAUSE
    Press any key to continue . . .
    Running the batch file directly in windows works fine. The batch file also runs fine from the Host command if I remove the d_unix.txt parameter.
    The file d_unix.txt file is in the same directory as the batch file and as unix2dos.exe.
    Running from Sql Plus in a windows environment.
    Any thoughts?
    Edited by: dgouin on Aug 19, 2009 11:41 AM
    Edited by: dgouin on Aug 19, 2009 11:42 AM
    Edited by: dgouin on Aug 19, 2009 11:42 AM

    I always understood that it worked with whatever directory you were in when you launched the SQL*Plus binary:
    D:\>SQLPLUS dbuser@testdb
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Aug 19 15:26:35 2009
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    dbuser@testdb > HOST ECHO %CD%
    D:\
    dbuser@testdb > exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    D:\>H:
    H:\>SQLPLUS dbuser@testdb
    SQL*Plus: Release 10.2.0.4.0 - Production on Wed Aug 19 15:27:03 2009
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    dbuser@testdb > HOST ECHO %CD%
    H:\
    dbuser@testdb > exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

  • How to run the batch files

    Hi Experts,
    I am trying to implement automatic cache purging every day at specified time and i created txt file with SApurge All cache() and created bat file with nqcmd -q Analyticsweb -u username -p password -s (txt file location).
    Now i want to run this bat file daily at specified time with out executing manually may i know how to run the batch file at specified time .
    Thanks,

    There is task type as command in workflow manager if you want you can go for that during the load
    nqcmd -d "AnalyticsWeb" -u Administrator -p Administrator -s "D:\PowerCenter8.1.1\server\infa_shared\SrcFiles\1_BIPurgeCache.txt"
    Check these urls
    http://docs.oracle.com/cd/E12103_01/books/AnySched/AnySched_Scripts3.html
    http://deliverbi.blogspot.com/2011/12/purge-all-cache-from-dashboard.html

  • RUNAS another user: assistance with my batch file for control panel and explorer

    Hello, for desktop support on end user or multi/generic user pcs it is nice to access common commands quickly from a batch file to run under your account. In xp both explorer and control panel apps launched without issues. The primary issue for explorer
    is it appears to ignore the runas command (but the user has permissions to explorer so no error) while the control panel apps ignores run as well but does not have permissions so generates an error. The other commands all execute as the attempting admin's
    account.
    who it is for: the user with the admin account to execute on the user's desktop whom is a nonadmin
    **please note, the commands appear to work if you do have admin rights**, the logged in user does not  have admin rights to these utilities like in a common corporate environment.
    "windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the item."
    Issue#1:
    With win7 if you do a run as for explorer.exe via batch it will open, but will still be running under the signed in user. I have searched many threads on various sites and have not found a working solution for batch, this may be something I need to retire.
    Issue#2: all control panel applets fail to launch through various methods.
    SECTIONS THAT I AM STRUGGLING WITH:
    runas /user:%auser%@DOMAINNAME "explorer.exe /separate"
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl"
    "cmd /c start appwiz.cpl" also fails
    alternative also fails:
    runas /user:%auser%@chwi "cmd /c Start /B control.exe"
    cls
    @ECHO OFF
    set /p auser= Enter your account login id:
    :MyMenu
    CLS
    Echo Use the options below to run as with your admin account id:
    echo.
    ECHO 1 - Explorer C:\ - may not work with win7
    ECHO 2 - Device Manager
    ECHO 3 - Event Viewer
    ECHO 4 - Services
    ECHO 5 - Computer Management
    ECHO 6 - REGEDIT
    ECHO 7 - Command prompt
    ECHO 8 - Local Users and Groups
    echo 9 - launch task manager
    ECHO a - Control Panel - may not work with win7
    Echo b - Add/Remove programs - may not work with win7
    Echo 0 - Exit
    echo.
    SET /P OPT=Please make a selection, and press enter:
    if %OPT%==1 GOTO OPTION1
    if %OPT%==2 GOTO OPTION2
    if %OPT%==3 GOTO OPTION3
    if %OPT%==4 GOTO OPTION4
    if %OPT%==5 GOTO OPTION5
    if %OPT%==6 GOTO OPTION6
    if %OPT%==7 GOTO OPTION7
    if %OPT%==8 GOTO OPTION8
    if %OPT%==9 GOTO OPTION9
    if %OPT%==a GOTO OPTIONa
    if %OPT%==b GOTO OPTIONb
    GOTO exit
    :OPTION1
    ECHO Executing Explorer C: window
    echo.
    runas /user:%auser%@DOMAINNAME "explorer.exe /separate"
    GOTO:mymenu
    :OPTION2
    ECHO Executing Device Manager
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B devmgmt.msc"
    GOTO:mymenu
    :OPTION3
    ECHO Executing Event Viewer
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B eventvwr.msc"
    GOTO:mymenu
    :OPTION4
    ECHO Executing Services
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B services.msc"
    GOTO:mymenu
    :OPTION5
    ECHO Executing Computer Management
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B compmgmt.msc"
    GOTO:mymenu
    :OPTION6
    ECHO Executing regedit
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B regedit"
    GOTO:mymenu
    :OPTION7
    ECHO Executing command prompt
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B cmd"
    GOTO:mymenu
    :OPTION8
    ECHO Executing Local Users and Groups
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B lusrmgr.msc"
    :OPTION9
    ECHO Executing task manager
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B taskmgr.exe"
    :OPTIONa
    ECHO Executing control panel
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B control.exe"
    :OPTIONb
    ECHO Executing add/remove programs
    echo.
    runas /user:%auser%@DOMAINNAME "cmd /c Start /B rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl"
    GOTO:mymenu
    GOTO EXIT
    :EXIT

    You guys I appreciate the feedback but please read my entire post and help if related, this is getting a bit frustrating.
    a. I am not developing a powershell solution or "how do I launch them via command prompt" that is well known. The goal is to create an easy to use "run as helper" script for those that are not as savvy or do not have the commands memorized.
    Even so many of your suggestions do not work because the user logged in does not have admin rights and the commands are blocked because of this restriction.
    b. This is for the batch file in question, NOT "how do I launch command prompt as an admin"
    c. Again, several options work, several do not (network connections and programs and features do not) must likely due to same limitations as explorer.exe or UAC
    d. this is not "how do I launch the utilities by command line" it is "how do I launch them as the admin WHEN the current user does not have admin rights". The entire script works on a pc if you have admin rights because its launching
    it instead AS the current user, in that case the current user has admin rights therefore it doesnt reproduce the issue.
    e. running by control.exe using the app name or with cpl does not resolve the issue.
    f. I did not post that command prompt is having issues launching, I wrote a couple times that the options in my script do work such as command prompt. Even if you launch command prompt you cannot launch programs and features or network connections with your
    admin account with or without an additional runas command.

  • Combine 2 PDF's with a Batch file?

    Hello Community,
    this is my first post, so please be patient with me - and sorry for my bad english.
    i want to edit and comine 2 pdf files automatically with an batch file or something else.
    i already have 2 pdf files, a delivery tracking label and a delivery ticket.
    the delivery label from the first pdf should place in the second pdf at the top.
    afer the process they should generate a third pdf an delete the other 2 pdfs.
    is that possible with an batch or vbs or something else?
    thank u in front - at the bottom in this post there is a link to the 3 pdf files.
    the delivery label
    the delivery ticket
    and the final pdf
    Directory Listing of /development/
    best reguards
    m.s

    Are this diferent documents? What version of Adobe Reader?

  • Execution of a batch file fails if the batch file has a date

    Hi All,
    I have a batch file which copies files from one folder to another based on the date condition( if the files are modified or created today copy them). Below is my code
    set curr_date=%DATE:~4,2%/%DATE:~7,2%/%DATE:~10,4% & XCOPY \\cambosnapp01\FileTransfers\InboundToHomesite\NICB\Entities \\cambosnapp01\Claims\Analytics\NICB\CurrentAlerts/d:%curr_date%
    This batch file runs fine if i run it manually, but i want to run this in an ssis package, i am using an execute process task and in the executable i gave the location of this batch file, and if i run the package it fails.However if i just exclude the last
    date thing from the batch file and run the below one it runs fine.
    set curr_date=%DATE:~4,2%/%DATE:~7,2%/%DATE:~10,4% & XCOPY \\cambosnapp01\FileTransfers\InboundToHomesite\NICB\Entities \\cambosnapp01\Claims\Analytics\NICB\CurrentAlerts/d
    But this batch file would copy all the files which i dont need. I only want to copy the new files and thats the reason i use the date in the end but for some reason it fails.
    Can someone please help me with any suggestions on this?
    Please let me know if you have any questions or if i am still unclear.
    Thanks

    What is the error you are getting?
    Why don't you want to use the FileSystem task that is parameter driven?
    Running the bat file manually vs as a package has a difference.
    Do you run it while the package is in development (via SSDT)?
    You only gave the bat file, but how did you set your task in SSIS not.
    Arthur
    MyBlog
    Twitter

  • Adobe AIR - java is not recognized as an internal or external command operable program or batch file

    Hi,
    I've done everything as in the HelloWorld tutorial but when i run this cmd: adt
    it gives me the following error java is not recognized as an internal or external command operable program or batch file
    I've installed the AIR runtime v2
    Downloaded the SDK v2 and placed in D:\Www\air
    Modified the path variable with D:\Www\air\bin
    And then i open a new cmd console and simply write adt and gives me that error.
    I've updated to the latest version of Java, but it did solve it.
    But what's strage it's that the adl command work, but i'm not being able to pack my application.
    I'm running Windows 7 on x64 platform.
    Sincerely,
    Alex

    I think the 32bit version will work, but it sounds like you'll need to add the Java bin folder to your system path.  This is usually done by the Java installer, so I'm not sure what failed, did you run the installer located at www.java.com?  Either way, this document might be able to help you out:
    How do I set or change the PATH system variable
    Add the Java "bin" folder to your path, you might also need to add the CLASSPATH.
    Please let me know how it goes!

Maybe you are looking for

  • Web filtering on Cisco 867 VAE K9 router

    Hi, how do I enable web filtering on Cisco 867 VAE K9 router with 15.1(4)M4 release? i have a message on the router : Content Filter unvailable .... thanks.

  • Audio quality in DVD pro

    I just brought a file from FCP through Compressor into DVD Studio Pro. I have a music track for Menu 1 as well at the audio which came out of Compressor from my original file. The music for Menu 1 sounds fine, but the music of the movie when played b

  • Coding a PDF to so distributors can swap out with their info

    we have created out catalog in Quark and used the plug-in X-cat to link to our price data base which allows us to make price chang es with the click up a button. We then prepare PDFs and upload the catalog to our website. We would like to offer our d

  • Image update problem (bug?)

    Within a canvas, which is placed in the center of a borderLayout, I am importing images via MediaTracker. I have a dialog and within this dialog, when an item is selected from a list, the image within the canvas ought to change when "ok' is clicked i

  • IPTC location fields - best practices?

    Lightroom offers various location-related data - Scene, Location, City, State/Province, Country, ISO Country Code. Country and State/Province are usually straightforward. In a major city, City is also obvious, and for Location I typically enter a str