55
Goals for This Week • Brief SQL refresh • New SQL in Oracle 9i • Overview of Oracle Architecture • Basic Oracle Administration • Performance Tuning • Schema Design • Back-end Tools

Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Embed Size (px)

Citation preview

Page 1: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Goals for This Week

• Brief SQL refresh

• New SQL in Oracle 9i

• Overview of Oracle Architecture

• Basic Oracle Administration

• Performance Tuning

• Schema Design

• Back-end Tools

Page 2: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Switch to SQL Intro

Page 3: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Role of Database Server

SQL orProcedureCall

Results

Client

SQL orProcedure Call

HTMLHTTP:GET

Results

Page 4: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Role of Database Server (4 tier)

Client

SQL orProcedure Call

Results

Web Server

App.Server

HTML

HTTP: GET

Proc./TransCall

Results

Page 5: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Logical Objects

Page 6: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Logical Objects

Database

Schemas

Objects

own

consists of

TablesIndexesSequencesViewsProceduresTriggersEtc

Page 7: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Schema Types

Database

Schemas

Objects(tables, indexes, etc)

own

consists of

•Application Schemas

Payroll

Student records

Financial Reporting

Nascar

Hollywood

•User Schemas

Joe

Fred

Dave

Page 8: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Schema Attributes

•Application Schemas

Usually referred to as a “schema object”

Contains a set of closely related tables and associated objects

Typical Object Reference: Hollywood.Movies

•User Schemas

Often referred to as a “User” or “Account” object.

May or may not contain personal tables (Joe.Contacts).

May or may not have the right to even create objects.

Are generally granted privileges to objects in application schemas.

Page 9: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

LABCreate a user schemaAnd an application schemaUsing dba studio

Note security weakness:

System (pw: manager)Sys (pw: change_on_install)Scott (pw: tiger)Sysman (pw: oem_start)

Page 10: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Caution Creating a user schema from SQL:

CREATE USER CALVIN IDENTIFIED by HOBBES

Page 11: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

LAB Creating a user schema from SQL:

CREATE USER CALVIN IDENTIFIED by HOBBES

DEFAULT TABLESPACE USERS

TEMPORARY TABLESPACE TEMP

QUOTA 100M on users

QUOTA 100M on temp

QUOTA 100M on rbs; -- quota on RBS not necessary on 9i

GRANT CONNECT TO CALVIN; -- let him log inGRANT RESOURCE TO CALVIN; -- let him create tables and other objects

Page 12: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Oracle vs. SQL Server

Database

Schemas

Objects(tables, indexes, etc)

own

consists of

SQL Server Software Instance

Databases

Objects(tables, indexes, etc)

contain

Usersown

defines

Page 13: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Oracle vs. SQL Server

Database

Schemas (users)

Objects(tables, indexes, etc)

own

consists of

SQL Server Software Instance

Databases

Objects(tables, indexes, etc)

contain

Usersown

defines

GrantedPrivileges to

GrantedPrivileges to

Page 14: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Controlling Application Access•Each User is given an Oracle Account and control is maintained by granting privileges to tables, procedures and other objects. (e.g. DESIGN)

•All users connect ominously to a web site. The Web or Application server connects to Oracle in the context of a particular user.

•Although the Web or Application server connects to Oracle in the context of a particular user, individuals connecting to the web site must still authenticate for the interface to determine what they should be allowed to do:

-Oracle Authentication-Local “user” table in application-Network authentication

Page 15: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Roles and Profiles

• Role– Functions similar to NT Groups

– Specific Object and System Privileges are granted to the Role

– That Collection of Privs can be quickly granted to a USER by granting them the Role (Example: GRANT DBA to HOMER)

• ProfileProvides default values for USER attributes such as– Number of Concurrent Sessions

– Password complexity

Page 16: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

LAB Creating a role

Create ROLE trainee;

