Unit-5 Final
Unit-5 Final
https://easy2learncode.in
22
RDBMS Using Oracle unit-5
Instance architecture :=
1. Database processes
2. Memory structure
3. Data files
https://easy2learncode.in Page 2
RDBMS Using Oracle unit-5
Processes
Process is a job or task.
An oracle server has three types of processes.
1. User/client process
This process is the user’s connections to the
RDBMS system.
When the user name and password is valid,
session is established and a user process is
created on the client side to act on behalf of
the user.
2. Server process
https://easy2learncode.in Page 3
RDBMS Using Oracle unit-5
3. Background process
Background process are :
DBWR(database writer)
LGWR(log writer)
SMON(system monitor)
PMON(process monitor)
CKPT(check point)
ARCH(Archive Process)
RECO(Recover Process)
LCKN(Locking)
SNP(snapshot/job process)
DN(Dispatcher Processes)
Memory Structure.
1)SGA (SYSTEM GLOBAL AREA)
Shared pool
Database buffer cashe
Redo log buffer
Java pool
Large pool
2) PGA(PROGRAM GLOBAL AREA)
https://easy2learncode.in Page 4
RDBMS Using Oracle unit-5
Data files
Control files
The control file resides on the operating system file
system.
This files contain the location of data files, location of
redo log files.
https://easy2learncode.in Page 5
RDBMS Using Oracle unit-5
Syntax :
https://easy2learncode.in Page 6
RDBMS Using Oracle unit-5
Example :
Create database firstdb
datafile '/disc03/firstdb/system1.dbf ' SIZE 20M
LOGFILE '/disc04/firstdb/log1.log '
'/disc05/firstdb/log2.log ' SIZE 512K;
ALTERING Database
NOMOUNT Mode :
It reads only SPFILE or PFILE and allocating SGA.
EX., startup nomount
https://easy2learncode.in Page 7
RDBMS Using Oracle unit-5
MOUNT Mode:
It reads SPFILE or PFILE and open control files.
Ex., startup mount
Or
Alter database mount
OPEN Mode:
It reads SPFILE or PFILE, open control files, datafiles
and redo log files.
Ex., startup
Or
Alter database open
Shutdown modes A I T N
Allow new connections No No No No
Waits until current sessions No No No Yes
end
Waits until current Transaction No No Yes Yes
end
Forces a chechpoint and closes No Yes Yes Yes
files
Shutdown modes:
A = ABORT
I = IMMEDIATE
T = TRANSACTIONAL
N = NORMAL
https://easy2learncode.in Page 8
RDBMS Using Oracle unit-5
Ex.,
Shutdown
Shutdown transactional
Shutdown immediate
Shutdown abort
EX.,
Create tablespace tbs_demo1 datafile 'data_ff1' size 100k;
Alter tablespace
Add a DATAFILE- Example.
https://easy2learncode.in Page 9
RDBMS Using Oracle unit-5
Drop a tablespace
drop tablespace tbs_demo1 including contents;
Rollback Segment
Rollback segments are areas in database, which are
used to temporarily save the previous values when
some updates(UPDATE/INSERT/DELETE) are going
on.
Syntax:
https://easy2learncode.in Page 11
RDBMS Using Oracle unit-5
Oracle Blocks
A block is the smallest unit of storage in an oracle
database.
Data block size is defined during the creation of a
database.
They are the smallest unit of storage that oracle can
allocate to an object.
They are physically stored on disk.
SEGMENT
BLOCK
BLOCK
EXTENT EXTENT
EXTENDS
It consists of data block.
An extends is used to minimize the amount of
wasted(empty) storage.
SEGMENT
A segment is a set of extent used to store a particular
type of data.
https://easy2learncode.in Page 12
RDBMS Using Oracle unit-5
Import
The Import utility allows you to restore the database
information held in previously created Export
files(Dump files).
Syntax:
https://easy2learncode.in Page 13
RDBMS Using Oracle unit-5
Export
Export is a logical backup of database. This utility
copy the data and database to a binary OS file in
special format. i.e., moves data out of oracle database.
EXPORT MODES:
MODE DESCRIPTION
https://easy2learncode.in Page 14
RDBMS Using Oracle unit-5
SQL*Loader
SQL * LOADER is a high speed data loading utility that
loads data from external files into tables in oracle
database.
It is only way that you can load data created in
another DBMS into oracle.
SQL * LOADER loads data using a control file.
https://easy2learncode.in Page 15
RDBMS Using Oracle unit-5
1. CONTROL FILE
The Control file is a text file written in a language
that SQL * Loader where to find data, how to parse
and interpret data, and where to insert data.
It also specify how to interpret data, what column
and tables to inserts the data into, and also include
input data file management information.
2. LOG FILE
When SQL * LOADER begins execution, it creates a
LOG FILE.
If it can not create a log file, execution terminates.
The LOG FILE contailns a detailed summary of the
load, including a description of any error that occur
during the load.
3. BAD FILE
The BAD FILE contains rejected records either by
sql*loader or by oracle.
Whenever you insert the data into a database you run
the risk of that insert failing because of some type of
error like integrity constraints represents the most
common type of error.
Whenever sql*loader encounters a database errors
while trying to load a record it writes that records to
a file known as the bad files.
https://easy2learncode.in Page 16
RDBMS Using Oracle unit-5
4. DISCARD FILE
The discard file contains the records that where
filtered out of the load because they did not match
any record selection criteria specified in the control
file.
Discard file are used to hold records that do not meet
selection criteria specified in the sql*loader control
file.
Discard file are optional you will only gate a discard
file if you have specified a discard file name.
5. DATAFILE
A datafile can be associated with only one tablespace
and only one database.
Oracle creates a datafile for a tablespace by allocating
the specified amount of disk .When a datafile is
created.
When a datafile is first created, the allocated disk
space is formatted but does not contain any user data.
However, Oracle reserves the space to hold the data
for future segments of the associated tablespace
https://easy2learncode.in Page 17
RDBMS Using Oracle unit-5
Follow Us :
https://easy2learncode.in Page 18
RDBMS Using Oracle unit-5
https://easy2learncode.in Page 19