I. Oracle DATA dictionary
A data dictionary is where Oracle stores information about a database and uses it to describe the data. For example, the creator information of a table, create time information, the table space information, user access rights information, and so on. When users encounter difficulties in manipulating data in the database, they can access the data dictionary to view detailed information. Data dictionaries in Oracle have static and dynamic points. The static data dictionary is mostly not changed when the user accesses the data dictionary, but the Dynamic Data dictionary is dependent on the performance of the database and reflects some intrinsic information of the database running, so it is often not invariable to access such data dictionary. These two types of data dictionaries are discussed below.
1. data dictionaries such as static data dictionaries are primarily composed of tables and views, and it should be noted that the tables in the data dictionary are not directly accessible, but can access the views in the data dictionary. Views in a static data dictionary are divided into three categories, each of which is made up of three prefixes: user_*, all_*, dba_*.
User_* This view stores information about the objects that are owned by the current user. (That is, all objects in this user mode)
All_* this attempt to store information about the objects that the current user can access. (all_* does not need to have the object as compared to user_*, only the right to access the object)
Dba_* This view stores information about all objects in the database. (as long as the current user has access to these databases, generally must have administrator rights) from the above description can be seen, the data stored between the three will certainly overlap, in fact, in addition to the scope of access to the different (because the permissions are not the same, so the scope of the object access is not the same), others have consistency. Specifically, because the data dictionary view is owned by the SYS (System user), in the case of a state, only SYS and users with DBA system privileges can see all views. Users who do not have DBA authority can only see user_* and all_*. If the relevant SELECT permission is not granted, they cannot see the dba_* view.
Because of the similarity of the three, the following example introduces several common static views in User_:
User_users View
Mainly describes the current user's information, including the current user name, account ID, account status, tablespace name, creation time, and so on. For example, you can return this information by executing the following command.
SELECT * FROM User_users
User_tables View
This paper mainly describes the information of all the tables owned by the current user, including the table name, table space name, cluster name and so on. This view provides a clear understanding of what tables the current user can manipulate. The Execute command is: SELECT * from User_tables
User_objects View
It mainly describes the information of all objects owned by the current user, including tables, views, stored procedures, triggers, packages, indexes, sequences, and so on. This view is more comprehensive than the User_tables view. For example, to obtain information about an object type named "Package1" and its status, you can execute the following command:
Select Object_type,status from user_objects where Object_name=upper (' package1 ');
Note: The use of upper, all objects in the data dictionary are uppercase, and PL/SQL is not case sensitive, so be sure to pay attention to case matching in practice.
User_tab_privs view, which is primarily to store permission information for all tables under the current user. For example, to understand the current user's permissions to table1, you can execute the following command:
SELECT * from User_tab_privs where Table_name=upper (' table1 ')
Knowing the current user's permissions on the table gives you a clear idea of what actions can be performed and what actions cannot be performed.
The previous view is User_, but the All_ beginning is exactly the same, but the information listed is the object that the current user can access instead of the current user. For Dba_ to start with administrator privileges, other uses are exactly the same, here is not to repeat.
2. Dynamic Data dictionary
Oracle contains a number of potential tables and views that are maintained by system administrators such as SYS, which are called Dynamic Data dictionaries (or dynamic performance views) because they are constantly updated when the database is running. These views provide information about memory and disk operations, so we can only read access to them and not modify them.
These dynamic performance views in Oracle are views that start with v$, such as v$access. Here are a few of the main dynamic performance views.
V$access
This view displays the database objects that are locked in the database and the session objects that access those objects (Session objects).
Run the following command:
Select * from V$access
results are as follows: (because of the record, so this is just a partial record)
Sid |
OWNER |
OBJECT |
TYPE |
27 |
DKH |
V$access |
CURSOR |
27 |
Public |
V$access |
Synonym |
27 |
SYS |
Dbms_application_info |
Package |
27 |
SYS |
Gv$access |
VIEW |
V$session
This view lists the details of the current session. Because the view field is large, the detail field is not listed here, for more information, you can type it directly under the Sql*plus command line: Desc v$session.
V$active_instance
This view primarily describes the information for an instance of an activity under the current database. You can still use the SELECT statement to observe this information.
V$context
This view lists the property information for the current session. such as namespaces, property values, and so on.
-------------------------------------------------------------------------
One, theOracle data dictionary is composed of the following views mainly:
The 1.user view is prefixed with user_ to record information about the user object
The 2.all view is prefixed with All_ to record information about the user object and the object information that is authorized to access it
The 3.DBA view is prefixed with Dba_ and is used to record information about all objects of the DB instance
The 4.v$ view is prefixed with v$ to record performance statistics related to database activity
The 5.gv$ view is prefixed with gv$ to record dynamic information for all instances in a distributed environment
Second, Oracle's Common data dictionary
1. Basic Data dictionary
Dictionary name Description
Dba_tables All table information for all users
Dba_tab_columns field information for all users ' tables
Dba_views All view information for all users
dba_synonyms all synonym information for all users
Dba_sequences all sequence information for all users
dba_constraints constraint information for all users ' tables
Dba_ind_columns field information for the index of all users ' tables
Dba_triggers trigger information for all users
Dba_sources stored procedure information for all users
Dba_segments use space information for all users ' segments
Dba_extents extended information for all segments of a user
Dba_objects basic information for all user objects
All base tables that the cat current user can access
tab but all base tables, views, synonyms, etc. created by the previous user
Dict information for all tables that comprise a data dictionary
2. Data dictionaries related to database components
Table or view description in the database component data dictionary
The operation of database V$datafile record system
Table Space Dba_tablespaces The basic information of the record system tablespace
Dba_free_space to record free space information for a system table space
Basic information of control file V$controlfile record system control file
V$control_record_section record the information of a document segment in a system control file
V$parameter basic information for recording system parameters
Data file Dba_data_files record system data file and table space basic information
V$filestat Record data file information from a control file
V$datafile_header basic information for recording data file headers
Section dba_segments basic information for record segments
Section dba_extents basic information for recording data area
Log v$thread basic information for logging threads
V$log basic information for logging log files
V$logfile Log File summary information
Archive V$archived_log basic information for archived log files
V$archived_dest record the path information for the archived log file
DB instance v$instance the basic information of the record instance
V$system_parameter record the current valid parameter information for an instance
Memory structure V$SGA records information about the SGA area
V$sgastat to record SGA details
V$db_object_cache Record object Cache size information
V$sql log details of SQL statements
V$sqltext statement information that records SQL statements
V$sqlarea Log SQL basic information for SQL area
Background process v$bgprocess Show background process information
V$session Displaying current session information
3. Common Dynamic Performance views
View name Description
V$fixed_table displays a description of the currently released fixed object
V$instance displaying information for the current instance
V$latch Display LATCH Statistics
V$librarycache displaying statistics about library cache performance
V$rollstat show the name of the online rollback segment
V$rowcache Show statistics for active data dictionaries
V$sag Record the SGA area information
V$sgastat to record SGA details
V$sort_usage shows the size and session of the staging segment
V$sqltext statement information that records SQL statements
V$sqlarea Log SQL basic information for SQL area
V$stsstat displaying basic instance statistics
V$system_event Displays the total wait time for an event
V$WAITSTAT Display Block Competition statistics
Oracle's Common Data dictionary