Oracle 5
Oracle 5
· 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 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.
· 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.
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.
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.
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.
i. Table
definitions ii.
Table Data
iii. Table Indexes
iv. Triggers/Constraints/Bitmap Index
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.
Syntax:
Imp <user name/password> file = <file name> from user = <user
name>
table = <table name>
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.
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.
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:
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.
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.
· Network Transparency
· Protocol Independence
· Media/Topology Independence
· Heterogeneous Networking
· Large Scale
Scalability NETWORK
TRANSPARENCY:
PROTOCOL INDEPENDENCE:
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:
LARGESCALE SCALIBILITY:
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:-
- READ IN LITHOS.
3) CONTROL FILE:
- READ IN LITHOS.
2) LOGICAL LAYER:
ANS:-
1) USER PROCESS:-
2) CHECK POINT(CKPT):-
- WHEN THE REDO LOG FILE SWITCH ,
A CHECK POINT ACCURE.
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):-
6) ARCHIVER(ARCH):-
8) JOB QUEUE(SNP):-
ANS:-
ANS:-
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:-