Showing posts with label dbca. Show all posts
Showing posts with label dbca. Show all posts

Thursday, May 21, 2020

DBCA Reports ORA-46385 When Oracle Home Has Unified Auditing Enabled

Running dbca in silent mode reports ORA-46385 if the Oracle home has unified auditing is enabled. Below is the output on the shell prompt (only relevant section of the output is shown). This was on 19c.
Creating data dictionary views
33% complete
38% complete
39% complete
40% complete
[WARNING] ORA-46385: DML and DDL operations are not allowed on table

41% complete
46% complete
49% complete
52% complete
57% complete
Oracle Text
Trace files shows the same.
[Thread-242] [ 2020-02-06 12:23:53.087 UTC ] [BasicStep.handleNonIgnorableError:541]  oracle.sysman.assistants.util.SilentMessageHandler@3a6532cd:messageHandler
[Thread-242] [ 2020-02-06 12:23:53.087 UTC ] [BasicStep.handleNonIgnorableError:542]  ORA-46385: DML and DDL operations are not allowed on table
:msg
WARNING: Feb 06, 2020 12:23:53 PM oracle.assistants.common.base.util.AssistantAdvisor logMessage
WARNING: [ 2020-02-06 12:23:53.088 UTC ] [WARNING] ORA-46385: DML and DDL operations are not allowed on table


The dbca can run till the end despite the error. However, if a clean error free installation is preferred then turn off the unified auditing on the Oracle home before running dbca. There's no error in this case (output shown around same % mark where error happened before). Enable unified auditing once database is created.
Creating data dictionary views
33% complete
38% complete
39% complete
40% complete
41% complete
46% complete
49% complete
52% complete
57% complete
Oracle Text

Thursday, November 8, 2018

DBCA Templates and PDBs - 12.1, 12.2 and 18c

This post looks the option of creating a database using a template, where the template was created from a CDB containing a PDB. During the testing it was observed that 12.1, 12.2 and 18c behaves differently.
The following steps were done on databases of all three versions. Two additional tablespaces were created in the root container (called ROOTBS) and in the PBD (called TEST).
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBONE                         READ WRITE NO

    CON_ID NAME
---------- -------
         1 USERS
         1 ROOTBS
         1 SYSAUX
         1 SYSTEM
         1 UNDOTBS1
         1 TEMP
         2 SYSAUX
         2 SYSTEM
         2 TEMP
         3 SYSAUX
         3 TEMP
         3 TEST
         3 SYSTEM
The basic template creation steps are shown below (for 12.1 only).



Creating CDB Using Template in 12.1
Select the template created earlier during the create database using DBCA. The show details button will give a detail list of tablespace included in the template. In this case it shows the two tablespaces created earlier.
Summary page also list the tablespaces.
During the DB creation process following error is shown but DBCA is able to run to completion.
At the end of the CDB creation, the newly created CDB will have a PDB, with the same name as the PDB where the template was created from.
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBONE                         READ WRITE NO
The new CDB will also have the both root container level tablespace and PDB level tablespace.

SQL> select con_id,name from v$tablespace order by 1;

    CON_ID NAME
---------- ------------------------------
         1 ROOTBS
         1 USERS
         1 SYSAUX
         1 SYSTEM
         1 UNDOTBS1
         1 TEMP
         2 SYSAUX
         2 SYSTEM
         2 TEMP
         3 SYSTEM
         3 SYSAUX
         3 TEMP
         3 TEST

Creating CDB Using Template in 12.2
Similar to 12.1 a template was created on 12.2 DB. Additional tablespace created for root container and on PDB.
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 DEVPDB                         READ WRITE NO

SQL>  select con_id,name from v$tablespace order by 1;

    CON_ID NAME
---------- ------------------------------
         1 USERS
         1 SYSAUX
         1 TEMP
         1 SYSTEM
         1 UNDOTBS1
         1 ROOTBS
         2 TEMP
         2 UNDOTBS1
         2 SYSAUX
         2 SYSTEM
         3 SYSAUX
         3 UNDOTBS1
         3 TEMP
         3 USERS
         3 ASANGA
         3 SYSTEM
The DB creation was done using the template.
The summary page also list the additional tablespaces.
However due to existing issue (tracked under bug 26921308) DB creation fails.



Creating CDB Using Template in 18c
The 18c database had following additional tablespaces for root container and PDB.
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 DOCKLAND                       READ WRITE NO

SQL> select con_id,name from v$tablespace order by 1;

    CON_ID NAME
