Thursday, January 21, 2021

How to install Oracle Database 19c In Centos 7 Linux

 Install Oracle Database 19c :

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

pSSWRDa

----------------  /opt/oracle/product/19c/dbhome_1

Log in as root.

curl -o oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm


yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm


cd /root

#  yum -y localinstall oracle-database-ee-19c.rpm

Change the port here:

vi /etc/sysconfig/oracledb_ORCLCDB-19c.conf 

To configure a sample Oracle Database instance, run the following service configuration script:

mkdir -p /opt/oracle/oradata

vi /etc/hosts

157.230.243.130 srvr01

--- add ip address with hostname

/etc/init.d/oracledb_ORCLCDB-19c configure


This script creates a container database (ORCLCDB) with one pluggable database (ORCLPDB1) 

and configures the listener at the default port (1521).


Review the status information that is displayed on your screen.


echo '# setting oracle database environment variables and aliases' >> /etc/profile.d/oraenv.sh

echo 'ORACLE_SID=ORCLCDB' >> /etc/profile.d/oraenv.sh

echo 'ORAENV_ASK=NO' >> /etc/profile.d/oraenv.sh

echo 'ORACLE_HOME=/opt/oracle/product/19c/dbhome_1' >> /etc/profile.d/oraenv.sh

echo '. /usr/local/bin/oraenv -s' >> /etc/profile.d/oraenv.sh

echo 'alias sqlplus="rlwrap sqlplus"' >> /etc/profile.d/oraenv.sh

echo 'alias rman="rlwrap rman"' >> /etc/profile.d/oraenv.sh

. /etc/profile.d/oraenv.sh


/opt/oracle/product/19c/dbhome_1

or vi /etc/profile.d/oraenv.sh

chmod 6751 $ORACLE_HOME/bin/*

systemctl enable oracledb_ORCLCDB-19c


# chown -R oracle:oinstall /opt 

# chmod -R 775 /opt 


chown -R oracle:dba /opt

chmod -R 777 /opt


su oracle

sqlplus / as sysdba

create pfile from spfile;


delete this parameter from pfile:


*.memory_target=1024m


create spfile from pfile;


startup force pfile='/opt/oracle/product/19c/dbhome_1/dbs/initORCL.ora';


COLUMN name FORMAT a20;

SELECT name,con_id FROM v$pdbs;

SELECT name as “Service Name” FROM v$active_services WHERE con_id=3;

SQLPLUS / as SYSDBA

SHOW con_name


ALTER SESSION SET CONTAINER=orclpdb1;

Note that since 12c Oracle Database has multitenant architecture, which means there could be several pluggable databases and 

one multitenant container database. By default, the XEPDB1 pluggable database is created during the installation of XE.


To make it easier to connect to the pluggable database, I recommend editing of tnsnames.ora file and add there a new connection 

descriptor that we are going to use:


vi /opt/oracle/product/18c/dbhomeXE/network/admin/sqlnet.ora

SQLNET.ALLOWED_LOGON_VERSION=8


vi /opt/oracle/product/18c/dbhomeXE/network/admin/tnsnames.ora

Add this record there below the standard XE record:


PDB1 =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = 157.230.243.130)(PORT = 1539))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = XEPDB1)

    )

  )


And save the changes.

alter session set "_ORACLE_SCRIPT"=true;  

copy tnsnames to your windows oracle /network/admin folder.

Check connection from anywhere. e.g. Your Laptop or PC.

CONNECT WITHOUT GIVING ANY DATABASE NAME:

=========================================


sqlplus /nolog

conn SYS/CBQQZ123 AS SYSDBA

SHUTDOWN IMMEDIATE

create pfile from spfile;

STARTUP

alter session set "_ORACLE_SCRIPT"=true;  

0 comments:

Post a Comment