Category Archives: dbca

Create PDB in silent mode

In Oracle 12c RDBMS you can use the Database Configuration Assistant to create a PDB from shell scripts or command line in an existing CDB.    You can provide all of the necessary parameters for the PDB creation through a response file or at the command prompt.   In this example we will provide all required command line option to create new PDB called pdb1 in the CDB1 container.

 

  1. Logon to your Oracle server as the Oracle software owner.

 

[root@linux2 ~]# su – oracle

Last login: Wed Oct  5 15:10:16 EDT 2016 on pts/2

[oracle@linux2 ~]$

 

  1. Define the following parameter with values:
    1. -sourceDB = the name of the CDB database you wish to create your PDB in.
    2. -pdbName = the name of the new PDB database.
    3. -pdbAdminPassword = password for the PDB admin user.

 

  1. You will have to also supply the tags: –silent and  -createPluggableDatabase

 

  1. Update the below DBCA command with the values defined in step 2.

 

dbca -silent -createPluggableDatabase -sourceDB cdb1 -pdbName pdb1 -pdbAdminPassword password

 

  1. Example execution.

 

[oracle@linux2 admin]$ dbca -silent -createPluggableDatabase -sourceDB cdb1 -pdbName pdb1 -pdbAdminPassword password

Creating Pluggable Database

4% complete                                                                                                                                         

12% complete

21% complete

38% complete

85% complete

Completing Pluggable Database Creation

100% complete

Look at the log file “/opt/app/oracle/cfgtoollogs/dbca/cdb1/pdb1/cdb1.log” for further details.

[oracle@linux2 admin]$

 

  1. View the status of the listener process to validate that the new PDB has been picked up by the listener with the command: lsnrctl status

 

[oracle@linux2 admin]$ lsnrctl status

 

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 20-OCT-2016 10:21:44

 

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 – Production

Start Date                19-OCT-2016 14:06:54

Uptime                    0 days 20 hr. 14 min. 50 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Listener Log File         /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening Endpoints Summary…

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

Services Summary…

Service “cdb1” has 2 instance(s).

  Instance “cdb1”, status UNKNOWN, has 1 handler(s) for this service…

  Instance “cdb1”, status READY, has 1 handler(s) for this service…

Service “cdb1XDB” has 1 instance(s).

  Instance “cdb1”, status READY, has 1 handler(s) for this service…

Service “pdb1” has 1 instance(s).

  Instance “cdb1”, status READY, has 1 handler(s) for this service…

The command completed successfully

[oracle@linux2 admin]$

 

 

  1. Update the tnsnames.ora file with the reference to newly created PDB1 with the command:

 

echo -e “PDB1 =\n” \

”  (DESCRIPTION =\n” \

”    (ADDRESS_LIST =\n” \

”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

”    )\n” \

”    (CONNECT_DATA =\n” \

”      (SERVER = DEDICATED)\n”  \

”      (SERVICE_NAME = pdb1)\n” \

”    )\n” \

”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora

 

Example execution:

 

[oracle@linux2 admin]$ echo -e “PDB1 =\n” \

> ”  (DESCRIPTION =\n” \

> ”    (ADDRESS_LIST =\n” \

> ”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

> ”    )\n” \

> ”    (CONNECT_DATA =\n” \

”      (SERVER = DEDICATED)\n”  \

”      (SERVICE_NAME = pdb1)\n” \

”    )\n” \

”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora> ”      (SERVER = DEDICATED)\n”  \

> ”      (SERVICE_NAME = pdb1)\n” \

> ”    )\n” \

> ”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora

[oracle@linux2 admin]$

 

 

  1. Test connection to new PDB with the command: tnsping pdb1

 

[oracle@linux2 admin]$ tnsping pdb1

 

TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 20-OCT-2016 10:32:32

 

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

 

Used parameter files:

 

 

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb1)))

OK (0 msec)

[oracle@linux2 admin]$

 

 

  1. This completes the creation of new PDB in silent mode.

 

Larry Catt

