DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Batch File

  1. #1
    Join Date
    Apr 2002
    Posts
    86

    Question

    I am writing a bacth file which is as below.

    SVRMGRL
    CONNECT internal/oracle@aaaa
    select * from v$database

    But as soon as SVRMGRL it doesn't type the next command
    How to reslove this..?
    Please help

    Thanks
    Harry

  2. #2
    Join Date
    Feb 2000
    Location
    NJ, United States
    Posts
    250
    In windows you have to do the foll to run a batch file:
    put all the commands starting from connect internal into a sql script for eg: data.sql:
    connect internal
    select * from v$datafile;
    exit;
    and then run another batch script like :
    %ORACLE_HOME%/bin/svrmgrl @data.sql

    I think this will work.
    KN

  3. #3
    Join Date
    Apr 2002
    Posts
    86
    I couldn't understand this
    How can I define the sql script to run in SVRMGRL.

    Explain in detail.

    Thanks
    Harry

  4. #4
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727
    Hi

    You have to make two bacth files.

    1. startup.bat
    ---------------

    svrmgrl @s.sql


    2. s.sql
    ----------------

    connect internal



    Then when ever you run the startup.bat, the the file s.sql will be executed. Try it..!

    Thomas
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

  5. #5
    Join Date
    Aug 2001
    Posts
    75
    My advice is " not to use svrmgrl and connect internal", since these commands are deprciated in Oracle9i, so use sqlplus which will make your script compatible to new Oracle version also.

    If you are using Unix.
    try
    sqlplus < connect scott/tiger@instance
    select * from dept;
    EOF


    Sanjay
    OCP 8i

  6. #6
    Join Date
    May 2001
    Location
    Delhi
    Posts
    340

    AT Cmd

    Hi,

    u can try scheduler on NT. an execute the sql command file as below

    sqlplus internal file.sql

    this works if u r using od authenticatio otherwise

    sqlplus user/pwd file.sql

    vijay

    --------------------------
    The Time has come ....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width