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.
- 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 ~]$
- 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 ~]$
- 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 ~]$
- 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]$
- Network configuration should have been complete by the DBCA tool.
- 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]$
- 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>
- This completes creation of a non-CDB in Oracle 12c
Larry Catt