12
IT 21003 Database IT 21003 Database Administration Administration Section 04 Section 04

IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary A set of tables and views owned by SYS and accessible using SQL Can be

Embed Size (px)

Citation preview

Page 1: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

IT 21003 Database AdministrationIT 21003 Database Administration

Section 04Section 04

Page 2: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

The Oracle 9i Data DictionaryThe Oracle 9i Data Dictionary A set of tables and views owned by SYS and A set of tables and views owned by SYS and accessible using SQLaccessible using SQL

Can be queried in identical fashion to user tablesCan be queried in identical fashion to user tables Base tables have names like tab$, obj$, etcBase tables have names like tab$, obj$, etc

Page 3: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

The Oracle 9i Data DictionaryThe Oracle 9i Data Dictionary The Data Dictionary containsThe Data Dictionary contains

Usernames and their rights and privilegesUsernames and their rights and privileges Information on space allocation and usageInformation on space allocation and usage Details of database structureDetails of database structure Auditing informationAuditing information Relational table structure and contentsRelational table structure and contents Special monitoring and performance tablesSpecial monitoring and performance tables Full details of all stored (server-side) codeFull details of all stored (server-side) code

Page 4: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

The Oracle 9i Data DictionaryThe Oracle 9i Data Dictionary The Data Dictionary should never be directly The Data Dictionary should never be directly updated using SQLupdated using SQL

Should be changed only using DDL statementsShould be changed only using DDL statements The Oracle Data Dictionary grows each releaseThe Oracle Data Dictionary grows each release

Page 5: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

Data Dictionary ConstructionData Dictionary Construction The base dictionary tables are built during The base dictionary tables are built during database creationdatabase creation

Difficult to read and direct use of them is Difficult to read and direct use of them is unsupportedunsupported Change in structure each releaseChange in structure each release

Page 6: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

Data Dictionary ConstructionData Dictionary Construction The views are built by running the scripts The views are built by running the scripts catalog and catproccatalog and catproc

Catalog builds views that refer to nonprocedural Catalog builds views that refer to nonprocedural objectsobjects

Example: user_tablesExample: user_tables

Catproc builds the views to support procedural Catproc builds the views to support procedural objectsobjects

Example: user_triggersExample: user_triggers

Page 7: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

Data Dictionary ConstructionData Dictionary Construction Many additional supplied scripts can be used Many additional supplied scripts can be used to extend the dictionary support for more to extend the dictionary support for more specialized activityspecialized activity

Found in Oracle_Home\rdbms\admin folderFound in Oracle_Home\rdbms\admin folder

Page 8: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

Standard Types of Dictionary ViewsStandard Types of Dictionary Views user_% viewsuser_% views

Refer to the user’s own environment and give Refer to the user’s own environment and give concise informationconcise information Return a subset of the all_% viewsReturn a subset of the all_% views Some have additional alternative public synonyms Some have additional alternative public synonyms for ease of usefor ease of use

Page 9: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

Standard Types of Dictionary ViewsStandard Types of Dictionary Views all_% viewsall_% views

Refer to the user’s own environment and Refer to the user’s own environment and resources, plus show details of objects to which resources, plus show details of objects to which they have accessthey have access

Page 10: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

Standard Types of Dictionary ViewsStandard Types of Dictionary Views dba_% viewsdba_% views

Accessible only to DBAs or users granted Oracle Accessible only to DBAs or users granted Oracle Catalog rolesCatalog roles

Page 11: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

The Dynamic Performance Views (v$ views)The Dynamic Performance Views (v$ views) Used by DBAs to monitor performanceUsed by DBAs to monitor performance

Owned by SYSOwned by SYS Built on the x$ dictionary base tablesBuilt on the x$ dictionary base tables Names begin with v_$Names begin with v_$ Some useful views:Some useful views:

v$parameterv$parameter v$sgav$sga v$sqlv$sql v$sqltextv$sqltext v$sessionv$session v$filestatv$filestat v$rowcachev$rowcache v$rollstatv$rollstat

Page 12: IT 21003 Database Administration Section 04. The Oracle 9i Data Dictionary  A set of tables and views owned by SYS and accessible using SQL  Can be

Questions?Questions?