nerdexam
Oracle

1Z0-083 · Question #275

Choose the best answer. Examine this configuration: 1. CDB1 is a container database. 2.DEFAULT_SHARING is METADATA. 3. APP_ROOT is an application root contained in CDB1. 4. APP_PDB1 is an…

The correct answer is D. It will return an error because EMP is not empty in APP_ROOT. Option D is correct because ALTER TABLE emp ADD (sal NUMBER NOT NULL) - recorded during the upgrade in APP_ROOT - is replayed against APP_PDB1 when SYNC executes. Oracle cannot add a NOT NULL column without a DEFAULT clause to a table that already contains rows; existing rows…

Multitenant Architecture

Question

Choose the best answer. Examine this configuration: 1. CDB1 is a container database. 2.DEFAULT_SHARING is METADATA. 3. APP_ROOT is an application root contained in CDB1. 4. APP_PDB1 is an application PDB contained in APP_ROOT. 5. COMPANYAPP is an application contained in APP_ROOT. 6. EMP is a common table created in APP_ROOT and all its application PDBs, created when version 1.0 of COMPANYAPP was installed. You execute these commands: $ sqlplus sys/ orac1e@localhost:1521/cdb1 as sysdba SQL> ALTER SYSTEM SET DEFAULT_SHARING=DATA; System altered. SQL> ALTER SESSION SET CONTAINER=app_root; Session altered. SQL> ALTER PLUGGABLE DATABASE APPLICATION companyapp BEGIN UPGRADE '1.0' TO '2.0'; pluggable database altered. SQL> ALTER TABLE emp ADD (sal NUMBER NOT NULL) ; Table altered. SQL> ALTER PLUGGABLE DATABASE APPLICATION companyapp END UPGRADE TO '2.0'; Pluggable database altered. SQL> ALTER SESSION SET CONTAINER=app_pdb1; Session altered. SQL> DESC emp; Name Null? Type -------- ------------------------------------------------------ENO NUMBER ENAME VARCHAR2 (20) SQL> SELECT * FROM emp; ENO ENAME ---------------------------------100 Alan 200 Ben SQL> ALTER PLUGGABLE DATABASE APPLICATION companyapp SYNC; What will be the outcome and why?

Options

  • ASAL will be added to APP_PDB1.EMP, with 0 in columns of existing rows.
  • BSAL will be added to APP_PDB1.EMP, with NULLs in columns of existing rows.
  • CIt will return an error because the SYNC operation is not allowed when constraints are added
  • DIt will return an error because EMP is not empty in APP_ROOT.
  • EIt will return an error because EMP.SAL is empty in APP_ROOT.

How the community answered

(62 responses)
  • A
    8% (5)
  • B
    3% (2)
  • C
    3% (2)
  • D
    69% (43)
  • E
    16% (10)

Explanation

Option D is correct because ALTER TABLE emp ADD (sal NUMBER NOT NULL) - recorded during the upgrade in APP_ROOT - is replayed against APP_PDB1 when SYNC executes. Oracle cannot add a NOT NULL column without a DEFAULT clause to a table that already contains rows; existing rows would have no valid value for SAL, violating the constraint, so the SYNC operation raises an error.

Why the distractors fail:

  • A & B are impossible: Oracle never silently fabricates zeros or permits NULLs for a NOT NULL column - both scenarios directly violate the constraint definition.
  • C is wrong: SYNC does not generically prohibit DDL that adds constraints; the failure is data-driven, not constraint-type-driven.
  • E is wrong: the column SAL doesn't yet exist in APP_PDB1 before SYNC, so "SAL is empty in APP_ROOT" is meaningless - the blocking issue is the existing row data, not a missing column value.

Memory tip: When writing upgrade scripts for Application Containers, treat NOT NULL ADD like a loaded gun - it only fires safely on an empty table. Always pair NOT NULL with a DEFAULT value when existing rows may be present: ADD (sal NUMBER DEFAULT 0 NOT NULL).

Topics

#Application Containers#Application Upgrade/Sync#Table Constraints#Multitenant Architecture

Community Discussion

No community discussion yet for this question.

Full 1Z0-083 Practice