Sunday, November 30, 2014

Using DBCA to create CDB/PDB database in scripting manner

DBCA Script Generated by runInstaller:

/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca –silent -progress_only -createDatabase -templateName General_Purpose.dbc -createAsContainerDatabase true -pdbName pdb1 -numberOfPDBs 1 -sid cdborcl -gdbName cdborcl -emConfiguration DBEXPRESS -storageType FS -datafileDestination /u01/app/oracle/oradata -datafileJarLocation /u01/app/oracle/product/12.1.0/dbhome_1/assistants/dbca/templates -responseFile NO_VALUE -characterset WE8MSWIN1252 -obfuscatedPasswords false -sampleSchema true -automaticMemoryManagement true -totalMemory 1637 -maskPasswords false

Modified Version with “Silent” option:

/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -createAsContainerDatabase true -pdbName pdb1 -numberOfPDBs 1 -sid cdborcl -gdbName cdborcl -emConfiguration DBEXPRESS -storageType FS -datafileDestination /u01/app/oracle/oradata -datafileJarLocation /u01/app/oracle/product/12.1.0/dbhome_1/assistants/dbca/templates -responseFile NO_VALUE -characterset WE8MSWIN1252 -obfuscatedPasswords false -sampleSchema true -automaticMemoryManagement true -totalMemory 1637 -maskPasswords false

Output for Silent Option:

oracle@solaris:/u01/app/oracle/diag/rdbms/cdborcl/cdborcl/trace$
oracle@solaris:/u01/app/oracle/diag/rdbms/cdborcl/cdborcl/trace$ cd
oracle@solaris:~$ /u01/app/oracle/product/12.1.0/dbhome_1/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -createAsContainerDatabase true -pdbName pdb1 -numberOfPDBs 1 -sid cdborcl -gdbName cdborcl -emConfiguration DBEXPRESS -storageType FS -datafileDestination /u01/app/oracle/oradata -datafileJarLocation /u01/app/oracle/product/12.1.0/dbhome_1/assistants/dbca/templates -responseFile NO_VALUE -characterset WE8MSWIN1252 -obfuscatedPasswords false -sampleSchema true -automaticMemoryManagement true -totalMemory 1024 -maskPasswords false
Enter SYS user password:
password
Enter SYSTEM user password:
password
Enter PDBADMIN User Password:
password

Cleaning up failed steps
4% complete
Copying database files
5% complete
6% complete
12% complete
17% complete
22% complete
27% complete
30% complete
Creating and starting Oracle instance
32% complete
35% complete
36% complete
37% complete
41% complete
44% complete
45% complete
48% complete
Completing Database Creation
50% complete
53% complete
55% complete
63% complete
66% complete
74% complete
Creating Pluggable Databases
79% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdborcl/cdborcl0.log" for further details.
oracle@solaris:~$