OCP

Create non-CDB database in Oracle 12c

The multitenant database in Oracle 12c is an option that provides for a single instance supporting multiple database all sharing the same Oracle resources.  The default database creation is still a standard single instance and single database, outside of a RAC configuration.    This procedure demonstrates creation of a non-CDB database from command prompt of a Linux platform.   In this procedure, you must already have the Oracle binary software installed.

 

 

  1. Logon to your oracle server as the oracle software owner.

 

[root@linux2 ~]# su – oracle

Last login: Wed Nov  7 08:45:50 EST 2016 on pts/0

[oracle@linux2 ~]$

 

  1. View the system parameters for oracle binaries to include: ORACLE_HOME and PATH.

 

[oracle@linux2 ~]$ echo $ORACLE_HOME

/opt/app/oracle/product/12.1.0.2/db_1

[oracle@linux2 ~]$ echo $PATH

/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/oracle/.local/bin:/home/oracle/bin:/opt/app/oracle/product/12.1.0.2/db_1/bin:/opt/app/oracle/product/12.1.0.2/db_1/bin

[oracle@linux2 ~]$

 

  1. Set a new ORACLE_SID value for creation of new database.

 

[oracle@linux2 ~]$ export ORACLE_SID=orcl

[oracle@linux2 ~]$ echo $ORACLE_SID

orcl

[oracle@linux2 ~]$

 

  1. Create a database named for ORACLE_SID defined above using the dbca utility. You must define the following:

-silent – prevents opening of DBCA GUI and performs.

–createDatabase – create a database

-ignorePreReqs – ignore prerequisite checks

-templateName General_Purpose.dbc  – General Purpose database

-gdbName orcl – Global DB Name

-sid orcl – Instance Name

-sysPassword password – Password for SYS user

-systemPassword password – Password for SYSTEM user

-emConfiguration NONE – Configure EM Express

-datafileDestination /u01/oradata/orcl – Location of datafiles, does not need to exist

-redoLogFileSize 10 – Size of redo logs in megabytes

-recoveryAreaDestination NONE – Configure recovery area.

-storageType FS – Type of storage

-memoryPercentage 40 – Amount of memory for instance.

 

 

 

dbca -silent -createDatabase -ignorePreReqs -templateName General_Purpose.dbc -gdbName orcl -sid orcl -sysPassword password -systemPassword password \

-emConfiguration NONE -datafileDestination /u01/oradata/orcl -redoLogFileSize 10 \

-recoveryAreaDestination NONE -storageType FS -memoryPercentage 40

 

[oracle@linux2 db_1]$ dbca -silent -createDatabase -ignorePreReqs -templateName                           General_Purpose.dbc -gdbName orcl -sid orcl -sysPassword password -systemPasswor                          d password \

> -emConfiguration NONE -datafileDestination /u01/oradata/orcl -redoLogFileSize                           10 \

> -recoveryAreaDestination NONE -storageType FS -memoryPercentage 40

Copying database files

1% complete

3% complete

11% complete

18% complete

26% complete

33% complete

37% complete

Creating and starting Oracle instance

40% complete

45% complete

50% complete

55% complete

56% complete

60% complete

62% complete

Completing Database Creation

66% complete

70% complete

73% complete

85% complete

96% complete

100% complete

Look at the log file “/opt/app/oracle/cfgtoollogs/dbca/orcl/orcl.log” for further details.

[oracle@linux2 db_1]$

 

  1. Network configuration should have been complete by the DBCA tool.
  2. Now from the command prompt, use the tnsping command to check connection with command: tnsping orcl.

 

[oracle@linux2 admin]$ tnsping orcl

 

TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 07-NOV-2016 10:07:56

 

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

 

Used parameter files:

 

 

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.96)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))

OK (0 msec)

[oracle@linux2 admin]$

 

  1. Connect to the newly created database as the sysdba user.

 

[oracle@linux2 admin]$ sqlplus sys/password@orcl as sysdba

 

