Shell Script  for Startup and Shutdown the database

Hi,
i want Shell Script for Startup and Shutdown the database in Solaries.
could any one can hep me where i can get this script. or send to me to [email protected]
Thanks & Regards,
Gangi reddy

SHUTDOWN
SHUTDOWN ABORT]
Shuts down a currently running Oracle instance, optionally closing and dismounting a database.
Terms
Refer to the following list for a description of each term or clause:
ABORT
Proceeds with the fastest possible shutdown of the database without waiting for calls to complete or users to disconnect.
Uncommitted transactions are not rolled back. Client SQL statements currently being processed are terminated. All users currently connected to the database are implicitly disconnected and the next database startup will require instance recovery.
You must use this option if a background process terminates abnormally.
IMMEDIATE
Does not wait for current calls to complete or users to disconnect from the database.
Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.
NORMAL
NORMAL is the default option which waits for users to disconnect from the database.
Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.
TRANSACTIONAL [LOCAL]
Performs a planned shutdown of an instance while allowing active transactions to complete first. It prevents clients from losing work without requiring all users to log off.
No client can start a new transaction on this instance. Attempting to start a new transaction results in disconnection. After completion of all transactions, any client still connected to the instance is disconnected. Now the instance shuts down just as it would if a SHUTDOWN IMMEDIATE statement was submitted. The next startup of the database will not require any instance recovery procedures.
The LOCAL mode specifies a transactional shutdown on the local instance only, so that it only waits on local transactions to complete, not all transactions. This is useful, for example, for scheduled outage maintenance.
Usage
SHUTDOWN with no arguments is equivalent to SHUTDOWN NORMAL.
You must be connected to a database as SYSOPER, or SYSDBA. You cannot connect via a multi-threaded server. For more information about connecting to a database, see the CONNECT command earlier in this chapter.
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013607
Joel Pérez

