This article mainly introduces various methods and commands for starting and shutting down databases in oracle. The following is a good article for you, hoping to help you.
Unix shutdown sequence: first shut down the database, then the operating system, and finally power off
Only users with sysdba and sysoper SYSTEM privileges can start and close the database.
You should start the listener before starting the database. Otherwise, you cannot use commands to manage the database, including starting or shutting down the database.
Although the database runs normally, if the listener is not started, the client cannot connect to the database, and the oem and isqlplus tools cannot be used on the server.
Start the listener lsnrctl start to close the listener lsnrctl stop
Query listener status lsnrctl status
Steps for starting a database:
1. Create and start a routine. The memory and service processes are allocated, initialized and started, and the parameter files are initialized. The initialization parameter in the parameter file determines how to start the routine startup nomount.
2. Load the database, open the Database Control file, and obtain the database name, location and name of the data file, and other information about the physical structure of the database. Find the control file in the parameter file, to load the database startup mount
3. Open the database. The routine will open all online data files and rebuild log files. If any data file or duplicate log file listed in the control file cannot be opened, the database will return an error message, and the database needs to be restored. Startup open
When starting a database, the File Usage sequence is: parameter files, control files, data files, and redo log files. When these files are normal, the database can start normally.
To perform maintenance, you must use the nomount option to start the database (run a tutorial to create a new database and recreate the control file)
In nomount startup mode, only the database dictionary views related to the sga zone can be accessed, regardless of the database.
In the mount status, you can (rename the data file, add, delete, or rename the redo log file, perform the database full recovery operation, and change the database archive mode). In this mode, in addition to accessing the data dictionary view related to the sga area, you can also access the data dictionary views related to file control.
If it is difficult to start the database normally, you can use the force option to start the database startup force
Startup restrict starts the database and places it in open mode. However, only users with restricetd session permission can access the database. If you want to maintain the database in open mode, make sure that other users cannot establish a connection to the database and execute tasks, this option should be used (to export and import database data, to load data, and temporarily prevent normal users from using data for database transplantation or upgrade, use alter system disable restricted session.
When starting a database, you must specify an initialization parameter file. If not specified, the system first reads the server initialization parameter file spfile in the default location. If not, it finds the text initialization parameter file pfile.
Startup force pfile = e: pfleoamissid. ora
Alter database mount/open
Steps for shutting down a database:
1. Close the database. oracle writes the content in the redo log cache to the redo log file and writes the modified data in the database cache to the data file, then close all the data files and redo log files. At this time, the Database Control file is still open, but the database is closed, so users cannot access the database.
2. Uninstall the database. After the database is closed, the routine can be detached. The control file is closed again, but the routine still exists.
3. Terminate the routine, terminate the process, and recycle the memory sga area allocated to the routine.
Shutdown normal shut down the database normally
Shutdown transactional, once all users are disconnected, close immediately, uninstall the database, and terminate the routine)
Shutdown immediate (any uncommitted transactions are returned and the connection is directly disconnected)
Shutdown abort (oracle is not closed in the above three methods, and some data may be lost)
There are several startup methods:
1. startup nomount
Non-installation startup. In this mode, you can execute: re-build the control file and re-build the database.
Read the init. ora file and start the instance, that is, start the SGA and background processes. To start the process, you only need the init. ora file.
2. startup mount dbname
Install and start. In this mode, run:
Database Log archiving,
Database media recovery,
Online or offline data files,
Locate the data file and redo the log file.
Execute "nomount", open the control file, and confirm the location of the data file and the on-line log file,
However, data files and log files are not verified at this time.
3. startup open dbname
Run "nomount" first, then "mount", and then open all database files including the Redo log file,
In this way, you can access data in the database.
4. startup, which is equal to the following three commands
Startup nomount
Alter database mount
Alter database open
5. startup restrict
Constraint-based startup
This method can start the database, but only allow access by users with certain privileges
When a non-authorized user accesses the service, the following prompt is displayed:
ERROR:
ORA-01035: ORACLE only allows users with restricted session permissions to use 6, startup force
Force start Mode
When the database cannot be closed, you can use startup force to close the database.
Shut down the database first, and then execute the normal database startup command
7. startup pfile = parameter file name
Startup method with initialization parameter file
Read the parameter file first, and then start the database according to the settings in the parameter file.
Example: startup pfile = E: Oracleadminoradbpfileinit. ora
8. startup EXCLUSIVE
There are three startup methods:
1. shutdown normal
Close the database normally.
2. shutdown immediate
Close the database immediately.
Run shutdown immediate in SVRMGRL, and the database is not closed immediately,
However, it is disabled only after Oracle executes some cleanup tasks (terminating sessions and releasing session resources ),
When you use shutdown to close a database, shutdown immediate can be used to close the database.
3. shutdown abort
Directly shut down the database, and the session accessing the database will be suddenly terminated,
If a large number of operations are being performed in the database, it takes a long time to restart the database after the shutdown abort command is executed.