Managing Tables.

Slides:



Advertisements
Similar presentations
11 Copyright © Oracle Corporation, All rights reserved. Managing Tables.
Advertisements

9 Copyright © 2004, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
9 Creating and Managing Tables. Objectives After completing this lesson, you should be able to do the following: Describe the main database objects Create.
Data Definition Language (DDL)
Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
Oracle 10g Database Administrator: Implementation and Administration Chapter 8 Advanced Table Management.
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.
12 Copyright © Oracle Corporation, All rights reserved. Managing Indexes.
Physical Database Design Data Migration/Conversion.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
Harvard University Oracle Database Administration Session 5 Data Storage.
Database Management System LICT 3011 Eyad H. Elshami.
Oracle Database Administration Database files Logical database structures.
CHAPTER 11 Large Objects. Need for Large Objects Data type to store objects that contain large amount of text, log, image, video, or audio data. Most.
9/11/2015ISYS366 - Week051 ISYS366 – Week 5-6 Database Tuning - User and Rollback Data Spaces, Recovery, Backup.
Oracle Data Block Oracle Concepts Manual. Oracle Rows Oracle Concepts Manual.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 9 Index Management.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
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.
10 Copyright © 2009, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
1 Copyright © 2006, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
Copyright © 2004, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
Sizing Basics  Why Size?  When to size  Sizing issues:  Bits and Bytes  Blocks (aka pages) of Data  Different Data types  Row Size  Table Sizing.
Lecture 2: Using DDL Statements to Create and Manage Tables & Indexes
10-1 Copyright  Oracle Corporation, All rights reserved. Database Objects ObjectDescription TableBasic unit of storage; composed of rows and columns.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Chapter 3 Selected Single-Row Functions and Advanced DML & DDL.
Oracle 10g Database Administrator: Implementation and Administration Chapter 7 Basic Table Management.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
9 Copyright © 2004, Oracle. All rights reserved. Using DDL Statements to Create and Manage Schema Objects.
6 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
8 Copyright © 2007, Oracle. All rights reserved. Managing Schema Objects.
14 Copyright © 2006, Oracle. All rights reserved. Tuning Block Space Usage.
Week 4 Lecture 2 Advanced Table Management. Learning Objectives  Create tables with large object (LOB) columns and tables that are index-organized 
8 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.
Harvard University Oracle Database Administration Session 6 Object Storage.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
13 Copyright © Oracle Corporation, All rights reserved. Maintaining Data Integrity.
Managing Schema Objects
Chapter 5 Index and Clustering
Indexes- What?  Optional structures associated with tables  Provides a quick access path to table data  You can create indexes on one or more columns.
Creating and Managing Tables 14. ObjectivesObjectives After completing this lesson, you should be able to do the following: After completing this lesson,
Academic Year 2015 Autumn. MODULE CC2006NI: Data Modelling and Database Systems Academic Year 2015 Autumn.
Declaring PL/SQL Variables
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Unit 6 Seminar. Indexed Organized Tables Definition: Index Organized Tables are tables that, unlike heap tables, are organized like B*Tree indexes.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Last Updated : 27 th April 2004 Center of Excellence Data Warehousing Group Teradata RDBMS Concepts.
7 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.
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.
Introduction To Oracle
SQL Creating and Managing Tables
Database Tuning - User and Rollback Data Spaces, Recovery, Backup
DATABASE SQL= Structure Query Language مبادئ قواعد بيانات
ORACLE SQL Developer & SQLPLUS Statements
SQL Creating and Managing Tables
Database structure and space Management
Working with Composite Datatypes
Database.
SQL Creating and Managing Tables
Chapter 2 Handling Data in PL/SQL Blocks Oracle9i Developer:
Structured Query Language
Using DDL Statements to Create and Manage Tables
Object-Relational Features
Managing Indexes.
Storage Structure and Relationships
Using DDL Statements to Create and Manage Tables
Presentation transcript:

Managing Tables

Objectives Distinguishing between different Oracle data types Creating tables using appropriate storage settings Controlling the space used by tables Analyzing tables to check integrity and migration Retrieving information about tables from the data dictionary Converting between different formats of ROWID Lesson Aim <Enter lesson aim here.>

Index-organized table Storing User Data Regular table Partitioned table Cluster Index-organized table

Structure of a Row Database block Row header Column length Column value

Oracle Data Types Data type User-defined Built-in Scalar Collection Relationship CHAR(N), NCHAR(N) VARCHAR2(N), NVARCHAR2(N) NUMBER(P,S) DATE RAW(N) BLOB, CLOB, NCLOB, BFILE LONG, LONG RAW ROWID VARRAY TABLE REF

ROWID Data Type Unique identifier for a row Used to locate a row ROWID Format OOOOOO FFF BBBBBB RRR Data object number Relative file number Block number Row number

Collections Collections are objects that contain objects. VARRAYs are ordered sets of elements containing a count and a limit. Nested tables are tables with a column or variable of the TABLE data type. Nested table VARRAY Describing Collections A collection is an object that contains other objects, where each contained object is of the same type. Collection types are parameterized datatypes. Collection types are arrays (VARRAY datatype) and nested tables. VARRAYs can be used to hold lists of objects, REFs, or scalar datatypes. They are primarily useful in dealing with small sets, where individual elements need not be manipulated through SQL. Nested tables are used where large sets of data need to be placed within a parent table and are typically useful there is a master-detail relationship, where for a given master row, there could be many detailed rows. Collections are discussed in detail in Lesson 7, “Implementing Collection Types.”

Creating a Table CREATE TABLE employees( empno NUMBER(4), last_name VARCHAR2(30) deptno NUMBER(2)) PCTFREE 20 PCTUSED 50 STORAGE(INITIAL 200K NEXT 200K PCTINCREASE 0 MAXEXTENTS 50) TABLESPACE data01;

Creating a Table: Guidelines Use a few standard extent sizes for tables to reduce tablespace fragmentation. Use the CACHE clause for frequently used, small tables.

Setting PCTFREE and PCTUSED Compute PCTFREE (Average Row Size - Initial Row Size) * 100 Average Row Size Compute PCTUSED Average Row Size * 100 100 - PCTFREE - Available Data Space

Row Migration and Chaining Before update After update

Copying an Existing Table CREATE TABLE new_emp STORAGE(INITIAL 200K NEXT 200K PCTINCREASE 0 MAXEXTENTS 50) NOLOGGING TABLESPACE data01 AS SELECT * FROM scott.employees;

Dropping Tables DROP TABLE scott.departments CASCADE CONSTRAINTS;