KEMBAR78
19c Installation Script | PDF | Information Retrieval | Information Technology Management
0% found this document useful (0 votes)
38 views7 pages

19c Installation Script

The document provides a detailed installation script for Oracle Database 19c on Oracle Linux 7, including steps to configure the environment, install necessary packages, and set up directories. It also outlines manual steps for unzipping the database files, creating a listener, and configuring the database. Additionally, it includes commands for managing users and schemas, as well as configuring Enterprise Manager Database Express.

Uploaded by

Stephen Efange
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views7 pages

19c Installation Script

The document provides a detailed installation script for Oracle Database 19c on Oracle Linux 7, including steps to configure the environment, install necessary packages, and set up directories. It also outlines manual steps for unzipping the database files, creating a listener, and configuring the database. Additionally, it includes commands for managing users and schemas, as well as configuring Enterprise Manager Database Express.

Uploaded by

Stephen Efange
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

19c Installation Script:

https://oracle-base.com/articles/19c/oracle-db-19c-installation-on-oracle-linux-7

#!/bin/sh

# echo "192.168.56.101 centos01" >> /etc/hosts

systemctl restart network


setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

systemctl stop firewalld


systemctl disable firewalld

cd /etc/yum.repos.d/
wget http://yum.oracle.com/public-yum-ol7.repo

systemctl restart network

wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-


oracle
gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

yum install oracle-database-preinstall-19c.x86_64 -y


yum install compat-libstdc++-33 -y

# Remove the kmods: rpm -qa | grep -i kmod-20-21.0.1.el7.x86_64 and rpm -qa | grep
-i
yum install kmod-20-21* -y
yum install kmod-libs-20-21* -y

rm public-yum-ol7.repo

mkdir -p /u01/app/
mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
chown -R oracle:oinstall /u01/app
chmod -R 775 /u01/app

mkdir -p /u02/app/oracle/oradata
chown -R oracle:oinstall /u02/app
chmod -R 775 /u02/app/

mkdir -p /u03/app/oracle/fast_recovery_area
chown -R oracle:oinstall /u03/app
chmod -R 775 /u03/app

echo "sprragga" | passwd --stdin oracle

cat >> /home/oracle/.bash_profile <<EOF

export TMP=/tmp

export TMPDIR=\$TMP

export ORACLE_HOSTNAME=centos01

export ORACLE_UNQNAME=cdborcl
export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=\$ORACLE_BASE/product/19.3.0/dbhome_1

export ORA_INVENTORY=/u01/app/oraInventory

export ORACLE_SID=cdborcl

export PDB_NAME=pdborcl

export DATA_DIR=/u02/app/oracle/oradata

export PATH=/usr/sbin:/usr/local/bin:\$PATH

export PATH=\$ORACLE_HOME/bin:\$PATH

export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib

export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib

export _JAVA_OPTIONS='-Dsun.java2d.xrender=false'

export CV_ASSUME_DISTID=RHEL7.9

EOF

yum install xclock -y

systemctl restart sshd

systemctl status sshd

sudo su - oracle

Manual steps:

As oracle:

mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
chown -R oracle:oinstall /u01/app

as root: Stage the oracle zip in /root

cd /root
chown -R oracle:oinstall LINUX.X64_193000_db_home.zip
mv LINUX.X64_193000_db_home.zip /home/oracle

As oracle:

https://www.oracle.com/database/technologies/oracle-database-software-
downloads.html
unzip LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.3.0/dbhome_1

cd /u01/app/oracle/product/19.3.0/dbhome_1

export DISPLAY=192.168.56.1:0.0

./runInstaller

Create Listener:

netca

Create Database:

dbca

Create tnsnames entry for PDB:

netca or netmgr

+++++++++++++++++++

sqlplus sys/sprragga as sysdba;

alter session set container=pdborcl;

alter pluggable database pdborcl save state;

++++++++Sample Schemas:

https://docs.oracle.com/en/database/oracle/oracle-database/19/comsc/installing-
sample-schemas.html#GUID-CB945E4C-D08A-4B26-A12D-3D6D688467EA

cd
wget https://github.com/oracle-samples/db-sample-schemas/archive/refs/tags/
v19.2.zip
cd /home/oracle/db-sample-schemas-19.2/human_resources

You need to call only one script, hr_main.sql

sqlplus sys/sprragga as sysdba;

SQL> desc v$instance;


SQL> col HOST_NAME format a35
SQL> select INSTANCE_NAME, HOST_NAME , STATUS, EDITION from v$instance;

INSTANCE_NAME HOST_NAME STATUS EDITION


---------------- ----------------------------------- ------------ -------
cdborcl oracle19c01 OPEN EE

SQL> alter session set "_ORACLE_SCRIPT"=true;

Session altered.

SQL> create user hr identified by sprragga;

User created.
SQL> drop user hr cascade;

User dropped.

