Exam 1z0-083 All QuestionsBrowse all questions from this exam
Question 34

You are managing this configuration:

1. CDB1 is a container database.

2. PDB1 and PDB2 are two pluggable databases in CDB1.

3. USER1.EMP is a table in PDB1 and USER2.DEPT is a table in PDB2.

CDB1 user SYS executes these commands after connecting successfully to PDB2:

Which two are true? (Choose two.)

    Correct Answer: A, C

    In this scenario, the key point to understand is how transactions are handled across pluggable databases (PDBs) in a container database (CDB). When a transaction is started in one PDB, it cannot be committed or rolled back until it is resumed in the same PDB where it began. The execution of an ALTER SESSION SET CONTAINER command does not commit or rollback an ongoing transaction. Thus, the inserts on USER1.EMP remain uncommitted when the session is connected to PDB2, and any attempt to perform a DML operation in a different PDB while a transaction is active in the original PDB will fail due to the active transaction in the parent container. Therefore, the correct answers are: The inserts on USER1.EMP remain uncommitted when the session connected to PDB2, and the insert on USER2.DEPT fails because of the active transaction in the parent container.

Discussion
you1234Options: AC

other session to check any transaction Version 19.5.0.0.0 SQL> SQL> alter session set container=ELC20MIG; Session altered. SQL> select * from user1.emp; no rows selected correct answer is A & C

you1234Options: AC

tested in 19c. correct answer is A & C

veginhaOptions: AC

A and C are correct, i have tried myself in a development environment

AliNawabOptions: AC

Surely A & C sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Tue Sep 14 16:58:07 2021 Version 19.11.0.0.0 Copyright (c) 1982, 2020, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.11.0.0.0 SQL> ALTER SESSION SET CONTAINER=PDB1; Session altered. SQL> INSERT INTO USER1.EMP VALUES(100); 1 row created. SQL> INSERT INTO USER1.EMP VALUES(200); 1 row created. SQL> ALTER SESSION SET CONTAINER=PDB2; Session altered. SQL> INSERT INTO USER2.DEPT VALUES(300); INSERT INTO USER2.DEPT VALUES(300) * ERROR at line 1: ORA-65023: active transaction exists in container PDB1 SQL>

you1234Options: AC

SQL> alter session set container=ELC20MIG; Session altered. SQL> select * from user1.emp; no rows selected SQL> insert into user1.emp values(100); 1 row created. SQL> insert into user1.emp values(200); 1 row created. SQL> alter session set container=PDB2; Session altered. SQL> insert into user2.emp values(100); insert into user2.emp values(100) * ERROR at line 1: ORA-65023: active transaction exists in container ELC20MIG

ObserverPLOptions: AC

SQL> alter session set container=PDB1; Session altered. SQL> insert into emp values(1); 1 row created. SQL> alter session set container=PDB2; Session altered. SQL> insert into emp values(2); insert into emp values(2) * ERROR at line 1: ORA-65023: active transaction exists in container PDB1

gurettoOptions: AC

A C From MyOracleSupport note "Oracle Multitenant: Frequently Asked Questions (Doc ID 1511619.1)" Can a transaction span across PDBS ? No, though "alter session set container" is allowed after starting a transaction in a PDB, only select is allowed in the second PDB.Transaction is preserved and you can do commit or rollback after switch back to original PDB

ShunpinOptions: AC

SQL> alter session set container=ORCLPDB; Session altered. SQL> create table a (col1 varchar2(10)); Table created. SQL> insert into a values ('1'); 1 row created. SQL> alter session set container=APPCON1; Session altered. SQL> create table a (col1 varchar2(10)); create table a (col1 varchar2(10)) * ERROR at line 1: ORA-65023: active transaction exists in container ORCLPDB

kaka321Options: FG

I will go for GF. all ddl command when issued on a session automatically commit any existing dml on that same session. that makes G correct.

Guhborges

A and C 100%

kameniOptions: AC

A transaction cannot span multiple containers. If you start a transaction and use ALTER SESSION SET CONTAINER to switch to a different container, then you cannot issue DML, DDL, COMMIT, or ROLLBACK statements until you switch back to the container in which you started the transaction.

taotsumiau

G is correct....

GuhborgesOptions: AC

A C 100% Here my own test. SQL> insert into in1 values(1); 1 row created. SQL> alter session set container=pdb2; Session altered. SQL> insert into in2 values(2); insert into in2 values(2) * ERROR at line 1: ORA-65023: active transaction exists in container PDB1

ScottLOptions: AC

A and C

_gio_Options: AC

i think ac

vkraOptions: AC

A+C is correct

Neil107Options: AF

A and F. Refer to The 12c DBA Guide p. 399.

taotsumiauOptions: FG

GF are correct

veginha

how do you get this answers? i got different result in a test environment

taotsumiau

I setup the same environment setting in my VM. And follow the question's step to test. When I insert USER1.EMP at PDB1 without commit. Then connect to PDB2, and open another new session to select the data that I didn't commit. It shows the data. Then, I inserted data into PDB2 without commit. And select the PDB2's insert data from new session, that didn't show out the data from my query. That is all I did on my testing VM. How about you?

veginha

strange, i did exactly the same, and got different results: No commit in user1.emp after changing the session container, and got this error while doing the insert in pdb2: ERROR at line 1: ORA-65023: active transaction exists in container PDB1. Did you use sqlplus as client? do you think that the client configuration could be the reason to get different results?