1 Reply Latest reply: Oct 8, 2013 8:56 AM by ReubenC RSS

    Need help in execution of script

    DBA_Zeropoint

      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/password@rrdb @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_SLAYELDB.SQL"

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

       

       

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

        • 1. Re: Need help in execution of script
          ReubenC

          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.