SQL*Plus: Release 12.1.0.2.0 Production on Wed Nov 7 10:08:40 2016

 

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

 

 

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

 

SQL>

 

 

  1. This completes creation of a non-CDB in Oracle 12c

 

Larry Catt

Create CDB in silent mode

In Oracle 12c RDBMS you can use the Database Configuration Assistant to create a CDB from shell scripts or command line.    You can provide all of the necessary parameters for the CDB creation through a response file or at the command prompt.   In this example we will provide all required command line option to create new CDB called cdb1.

 

  1. Logon to your Oracle server as the Oracle software owner.

 

[root@linux2 ~]# su – oracle

Last login: Wed Oct  5 15:10:16 EDT 2016 on pts/2

[oracle@linux2 ~]$

 

  1. Define the following parameter with values:
    1. -gdbName = the name of the database you wish to create.
    2. -sid = the SID you wish to use for the database.
    3. -SysPassword = password for the SYS user.
    4. -SystemPassword = password for the SYSTEM user.
    5. -datafileDestination = location of the data file storage.
    6. -storageType = type of storage used for files.
    7. -characterSet = character set of database.

 

  1. You will have to also supply the tags for –silent option, -createDatabase, -templateName, and –createAsContainerDatabase.

 

  1. Update the below DBCA command with the values defined in step 2.

 

  dbca -silent \

 -createDatabase -templateName General_Purpose.dbc \

 -gdbName <db name>  -sid <SID name> \

 -createAsContainerDatabase true \

 -SysPassword <SYS Password> -SystemPassword <SYSTEM Password> \

 -datafileDestination <Directory Name> \

 -storageType <Type of storage> -characterSet <Character Set>

 

  1. Example execution.

 

[oracle@linux2 database]$ dbca -silent \

>  -createDatabase -templateName General_Purpose.dbc \

>  -gdbName cdb1  -sid cdb1 \

>  -createAsContainerDatabase true \

>  -SysPassword password12 -SystemPassword password12 \

>  -datafileDestination /u01/oradata \

>  -storageType FS -characterSet AL32UTF8

Copying database files

1% complete

3% complete

11% complete

18% complete

26% complete

33% complete

37% complete

Creating and starting Oracle instance

40% complete

45% complete

46% complete

47% complete

52% complete

57% complete

58% complete

59% complete

62% complete

Completing Database Creation

66% complete

70% complete

74% complete

85% complete

96% complete

100% complete

Look at the log file “/opt/app/oracle/cfgtoollogs/dbca/cdb1/cdb1.log” for further details.

[oracle@linux2 database]$

 

  1. NOTE: The following step should only be used if your system only has one SID and ORACLE_HOME.   Update profile with the ORACLE_HOME and ORACLE_SID environmental variables.  Add the ORACLE_HOME/bin path to your PATH variable.   You can use the following two statements update the .bash_profile file located in your oracle software owner’s home file.

 

