Sunday, May 21, 2023

Oracle 21C EE installation on Redhat Linux 8.2 with all Demo Schema (BI,HR,SH,IX,OE) installation

 #Oracle 21C EE installation on Redhat Linux 8.2 with  all Demo Schema (BI,HR,SH,IX,OE) installation


Document Direct Google Drive Link: Open in Notepad++

https://drive.google.com/file/d/1zX5xK5txK8tlNYuikadaPmgEKgDaURCD/view?usp=sharing



# Oracle 21C EE installation on Redhat Linux 8.2 Step 1. Oracle Version 21.3.0.0.0 (21C Enterprise Edition : LINUX.X64_213000_db_home.zip) Download software from oracle official website and keep it in windows C or D drive . VM ware work station pro : Network Network Connection : Bridged ( Not NAT) don't select -> Replicate Physical Network connection state ( Leave blank) RHEL server Disk size must be : 70GB No of processor : 2. No of cores per processor : 2 total processor cores : 4 ( automatic ) Start the RHEL 8 server and Login as root user via Putty . Step 2. Internet must be working on your machine, let's check it's working or not using the ping command. [root@localhost ~]# ping www.google.com PING www.google.com (142.250.182.68) 56(84) bytes of data. 64 bytes from maa05s20-in-f4.1e100.net (142.250.182.68): icmp_seq=1 ttl=116 time =8.56 ms 64 bytes from maa05s20-in-f4.1e100.net (142.250.182.68): icmp_seq=2 ttl=116 time =201 ms Step 3. Check the IP Address and hostname of your machine #ifconfig [root@localhost ~]# ifconfig -a ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.0.195 netmask 255.255.255.0 broadcast 192.168.0.255 [root@localhost ~]# hostname localhost.localdomain Step 4. Edit /etc/hosts file and add IP with hostname inside the hosts file. #vi /etc/hosts [root@localhost ~]# vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.195 localhost.localdomain ora21c Step 5. Register to subscription manager [root@localhost ~]# sudo -i subscription-manager remove --all 0 subscriptions removed at the server. [root@localhost ~]# subscription-manager unregister Unregistering from: subscription.rhsm.redhat.com:443/subscription System has been unregistered. [root@localhost ~]# subscription-manager clean dnf clean all cannot parse argument: dnf cannot parse argument: clean cannot parse argument: all [root@localhost ~]# subscription-manager clean All local data removed [root@localhost ~]# dnf clean all Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. 0 files removed [root@localhost ~]# rm -rf /var/cache/yum/* [root@localhost ~]# subscription-manager register Registering to: subscription.rhsm.redhat.com:443/subscription Username: rajanikanta999 Password: The system has been registered with ID: bd92ec6d-4f09-4161-add9-9c24f6f7ea17 The registered system name is: localhost.localdomain [root@localhost ~]# subscription-manager attach --auto Installed Product Current Status: Product Name: Red Hat Enterprise Linux for x86_64 Status: Subscribed [root@localhost ~]# subscription-manager list +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux for x86_64 Product ID: 479 Version: 8.2 Arch: x86_64 Status: Subscribed Status Details: Starts: 05/14/2023 Ends: 05/13/2024 Step 6: Download the pre-instal file from correct URL and ftp to RHEL server https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm [root@localhost ~]# curl -o oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm [root@localhost ~]# pwd /root [root@localhost ~]# ls -lrt total 40 -rw-------. 1 root root 2122 May 16 11:50 original-ks.cfg -rw-------. 1 root root 2875 May 16 11:50 anaconda-ks.cfg -rw-r--r--. 1 root root 30772 May 19 06:25 oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm [root@localhost ************************************************************************************************************************ Step 7: install [root@localhost ~]# yum -y localinstall oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm Updating Subscription Management repositories. Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 20 MB/s | 57 MB 00:02 Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 25 MB/s | 60 MB 00:02 Last metadata expiration check: 0:00:23 ago on Sat 20 May 2023 10:42:52 AM PDT. Dependencies resolved. ============================================================================================================================================================================================= Package Architecture Version Repository Size ============================================================================================================================================================================================= Installing: oracle-database-preinstall-21c x86_64 1.0-1.el8 @commandline 30 k Installing dependencies: compat-openssl10 x86_64 1:1.0.2o-4.el8_6 rhel-8-for-x86_64-appstream-rpms 1.1 M ksh x86_64 20120801-257.el8 rhel-8-for-x86_64-appstream-rpms 929 k libXxf86dga x86_64 1.1.5-1.el8 rhel-8-for-x86_64-appstream-rpms 26 k libdmx x86_64 1.1.4-3.el8 rhel-8-for-x86_64-appstream-rpms 22 k libnsl x86_64 2.28-101.el8 rhel-8-for-x86_64-baseos-rpms 96 k lm_sensors-libs x86_64 3.4.0-23.20180522git70f7e08.el8 rhel-8-for-x86_64-baseos-rpms 59 k sysstat x86_64 11.7.3-9.el8 rhel-8-for-x86_64-appstream-rpms 426 k xorg-x11-utils x86_64 7.5-28.el8 rhel-8-for-x86_64-appstream-rpms 135 k Transaction Summary ============================================================================================================================================================================================= Install 9 Packages Total size: 2.8 M Total download size: 2.8 M Installed size: 8.2 M Downloading Packages: (1/8): libdmx-1.1.4-3.el8.x86_64.rpm 60 kB/s | 22 kB 00:00 (2/8): libXxf86dga-1.1.5-1.el8.x86_64.rpm 70 kB/s | 26 kB 00:00 (3/8): xorg-x11-utils-7.5-28.el8.x86_64.rpm 272 kB/s | 135 kB 00:00 (4/8): compat-openssl10-1.0.2o-4.el8_6.x86_64.rpm 3.4 MB/s | 1.1 MB 00:00 (5/8): ksh-20120801-257.el8.x86_64.rpm 2.7 MB/s | 929 kB 00:00 (6/8): sysstat-11.7.3-9.el8.x86_64.rpm 1.0 MB/s | 426 kB 00:00 (7/8): lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64.rpm 216 kB/s | 59 kB 00:00 (8/8): libnsl-2.28-101.el8.x86_64.rpm 323 kB/s | 96 kB 00:00 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 2.8 MB/s | 2.8 MB 00:01 warning: /var/cache/dnf/rhel-8-for-x86_64-appstream-rpms-9d3886b51bb367d7/packages/xorg-x11-utils-7.5-28.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 1.2 MB/s | 5.0 kB 00:00 Importing GPG key 0xFD431D51: Userid : "Red Hat, Inc. (release key 2) <security@redhat.com>" Fingerprint: 567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release Key imported successfully Importing GPG key 0xD4082792: Userid : "Red Hat, Inc. (auxiliary key) <security@redhat.com>" Fingerprint: 6A6A A7C9 7C88 90AE C6AE BFE2 F76F 66C3 D408 2792 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 1/9 Running scriptlet: lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 1/9 Installing : sysstat-11.7.3-9.el8.x86_64 2/9 Running scriptlet: sysstat-11.7.3-9.el8.x86_64 2/9 Installing : libnsl-2.28-101.el8.x86_64 3/9 Installing : ksh-20120801-257.el8.x86_64 4/9 Running scriptlet: ksh-20120801-257.el8.x86_64 4/9 Installing : compat-openssl10-1:1.0.2o-4.el8_6.x86_64 5/9 Running scriptlet: compat-openssl10-1:1.0.2o-4.el8_6.x86_64 5/9 Installing : libXxf86dga-1.1.5-1.el8.x86_64 6/9 Installing : libdmx-1.1.4-3.el8.x86_64 7/9 Installing : xorg-x11-utils-7.5-28.el8.x86_64 8/9 Installing : oracle-database-preinstall-21c-1.0-1.el8.x86_64 9/9 Running scriptlet: oracle-database-preinstall-21c-1.0-1.el8.x86_64 9/9 Verifying : xorg-x11-utils-7.5-28.el8.x86_64 1/9 Verifying : libdmx-1.1.4-3.el8.x86_64 2/9 Verifying : libXxf86dga-1.1.5-1.el8.x86_64 3/9 Verifying : compat-openssl10-1:1.0.2o-4.el8_6.x86_64 4/9 Verifying : ksh-20120801-257.el8.x86_64 5/9 Verifying : sysstat-11.7.3-9.el8.x86_64 6/9 Verifying : libnsl-2.28-101.el8.x86_64 7/9 Verifying : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 8/9 Verifying : oracle-database-preinstall-21c-1.0-1.el8.x86_64 9/9 Installed products updated. Installed: compat-openssl10-1:1.0.2o-4.el8_6.x86_64 ksh-20120801-257.el8.x86_64 libXxf86dga-1.1.5-1.el8.x86_64 libdmx-1.1.4-3.el8.x86_64 libnsl-2.28-101.el8.x86_64 lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 oracle-database-preinstall-21c-1.0-1.el8.x86_64 sysstat-11.7.3-9.el8.x86_64 xorg-x11-utils-7.5-28.el8.x86_64 Complete! [root@localhost ~]# ******************************************************** Once prerequisites are completed, the ORACLE user and GROUPS are also created automatically. So, after the installation of prerequisites, you should change the password for the ORACLE user. Step 9. Change the password for ORACLE USER. Login as Root user : #passwd oracle Step 10. Disable firewall and SELinux. [root@localhost ~]#systemctl stop firewalld [root@localhost ~]#systemctl disable firewalld Step : 11 edit config to set For SELinux: #vi /etc/selinux/config permissive # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. #SELINUX=enforcing SELINUX=permissive # SELINUXTYPE= can take one of these three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted ###### execute below [root@localhost ~]# setenforce permissive step 12: Create Directories and give permission: ************************************** [root@localhost ~]# mkdir -p /u01/app/oracle/product/21c/db_1/ [root@localhost ~]# mkdir -p /u01/app/oracle/oradata/ [root@localhost ~]# mkdir -p /u01/app/oracle/FRA/ [root@localhost ~]# chown -R oracle:oinstall /u01/ [root@localhost ~]# chmod -R 775 /u01/ Step 13: Add below entries in /etc/security/limits.conf file which will define limits #@student - maxlogins 4 # End of file oracle soft nofile 1024 oracle hard nofile 65536 oracle soft nproc 16384 oracle hard nproc 16384 oracle soft stack 10240 oracle hard stack 32768 oracle hard memlock 134217728 oracle soft memlock 134217728 Step 14: [oracle@localhost]$ /home/oracle./bash_profile add text # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs export TMP=/tmp export TMPDIR=$TMP export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/21c/db_1 export ORACLE_SID=orcl export ORACLE_TERM=xterm export BASE_PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$BASE_PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib step 15: [oracle@localhost]$ source ~/.bashrc step 16: copy 21c EE zip file to below path via winscp or file zilla and unzip it [oracle@localhost ~]$ cd /u01/app/oracle/product/21c/db_1 [oracle@localhost db_1]$ pwd /u01/app/oracle/product/21c/db_1 [oracle@localhost db_1]$ ls -lrt total 3036356 -rw-r--r--. 1 oracle oinstall 3109225519 May 13 21:13 LINUX.X64_213000_db_home.zip [oracle@localhost db_1]$ unzip LINUX.X64_213000_db_home.zipif required below step else no ( Mostly ignore) /* DISPLAY=localhost:0.0; export DISPLAY Set profile and go to ORACLE_HOME location and run following command and follow the steps.*/ Step 17: Run installer [oracle@localhost db_1]#./runInstaller Page Menus : --> Set up Software only ( 2nd option) --> Single Instance DB installation --> Enterprise Edition (1st Option) ORACLE_BASE=/u01/app/oracle Software location should show : /u01/app/oracle/product/21c/db_1 Inventory Directory : /app/oraInventory group name from down : oinstall Priviledged operating system group : OSDBA oinstall OPOPER oinstall ... All group should be oinstall --> Tick : Automatically run configuration scripts use root user credential : < provide root password> Pop up: config script to run with root accss : Yes Next : Listner Configucation: [oracle@localhost ~]$ netmgr LISTENER ->ADD LISTENER->NAME ALSO LISTENER-> ADD DATABASE-> DATABASE SERVICES -> Global databse name : orcl, sid : orcl , oracle home directory : /u01/app/oracle/product/21c/db_1 File-> Save network configuration : [oracle@localhost ~]$ lsnrctl status [oracle@localhost ~]$ lsnrctl start LSNRCTL for Linux: Version 21.0.0.0.0 - Production on 20-MAY-2023 12:09:13 Copyright (c) 1991, 2021, Oracle. All rights reserved. Starting /u01/app/oracle/product/21c/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 21.0.0.0.0 - Production System parameter file is /u01/app/oracle/homes/OraDB21Home1/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 21.0.0.0.0 - Production Start Date 20-MAY-2023 12:09:13 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/homes/OraDB21Home1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))) Services Summary... Service "orcl" has 1 instance(s). Instance "orcl", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully [oracle@localhost db_1]$ dbca --> Create database Advanced configuration : Database type: oracle single instance database option : general purpose or transactional processing Global database name: orcl sid : orcl pdb name : orclpdb1 Use local undo table space : Tick no changes select database storage location menu: select 2nd option : use folliwng for the database storage attributes : Database file location : Browse: /u01/app/oracle/oradata Tick Both Specify fast recovery area and enable Archieving Fast Recovery Area : Browse: /u01/app/oracle/FRA select archieve mode parameters as per video recording Tick: Automatic Archieving archieve log file format : %t_%s_%r.arc Archive LOG DESTINATIONS : LOCATION=/u01/app/oracle/FRA LISTENER selection : Status : up Database Vault and security : No change to that page Configuration option : Sizing tab: Processes : 1000 (change to 1000) Connection mode tab: dedicated server mode : by default Configure enterprise manager database express -> tick-> port 5500 2nd option : use the same administrative password for all accounts : sys Next page : Tick -> Create database Finish Reboot the Virtual machine ( don't connect immediately by sqlplus / as sysdba) Fresh login: [oracle@localhost ~]$ lsnrctl status [oracle@localhost ~]$ lsnrctl start [oracle@localhost db_1]$ sqlplus / as sysdba SQL> startup ORACLE instance started. Total System Global Area 1577057552 bytes Fixed Size 9686288 bytes Variable Size 1006632960 bytes Database Buffers 553648128 bytes Redo Buffers 7090176 bytes Database mounted. Database opened. SQL> select name, open_mode from v$database; NAME OPEN_MODE --------- -------------------- ORCL READ WRITE SQL> SQL> show con_name; CON_NAME ------------------------------ CDB$ROOT SQL> Alter session set container=ORCL; ALTER PLUGGABLE DATABASE ORCLPDB1 OPEN; ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE; CREATE OR REPLACE TRIGGER open_pdbs AFTER STARTUP ON DATABASE BEGIN EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN'; END open_pdbs; / TNSnames entry to be modified in different path : Path : /u01/app/oracle/homes/OraDB21Home1/network/admin # tnsnames.ora Network Configuration File: /u01/app/oracle/homes/OraDB21Home1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521)) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) #Add below Manually ORCLPDB1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orclpdb1) ) ) #Check the tnsping status : [oracle@localhost ~]$ tnsping orcl TNS Ping Utility for Linux: Version 21.0.0.0.0 - Production on 20-MAY-2023 23:53:40 Copyright (c) 1997, 2021, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl))) OK (10 msec) [oracle@localhost ~]$ tnsping orclpdb1 TNS Ping Utility for Linux: Version 21.0.0.0.0 - Production on 20-MAY-2023 23:53:48 Copyright (c) 1997, 2021, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orclpdb1))) OK (10 msec) [oracle@localhost ~]$ ******************************************************************** SQL> show pdbs; SQL> show pdbs; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 ORCLPDB1 READ WRITE NO SQL> alter session set container=ORCLPDB1; SQL> create user checkuser identified by test; User created. SQL> grant create session to checkuser; Grant succeeded. Download db-sample-schemas-12.2.0.1.zip from github and place under /tmp path. [oracle@localhost ~]$ cd /tmp [oracle@localhost tmp]$ unzip /tmp/db-sample-schemas-12.2.0.1.zip [oracle@localhost tmp]$ cd $ORACLE_HOME/demo/schema [oracle@localhost schema]$ cp -R /tmp/db-sample-schemas-12.2.0.1/* . oracle@localhost schema]$ pwd /u01/app/oracle/product/21c/db_1/demo/schema [oracle@localhost schema]$ perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat sqlplus sys/sys@ORCLPDB1 show con_name ORCLPDB1 sqlplus > @/u01/app/oracle/product/21c/db_1/demo/schema/mksample sys sys hrPassword1 oePassword1 pmPassword1 ixPassword1 shPassword1 biPassword1 users temp $ORACLE_HOME/demo/schema/log/ localhost:1521/orclpdb1 .... ... Index cardinality (without LOB indexes) OWNER INDEX_NAME DISTINCT_KEYS NUM_ROWS ------ ------------------------- ------------- ---------- HR COUNTRY_C_ID_PK 25 25 HR DEPT_ID_PK 27 27 HR DEPT_LOCATION_IX 7 27 HR EMP_DEPARTMENT_IX 11 106 HR EMP_EMAIL_UK 107 107 HR EMP_EMP_ID_PK 107 107 HR EMP_JOB_IX 19 107 HR EMP_MANAGER_IX 18 106 HR EMP_NAME_IX 107 107 HR JHIST_DEPARTMENT_IX 6 10 HR JHIST_EMPLOYEE_IX 7 10 HR JHIST_EMP_ID_ST_DATE_PK 10 10 HR JHIST_JOB_IX 8 10 HR JOB_ID_PK 19 19 HR LOC_CITY_IX 23 23 HR LOC_COUNTRY_IX 14 23 HR LOC_ID_PK 23 23 HR LOC_STATE_PROVINCE_IX 17 17 HR REG_ID_PK 4 4 IX AQ$_STREAMS_QUEUE_TABLE_Y 0 0 OE ACTION_TABLE_MEMBERS 132 132 OE CUSTOMERS_PK 319 319 OE CUST_ACCOUNT_MANAGER_IX 4 319 OE CUST_EMAIL_IX 319 319 OE CUST_LNAME_IX 176 319 OE CUST_UPPER_NAME_IX 319 319 OE INVENTORY_IX 1112 1112 OE INV_PRODUCT_IX 208 1112 OE ITEM_ORDER_IX 105 665 OE ITEM_PRODUCT_IX 185 665 OE LINEITEM_TABLE_MEMBERS 132 132 OE ORDER_ITEMS_PK 665 665 OE ORDER_ITEMS_UK 665 665 OE ORDER_PK 105 105 OE ORD_CUSTOMER_IX 47 105 OE ORD_ORDER_DATE_IX 105 105 OE ORD_SALES_REP_IX 9 70 OE PRD_DESC_PK 8640 8640 OE PRODUCT_INFORMATION_PK 288 288 OE PROD_NAME_IX 3727 8640 OE PROD_SUPPLIER_IX 62 288 OE PROMO_ID_PK 2 2 OE WAREHOUSES_PK 9 9 OE WHS_LOCATION_IX 9 9 PM ONLINEMEDIA_PK 0 0 PM PRINTMEDIA_PK 4 4 SH CHANNELS_PK 5 5 SH COSTS_PROD_BIX 0 0 SH COSTS_TIME_BIX 0 0 SH COUNTRIES_PK 23 23 SH CUSTOMERS_GENDER_BIX 2 5 SH CUSTOMERS_MARITAL_BIX 11 18 SH CUSTOMERS_PK 55500 55500 SH CUSTOMERS_YOB_BIX 75 75 SH DR$SUP_TEXT_IDX$KD 0 0 SH DR$SUP_TEXT_IDX$KR 0 0 SH DR$SUP_TEXT_IDX$X 0 0 SH FW_PSC_S_MV_CHAN_BIX 4 4 SH FW_PSC_S_MV_PROMO_BIX 4 4 SH FW_PSC_S_MV_SUBCAT_BIX 21 21 SH FW_PSC_S_MV_WD_BIX 210 210 SH PRODUCTS_PK 72 72 SH PRODUCTS_PROD_CAT_IX 5 72 SH PRODUCTS_PROD_STATUS_BIX 1 1 SH PRODUCTS_PROD_SUBCAT_IX 21 72 SH PROMO_PK 503 503 SH SALES_CHANNEL_BIX 4 92 SH SALES_CUST_BIX 7059 35808 SH SALES_PROD_BIX 72 1074 SH SALES_PROMO_BIX 4 54 SH SALES_TIME_BIX 1460 1460 SH SUP_TEXT_IDX SH TIMES_PK 1826 1826 73 rows selected. SQL> ***************************************************************** Connection Details in sql Developer : Name: sys@ORCLCDB user : sys pwd: sys role: sysdba hostname : ipaddress: 192.168.0.195 port : 1521 service name : orcl Name: sys@orclpdb21c user : sys pwd: sys role: sysdba hostname : ipaddress: 192.168.0.195 port : 1521 service name : orclpdb1 Normal user : hr@orclpdb21c user name : hr pwd: hrPassword1 hostname : ipaddress: 192.168.0.195 port : 1521 service name : orclpdb1 Normal user : ix@orclpdb21c user name : ix pwd: ixPassword1 hostname : ipaddress: 192.168.0.195 port : 1521 service name : orclpdb1 Normal user : bi@orclpdb21c user name : bi pwd: biPassword1 hostname : ipaddress: 192.168.0.195 port : 1521 service name : orclpdb1 ****************************start for Knowledge ********************************* Read-Only Oracle Home File Path (21c onwards) ORACLE_HOME OR SOFTWARE LOCATTION : /u01/app/oracle/product/21.0.0/dbhome_1 ORACLE_BASE: /u01/app/oracle/ ORACLE_BASE_HOME: /u01/app/oracle/homes/OraDB21Home1 ORACLE_BASE_CONFIG: /u01/app/oracle/ network: /u01/app/oracle/homes/OraDB21Home1/network/admin /u01/app/oracle/homes/OraDB21Home1/network/admin Oracle Enterprise Manager Database Express URL: https://localhost:5500/em *********************************** end for Knowledge ************************************** Every time to start the database: Login as oracle user in putty and provide the below command. [oracle@localhost ~]$ lsnrctl status [oracle@localhost ~]$ lsnrctl start [oracle@localhost db_1]$ sqlplus / as sysdba SQL> startup ORACLE instance started. Total System Global Area 1577057552 bytes Fixed Size 9686288 bytes Variable Size 1006632960 bytes Database Buffers 553648128 bytes Redo Buffers 7090176 bytes Database mounted. Database opened. OR manually start by below command as oracle user : [oracle@localhost ~]$ $ORACLE_HOME/bin/dbstart $ORACLE_HOME. Processing Database instance "orcl": log file /u01/app/oracle/homes/OraDB21Home1/rdbms/log/startup.log Processing Database instance "orclpdb1": log file /u01/app/oracle/homes/OraDB21Home1/rdbms/log/startup.log [oracle@localhost ~]$ OR ########################################################################## How to automate the oracle 21c Enterprise Edition service for startup and shutdown: Login as root user : 1. go to system path : cd /usr/lib/systemd/system 2. create a file with oracle.service name with below conent. [root@localhost system]# vi oracle.service # cd /usr/lib/systemd/system # vi oracle.service [Unit] Description=Oracle Database 21c Service After=network.target [Service] Type=simple RemainAfterExit=yes User=oracle Group=dba Environment="ORACLE_HOME=/u01/app/oracle/product/21c/db_1" ExecStart=/u01/app/oracle/product/21c/db_1/bin/dbstart $ORACLE_HOME >> 2>&1 & ExecStop=/u01/app/oracle/product/21c/db_1/bin/dbshut $ORACLE_HOME 2>&1 & TimeoutSec=120 [Install] WantedBy=multi-user.target ############################################### [root@localhost system]# ls -lrt oracle.service* -rw-r--r--. 1 root root 449 Jul 29 04:18 oracle.service [root@localhost system]# systemctl enable oracle.service Created symlink /etc/systemd/system/multi-user.target.wants/oracle.service/usr/lib/systemd/system/oracle.service. [root@localhost system]# systemctl daemon-reload [root@localhost system]# ps -ef | grep smon root 2662 2453 0 04:22 pts/1 00:00:00 grep --color=auto smon [root@localhost system]# systemctl start oracle.service [root@localhost system]# systemctl status oracle.serviceoracle.service - Oracle Database 21c Service Loaded: loaded (/usr/lib/systemd/system/oracle.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2023-07-29 04:23:02 PDT; 30s ago Main PID: 2665 (dbstart) Tasks: 61 (limit: 23804) Memory: 1.5G CGroup: /system.slice/oracle.service ├─2665 /bin/sh /u01/app/oracle/product/21c/db_1/bin/dbstart /u01/app/oracle/product/21c/db_1 >> 2>&1 & ├─2676 /u01/app/oracle/product/21c/db_1/bin/tnslsnr LISTENER -inherit ├─2722 /bin/sh /u01/app/oracle/product/21c/db_1/bin/dbstart /u01/app/oracle/product/21c/db_1 >> 2>&1 & ├─2774 sqlplus ├─2814 ora_pmon_orcl oracle 2878 1 0 04:23 ? 00:00:00 ora_smon_orcl root 3557 2453 0 04:26 pts/1 00:00:00 grep --color=auto smon [root@localhost system]#