DBCA creates and configures a database. Post-creation checks tell you which database you are connected to, the state of its containers, how undo is organized, whether required components have valid registry status, and whether the application can use its intended connection and objects.
Oracle DBA Lesson 24 Part 3 — Verify the Database Created by DBCA
Catalog access, container switching, and the application service
An administrator needs catalog and dynamic-view access in the relevant containers. Container switching requires an appropriately privileged common administrative account. The application account must exist with CREATE SESSION and the required object access. Its user-defined service must already be running, associated with APP_PDB, and reachable through the listener. DBCA creating a PDB does not itself establish a complete application workload and service setup.
Establish the current container and database identity
In the administrative SQL*Plus session:
SHOW CON_NAME
SELECT name, cdb, open_mode FROM v$database;
Begin these database-wide checks in CDB$ROOT. SHOW CON_NAME describes the current session container. NAME identifies the database. CDB=YES indicates container architecture. READ WRITE indicates the database is open for reads and writes. Example result: APP / YES / READ WRITE. See V$DATABASE and SQL*Plus SHOW.
Inspect each pluggable database
SELECT name, open_mode, restricted FROM v$pdbs ORDER BY con_id;
Root inspection shows the relevant PDB rows. PDB$SEED normally appears READ ONLY. It supplies the template used to create new PDBs. APP_PDB=READ WRITE permits normal data changes. If a PDB is MOUNTED, it is closed for normal application use. RESTRICTED=YES requires RESTRICTED SESSION. NO means that restriction is absent. Opening mode and connection availability are distinct checks. This part verifies state. See V$PDBS.
Understand local undo
Undo retains prior data used for rollback and consistent queries. Local mode gives each container its own undo tablespace. Tablespace content is stored in physical data files on disk. This is the persistent organization. It is not a claim that every new undo change is instantly written to disk.
From the root:
SELECT property_value FROM database_properties
WHERE property_name = 'LOCAL_UNDO_ENABLED';
TRUE establishes local undo mode for the CDB. Capacity and retention require a separate workload assessment. See CDB undo modes and Managing Undo.
Check required components in each relevant container
SELECT comp_id, version, status FROM dba_registry ORDER BY comp_id;
The registry tracks loaded database components, their versions, and status. CATALOG (catalog views) and CATPROC (database packages) are two core entries shown in the video. They are a subset, not a universal component list. VALID is a validated component state. Investigate required INVALID entries using the actual errors and creation logs. Registry status and version alone do not replace object-level diagnosis, or release-update and SQL-patch checks, when those are required.
Use an administrative session to inspect the application PDB:
ALTER SESSION SET CONTAINER = APP_PDB;
SHOW CON_NAME
SELECT comp_id, version, status FROM dba_registry ORDER BY comp_id;
This changes the session's current container. It does not move database data. Review the required installed components in that scope, and return the administrative session to root afterward if needed:
ALTER SESSION SET CONTAINER = CDB$ROOT;
See DBA_REGISTRY and container-scoped information.
Test application access through its service
Use a separate application connection, with a user-defined application service:
CONNECT app_user@//dbhost:1521/appsvc.example.com
SHOW USER
SHOW CON_NAME
Enter the account password when prompted. Host and port locate the listener. A service associated with APP_PDB places the connected session in that PDB. Oracle recommends user-defined services for applications. The default PDB service is intended for administration. SHOW USER establishes the login identity, and SHOW CON_NAME establishes the destination container. See connecting to PDBs and managing services.
Then query a small existing application object that this account should access, for example:
SELECT order_id FROM orders WHERE ROWNUM <= 1;
Use the actual schema qualifier when needed. A successful query can return zero rows. An error such as a missing or inaccessible object needs investigation. Success verifies query access under this account. Full application functionality and workload performance require their own tests. Keep the DBCA and database alert logs to investigate creation and startup errors.
Recap
Post-creation checks confirm which database you are connected to, the state of its containers, how undo is organized, whether required components are valid, and whether the application can use its intended connection and objects. In CDB$ROOT, SHOW CON_NAME names the session container, and V$DATABASE reports NAME, CDB, and open mode. The example result is APP / YES / READ WRITE. V$PDBS shows each PDB open mode and restriction. PDB$SEED is normally READ ONLY, and it supplies the template for new PDBs. APP_PDB=READ WRITE permits normal data changes. MOUNTED means the PDB is closed for normal application use, and RESTRICTED=YES requires RESTRICTED SESSION. Opening mode and connection availability are separate checks. LOCAL_UNDO_ENABLED=TRUE establishes local undo mode: each container has its own undo tablespace, stored in physical data files. Capacity and retention still need a separate assessment. DBA_REGISTRY lists component id, version, and status. CATALOG and CATPROC are two core entries, not a complete list, and VALID is a validated state. Repeat the registry query in APP_PDB, because the current container determines the metadata being inspected, then return the administrative session to CDB$ROOT if needed. Connect the application account through its user-defined service, confirm SHOW USER and SHOW CON_NAME, and query an existing object such as ORDERS. A successful query can return zero rows.
No comments:
Post a Comment