Script to stop all databases running in the particular ORACLE_HOME

Hello

I'm looking for a shell script which would stop all databases running in a particular ORACLE_HOME, then start same accurate databases upward after a 'repeat all' was made.
Other databases in the particular ORACLE_HOME not running and I don't want to start these. I want only to the stopping and starting again that these databases running in the particular ORACLE_HOME. Thank you.

I want only to the stopping and starting again that these databases running in the particular ORACLE_HOME.

Assuming that/etc/oratab is correctly configured and you are working on an already set ORACLE_HOME (otherwise you will need to fix it in scripts).

$ cat shut.sh
rm -f /tmp/actives.txt
for SID in `grep $ORACLE_HOME /etc/oratab | awk -F: '{print $1}'`
do
        ACTIVE=`ps -ef | grep smon | awk -F_ '{print $3}' | grep $SID`
        if [ "$ACTIVE" ]; then
                echo $ACTIVE
                echo $ACTIVE >>/tmp/actives.txt
                export ORACLE_SID=$SID
                sqlplus -s / as sysdba << EOF
shutdown immediate
exit
EOF
        fi
done
$
$ cat start.sh
for SID in `cat /tmp/actives.txt`
do
        echo $SID
        export ORACLE_SID=$SID
        sqlplus -s / as sysdba << EOF
startup
exit
EOF
done
$

Tags: Database

