13
WHAT IS ORACLE DATABASE Oracle Storage Structure I n t e l l i p a a t S o f t w a r e S o l u t i o n s P v t . L t d . 1

Online Training on Oracle Database and Storage Structure

  • Upload
    diwakar

  • View
    18

  • Download
    1

Embed Size (px)

DESCRIPTION

1 - What is Oracle Database?2 - Why we Need a Database?3 - What is Oracle Storage Structure?4 - How to create Table?5 - What are Database objects?6 - And Many other points.For more Info : http://intellipaat.com/database-development/oracle-dba/

Citation preview

Page 1: Online Training on Oracle Database and Storage Structure

Intellipaat Software Solutions Pvt. Ltd.

1

WHAT IS ORACLE DATABASEOracle Storage Structure

Page 2: Online Training on Oracle Database and Storage Structure

2

Intellipaat Software Solutions Pvt. Ltd.

DATABASE Why we Need a Database

To Collect, Process and Distribute the Data. I can do that using Excel, Notepad a simple C,VB

code etc. Why Database ? Consider the Challenges of the Above approach. DBA’s Perspective (Developers have many more reasons)

Manage 100’s of files. Manage 100’s of users. Just need to see One Line/record from one of the file. Changes to the Data and propagation of the Changes. Files getting Lost, Corruption due to Software,

Hardware Issues. Backup & Restore.

Page 3: Online Training on Oracle Database and Storage Structure

3

Intellipaat Software Solutions Pvt. Ltd.HOW ORACLE DB DOES IT

Data File 1

Data File 2

Data file 3

Roll Back Segment

Redo Log 1_1,1_2Redo Log 2_1,2_2Redo Log 3_1,3_2

Archive Logs 1,2,3,4,5……….

Control File 1 2 3

Shared Pool

DataBase Buffer Cache

Redo Buffer

Oracle Process Oracle Process Oracle Process

Locks

Init_{SID}.ora spfile

Users

Background Processes

Page 4: Online Training on Oracle Database and Storage Structure

4

Intellipaat Software Solutions Pvt. Ltd.A TYPICAL UNIX KERNEL

Hardware

Applications

System Libraries (libc)

System Call Interface

Architecture-Dependent Code

I/O Related Process RelatedScheduler

Memory ManagementIPC

File SystemsNetworking

Device DriversMod

ules

Page 5: Online Training on Oracle Database and Storage Structure

Intellipaat Software Solutions Pvt. Ltd.

5

DATABASEPhysical

Parameter fileControl filesData filesTemp filesRedo Log filesArchive Log filesAlert & Trace FilesBackup files

Logical

Tablespace SchemaSegmentsExtentsOracle Data blocks

Page 6: Online Training on Oracle Database and Storage Structure

6

Intellipaat Software Solutions Pvt. Ltd.ORACLE STORAGE STRUCTURE

Schema_1TableSpace_1Ts1_df_1 Ts1_df_2 Ts1_df_3

TableSpace_2Ts2_df_4

Ts2_df_5

Segment_1

Segment_2

Segment_3

Table_1

Extent_1Block Block Block

Block Block Block Block

Block

Extent_2Block

Block

Block

Extent_3Bloc

kBloc

kBlockBlock

Free Block

Free Block

Free Block

Free Block

Free Block

Free Block

Free Block

Free Block

Table_2

Table_3

Table_4

Table_5

Page 7: Online Training on Oracle Database and Storage Structure

7

Intellipaat Software Solutions Pvt. Ltd.A SIMPLE CREATE TABLE STATEMENTCREATE TABLESPACE TableSpace_1DATAFILE '\oraserv\ORADATA\Ts1_df_1.dbf'SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE 100M;

Alter tablespace TableSpace_1 add datafile '\oraserv\ORADATA\Ts1_df_2.dbf‘ Size 10GB;

Alter Database Datafile '\oraserv\ORADATA\Ts1_df_2.dbf‘ resize 20GB;

CREATE TABLE Schema_1.Table_1( Col_1 VARCHAR2(100), Col_2 NUMBER, col_3 DATE )TABLESPACE TableSpace_1STORAGE ( INITIAL 16K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 )

Page 8: Online Training on Oracle Database and Storage Structure

8

Intellipaat Software Solutions Pvt. Ltd.

SCHEMAS AND SCHEMA OBJECTS Collection of database objects

TablesViewsSequencesSynonyms IndexesProceduresFunctionsPackagesTriggers

Page 9: Online Training on Oracle Database and Storage Structure

9

Intellipaat Software Solutions Pvt. Ltd.

DATA BLOCKS The smallest unit of Input/Output used by

Oracle database. The size of data block for any database is

fixed at the time of creation of the database; Some values of the data block size are 2KB,

8KB, 16KB, and 32KB. Oracle recommends a size of 8KB

Page 10: Online Training on Oracle Database and Storage Structure

10

Intellipaat Software Solutions Pvt. Ltd.

EXTENTS The next level of data storage. One extent consists of a specific number of

data blocks One or more extents in turn make up a

segment. When the existing space in a segment is

completely used, Oracle allocates a new extent for the segment.

Page 11: Online Training on Oracle Database and Storage Structure

11

Intellipaat Software Solutions Pvt. Ltd.

SEGMENT A segment consists of a set of extents Each table’s data is stored in its own single

segment. Each index’s data is stored in a single

segment. More extents are automatically allocated

by Oracle to a segment if its existing extents become full.

The different types of segments are the data segments, index segments,rollback segments, and temporary segments.

Page 12: Online Training on Oracle Database and Storage Structure

12

Intellipaat Software Solutions Pvt. Ltd.

CONTROL FILES Contain a list of all other files in the database Key information such as

Name of the database Date created Current state Backups performed Time period covered by redo files

Page 13: Online Training on Oracle Database and Storage Structure

13

Intellipaat Software Solutions Pvt. Ltd.

Store a recording of changes made to the database as a result of transactions and internal Oracle Activities

When Oracle fills one redo log, it automatically fills a second.

Used for database recovery

REDO LOG FILES