Mohamed Azar Shaj

Oracle DBA, azarmohds@gmail.com, Riyadh Kingdom Of Saudi Arabia

Oracle Certification ** Oracle-Base ** Export and Import ** Charater set migration

About Me

My photo
Database Administrator and like to read about hackers and them activities...and completed Oracle 10g Certified associate. Active member of Oracle Forum

Startup

5:38 PM / Posted by Azar Mohamed Shaj /

Starting up a database (Nomount) :-

* When starting the database, you select the states in which it starts.


  • Usually start an instance without mounting a database only during database creation or the recreation of control-files.

sql>Startup nomount

*Starting an instance include following tasks,

  • Reading the initializtion files
  • Allocating the SGA
  • Starting the background processes
  • Opening the alertSID.log file and the trace files.
  • The database must be named with the db_name parameter.

Starting up a database (Mount) :-

* The database must be mounted but not open during the following tasks,

  • Renaming datafiles
  • Enabling and disabling redo log archive options
  • Performing full database recovery
  • Locating and opening the control file specified initializtion parameters file.
  • Reading the control files to obtain the name and status of the redo log files and datafiles.

Starting up a database (Open) :-

* An instance started and database mounted and then datbase opened. During database open ,the user can be attempt to open database and performing.

*During the database open following tasks,

  • Datafiles and ONline redolog files are Available

Note :- When you open the database, a datafiles and online redo log file not avilable ,the oracle returns error. Mean time database needs recovery options.

*** If necessary,System Monitor background process (SMON) initiates instance recovery.

Startup Command :-

To startup an instance, use the following commands

  • Startup [force] [restrict] [pfile=filename] [open [recover] [database] Mount Nomount ]

Note :- This is not the Complex syntax.

  • Force ---> aborting the running instance before performing a startup
  • Restrict ---> Enables only users with restricted session privilege to access the database
  • Recover ---> can be media recovery when the database starts

**** Attempting to open Oracle utilities without start the service, Oracle returns a error Ora-12547 --TNS

The Alter Database Command :-

* Chang the states of the database from Nomount ot Mount stage,

sql> alter database db01 mount;

* Open the database read only mode

sql> alter database db01 open read only;

Alter database db01 open [read only read write]

where

  • Read Write ---> Opens the database read write mode so users can generate redo logs.
  • Read Only ----> Restrict users to read only transactions,preventing them from generating Redo log information.

Restrict Command :-

sql>startup restrict;

* Use the Alter system command in restriction mode,

sql> alter system enable restricted session;

**** When you perform struture maintanice or database export or import. The database can be restricted session so that it is available only to the restricted session privilige users.

Alter system [enable disable ] restricted session;

  • Enable ---> who have restircted privilige users
  • Disable ----> users who do not have the priviliges also log on.

Terminate Session :-

* After placing an instance in resticted mode, you may want to kill all current user sessions before performing administrative tasks.

  • Alter system kill session 'integer1,integer 2'

Where

  • Integer 1 ----> Value of the column in the v$session view
  • Integer 2 ----> value of the serail# in the v$session view

***** http://www.oracle-base.com/articles/misc/KillingOracleSessions.php

Efects of Terminating a Session :-

* Pmon perform following tasks,

  • Roll back the users current transaction
  • Release all currently held table or rows
  • Free all resources currently reserved by the user

Opening database in Read Only Mode :-

  • Executes query
  • Execute disk sort using locally managed tablespace
  • Take datafiles offline and Online ,.Not tablespace
  • Perform recovery offlines of datafile and tablespace.

0 comments:

Post a Comment