Oracle Startup and shutdown

Source: Internet
Author: User

OracleDatabaseStartupand theShutdownWay


To start and close a database, you must have aOracleadministrator rights The user logs in, usuallySYSDBAPermission User Login. Generally we useINTERNALuser to start and close the database (INTERNALthe user is actuallySYSusers toSYSDBAconnect synonyms). Oraclenew version of database will be phased outINTERNALThis internal user, so we are most still settingDbausers haveSYSDBApermissions.

Two: Three steps required to start a database
1,Create aOracleinstance (non-installation phase)
2,Install the database by instance (Installation phase)
3, Open a database (open phase)

Three:Startup(Start database command)

1,STARTUP Nomount
Nonountoption creates only oneOracleinstance. ReadInit.oraInitialize the parameter file, start the background process, initialize the system global zone (Sga). Init.oraThe file defines the configuration of the instance, including the size of the memory structure and the number and type of background processes started. Instance names are based onOracle_sidsettings, not necessarily the same as the open database name. When the instance is open, the system displays aSgaThe memory structure and size list are as follows:
Sql> Startup Nomount
ORACLEThe routine has been started.
Total System Global area 35431692 bytes
Fixed Size 70924 bytes
Variable Size 18505728 bytes
Database buffers 16777216 Bytesu
Redo buffers 77824 bytes

2,STARTUP MOUNT
The command creates an instance and installs the database, but does not open the database. Oraclethe system reads the control file about the data file and re-makes the contents of the log file, but does not open the file. This open method is often used in database maintenance operations, such as renaming a data file, changing the redo log, and opening the archive. In this open mode, in addition to seeingSgasystem list, the system will also give"Database Loading Complete"prompt.

3,STARTUP
This command completes all three steps to create an instance, install an instance, and open a database. At this point the database makes the data files and redo log files online, and typically requests one or more rollback segments. In addition to the system can see the frontStartup Mountall the hints in the mode, you will also give a"The database is already open"prompt. At this point, the database system is in a normal working state and can accept user requests.

If you useSTARTUP Nomountor aSTARTUP MOUNTDatabase Open Command mode, you must use theALTER DATABASEcommand to perform an open database operation. For example, if youSTARTUP Nomountmode to open the database, which means that the instance has been created, but the database is not installed and opened. This is required to run the following two commands for the database to start correctly.
ALTER DATABASE MOUNT;
ALTER DATABASE OPEN

4, other open mode
In addition to the previous three database open options, there are other options.
(1) STARTUP RESTRICT
in this way, the database will be opened successfully, but only some privileged users (withDbarole user) to use the database. This approach is often used to maintain the database, such as data import/you do not want other users to connect to the database operation data when you export the operation.
(2) STARTUP force
the command actually forcibly shuts down the database (Shutdown abort) and start the database (Startup) two commands a synthesis. This command is only used when the database is closed and the database is not closed.
(3) ALTER DATABASE OPEN READ only;
This command opens the database as read-only after the instance is created and the database is installed. For those that simply provide query functionality the product database can be opened in this way.
Four: Database Shutdown (SHUTDOWN)
1,SHUTDOWN NORMAL
This is the database shutdownSHUTDOWNcommand to save the options. Which means if you sendSHUTDOWNsuch an order, which is alsoSHUTDOWN nornalmeaning.
When this command is issued, any new connections will no longer be allowed to connect to the database. Before the database is shut down,Oraclewaits until the current connection all users have exited from the database before the database is closed. By shutting down the database in this way, no instance recovery is required at the next boot. But one thing to note is that, in this way, it may take a few days, perhaps longer, to close a database.
2,SHUTDOWN IMMEDIATE
This is a common way of shutting down a database, and want to close the database quickly, but also want to make the database cleanly shut down, often use this method.
Is currently beingOracleprocessingSqlThe statement is immediately interrupted, and any uncommitted transactions in the system are all rolled back. If there is a long uncommitted transaction in the system, it can take a while for the database to be shut down in this manner (the transaction is rolled back time). The system does not wait for all users to connect to the database to exit the system, forcibly rollback all currently active transactions, and then disconnect all connected users.
3,SHUTDOWN Transactional
This option is only available inOracle 8ibefore you can use it. This command is commonly used to schedule a shutdown of the database, which causes the current connection to the system to be completed, and any new connections and transactions are disallowed after the command is run. After all active transactions are completed, the database andSHUTDOWN IMMEDIATEClose the database the same way.
4,SHUTDOWN ABORT
This is the last move to close the database, but also in the absence of any way to shut down the database before the use of the way, generally do not use. You might consider shutting down the database this way if the following conditions occur.

Start the database
Sql> Conn/as SYSDBA
Sql> ALTER DATABASE Mount;
sql> ALTER DATABASE open;

Close the database
sql> shutdown immediate;


Oracle Startup and shutdown

Related Article

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.