0% found this document useful (0 votes)
16 views20 pages

Oracle 5

The document provides an overview of Oracle architecture, detailing components such as the System Global Area (SGA), tablespaces, export/import utilities, SQL*Loader, and backup strategies. It explains the roles of control files and redo log files in database recovery and introduces Net8 for network connectivity in client-server models. Additionally, it includes a series of one-word questions and answers to reinforce key concepts.

Uploaded by

hirenheckar55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views20 pages

Oracle 5

The document provides an overview of Oracle architecture, detailing components such as the System Global Area (SGA), tablespaces, export/import utilities, SQL*Loader, and backup strategies. It explains the roles of control files and redo log files in database recovery and introduces Net8 for network connectivity in client-server models. Additionally, it includes a series of one-word questions and answers to reinforce key concepts.

Uploaded by

hirenheckar55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

CH-5 ORACLE ARCHITECTURE

EXPLAIN ARCHITECUTER OF ORACLE.

· When someone refers to the Oracle database, they are most likely
referring to the entire Oracle database management system (DBMS).
THE SYSTEM GLOBLE AREA (SGA)
· The SGA is the primary component of the instance.
· It holds all the memory structures necessary for data manipulation, SQL
statement parsing, and redoes caching.
· The SGA is shared, which means that multiple processes can access and
modify the data contained within it at the same time.
· All databases operations use structures contained instance the SGA at
one point or another. As mentioned instance the previous section, the
SGA is when the instance is created, during the no mount stage of the
database, and is de allocated when the instance is shut down.

The SGA consists of the following:


- Shared pool
- Database buffer cache
- Redo log buffer
- Multithreaded server(MTS) structures
These are explained instance the following
sections.

THE SHARED POOL

§ The shared pool (see figure 2) contains the library cache, the dictionary
cache nd server control structures (such as database character set).
§ The library cache stores the text, parsed format, and execution plan of
SQL statements that have been submitted to the RDBMS, as well as the
headers of PL/SQL packages and procedures that have been executed.
§ The dictionary cache stores data dictionary rows that have been used
to parse SQL statements.

Parsing and executing SQL statements.

· The Oracle server uses the library cache to improve the performance of
SQL statements. When a SQL statement is submitted, the server first
checks the library cache to see if an identical statement has already been
submitted and cached.
· If it has, Oracle uses the stored parse tree and execution path for the
statement, rather than rebuilding these structures from scratch.
· Although this might not affect the Performance of ad hoc queries,
applications using stored code can gain significant performance
improvements by utilizing this feature.

ONE WORD QUESTION AND ANSWER


SR.NO QUESTION ANSWER
1. SGA MEANS? SYSTEM GLOBAL AREA
2 PGA MEANS? PROGRAM GLOBAL
AREA
3 SGA IS _TOOL PRIMARY
4 SGA IS SHARED? YES
5 WHO USE SGA? MULTIPLE USER USE.
EXPLAIN TABLESPACE IN DETAIL.
· The database is divided into one or more logical pieces known
as tablespaces.
· A tablespaces is used to logically group data together.
· For the different application one can create a separate tablespace.
· At the time of database creation it will automatically create
SYSTEM tablespace.
· Which is used to store important internal structures such as
data dictionary, the system stored procedures.
· The SYSTEM tablespace is used as the default for all database
users, which is not desirable.
· The Oracle tablespace is the lowest logical layer of the oracle
data structure.
· The tablespace consists of one or more data files.

· Tablespace is made read-write by default, but it can be altered


to become read-only.
· A tablespace can consist of 1022

data files. A tablespace can create with

the following options

Online:
This option specifies that the tablespace be brought online after creation it
can be used immediately.

Offline:
It specifies that the tablespace is left offline after creation.

Read only:
It specifies that tablespace is read only.
It is of no meaning to make the tablespace read only at the time of
creation. Create the tablespace and populate them, then if desire makes
the tablespace read only.

Permanent:
This specifies that the tablespace is for permanent
objects. This is the default parameter.
This option is used for all schema objects except for temporary tablespaces.

Temporary:
This specifies that the tablespace is for temporary objects.