Grant connect to trainee; -- right to log onGrant resource to trainee; -- right to create objectsGrant select_catalog_role to trainee; -- dictionary privs

Page 17: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

LAB Creating user schemas from PL/SQL:

DECLARE v_sqlstatement varchar2(200); v_newclass newclass%rowtype; CURSOR newclass_cursor IS SELECT * from newclass;BEGIN DBMS_OUTPUT.PUT_LINE ('****************** begin account creation'); OPEN newclass_cursor; FETCH newclass_cursor into v_newclass; WHILE newclass_cursor%found LOOP DBMS_OUTPUT.PUT_LINE (v_newclass.userid); v_sqlstatement := 'create user ' || UPPER(v_newclass.userid) || ' identified by oracle '; v_sqlstatement := v_sqlstatement || 'DEFAULT TABLESPACE USERS '; v_sqlstatement := v_sqlstatement || 'TEMPORARY TABLESPACE TEMP '; v_sqlstatement := v_sqlstatement || 'QUOTA 100M on users '; v_sqlstatement := v_sqlstatement || 'QUOTA 100M on temp '; v_sqlstatement := v_sqlstatement || 'QUOTA 100M on rbs '; -- rbs quota not needed in 9i execute immediate v_sqlstatement; -- this is dynamic SQL needed because of early binding v_sqlstatement := 'GRANT trainee TO ' || v_newclass.userid; execute immediate v_sqlstatement; FETCH newclass_cursor into v_newclass; END LOOP; DBMS_OUTPUT.PUT_LINE ('****************** end account creation'); CLOSE newclass_cursor;END;/

Page 18: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Oracle’s Architecture

Page 19: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Instance vs. Database

Database(disk structures)

Instance(memory structures)

Page 20: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Multiple Instances for 1 Database

Database 1(disk structures)

Instance A(memory structures)

Instance B(memory structures)

Page 21: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Multiple Databases for 1 Instance

Database 1(disk structures)

Instance A(memory structures)

Database 2(disk structures)

Page 22: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Instance to Instance Communication

Database 1(disk structures)

Instance A(memory structures)

Database 2(disk structures)

Instance B(memory structures)

Via clientOr replication

process

Page 23: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

On-lineRedo

Log Files

Key structures and Processes

On-lineRedo

Log FilesOn-line

RedoLog Files

DataFiles

(Inc. RBSegments)

Redo Log BufferDatabase Buffer Cache

DBWR

LibraryCache

Data DictionaryCache

Shared Pool

ORACLE INSTANCE

LGWRSMON PMON CKPTBackgroundProcesses

SERVER

ARCH

ControlFiles

ControlFiles

CLIENT

Network

SERVERSERVER

CLIENTCLIENT

LSTNR

Page 24: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

Database Buffer Cache

DataFiles

(Inc. RBSegments)

Database Buffer Cache

DBWR

Number of Buffers determined byInitialization File Parameter: DB_BLOCK_BUFFERS (8i) DB_CACHE_SIZE (9i)

Block Size is a multiple of OS Block.

Block Size if fixed in Oracle 8i.Block Size is not fixed in 9i except for the system, rollback, and temp tablespaces.

LRU algorithm used to determine buffered data.

Free block

Used block

Dirty block

Page 25: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Buffer Hit Ratio

Consistent Gets + DB Block Gets - Physical Reads

Consistent Gets + DB Block Gets* 100

Generally, a hit ratio below 80% indicates too manyphysical reads and suggests that DB_Block_Buffersshould be increased.

Page 26: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Hit Ratio Since Instance Startup

Select sum(decode(NAME, 'consistent gets',VALUE, 0)) "Consistent Gets",

sum(decode(NAME, 'db block gets',VALUE, 0)) "DB Block Gets", sum(decode(NAME, 'physical reads',VALUE, 0)) "Physical Reads", round((sum(decode(name, 'consistent gets',value, 0)) +

sum(decode(name, 'db block gets',value, 0)) - sum(decode(name, 'physical reads',value, 0))) /

(sum(decode(name, 'consistent gets',value, 0)) + sum(decode(name, 'db block gets',value, 0))) * 100,2) "Hit Ratio"

