Connect DB in a windows script
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Connect DB in a windows script

  1. #1
    Join Date
    Jun 2006
    Posts
    31

    Connect DB in a windows script

    Hello all,

    I want to connect to oracle with a windows .bat for execute some commands. I create the script like this:

    ***************************
    echo off
    sqlplus "sys as sysdba"
    passwd
    commands
    exit
    ***************************

    When I execute the .bat i only obtain the passwd request. The problem is that only execute the first line.

    How can I execute this script? what are the commands that i have to modify?

    Thanks in advanced.

  2. #2
    Join Date
    Feb 2009
    Posts
    3
    You can do so by this way:
    1. create sql file containing whatever commands you want to execute.ex:
    d:\test.sql
    ;
    ;
    ;
    .
    .
    ;

    2. create another sql file containing , say con.sql
    "sys/passwd@ as sysdba" @d:\test.sql

    3. create a .bat file as :

    echo off
    sqlplus @con.sql

    Hope this helps

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