Create Tablespace command is used to create tablespace.


One has to specify the name of the data file(s) that the tablespace has.

EXAMPLE:CREATE TABLESPACE msc DATAFILE '\disk03\mymscfile1.dbs' SIZE 10M


permanen

This command creates the tablespace and makes it immediately available.


After this command is issued, one will find a file at the specified location
and with the specified size.
ONE WORD QUESTION AND ANSWER
SR.NO QUESTION ANSWER
1. TABLE SPACE MEANS LOGICAL PIECES OF
OUR DATABASE
2 HOW MANY TYPES OF TABLE 6
SPACE?
3 TABLE SPACE USE DATA FILE? YES

EXPLAIN EXPORT AND IMPORT IN DETAIL.


ANS:
· Export is logical backup of database.
· This utility copy the data and database to a binary OS file in
special format.
· Export files store information about schema objects created for database.
· Using this utility we can backup database while it is open and avail
for use.
· There are three modes of export.

Mode Description
User Export all objects owned by a user.
Table Export all or specific tables owned by a user along with
index, constraints and triggers.
Full Database Exports all objects of the database except the one owned by
SYS.

· There are three types of export:

Incremental Only database data that has changed is exported. For


Export example if tables A, B and C exist, and only table A’s
information has been modified since the last
incremental export, only table A is exported.
Cumulative
Export

Completed
Export

Syntax:
Exp username/password inctype =
<incremental/cumulative/complete>
file = <export_file name>

IMPORT:
· The import utility allows you to restore the database
information held in previously created Export files.
· It is the complement utility to Export.

Import loads data in the following


order:

i. Table
definitions ii.
Table Data
iii. Table Indexes
iv. Triggers/Constraints/Bitmap Index

· First, new tables are created.


· Then data is imported and indexes are built.
· Then triggers are imported, integrity constraints are enabled on
the new tables, and any bitmap and functional indexes are
built.
· There are three modes of imports.

Mode Description
User Imports all objects owned by a user.
Table Imports all or specific tables owned by a user along with
index, constraints and triggers.
Full Database Imports all objects of the database.

· By default, import commits only after loading each table, and it


performs a rollback when an error occurs, before continuing with
the next object.

Syntax:
Imp <user name/password> file = <file name> from user = <user
name>
table = <table name>

ONE WORD QUESTION AND ANSWER


SR.NO QUESTION ANSWER
1. EXPORT MEANS? BACKUP DATA
2 HOW MANY TYPES OF 3
EXPORT AVAILABLE
3 IMPORT MEANS??? RECOVERY
4 HOW MANY TYPES OF 3
IMPORT ARE AVILABLE?
EXPLAIN SQL
*LOADER. DETAILING:-
· SQL *LOADER is high speed data loading utility that loads data from
external files into tables in an oracle database.
· It is the only way you can load data created in another DBMS into oracle.
· SQL *LOADER loads the table using a control file.
· The Data may be in a separate file or may be included in the control file.
· The data may be in the fixed length fields.

Features:
1. Loads data into multiple files.
2. Loads fixed/variable length data.
3. Converts data to oracle data types.
4. Combine more than one physical record into one logical record.
5. Break single physical record into multiple logical records.
6. Generates unique keys via sequence generator.
7. Use SQL function before data insert.

SQL *LOADER FILES:

a. Control File
b. Log File
c. Bad File
d. Discard File
e. Data File

Control file:
· The control file is a text file written in a language that SQL
*LOADER understands.
· The control file tell the SQL *LOADER where to find the data, how to
parse and interpret the data, and where to insert the data.
The control file provides the following information to the SQL *LOADER:
· The name and location of the input data file.
· The format of the records in the input data file.
· The name of the table or tables to be loaded.
· The name and the location of the bad file and discard file.

Log file:
· When SQL *LOADER begins execution it creates a LOG FILE.
· If it cannot create a log file, execution terminates.
· The log file contains detailed summary of the load, including a description
of any errors.
Log file contains following information:
· The names of the control file, log file, bad file, discard file and data file.
· The values of several command line parameters.
· Error messages for records that cause errors.