from v$sysstat

Next: change number of buffers, bounce service, large query, check hits

LAB

Page 27: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Shared Pool

LibraryCache

Data DictionaryCache

Shared PoolLibrary Cache

•Holds parsed SQL statements•Interrogate via v$sqlarea & v$librarycache•CURSOR_SHARING = FORCE

Data Dictionary Cache•Holds table and column definitions and privileges

Page 28: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Shared Pool Hit Ratios

Library Cache Hit RatioSelect (sum(pins) / (sum(pins) + sum(reloads))) * 100 “Lib. Hit Ratio”

from v$librarycache

Dictionary Hit Ratio Select (sum(gets) / (sum(getmisses) + sum(gets))) * 100 “Dict.

Hit Ratio” from v$rowcache

LAB

Also look at v$sqlarea

Page 29: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Oracle Processes•Background Processes

run on server-as separate processes on UNIX (ps –ef | grep <ORA_SID>)-As separate threads in single service on NT

•Listener Processone or more per serverlistens for connection requestshands off to server process (on diff. Port)

•Server ProcessesRun on serverTypically one process to support each connected user (unless MTS)

•Client (“User”) Processruns on client machinecommunicates with a server process on server

Page 30: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Oracle Background Processes•DBWR

Writes dirty blocks from the buffer pool back to disk.•SMON

Checks for consistency, initiates recovery•PMON

Cleans up resources if process fails•CKPT

Updates database status after commits and other key events.

•LGWRWrites before and after images of changed rows into the on-line redo log files

•ARCHNumbers and archives on-line redo log files

Page 31: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

LABStart and stop the instanceAnd listener services usingVarious methods

Page 32: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

LAB

Who is logged in?

Look at v$session

Alter system kill session ‘sid, serial’;

Page 33: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

On-lineRedo

Log File C

Oracle Commit Processing

DB-7F3 FRED 30000

On-lineRedo

Log File BOn-line

RedoLog File A

DataFiles

(Inc. RBSegments)

Redo Log BufferDatabase Buffer Cache

DB-7F4 JANE 36000

Update EmpSet Sal = 40000Where name=‘FRED’

Data requested might or Might not be in the buffer.

DBWR

Page 34: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

On-lineRedo

Log File C

Oracle Commit Processing

DB-7F3 FRED 30000

BEGIN SCN 412

On-lineRedo

Log File BOn-line

RedoLog File A

DataFiles

(Inc. RBSegments)

Redo Log BufferDatabase Buffer Cache

DB-7F4 JANE 36000

May or may notHave written at this point.

Update EmpSet Sal = 40000Where name=‘FRED’

DBWRLGWR

Page 35: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

On-lineRedo

Log File C

Oracle Commit Processing

DB-7F3 FRED 30000

BEGIN SCN 412

On-lineRedo

Log File BOn-line

RedoLog File A

DataFiles

(Inc. RBSegments)

Redo Log BufferDatabase Buffer Cache

DB-7F4 JANE 36000

May or may notHave written at this point.

Update EmpSet Sal = 40000Where name=‘FRED’

RB-65B

DBWRLGWR

Page 36: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

On-lineRedo

Log File C

Oracle Commit Processing

DB-7F3 FRED 30000

OLD:7F3 FRED 30000

OLD:RB-65B

BEGIN SCN 412

On-lineRedo

Log File BOn-line

RedoLog File A

DataFiles

(Inc. RBSegments)

Redo Log BufferDatabase Buffer Cache

DB-7F4 JANE 36000

May or may notHave written at this point.

Update EmpSet Sal = 40000Where name=‘FRED’

RB-65B NULL

DBWRLGWR

Page 37: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

On-lineRedo

