[Home] [Help]
select d.rdbid, d.dbid, d.dbun,
decode (bitand(d.attributes, 16777456),
16, 'PRIMARY',
32, 'PHYSICAL',
64, 'LOGICAL',
128, 'SNAPSHOT',
16777216, 'FAR SYNC',
'UNKNOWN') role,
decode (bitand(d.attributes, 3840),
256, 'MOUNTED',
512, 'OPEN READ WRITE',
1024, 'OPEN READ ONLY',
2048, 'OPEN UPGRADE',
'UNKNOWN') open_mode,
decode (bitand(d.attributes, 1),
0, 'NO', 'YES') participant,
d.version,
decode (d.engine_status,
3, 'NOT APPLICABLE',
2, 'RUNNING',
1, 'STOPPED',
'UNKNOWN') engine_status,
decode (bitand(d.attributes, 8),
8, 'YES',
'NO') rac,
decode (bitand(d.attributes, 1572864),
1572864, 'FINISHED',
524288, 'STARTED',
0, 'NOT STARTED',
'UNKNOWN') update_progress,
decode (d.prod_rscn, 0, NULL, d.prod_rscn) prod_rscn,
decode (d.prod_rid, 0, NULL, d.prod_rid) prod_rid,
decode (d.prod_scn, 0, NULL, d.prod_scn) prod_scn,
decode (d.redo_source, 0, NULL, d2.dbun) redo_source,
decode (d.cons_rscn, 0, NULL, d.cons_rscn) cons_rscn,
decode (d.cons_rid, 0, NULL, d.cons_rid) cons_rid,
decode (d.cons_scn, 0, NULL, d.cons_scn) cons_scn,
d.update_time
from system.rolling$databases d, system.rolling$databases d2,
system.rolling$status s
where d.revision = d2.revision
and d.revision = s.revision
and (((d.redo_source > 0) and
(d.redo_source = d2.rdbid)) or
((d.redo_source = 0) and
(d.rdbid = d2.rdbid)))
order by d.revision, d.rdbid
SELECT D.RDBID
, D.DBID
, D.DBUN
,
DECODE (BITAND(D.ATTRIBUTES
, 16777456)
,
16
, 'PRIMARY'
,
32
, 'PHYSICAL'
,
64
, 'LOGICAL'
,
128
, 'SNAPSHOT'
,
16777216
, 'FAR SYNC'
,
'UNKNOWN') ROLE
,
DECODE (BITAND(D.ATTRIBUTES
, 3840)
,
256
, 'MOUNTED'
,
512
, 'OPEN READ WRITE'
,
1024
, 'OPEN READ ONLY'
,
2048
, 'OPEN UPGRADE'
,
'UNKNOWN') OPEN_MODE
,
DECODE (BITAND(D.ATTRIBUTES
, 1)
,
0
, 'NO'
, 'YES') PARTICIPANT
,
D.VERSION
,
DECODE (D.ENGINE_STATUS
,
3
, 'NOT APPLICABLE'
,
2
, 'RUNNING'
,
1
, 'STOPPED'
,
'UNKNOWN') ENGINE_STATUS
,
DECODE (BITAND(D.ATTRIBUTES
, 8)
,
8
, 'YES'
,
'NO') RAC
,
DECODE (BITAND(D.ATTRIBUTES
, 1572864)
,
1572864
, 'FINISHED'
,
524288
, 'STARTED'
,
0
, 'NOT STARTED'
,
'UNKNOWN') UPDATE_PROGRESS
,
DECODE (D.PROD_RSCN
, 0
, NULL
, D.PROD_RSCN) PROD_RSCN
,
DECODE (D.PROD_RID
, 0
, NULL
, D.PROD_RID) PROD_RID
,
DECODE (D.PROD_SCN
, 0
, NULL
, D.PROD_SCN) PROD_SCN
,
DECODE (D.REDO_SOURCE
, 0
, NULL
, D2.DBUN) REDO_SOURCE
,
DECODE (D.CONS_RSCN
, 0
, NULL
, D.CONS_RSCN) CONS_RSCN
,
DECODE (D.CONS_RID
, 0
, NULL
, D.CONS_RID) CONS_RID
,
DECODE (D.CONS_SCN
, 0
, NULL
, D.CONS_SCN) CONS_SCN
,
D.UPDATE_TIME
FROM SYSTEM.ROLLING$DATABASES D
, SYSTEM.ROLLING$DATABASES D2
,
SYSTEM.ROLLING$STATUS S
WHERE D.REVISION = D2.REVISION
AND D.REVISION = S.REVISION
AND (((D.REDO_SOURCE > 0) AND
(D.REDO_SOURCE = D2.RDBID)) OR
((D.REDO_SOURCE = 0) AND
(D.RDBID = D2.RDBID)))
ORDER BY D.REVISION
, D.RDBID
|
|
|
|