egrep -E -v ‘^(#)’ /etc/oratab | awk /./ | awk -F: ‘{print “export ORACLE_HOME=”$2″”}’ >> ~/.bash_profile

 

egrep -E -v ‘^(#)’ /etc/oratab | awk /./ | awk -F: ‘{print “export ORACLE_SID=”$1″”}’ >> ~/.bash_profile

 

echo “export PATH=$PATH:$ORACLE_HOME/bin” >> ~/.bash_profile

 

[oracle@linux2 app]$ egrep -E -v ‘^(#)’ /etc/oratab | awk /./ | awk -F: ‘{print “export ORACLE_SID=”$1″”}’ >> ~/.bash_profile

[oracle@linux2 app]$

[oracle@linux2 app]$ echo “export PATH=$PATH:$ORACLE_HOME/bin” >> ~/.bash_profile

[oracle@linux2 app]$

[oracle@linux2 app]$ cat ~/.bash_profile

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/.local/bin:$HOME/bin

 

export PATH

export ORACLE_HOME=/opt/app/oracle/product/12.1.0.2/db_1

export ORACLE_SID=cdb1

export PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/oracle/.local/bin:/home/oracle/bin:/opt/app/oracle/product/12.1.0.2/db_1/bin:/opt/app/oracle/product/12.1.0.2/db_1/bin

[oracle@linux2 app]$

 

  1. Now re-execute the .bash_profile file to update environmental variables with the command: . ~/.bash_profile

 

[oracle@linux2 app]$ . ~/.bash_profile

[oracle@linux2 app]$

 

  1. Verify that the variables have been updating by echo the environmental variables of $ORACLE_HOME, $ORACLE_SID, $PATH.

 

[oracle@linux2 app]$ echo $ORACLE_HOME

/opt/app/oracle/product/12.1.0.2/db_1

[oracle@linux2 app]$ echo $ORACLE_SID

cdb1

[oracle@linux2 app]$ echo $PATH

/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/oracle/.local/bin:/home/oracle/bin:/opt/app/oracle/product/12.1.0.2/db_1/bin:/opt/app/oracle/product/12.1.0.2/db_1/bin

[oracle@linux2 app]$

 

  1. Create the file tnsnames.ora with the following statement:

 

echo -e “CDB1 =\n” \

”  (DESCRIPTION =\n” \

”    (ADDRESS_LIST =\n” \

”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

”    )\n” \

”    (CONNECT_DATA =\n” \

”      (SERVER = DEDICATED)\n”  \

”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

”      (SID = “$ORACLE_SID”)\n” \

”    )\n” \

”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora

Execution Example:

 

[oracle@linux2 admin]$ echo -e “CDB1 =\n” \

> ”  (DESCRIPTION =\n” \

> ”    (ADDRESS_LIST =\n” \

> ”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

> ”    )\n” \

> ”    (CONNECT_DATA =\n” \

> ”      (SERVER = DEDICATED)\n”  \

> ”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

> ”      (SID = “$ORACLE_SID”)\n” \

> ”    )\n” \

> ”  )\n” >> $ORACLE_HOME/network/admin/tnsnames.ora

[oracle@linux2 admin]$ cat tnsnames.ora

CDB1 =

   (DESCRIPTION =

     (ADDRESS_LIST =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))

     )

     (CONNECT_DATA =

       (SERVER = DEDICATED)

       (SERVICE_NAME = cdb1)

       (SID = cdb1)

     )

   )

 [oracle@linux2 admin]$

 

 

  1. Create the file listener.ora with the following statement:

 

echo -e “SID_LIST_LISTENER =\n” \

”  (SID_LIST =\n” \

”      (SID_DESC =\n” \

”      (SID_NAME = “$ORACLE_SID”)\n” \

”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

”      (GLOBAL_DBNAME = “$ORACLE_SID”)\n” \

”      (ORACLE_HOME = “$ORACLE_HOME”)\n” \

”    )\n” \

”  )\n” \

“\nLISTENER =\n” \

”  (DESCRIPTION_LIST =\n” \

”    (DESCRIPTION =\n” \

”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

”  ))\n” \

“\nADR_BASE_LISTENER = /opt/app/oracle\n” \

“\nLOGGING_LISTENER=ON\n” \

“\nTRACE_LEVEL_SERVER=SUPPORT\n” \

“\nSQLNET.INBOUND_CONNECT_TIMEOUT=240\n” >> $ORACLE_HOME/network/admin/listener.ora

 

 

Execution example:

 

 [oracle@linux2 admin]$ echo -e “SID_LIST_LISTENER =\n” \

> ”  (SID_LIST =\n” \

> ”      (SID_DESC =\n” \

> ”      (SID_NAME = “$ORACLE_SID”)\n” \

> ”      (SERVICE_NAME = “$ORACLE_SID”)\n” \

> ”      (GLOBAL_DBNAME = “$ORACLE_SID”)\n” \

> ”      (ORACLE_HOME = “$ORACLE_HOME”)\n” \

> ”    )\n” \

> ”  )\n” \

> “\nLISTENER =\n” \

> ”  (DESCRIPTION_LIST =\n” \

> ”    (DESCRIPTION =\n” \

> ”      (ADDRESS = (PROTOCOL = TCP)(HOST = “`hostname -i`”)(PORT = 1521))\n” \

> ”  ))\n” \

> “\nADR_BASE_LISTENER = /opt/app/oracle\n” \

> “\nLOGGING_LISTENER=ON\n” \

> “\nTRACE_LEVEL_SERVER=SUPPORT\n” \

> “\nSQLNET.INBOUND_CONNECT_TIMEOUT=240\n” >> $ORACLE_HOME/network/admin/listener.ora

[oracle@linux2 admin]$ cat listener.ora

SID_LIST_LISTENER =

   (SID_LIST =

       (SID_DESC =

       (SID_NAME = cdb1)

       (SERVICE_NAME = cdb1)

       (GLOBAL_DBNAME = cdb1)

       (ORACLE_HOME = /opt/app/oracle/product/12.1.0.2/db_1)

     )

   )

 LISTENER =

   (DESCRIPTION_LIST =

     (DESCRIPTION =

       (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))

   ))

 ADR_BASE_LISTENER = /opt/app/oracle

 LOGGING_LISTENER=ON

 TRACE_LEVEL_SERVER=SUPPORT

 SQLNET.INBOUND_CONNECT_TIMEOUT=240

 [oracle@linux2 admin]$

 

 

  1. Stat the listener process with the command: lsnrctl start

 

[oracle@linux2 admin]$ lsnrctl start

 

LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 19-OCT-2016 14:06:54

 

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

 

Starting /opt/app/oracle/product/12.1.0.2/db_1/bin/tnslsnr: please wait…

 

TNSLSNR for Linux: Version 12.1.0.2.0 – Production

System parameter file is /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Log messages written to /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.15.75)(PORT=1521)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 12.1.0.2.0 – Production

