Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    5

    Unanswered: DOS BAtch job to Refresh oracle database

    Hi.
    I am trying to run a batch job in DOS to refresh an oracle 817 environment window 2000.
    The .bat job runs fine if I double click on it but if scheduled it returns an error "invalid username and password" when calling sqlplus -s internal/password1.
    Are there any 'tricks' to running DOS batch jobs for oracle?
    The last line of the script (in bold) is where it fails.
    thanks.
    Ed.


    echo ---------------------------------------------------- > C:\TRINITY\cold_restore_new2.txt
    echo Starting Oracle DB cold Restore >> C:\TRINITY\cold_restore_new2.txt
    echo | date | find "current" >> C:\TRINITY\cold_restore_new2.txt
    echo | time | find "current" >> C:\TRINITY\cold_restore_new2.txt

    echo Shutting down Oracle DB (SID=upload) ..... >> C:\TRINITY\cold_restore_new2.txt
    echo . >> C:\TRINITY\cold_restore_new2.txt

    start /wait F:\oracle\ora81\bin\svrmgrl @c:\Trinity\script\shutdown.sql

    echo . >> C:\TRINITY\cold_restore_new2.txt
    C:\TRINITY\sleep 30
    echo . >> C:\TRINITY\cold_restore_new2.txt
    echo Rename files ..... >> C:\TRINITY\cold_restore_new2.txt
    echo . >> C:\TRINITY\cold_restore_new2.txt

    cd /D F:\Oracle\ORADATA\upload
    REN DAT01CBA3LIVE.DBF DAT01upload.DBF
    REN DAT02CBA3LIVE.DBF DAT02upload.DBF
    REN IDX01CBA3LIVE.DBF IDX01upload.DBF
    REN RBS01CBA3LIVE.DBF RBS01upload.DBF
    REN SYS01CBA3LIVE.DBF SYS01upload.DBF
    REN TMP01CBA3LIVE.DBF TMP01upload.DBF
    REN USR01CBA3LIVE.DBF USR01upload.DBF
    if exist REDO01CBA3LIVE.LOG DEL REDO01CBA3LIVE.LOG
    if exist REDO02CBA3LIVE.LOG DEL REDO02CBA3LIVE.LOG
    if exist REDO03CBA3LIVE.LOG DEL REDO03CBA3LIVE.LOG
    if exist CTL1CBA3LIVE.CTL DEL CTL1CBA3LIVE.CTL

    echo UNCompressed and Renamed the backup files finished..... >> C:\TRINITY\cold_restore_new2.txt
    echo . >> C:\TRINITY\cold_restore_new2.txt

    echo . >> C:\TRINITY\cold_restore_new2.txt
    echo Files are uncompressed and ready >> C:\TRINITY\cold_restore_new2.txt
    echo . >> C:\TRINITY\cold_restore_new2.txt


    REM Create the database first
    echo Create the database >> C:\TRINITY\cold_restore_new2.txt
    echo . >> C:\TRINITY\cold_restore_new2.txt

    set ORACLE_SID=upload
    F:\oracle\ora81\bin\sqlplus -s internal/password1 @c:\Trinity\script\uploadrebuild_new.sql >> C:\TRINITY\cold_restore_new2.txt

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    You cannot use "internal" as logon id unless you have actualy created a user account called "internal", you must use a valid user account.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    Internal account existed prior 8.1.7.0.
    Code:
    C:\Documents and Settings\Administrator>sqlplus internal
    
    SQL*Plus: Release 8.1.7.0.0 - Production on Fri Apr 7 10:53:03 2006
    
    (c) Copyright 2000 Oracle Corporation.  All rights reserved.
    
    
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.0.0 - Production
    
    SQL>
    If you're running this batch JOB as a user that belongs to the ORA_DBA group (and you should) on your machine, you can try with
    Code:
    C:\Documents and Settings\Administrator>sqlplus "/ as sysdba"
    
    SQL*Plus: Release 8.1.7.0.0 - Production on Fri Apr 7 10:53:56 2006
    
    (c) Copyright 2000 Oracle Corporation.  All rights reserved.
    
    
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.0.0 - Production
    
    SQL>

  4. #4
    Join Date
    Feb 2004
    Posts
    45
    Edward, be aware that oracle will not allow external authentication for some privileged accounts. If you run into that problem then you can start sqlplus with the /nolog option, and place a connect command in the script you call, like this:

    sqlplus /nolog @<script path and name>

    in the script you would begin with a connect statement:

    connect use/password@connect-string
    It was working just 5 minutes ago - I promise !

Posting Permissions

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