---------- ------------------------------
         1 USERS
         1 SYSAUX
         1 TEMP
         1 SYSTEM
         1 UNDOTBS1
         1 ROOTBS
         2 TEMP
         2 UNDOTBS1
         2 SYSAUX
         2 SYSTEM
         3 SYSAUX
         3 UNDOTBS1
         3 TEMP
         3 USERS
         3 ASANGA
         3 SYSTEM
The Database was created using the template which showed the tablespaces for PDB as well.
However, the newly created CDB didn't have any new PDBs. But it had a the root container tablespaces which was listed on the template.
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO

SQL> select con_id,name from v$tablespace order by 1;

    CON_ID NAME
---------- ------------------------------
         1 SYSTEM
         1 UNDOTBS1
         1 ROOTBS
         1 TEMP
         1 USERS
         1 SYSAUX
         2 TEMP
         2 SYSAUX
         2 UNDOTBS1
         2 SYSTEM
This shows that DBCA templates for CDB and for PDBs other methods such as cloning or transporting must be used.

Related Metalink Notes
Can PDB Templates be Created in DBCA? [ID 2128673.1]
12.2 Dbca: Custom Template Doesn't Work As Expected With Cdb Option [ID 2283829.1]
ORA-65101 Wrong option for CDB parameter in a Template which created by DBCA with silent mode [ID 2270420.1]
12.2 DBCA TEMPLATE NOT SAVE SETTING FOR "INCLUDE IN PDBS" OF "DATABASE OPTIONS" [ID 2274760.1]

Sunday, April 1, 2018

DBCA With Silent Option Fails on CDB when Oracle Text Option is Present

Creating a database using a dbca -silent option fails on a CDB when Oracle text option is present. Following commands tries to create a CDB using a template. The DB the template was created from had the following componetns
COMP_ID    COMP_NAME                                STATUS
---------- ---------------------------------------- ----------
CATALOG    Oracle Database Catalog Views            VALID
CATPROC    Oracle Database Packages and Types       VALID
RAC        Oracle Real Application Clusters         OPTION OFF
XDB        Oracle XML Database                      VALID
OWM        Oracle Workspace Manager                 VALID
CONTEXT    Oracle Text                              VALID
However at the point of running Oracle text related SQL scripts the database creation fails.
dbca -silent -createDatabase -templateName /home/oracle/CDB_template.dbt -gdbName testcdb -sid testcdb -sysPassword testcdb -systemPassword testcdb -pdbAdminPassword testcdb -emConfiguration DBEXPRESS -storageType FS -datafileDestination  /opt/app/oracle/oradata  -recoveryAreaDestination /opt/app/oracle/fast_recovery_area
Creating and starting Oracle instance
1% complete
2% complete
6% complete
Creating database files
7% complete
13% complete
Creating data dictionary views
15% complete
19% complete
23% complete
25% complete
27% complete
29% complete
33% complete
Adding Oracle Text
34% complete
ERROR :java.io.IOException: Error while executing "/opt/app/oracle/product/12.2.0/dbhome_1/ctx/admin/catctx.sql". Refer to "/opt/app/oracle/cfgtoollogs/dbca/testcdb/catctx0.log" for more details. Error in Process: /opt/app/oracle/product/12.2.0/dbhome_1/perl/bin/perl
DBCA Operation failed.
Look at the log file "/opt/app/oracle/cfgtoollogs/dbca/testcdb/testcdb.log" for further details.
There's no information on the catctx0.log (it's empty).
If the same command was run without the -silent option (this would run the GUI but most of the fields will be populated by the template info) the database creation succeeds. Following suceeds
dbca -createDatabase -templateName /home/oracle/CDB_template.dbt -gdbName testcdb -sid testcdb -sysPassword testcdb -systemPassword testcdb -pdbAdminPassword testcdb -emConfiguration DBEXPRESS -storageType FS -datafileDestination /opt/app/oracle/oradata -recoveryAreaDestination /opt/app/oracle/fast_recovery_area 
Only different between the two commands is -silent option.



The issue is not present when dbca -silent is run to create a non-CDB database. It appears to be a combination of CDB and presence of Oracle text is causing the issue.
Oracle confirmed this is related to bug 26921308 (Bug ID Doc 27554155) and fixed in 18.1. At the time of the post a backport for 12.2 is being created.

Update on 2018-11-28
The backport of the patch for bug 26921308 did not resolve the issue. Even after applying it, dbca kept on failing same as before. SR was closed pointing to bug 26003431 which was fixed on 18.1 but no backport available for 12.2. Only option is to upgrade to 18c.