Scheduling shutdown

i want to schedule shutdown of database.
i have tried 2 methods-
1st-->
shut.bat
set oracle_sid=anmreco
sqlplus "/ as sysdba"
@"C:\Documents and Settings\hp\Desktop\shut.sql"
shut.sql-->
shutdown immediate;
2nd -->
shut2.bat
set oracle_sid=anmreco
sqlplus "/ as sysdba"
shutdown immediate;
however both the methods only gets me connected to oracle as sysdba. The shutdown immediate does not seem to execute.
Whats the problem?
Thanks
Anmol

Hi Anmol,
The Scheduler typically clears out variables before running an executable so you would also have to set ORACLE_HOME and specify the full path to sqlplus.
Also in your job you cannot point to a Windows batch script directly you have to call it like
cmd.exe
/q
/c
script.bat
If you are running on a 10.1 database you should make sure your scripts produce no output to avoid running into a known issue on this release. You should redirect output (e.g. from sqlplus) to a log file. This will also help you diagnose what is going on.
Hope this helps,
Ravi.

Similar Messages

  • Scheduled shutdown no longer works in Keynote 4.0 iLife 08

    Those of us using Keynote, a large LED monitor and a Mac Mini as a Digital signage system have found that the new Keynote 4.0 in iLife 08 will not allow a scheduled shutdown. This worked well under the old version.
    We had been on iLife 06 and 10.4.9. We found that Keynote crashes every few days when you try and run a show 24/7 so we had used the energy saver settings to have it shut down at 1AM and restart at 2AM. This was working well, the only trick was to always name the current slide show the same thing and have Keynote auto launch at startup and run the slideshow.
    Last week we reimaged a Mini with 10.4.10 and iLife 08 and put in place of the 10.4.9 ilife 06 mini, the first time it was suppose to shutdown it hung, there was an error on the screen that said "Keynote had canceled shutdown".
    Testing proved the following:
    Schedule shutdown does not work at all when a Keynote presentation is running. You get this error.
    "The application Keynote canceled shutdown. To try again quit Keynote and choose shut down from the Apple menu"
    It will auto shutdown and startup IF a Keynote slide show is NOT running.
    It will do a scheduled shutdown if just the Keynote App is running.
    If the Keynote app is running a normal shutdown command will work.
    Does anyone know a work around or a fix?

    The thread "Keynote Cancelled Shutdown: how do I troubleshoot?" has recently posted a possible solution but is there an explanation or a fix planned?

  • Mavericks Scheduled Shutdown not working

    Since upgrading to Mavericks 10.9.2 , about 2 weeks ago, (from Snow Leopard 10.6.8) unable to get Energy Saver / "Scheduled Shutdown" working.
    Scheduled Startup works without any problems, everyday at selected time, my iMac boots up; but when I have a time set for "shutdown" it just goes to sleep.  Never had this problem with Snow Leopard 10.6.8 - always worked on schedule everyday.  Tried not selecting both Startup and Shutdown, and doing it manually; but whenever I go back to set the Startup and Shutdown, it never works in Shutdown.   Any help on how to solve this, would be appreciated.
    Running iMac 21" 16GB RAM, Ma

    I think I spoke too soon, about Scheduled Shutdown working OK.  It does not work when Mac is in "Sleep Mode"...I tried it again this morning, set a schedule time for shutdown, 10 minutes out from present time.
    Did not allow screen or computer to go into sleep mode, and guess what ?  Up pops the scheduled shutdown screen, saying this computer will shut down in 10 minutes. OK that worked.   I then changed the shutdown schedule again, for a later time, now I allowed the Display and Computer to go into Sleep mode, per settings I have in System Preferences/Energy Saver -> "Display Sleeps in 10 Minutes - Computer sleep in 15 minutes. I returned 40 minutes later, -- Computer and Display are in Sleep mode, return key to bring screen back up,---- and Scheduled Shutdown was not activated.  Have no background programs running that causing errors in Console.  Therefore there is a software flaw somewhere, that will not allow "Schedule Sutdown" to activate when computer is in sleep mode.   Any suggestions on how to correct this would be appreciated.
    Winston

  • Scheduled shutdown immediate and full database export

    Hi all,
    The database is Oracle 10g.
    How to make a scheduled shutdown immediate and full database export ? I want to use a batch file for it so I can make a sheduled task from the windows control panel everyday at 2 am. So what to write in the batch file because I am a bit new to 10g ?
    Thank you very much

    >
    How to make a scheduled shutdown immediate and full database export ? I want to use a batch file for it so I can make a sheduled task from the windows control panel everyday at 2 am. So what to write in the batch file because I am a bit new to 10g ?No, you can't take logical backup after shutdown database.
    If you want to schedule the logical backup of your database, just you can refer from here
    Schema level
    http://mohamedazar.wordpress.com/2010/04/18/datapump-scheduler-for-schema-level/
    Full export
    http://mohamedazar.wordpress.com/2010/02/16/dbms-scheduler-for-data-pump/

  • Scheduled shutdowns issue

    Under Yosemite, automatic shut downs scheduled in the Energy Saver System Preference no longer work when the Mac is at the login screen.
    According to the following support document, this appears to be a 'feature' rather than a bug:
    https://support.apple.com/kb/PH18583?locale=en_US
    In all prior versions of the Mac OS through Mavericks, scheduled shut downs are honored whether or not any user is logged in.
    This new restriction in Yosemite is problematic: at my offices there are many shared desktop Macs (iMacs and Mac minis) with scheduled start ups and shut downs. When no one is actively using the stations, they are (or should be) at the login screen.
    Asking people to remain logged in when done with these stations, so that the scheduled shutdowns would work, would have unwelcome consequences, such as: open applications preventing shut down, and other users not able to log in during the day because they could not unlock the screen saver for the previous still-logged-in user.
    The scheduled start ups (if I've manually shut down the Mac) still work as expected. But these scheduled shut downs not being honored when no one is logged in is a big issue, which will probably prevent me from upgrading shared Macs beyond Mavericks because I don't want them to remain on 24/7/365. I have already submitted feedback to Apple on this issue.
    Has anyone found a way to get scheduled shutdowns to work under Yosemite when no user is logged in?

    Does cron still work? It's brutal but you could setup a shell script to be triggered from cron (or use shutdown directly).
    Take a look at the shutdown manual.
    https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man8/shutdown.8.html
    0 20 * * * /sbin/shutdown now
    If that was in roots crontab it should stop them at 8pm, this is untested, I'm away from 10.10 at the moment. You may need to ensure the machine is awake, I think cron will not wake the OS for jobs.
    launchd may be another option, but I'm still unsure if the OS wakes to run scheduled jobs.
    Ideally you would clean up any unsaved work & logout active users, or bail out if there is an active login, hence the shell script to handle some logic.

  • Scheduled shutdown when another user is logged in

    I like my Mac to shut itself down each evening at 9pm and then switch on at 8.30am - which is easy to set within Energy Saver.
    However, if I have another user account open (which I often has), the computer will not shutdown unless an Administer's name and password is entered. This means that I have to be there to do this - which negates the reason for having a scheduled shutdown.
    I know that no data will be lost if the other account is closed down, so is there any way around this?
    Thanks
    Phil

    Not that I am aware of. Data could be lost if someone is in the middle of work and the Mac shuts down without giving the user and opportunity to save the work.
    Why do you want to do this? Why not just leave the Mac on all the time? Are you trying to force your kids off the Mac at a predetermined time?

  • Scheduled Shutdown

    Since installing 10.5.2 on my G4 mac the scheduled shutdown does not happen. If I shut the computer down manually I have no problems with scheduled startup. I have not other problems with the machine and no problems with normal shutdowns.

    how can i create a system agent who force shutdown? i try this software (launchd manage)
    http://macupdate.com/info.php/id/19879 but is not user friendly.
    editing crontab is completely useless under os x 10.4
    ideas?

  • Scheduled shutdowns

    I have my MBP and iMac set up to shutdown every weekday (my GF likes to leave them on!!) but if they are already shutdown they start up just before their scheduled shutdown time and then shut themselves down, is this a common problem with Leopard? I don't see the point in starting up to shut down if it's already shutdown.
    Does anyone know if there's a fix to this (apart from removing the scheduled shutdown)? Does anyone else have the same problem?

    Try trashing the Power Management preferences, restart and reset them to how you like.
    You can find the file here:
    Hard drive/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist

  • Power Saving & Scheduled Shutdown

    I work in a computer lab at a grammar school... it's a small room but we have 15 eMacs squeezed in, and they generate a lot of heat. I've tried putting the machines on a schedule to start up at 9 am on weekdays, and shut down at 6:30 pm every day, but invariably, they're asleep at 6:30, and so the shutdown never happens. I set them to never go to sleep, too, but it doesn't seem to stick. We're running 10.3.9 on most of these. This sound familiar to anyone?

    Hi,
    You can create a scheduled task using group policy preferences to initiate shutdown.
    Checkout the below thread on similar discussion,
    http://social.technet.microsoft.com/Forums/en-US/c01687ff-d42d-4e32-9305-6ba3802b68b0/how-to-schedule-shutdown-task-by-group-policy-?forum=winserverGP
    FYI
    The file path for the executable to initiate shutdown, restart, logoff, hibernate -
    c:\windows\system32\shutdown.exe
    Command for,
    Shutdown - shutdown -f -s
    Restart     - shutdown -f -r
    Logoff       - shutdown -f -l
    Hibernate - shutdown -f -h
    Regards,
    Gopi
    JiJi
    Technologies

  • Schedule Shutdown that Cannot be Canceled?

    Would like to schedule a shutdown that cannot be canceled (except by Admin user obviously). So I can force my teenager off the computer at bedtime! Normal scheduled shutdown can be canceled by anyone.
    Would be happy to pay for a 3rd party utility that permits this if needed.
    Thanks

    One idea: if your teen connects through a router, you often can configure the router to allow Internet access only at certain times.
    Or, set up a separate, non-Admin user account for your teen's use.
    Also, from OS X Help:
    To set time limits on computer use:
    Choose Apple menu > System Preferences and click Parental Controls.
    Open Parental Controls preferences
    Click the lock icon to unlock it, and then enter an administrator name and password.
    Select the account you want to limit, and then click Time Limits.
    To set a maximum amount of time that the computer can be used during the week (Monday through Friday), select the “Limit computer use to” checkbox under “Weekday time limits,” and then drag the slider to adjust the number of hours per day the computer can be used.
    To set a maximum amount of time that the computer can be used during the weekend, select the “Limit computer use to” checkbox under“Weekend time limits,” and then drag the slider to adjust the number of hours per day the computer can be used.
    To restrict computer use on evenings prior to a weekday (Sunday night through Thursday night), select the “School nights” checkbox under Bedtime and then use the up and down arrows to specify the time during which computer use is blocked.
    To restrict computer use on Friday night and Saturday night, select the Weekend checkbox under Bedtime and then use the up and down arrows to specify the time during which computer use is blocked.
    Message was edited by: inandoutofgrace

  • Scheduled shutdown and power settings

    I have set up a policy to shut down all domain computers at 1900 every day with Task Scheduler via GPO, but there is still something that I need to configure.
    Working hours of the company that I work for, are from 0800 to 1700, but there are still employees that remain after working hours to finish their daily tasks. Many time it happens that the any computer won't be used at all, but they just do not shut it
    down.
    I would like to set a policy which would apply after 1700 to send the computers to sleep mode after 30 minutes of inactivity and then shut down the computers that have been on sleep mode for more then 15 minutes. So they do not have to wait till 1900 to
    shut down.
    Thanks

    Hi,
    You can create a scheduled task using group policy preferences to initiate shutdown.
    Checkout the below thread on similar discussion,
    http://social.technet.microsoft.com/Forums/en-US/c01687ff-d42d-4e32-9305-6ba3802b68b0/how-to-schedule-shutdown-task-by-group-policy-?forum=winserverGP
    FYI
    The file path for the executable to initiate shutdown, restart, logoff, hibernate -
    c:\windows\system32\shutdown.exe
    Command for,
    Shutdown - shutdown -f -s
    Restart     - shutdown -f -r
    Logoff       - shutdown -f -l
    Hibernate - shutdown -f -h
    Regards,
    Gopi
    JiJi
    Technologies

  • Scheduled shutdown stops if there are connections

    My Mac Pro acts as a server in my home.  I used to run it 24/7 with an occasional reboot when things seemed a bit amiss.  So I decided to schedule a shutdown at midnight and startup at 6AM everyday.  Because it is my server, I connect to it from my other Macs.  But when the schedule tries to shutdown, it warns that a user is sharing this computer and will not shutdown until I click the restart button.
    Is there a way for me to skip this step or to force a shutdown w/o this warning coming up?  Seems this step negates the scheduling of shutdowns/restarts.

    Here the thing.. what happens when the user clicks the "shut down" button in the warning? The answer.. exactly what should happen without the warning. Users are disconnected and then the shut down processes intiated.
    All the moumbo jumbo about data loss etc. is just panic-talk. If a file transfer is actually in progress the OS knows it and therefore prevents shutdown (and disconnect). It's VERY clear that markwmsn has no clue what he's posting about and is merely an Apple fanboy.
    Face it, The OS gets worse and worse. This is one of those processes which has ran flawlessles since, heck OS8. Now markwmsn wants us to beleive there's a reason it no longer works as expected. He's just full of it and making excuses for things he doesn't know about.
    Apple, please fix your shut down scheduler.

  • Schedule shutdown stops working after putting the computer to sleep

    I had trouble scheduling the computer to shut down after upgrading from Mac OS 10.3.9 to Mac OS 10.4.6. I accidentally left my screen closed on my PowerBook G4 after scheduling it to startup. It startup with the scceen closed and in sleep mode. After that it wouldn't shutdown after scheduling to shutdown.
    So I read a Post to trash Library/preference/SystemConfiguration/com.apple.Autowake.plist. That worked but now it won't shutdown after being put to sleep even when it is woken.

    Yes, just put your computer to sleep whenever you judge it right.
    The three nightly maintenance tasks are not important enough to change your habits,
    they do not affect OS X performance: only disk space.
    And yes, since 10.4.2 they are automatically delayed if your computer was sleeping, but you still have to run them manually
    — all three together once a month is fine —
    if you sometimes shut down or reboot your computer.
    Use this Terminal command
    sudo periodic daily weekly monthly
    or one of the "cache-cleaners" utilities like Cocktail etc.
    HTH
    Axl

  • Disable schedule shutdown

    I used command line in terminal to schedule my mac to shutdown, now I want to disable that schedule, but don't know how, please help.

    I'm using AMD, but xsensors says that I'm running ~90C, which seems super high, actually.  Why doesn't Windows or Ubuntu make me shut down?  Is it just that Arch makes my system run hotter?  I installed laptop-tools, but didn't configure it as I didn't understand how, and it doesn't seem to be helping.  And neither is that extra line i put in the kernel line of menu.lst that I found in the [SOLVED] Huge power consumption after upgrading kernel thread.
    Any other ideas?  I just had to reinstall GRUB and such because the system shut itself down during the middle of an upgrade.  Pain in the butt.

  • Preventing app relaunch on boot after scheduled shutdown?

    Hi—
    I have my Mac(Book Pro) scheduled to shut down at night, and restart each morning.  After upgrading to Mountain Lion, I'm noticing that whatever apps were open at shutdown are re-opening at launch.  The "reopen windows" checkbox is NOT checked when I restart, either manually or via the schedule.
    How can I make sure that the Finder and other assigned Login Items are the only things to launch when I log in?
    Thanks.

    Hi,
    Yes, I did resolve it - it was the graphics card. Changed that, updated OS X and it was done.
    I can't now remember exactly which card I used, and I'm away at the moment so I can't get to the infomation, but I do remember that it was a full length card with a large heatsink, and was a bit of a pig to squeeze into the chassis!
    Had to buy an adaptor for the second monitor connection, but that didn't cause any hassle. I got the card and cable from the local Apple Store.
    It also theoretically needed a later version of OS X than was already there, but since it allowed me to boot off the CD, that didn't matter (and it worked with the old one anyway, as it turned out).
    Oh, and also of course, although it's a bog standard PC card, you have to pay way over the odds for it because it has to have different PROMS for a Mac. (Thank you Apple.)  Just part of the price we all have to pay for using Macs.
    I seem to remember that there was a certain amount of dancing involved in upgrading the OS afterwards (might have had to do one step twice), but nothing that unusual.
    Hope this helps,
    All the best,
    Brian

Maybe you are looking for

  • Fireworks won't recognize mouse clicks on the canvas/I cannot select items.

    Recently, Fireworks has been acting weird.  When I try to click on an item on my canvas (with the pointer tool), such as a shape, a bitmap, or some text, I can see the corners light up as I hover over it, but when I click, nothing happens.  I have no

  • Mystery Virtual memory/disk usage

    I have installed SL on a Mac Mini and MBP with no problem. But now I have installed it on a Macbook and something is eating the disk and/or virtual memory. After a fresh reboot I have 120G free disk space. This steadily reduces until the OS starts po

  • Is it possible to have an ssd installed by an authorized technician in Turkey?

    I have an imac 2011 27 that i want a ssd to be installed. while i can do it my self , i would prefer that is to be installed by an authorized technitian. I've talked to them and the response i got was it is not possible to add an ssd to imac as a sec

  • External swf size issue

    Hai.... how get swf width and height using loader ,we are getting different values .... // Fla document size is 550 X 400,but we are getting 500 X 375... <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"                                 

  • Poviding inpiut to datasource from output of another datasource

    Hi All, I hv two datasources, bapis to be precise. The output of one bapi(A) provides the input to the other bapi [BAPI B - provides me the data for display on iview]. i hv a datalink connected from output port of A to input port of B and mapped the