Presentation is loading. Please wait.

Presentation is loading. Please wait.

What is a schema ? Schema is a collection of Database Objects. Schema Objects are logical structures created by users to contain, or reference, their data.

Similar presentations


Presentation on theme: "What is a schema ? Schema is a collection of Database Objects. Schema Objects are logical structures created by users to contain, or reference, their data."— Presentation transcript:

1 What is a schema ? Schema is a collection of Database Objects. Schema Objects are logical structures created by users to contain, or reference, their data. There is one-to-one correspondence between a DB user and the Schema that he/she creates. Container which contains all oracle objects with in it.

2 Different Schema Objects Clusters Constraints Database links Database triggers Dimensions External procedure libraries Indexes and indextypes Java classes, resources

3 Schema objects continued…. Object tables, types, views Materialized views and logs Operators Sequences Stored functions, procedures & packages

4 Where is Schema ? Oracle database stores schema objects in tablespaces Data of each object is physically contained in the one of the tablespace’s data files.

5 Schema objects, Tablespaces & Data Files

6 With Schema Objects, you can…… Create multiple tables, views in one shot. Analyze table, clusters, indexes. Truncate tables and clusters. Manage integrity constraints. Manage data integrity. Manage object dependencies.

7 Analyze tables You analyze a schema object (table, index, or cluster) to: 1.Collect and manage statistics for it 2.Verify the validity of its storage format 3.Identify migrated and chained rows of a table or cluster  DBMS_STATS package/ANALYZE statement is used to gather statistics about the physical storage characteristics of a table, index, or cluster.  These statistics are stored in the data dictionary and can be used by the optimizer to choose the most efficient execution plan for SQL statements accessing analyzed objects.  ANALYZE statement (rather than DBMS_STATS) is used for statistics collection not related to the cost-based optimizer

8 Object Dependencies An object that references another object as part of its definition is called a dependent object, while the object being referenced is a referenced Object. To manage dependencies among schema objects, all of the schema objects in a database have a status. Valid schema objects have been compiled and can be immediately used when referenced. Invalid schema objects must be compiled before they can be used. 1)For procedures, functions, and packages, this means compiling the schema object. 2)For views, this means that the view must be reparsed, using the current definition in the data dictionary.

9 The Data Dictionary The data dictionary is the repository for database metadata, which is a fancy term for data describing the database. Oracle stores the definitions for other objects you create, such as views, PL/SQL packages, triggers, synonyms, indexes, and so forth in the Data dictionary. The database software uses this metadata to interpret and execute SQL statements, and to properly manage stored data. Oracle exposes database metadata through a large collection of data dictionary views. Codd's fourth rule for relational database systems states that database metadata must be stored in relational tables just like any other type of data.

10 Hierarchial Structure of Datadictionary At the root of the tree is the dictionary table, that features two attributes: table_name and comments. The comment field presents an informal description of the corresponding dictionary table. We can request info. about the Dictionary table in the following way “select Comments from dictionary where table_name=‘Dictionary’ ” ;

11 Data Dictionary Views Oracle divides data dictionary views into the four families, as indicated by the following prefixes:  USER_ USER views return information about objects owned by the currently-logged-on database user.  ALL_ ALL views return information about all objects to which you have access, regardless of who owns them.  DBA_ DBA views are generally accessible only to database administrators, and return information about all objects in the database, regardless of ownership or access privileges.  V$ views reflect the internal state of the DBMS and are used for its performance and optimization.

12 References http://www.oreillynet.com/pub/a/network/2002/10/2 8/data_dictionary.html http://www.oreillynet.com/pub/a/network/2002/10/2 8/data_dictionary.html http://www.ss64.com/orap/DBMS_SPACE.html Oracle Dba Guide for 10G. Hands-ON Oracle DB 10g XE for Windows.


Download ppt "What is a schema ? Schema is a collection of Database Objects. Schema Objects are logical structures created by users to contain, or reference, their data."

Similar presentations


Ads by Google