Oracle DBA, How To, Error, Cause and Action

Showing posts with label Mount. Show all posts
Showing posts with label Mount. Show all posts

Oracle Database Startup Process (2/2)

Oracle Database Startup Process (1/2)
Oracle Database Startup Process (2/2) [You are Here]


5. Once you are at mounted state you will able to query selected Oracle management view, in this case we can see the state of the database.
The command is

SELECT name, open_mode FROM v$database;


6. Now we going to upgrade the state to open state. The command is ALTER DATABASE OPEN;



7. Again to see the state of the database we can use the query from step 5. SELECT name, open_mode FROM v$database;



As you can see that I am now at READ WRITE, that is mean I am Open READ WRITE. As I mentioned earlier there are three types of open state mode, READ WRITE, READ ONLY and RESTRICTED.

8. Above all are the stage of Oracle database startup, you don't have to jump from one state to another, I just demonstrate to you to show you different type of startup stage.
Normally you just need to issue command STARTUP to startup the database at open stage.

Now I am shutdown my database and perform normal startup.


As you can see in order for the Oracle database to go to OPEN state Oracle will go through 3 stages, Nomount, Mounted then Open. (I drew 1, 2, 3)

So STARTUP command will perform all three stages.

In short how to startup Oracle database.

1. login as oracle account
sqlplus "/as sysdba"
2. at SQL prompt
startup



Please note:

Once the database at higher stage it will not be able to go back to lower stage, for example from mount state to nomount state, or from open state to mount or to nomount state, the only way to go to lower state is by shutdown the database and startup again.


Oracle Database Startup Process (1/2)
Oracle Database Startup Process (2/2) [You are Here]

Oracle Database Startup Process (1/2)

Oracle Database Startup Process (1/2) [You are Here]
Oracle Database Startup Process (2/2)

There are three stages Oracle will going through to startup the Database instance.
First is Nomount, then it goes to Mount and finally Open.

As end user of the database you will always want your database to be at open stage.

Started database at Nomount stage is typically, you do so only during database creation, when you want to recreate your Oracle Control Files. (Control Files is an important file part of your database)

Started database at Mount stage is needed during the time we perform specific database maintenance (like during backup and recovery, renaming datafiles and many more).

Started database at Open stage is a normal operating operating condition, well, there are three types of Open Mode,
1. Open Read Write (Normal Operation, which you can update the database records)
2. Open Read Only (You are able to query the database records no update operation is allowed, this can for static database or standby database (Oracle Data Guard, will discuss this further).
3. Open Restricted, that's mean no one can access the database, the database is only available for those with administrative privileges, you would want to have Open Restricted mode during maintenance, to prevent other end user without administrative privileges to make any changes while you are working.

You need to have sysdba privilege to startup shutdown database.

1. Connect as sysdba

sqlplus "/as sysdba"



2. in the SQLPLUS prompt type following command to startup nomount

startup nomount

As you can see the Total System Global Area and everything below is the Oracle memory which know as SGA.
SGA and Oracle processes are created when your database at nomount stage.

3. The way to check if the system is at nomount stage you can see the process is running or not. You can use following Linux command.

ps -ef |grep smon

I have to exit from SQLPLUS to the Linux prompt, with SQLPLUS command exit to exit.

You can see there is line in my example
oracle 6854 1 0 22:59 ? 00:00:00 ora_smon_edba01

we see one ora_smon_edba01 process running, please note that 6854 is my process id assigned by my Linux OS, for you case most probably is different number.
smon is system monitor, oracle instance have 1 smon process running whenever instance running. Please note some dba may use pmon (process monitor) instead of smon, is all the same, our intention is to see that we have oracle process running.
edba01 is my Oracle SID (system identification), if you see more than one smon_[your SID] that's mean you have multiple Oracle instance running.

4. Now I login back to Oracle SQLplus and will alter database to mount stage by using command ALTER DATABASE MOUNT;


Oracle Database Startup Process (1/2) [You are Here]
Oracle Database Startup Process (2/2)