Similar Messages

  • Shell script for creating,altering, etc ., a database

    hi there,
    Please help me to find shell scripts for creating,altering, etc a database..
    Thanks & Regards,
    Balu.

    Thanks to all , but dbca generates XML files :
    <DatabaseTemplate name="MYDB" description="" version="10.2.0.0.0">
       <CommonAttributes>
          <option name="ISEARCH" value="false"/>
          <option name="OMS" value="false"/>
          <option name="JSERVER" value="true"/>
          <option name="SPATIAL" value="true"/>
          <option name="ODM" value="true">
             <tablespace id="SYSAUX"/>
          </option>
          <option name="IMEDIA" value="true"/>
          <option name="XDB_PROTOCOLS" value="true">
             <tablespace id="SYSAUX"/>
    ..................I need a file.sql script to launch in sqlplus. Something like the following :
    CREATE DATABASE MYDB
    USER SYS IDENTIFIED BY ***
    USER SYSTEM IDENTIFIED BY ***
    LOGFILE GROUP 1 ('/home/oracle/oracle/instances/oradata/MYDB/redo1/redo01.log') SIZE 15M,
    GROUP 2 ('/home/oracle/oracle/instances/oradata/MYDB/redo2/redo02.log') SIZE 15M,
    GROUP 3 ('/home/oracle/oracle/instances/oradata/MYDB/redo3/redo03.log') SIZE 15M
    ......................

  • Shell Script For Export And Import Of Table Records

    Hello,
    We have production and test instances and for constant testing we need to copy data from production to test or development environment.
    At the moment what we do is manually doing export and import table records. At times this could be very tedious as we may need
    to do this exercise a couple of times in a day.
    Is it a good idea to do this exercise using shell script? If so how could I do this? If this is not a good idea what are the best alternatives?
    Any input is highly appreciated.
    Thanks

    Ah I see, your company prefers stupidity over efficiency. It would be possible to do it in a controlled environment, wouldn't it? Also the test database would be allowed to select only.
    So the non-allowance is just plain stupid.
    To the second question: do you use hard-coded passwords in shell scripts?
    Don't you think that poses a security risk?
    Don't you think that is a bigger risk than a database link, properly set up?
    In my book it is!
    Sybrand Bakker
    Senior Oracle DBA

  • [SOLVED] advanced shell script for mount and unmount samba share

    Good morning guys,
    Today I've a very long question....
    Hope in your help....:
    I usually move from different network.
    For one of those I need to mount some share that are under an ActiveDirectory server.
    To do that I use samba.
    Especially I've made and use the below  shell script.
    I know that it's so stupid but I'm a very newbie:
    #!/bin/sh
    echo "This is a custom script for mount my citrix share"
    echo "Please insert user password (must a sudoer user)"
    echo " "
    sudo mount -t cifs -o username='myusername',password='mypassword' //host_ip/TsHome$/myusername /home/myuser/samba_share/TsHOME
    sudo mount -t cifs -o username='myusername',password='mypassword' "//host_ip/direction" /home/myuser/samba_share/direction
    echo " "
    read -p "Press ENTER key to close this terminal"
    exit
    As I say the script work but it's so crude...!
    I want/need to implement it whit the follow addictions:
    1. print a feedback on mount: somenthing like "TsHOME is now mounted" or "unable to mount TsHOME"
    2. check if the share are already mounted: to prevent accidentally multiple mount. If a share is already mounted I want to print something like "TsHOME is already mounted on /home/myuser/samba_share/TsHOME"
    3. ask for share password  (now it's in clear on script) - This is optinal
    4. un-mount the share before reboot or shutdown command. That because I've notice that If i reboot or shutdown without manually un-mount the share the step of unmounting network file system became very slow
    If it's no extremely difficult, can someone help me to write this script?
    I know that man exist but I'm not a programmer and it's so difficult for me approch it.
    Thank you in advance.
    Ale
    Last edited by Alexbit (2010-09-23 21:29:13)

    Thank you very (VERY) much!
    I've follow your information and.. it work!
    If can be usefull to other this is the complete script:
    #!/bin/sh
    echo "This is a custom script for mount citrix share"
    echo "****************************************"
    echo " "
    echo "Please insert domain password:"
    read -s mypassword
    echo " "
    echo "|checking mount state...in share are not mounted mount it!|"
    echo "+-------------------------------------------------------------------------+"
    if grep "TsHome" /etc/mtab &>/dev/null; then
    grep "TsHome" /etc/mtab | awk '{print "TsHome is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" //ipaddress/TsHome$ /home/Samba_share/TsHOME && echo "TsHOME is now mounted" || echo "unable to mount TsHOME"
    fi
    echo " "
    if grep "direction" /etc/mtab &>/dev/null; then
    grep "direction" /etc/mtab | awk '{print "direction is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" '//ipaddress/direction' /home/Samba_share/direction' && echo "direction pat is now mounted" || echo "unable to mount direction"
    fi
    echo " "
    if grep "Area" /etc/mtab &>/dev/null; then
    grep "Area" /etc/mtab | awk '{print "Area is already mounted on " $2}'
    else
    sudo mount -t cifs -o username='yourusername',password="$mypassword" '//ipaddress/Area' /home/Samba_share/Area && echo "Area is now mounted" || echo "unable to mount Area"
    fi
    echo " "
    echo "All DONE!"
    echo " "
    read -p "Press ENTER key to close this terminal"
    exit
    I don't really well understand what I've to put in rc.local.shutdown....
    I think somethings like:
    #!/bin/bash
    # /etc/rc.local.shutdown: Local shutdown script.
    echo "This is a custom script for UN-mount citrix share"
    echo "********************************************"
    echo " "
    echo "|check mount state: if mount then un-mount!|"
    echo "+-------------------------------------------------------+"
    echo " "
    if grep "TsHome" /etc/mtab &>/dev/null; then
    grep "TsHome" /etc/mtab | awk '{print "TsHome is NOT mounted -> going on..." $2}'
    else
    sudo umount /home/Samba_share/TsHOME && echo "TsHOME is now UN mounted" || echo "unable to UN-mount TsHOME"
    fi
    echo " "
    if grep "direction" /etc/mtab &>/dev/null; then
    grep "direction" /etc/mtab | awk '{print "direction is NOT mounted -> going on.." $2}'
    else
    sudo umount /home/Samba_share/direction && echo "direction is now UN mounted" || echo "unable to UN-mount direction pat"
    fi
    echo " "
    if grep "Area" /etc/mtab &>/dev/null; then
    grep "Area" /etc/mtab | awk '{print "Area is NOT mounted - Finished" $2}'
    else
    sudo umount /home/Samba_share/Area && echo "Area is now UN mounted" || echo "unable to UN-mount Area"
    fi
    echo " "
    echo "going shutdown"
    echo " "
    sleep 5
    I've try but it seems to ignore the IF statement... this is the output when ALL share are UNmounted:
    $ sh /etc/rc.local.shutdown
    This is a custom script for UN-mount citrix share
    |check mount state: if mount then un-mount!|
    +-------------------------------------------------------+
    umount: /home/Samba_share/TsHOME: not mounted
    unable to UN-mount TsHOME
    umount: /home/Samba_share/direction: not mounted
    unable to UN-mount direction
    umount: /home/Samba_share/Area: not mounted
    unable to UN-mount Area
    going shutdown
    Tomorrow I will test again when I'm at office.
    Meanwhile can you check if I made a macroscopic mistakes?
    Thank you again!
    Last edited by Alexbit (2010-09-23 17:34:49)

  • Shell script for export and import

    Hi,
    I want to run exp command in background since i need to export 40gb database of other database
    if i won't use & my session will die.
    appreciated any inputs.
    i need to run this line from shell script.
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    bash-2.05$ more export.sh
    #!/bin/sh
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    bash-2.05$ sh export.sh &
    [10] 13352
    bash-2.05$
    Export: Release 8.1.7.0.0 - Production on Fri Dec 4 22:51:09 2009
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    Password: pin
    bash: pin: command not found
    [10]+ Stopped sh export.sh
    input appreciated
    thanks
    Prakash

    Hi,
    /oracle/bin/exp pin@voipdbstg/pin file=voip.dmp owner=pin log=voip.log
    should be
    /oracle/bin/exp pin/pin@voipdbstg file=voip.dmp owner=pin log=voip.log
    Also for running the script is background and you should be able to log out of shell scriptthen run the command in nohup mode.
    $nohup export.sh&
    Regards

  • Running a script on startup and shutdown

    Hi,
    I've got my own two AppleScript scripts. They are very simple, in fact they only do a shell script. I need to run one of them every time I login and the other every time I shutdown the Mac. While the first step can be accomplished using login elements under preferences, I can't seem to do the same on shutdown. How can I solve this?

    I use asp.net as my back-end and use xml strings to send data
    between my server and client tiers.
    If you are using httpservice to get your data into flex, and
    have set resultFormat="e4x"(othrwise flex converts your xml into a
    nested object structure, not good.), then changes make via the
    editable dataGrid are automatically saved in the dataProvider. So
    sending the data back might be as easy as:
    var oRequest:Object ={xml:myXMLDataProvider.toXMLString()}
    myHTTPService.send(oRequest);
    Serverside this data will be accessible as a requst arg.
    dim sXml as string = Request("xml") 'works for post or get
    Tracy

  • Shell script for moving and renaming files

    I'm not so familiar with shell scripts. I have created some simple scripts for various tasks but now I hit something I can't handle myself.
    My server receives every night a logfile from another server. This file I need to rename and move to another location. Problem is that a simple mv with new filename isn't enough, I need to insert date in filename. Format for date should be ddmmyy. Also the name of incoming file changes every night. The output always starts with same letters, let's say "log", and the date is used to identify files.
    For example I receive a file /Input/filename.log and I need to move the file to the folder /Output with name log130308.txt.
    Any tips how to insert the date as part of of filename while renaming or moving the file? I prefer shell script as I'll use launchd for scheduling the script.

    Hi again,
    so far I've constructed this:
    cd /input
    for file in `ls *log`
    do
    echo "Copying " $file
    cp $file /output/log.$file.`date +%d%m%y`
    done
    Quite there. I'm cding to directory, i'll focus later how to set some environmental parameters.
    Problem with zipping is that I don't know exact logfiles names. Each day there's a new name. So zip -q filename.zip filename.log isn't quite enough and it's impossible to use wildcards. The switch -q and checksums were welcome suggestions.
    Thanks again,
    Juha
    Message was edited by: J.Otava

  • Shell Script For Collecting Information on the Mac

    Hi Expert,
    Do you have sample script to colletion the information from Mac OS such network, hostname, Mac OS version.. so on?
    BR,
    Khemarin

    Here's a script I have used to trouble shoot network problems for new telecommuters: http://putnamhill.net/applescript/netinfo2clipboard
    This version of the link should open the same script in the applescript editor. Then they just have to run the script and paste the results into an email: http://putnamhill.net/applescript/editor/netinfo2clipboard

  • Script for gather and store the log running queries details in a table?

    Hi All,
    Please suggest the best query that gather and store the long running queries details in a table.
    Thanks,
    rup

    The below links would help you...
    Ben Snaidero
    performance-dashboard

  • Startup and shutdown of  Apps and database on R12 with linux server reboot

    Hi Guys,
    Version : R12
    Platform : Linux EL 5
    Hi Guys,
    I am trying to startup and shutdown the R12 apps and database automatically with Linux server reboots.
    Does any one have steps to do this or metalink note:
    Thanks in advance,
    Z

    Hi,
    Please see this thread.
    Autostart of Services
    Re: Autostart of Services
    Regards,
    Hussein

  • Startup and Shutdown scripts for OCS 9.0.4 on Windows?

    Hi,
    I wanted to know if startup and shutdown scripts for OCS 9.0.4 on Windows are available.
    I am thinking something like the ocsctl_sample scripts that OCS10g included.
    I have checked the OCS 9.0.4 documentation and not a lot of information for the windows platform is avaiable.
    Any information will be appreciated.
    Thanks,
    Ana

    There is no scripts that comes with 9.0.4.
    One possibility is to just write the commands you normally use in a batch-file, but note that then you have no checking, and if OCS runs on several machines you should have some checking for required processes etc.
    We are using some scripts that does this, but I'm not shure where they came from, possibly from Metalink or from this forum. Try a search. Our scripts are changed quite a bit for our needs, but I might be able to find the original ones.

  • Startup and shutdown of standby database

    Hi
    Expert,
    i want to know step by step process of startup and shutdown of standby oracle 10g database on windows and linux server.
    thanks

    Any form of integration with standard oracle startup/shutdown scripts for a dataguar configuration?
    Or this is targeted by the broker perhaps?
    For example putting Y inside /etc/oratab but also with other flags inside it or any other files around?
    Or something like this:
    - make a startup mount
    - select switchover_status from v$database
    in case output is "TO PRIMARY"
    alter database recover....
    otherwise if it is "TO STANDBY"
    alter database open
    or somethjngi similar...

  • 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

  • How to write triggers on startup and shutdown of the server?

    Plz advice.
    How to write triggers on startup and shutdown of the server?
    I could write it but nothing happened!!!

    Small code example for you:
    [email protected]> @ connect mob/mob
    [email protected]> create or replace trigger shutdown_trigger
    2 before shutdown on database
    3 begin
    4 insert into shut_table values(sysdate);
    5 end;
    6 /
    Trigger created.
    [email protected]> create or replace trigger start_trigger
    2 after startup on database
    3 begin
    4 insert into start_table values(sysdate);
    5 end;
    6 /
    Trigger created.
    [email protected]> @ connect "/ as sysdba"
    [email protected]> shutdown immediate
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    [email protected]> startup
    ORA-32004: obsolete and/or deprecated parameter(s) specified
    ORACLE instance started.
    Total System Global Area 64036368 bytes
    Fixed Size 454160 bytes
    Variable Size 50331648 bytes
    Database Buffers 12582912 bytes
    Redo Buffers 667648 bytes
    Database mounted.
    Database opened.
    [email protected]> select * from mob.start_table;
    START_DAT
    14-SEP-06
    [email protected]> select * from mob.shut_table;
    SHUT_DATE
    14-SEP-06
    Best Regards
    Krystian Zieja / mob

  • Wireless network (and a shell script for you guys, also)

    I don't know the right way to bring up my wireless iface at bootup, so I wrote a small shell script to do it for me.
    Feel free to use it if you find it useful..
    I'd also appreciate someone telling me what *IS* the arch way of doing what my shell script's doing
    #!/usr/bin/env bash
    # Val Polyakov <[email protected]>
    # 7/8/07
    # Change these to reflect your network
    PATH=/usr/sbin:/sbin:/bin
    IFACE=ifaceNameOfYourWirelessCard
    DRIVER=moduleNameForYourWirelessCard
    SID=yourSID
    ENCKEY=yourEncryptionKey
    # Don't change anything beyond this point.
    case "$1" in
        start)
            echo "Loading the wireless card driver"
            modprobe $DRIVER
        echo "Setting up the SID and encryption key"
            iwconfig $IFACE essid $SID enc $ENCKEY
        echo "Bringing up the wireless interface"
        ifconfig $IFACE up
        if [ -f /var/run/dhcpcd-$IFACE.pid ]
        then
            rm /var/run/dhcpcd-$IFACE.pid
        fi
        echo "Running the dhcp client"
        dhcpcd $IFACE
        stop)
            echo "Bringing down the wireless interface"
        ifconfig $IFACE down
        echo "Unloading the driver"
        rmmod $DRIVER   
        restart)
            $0 stop
        sleep 2
            $0 start
            echo "usage: $0 {start|stop|restart}"
    esac
    exit 0

    brain0 wrote:If your wireless drivers support wpa_supplicant, you could try autowifi from http://www.archlinux.org/~thomas/autowifi-svn/ It handles multiple wireless networks very well. There is no documentation right now, just read here: http://archlinux.org/pipermail/arch-dev … 00867.html
    what would the benefit of that be, as compared to my script ?
    the shell script i made (and pasted) works just fine, sits in /etc/rc.d and is called by /etc/rc.conf
    i was just curious whats the official, i guess, way to do it with arch
    since network profiles dont work for some reason, i figured i must be missing something..

Maybe you are looking for