Bad File:
·MATThEeRbIaAd Lfi le(Bc.oCnAta. in&s Bth.eSCre.(cIo.Trd.s) SreEjeMct-
e3d) , either by SQL *LOADER or by ORACLE.
· Lack of free space in a table space, can also cause insert operation to fail.
· Whenever SQL *LOADER encounters a database error while trying to load
a record, it writes that record to a file known as the BAD file.

Discard File:
· The discard file contains records that were filtered out of the load because
they did not match any record selection criteria specified in the control
file.

ONE WORD QUESTION AND ANSWER


SR.NO QUESTION ANSWER
1. SQL LOADER MEANS HIGH SPEED DATA
LOADING UTILITY
2 HOW MANY FILE ARE USE IN 4
LOADER
3 ROLE OF SQL LOADER OTHER DATABSE DATA
IS USE IN ORALCE.

Explain backup in detail.


A backup is a duplicate copy of data.
This copy can include important parts of a database such as the control file, redo logs
and data files.

Types of backup:
Physical Backup
Logical Backup

· Physical backups are copies of physical database file like control files,
redo log files and data files.
· Logical backups store information about the schema objects created for
a database.
· It contains data that is expected using SQL commands and stored in a
binary file.
· Facilities like IMPORT/EXPORT are used for logical backup.

BACKUP STRATEGY:

· Run the database in ARCHIVELOG mode and archive redo logs to


multiple locations.
· Maintain multiple concurrent backups of the control file.
· Take frequent backups of physical data files and store them in a safe
place, making multiple copies if possible.

BACKUP TYPES:
1. Online Database backup (Hot backup)
2. Offline Database backup (Cold backup)
3. Whole Database backup
4. Table space backup
5. Data file backup
6. Control file backup
7. Archived Redo log backup
· If the database must be up and running 24 hours a day, 7 days a week
then no choice but to perform online backups of whole database which is
in ARCHIVELOG mode.
· When database is shutdown at the time of backup, it is called offline backup.
· A whole database backup contains the control file, and all database
files, which belong to that database.
· A table space backup is a backup of a subset of the database.
· A data file backup is back up of a single data file.

ONE WORD QUESTION AND ANSWER


SR.NO QUESTION ANSWER
1. BACKUP MEANS COPY OF DATA
2 HOW MANY TYPES OF 7
BACKUP
3 BACKUP USE IMPORT AND YES
EXPORT

Q- 7. EXPLAIN CONTROL FILE AND REDOLOG FILE.

REDO LOG FILE:


· Redo log files hold information used for recovery in the event of a
system failure.
· Redo log files store a log of all changes made to the database.
· This information is used in the event of a system failure.
· If redo log information is lost, you cannot recover the system.
· Since the redo log files are very important for recovery purpose,
oracle recommends that redo logs be multiplexed.
· Multiplexing is maintaining multiple copies.
· Each copy of redo log files should be of the same size and placed
on separate disks.
· This will prevent loss of data in redo file in the event of the loss of a disk.
· You can transfer the redo entries to another media before
overwriting them; this process is known as archiving.
· Archiving can be done automatically every time a redo log file becomes
full and LGWR starts writing to another file.
· The event when LGWR stops writing to one file and starts writing
to another file is called a Log Switch.
· This all process done by oracle engine automatically.

CONTROL FILE:

· This is very important file that is required for the oracle database
to function.
· If any one of the control file is unavailable, the database is shutdown.
· Hence it is recommended that multiple copies of the control files
are maintained in the database or separate disks.
· The control file keeps a record of the names, size and locations
different physical files of the database.
· It contains the information used to start an instance, such as the
location of the data file and redo log files.
· Oracle needs this information to start the database instance.
· Control files must be protected.
The entries maintained in the control file are:
1. The database identified and name.
2. Time of database creation.
3. Table space name.
4. Name and location of data files and online redo log files.

ONE WORD QUESTION AND ANSWER


SR.NO QUESTION ANSWER
1. REDO LOG FILE USE FOR RECOVERY PURPOSE
2 CONTROL FILE USE FOR FUNCTION PURPOSE
3 WHAT HAPPEN IF BOTH FILE ORALCE ARCHITECTURE
ARE NOT AVAILABLE NOT START.

