Your Data Guard environment has one physical standby database using Real-Time Query.
Two sentences have been created by these SQL statements:
create sequence a global;
create sequence b session;
Neither sequence has been used since being created.
Session 1 connects to the primary database instance and issues these two SQL statements:
SELECT a.nextval FROM DUAL;
SELECT b.nextval FROM DUAL;
Then session 2 connects to the physical standby database instance and issues the same SQL statements.
What output will be seen for session 2?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
Correct Ans: A (21,1)
Explanation:
Global sequences: Created by the primary database with the default CACHE and NOORDER options can be accessed from standby databases as well. When a standby database accesses such a sequence for the first time, it requests that the primary database allocate a range of sequence numbers. The range is based on the cache size and other sequence properties specified when the sequence was created. Then the primary database allocates those sequence numbers to the requesting standby database by adjusting the corresponding sequence entry in the data dictionary. When the standby has used all numbers in the range, it requests another range of numbers.
Here the global sequence was created without specifying any CACHE value so it defaults to 20. It was already queried in primary so when you access at the standby it gets next range 21-40. SELECT a.nextval FROM DUAL; –> 21
Session sequences: Returns a unique range or sequence numbers only within a session, not across sessions and CACHE and NOORDER options are not relevant and ignored. Since it is a session sequence SELECT b.nextval FROM DUAL; –> 1
A