Oracle数据库有4大类系统“表“:
- 内部表
- 数据字典表
- 动态视图
- 数据字典视图
常用的,诸如DBA_**, ALL_**, USER_**,都是数据字典视图!
1. 以DBA_TABLES为例,来看看这个视图从哪些”表”里获取了数据?
1 SQL> 2 SQL> 3 SQL> select text from dba_views where view_name like 'DBA_TABLES'; 4 5 TEXT 6 -------------------------------------------------------------------------------- 7 select u.name, o.name, 8 decode(bitand(t.property,2151678048), 0, ts.name, 9 decode(t.ts#, 0, null, ts.name)), 10 decode(bitand(t.property, 1024), 0, null, co.name), 11 decode((bitand(t.property, 512)+bitand(t.flags, 536870912)), 12 0, null, co.name), 13 decode(bitand(t.trigflag, 1073741824), 1073741824, 'UNUSABLE', 'VALID'), 14 decode(bitand(t.property, 32+64), 0, mod(t.pctfree$, 100), 64, 0, null), 15 decode(bitand(ts.flags, 32), 32, to_number(NULL), 16 decode(bitand(t.property, 32+64), 0, t.pctused$, 64, 0, null)), 17 decode(bitand(t.property, 32), 0, t.initrans, null), 18 19 TEXT 20 -------------------------------------------------------------------------------- 21 decode(bitand(t.property, 32), 0, t.maxtrans, null), 22 decode(bitand(t.property, 17179869184), 17179869184, 23 ds.initial_stg * ts.blocksize, 24 s.iniexts * ts.blocksize), 25 decode(bitand(t.property, 17179869184), 17179869184, 26 ds.next_stg * ts.blocksize, 27 s.extsize * ts.blocksize), 28 decode(bitand(t 29 30 31 SQL> set long 2048; 32 SQL> 33 SQL> 34 SQL> select text from dba_views where view_name like 'DBA_TABLES'; 35 36 TEXT 37 -------------------------------------------------------------------------------- 38 select u.name, o.name, 39 decode(bitand(t.property,2151678048), 0, ts.name, 40 decode(t.ts#, 0, null, ts.name)), 41 decode(bitand(t.property, 1024), 0, null, co.name), 42 decode((bitand(t.property, 512)+bitand(t.flags, 536870912)), 43 0, null, co.name), 44 decode(bitand(t.trigflag, 1073741824), 1073741824, 'UNUSABLE', 'VALID'), 45 decode(bitand(t.property, 32+64), 0, mod(t.pctfree$, 100), 64, 0, null), 46 decode(bitand(ts.flags, 32), 32, to_number(NULL), 47 decode(bitand(t.property, 32+64), 0, t.pctused$, 64, 0, null)), 48 decode(bitand(t.property, 32), 0, t.initrans, null), 49 50 TEXT 51 -------------------------------------------------------------------------------- 52 decode(bitand(t.property, 32), 0, t.maxtrans, null), 53 decode(bitand(t.property, 17179869184), 17179869184, 54 ds.initial_stg * ts.blocksize, 55 s.iniexts * ts.blocksize), 56 decode(bitand(t.property, 17179869184), 17179869184, 57 ds.next_stg * ts.blocksize, 58 s.extsize * ts.blocksize), 59 decode(bitand(t.property, 17179869184), 17179869184, 60 ds.minext_stg, s.minexts), 61 decode(bitand(t.property, 17179869184), 17179869184, 62 ds.maxext_stg, s.maxexts), 63 64 TEXT 65 -------------------------------------------------------------------------------- 66 decode(bitand(ts.flags, 3), 1, to_number(NULL), 67 decode(bitand(t.property, 17179869184), 17179869184, 68 ds.pctinc_stg, s.extpct)), 69 decode(bitand(ts.flags, 32), 32, to_number(NULL), 70 decode(bitand(o.flags, 2), 2, 1, 71 decode(bitand(t.property, 17179869184), 17179869184, 72 ds.frlins_stg, decode(s.lists, 0, 1, s.lists)))), 73 decode(bitand(ts.flags, 32), 32, to_number(NULL), 74 decode(bitand(o.flags, 2), 2, 1, 75 decode(bitand(t.property, 17179869184), 17179869184, 76 ds.maxins_stg, decode(s.groups, 0, 1, s.groups)))), 77 78 TEXT 79 -------------------------------------------------------------------------------- 80 decode(bitand(t.property, 32+64), 0, 81 decode(bitand(t.flags, 32), 0, 'YES', 'NO'), null), 82 decode(bitand(t.flags,1), 0, 'Y', 1, 'N', '?'), 83 t.rowcnt, 84 85 86 SQL> set long 65535; 87 SQL> 88 SQL> 89 SQL> select text from dba_views where view_name like 'DBA_TABLES'; 90 91 TEXT 92 -------------------------------------------------------------------------------- 93 select u.name, o.name, 94 decode(bitand(t.property,2151678048), 0, ts.name, 95 decode(t.ts#, 0, null, ts.name)), 96 decode(bitand(t.property, 1024), 0, null, co.name), 97 decode((bitand(t.property, 512)+bitand(t.flags, 536870912)), 98 0, null, co.name), 99 decode(bitand(t.trigflag, 1073741824), 1073741824, 'UNUSABLE', 'VALID'), 100 decode(bitand(t.property, 32+64), 0, mod(t.pctfree$, 100), 64, 0, null), 101 decode(bitand(ts.flags, 32), 32, to_number(NULL), 102 decode(bitand(t.property, 32+64), 0, t.pctused$, 64, 0, null)), 103 decode(bitand(t.property, 32), 0, t.initrans, null), 104 105 TEXT 106 -------------------------------------------------------------------------------- 107 decode(bitand(t.property, 32), 0, t.maxtrans, null), 108 decode(bitand(t.property, 17179869184), 17179869184, 109 ds.initial_stg * ts.blocksize, 110 s.iniexts * ts.blocksize), 111 decode(bitand(t.property, 17179869184), 17179869184, 112 ds.next_stg * ts.blocksize, 113 s.extsize * ts.blocksize), 114 decode(bitand(t.property, 17179869184), 17179869184, 115 ds.minext_stg, s.minexts), 116 decode(bitand(t.property, 17179869184), 17179869184, 117 ds.maxext_stg, s.maxexts), 118 119 TEXT 120 -------------------------------------------------------------------------------- 121 decode(bitand(ts.flags, 3), 1, to_number(NULL), 122 decode(bitand(t.property, 17179869184), 17179869184, 123 ds.pctinc_stg, s.extpct)), 124 decode(bitand(ts.flags, 32), 32, to_number(NULL), 125 decode(bitand(o.flags, 2), 2, 1, 126 decode(bitand(t.property, 17179869184), 17179869184, 127 ds.frlins_stg, decode(s.lists, 0, 1, s.lists)))), 128 decode(bitand(ts.flags, 32), 32, to_number(NULL), 129 decode(bitand(o.flags, 2), 2, 1, 130 decode(bitand(t.property, 17179869184), 17179869184, 131 ds.maxins_stg, decode(s.groups, 0, 1, s.groups)))), 132 133 TEXT 134 -------------------------------------------------------------------------------- 135 decode(bitand(t.property, 32+64), 0, 136 decode(bitand(t.flags, 32), 0, 'YES', 'NO'), null), 137 decode(bitand(t.flags,1), 0, 'Y', 1, 'N', '?'), 138 t.rowcnt, 139 decode(bitand(t.property, 64), 0, t.blkcnt, null), 140 decode(bitand(t.property, 64), 0, t.empcnt, null), 141 t.avgspc, t.chncnt, t.avgrln, t.avgspc_flb, 142 decode(bitand(t.property, 64), 0, t.flbcnt, null), 143 lpad(decode(t.degree, 32767, 'DEFAULT', nvl(t.degree,1)),10), 144 lpad(decode(t.instances, 32767, 'DEFAULT', nvl(t.instances,1)),10), 145 lpad(decode(bitand(t.flags, 8), 8, 'Y', 'N'),5), 146 147 TEXT 148 -------------------------------------------------------------------------------- 149 decode(bitand(t.flags, 6), 0, 'ENABLED', 'DISABLED'), 150 t.samplesize, t.analyzetime, 151 decode(bitand(t.property, 32), 32, 'YES', 'NO'), 152 decode(bitand(t.property, 64), 64, 'IOT', 153 decode(bitand(t.property, 512), 512, 'IOT_OVERFLOW', 154 decode(bitand(t.flags, 536870912), 536870912, 'IOT_MAPPING', null 155 ))), 156 decode(bitand(o.flags, 2), 0, 'N', 2, 'Y', 'N'), 157 decode(bitand(o.flags, 16), 0, 'N', 16, 'Y', 'N'), 158 decode(bitand(t.property, 8192), 8192, 'YES', 159 decode(bitand(t.property, 1), 0, 'NO', 'YES')), 160 161 TEXT 162 -------------------------------------------------------------------------------- 163 decode(bitand(o.flags, 2), 2, 'DEFAULT', 164 decode(bitand(decode(bitand(t.property, 17179869184), 17179869184, 165 166 ds.bfp_stg, s.cachehint), 3), 167 1, 'KEEP', 2, 'RECYCLE', 'DEFAULT')), 168 decode(bitand(o.flags, 2), 2, 'DEFAULT', 169 decode(bitand(decode(bitand(t.property, 17179869184), 17179869184, 170 171 ds.bfp_stg, s.cachehint), 12)/4, 172 1, 'KEEP', 2, 'NONE', 'DEFAULT')), 173 decode(bitand(o.flags, 2), 2, 'DEFAULT', 174 175 TEXT 176 -------------------------------------------------------------------------------- 177 decode(bitand(decode(bitand(t.property, 17179869184), 17179869184, 178 179 ds.bfp_stg, s.cachehint), 48)/16, 180 1, 'KEEP', 2, 'NONE', 'DEFAULT')), 181 decode(bitand(t.flags, 131072), 131072, 'ENABLED', 'DISABLED'), 182 decode(bitand(t.flags, 512), 0, 'NO', 'YES'), 183 decode(bitand(t.flags, 256), 0, 'NO', 'YES'), 184 decode(bitand(o.flags, 2), 0, NULL, 185 decode(bitand(t.property, 8388608), 8388608, 186 'SYS$SESSION', 'SYS$TRANSACTION')), 187 decode(bitand(t.flags, 1024), 1024, 'ENABLED', 'DISABLED'), 188 189 TEXT 190 -------------------------------------------------------------------------------- 191 decode(bitand(o.flags, 2), 2, 'NO', 192 decode(bitand(t.property, 2147483648), 2147483648, 'NO', 193 decode(ksppcv.ksppstvl, 'TRUE', 'YES', 'NO'))), 194 decode(bitand(t.property, 1024), 0, null, cu.name), 195 decode(bitand(t.flags, 8388608), 8388608, 'ENABLED', 'DISABLED'), 196 case when (bitand(t.property, 32) = 32) then 197 null 198 when (bitand(t.property, 17179869184) = 17179869184) then 199 decode(bitand(ds.flags_stg, 4), 4, 'ENABLED', 'DISABLED') 200 else 201 decode(bitand(s.spare1, 2048), 2048, 'ENABLED', 'DISABLED') 202 203 TEXT 204 -------------------------------------------------------------------------------- 205 end, 206 case when (bitand(t.property, 32) = 32) then 207 null 208 when (bitand(t.property, 17179869184) = 17179869184) then 209 decode(bitand(ds.flags_stg, 4), 4, 210 case when bitand(ds.cmpflag_stg, 3) = 1 then 'BASIC' 211 when bitand(ds.cmpflag_stg, 3) = 2 then 'OLTP' 212 else decode(ds.cmplvl_stg, 1, 'QUERY LOW', 213 2, 'QUERY HIGH', 214 3, 'ARCHIVE LOW', 215 'ARCHIVE HIGH') end, 216 217 TEXT 218 -------------------------------------------------------------------------------- 219 null) 220 else 221 decode(bitand(s.spare1, 2048), 0, null, 222 case when bitand(s.spare1, 16777216) = 16777216 223 then 'OLTP' 224 when bitand(s.spare1, 100663296) = 33554432 -- 0x2000000 225 then 'QUERY LOW' 226 when bitand(s.spare1, 100663296) = 67108864 -- 0x4000000 227 then 'QUERY HIGH' 228 when bitand(s.spare1, 100663296) = 100663296 -- 0x2000000+0x400000 229 0 230 231 TEXT 232 -------------------------------------------------------------------------------- 233 then 'ARCHIVE LOW' 234 when bitand(s.spare1, 134217728) = 134217728 -- 0x8000000 235 then 'ARCHIVE HIGH' 236 else 'BASIC' end) 237 end, 238 decode(bitand(o.flags, 128), 128, 'YES', 'NO'), 239 decode(bitand(t.trigflag, 2097152), 2097152, 'YES', 'NO'), 240 decode(bitand(t.property, 17179869184), 17179869184, 'NO', 241 decode(bitand(t.property, 32), 32, 'N/A', 'YES')), 242 decode(bitand(t.property,16492674416640),2199023255552,'FORCE', 243 4398046511104,'MANUAL','DEFAULT') 244 245 TEXT 246 -------------------------------------------------------------------------------- 247 from sys.user$ u, sys.ts$ ts, sys.seg$ s, sys.obj$ co, sys.tab$ t, sys.obj$ o, 248 sys.obj$ cx, sys.user$ cu, x$ksppcv ksppcv, x$ksppi ksppi, 249 sys.deferred_stg$ ds 250 where o.owner# = u.user# 251 and o.obj# = t.obj# 252 and bitand(t.property, 1) = 0 253 and bitand(o.flags, 128) = 0 254 and t.bobj# = co.obj# (+) 255 and t.ts# = ts.ts# 256 and t.obj# = ds.obj# (+) 257 and t.file# = s.file# (+) 258 259 TEXT 260 -------------------------------------------------------------------------------- 261 and t.block# = s.block# (+) 262 and t.ts# = s.ts# (+) 263 and t.dataobj# = cx.obj# (+) 264 and cx.owner# = cu.user# (+) 265 and ksppi.indx = ksppcv.indx 266 and ksppi.ksppinm = '_dml_monitoring_enabled' 267 268 269 SQL> 270 SQL>
可以知道,DBA_TABLES这个数据字典视图从下面11个“表”获取数据:
sys.user$ u, sys.ts$ ts, sys.seg$ s, sys.obj$ co, sys.tab$ t, sys.obj$ o, sys.obj$ cx, sys.user$ cu, x$ksppcv ksppcv, x$ksppi ksppi, sys.deferred_stg$
其中9个是数据字典表,2个是内部表。
2. 再以动态视图v$process为例,看看动态视图的数据从哪里来?
1 SQL> 2 SQL> 3 SQL> select VIEW_DEFINITION from v$fixed_view_definition where VIEW_NAME = 'V$PROCESS'; 4 5 VIEW_DEFINITION 6 -------------------------------------------------------------------------------- 7 select addr, pid, spid, pname, username, serial#, terminal, program, traceid, tr 8 acefile, background, latchwait,latchspin,pga_used_mem,pga_alloc_mem,pga_freeable 9 _mem,pga_max_mem from gv$process where inst_id = USERENV('Instance') 10 11 12 SQL> select VIEW_DEFINITION from v$fixed_view_definition where VIEW_NAME = 'GV$PROCESS'; 13 14 VIEW_DEFINITION 15 -------------------------------------------------------------------------------- 16 select inst_id, addr, indx, ksuprpid, ksuprpname, ksuprunm, ksuprser, ksuprtid, 17 ksuprpnm, ksuprtfi, ksuprtfn, decode(bitand(ksuprflg,2),0,null,1), decode(ksllaw 18 at,hextoraw('00'),null,ksllawat), decode(ksllaspn,hextoraw('00'),null,ksllaspn), 19 ksuprpum,ksuprpnam+ksuprpram,ksuprpfm, case when ksuprpnam+ksuprpram > ksuprpmm 20 then ksuprpnam+ksuprpram else ksuprpmm end from x$ksupr where bita 21 nd(ksspaflg,1)!=0 22 23 24 SQL> 25 SQL>
可以知道,视图V$PROCESS的数据来自于视图GV$PROCESS;而GV$PROCESS的数据来自于下面1个表:
x$ksupr
数据库内部表。
1 SQL> 2 SQL> 3 SQL> select VIEW_DEFINITION from v$fixed_view_definition where VIEW_NAME = 'V$DATABASE'; 4 5 VIEW_DEFINITION 6 -------------------------------------------------------------------------------- 7 select DBID, NAME, CREATED, RESETLOGS_CHANGE#, RESETLOGS_TIME, PRIOR_RESETLOGS_ 8 CHANGE#, PRIOR_RESETLOGS_TIME,LOG_MODE, CHECKPOINT_CHANGE#, ARCHIVE_CHANGE#, CON 9 TROLFILE_TYPE, CONTROLFILE_CREATED, CONTROLFILE_SEQUENCE#, CONTROLFILE_CHANGE#, 10 CONTROLFILE_TIME, OPEN_RESETLOGS, VERSION_TIME, OPEN_MODE, PROTECTION_MODE, PROT 11 ECTION_LEVEL, REMOTE_ARCHIVE, ACTIVATION#, SWITCHOVER#, DATABASE_ROLE, ARCHIVELO 12 G_CHANGE#, ARCHIVELOG_COMPRESSION, SWITCHOVER_STATUS, DATAGUARD_BROKER, GUARD_ST 13 ATUS, SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA 14 _UI, FORCE_LOGGING, PLATFORM_ID, PLATFORM_NAME, RECOVERY_TARGET_INCARNATION#, LA 15 ST_OPEN_INCARNATION#, CURRENT_SCN, FLASHBACK_ON,SUPPLEMENTAL_LOG_DATA_FK, SUPPLE 16 MENTAL_LOG_DATA_ALL, DB_UNIQUE_NAME, STANDBY_BECAME_PRIMARY_SCN, FS_FAILOVER_STA 17 TUS, FS_FAILOVER_CURRENT_TARGET, FS_FAILOVER_THRESHOLD, FS_FAILOVER_OBSERVER_PRE 18 19 VIEW_DEFINITION 20 -------------------------------------------------------------------------------- 21 SENT, FS_FAILOVER_OBSERVER_HOST, CONTROLFILE_CONVERTED, PRIMARY_DB_UNIQUE_NAME, 22 SUPPLEMENTAL_LOG_DATA_PL, MIN_REQUIRED_CAPTURE_CHANGE# from GV$DATABASE where in 23 st_id = USERENV('Instance') 24 25 26 SQL> 27 SQL> 28 SQL> select VIEW_DEFINITION from v$fixed_view_definition where VIEW_NAME = 'GV$DATABASE'; 29 30 VIEW_DEFINITION 31 -------------------------------------------------------------------------------- 32 select di.inst_id,di.didbi,di.didbn,to_date(di.dicts,'MM/DD/RR HH24:MI:SS','NLS_ 33 CALENDAR=Gregorian'),to_number(di.dirls),to_date(di.dirlc,'MM/DD/RR HH24:MI:SS', 34 'NLS_CALENDAR=Gregorian'),to_number(di.diprs),to_date(di.diprc,'MM/DD/RR HH24:MI 35 :SS','NLS_CALENDAR=Gregorian'),decode(di.dimla,0,'NOARCHIVELOG',1,'ARCHIVELOG',' 36 MANUAL'),to_number(di.discn),to_number(di.difas),decode(bitand(di.diflg,256),256 37 ,'CREATED',decode(bitand(di.diflg,1024),1024,'STANDBY',decode(bitand(di.diflg,32 38 768),32768,'CLONE',decode(bitand(di.diflg,4096),4096,'BACKUP','CURRENT')))),to_d 39 ate(di.dicct,'MM/DD/RR HH24:MI:SS','NLS_CALENDAR=Gregorian'),di.dicsq,to_number( 40 di.dickp_scn),to_date(di.dickp_tim,'MM/DD/RR HH24:MI:SS','NLS_CALENDAR=Gregorian 41 '),decode(bitand(di.diflg,4),4,'REQUIRED',decode(di.diirs,0,'NOT ALLOWED','ALLOW 42 ED')),to_date(di.divts,'MM/DD/RR HH24:MI:SS','NLS_CALENDAR=Gregorian'),decode(di 43 44 VIEW_DEFINITION 45 -------------------------------------------------------------------------------- 46 .didor,0,'MOUNTED',decode(di.didor,1,'READ WRITE',decode(di.didor,2,'READ ONLY', 47 'READ ONLY WITH APPLY'))),decode(bitand(di.diflg,65536),65536,'MAXIMUM PROTECTI 48 ON',decode(bitand(di.diflg,128),128,'MAXIMUM AVAILABILITY',decode(bitand(di.difl 49 g,134217728),134217728,'RESYNCHRONIZATION',decode(bitand(di.diflg,8),8,'UNPROTEC 50 TED','MAXIMUM PERFORMANCE')))),decode(di.diprt,1,'MAXIMUM PROTECTION',2,'MAXIMUM 51 AVAILABILITY',3,'RESYNCHRONIZATION',4,'MAXIMUM PERFORMANCE',5,'UNPROTECTED', ' 52 UNKNOWN'),decode(di.dirae,0,'DISABLED',1,'SEND',2,'RECEIVE',3,'ENABLED','UNKNOWN 53 '),to_number(di.diacid),to_number(di.diacid),decode(bitand(di.difl2,32768),32768 54 ,'SNAPSHOT STANDBY',decode(bitand(di.diflg,33554432),33554432,'LOGICAL STANDBY', 55 decode(bitand(di.diflg,1024),1024,'PHYSICAL STANDBY','PRIMARY'))),to_number(di.d 56 iars),decode(bitand(difl2,1),1,'ENABLED','DISABLED'),decode(di.disos,0,'IMPOSSIB 57 58 VIEW_DEFINITION 59 -------------------------------------------------------------------------------- 60 LE',1,'NOT ALLOWED',2,'SWITCHOVER LATENT',3,'SWITCHOVER PENDING',4,'TO PRIMARY', 61 5,'TO STANDBY',6,'RECOVERY NEEDED',7,'SESSIONS ACTIVE',8,'PREPARING SWITCHOVER', 62 9,'PREPARING DICTIONARY',10,'TO LOGICAL STANDBY',11,'FAILED DESTINATION',12,'RES 63 OLVABLE GAP',13,'LOG SWITCH GAP',14,'UNRESOLVABLE GAP',NULL),decode(di.didgd,0,' 64 DISABLED','ENABLED'),decode(bitand(di.diflg,1048576),1048576,'ALL',decode(bitand 65 (di.diflg,2097152),2097152,'STANDBY','NONE')),decode(bitand(diflg,1073741824),10 66 73741824, 'YES', decode(bitand(diflg, 131072 + 262144 + 524288),0, 67 decode(bitand(difl2,2 + 64), 0,'NO','IMPLICIT'), 68 'IMPLICIT')),decode(bitand(di.diflg,131072),131072,'YES','NO'),decode 69 (bitand(di.diflg,262144),262144,'YES','NO'),decode(bitand(di.diflg,268435456),26 70 8435456,'YES','NO'),di.diplid, di.dipln, di2.di2rdi, di2.di2inc,to_number(di.dic 71 72 VIEW_DEFINITION 73 -------------------------------------------------------------------------------- 74 ur_scn),decode(bitand(di2.di2flag,1),1,'YES', decode(di2.di2rsp_ol 75 dest,0,'NO','RESTORE POINT ONLY')),decode(bitand(diflg,524288),524288,'YES','NO' 76 ),decode(bitand(difl2,2),2,'YES','NO'),di2.di2dbun, to_number(di2.di2actiscn), d 77 ecode(di.difsts,0,'DISABLED',1,'BYSTANDER',2,'SYNCHRONIZED',3,'UNSYNCHRONIZED',4 78 ,'SUSPENDED',5,'STALLED',6,'LOADING DICTIONARY',7,'PRIMARY UNOBSERVED',8,'REINST 79 ATE REQUIRED',10,'REINSTATE FAILED',11,'TARGET OVER LAG LIMIT',12,'TARGET UNDER 80 LAG LIMIT',''), di.diftgt, di.difths,decode(di.difopr,1,'YES',2,'NO',3,'UNKNOWN' 81 ,''), di.difobs, decode(bitand(difl2, 16384), 16384, 'YES', 'NO'), di2.di2pdbun, 82 decode(bitand(di.difl2,64), 64, 'YES', 'NO'), decode(di2.di2min_req_capture_scn 83 , 0, to_number(null), di2.di2min_req_capture_scn) from x$kccdi di, x$kcc 84 di2 di2 85 86 VIEW_DEFINITION 87 -------------------------------------------------------------------------------- 88 89 90 SQL> 91 SQL>
可以知道,视图V$DATABASE的数据来自于视图GV$DATABASE;而GV$DATABASE的数据来自于下面2个表:
x$kccdi di, x$kccdi2 di2
都是数据库内部表。