oracle starts with three steps

Keywords: Big Data Oracle SQL Database

There are three processes to start oracle, nomount, mount, open

I. nomount stage

During the nomount phase, you can see that the instance has started.The oracle process creates a shared memory pool based on the parameter file.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1653518336 bytes
Fixed Size          2213896 bytes
Variable Size         956303352 bytes
Database Buffers      687865856 bytes
Redo Buffers            7135232 bytes
SQL>

You can see that shared memory has been developed

[root@localhost dbs]# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00000000 98304      oracle     600        393216     2          dest         
0x00000000 131073     oracle     600        393216     2          dest         
0x00000000 163842     oracle     600        393216     2          dest         
0x00000000 196611     oracle     600        393216     2          dest         
0x00000000 229380     oracle     600        393216     2          dest         
0x00000000 262149     oracle     600        393216     2          dest         
0x00000000 294918     oracle     600        393216     2          dest         
0x00000000 327687     oracle     600        393216     2          dest         
0x00000000 360456     oracle     600        393216     2          dest         
0x33554094 1048585    oracle     660        4096       0                       
0x00000000 425994     oracle     600        393216     2          dest         
0x00000000 458763     oracle     600        393216     2          dest         
0x00000000 491532     oracle     600        393216     2          dest         
0x00000000 524301     oracle     600        393216     2          dest         
0x00000000 557070     oracle     600        393216     2          dest         
0x00000000 688143     oracle     600        393216     2          dest         
0x00000000 720912     oracle     600        393216     2          dest 

The process is already started

oracle     2965      1  0 04:44 ?        00:00:00 ora_pmon_test
oracle     2967      1  0 04:44 ?        00:00:00 ora_vktm_test
oracle     2971      1  0 04:44 ?        00:00:00 ora_gen0_test
oracle     2973      1  0 04:44 ?        00:00:00 ora_diag_test
oracle     2975      1  0 04:44 ?        00:00:00 ora_dbrm_test
oracle     2977      1  0 04:44 ?        00:00:00 ora_psp0_test
oracle     2979      1  0 04:44 ?        00:00:00 ora_dia0_test
oracle     2981      1  0 04:44 ?        00:00:01 ora_mman_test
oracle     2983      1  0 04:44 ?        00:00:00 ora_dbw0_test
oracle     2985      1  0 04:44 ?        00:00:00 ora_lgwr_test
oracle     2987      1  0 04:44 ?        00:00:00 ora_ckpt_test
oracle     2989      1  0 04:44 ?        00:00:00 ora_smon_test
oracle     2991      1  0 04:44 ?        00:00:00 ora_reco_test
oracle     2993      1  0 04:44 ?        00:00:00 ora_mmon_test
oracle     2995      1  0 04:44 ?        00:00:00 ora_mmnl_test
oracle     2997      1  0 04:44 ?        00:00:00 ora_d000_test
oracle     2999      1  0 04:44 ?        00:00:00 ora_s000_test

View parameter profile location

SQL> show parameter spfile

NAME                     TYPE                  VALUE
------------------------------------ --------------------------------- ------------------------------
spfile                   string                /u01/app/oracle/product/11.2.4
                                       /db_1/dbs/spfiletest.ora
SQL> 

After removing the configuration file, startup nomount reported the following error:

SQL> startup nomount;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.4/db_1/dbs/inittest.ora'
SQL>

2. mount stage

In mount phase, oracle looks for the name and location of the control file based on the parameter file of nomount phase. Once it finds the control file, it locks it immediately. The control file records important information such as data files, log files, checkpoint information in the database.When mount is started, nomount is automatically started first

startup mount

As you can see in the mount phase, there is one more prompt for database mounted than in the nomount phase.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1653518336 bytes
Fixed Size          2213896 bytes
Variable Size         956303352 bytes
Database Buffers      687865856 bytes
Redo Buffers            7135232 bytes
Database mounted.
SQL> 

View Control File Location

SQL> show parameter control

NAME                     TYPE                  VALUE
------------------------------------ --------------------------------- ------------------------------
control_file_record_keep_time        integer                   7
control_files                string                /u01/app/oracle/oradata/test/c
                                       ontrol01.ctl, /u01/app/oracle/
                                       flash_recovery_area/test/contr
                                       ol02.ctl
control_management_pack_access       string                DIAGNOSTIC+TUNING
SQL> 

Remove the profile and start it once.

SQL> startup mount;
ORACLE instance started.

Total System Global Area 1653518336 bytes
Fixed Size          2213896 bytes
Variable Size         956303352 bytes
Database Buffers      687865856 bytes
Redo Buffers            7135232 bytes
ORA-00205: error in identifying control file, check alert log for more info

SQL> 

3. open Phase

The open phase officially opens the bridge between the instance and the database by locating database files, log files, etc. based on the information recorded in the control file.If the data file or log file is missing, open fails.
After open, if you use the archive logging feature, you can see the progress of archiving the log.

SQL> alter database open;

Database altered.

SQL> 

View the location of log files and log files

SQL> select file_name from dba_data_files;

FILE_NAME
------------------------------------------------
/u01/app/oracle/oradata/test/users01.dbf
/u01/app/oracle/oradata/test/undotbs01.dbf
/u01/app/oracle/oradata/test/sysaux01.dbf
/u01/app/oracle/oradata/test/system01.dbf

SQL> 
SQL> select group#,member from v$logfile;

    GROUP#      MEMBER
-------------------------------------
     3          /u01/app/oracle/oradata/test/redo03.log

     2          /u01/app/oracle/oradata/test/redo02.log

     1          /u01/app/oracle/oradata/test/redo01.log

Start after moving a data file with the following error

SQL> startup;
ORACLE instance started.

Total System Global Area 1653518336 bytes
Fixed Size          2213896 bytes
Variable Size         956303352 bytes
Database Buffers      687865856 bytes
Redo Buffers            7135232 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/u01/app/oracle/oradata/test/users01.dbf'

SQL> 

Would it be okay if I just copied a file in?Start as follows:

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01122: database file 4 failed verification check
ORA-01110: data file 4: '/u01/app/oracle/oradata/test/users01.dbf'
ORA-01210: data file header is media corrupt

summary

We can use statup to start the oracle database or shutdwon to close it.If you start with startup, there are actually three processes involved.

In general, without parameter files, instances cannot be created, databases cannot be nomount ed successfully, databases cannot mount without configuration files, databases cannot be opened for use without data files.

Posted by JellyFish on Thu, 16 May 2019 16:56:20 -0700