Log File C

Oracle Commit Processing

DB-7F3 FRED 30000

RB-65B FRED 30000

BEGIN SCN 412

On-lineRedo

Log File BOn-line

RedoLog File A

DataFiles

(Inc. RBSegments)

Redo Log BufferDatabase Buffer Cache

DB-7F4 JANE 36000

May or may notHave written at this point.(rollback segs. First)

May or may notHave written at this point.

Update EmpSet Sal = 40000Where name=‘FRED’

OLD:DB-7F3 FRED 30000

OLD:RB-65B

NEW:RB-65B FRED 30000

DBWRLGWR

Page 38: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

On-lineRedo

Log File C

Oracle Commit Processing

DB-7F3 FRED 40000

RB-65B FRED 30000

NEW:7F3 FRED 40000

BEGIN SCN 412

On-lineRedo

Log File BOn-line

RedoLog File A

DataFiles

(Inc. RBSegments)

Redo Log BufferDatabase Buffer Cache

DB-7F4 JANE 36000

May or may notHave written at this point.(rollback segs. First)

May or may notHave written at this point.

Update EmpSet Sal = 40000Where name=‘FRED’

OLD:DB-7F3 FRED 30000

OLD:RB-65B

NEW:RB-65B FRED 30000

DBWRLGWR

Page 39: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

DataFiles

(Inc. RBSegments)

On-lineRedo

Log File C

Oracle Commit Processing

DB-7F3 FRED 40000

RB-65B FRED 30000

NEW:7F3 FRED 40000

BEGIN SCN 412

On-lineRedo

Log File BOn-line

RedoLog File A

DataFiles

(Inc. RBSegments)

Redo Log BufferDatabase Buffer Cache

DB-7F4 JANE 36000

May or may notHave written at this point.(rollback segs. First)

Update EmpSet Sal = 40000Where name=‘FRED’

OLD:DB-7F3 FRED 30000

OLD:RB-65B

NEW:RB-65B FRED 30000

COMMIT SCN 412

Definitive writethrough commitrecordDBWR

LGWR

Page 40: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

LABSimulate ServerFailure after updateBut before commit

Page 41: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

GOBACK

Go Back 2 slidesAnd discuss “consistent gets”

Page 42: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Logical to Physical Mapping(controlling where objects are stored)

Database

Tablespaces

DataFiles

Stores objects in

Made Persistent via

OracleTablespace issimilar toSQL ServerFile Group.

Page 43: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Why multiple Tablespaces?• Reduce Disk Contention by spreading disk I/O

over multiple spindles.– We control which TS objects are stored on

– We control physical location of TS datafiles

– Even if all disks are in use currently, the best practice is to keep major apps on different tablespaces to more easily allow for future movement.

• Reduce performance degradation during on-line physical backups.

• Allows different applications to have different physical parameters – block size

– Fragmentation level

– etc

Page 44: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Typical Tablespaces:

• SYSTEM 32464 E:\ORACLE\ORADATA\INSY\SYSTEM01.DBF• RBS 265600 E:\ORACLE\ORADATA\INSY\RBS01.DBF• USERS 89440 E:\ORACLE\ORADATA\INSY\USERS01.DBF• TEMP 10560 E:\ORACLE\ORADATA\INSY\TEMP01.DBF• TOOLS 1280 E:\ORACLE\ORADATA\INSY\TOOLS01.DBF• INDX 2560 E:\ORACLE\ORADATA\INSY\INDX01.DBF• DRSYS 2560 E:\ORACLE\ORADATA\INSY\DR01.DBF• OEM_REPOSITORY 3841 E:\ORACLE\ORADATA\INSY\OEM_REPOSITORY.ORA

Page 45: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Typical OFA segregation1. Oracle software2. System tablespace3. System indexes4. RBS tablespace5. Data tablespace6. Data Indexes TS7. Temp tablespace8. Tools tablespace inc. index9. Online redo log 110. Online redo log 211. Online redo log 3

