Docsity

Oracle DB Management: Extents, Rollback, Utilities, Querying, Indexing, Slides of Business Administration

Partial preview of the text

Download Oracle DB Management: Extents, Rollback, Utilities, Querying, Indexing and more Slides Business Administration in PDF only on Docsity!

example

  • Table with 10 extents 64 K each
  • I/O device buffer = 64K => 10 reads
  • If extent = 640K => ???? Reads
  • If 8 extents 80K each => ??? Reads
    • Reads cannot span extents => 16 reads or an increase of 60% in I/O operations
  • Cl: either use extents much larger than

buffer or use multiple of buffer size

And for roll back segments

  • Should be kept small enough
  • Current wisdom is to ensure TS for rollback is

normally 50% free

  • Not always possible to use only one RB size
    • For different types of processes – e.g. TPS
    • Use two different TB to isolate activites
    • Easier trouble shooting
  • Discarded rollback segments go into the log file

Control files: using SQLloader

  • Data tranfers in and out of DB can be automated using the loader - Create a data file with the data(!) - Create a control file to guide the operation
  • Load creates two files
    • Log file
    • “bad transactions” file
  • Also a discard file if control file has selection criteria in it

Querying the Oracle DB

  • 2 main methods:
    • Full scan – TABLE ACCESS FULL
    • Direct access – TABLE ACCESS BY ROWID
  • When spelling out queries – drop HINT

using syntax: /*+ HINT */

  • This invokes the OPTIMISER
    • RBO
    • CBO

Effect of Primary key constraints

  • No index by default
  • When primary key added = > index created
  • Name given will be same as name of primary key (e.g. TABLE_PK)
  • PK indexes are of UNIQUE kind
  • Other non-unique indexes can be created on other fields
  • CREATE INDEX name ON table(field) TABLESPACE indexes

Using the index

  • Query with “where” clause on PK
  • First the PK index is accessed in INDEX

UNIQUE SCAN mode

  • Matching Rowid is retrieved and returned
  • Second: access table with ROWID as argument

in TABLE ACCESS BY ROWID mode

  • When value sought is in index, no need to read

table at all

Multiple index scans

  • When more than one value in WHERE

clause

  • Two indexes can be used to produce two

scans of range values

  • Then concatenation of scans
  • Result of the query
  • Broadly similar to cross-reference of

bitmap indexes