Is A View starting with v $?

Source: Internet
Author: User
In the dynamic performance view, there are changes in the oracle runtime. The changed data is stored in the dynamic performance table (memory table, fixed table), which is created as the database starts up, the dynamic performance table is too complex as the content is added as the database runs. On this basis, oracle creates a view and synonym for DBA to determine the system performance status information.

In the dynamic performance view, there are changes in the oracle runtime. The changed data is stored in the dynamic performance table (memory table, fixed table), which is created as the database starts up, the dynamic performance table is too complex as the content is added as the database runs. On this basis, oracle creates a view and synonym for DBA to determine the system performance status information.

Dynamic Performance View

The data in oracle is changing at runtime. The changed data is stored in the dynamic performance table (memory table, fixed table). It is created as the database starts and increases as the database runs, the dynamic performance table is too complex. On this basis, oracle creates a view and synonym for DBA to determine the system performance status information.

These views and synonyms are called dynamic performance views. They Store changing data at any time.

Select * from v $ FIXED_TABLE

The oracle database also maintains dynamic datasets related to data instance operations and performance. These dynamic performance views are built on a virtual table built through the memory structure in the database server. That is to say, they are not regular tables that reside in the database. Therefore, some of the views can display data before loading or opening the database.

The dynamic performance view includes the following information:

·Session·File status·Job and task progress·Lock·Backup status·Memory usage and allocation·System and session parameters·SQL Execution·Statistics and Measurement

Note: DICT and DICT_COLUMNS views also contain the names of these dynamic performance views.

The data contained in some dynamic views does not necessarily apply to all statuses of instances or databases. For example, if you have just started an instance but have not loaded the database, 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 read the control file from the database to be loaded before you can find the data file associated with the database.

· These views are owned by SYS users.

· Different views can be used at different times:

---- The instance has started

---- Database loaded

---- The database has been opened

· Query V $ FIXED_TABLE to view all view names

· These views are often referred to as "v $ views"

· Because the data is dynamic, read consistency is not guaranteed for these views.


Is A View starting with v $? <喎?http: www.2cto.com kf ware vc " target="_blank" class="keylink"> Vc3ryb25np1_vcd4kpha + large + 00rvPwtXiuPbK0828tcS7 + large/Cw/zB7rLp0a + large "v $ parameter ');


OBJECT_NAME OBJECT_TYPE OWNER
------------------------------------------------------------
V $ PARAMETER SYNONYM PUBLIC


SYS @ ORCL> select dbms_metadata.get_ddl (upper ('synonm'), upper ('v $ PARAMETER '), upper ('public') from dual;


DBMS_METADATA.GET_DDL (UPPER ('s
--------------------------------------------------------------------------------


Create or replace public synonym "V $ PARAMETER" FOR "SYS". "V _ $ PARAMETER"

② Through this step, we will find that V $ PARAMETER is actually a synonym of V _ $ PARAMETER,

SYS @ ORCL> select object_name, object_type, owner from all_objects where object_name = upper ('v _ $ parameter ');


OBJECT_NAME OBJECT_TYPE OWNER
------------------------------------------------------------
V _ $ PARAMETER VIEW SYS


SYS @ ORCL> select dbms_metadata.get_ddl (upper ('view'), upper ('v _ $ PARAMETER '), upper ('sys') from dual;



DBMS_METADATA.GET_DDL (UPPER ('v
--------------------------------------------------------------------------------


Create or replace force view "SYS". "V _ $ PARAMETER" ("NUM", "NAME", "TYPE", "VA

......

... From v $ parameter

3. At this point, the response is complete. How can we get back to v $ parameter? If we get _ DDL again, we get back to the first step. It must be wrong. Let's take a look at v _ $ parameter as a view, so v $ parameter may also be a fixed view. We can query it in a fixed view definition view.

SYS @ ORCL> select view_definition from v $ fixed_view_definition where view_name = upper ('v $ parameter ');


VIEW_DEFINITION
--------------------------------------------------------------------------------
Select NUM, NAME, TYPE, VALUE, DISPLAY_VALUE, ISDEFAULT, ISSES_MODIFIABLE
, ISSYS_MODIFIABLE, ISINSTANCE_MODIFIABLE, ISMODIFIED, ISADJUSTED, ISDEPRECAT
ED, DESCRIPTION, UPDATE_COMMENT, HASH from GV $ PARAMETER where inst_id = USERENV
('Instance ')


④ It is a fixed view. This fixed view is also defined according to the fixed view. We can view the fixed view GV $ parameter again.

SYS @ ORCL> select view_definition from v $ fixed_view_definition where view_name = upper ('gv $ parameter ');


VIEW_DEFINITION
--------------------------------------------------------------------------------
Select x. inst_id, x. indx + 1, ksppinm, ksppity, ksppstvl, ksppstdvl, ksppstdf, decode
(Bitand (ksppiflg/256, 1), 1, 'true', 'false'), decode (bitand (ksppiflg/65536,3), 1, 'I
MMEDIATE ', 2, 'referred', 3, 'immediate', 'false '),
Decode (bitand (ksppiflg, 4), 4, 'false', decod
E (bitand (ksppiflg/65536,3), 0, 'false', 'true'), decode (bitand (ksppstvf, 7 ),
1, 'modified', 4, 'System _ mod', 'false'), decode (bitand (ksppstvf, 2), 2, 'true', 'false'
'), Decode (bitand (ksppilrmflg/64, 1), 1, 'true', 'false'), ksppdesc, ksppstcen
T, ksppihash from x $ ksppi x, x $ ksppcv y where (x. indx = y. indx) and (translat
E (ksppinm, '_', '#') not like '# %') and (translate (ksppinm, '_', '#') not like
'# %') Or (ksppstdf = 'false') or (bitand (ksppstvf, 5)> 0 )))




SYS @ ORCL>

⑤ Seeing the base table of GV $ PARAMETER, I finally know the ins and outs of the dynamic performance view.

Summary:

-- The dynamic performance view viewed by a non-sys user is a synonym

-- Source of "Dynamic Performance View:

Base table starting with X $ ----> fixed View starting with gv $ -----> fixed View starting with v $ ----> View starting with v _ $ -----> synonym starting with v $

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.