This article will introduce the methods for stopping and starting the services of the Oralce database, including some methods in windows and linux systems. I hope this method will be helpful to you.
Log On As A database user first
Stop Database Service
Cd
Source. bash_profile
Lsnrctl stop
Sqlplus/nolog
> Connect user/pwd as sysdba
> Shutdown immediate
> Exit
Start Database Service
Cd
Source. bash_profile
Lsnrctl start
Sqlplus/nolog
> Connect user/pwd as sysdba
> Startup
> Exit
Procedure in windows
First, connect with the sys user
C:> sqlplus sys/change_on_install as sysdba;
Enter the SQL * plus environment. (Note that you need to set the password for sys and system when installing ORACLE9I, and you cannot use the default password of the two users before ORACLE9I, this is mainly to ensure the security of the database system. For good memory, I restored the default password immediately after installation)
Second:
C:> sqlplus/nolog
SQL * Plus: Release 9.2.0.1.0-Production on Monday April 26 09:42:00 2004
Copyright (c) 1982,200 2 [/img] [/img], Oracle Corporation. All rights reserved.
SQL> connect/as sysdba
Connected.
SQL>
The following describes a complete instance.
I. SQL * plus:
Connect with SQL * plus
Oracle
Sqlplus/nolog starts SQL * plus without connecting to the database.Connect/as sysdba connects to oracle as A DBA
. Start
Startup can be started.However, there are three oracle startup modes:L Startup nomount (nomount mode) starts the instance and does not load the database.L Startup mount (mount mode) Start the instance to load the database but not open the databaseL Startup (open mode) starts the instance to load and open the database, which is the command we used aboveIn Nomount mode, oracle only creates various Memory Structures and service processes for instances and does not open any database files,So:1) create a new database2) recreate the control fileBoth operations must be performed in this mode.In Mount mode, oracle only loads the database but does not open the database. Therefore:1) Rename the data file2) add, delete, and rename the redo date file3) perform full database recovery4) change the database archiving ModeAll four operations must be performed in this mode.Open Mode (that is, the above startup does not contain any parameters) can be started normally.Of course, the three modes can be converted:Alter database mount (nomount mode)-> alter database open (mount mode)-> (open Mode)
Of course, there are other cases where we can set the database to a non-restricted or restricted State in open mode.In a restricted State, only DBA can access the database:1) execute Data Import and Export2) use SQL * loader to extract external data3) regular users must be temporarily denied access to the database.4) database migration or upgrade
All four operations must be performed in this status.
When you open the database, use the startup restrict command to enter the restricted State.
Use the alter system disable restricted session command to change the restricted State to a non-restricted State.
Use the alter system enable restricted session command to change the unrestricted state to the restricted State.
Use alter database open read only to make the database read-only.
Use alter database open read write to change the database to read/write status. Of course, in some cases, you may not be able to start the database successfully using any of the above startup methods. In this case, you must use the startup force command to forcibly start the database. Of course, no one wants this situation :)
C. Shut down the database
1) Shut Down normally
2) Close shutdown immediate now
3) Close the transaction shutdown transactional
4)Force shutdown abort off. Of course, no one wants to encounter this situation.
Ii. OEMOracle Enterprise Management (OEM ),The Sqlplus/nolog, Connect/as sysdba commands mentioned in the first section are similar to the Operations
Follow the steps above to connect to the database. The following describes how to start and close a database:
Click the configuration options in the database tree ORADB01 created in the previous chapters: 1) the corresponding Nomount mode has been started.2) the corresponding mount mode has been reprinted3) open the corresponding open modeAfter you click the expected button, the following dialog box is displayed.
1) Shut Down normally2) immediately close shutdown immediate3) shutdown transactional4) abort and forcibly close shutdown abort After confirmation, the following dialog box is displayed.
Restrict access to the database corresponding to alter system disable restricted sessionAlter system enable restricted sessionThe read-only mode corresponds to alter database open read only.Alter database open read write Simple: A lot of SQL * plus commands have changed to several buttons in the OEM.
3. windows Console
Familiar with this:
Oracle ************ Agent Used for OEM management structure
Oracle ************ HTTPSERVER oracle Web Server
Oracle ************ ManagementServer is used for OEM management structure
Oracle ************ server-side processes of the TNSListener oracle Network Structure
Oracle ************* OEMREP archive file
Oracle ************* ORADB001 database created by the user
I usually select all services as manual start. If all services are enabled, the memory will be used off by 700M ..............