WHAT IS NET 8? EXPLAIN ITS FEATURES.


· Net8 is the follow-on networking product to SQL*plus.
· It is used in client server model
· Net8 connect server and client.
· If net8 not available then we can not perform client server mode.
· Oracle used net8 from connect client and server pc.
· Its primary purpose is to enable the underlying network
connectivity between remote client applications and Oracle servers.
· Net8 enables the machines in your network to "talk" with one another.
· It facilitates and manages communication sessions between a
client application and a remote database.
Specifically, Net8 performs three basic operations:

· Connection - opening and closing connections between a client (or


a server acting as a client) and a database server over a network
protocol.
· Data Transport - packaging and sending data such as SQL
statements and data responses so that it can be transmitted and
understood between a client and a server.
· Exception Handling - initiating interrupt requests from the client
or server.

Net8 provides the following benefits to users of networked applications:

· Network Transparency
· Protocol Independence
· Media/Topology Independence
· Heterogeneous Networking
· Large Scale

Scalability NETWORK

TRANSPARENCY:

· Net8 provides support for a broad range of network transport


protocols including TCP/IP, SPX/IPX, IBM LU6.2, Novell, and
DECnet.
· It does so in a manner that is invisible to the application user.
· This enables Net8 to interoperate across different types of
computers, operating systems, and networks to transparently
connect any combination of PC, UNIX, legacy, and other system
without changes
to the existing infrastructure.

PROTOCOL INDEPENDENCE:

· Net8 enables Oracle applications to run over any supported


network protocol by using the appropriate Oracle Protocol Adapter.
· Applications can be moved to another protocol stack by installing
the necessary Oracle Protocol Adapter and the industry protocol
stack.
· Oracle Protocol Adapters provide Net8 access to connections over
specific protocols or networks. On some platforms, a single Oracle
Protocol Adapter will operate on several different network
interface

boards, allowing you to deploy applications in any networking


environment.

MEDIA/TOPOLOGY INDEPENDENCE:
· When Net8 passes control of a connection to the underlying protocol, it
inherits all media and/or topologies supported by that network
protocol stack.
· This allows the network protocol to use any means of data
transmission, such as Ethernet, Token Ring, or other, to accomplish low
level data link transmissions between two machines.

HETEROGENOUS NETWORKING:

· Oracle's client-server and server-server models provide connectivity


between multiple network protocols using Oracle Connection Manager.

LARGESCALE SCALIBILITY:

· By enabling you to use advanced connection concentration and


connection pooling features, Net8 makes it possible for thousands
of concurrent users to connect to a server

ONE WORD QUESTION AND ANSWER


SR.NO QUESTION ANSWER
1. NET 8 MEANS IT IS NETWORKING
PRODUCT
2 HOW MANY TYPES OF 5
BENEFIT IN NET8
3 CAN NET 8 USE PROTOCOL YES
4 NET 8 USE TOPOLOGY YES
5 NET 8 USE IN DIFFERENT YES
NETWORK
Q- WHAT IS DATA BASE? ANS:
· DATA BASE IS A COLLECTION OF DATA FILE.

Q- EXPLAIN ORACLE DATA BASE. OR EXPLAIN ORACLE LAYER


ANS:
- THE ORACLE DATABASE HAS LOGICAL AND
PHYSICAL LAYER.
PHYSICAL LAYER:

- THE PHYSICAL OF DATA BASE CONSISTS OF 3


TYPES OF FILES
- LIKE 1)DATA FILE 2)REDO LOG FILE
3)CONTROL FILE.

1) DATA FILE:
- DATA FILE CONTAIN ALL DATA
BASE DATA.
- THE ORACLE DATA BASE IS MADE WITH ONE
OR MORE DATA FILE.
- TWO TYPES OF DATA ARE STORE
IN DATA FILE. LIKE USER DATA
AND SYSTEM DATA.

*) USER DATA:-

- USER DATA IS OUR APPLICATION DATA.


