Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Location
    Manchester, UK
    Posts
    143

    Unanswered: Basic SQLPLUS logon script - easy question!

    Hi all,

    Most of my Oracle databases are on a Unix platform and I have many scripts with the following code to connect and disconnect to the database. however, now I need one to run on windows from a dos command prompt and I'm not sure what needs changing, but the code below definitely does not work!

    sqlplusw \/nolog <<EOF
    connect logon/xxxxx
    shutdown immediate
    exit
    EOF

    Any help greatly appreciated!

    Thanks,

    Paula.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    You'll find quite a few scripts here; the one you are looking for is this one (written by Frank Naude):
    Code:
    @echo off
    rem -----------------------------------------------------------------------
    rem Filename:   DBStop.bat
    rem Purpose:    Stop an Oracle database
    rem Date:       05-Mar-2002
    rem Author:     Frank Naude, Oracle FAQ
    rem -----------------------------------------------------------------------
    
    rem -- Set Database SID --
    set ORACLE_SID=sgnt
    
    rem  -- Create SQL Script to Shutdown the DB --
    echo set echo on                  > %0.tmp
    echo connect sys/orcl as sysdba; >> %0.tmp
    echo shutdown immediate;         >> %0.tmp
    echo exit;                       >> %0.tmp
    
    rem -- Do the Shutdown --
    sqlplus /nolog @%0.tmp
    
    rem -- Cleanup -- 
    del %0.tmp

  3. #3
    Join Date
    Aug 2004
    Location
    Manchester, UK
    Posts
    143
    Many thanks!

Posting Permissions

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