Similar Questions

  • Script to stop all instances of weblogic running on a box

    Hello

    There the script to stop all instances of weblogic running on a Unix machine at a time?

    My understanding is grep for weblogic and then issue kill-9 process.

    Correct me if im wrong and also provides good script to stop all instances of weblogic.

    Thank you!!

    Hello

    You can use simple JMX code to achieve the same (all servers within a domain at a time stopping):

    Topic: Force Shutingdown WLS using JMX
    http://middlewaremagic.com/WebLogic/?p=55

    NOTE: The code above JMX is supposed to close just down the AdminServer, you can remove the if {} block of line no-60 the following code JMX stop all servers rather than to stop only the server administrator.

    Thank you
    Véronique Mody

  • How to stop all means of copying the database

    Hello

    I'm out of oracle database 11g R2 under windown server 2008 (the database name is ORCL)

    I need to prevent all means of transporting data to a different database

    I tried the encryption (TDE) portfolio with tablespace but always utility data expdp works

    and I can copy the file (oracle_home\oradata\orcl) what hv the datafile to and replace it with a different database on another pc that have installed oracle on same directory then provided works perfectly

    even if there were the portfolio on the first database, we can create another portfolio with new password and every thing will be decrypted and it is not accepted.

    I need your help to find a way of:

    1-stop exp and utility expdp

    2-stop backup and restore of database with RMAN (auxiliary or copying RMAN files is added to the different database)

    3 - stop copy replace and folder (oracle_home\oradata\orcl) is the different database in the same place (another pc)

    (Note: in addition to the operating system user account is administrator)

    Thanks in advance

    Please specify.  You can't restrict exp/imp, because it is installed on any client anywhere.  If they can query the database, they can export all they have access.  Check the roles that have EXPORT_FULL_DATABASE and limit those to yourself or to administrative positions under your control.

    expdp/impdp files similar to exp/imp of output, but put them on the database server (or a drive connected to the network).  You can't prevent their execution.  The API of PL/SQL is part of the database, so even without the expdp/impdp executable, you can do the equivalent within the database. The same basic data access control applies.

    RMAN backups can be run from remote machines, and the backup files can go to local disk, NAS network drive or tape.  On the local computer, you can use operating system permissions to protect them, but another admin on the computer can do what they want.  You can delete rman of this machine, but someone could just run rman from another machine and that it points to the database.  Limit which has the SYSDBA privilege.

    The raw database files are not useful if they are copied while the database is in place, but if there are other administrators on the computer, they may be able to stop the Oracle service, which stops the database, and then they can copy files wherever he wishes.  It's a situation TDE can protect against, because someone needs your encryption key to use database files, even if they copy them elsewhere.

    It was really far from saying these features can really turn off; you usually have to handle this with database privileges.

    If you can afford the extra option you can look into Oracle Database Vault.  It offers more restriction and auditing options, designed to prevent or detect abuse by privileged users.

  • vCD 5.1.2 - How can we suspend all vApps running using the API or a command?

    I can browse a list of deployed vApps, but is there a better way?  We must suspend all vApps running before kick off a backup using SAN snapshots.

    Is there a doc internal API, such as Lab Manager?

    Thank you!

    Here is my understanding... Right suspension does not release reserves... Suspend the needs to maintain the reserves there to make sure that a resume is successful. It's just for CPU/MB of the reserves on virtual machines / pools.

    Stop will also cancel the deployment, but disables the virtual machines... even as a 'stop' of the user interface.

    One of these should be good for you to perform, the aim being to turn the VMs to take a glance SAN, just that suspend which takes much more time off.

  • Slow sign on and close to vista, how to I stop unused programs running in the background that I no longer use?

    PC takes up to 10 minutes to sign in and even close. Programs that run in the backround slow down COMP...

    rojo2USA,

    Please take a look at the following:

    http://social.technet.Microsoft.com/forums/en-CA/itprovistahardware/thread/5f46dd87-2d47-448f-B202-3162004d8204

  • How can I stop programs@from running in the background?

    programs - I never userun in the background as institutional calendar. I would like to launch a clean background and a sleek office. Is ok to ermanently remove apps / programs I not have access? or better yet I can remove the icon without deleting the program I talk about these programs preinstalled. latter case your room for answerng this - what is the diffrence between apps widgets n programs on the droid.

    I'm sorry it explained not completely. I will try. Default apps cannot be uninstalled or removed. You can go into management applications in the settings and force closes, but it can start up if the operating system decides that she needs. There is an application that will allow you to hide the icons, but I don't remember the name. I don't know of a setting in the calendar application to prevent it from running. You might want to make sure that it is not set to automatically synchronize. This could be the reason why he is running. So the only way I know to keep them from running in the background is using a task killer, so the answer is always the same. I hope that I have cleared it up a little bit.

  • Configuration of database running on the server with 256 cpu

    Hi all

    We have a rac 11.2.0.2 on Solaris 10 installation.
    The servers are 2 and a short configuration is:

    SQL > show parameter cpu_count
    VALUE OF TYPE NAME
    ------------------------------------ ----------- ------------------------------
    cpu_count integer 256

    psrinfo | WC-l
    * 256 *.
    prtconf | grep 'memory '.
    Memory size: * 130784 MB *.
    psrinfo - pv
    The physical processor has 64 virtual processors (0-63)
    UltraSPARC-T2 + (chipid 0, clock MHz 1414)
    The physical processor has 64 virtual processors (64-127)
    UltraSPARC-T2 + (chipid 1, clock MHz 1414)
    The physical processor has 64 virtual processors (128-191)
    UltraSPARC-T2 + (chipid 2, clock MHz 1414)
    The physical processor has 64 virtual processors (192-255)
    UltraSPARC-T2 + (chipid 3, clock MHz 1414)

    There are a lot of settings Oracle automatically design based on the number of CPUs.
    In my case, this number is too high.

    For example, normally db_cache_size = 4 MB * cpu, in this case the result is 1 G of db_cache_size.

    The plan is to create several databases on this car, so the question is:

    Is there a way to design or to tell oracle a different number of cpu?
    and in general...
    You have some tips on how it is possible to configure a machine so powerful that runs a large number of instances?


    Thanks in advance

    Published by: Spugna on May 7, 2012 03:01

    Hi Spugna,

    Of course, as long as you use Oracle 11 g you can use Instance Caging to limit each database, the CPU usage. Although it is no longer applicable to the single server database or a CCR node I see no reason why not to use with RAC. Look here for more information:
    http://docs.Oracle.com/CD/E14072_01/server.112/e10595/dbrm007.htm

    You could also consider the consolidation of these different in a large database of databases if it is possible and there is no dependence application?

    Kind regards
    EVS

  • Spooler service is stopped & must be running for the installation to continue

    Original title: installation printer problem

    Installation stops and I get the message "Spooler service is stopped & must be rinning for installation to continue.  Nothing happens when I select "Fix."

    Hi leealaga,
     
    To solve the problem, fix the dependency for the spooler service information.
     
    Follow these steps to do the same thing:
     
    a. Click Start, run and type the following command and press ENTER:
    CMD /K SC CONFIG SPOOLER DEPEND = RPCSS
     
    This should help you get started the spooler trouble-free service.
  • Script to remove all embedded images in the beginning upward

    My file crashes on startup, and I know that its because of an image embedded in the file.

    Do someone have a script to remove images that are all integrated to opening a document?

    If ID crashes when you open this file, then a startup script will not help you. This script has open the file and will crash InDesign as before.

    P.

  • vCloud Director &amp; database running on the virtual machine

    Hi people,

    I looked for this information on documentation and the online forum, but I have not found it. Is it possible to run vCloud Director Service and Oracle DB on Virtual Machines VMware? And if it's possible, VMware will support it?

    Don't forget that I will reserve all the resources of these virtual machines.

    Thank you!

    Jean-

    Running vCloud Director in one or more virtual machines is certainly supported.

    --

    Eddie Dinel

    Senior Product Manager, vCloud Director

  • HP Envy 17 t-j100, extended monitoring mode stops all sound elements, of the reasons why?

    When I plug my second monitor using the hdmi port and change the monitor mode to extend the audio stops working. The volume mixer still watch movement audio but released no audio. Ive looked upward a soltion but I can't find an awenswer to this problem. any thoughts why this could happen?

    solved my problem, go into the menu speker and disable everything except the hp speakers, reboot everything and save options.

  • script to stop the virtual machine

    I am writing a script to stop all the virtual machine as follows:

    1. The list of the VM

    VMLIST ='/ usr/bin/vmrun list '

    for a virtual machine in '$VMLIST '.

    do

    echo '$VM '.

    1. stop the virtual machine

    / usr/bin/vmrun stop '$VM' trysoft

    sleep 2

    fact

    But he failed, the news of the error:

    / root/vmware/Windows NT / Windows NT.vmx

    Error: Could not open the virtual machine: unknown suffixNT/Windows NT.vmx file

    the feedback by the command "echo $VM" is the correct path, but why it says file unknown?

    Please refer to the attachment.

    See if that helps...

    vmlist ='/ usr/bin/vmrun list '

    printf "$vmlist" | egrep '\.vmx$ ' | while reading vm; echo '$vm '.

    / usr/bin/vmrun stop soft "$vm".

    sleep 2; fact

  • Unable to connect to the local database (without using the tnsname)

    Hi guys
    I have 2 database running on the local computer.

    Db1 SID - orcl (install 1)
    DB2 SID - unicode (later installation)


    Today I stop the basic unicode and stop its respective services.

    on the back
    I did a sqlplus scott/tiger, I got an error
    ORA-12560: TNS:protocol adapter error

    That's why
    I did a
    Set ORACLE_SID = orcl

    and I still get the same error.
    -------------------------------------------------

    So I'm the other way around. I orcl database stop, stop its services and database unicode to START and its services.

    I disassembled the ORACLE_SID environment variable.

    Now, I have in the command prompt
    sqlplus scott/tiger

    I am connected to the unicode database!
    -------------------------------------------------

    Now I ORCL stop unicode data and start...

    and I have a
    sqlplus scott/tiger@ORCL...

    I HAVE no problem to connect to it...
    --------------------------------------------------

    May I ask why should I provide the TNSname ORCL database and I do not for the UNICODE of the databases...
    Both are local on my database.

    What's wrong?

    Moreover, I am on XP.
    Thank you!

    Set ORACLE_SID = orcl
    sqlplus / as sysdba;
    sys@ORCL > exit

    Set ORACLE_SID = unicode
    sqlplus / as sysdba;
    sys@Unicode > exit

    Well, we know that both your DBs are working properly.

    So out of curiosity, I did cela tests...
    (1) connect the two database and stop
    (2) stop their services
    (3) start only ORCL service
    (4) close and reopen the command prompt to delete the var of environment ORACLE_SID

    sqlplus / as sysdba;
    Error: ORA-12560: TNS: Protocol adapter error

    (5) now I stop service ORCL
    (6) (and I start the service of UNICODE)

    then I deliver

    sqlplus / as sysdba;
    sys@Unicode >

    It seems quite normal. In your registry value ORACLE_SID is, most likely, unicode, the last created: check it out, and if so, you can connect to unicode DB without setting ORACLE_SID, while you will need to set to connect to DB orcl.

    When you have more than one DB, you set the ORACLE_SID environment variable before connecting either you use connection strings.

  • "Cannot run the troubleshooter in windows' native hosts of diagnostics by script has stopped working".

    Original title: Troubleshooting work do not
    I can't run any programs of solving problems of the control panel. When l happens with diagnostics by native script host has stopped working. It offers the ability to debug and when you do, it says that there is no registered JIT debugger. How do l fix

    Hello

    Welcome to the community Microsoft and thanks for posting the question.

    By the description, it looks like you are unable to run any windows build-in the convenience store, he would be grateful if you can answer this question in order to help you further.

    Have you made changes on the computer before this problem?

    The issue could be due to the file system sdiagnhost.exe file is missing, sdiagnhost.exe is damaged or Corruption in the registry.

    I suggest you perform a sfc scan and check if this can help, the system (SFC.exe) File Checker tool searches for missing or damaged system files and repairs.

    Steps to perform a scan SFC:

    un) Click Start, click principally made programs, Accessories, right-click guest, and then click run as administrator. If you are prompted for an administrator password or a confirmation, type the password, or click allow

    (b) type the following command and press ENTER:

    sfc/scannow

    [The command sfc /scannow. analysis of all protected system files and replaces incorrect versions with appropriate Microsoft versions.]

    Once the scan is finished, close the command prompt window, restart the computer and check.

    Reference: http://support.microsoft.com/kb/929833

    Try to create a new user account and check if the problem is limited with the particular user profile.

    Create a new user account: http://windows.microsoft.com/en-US/windows7/Create-a-user-account

    If the new user account works, see steps on how to copy files to the new user profile in Microsoft article provided: http://windows.microsoft.com/en-US/windows7/fix-a-corrupted-user-profile

    If you have any other questions or you need Windows guru, do not hesitate to post your questions and we will be happy to help you.

  • How to stop the side menu of Adobe ExportPDF running in all my software and the blocking of the screen?

    How to stop the side menu of Adobe ExportPDF running in all my software and the blocking of the screen?

    Hi B Faro,

    I'm not sure that I am. You are in Adobe Reader and see ExportPDF option in the tool pane on the right side of the application window? If this is the case, you can hide the toolbar by choosing View > show/hide > elements Toolbar > hide toolbars.

    Please let us know if that does not address your concern and provide more details about the problem you are having.

    Best,

    Sara

