Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI

Slides:



Advertisements
Similar presentations
CHAPTER 4 Tablespaces and Datafiles. Introduction After installing the binaries, creating a database, and configuring your environment, the next logical.
Advertisements

The Architecture of Oracle
School of Computing and Management Sciences © Sheffield Hallam University The slowest task in any record retrieval is reading from disk (It can be 500.
Primer on Structure& Storage Analysis Primer on Structure & Storage Analysis This presentation is supposed to give a simple and brief overview for storage.
Basic Storage Concepts and Settings
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
IS 4420 Database Fundamentals Chapter 6: Physical Database Design and Performance Leon Chen.
Harvard University Oracle Database Administration Session 2 System Level.
Harvard University Oracle Database Administration Session 5 Data Storage.
Copyright س Oracle Corporation, All rights reserved. 13 Other Database Objects.
INTEGRITY Enforcing integrity in Oracle. Oracle Tables mrobbert owner granted access.
INTRODUCTION TO ORACLE
Oracle Database Administration Database files Logical database structures.
9/11/2015ISYS366 - Week051 ISYS366 – Week 5-6 Database Tuning - User and Rollback Data Spaces, Recovery, Backup.
Database Administration TableSpace & Data File Management
Lecture 8 Index Organized Tables Clusters Index compression
Oracle Data Block Oracle Concepts Manual. Oracle Rows Oracle Concepts Manual.
Schema Objects the different types of objects contained in a user’s schema are: tables views sequences synonyms indexes clusters hash clusters Other schema.
Chapter 6 Additional Database Objects
1 © Prentice Hall, 2002 Physical Database Design Dr. Bijoy Bordoloi.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 9 Index Management.
7202ICT Database Administration Lecture 7 Managing Database Storage Part 2 Orale Concept Manuel Chapter 3 & 4.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
1 CG171 - Database Implementation and Development (Physical Database Design) – Lecture 7 Storage Allocation & Data Access Methods By Dr. Akhtar Ali.
Chapter 6 1 © Prentice Hall, 2002 The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited) Project Identification and Selection Project Initiation.
12 Copyright © Oracle Corporation, All rights reserved. Other Database Objects.
Other database objects (Sequence). What Is a Sequence? A sequence: Automatically generates sequential numbers Is a sharable object Is typically used to.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
9 Storage Structure and Relationships. 9-2 Objectives Listing the different segment types and their uses Controlling the use of extents by segments Stating.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 7 Basic Table Management.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Oracle 10g Database Administrator: Implementation and Administration Chapter 7 Basic Table Management.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
1 SQL - II Data Constraints –Applying data constraints Types of data constraints –I/O constraints The PRIMARY KEY constraints The FOREIGN KEY constraints.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Week 3 Lecture 2 Basic Storage Concepts and Settings.
Database Programming Sections 11 & 12 –Sequences, Indexes, and Synonymns.
Week 4 Lecture 2 Advanced Table Management. Learning Objectives  Create tables with large object (LOB) columns and tables that are index-organized 
1/14/2005Yan Huang - CSCI5330 Database Implementation – Storage and File Structure Storage and File Structure II Some of the slides are from slides of.
Indexes and Views Unit 7.
Harvard University Oracle Database Administration Session 6 Object Storage.
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Managing Tablespaces and Data Files
Chapter 12 Additional Database Objects. Chapter Objectives  Define the purpose of a sequence and state how it can be used by an organization  Explain.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
Chap 5. Disk IO Distribution Chap 6. Index Architecture Written by Yong-soon Kwon Summerized By Sungchan IDS Lab
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Chapter 12Introduction to Oracle9i: SQL1 Chapter 12 Additional Database Objects.
CSCI N311: Oracle Database Programming 5-1 Chapter 15: Changing Data: insert, update, delete Insert Rollback Commit Update Delete Insert Statement –Allows.
Select Operation Strategies And Indexing (Chapter 8)
1 Chapters 19 and 20  Ch. 19: By What Authority? Users Roles Grant and revoke Synonyms  Ch. 20: Changing the Oracle Surroundings Indexes Clusters Sequences.
Creating Indexes Database Systems Objectives Distinguish between the indexes that are created automatically and those that are created manually.
Index An index is a performance-tuning method of allowing faster retrieval of records. An index creates an entry for each value that appears in the indexed.
Database structure and space Management
Database Tuning - User and Rollback Data Spaces, Recovery, Backup
CHAPTER 5: PHYSICAL DATABASE DESIGN AND PERFORMANCE
Database structure and space Management
Chapter 5 Sequences.
Chapter 4 Indexes.
CH 4 Indexes.
Introduction To Oracle 10g
CH 4 Indexes.
The Physical Design Stage of SDLC (figures 2.4, 2.5 revisited)
Object-Relational Features
Managing Indexes.
Storage Structure and Relationships
Managing Tables.
Managing Tablespaces and Data Files
ISYS366, Oracle Disk Internals
Presentation transcript:

Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI Tablespaces

