[Oracle DBA Study Notes] startup

Source: Internet
Author: User
NOTE: Refer to database version: 10.0.2

I. Command Parsing

Startup options | upgrade_options

Options[Force] [restrict] [pfile = filename] [Quiet] [Mount [dbname] | [open [open_options] [dbname] | nomount], the three stages of nomount, mount, and open are startup. They cannot exist in the command at the same time. Here, open_options is: Read {only | write [recover]} | recover.

Upgrade_options[Pfile = filename] {upgrade | downgrade} [Quiet]

1,ForceResolution: force open the database. shutdown is executed before open, which is equivalent to shutdown abort; Startup open. If force is not used when the current instance is running, an error is reported when the instance is started. Force can be used in a debugging or non-production environment with caution.

2,RestrictResolution: only users with restricted session system permissions can access the database opened in this mode. After enabling restricted, you can use the alter system command to set the state to disable restricted and enable the database normally.

3,Pfile = filenameResolution: Open the instance with parameters in the specified file. If pfile is not used, startup is enabled with parameters in the default parameter file. In Unix systems, the default file is $ ORACLE_HOME/dbs/init $ oracle_sid.ora. In Windows systems, the default file is % ORACLE_HOME % \ database \ initsid. ora.

4,QuietResolution: This option is used to prevent SGA-related information from being displayed when the instance is opened.

5,Mount dbnameResolution: Open the instance in Mount mode. If dbname is not specified, open the database specified by the db_name parameter in the parameter file.

6,OpenResolution: Open the instance

7,NomountResolution: Open the instance in nomount Mode

8,RecoveR resolution: This option directs the startup to completely recover the instance before it is opened, which is the same as the recover database command. To enable automatic recovery, set autorecovery to on. If the redo log file is not in the specified position, the recovery can continue even if automatic recovery is not enabled after the backup log file is specified according to the prompt.

9,UpgradeResolution: Open the instance in open upgrade mode and set specific parameter values to run the upgrade script. You can use the upgrade option only when you open a new database version for the first time. When this option is used, run the upgrade script to upgrade the currently installed database version to an updated version. After upgrade is complete, the database must be shut down and restarted properly.

10,DowngradeResolution: You can open an instance in the open downgrade mode and set specific parameters to run the downgrade script. When this option is used, run the downgrade script to downgrade the currently installed database version to an earlier version. After downgrade is completed, the database must be shut down and restarted properly.

Ii. Instructions for use

1. You must connect as sysoper or sysdba to execute startup.

2. startup without any parameters is equivalent to startup open.

3. startup open RECOVER: even if the Recovery fails, the instance will still be loaded and opened.

Iii. Enabling instances and databases

Startup will enable the database in three steps: 1. Start and instance (nomount); 2. Mount the database (Mount); 3. Open the database (open)

1. Start and instance

In nomount, Oracle starts an instance and reads the specified initial parameter values in the spfile or pfile parameter file. Allocate the SGA shared memory area and create background processes. You can use the restrict and force options to enable instances. In restrict mode, only DBA is allowed to do the following:

Execute Structure Maintenance, such as re-indexing;

Execute database file import and export;

Execute Database loading;

Temporarily stop users from using data.

2. Mount the database

When a database is loaded in the Mount mode, the instance finds and opens the control file based on the value specified by the initialization parameter control_files, and obtains information about the data file and redo log file from the control file. In this status, the database is still closed, and only some users with database management permissions can perform operations on the database. For example:

Rename a data file;

Add, undo, or rename the redo log file;

Start and disable redo log archiving;

Restore all databases.

2.1 load RAC

You can set the initialization parameter cluster_database to true to load multiple databases. By default, the value of this initialization parameter is false, and the database will be loaded in an exclusive manner. After the first instance loads the database with cluster_database = true, the subsequent instances also load the database with cluster_database = true.

2.2 mount a replica database (standby database)

A replica database is a completely identical copy of the primary database, which can continue to provide Database Availability for disasters. Replica databases are always in the recovery mode. Only the alter database command can be used to load databases in standby mode, and archive redo logs generated by the primary database are applied in standby mode. Only read-only (open) replica databases can be opened.

2.3 load the clone Database)

A cloned database is a copy of a database used for point-in-time recovery of tablespaces. When the database is restored at the execution time point, the cloned database is loaded and restored to the expected time, and metadata (metadata) is imported from the cloned database) to the master database, copy the data files in the tablespace to the master database

3. Open the databasE

Open the database in open mode, so far the database is fully open. When the database is opened, it opens online data files and redo log files. If the tablespace is in the offline status when the database is shut down last time, the tablespace remains in the offline status when the database is re-opened. If an exception exists in a data file or redo log file, Oracle returns an error. When the database is opened, the Instance tries to obtain the Undo tablespace. If the value of the initialization parameter undo_management is Auto, the instance automatically manages undo. The default value of the initialization parameter undo_management is manual. If you use tablespace to manage undo, undo is automatically managed. This is the recommended mode. If you use rollback segment to manage undo space, use manual. If the database is shut down abnormally and there are scattered and suspicious transactions, whether committed or rolled back, when you re-open the database and restore it completely, the background process reco can automatically, immediately, and permanently complete this task.

Iv. Example

1. startup

Enable the instance with the default parameter file (spfile), load the default database, and open the database.

2. startup open dbname

Start the instance with the default parameter file (spfile), load the database dbname, and open the database.

3. startup force restrict Mount

4. startup pfile = init_dbname.ora nomount

5. startup force restrict pfile = init_dbname.ora open dbname

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.