- IT STORE ALL THE ORACLE
OBJECT CREATED BY USER.
- IT STORE OUR DATA.
*) SYSTEM DATA

- SYSTEM DATA STORE SYSTEM DATA.


- IT STORE ORACLE’S INTERNAL DATA.
- SYSTEM DATA STORE OUR PASSWORD AND
USER NAME.

2) REDO LOG FILE/ TRANSACTION FILE:

- READ IN LITHOS.
3) CONTROL FILE:

- READ IN LITHOS.
2) LOGICAL LAYER:

- LOGICAL LAYER CONTAIN TABLE SPACE AND


DATA BASE SCHEMA.

1) TABLE SPACE :- (READ IN THE LITHOS)

2) DATA BASE SCHEMA:-

- DATA BASE SCHEMA IS COLLECTION OF


THE STRUCTURE OF ORACLE OBJECT.
- THE SCHEMA OBJECT CONTAIN
STRUCTURE OF OUR OBJECT LIKE TABLE , VIEW ,
SEQUENCE , INDEX AND MORE.
-

Q- EXPLAIN ORACLE PROCESS ( OR ) EXPLAIN


SERVER PROCESS (OR) EXPLAIN BACK GROUND
PROCESS.

ANS:-

- THERE ARE TWO TYPES OF ORACLE PROCESS LIKE


SERVER PROCESS AND USER PROCESS.

1) USER PROCESS:-

- USER PROCESS MEANS OUR PROCESS BUT IN


ORACEL USER CAN NOT CONTAIN ALL THE PROCESS/
- USER CAN SENT REQUEST TO THE SERVER.
- HERE IN ORACLE SERVER CAN DONE ALL
THE PROCESS.
-
2) Server process (back ground process):-
- SERVER PROCESS TAKE REQUEST FROM THE
USER PROCESS AND COMMUNICATE
WITH THE DATA BASE.
- THIS SERVER PROCESS ARE ALSO
CALLED BACKGROUND PROCESS.
- SOME IMPORTANT SERVERPROCESS ARE FOLLOW.
1) DATA BASE WRITER(DBWR):-

- DATABASE WRITER IS MANDATORY PROCESS.


- IT WRITE DATA INTO DATA BASE.

2) CHECK POINT(CKPT):-
- WHEN THE REDO LOG FILE SWITCH ,
A CHECK POINT ACCURE.

- WHEN THIS SWITCH HAPPEN ORACLE GOES


INTO MEMORY AND WRITE DIRTY DATA INTO
DISK.

3) LOG WRITER(LGWR):-
- THE LOG WRITER IS A MANDATORY PROCESS.
- IT WRITE DATA INTO LOG FILE.
4) SYSTEM MONITOR(SMON):-
- SYSTEM MONITOR IS
MANDATORY PROCESS.
- THAT PERFORM ANY RECOVERY NEEDED AT
THE STARTUP.
- IT CAN PERFORM RECOVERY FOR A FAIL DATABASE.

5) PROCESS MONITOR(PMON):-

- PROCESS MONITOR IS A MANDATORY PROCESS.


- THAT PERFORM RECOVERY FOR
FAIL USER IN CLIENT SERVER
MODEL.

6) ARCHIVER(ARCH):-

- ARCHIVER IS OPTIONAL PROCESS.


- WHEN DATA BASE IS RUNNING IN
ARCHIVE LOG MODE,THE DATA BASE GOES OUT
AND MADE COPY OF REDO LOG FILR .

- THIS JOB IS CALLES ARCHIVER PROCESS.


7) LOCK(LCK):-

- LOCK IS OPTIONAL PROCESS.


- IT IS LOCK WHOLE DATA BASE AND ALSO
INDIVIDUAL STATEMENT.

8) JOB QUEUE(SNP):-

- THIS PROCESS FACILITY PROVIDE


ORACLE SNAPSHOT TECHNOLOGY.
- THIS PROCESS WAKE UP TIME BY TIME AND
TAKE SNAP SHOT OF PROCESS AND DATA.
Q-EXPLAIN MEMORY STRUCTURE.

ANS:-

- THERE ARE TwO PARTS OR ORACLE USE TWO