Start Date                19-OCT-2016 14:06:54

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /opt/app/oracle/product/12.1.0.2/db_1/network/admin/listener.ora

Listener Log File         /opt/app/oracle/diag/tnslsnr/linux2/listener/alert/log.xml

Listening Endpoints Summary…

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.30.15.75)(PORT=1521)))

Services Summary…

Service “cdb1” has 1 instance(s).

  Instance “cdb1”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

[oracle@linux2 admin]$

 

  1. Test connect to the new database with command: tnsping cdb1

 

[oracle@linux2 admin]$ tnsping cdb1

 

TNS Ping Utility for Linux: Version 12.1.0.2.0 – Production on 19-OCT-2016 14:15:55

 

Copyright (c) 1997, 2014, Oracle.  All rights reserved.

 Used parameter files:

 Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.30.15.75)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cdb1) (SID = cdb1)))

OK (0 msec)

[oracle@linux2 admin]$

 

  1. This completes the creation of CDB in silent mode.

 

Larry Catt

OCP

Oracle 12c Create stand-alone database(non-CDB and non-PDB)

In Oracle 12c, Container Databases were introduced which allowed for multiple separate database to be placed in a single oracle instance to reduce the amount of resource consumed.   However, it is still possible to create a traditional stand-alone database without the features or restriction of a CDB.  This procedure covers the creation of a 12c standalone database using Oracle Database Configuration Assistant in a Windows environment.

 

  1. Logon your windows server as the administrator.

 

  1. Open Oracle Database Configuration Assistant.

  1. At the Database Operation Page select “Create Database”

  1. At the Creation Mode Page select “Advanced Mode”

  1. At the Database Template Page select the Desired type of database, in This example we select “General Purpose or Transaction Processing”

  1. At the Database Identification Page enter the Global Database Name and SID, then unselect “Create as Container Database” and press Next Button.

  1. At the Management Options Page, select Configure Enterprise Manger (EM) Database Express if desired.

 

  1. At the Database Credentials Page, select Use the Same Administrative Password for All Accounts and enter a valid password. Additionally enter a password the administrative account on the windows system.

  1. On the Network Configuration Page, select the Listener to be used by the new database.

  1. At the Storage Location Page, select the appropriate storage for your database.

  1. At the Database Options page select nothing and Press Next button.

 

  1. At the Initialization Parameters Page, select the defaults and Press the Next button.

 

 

  1. At the Creation Options Page, select Create Database and Generate Database Creation Scripts (giving a valid destination directory) and press Next button.

  1. At the Summary Page, press the Finish button.

  1. The Progress Page, a confirmation of script creation will be displayed, once complete press OK.

  1. The CDB will now be created in Windows.

  1. A confirmation screen will appear once the install is completed with the EM information and confirmation of install, Press the Exit button to close.

  1. Once back at the Progress Page, press the Close button to terminate Database Configuration Assistant.