Maybe you are looking for

  • Driver Bluetooth for Satellite C855

    To install BT Bluetooth Toshiba C855 and fix "unknown device" on acpi tos6205 2 & daba3ff & 2 just download It's weird because it's the same driver of Toshiba site, but the real, we don't work.This works! + The message was edited: link has been remov

  • Satellite L550D does not recognize DVD

    Hi people, New on here have just got my laptop last week.It is a standard configuration with Windows 7 64 bit and the DVD - RW is a Pioneer model. I used CD no problem to install programs, etc, but yesterday put a DVD movie into the machine for the f

  • NET Framework 3.5

    Does anyone else have a problem with the NET Framework 3.5 Service Pack 1 and 3.5 Family Update for NET versions 2.0 to 3.5.  It happens on my daily updates, but it won't install... It downloads, but after a while a message saying that it was not ins

  • Unable to connect to Apple double Airport wireless broadband unless 5 mhz is disabled

    My Airport Extreme transmits mhz both 2.4 and 5 GHz.  If I check the 5 GHz in the router, I am able to connect wireless to my new 8610 of Officejet Pro. But if I turn it back on, the printer disappears. My old Epson printer only printed using 2.4 mhz

  • Enterprise Manager Express does not

    I have 12 c DB server with multiple instances. I created new BBBB database with the DBCA Wizard and chose the option to configure EM Express port 5501. But EM Express does not work. Problem is probably to the listener, I do not see the function XDB.