TYPES OF MEMORY STRUCTURE.
- LIKE 1) SYSTEM GLOBAL AREA(SGA)
- 2)PRAGRAM GLOBAL AREA(PGA).
1) SGA:--
- READ IN LITHOS..
2) PROGRAM GLOBAL AREA:-
- PGA IS AREA OF MEMORY THAT IS USED BY
SINGLE ORALCE USER.
- THE PGA IS NOT SHARED.

Q- EXPLAIN INIT.ORA FILE. OR EXPLAIN


INITIALIZATION PARAMETER FILE.

ANS:-

- MANY TOOLS ARE AVAILABLE FOR


RUNNING THE DATA BASE.
- THE INITIALIZATION PARAMETER FILE
IS A GOOD PLACE TO START.
- A STARTUP EVERY DATABASE READ
INIT.ORA PARAMETER TO CONFIGURE ITSELF.

- BEFORE A DATABASE INSTANCE CAN START IT


MUST READ ALL THE INIT.ORA PARAMENTER FILE.
- THERE ARE 100 DIFFERENT CHANGEABLE
ENTRY,ALL AFFECTING HOW OUR DATABASE
START AND PROCESS THAT RUN AGAINST OUR
DATABASE WORK.
- SOME IMPORTANT PARAMETER ARE FOLLOW.
1) DB_BLOCK_BUFFER:
- THIS IS DATA CATCH.THIS PARAMETER
INCREASE THE SIZE OF SGA.
2) SORT_AREA_SIZE:-
- THIS IS PARAMETER THAT CONTROL THE
ALLOCATION OF MEMORY FOR STARTING
ACTIVITY.
- THIS PARAMETER USED IN SQL STATEMENT
LIKE ORDER BY AND GROUP BY CLAUSE.
3) OPEN_ CURSOR:-
- THIS PARAMETER IS THE MAXIMUM NO.
OF CURSOR USER CAN OPEN AT A
TIME.
4) DATABASE_WRITER:-
- THIS PARAMETER CONTROL THE NO.OF
PROCESS THAT WRITE TO THE DATA
BASE CONCURRENTLY.
5) DB_NAME:-
- THIS PARAMETER SPECIFY THE NAME OF DATABASE.

Q- EXPLAIN DATA
BLOCK. ANS:-
- THE DATA BLOCK IS A SMALLEST UNIT OF STORAGE.
Q- EXPLAIN
EXTENTS. ANS:-
- EXTENTS CONSIST OF DATABLOCK.
Q- EXPLAIN SEGMENT. ANS:-

- SEGMENT IS SET OF EXTENTS.


Q- EXPLAIN SET OPERATOR.
ANS:-
- WHENEVER WE HAVE MORE THAN ONE QUERY AND
WE WISH TO COMBINE THE RESULT OF MORE THAN
ONE QUERY , SET OPERATOR IS USED.
- THE COMBINATION OF MORE THAN ONE QUERY IS
CALLED COMPOUND QUERY . SO THAT SET
OPERATOR ARE USE IN
COMPOUND QUERY.
TYPES OF SET
OPERATOR.
1) UNION:-
- THIS OPERATOR COMBINE THE RESULT OF FIRST
QUERY + RESULT OF SECOND QUERY.
- DUPLICATE RAW WILL BE ELIMINATED.
2) UNION ALL:-
- IT WILL NOT ELIMINATED DUPLICATE RAW.
3) INTERSECT:-
- RETURN ONLY COMMON RAW IN BOTH
query.
4) MINUS:-
- RETRIVE ALL RAW SELECTED BY THE FIRST
QUERY THAT ARE NOT IN SECOND
QUERY.
SELECT * FROM EMP WHERE DEPTNO IN ( 10,20)
MINUS
SELECT * FROM EMP WHERE DEPTNO=20;

Q- EXPLAIN DUAL TABLE


ANS:-
- DUAL TABLE IS DEFAULT TABLE.
- DUAL TABLE IS USED TO DISPLAY RESULT
OF FUCTIONA AND SOME
PROCESS.
- DUAL TABLE IS BLANK TABLE.

You might also like