This completes creation of Oracle 12c stand-alone database in Windows environment with Database Configuration Assistant.

 

 

Larry Catt

OCP

Oracle 12c Create PDB

In Oracle 12c, Container Databases (CDB) were introduced which allowed for multiple Pluggable Database (PDB) to be placed in a single oracle instance to reduce the amount of resource consumed.   This procedure covers the creation of a PDB in an already existing CDB using Oracle Database Configuration Assistant in a Windows environment.

 

  1. Logon your windows server as the administrator.

 

  1. Open Oracle Database Configuration Assistant.

  1. At the Database Operation Page select “Create Database”

 

  1. At the Manage Pluggable Database Page select “Create a Pluggable Database”

  1. At the Database List Page, select the Container Database CDB you would like your PDB to be created in.

  1. At the Create Pluggable Database page, select “Create a new Pluggable Database” and press Next.

  1. At the Pluggable Database Options page, Enter the name of the Pluggable Database, Storage options, and Password Credentials. NOTE:  This is an administrator account inside of the new PDB, not administrator account of OS or CDB.  Press Next button.

  1. At the Summary Page, Press the Finish button.

  1. The PDB will now be created in Windows.

  1. A confirmation screen will appear once the install is completed and press the OK button.

  1. Back at the Progress Page, press the Close button to terminate Database Configuration Assistant.

 

 

This completes creation of Oracle 12c PDB in an existing CDB with Database Configuration Assistant.

 

 

Larry Catt

OCP

 

Oracle 12c Create CDB with Database Configuration Assistant in Windows

In Oracle 12c, Container Databases were introduced which allowed for multiple separate database to be placed in a single oracle instance to reduce the amount of resource consumed.   This procedure covers the creation of a CDB using Oracle Database Configuration Assistant in a Windows environment.

 

  1. Logon your windows server as the administrator.

 

  1. Open Oracle Database Configuration Assistant.

  1. At the Database Operation Page select “Create Database”

  1. At the Creation Mode Page select “Advanced Mode”

  1. At the Database Template Page select the Desired type of database, in This example we select “General Purpose or Transaction Processing”

  1. At the Database Identification Page enter the Global Database Name and SID, then select “Create as Container Database” and “Create an Empty Container Database”

  1. At the Management Options Page, select Configure Enterprise Manger (EM) Database Express if desired.

 

  1. At the Database Credentials Page, select Use the Same Administrative Password for All Accounts and enter a valid password.

 

  1. Additionally enter a password the administrative account on the windows system.

  1. On the Network Configuration Page, select the Listener to be used by the new database.

  1. At the Storage Location Page, select the appropriate storage for your database.

  1. At the Database Options page select nothing and Press Next button.

 

  1. At the Initialization Parameters Page, select the defaults and Press the Next button.

 

  1. At the Creation Options Page, select Create Database and Generate Database Creation Scripts (giving a valid destination directory) and press Next button.

  1. At the Summary Page, press the Finish button.

  1. The Progress Page, a confirmation of script creation will be displayed, once complete press OK.

  1. The CDB will now be created in Windows.

 

  1. A confirmation screen will appear once the install is completed and press the Close button to terminate Database Configuration Assistant.

 

 

This completes creation of Oracle 12c CDB in Windows environment with Database Configuration Assistant.

 

 

