Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle startup phase

Shulou Source: shulou.com Published: 2022-06-01 11:33:49 10月03日 Update

Start-up is divided into three steps:

1. Nomount stage, this stage is the instance start, according to the parameter file for system allocation of memory, start background process.

2. Mount stage, according to the control file to check the name and location of the data file and log file, the instance and database connected.

3. Open stage, is the database open stage, open is to check whether the file is normal, there is no file loss or inconsistency, loss is an error, inconsistent instance recovery.

Stop database:

sysdba & sysoper can only start and stop the database!

View the current state of the database:

select status from v$instance;

Stop database:

shutdown normal = shutdown

1. New connections are not allowed

2. Wait for the query to end

3. Wait for transaction completion

4. Checkpoints are generated (dirty data in buffer cache is written to disk)

5. Close the data file

6. Close control file

7. Close instance (stop all daemons, free shared memory segments)

shutdown transactional

1. New connections are not allowed

*2. Do not wait for the query to end

3. Wait for transaction completion

4. Checkpoints are generated (dirty data in buffer cache is written to disk)

5. Close the data file

6. Close control file

7. Close instance (stop all daemons, free shared memory segments)

shutdown immediate (the most common option)

1. New connections are not allowed

1. New connections are not allowed

*2. Do not wait for the query to end

*3. Transactions are rolled back

4. Checkpoints are generated (dirty data in buffer cache is written to disk)

5. Close the data file

6. Close control file

7. Close instance (stop all daemons, free shared memory segments)

For the first three shutdown parameters, the database is clean, and no instance recovery is required when restarting!

shutdown abort

Instance recovery is required when restarting! --> smon

ps -ef | grep pmon

ipcs -sm

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Start database:

in three phases

1. Assign instance nomount:

Parameter file required

Directory where trace files need to be saved (instance managed directory)

ps -ef | grep pmon

ipcs -sm

2. Load control file mount

All you need is control files.

3. Load online logs and data files open

Online logs and data files required

startup = startup open

Three steps to start continuously

Start the database in stages:

Start the database to phase one: nomount

startup nomount --> Start instances only (shared memory segments and daemons)

SQL> select status from v$instance;

STATUS

------------

STARTED

Start database to stage 2: mount

Data if shutdown status:

startup mount

If the data is in STARTED state: you cannot use the startup command, only use the command to modify the database

alter database mount;

SQL> select status from v$instance;

STATUS

------------

MOUNTED

Start the database to stage 3: open

Data if shutdown status:

startup

Data If STARTED Status:

alter database mount;

alter database open;

alter database open read only;

Data If Mounted Status:

alter database open;

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

startup command:

startup nomount

startup mount

startup open = startup

startup pfile='/home/oracle/initdemo.ora'

startup restrict

*startup force = shut abort + startup --> Force restart (caution)

conn / as sysdba

alter system enable restricted session;

alter system disable restricted session;

alter database mount;

alter database open;

alter database open read only; --> only query cannot dml, can write locally managed temp table space

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tags: Data file database instance phase state control memory background process check query three transaction parameter command log checkpoint consistency directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Tech Info Huawei OPPO Reno macOS