Forum Stats

  • 3,875,496 Users
  • 2,266,929 Discussions


Need help in execution of script

DBA_Zeropoint Member Posts: 47 Blue Ribbon
edited Oct 7, 2013 10:32AM in ODBC

Dear experts,

We have a central database 10g installed on windows server 2008. We have 47 sites and each site has its own database. We created Materialized views in central DB which collect data from all 47 sites. We have a script to refresh these Materialized views. The problem is this when one/ some sites down, the script halts/stop working at that specific point. We want a script which skip that specific (down) site. following is some part of the script.

start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/password @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_AFLAGDB.SQL"

start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/[email protected] @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_SLAYELDB.SQL"

start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/[email protected] @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_DWASERDB.SQL"

(note: AFLAG, SLAYEL & DWASER specifying the site name). Please experts help me in this concern.



  • ReubenC
    ReubenC Member Posts: 80 Blue Ribbon
    edited Oct 8, 2013 9:56AM

    Probably the wrong forum for this question.

    My guess would be that you need to add some sort of check to see if the site is up before running the refresh.

    What is meant by having the site down?

    What kind of script is this?

    If it's a batch script:

    Batch script to test if Oracle instance is up on windows 2003

    Use that and loop through a text files of entries to try to connect to.

    Or you could probably do everything in a PL/SQL stored procedure if links are setup.  Having little idea what is in those SQL scripts I can't say whether or not this would be a good idea.

    There it would be a matter of testing the link by querying dual through the link and handling the particular exception(s) of a bad link properly.

    It would also reduce dependency on several script files.

    Looping through the instances would also probably be easier through a procedure.

This discussion has been closed.