12.Control file 113.Control file 214.Control file 315.Application software16.User Tablespace inc.

indexes17.Archive log dest

Page 46: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

RAID: Redundant Array of Inexpensive Disks

1 2 34 5 6

Volume Set:

7 8 910 11

Stripe Set (Raid Level 0)

12 1314 15

C:

1 2 3 4 5 6 7 8 910 11 12 13 14 1516 17 18 19 20 21

Page 47: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

RAID: Redundant Array of Inexpensive Disks

1 3 24 3 5

Mirror set (Raid level 1):

1 3 24 3 5

=

DriveController

Page 48: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

RAID: Redundant Array of Inexpensive Disks

Stripe Set with Parity (Raid Level 5)

=+

0 1 00 1 00 0 01 0 1

1 1 01 0 00 0 11 1 0

1 1 11 0 01 0 00 0 1

0 1 10 1 01 0 10 1 0+

==

parity

data

Page 49: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

RAID: Redundant Array of Inexpensive Disks

Stripe Set with Parity (Raid Level 5)

=+

0 1 00 1 00 0 01 0 1

1 1 11 0 01 0 00 0 1

0 1 10 1 01 0 10 1 0+

==

parity

data

Page 50: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

RAID: Redundant Array of Inexpensive Disks

Mirrored Stripe Set (Raid Level 0 + 1)

1 2 3 4 5 6 7 8 910 11 12 13 14 1516 17 18 19 20 21

Data container

1 2 3 4 5 6 7 8 910 11 12 13 14 1516 17 18 19 20 21

Mirror container

Page 51: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

RAID: Redundant Array of Inexpensive DisksStripe Set of Mirrors (Raid Level 1 + 0)

1 2 3 4 5 6 7 8 910 11 12 13 14 1516 17 18 19 20 21

1 2 3 4 5 6 7 8 910 11 12 13 14 1516 17 18 19 20 21

Mirror Set Mirror Set Mirror Set

Stripe Set

Page 52: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Large Scale RAID dependent Oracle InstallationCabinet 1 (9 Containers, 42 drives)

Log 1 Ndx 3

Data 1, Cntrl 1

Log 2 Ndx 4

Data 2, Cntrl 2

Log 3 Intf 1

Sys, Rbs, Temp

Cabinet 2 (9 containers, 42 drives)

Log 4 Ndx 1

Data 3, Cntrl 3

Log 5 Ndx 2

Data 4, Cntrl 4

Log 6 Intf 2

Archived Logs

Source: Oracle Performance Tuning 101, Oracle Press

Controller 1 (c1) Details:

c3c2c1

c6c5c4

RAID 1 (Log 1) RAID 0 + 1 (Ndx 3)

RAID 0 + 1 (Data 1, Cntrl 1)

Page 53: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Small Scale RAID dependent Oracle Installation optimized for read/write operations.

RAID 1 + 0

RedoLog FilesDatafiles, INIT, and Control Files

Raid 1 Raid 1

ArchLog Files

Page 54: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

LABDirectly Examine: dba_tables

dba_tablespacesV$datafile

Or indirectly:@\\neelix\oracle\scripts\admin\datafiles@\\neelix\oracle\scripts\admin\usertabs

Look at Same using DBA studio

Create a new tablespaceAnd related datafile(s).

Page 55: Goals for This Week Brief SQL refresh New SQL in Oracle 9i Overview of Oracle Architecture Basic Oracle Administration Performance Tuning Schema Design

Creating Indexes and Tables in specific tablespaces.

• Each user is assigned a default tablespace.

•Don’t create tables when logged in as system or sys unless instructed to do so when installing Oracle tools.

•Override defaults when necessary through extended DDL syntax.

CREATE TABLE GLACCOUNTS ( AccountNum char(6) Name varchar2(30), Balance number(12,2)) TABLESPACE FINANCIALS;