Your Data Guard environment has one physical standby database using Real-Time Query. Two sequences have been created by these SQL statements:
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. Which output will be seen for session 2?
Then session 2 connects to the physical standby database instance and issues the same SQL statements. Which output will be seen for session 2?
A)
B)
C)
In Oracle, a sequence created with the GLOBAL keyword is available and can produce values across all sessions and instances. However, a sequence created with the SESSION keyword is only specific to the session it was created in. When the NEXTVAL is called for a sequence, it will increment according to the sequence's properties set during its creation.
Given the sequence creation statements and the actions performed:
The a sequence is global, which means it is available across the entire database, including the standby database with Real-Time Query enabled. So, when session 2 calls a.nextval, it will get the next value in the sequence, which is 21 since session 1 already retrieved 1.
The b sequence is session-specific, so when session 2 calls b.nextval, it will get the value 1 because for this new session on the standby, this is the first time the sequence is being accessed.
Therefore, the output for session 2 will be a output as 21 and b output as 1, which corresponds to Option C.
Leonor
2 months agoAlecia
2 months agoTonette
1 months agoTonette
1 months agoTonette
1 months agoRory
2 months agoLucille
2 months agoDevora
1 months agoEna
1 months agoArt
2 months agoCristy
2 months agoWhitney
2 months agoArlen
1 months agoTegan
2 months agoEthan
2 months agoLeonor
3 months agoCarry
3 months agoFletcher
2 months agoGary
2 months agoJudy
2 months agoMilly
2 months ago