Create a windows script to automate shutdown databases during maintainance

Can any one please me the script to automate shutdown databses during maintainance.
The script would be scheduled from the Windows server and will be shutting down databases hosted in AIX server .
Windows server will interact with Aix servers using SQLPLUS COMMANDS (TNSNAMES).
Please let me know because I am working on this issue and it needs to be resolved.

There are thousands of scripts available, just google it. In creation/execution of your script, if you face any problem or see any errors than you can come here and post it.

Similar Messages

  • Automatically Shutdown Database During VMware Server 'Shut Down Guest'

    I have 10g Enterprise Edition Release 10.2.0.4.0 running on Windows Server 2003 R2 under VMware Server version 2.0.0.
    I 'Power On' the VM and the OS/database start normally. I don't even open the guest OS console from VMware. I use TOAD and SQLPlus from the host machine to access my database.
    I'm trying to set up the database to do a clean shutdown when I use the VMware console to 'Shut Down Guest'.
    I've used the Group Policy Object Editor (gpedit.msc) to create a shutdown script under 'Local Computer Policy/Computer Configuration/Windows Settings/Scripts (Startup/Shutdown)/Shutdown'.
    The shutdown script is called Shutdown.bat and contains:
    rem adding the first two lines didn't affect anything, so I REMed them
    rem set ORACLE_SID=mysid
    rem set ORACLE_HOME=c:\oracle\product\10.2.0\db_1
    C:\oracle\product\10.2.0\db_1\bin\oradim -shutdown -sid mysid -shutmode immediate -log C:\oracle\product\10.2.0\db_1\database\oradim.log
    exit
    I get this in the oradim.log:
    Wed Apr 15 13:16:50 2009
    C:\oracle\product\10.2.0\db_1\bin\oradim -shutdown -sid mysid -shutmode immediate -log C:\oracle\product\10.2.0\db_1\database\oradim.log
    Wed Apr 15 13:16:51 2009
    ORA-12560: TNS:protocol adapter error
    I get this in sqlnet.log:
    Fatal NI connect error 12560, connecting to:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oraclemysid)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=mysid)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\oradim.exe)(HOST=myserver)(USER=OraUser))))
    VERSION INFORMATION:
         TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
         Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 10.2.0.4.0 - Production
    Time: 15-APR-2009 13:16:51
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12560
    TNS-12560: TNS:protocol adapter error
    ns secondary err code: 0
    nt main err code: 530
    TNS-00530: Protocol adapter error
    nt secondary err code: 2
    nt OS err code: 0
    Note: If I open the guest OS console and execute the Shutdown.bat file as myself (I'm in the administrator and ora_dba groups), it works perfectly ... as does opening SQLPlus and issuing 'shutdown immediate'.
    I'm stuck. Any ideas?
    Thanks.

    We are also having the same issue. We create a shutdown script via the Group Policy editor which works fine if we do a manual shutdown, but if we do a remote shutdown ex: "shutdown /r /f /m <servername /t 120", it does not work, the Database crash.
    As mentionned the script works when we do a manual shutdown but does not work for a remote shutdown. The group policy script contains the following:
    echo Rebooting server START at %DATE% %TIME% >> E:\oracle\product\admin\test\Reboot.log
    net stop <Oracle servicename>
    echo Rebooting server MIDDLE at %DATE% %TIME% >> E:\oracle\product\admin\test\Reboot.log
    net stop <Oracle servicename>
    echo Rebooting server END at %DATE% %TIME% >> E:\oracle\product\admin\test\Reboot.log
    After the reboot we see all the echoed line in the "reboot.log" file but the "net stop" doesn't get executed or failed since the database crash and recovers
    Any ideas/feedback ?
    Thanks

  • Command prompt window script to automatically run adobe media encoder

    Does anyone know of a way to run adobe media encoder from the command prompt or batch file?
    I would like to automatically invoke a script, much the way I do for Adobe After Effects.
    (I do not mean batch encode from the software.)

    This sort of thing is quite easy to accomplish in Windows using Notepad and the keyword Start.
    You would type something like
    start amencoder.exe (although I don't know the exact full path and exact name of Adobe Media encoder).
    Save your text from above into notepad as a .bat file .
    I'm not sure how this would be done in Mac but I'm sure there are similar options using the Terminal.
    Why do you need to do this when you have an icon that can be double-clicked to invoke the program, by the way?

  • How can I create a windows scheduler for shutdown my system in network?

    Hello.
    I want to create a windows scheduler for shutdown my system in a specific time but it can't let me to create it. I used below link to create a task but when I click on Finish it show me an error about permission. I used administrator account too but
    got same error.
    http://www.wikihow.com/Automatically-Shut-Down-Your-Computer-at-a-Specified-Time
    Thank you.

    Hello,
    Can you try opening Task Scheduler as Administrator :
    Right-click on "Task Scheduler" shortcut and select "Run as administrator
    Regards,
    Régis

  • Script to automate the display language on windows server

    Hi,
    I'm looking for a script which should change the windows display language from non-english to english (vizversa).
    Here is the scenario:
    On windows server 2008 R2 I have two language installed - Japanese and English with the help of MUI packs available on microsoft site. The native language of windows server 2008 R2 is Japanese. Consider there are 10 sys admins only knows
    Japanese but not english. Similarly there are 10 sys admins knowing only English. I  being english administrator, i should each time go to regional setting in the control panel and click on change display language to english. After
    I finish my task I need to set back the language to japanese(native).
    I'm looking for script which can auotmate this process.
    Objective:
    The script should automatical change the language to Japanese when I logoff from the system. 
    Here is the steps to reach "Change Display language" on windows server 2008
    Go to control Panel > Category view (on right side top ) > System and Security > Clock ,Language and Region > Under “Regional Language” > Change display
    language > Go to Tab “Keyboards and Languages” > Look for the dropdown menu “Choose a display language” and choose the appropriate language you prefer from the dropdown list
    Kindly note this menu/option is available for Vista,Windows 7 and Windows Server 2008. This option is also available on Windows XP/Server 2000/2003 provided the LIP/MUI is installed.
    Thanks
    Ezakial

    Hi,
    I'm looking for a script which should change the windows display language from non-english to english (vizversa).
    Here is the scenario:
    On windows server 2008 R2 I have two language installed - Japanese and English...
    Thanks
    Ezakial
    Guys,
    Forgive me, but I think you are making this far too complicated. Using a script to achieve this is, in my view the wrong tool, and a little dangerous. If your logoff script fails to run for any reason, 11 Japanese sysadmins will be waving Samurai swords
    at you :-).
    There is a single Group Policy setting that will do exactly what you want on Vista, W7, W2K8 & R2.
    Create a new Group Policy object ("English_interface", for example.
    Edit the new policy object
    Drill down to "User Configuration, Policies, Administrative Templates, Control Panel, Regional and Language Options"
    Pick the setting "Restricts the UI languages Windows should use for the selected user" and Enable it.
    Drop down the "Restrict users to the following language" and pick "English"
    Click "OK"
    Link your new GPO somewhere in the OU hierarchy that contains the English user
    If other (Japanese?) users are also in the same container, you can filter application of the GPO by security group so that the policy can only be read and applied by the English group.
    That's all you need to do!
    As a point of principle. I ALWAYS install my OS in US English then add languages, and set the locals to use their own language. This is because service packs and hotfixes invariably arrive for US English first, and some hot fixes are NEVER translated.
    I'm just doing this for a single W7 build in English, to be deployed in 6 countries, with 7 different languages and 9 different keyboard layouts. Fun...
    Come back if you need more help. I volunteer to visit and help if you want!
    Richard
    MCSE, MCITP, MCT etc.
    Switzerland
    RS

  • Automatic shutdown of an database's instance

    For some unknown reasons, an instance of our database was shutdown automatically almost every night. I have to run Oracle Enterprice Manager to re-open the instance.
    I checked Windows Event Viewer but I could not find any info to determine which cause our database's instance shutting down. Our Oracle version: 9.2
    Anyone know what would have caused an automatic shutdown of an database instance in Oracle?
    Please help
    Thanks

    Thanks for all responses to my question.
    I found the cause of automatic terminating database instance.
    I looked into the Oracle trace log and I found the error 340: IO file lock by other process. Then I googled this error and found a related article. One of the oracle files was locked by Veritas File Backup Exec process to perform nightly backup.
    Thanks
    Norm

  • Automatic shutdown/startup EBS DB script on R12.1??

    Our EBS R12.1 system going to production soon. I wonder anyone have automatic shutdown/start database scripts (only DB, application on seperate server) which we can reference.
    Thanks.

    Hi ef;
    We are using cold backup sh and sometimes we faced same thing as you mention. But i can tell you its not soo fruquently. How we notice this error? After cold backup we send email about cold backup logs. If we see error on log files (after apps side down(and wait 240 sec),then closind db)
    we have this error in log:
    Shutting down database ZZZ
    SQL*Plus: Release xxx -Production on
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Connected.
    ORA-01013: user requested cancel of current operation Disconnected from Oraclex Enterprise Edition Release xxx- 64bit Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release xxx Production
    so we find related process id from log file and kill it as Hussein Sawwan mention
    Hope it helps
    Regard
    Helios

  • Need Help in creating Unix Shell Script for database

    Would be appreciable if some one can help in creating unix shell script for the Oracle DB 10,11g.
    Here is the condition which i want to implement.
    1. Create shell script to create the database with 10GB TB SPACE and 3 groups of redo log file(Each 300MB).
    2. Increase size of redolog file.
    3. Load sample schema.
    4. dump the schema.
    5. Create empty db (Script should check if db already exists and drop it in this case).
    6. Create backup using rman.
    7. restore backup which you have backed up.

    This isn't much of a "code-sharing" site but a "knowledge-sharing" site.  Code posted me may be from a questioner who has a problem / issue / error with his code.   But we don't generally see people writing entire scripts as responses to such questions as yours.  There may be other sites where you can get coding done "for free".
    What you could do is to write some of the code and test it and, if and when it fails / errors, post it for members to make suggestions.
    But the expectation here is for you to write your own code.
    Hemant K Chitale

  • Creating the Windows Service for the Database Instance

    Hello, I am using the PeopleTools 8.52 Installation for Oracle documentation and was in Task 6A-2: Creating the Windows Service for the Database Instance.
    After I type in
    oradim -new -sid ORCL -intpwd manager -startmode auto -pfile C:\Oracle\database\initORCL.ora
    I had encountered these errors:
    OPW-00005: File with same name exists - please delete or rename
    DIM-00019: create service error
    O/S-Error: (OS 1073) The specified service already exists.
    Please advise.... Thank you in advance!

    Hi, thank you for your reply!
    After I typed oradim -delete -sid ORCL, it shows this:
    Unable to stop service, OS Error = 1062
    Instance deleted.
    Then, I:
    Set ORACLE_SID=ORCL
    oradim -new -sid ORCL -intpwd manager -startmode auto -pfile C:\Oracle\database\initORCL.ora
    Then, it shows:
    OPW-00005: Files with same name exists - please delete or rename
    Instance created.
    Does it mean no error already and I can proceed?

  • Automate the database and forms / reports services to start on windows 2008 server R2 startup

    Dear memebers,
    I want to automate the database and forms / reports services to start on windows 2008 server R2 startup. whats the possibilities and which method is the best?
    Regards:

    Hi,
    type services.msc at run
    then check for Oracle Services--> Right Click-->Properties-->Startup type-->start automatic
    HTH

  • Database Development, how to create a drop script generated by JDeveloper

    Hi to all,
    JDeveloper generates a "create script" for an offline database or a real one. But, I can not see a drop script generation for that. Is there any practical way to generate one? Or do we need to use data dictionary and write something customized?
    Also, is there a way to avoid generation of the tablespace information in create script? Even though I'm disabling the tablespace information from the table definition, it gets created to the "create script" anyway. That is nice, but it degrades the portability.
    Thank you for your time.

    Hi Susan,
    1. A drop script would be a script to reverse the creation of the create script. Of course, this would be in somehow intelligent way, such as dropping constraints and foreign keys first, and then removing the tables etc. This was a feature in another product that I have abandoned before switching to Oracle JDeveloper. I'm missing this feature because : Me and my colleagues are working on one single schema, with some part is production ready and some is not and each part is assigned to different people. So, it would be nice if we could have a chance to load the creation script of the part which is under development next to the production ready part, test it, and drop only the newer(development) one without affecting production ready tables which are under production test. The database modeler is very useful, and the offline database concept is great, but I would be very happy if we had this feature too.
    2. "Remember to remove the storage options from Indexes (properties - storage options)" Aaahh, that was I missing. Also, the reason I want to remove the storage options from the generation script was also related with the scenario I stated in 1. The production machine has more detailed, optimized and advanced storage properties that we can not mimic on our test/development machines.
    Your answer was very useful, thank you for your time.
    Caglar Toklu

  • Script stops automatically on windows server 2008, IE8 is not launched or it doesn't navigate

    QTP 11.0 - Script stops automatically on windows server 2008, IE8 and works fine on other standalone machines having Windows 7. Pls advise. It is very weird, it suddenly stops launching IE8. Sometimes it launches IE8 but des not navigate from one step to another. I have scheduled it using a vbscript though windows scheduler.  I tired to uninstall QTP, then reinstall, it works fine for first run but stops again.

    To Wendy23,
    Just for clarity, the Windows Server 2008 OS that I ran ROBOCOPY and XCOPY on was the non-R2 version. Microsoft might have fixed this issue in R2.
    You'll probably need to logon as local Administrator or use an account belonging to the local Administrators group.
    Also, open the Command Prompt using "Run as Administrator" (right-click on Command Prompt), then run the XCOPY and ROBOCOPY commands from within this prompt.
    To answer G.Write, the storage is local hard disks.
    Thanks, was a long time ago, I was having a problem with robocopy not copying permissions on a SAN, and was wondering if the SAN was the problem, but your method worked fine for me, thanks.

  • Oracle database automatically shutdown when i restart computer

    Hi all!
    i have some problems, so i want your help
    i have the database which name is ORCL but i don't understand why when i restart my computer, my database automatically shutdown, so i alway have to execute this command after restarting my computer
    connect / as sysdba
    startup
    could you show me how to fix that error
    help me!

    Hi,
    Refer this thread for a full explaination...
    Oracle service failed to start in a timely manner
    Regards.

  • Can OATS scripts that are created on Windows version run on a LINUX version

    Can ATS scripts that were recorded/ created on Windows version of ATS be ported to a LINUX version of ATS and run successfully. Do both versions of ATS need to be identical?
    we are using version internal Windows build version 9.31.0029 and the LINUX version is the current downloadable version 9.31

    Hi,
    As far I am aware the only Linux option in ATS (GA version) at the moment is the load agent. If you create a load test script in OpenScript on Windows it should run fine using the Linux load agent. The Linux load agent will need to be the same version as the version of OLT that you are running.
    Regards,
    Jamie

  • Create new window in SAP Script

    Dear All
       how to create new window in sap script
    Regards
    Suresh
    Edited by: Alvaro Tejada Galindo on Apr 9, 2008 11:58 AM

    Hi,
    To create a new window in scripts.
    1.  After opening the form in SE71   Click on Windows push button.
        it will gives a screen  list of windows in a page
    2. Click on Edit option in menu bar  in Edit-->Create Element click it will gives a popup window in the window give Name of the window and short description press enter  like that you can create windows in  a page
    3.  Click on Page windows it will gives a screen where that window you want to place in that page.    Click on Edit option on menu bar Edit-->Create Element
    it will gives a list of windows which your created in a page   here you have to select which window you want to place.  Double click on that window it will adds on the page and give the bottom of the screen you can find  standard attributes block
    there you have to give the position of the window in a page. 
    or
    Click on setting option on menu bar  settings-->form painter
    it will gives a GUI editor here you can drag the window position it is easy to use.
    then you can see the layout.
    Thanks
    Ganesh

Maybe you are looking for

  • Total balance amount not displayed correctly

    i have shown my table below my problem is that the balance amount being displayed on form displays the total balance amount and total balance amount being displayed is the sum of all balance amount,hence the final total which iget at the end is incor

  • Can't get past setup assistant after installing leopard...

    i am having trouble getting past the setup assistant after installing leopard on my other computer which is a 1.25 ghz G4 desktop. Everything seems to be going fine then the setup assistant comes up and i go through the exercise of filling it out and

  • Adobe Pro XI Software

    We began with a Word document, then someone made changes and returned it in pdf format without comments.  Will Adobe Pro XI allow me to determine what changes were made?

  • Dv6-3050us touchpad / touchbutton issues? Inconsistent behavior touching vs. pressing the buttons.

    Okay, so here's the deal: The DV6-3050US has an integrated touch device. That is to say, both the typical touch pad AND the left/right buttons are touch-sensitive. However, they do not exhibit the expected behavior... Specifically, the right "touch b

  • Importing XML to automate layout

    Hi, I have been trying for days to import a XML datafile into InDesign CS4. I have successfully achieved the following: Created a DTD file Imposrted Tags Created tagged text and image elements Made sure the structure of document matches XML file Vali