DBAVIEWS

Embed Size (px)

Citation preview

  • 7/29/2019 DBAVIEWS

    1/2

    Oracle DBA Commonly Used Views

    Oracle DBA Commonly Used Views

    Below is a list of some of the views DBAs use to monitor a database. A DBA can seewhat columns a particular view provides by using the describe view SQL command.

    Then you can limit which columns appear to the ones of interest at the moment. You canalso limit the rows to the specific things of interest. An example might be:select Owner, Tablespace_name, Segment_Name, Extents as '# Extents',Max_Extents as 'Max Extents', (Extents/Max_Extents)*100 as '% used'from DBA_SEGMENTSwhere Owner not in ('SYS', 'SYSTEM')and Segment_type not in ('ROLLBACK', 'DEFERRED ROLLBACK', TEMPORARY')order by Tablespace_Name, Owner;

    Many of the DBA_ views shown in the table below have corresponding USER_ viewsthat show similar information but for the current user (schema) only. Likewise, the

    various V$ views, which show information about the current instance have matchingGV$ views, which show information about all instances.The table below lists the views in three general categories, resource managment views,performance monitoring views, and security related views). Within each group the viewsare not listed in any particular order however.

    Views

    View DescriptionSystem Resource ViewsUSER_ERRORS Displays the errors found in views, stored procedures, and otherobjects.

    DBA_TABLESPACES Provides information about each tablespace in the database.DBA_USERS Provides information about each user in the database.DBA_SOURCE Shows the source code for stored functions, triggers, and Java objectsDBA_DATAFILES Gives information about the datafiles.DBA_SEGMENTS Describes the storage usage for the segments (the part of a datafilethat contains the physical storage for a database object).DBA_EXTENTS More detailed information on space used for segments. (Too manyextents per segment can take hours if dropping the associated table. You can also checkthe next extent size to make sure you have sufficient free space.)DBA_UNDO_EXTENTS Used to monitor the space used for automatic undomanagement. (If not using AUM you will have rollback segments instead, and the view

    to use for that is DBA_ROLLBACK_SEGS.)DBA_TABLES Lets the DBA view information about any table.DBA_TAB_COLUMNS Provides detailled information about each column of a table.DBA_INDEXES Show information about table indexes; helps when trying to decide ifsome index is useful or not. A related view is DBA_IND_COLUMNS which tells whichcolumns of a table are indexed.DBA_CONSTRAINTS Lists the restristions that have been placed on the contents ofcolumns of tables and views. More detailed information comes from the related view

  • 7/29/2019 DBAVIEWS

    2/2

    DBA_CONS_COLUMNS.PRODUCT_COMPONENT\_VERSION Shows the current versions of all installed components.Performance Monitoring ViewsV$SYSSTAT Statistics such as the amount of data changed and the number of

    transactions executed.V$SQL The actual SQL commands recently executed, how many time it was executedand how much CPU time it took.V$SESSTAT Shows resources consumed per session. (Related: V$SESSION_WAIT)V$FILESTAT The number of reads and writes per file, and time spent on disk I/O.V$DATAFILE Lists the file number and name for each DB file. In many views andtables Oracle identifies files by the number rather than name. (Related:V$DATAFILE_HEADER)V$DATABASE General information about the databaseV$DBFILE Shows file name to numbersV$FIXED_TABLE Shows the names of all dynamic tables and views.

    V$INSTANCE General information about each instance.V$PARAMETER Shows all the initializatino parameters and their current values.V$SGA Summary statistics for the use of space in the SGA.V$TEMPFILE Shows Statistics for locally-managed temporary tablespace files.Security Related ViewsDBA_USERS Lists users who can access a database.DBA_PROFILES List & Description of all profiles in DBDBA_ROLES List of all roles in the DBDBA_ROLE_PRIVS Roles assigned to usersDBA_SYS_PRIVS System Level Privileges for usersDBA_TAB_PRIVS Object level privileges for usersDBA_TS_QUOTA Which user has how much quota on tablespaceDBA_VIEWS Description of all views in the DB