在oracle運維的過程中
這些都是由oracle自己管理的數據結構
[oracle@
SQL*Plus: Release
Copyright (c)
Connected to:
Oracle Database
With the Partitioning
SQL> desc v$fixed_table;
Name Null? Type
—————————————– ——– —————————
NAME VARCHAR
OBJECT_ID NUMBER
TYPE VARCHAR
TABLE_NUM NUMBER
SQL> select * from v$fixed_table
NAME OBJECT_ID TYPE TABLE_NUM
—————————— ———
X$KQFTA
X$KQFVI
GV$PROCESS
V$PROCESS
GV$BGPROCESS
………………………………………
從上面可以看到GV$與V$是視圖
SQL> set linesize
SQL> col view_name for a
SQL> col view_definition for a
SQL> select * from v$fixed_view_definition where view_name=
VIEW_NAME VIEW_DEFINITION
———————
V$FIXED_TABLE select NAME
USERENV(
SQL> select * from v$fixed_view_definition where view_name=
VIEW_NAME VIEW_DEFINITION
————————
GV$FIXED_TABLE select inst_id
nst_id
qfdtnam
原來gv$是全局視圖
etl@ALIDW> select distinct inst_id from gv$session;
INST_ID
———
這rac上有四個實例
那gv_$與v_$的定義又在什麼地方呢?原來在$ORACLE_HOME/rdbms/admin存放著系統管理腳本
–CATCTL
@@cdstrt
@@cdfixed
@@cdcore
–CATCTL
@@cdplsql
@@cdsqlddl
……………………………………………………………………………
進一步在cdfixed
create or replace view v_$fixed_table as select * from v$fixed_table;
create or replace public synonym v$fixed_table for v_$fixed_table;
grant select on v_$fixed_table to select_catalog_role;
create or replace view gv_$fixed_table as select * from gv$fixed_table;
create or replace public synonym gv$fixed_table for gv_$fixed_table;
grant select on gv_$fixed_table to select_catalog_role;
……………………………………………………………………………………………………………
[oracle@
SQL> select * from user_role_privs;
USERNAME GRANTED_ROLE ADM DEF OS_
—————————— —————————— — — —
SYS SELECT_CATALOG_ROLE YES YES NO
因此我們常用的v$ 是v_$的同義詞
我們常用的gv$是gv_$的同義詞
From:http://tw.wingwit.com/Article/program/Oracle/201311/18981.html