Larry Catt

OCP

Oracle 12c Create CDB with PDB

In Oracle 12c, Container Databases (CDB) were introduced which allowed for multiple Pluggable database (PDB) to be placed in a single oracle instance to reduce the amount of resource consumed.   This procedure covers the creation of a CDB with a PDB using Oracle Database Configuration Assistant in a Windows environment.

 

  1. Logon your windows server as the administrator.

 

  1. Open Oracle Database Configuration Assistant.

  1. At the Database Operation Page select “Create Database”

  1. At the Creation Mode Page select “Advanced Mode”

  1. At the Database Template Page select the Desired type of database, in This example we select “General Purpose or Transaction Processing”

  1. At the Database Identification Page enter the Global Database Name and SID, then select “Create as Container Database”, “Create a Container Database with one or more PDBs”, enter Number of PDBs = 1, and Name your PDB.

  1. At the Management Options Page, select Configure Enterprise Manger (EM) Database Express if desired.

 

  1. At the Database Credentials Page, select Use the Same Administrative Password for All Accounts and enter a valid password. Additionally enter a password the administrative account on the windows system.

  1. On the Network Configuration Page, select the Listener to be used by the new database.

  1. At the Storage Location Page, select the appropriate storage for your database.

  1. At the Database Options page select nothing and Press Next button.

 

  1. At the Initialization Parameters Page, select the defaults and Press the Next button.

 

  1. At the Creation Options Page, select Create Database and Generate Database Creation Scripts (giving a valid destination directory) and press Next button.

  1. At the Summary Page, press the Finish button.

  1. The Progress Page, a confirmation of script creation will be displayed, once complete press OK.

 

  1. The CDB with PDB will now be created in Windows.

  1. A confirmation screen will appear once the install is completed with information about EM configuration, press the Exit button.

  1. Back at the Progress Page, Press the Close button to exit.

 

 

 

This completes creation of Oracle 12c CDB with PDB in a Windows environment with Database Configuration Assistant.

 

 

Larry Catt

OCP

 

Remove Oracle Database with DBCA from command line

The following procedure shows how to remove an Oracle database with dbca utility from the command line.

1. Logon as the oracle software owner.

[root@mylinux2 root]# su – oracle
[oracle@mylinux2 ~]$

2. Change directories to $ORACLE_HOME/bin

[oracle@mylinux2 ~]$ cd $ORACLE_HOME/bin
[oracle@mylinux2 bin]$

3. Obtain the ORACLE_SID of the database you wish to delete.

[oracle@mylinux2 bin]$ ps -ef|grep smon
oracle 4746 1 0 Feb09 ? 00:00:00 ora_smon_orcl
oracle 7839 7796 0 00:39 pts/1 00:00:00 grep smon
[oracle@mylinux2 bin]$

4. Obtain the userid and password of a user with sysdba privileges, normally this would be sys.

5. Logon to the database if open with the immediate option and exit.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@mylinux2 bin]$

6. Ensure that no oracle database processes are running for the ORACLE_SID you wish to delete


[oracle@mylinux2 bin]$ ps -ef|grep orcl
oracle 11485 7796 0 01:46 pts/1 00:00:00 grep orcl
[oracle@mylinux2 bin]$

7. Execute the command dbca -deleteDatabase -sourceDB -sysDBAUserName -sysDBAPassword


[oracle@mylinux2 bin]$ ./dbca -silent -deleteDatabase -sourceDB orcl – sysDBAUserName larry -sysDBAPassword larry
Connecting to database
4% complete
9% complete
14% complete
19% complete
23% complete
28% complete
47% complete
Updating network configuration files
48% complete
52% complete
Deleting instance and datafiles
76% complete
100% complete
Look at the log file “/u01/app/oracle/cfgtoollogs/dbca/orcl.log” for
further details.
[oracle@mylinux2 bin]$

This completes deleting an oracle database from command line with dbca.

Larry J. Catt, OCP
oracle@allcompute.com
www.allcompute.com