Oralce database stop and start service summary

Source: Internet
Author: User
Tags sqlplus


Log in as a database user first

Stop the database service

Cd
source. bash_profile
Lsnrctl stop
Sqlplus/nolog
>connect User/pwd as Sysdba
>shutdown Immediate
>exit


Start the database service

Cd
source. bash_profile
Lsnrctl start
Sqlplus/nolog
>connect User/pwd as Sysdba
>startup
>exit

How to operate under Windows


First, connect with the SYS user

C:>sqlplus Sys/change_on_install as SYSDBA;

Enter the sql*plus environment; (Note that oracle9i requires you to set the SYS and system password at the time of installation, and you cannot use the default password of the previous two users, mainly to ensure the security of the database system, I, for good memory, The default password is restored immediately after the installation completes)

The second type:

C:>sqlplus/nolog

Sql*plus:release 9.2.0.1.0-production on Monday April 26 09:42:00 2004

Copyright (c) 1982, 2002[/img][/img], Oracle Corporation. All rights reserved.

Sql> Connect/as SYSDBA

is connected.

Sql>

Let's look at a complete example

First, Sql*plus way:

use sql*plus to connect to Oracle
Sqlplus/nolog is started sql*plus without connecting to the database
Connect/as Sysdba is connected to Oracle as DBA
. Start

Startup is ready to start.
However , there are 3 Oracle boot modes:
L startup Nomount (nomount mode) Boot instance does not load the database.
L startup mount (mount mode) Start instance load database without opening database
L Startup (open mode) starts the instance load and opens the database, which is the command we used above
In Nomount mode , Oracle creates a variety of memory structures and service processes for instances and does not open any database files.
So:
1) Create a new database
2) Rebuilding the control file
All 2 of these operations must be performed in this mode.
In Mount Mode , Oracle mounts only the database but does not open the database, so it says:
1 Renaming data files
2 Add, delete, and rename redo day files
3) perform a full database restore operation
4) Changing the archive mode of the database
All 4 of these operations must be performed in this mode
Open mode (that is, the startup without any arguments above) starts normally.
Of course these 3 modes can be converted between:
Alter database Mount (nomount mode )-〉alter database open (Mount mode)-〉 (open mode )

There are, of course, other situations in which we can set the database to be unrestricted and restricted in our open mode
In a restricted state, only DBAs can access the database, so say:
1) performing data import Export
2) using sql*loader to extract external data
3 need to temporarily deny ordinary users access to the database
4) database porting or upgrade operation

All 4 of these operations must be performed in this state

Use the startup restrict command to enter a restricted state when you open the database.
You can change the restricted state to a disable state by using the ALTER system restricted session command.
Use the ALTER system enable restricted session command to change an unrestricted state to a restricted state
Use ALTER DATABASE open read only to make the database read-only.
use ALTER DATABASE open read write to enable the database to enter and write state.
Of course, in some cases, you may not be able to start the database successfully with the various startup methods mentioned above, this time you will use the Startup Force command to force the database to start. Of course, nobody wants to run into this situation:

C. Close the database
1) Normal shutdown shutdown
2) immediately close shutdown immediate
3) Close transaction shutdown transactional
4 forcibly closes shutdown abort, of course, nobody wants to encounter this kind of situation.



Second, OEM as an example
Oracle Enterprise Management (OEM),
In the first section of the Sqlplus/nolog, Connect/as sysdba These 2 commands are similar to the operation as shown:



You can connect to a database by following the steps above.
The following is how to start and close the database:

Click on the configuration options in the ORADB01 database tree that we created in the previous chapters:
1) The corresponding Nomount mode has been started
2) has been reproduced corresponding mount mode
3 opens the corresponding open mode
When you click on the appropriate button, you will enter the following dialog box

1 Normal closed shutdown
2) immediately turn off shutdown immediate
3 transaction processing corresponds to close transaction shutdown transactional
4) abort the corresponding forcibly shut down shutdown abort
When you are sure, the following dialog box appears

Restricting access to the database corresponds to alter system disable restricted session
Alter system enable restricted session
Read Only mode corresponds to ALTER DATABASE open read only
ALTER DATABASE Open Read Write
Simply put,sql*plus a bunch of commands into the OEM into a few buttons.
3.windows Console

This familiar bar:
Oracle ************agent for OEM management structure
Oracle************httpserver Oracle Web Server
Oracle ************managementserver for OEM management structure
Oracle ************ tnslistener Oracle Network architecture server-side processes
Oracle ************OEMREP Data Archive file
Oracle ************ORADB001 User-created database
I generally have all the services selected to manually start, if fully open, memory to use out of the 700M ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.