The dynamic performance view is used to access the changing status information of the Instance memory structure. A dynamic dataset about database instance operations and performance is maintained in OracleDB. These dynamic performance views are based on virtual tables built based on the memory structure of the database server.
The dynamic performance view is used to access the changing status information of the Instance memory structure. A dynamic dataset about database instance operations and performance is maintained in Oracle DB. These dynamic performance graphs are based on virtual tables built based on the memory structure of the database server.
Used to access the changing status information of the Instance memory structure.
A dynamic dataset about database instance operations and performance is maintained in Oracle DB. These dynamic performance views are based on virtual tables built based on the memory structure of the database server. That is to say, these views are not tables that reside in the database in the traditional sense. This is why some views can be used before the database is loaded or opened.
The dynamic performance view contains the following information:
? Session
? File status
? Job and task progress
? Lock
? Backup status
? Memory usage and Memory Allocation
? System Parameters and session parameters
? SQL Execution
? Statistical data and Measurement
Note: DICT and DICT_COLUMNS views also contain the names of these dynamic performance views. The dynamic performance view is prefixed with "v $" and has more than 590 features.
- Dynamic Performance view: usage example
Enterprise Manager is often used for these views, but other users can also query these views as needed.
1. Which SQL statements (and their related execution numbers) occupy more than 200,000 microseconds of CPU time?
SQL> SELECT SQL _text, executions FROMV $ SQLWHERE cpu_time> 200000;
2. In the previous day, which current sessions are logged on from the EDRSR9P1 computer?
SQL> SELECT * FROMV $ sessionWHERE machine = 'edrsr9p1' and logon_time> SYSDATE-1;
3. What is the session ID that currently holds the lock that blocks other users? How long have these locks been held?
SQL> SELECT sid, ctime FROMV $ lockWHERE block> 0;
- Dynamic Performance view: Considerations
? These views are owned by SYS users.
? Different views can be used in different scenarios:
-The instance has been started.
-The database has been loaded.
-The database has been opened.
? You can query V $ FIXED_TABLE to view all view names.
? These views are usually called "v $ views ".
? Because its data is dynamic, read consistency cannot be guaranteed in these views.
The data contained in some dynamic views does not apply to all statuses of instances or databases. For example, if the instance is just started but no database is loaded, you can query V $ BGPROCESS to view the list of running background processes. However, you cannot query V $ DATAFILE to view the status of the database data file, because you need to load the database to read the control file before you can find the data file associated with the database.
Some V $ views contain information similar to those in the corresponding DBA _ view. For example, V $ DATAFILE is similar to DBA_DATA_FILES. Note that the V $ view name is usually in the singular form, while the DBA _ view name is in the plural form.
- Data Dictionary: overview
Oracle Data dictionary is the metadata of a database, which contains the names and attributes of all objects in the database. Creating or modifying any object will update the data dictionary to reflect these changes. This information is stored in the base tables maintained by Oracle DB. However, you can use a predefined view to access these tables (instead of directly reading tables ).
Data Dictionary:
? Used by the Oracle DB server to find information about users, objects, constraints, and storage
? Oracle DB performs maintenance when the object structure or definition is modified.
? Allows any user to query database information.
? Owned by SYS users
? Do not use SQL to directly modify
Note: The DICTIONARY data DICTIONARY view (or its DICT synonym) contains the name and description of the data DICTIONARY table and view. You can use the DICT_COLUMNS view to view columns and their definitions.
View prefix indicates the data (and data volume) that can be viewed by a given user ).
Only users with DBA permissions can access the global view containing all objects (with DBA _ prefix ).
The next permission level is the ALL _ prefix level, which indicates querying ALL objects that the user has the right to view, regardless of whether the user owns these objects. For example, if USER_A is authorized to access a table belonging to USER_ B, USER_A will see the table in ALL _ views related to the table name.
Prefix user_represents the smallest visible range. This type of view only displays the objects that belong to the query user (that is, the objects that exist in the user's own solution ).
In general, each gallery is a subset of a gallery with higher permissions, whether by row or by column. Not all views in a given view set have corresponding views in other views. This depends on the nature of the information in the view.
For example, there is a DBA_LOCK view, but there is no ALL_LOCK view. This is because only DBA pays attention to the lock data. To meet the needs, make sure that the appropriate visual gallery is selected. Even if you have the right to access the DBA view, you may only want to query the view of the USER version, because the result will show information about the objects you own, and you may not want the results to contain other objects in the result set.
The DBA _ view can only be queried by users with SYSDBA or select any dictionary permissions.
Not ALL dictionary views are prefixed with DBA _, ALL _, and USER. The synonym for the following view or view is
Exceptions:
? AUDIT_ACTIONS
? CAT
? CHANGE_PROPAGATIONS
? CHANGE_PROPAGATION_SETS
? CHANGE_SETS
? CHANGE_SOURCES
? CHANGE_TABLES
? CLIENT_RESULT_CACHE_STATS $
? CLU
? COLS
? COLUMN_PRIVILEGES
? DATABASE_COMPATIBLE_LEVEL
? DBMS_ALERT_INFO
? DBMS_LOCK_ALLOCATED
? DICT
? DICTIONARY
? DICT_COLUMNS
? DUAL
? GLOBAL_NAME
? IND
? INDEX_HISTOGRAM
? INDEX_STATS
? LOGSTDBY_UNSUPPORTED_TABLES
? NLS_DATABASE_PARAMETERS
? NLS_INSTANCE_PARAMETERS
? NLS_SESSION_PARAMETERS
? OBJ
? RECYCLEBIN
? RESOURCE_COST
? ROLE_ROLE_PRIVS
? ROLE_SYS_PRIVS
? ROLE_TAB_PRIVS
? SEQ
? SESSION_PRIVS
? SESSION_ROLES
? SM $ VERSION
? SYN
? TABLE_PRIVILEGES
? TABS
- Data Dictionary: usage example
1. What is the name of the created table (and the name of the tablespace in which the table is located) in the solution?
SELECT table_name, t ablespace_name FROMUser_tables;
2. What is the important sequence information in the database you have the right to access?
SELECT sequence_name, min_value, max_value, increment_by FROMAll_sequencesWHERE sequence_owner IN ('mdsys ', 'xdb ');
3. What are the users currently logged on to this database?
Select username, ACCOUNT_STATUS FROMDba_usersWHERE ACCOUNT_STATUS = 'open ';
4. What are the columns in the DBA_INDEXES view? This shows the information about all indexes in the database.
DESCRIBEDba_indexes
Some outputs of this command are listed below:
SQL> DESCRIBE dba_indexes
Name Null? Type
------------------------------------
Owner not null VARCHAR2 (30)
INDEX_NAME not null VARCHAR2 (30)
INDEX_TYPE VARCHAR2 (27)
TABLE_OWNER not null VARCHAR2 (30)
TABLE_NAME not null VARCHAR2 (30)
You can set the initialization parameter O7_DICTIONARY_ACCESSIBILITY to false to protect the data dictionary.
This parameter can prevent users (users with any system permission is the permission of objects in SYS mode) from using these data dictionaries.
The oracle database provides highly detailed permissions.
Such a privilege is generally referred to as any privilege, which is usually granted to the owners and individual database administrators of the only application.
For example, you can grant the drop any table permission to an application owner to initialize parameters by enabling or disabling 07_DICTIONARY_ACCESSIBILITY to protect Oracle data dictionaries from ANY unexpected or malicious privileges.
Enable data dictionary protection Workflow
-
Use em to log on to Oracle Enterprise Manager Database Control (Database Control ).
-
Click Server, and click Initialization Parameters ".
-
Search for the O7_DICTIONARY_ACCESSIBILITY parameter.
-
SetO7_DICTIONARY_ACCESSIBILTYSetFALSE。
5.Click application and restart the database.
O7_DICTIONARY_ACCESSIBILITY parameter:
O7_DICTIONARY_ACCESSIBILITY controls system permissions. If this parameter is set to true, all objects in sys mode can access the data dictionary. The default value is false. Make sure that the system permission is allowed to access any other mode, but not the sys mode.
For example, if O7_DICTIONARY_ACCESSIBILITY is set to falseSELECT ANY TABLEAllows access to any view or table except sys mode (data dictionary cannot be accessed. System permission execute any procedure, which can access ANY mode except sys mode.
If this parameter is set to falise and you need to access the object in sys mode, you must explicitly grant the object permission. You can assign the following roles to the database administrator or to access dictionary objects:
-
SELECT_CATALOG_ROLE
-
EXECUTE_CATALOG_ROLE
-
DELETE_CATALOG_ROLE