Dale Roberts 2 Tablespaces and terminology  Tablespace Tablespaces are a logical organization of space. Tablespaces owns the database’s datafiles. Database objects are stored within tablespaces.  Database: a logical collection of shared data stored in tablespaces.  File: A physical datafile belonging to a single tablespace.  Segment: A set of one or more extents that contains all the data for a specific structure within a tablespace. (TABLE, INDEX, CLUSTER, ROLLBACK, TEMP, etc.)  Extent: A set of contiguous data blocks with in a database that make up a segment.  Block: One or more physical file blocks allocated from an existing datafile.

Dale Roberts Oracle Tablespace Architecture datafile 1 datafile 2 datafile 3 datafile 4datafile 5 Database Blocks Extent 28K Extent 84K Segment 112K (Table, Index, etc.) TABLESPACE

Dale Roberts 4  Entity-Relationship Diagram showing: Database Tablespace Extents Segments Files Blocks Tablespace Data Model

Dale Roberts 5 Tablespace clause syntax Tablespace Clause: indicates Tablespace and other storage options for tables, indexes, constraints. Storage Clause: indicates how extents are managed, overrides the default storage parameters of tablespace. Syntax: CREATE TABLE tablename ( column_atype NOT NULL, column_btype,...) STORAGE ( INITIAL 100K NEXT 20K MINEXTENTS 1 MAXEXTENTS 99 PCTINCREASE 50 ) TABLESPACE USER_DATA PCTFREE 5 PCTUSED 30; CREATE TABLE tablename ( column_atype NOT NULL, column_btype,...) STORAGE ( INITIAL 100K NEXT 20K MINEXTENTS 1 MAXEXTENTS 99 PCTINCREASE 50 ) TABLESPACE USER_DATA PCTFREE 5 PCTUSED 30; The number of create table options is voluminous: NOLOGGING, NOPARALLEL, etc.

Dale Roberts 6 Tablespace and Segment Example SQL> select file_name, tablespace_name, bytes, blocks from dba_data_files FILE_NAME TABLESPACE_NAME BYTES BLOCKS /opt/oracle/u1/oradata/OS80/users01.dbf USERS /opt/oracle/u1/oradata/OS80/tools01.dbf TOOLS /opt/oracle/u1/oradata/OS80/temp01.dbf TEMP /opt/oracle/u1/oradata/OS80/rbs01.dbf RBS /opt/oracle/u1/oradata/OS80/system01.dbf SYSTEM /opt/oracle/u1/oradata/OS80/n311_t1.dbf N311TBS /opt/oracle/u1/oradata/OS80/csgrad_t1.dbf USERDATA_GRAD SQL> l 1 select tablespace_name, segment_name, segment_type, bytes, blocks, extents 2 from dba_segments 3* where owner = 'SCOTT' TABLESPACE_NAME SEGMENT_NA SEGMENT_TYPE BYTES BLOCKS EXTENTS SYSTEM BONUS TABLE SYSTEM SALGRADE TABLE SYSTEM WORKER TABLE SYSTEM TEMP_USERS TABLE SYSTEM LEDGER TABLE SYSTEM DEPT TABLE SYSTEM EMP TABLE SYSTEM PK_DEPT INDEX SYSTEM PK_EMP INDEX rows selected.

Dale Roberts 7 CREATE INDEX  Indexes: Contains values of data from a table and their location Pro: Used to speed data retrieval, also can enforce uniqueness. Con: Slows updates and deletes. When to use: if columns are typically used in where clause searches Primary keys and unique constraints create a unique index automatically. NULL values are not indexed.  Syntax: CREATE [BITMAP|UNIQUE] INDEX index ON table(COL1 [, COL2…] ) [REVERSE];  Other Oracle Index Features: Reverse indexes builds an index on the indexed column in reverse byte order thus increasing the dispersal of values. Bitmap indexes, new in 8 or 8i ?, associates a bitmap to values and only stores the bitmap in the index. Use with low cardinality values (e.g. T/F) Function based indexes, new in 8i. Normal indexes are not used if a function is used on the where clause column that you’re searching on.

Dale Roberts 8 CREATE CLUSTER  Clusters: Stores different tables physically together. The cluster key is the column that the data would normally be joined together with. Tables that share the same cluster are actually stored together and I/O is decreased when the two tables are joined.  Syntax Example: Create cluster BOOKandAUTHOR( col1 varchar2(1000)); Create table BOOKSHELF (title varchar2(100) primary key, … ) cluster BOOKandAUTHOR(title);

Dale Roberts 9 CREATE SEQUENCE  Sequences: Creates a unique sequentially valued number. Used during insert and update commands usually. Typically used to create a primary key. NextVal and CurrVal get the next/current value of the sequence.  Syntax: Create sequence myseq increment by 1 start with 1; Insert into CUSTOMER (id, name) values (myseq.nextval, ‘a’); Update OTHERTABLE set id = myseq.currval;

Dale Roberts 10 Acknowledgements Loney, Oracle Database 10g The Complete Reference