SQL> @?/demo/schema/human_resources/hr_main.sql

password
users
temp
$ORACLE_HOME/demo/schema/log/

SQL> ALTER USER hr ACCOUNT UNLOCK;

User altered.

alter user hr identified by sprragga;

SQL> alter user hr identified by sprragga;

User altered.

sqlplus system/sprragga as sysdba;

show con_name;

alter session set container=pdborcl;

select open_mode, con_id from v$pdbs;

SQL> conn hr/sprragga


Connected.

SELECT table_name from user_tables;

SET LINESIZE 120


COL FIRST_NAME FORMAT A20
COL LAST_NAME FORMAT A20
COL EMAIL FORMAT A20
COL JOB_TITLE FORMAT A30

select FIRST_NAME, LAST_NAME, EMAIL, JOB_TITLE


FROM EMPLOYEES, JOBS
WHERE EMPLOYEES.JOB_ID=JOBS.JOB_ID

select FIRST_NAME, LAST_NAME, EMAIL, JOB_TITLE


FROM EMPLOYEES NATURAL JOIN JOBS

select FIRST_NAME, LAST_NAME, EMAIL, JOB_TITLE


FROM EMPLOYEES JOIN JOBS USING(JOB_ID)

select FIRST_NAME, LAST_NAME, EMAIL, JOB_TITLe


FROM EMPLOYEES JOIN JOBS
on EMPLOYEES.JOB_ID=JOBS.JOB_ID

EM express:
SQL> set linesize 200;
SQL> col NETWORK format a60
SQL> select NAME, NETWORK,STATUS, LISTENER from V$DISPATCHER;

NAME NETWORK STATUS


LISTENER
---- ------------------------------------------------------------ ----------------
----------
D000 (ADDRESS=(PROTOCOL=tcp)(HOST=oracle19c01)(PORT=15977)) WAIT
0

SQL> exec DBMS_XDB_CONFIG.SETHTTPSPORT(5500);

PL/SQL procedure successfully completed.

https://docs.oracle.com/en/database/oracle/oracle-database/tutorial-configure-em/
index.html

SELECT DBMS_XDB_CONFIG.GETHTTPPORT FROM DUAL;

https://oracle19c01:5500/em/login

SQL> exec dbms_xdb_config.sethttpport(5550);

PL/SQL procedure successfully completed.

SQL> SELECT DBMS_XDB_CONFIG.GETHTTPPORT FROM DUAL;

GETHTTPPORT
-----------
5550

NB:
the Enterprise Manager Database Express which is delivered with Oracle Database 19c
is based on Oracle JET (Javascript-Extension-Toolkit) and provides performance-
reporting functionality only. So it is intended that there is no server-tab.

You can revert back to the flash-based Enterprise Manager Database Express which
was delivered with Oracle 12.1 to 18c with the SQL command (as SYS)
@?/rdbms/admin/execemx emx

Re-enabling the JET-based is done with @?/rdbms/admin/execemx omx

*******************
[oracle@oracle19c01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 17 13:43:26 2023


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> @?/rdbms/admin/execemx emx


Session altered.

no rows selected

old 1: select nvl( '&1','omx') p1 from dual


new 1: select nvl( 'emx','omx') p1 from dual

P1
---
emx

PL/SQL procedure successfully completed.

Session altered.

SQL>

https://docs.oracle.com/en/database/oracle/oracle-database/19/admqs/
index.html#Oracle%C2%AE-Database

https://docs.oracle.com/en/database/oracle/oracle-database/tutorial-start-em/
index.html?opt-release-19c

https://github.com/radubirsan/FlashBrowser/releases/tag/v0.81

PDB:

SELECT log_mode FROM v$database;

col NAME format a35


SELECT con_id, name, open_mode FROM v$pdbs ORDER BY 1;

PDB - Connect:

- register the pdb service to the tnsnames.ora file


- cat $ORACLE_HOME/network/admin/tnsnames.ora

Using EZ-connect:

sqlplus hr/sprragga@oracle19c01:1521/pdborcl

-port and service name are optional

sqlplus hr/sprragga

[oracle@oracle19c01 ~]$ . oraenv


ORACLE_SID = [cdborcl] ? cdborcl
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oracle19c01 ~]$ sqlplus hr/sprragga@oracle19c01:1521/pdborcl
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 17 23:32:33 2023
Version 19.3.0.0.0

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

Last Successful login time: Thu Aug 17 2023 19:08:26 -04:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL>

SELECT table_name from user_tables;

Local Naming Method:

- tnsnames.ora

sqlplus hr/sprragga@pdborcl

[oracle@oracle19c01 ~]$ . oraenv


ORACLE_SID = [cdborcl] ? cdborcl
$ sqlplus hr/sprragga@pdborcl

$ echo $TNS_ADMIN
$ ps -ef | grep -i tns

netca

$ tnsping oracle19c01

$ tnsping pdborcl

You might also like