Database Reference
In-Depth Information
NEXTVAL
----------
1
...
REM selecting couple of times from this sequence from two nodes to bump up the value to 9
REM Note: Not all SELECT statements are printed for brevity.
SQL> select t1_seq.nextval from dual;
NEXTVAL
----------
9
Resources created in GRD for sequences with CACHE ORDER attributes uses the familiar naming pattern discussed
earlier in this chapter. Object_id of the sequence and SV lock type is used to fabricate a resource name. 5 In this example,
resource_name is [0xb6e64b][0x0],[SV] ; the first part of the string, 0xb6e64b , is object_id of the sequence in hexadecimal
format; the second part of the string is set to 0 (not applicable to SV resource types); and the third part of the string is SV,
indicating the resource type. The following query shows the SV resource_name for the T1_SEQ sequence.
REM query gv$ges_resource to identify the resource name.
col res new_value resource_name
SELECT DISTINCT '[0x'
||trim(TO_CHAR(object_id, 'xxxxxxxx'))
||'][0x'
|| trim(TO_CHAR(0,'xxxx'))
|| '],[SV]' res
FROM dba_objects WHERE object_name=upper('&objname')
AND owner=upper('&owner') AND object_type LIKE 'SEQUENCE%'
/
Objname: T1_SEQ
Owner: RS
RES
---------------------------
[0xb6e64b][0x0],[SV]
In Listing 11-8, view gv$ges_resource is queried to identify the resources in GRD. Column value of value_blk
is of special interest. Column value_blk of the resource holds the current value of the sequence; in this example,
notice that the first few bytes of the value_blk are set to 0x82c10b . The second part of that value is c10b , which is the
internal representation of value 10. Essentially, value_blk column of SV resource holds current sequence value.
Listing 11-8. Sequence Value and SV Resource
REM Using the derived resource_name, identify all GES resources.
col master_node head 'Mast|node' format 99
col value_blk format a30
SQL> SELECT inst_id, resource_name, master_node, value_blk
FROM gv$ges_resource WHERE resource_name LIKE '&resource_name%'
/
5 In 12c, PDB container_id is also coded in to the resource name.
 
Search WWH ::




Custom Search