Oracle 19c Database creation using in Silent Mode on Linux 7

In this post I will show how to create database in oracle 19c using silent mode.

Usually we create database graphically by calling database creation utility known as DBCA.
But due to different reasons you may not have the possibility to install it graphically. So I will show how to create a database using DBCA in silent mode.

Before creating a database, the database binary should be installed.

Using the following link you can learn how to install oracle 19c database.

how to install Oracle 19c Software using Silent mode on Linux 7

To create database graphically you can follow the following link

Oracle Database 19c Installation On Oracle Linux 7 in graphical mode.

 

Step 1.

To create a database in silent mode, we will use a response file, however its not mandatory as we can pass all the arguments in command line to create database. A response file consists of different values which are basically required for database installation. The location of response file is $ORACLE_HOME/assistants/dbca

 

Add the following arguments response file . The arguments I have passed here as based on my requirement.

[oracle@gg1 bin]$ vi  $ORACLE_HOME/assistants/dbca/dbca.rsp

responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0

 gdbName=testdb ---> This defines global db name

 sid=testdb    --->  This defines the oracle SID 

 databaseConfigType=SI ---- > This defines the instance type i.e single instance or Rac instance

 createAsContainerDatabase=true ---> Choose true if you want to create a container database

 numberOfPDBs=2 --- > Defines no of pdbs would be created

 pdbName=testpdb --- > Defines pdb name

pdbAdminPassword=redhat ---> Defines password for pdb admininstrator user

templateName=/u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/templates/General_Purpose.dbc --- > Defines the template name would be used for database creation

 sysPassword=redhat --- > password for sys user

 systemPassword=redhat --- > password for system user

 datafileDestination=/u01/app/oracle/oradata ---- > Defines datafile location

  storageType=FS --- > Defines the storage type i.e. file system or ASM

 characterSet=AL32UTF8 --- > Defines character set

 nationalCharacterSet=AL16UTF16 --- > Defines national character set

 sampleSchema=TRUE --- > Defines if sample schemas would be created

 

 databaseType=MULTIPURPOSE --- >Defines database type whether   

  MULTIPURPOSE|DATA_WAREHOUSING|OLTP

 automaticMemoryManagement=TRUE --- > Defines if AMM is enabled

 totalMemory=1024 ---- > Defines total memory allocated for database

 


Step 2.

Begin installation

 

[oracle@gg1 bin]$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1

[oracle@gg1 bin]$ export PATH=$ORACLE_HOME/bin:$PATH

[oracle@gg1 bin cd $ORACLE_HOME/bin

 

[oracle@gg1 bin]$ dbca -silent -createDatabase -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/assistants/dbca/dbca.rsp

Prepare for db operation

8% complete

Copying database files

31% complete

Creating and starting Oracle instance

32% complete

36% complete

40% complete

43% complete

46% complete

Completing Database Creation

51% complete

53% complete

54% complete

Creating Pluggable Databases

58% complete

63% complete

77% complete

Executing Post Configuration Actions

100% complete

Database creation complete. For details check the logfiles at:

 /u01/app/oracle/cfgtoollogs/dbca/testdb.

Database Information:

Global Database Name:testdb

System Identifier(SID):testdb

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/testdb/testdb0.log" for further details.

 

 

Step 3.

Verify Installation

 

[oracle@gg1 bin]$ export ORACLE_SID=testdb

[oracle@gg1 bin]$ sqlplus / as sysdba

 

SQL> show con_name

 

CON_NAME

------------------------------

CDB$ROOT

 

SQL> select instance_name,open_mode,database_role from v$database,v$instance;

 

INSTANCE_NAME    OPEN_MODE            DATABASE_ROLE

---------------- -------------------- ----------------

testdb           READ WRITE           PRIMARY

 

SQL> show pdbs

 

    CON_ID CON_NAME             OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

         2 PDB$SEED                       READ ONLY  NO

         3 TESTPDB1                       READ WRITE NO

         4 TESTPDB2                       READ WRITE NO



So this concludes the database creation using silent mode in oracle 19c

No comments:

Post a Comment