In the last post, we installed Oracle 19c Database Software by running RPM Package. Now, we are going to create and configure a Database with default Setting.
Log in as root and run the below command to configure an Oracle Database instance.
[root@oracle19c dbhome_1]# /etc/init.d/oracledb_ORCLCDB-19c configure Configuring Oracle Database ORCLCDB. [FATAL] [DBT-06103] The port (1,521) is already in use. ACTION: Specify a free port. Database configuration failed.
To resolve the above error, make sure /etc/hosts has configured properly and ping to the server is also working.
[root@oracle19c dbhome_1]# ping oracle19c ping: oracle19c: Name or service not known [root@oracle19c dbhome_1]# vi /etc/hosts [root@oracle19c ~]$ cat /etc/hosts 192.168.2.7 oracle19c oracle19c.localdomain 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [root@oracle19c ~]$ ping oracle19c PING oracle19c (192.168.2.7) 56(84) bytes of data. 64 bytes from oracle19c (192.168.2.7): icmp_seq=1 ttl=64 time=0.044 ms 64 bytes from oracle19c (192.168.2.7): icmp_seq=2 ttl=64 time=0.044 ms
Now, re-run the configure for creating database instance.
[root@oracle19c dbhome_1]# /etc/init.d/oracledb_ORCLCDB-19c configure Configuring Oracle Database ORCLCDB. 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 54% complete Creating Pluggable Databases 58% complete 77% complete Executing Post Configuration Actions 100% complete Database creation complete. For details check the logfiles at: /opt/oracle/cfgtoollogs/dbca/ORCLCDB. Database Information: Global Database Name:ORCLCDB System Identifier(SID):ORCLCDB Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details. Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user. [root@oracle19c dbhome_1]#
Note: You can modify the configuration parameters by changing in a configuration file.
[root@oracle19c sysconfig]# pwd /etc/sysconfig [root@oracle19c sysconfig]# cat oracledb_ORCLCDB-19c.conf #This is a configuration file to setup the Oracle Database. #It is used when running '/etc/init.d/oracledb_ORCLCDB configure'. #Please use this file to modify the default listener port and the #Oracle data location. # LISTENER_PORT: Database listener LISTENER_PORT=1521 # ORACLE_DATA_LOCATION: Database oradata location ORACLE_DATA_LOCATION=/opt/oracle/oradata # EM_EXPRESS_PORT: Oracle EM Express listener EM_EXPRESS_PORT=5500 [root@oracle19c sysconfig]#
This script creates a container database (ORCLCDB) with one pluggable database (ORCLPDB1) and configures the listener at the default port (1521). Now, connect to a database with an Oracle user.
[oracle@oracle19c sw]# ps -ef|grep pmon oracle 29358 1 0 03:47 ? 00:00:00 ora_pmon_ORCLCDB root 30579 17822 0 03:59 pts/0 00:00:00 grep --color=auto pmon [oracle@oracle19c sw]$ . oraenv ORACLE_SID = [oracle] ? ORCLCDB The Oracle base has been set to /opt/oracle [oracle@oracle19c sw]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Fri Apr 26 03:59:49 2019 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB1 READ WRITE NO [oracle@oracle19c ~]#
Stop the database instance
[root@oracle19c ~]# /etc/init.d/oracledb_ORCLCDB-19c stop Shutting down Oracle Database instance ORCLCDB. Oracle Database instance ORCLCDB shut down. Stopping Oracle Net Listener. Oracle Net Listener stopped. [root@oracle19c ~]#
Start the database instance
[root@oracle19c ~]# /etc/init.d/oracledb_ORCLCDB-19c start Starting Oracle Net Listener. Oracle Net Listener started. Starting Oracle Database instance ORCLCDB. Oracle Database instance ORCLCDB started. [root@oracle19c ~]#
Restart the database instance
[root@oracle19c ~]# /etc/init.d/oracledb_ORCLCDB-19c restart Shutting down Oracle Database instance ORCLCDB. Oracle Database instance ORCLCDB shut down. Stopping Oracle Net Listener. Oracle Net Listener stopped. Starting Oracle Net Listener. Oracle Net Listener started. Starting Oracle Database instance ORCLCDB. Oracle Database instance ORCLCDB started. [root@oracle19c ~]#
Delete the database instance
[root@oracle19c ~]# /etc/init.d/oracledb_ORCLCDB-19c delete Detecting existing Listeners... Deleting Oracle Listener.... Detecting existing Oracle Databases... Deleting Oracle Database ORCLCDB. [WARNING] [DBT-19202] The Database Configuration Assistant will delete the Oracle instances and datafiles for your database. All information in the database will be destroyed. Prepare for db operation 32% complete Connecting to database 35% complete 39% complete 42% complete 45% complete 48% complete 52% complete 65% complete Updating network configuration files 68% complete Deleting instance and datafiles 84% complete 100% complete Database deletion completed. Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB0.log" for further details. [root@oracle19c ~]#
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Telegram Channel: https://t.me/helporacle
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp