How to Install Oracle database 23c rpm on Linux Step by Step?
Oracle 23ai download
https://www.oracle.com/database/free/get-started/
============================
Check Os !!
cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.8"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:8:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://github.com/oracle/oracle-linux"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.8
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.8
===
Set below value!! for SELinux
cat /etc/selinux/config
# 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.
# 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.
SELINUX=permissive
SELINUXTYPE=targeted
====
download pre rpm !!!
[root@oracle21 ~]# curl -L -o oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/developer/x86_64/getPackage/oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 30688 100 30688 0 0 134k 0 --:--:-- --:--:-- --:--:-- 134k
dnf -y localinstall oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
dnf -y localinstall oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm
Last metadata expiration check: 1:49:55 ago on Mon 31 Jul 2023 12:03:43 PM BST.
Dependencies resolved.
=====================================================================================================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================================================================================================
Installing:
oracle-database-preinstall-23c x86_64 1.0-0.5.el8 @commandline 30 k
Installing dependencies:
compat-openssl10 x86_64 1:1.0.2o-4.el8_6 ol8_appstream 1.1 M
libnsl x86_64 2.28-225.0.3.el8 ol8_baseos_latest 108 k
Transaction Summary
=====================================================================================================================================================================================================================
Install 3 Packages
Total size: 1.3 M
Total download size: 1.2 M
Installed size: 3.1 M
Downloading Packages:
(1/2): libnsl-2.28-225.0.3.el8.x86_64.rpm 661 kB/s | 108 kB 00:00
(2/2): compat-openssl10-1.0.2o-4.el8_6.x86_64.rpm 2.7 MB/s | 1.1 MB 00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.8 MB/s | 1.2 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : compat-openssl10-1:1.0.2o-4.el8_6.x86_64 1/3
Running scriptlet: compat-openssl10-1:1.0.2o-4.el8_6.x86_64 1/3
/sbin/ldconfig: /etc/ld.so.conf.d/kernel-5.4.17-2011.1.2.el8uek.x86_64.conf:6: hwcap directive ignored
Installing : libnsl-2.28-225.0.3.el8.x86_64 2/3
Installing : oracle-database-preinstall-23c-1.0-0.5.el8.x86_64 3/3
Running scriptlet: oracle-database-preinstall-23c-1.0-0.5.el8.x86_64 3/3
/sbin/ldconfig: /etc/ld.so.conf.d/kernel-5.4.17-2011.1.2.el8uek.x86_64.conf:6: hwcap directive ignored
Verifying : libnsl-2.28-225.0.3.el8.x86_64 1/3
Verifying : compat-openssl10-1:1.0.2o-4.el8_6.x86_64 2/3
Verifying : oracle-database-preinstall-23c-1.0-0.5.el8.x86_64 3/3
Installed:
compat-openssl10-1:1.0.2o-4.el8_6.x86_64 libnsl-2.28-225.0.3.el8.x86_64 oracle-database-preinstall-23c-1.0-0.5.el8.x86_64
Complete!
[root@oracle21 ~]#
Check below rpm
yum install sysstat compat-openssl10 glibc-devel ksh libnsl make
Last metadata expiration check: 1:52:04 ago on Mon 31 Jul 2023 12:03:43 PM BST.
Package sysstat-11.7.3-9.0.1.el8.x86_64 is already installed.
Package compat-openssl10-1:1.0.2o-4.el8_6.x86_64 is already installed.
Package glibc-devel-2.28-225.0.3.el8.x86_64 is already installed.
Package ksh-20120801-257.0.1.el8.x86_64 is already installed.
Package libnsl-2.28-225.0.3.el8.x86_64 is already installed.
Package make-1:4.2.1-11.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@oracle21 ~]#
=========================
dnf -y localinstall /root/oracle-database-free-23c-1.0-1.el8.x86_64.rpm
Last metadata expiration check: 1:56:39 ago on Mon 31 Jul 2023 12:03:43 PM BST.
Dependencies resolved.
=====================================================================================================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================================================================================================
Installing:
oracle-database-free-23c x86_64 1.0-1 @commandline 1.6 G
Transaction Summary
=====================================================================================================================================================================================================================
Install 1 Package
Total size: 1.6 G
Installed size: 5.2 G
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: oracle-database-free-23c-1.0-1.x86_64 1/1
Installing : oracle-database-free-23c-1.0-1.x86_64 1/1
Running scriptlet: oracle-database-free-23c-1.0-1.x86_64 1/1
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure Oracle Database Free, optionally modify the parameters in '/etc/sysconfig/oracle-free-23c.conf' and then run '/etc/init.d/oracle-free-23c configure' as root.
/sbin/ldconfig: /etc/ld.so.conf.d/kernel-5.4.17-2011.1.2.el8uek.x86_64.conf:6: hwcap directive ignored
Verifying : oracle-database-free-23c-1.0-1.x86_64 1/1
Installed:
oracle-database-free-23c-1.0-1.x86_64
Complete!
[root@oracle21 ~]#
[root@oracle21 ~]#
[root@oracle21 ~]# ls -ltr /etc/init.d/oracle-free-23c
-r-xr-xr-x. 1 root root 19880 Mar 26 06:02 /etc/init.d/oracle-free-23c
[root@oracle21 ~]# cat /etc/init.d/oracle-free-23c
[root@oracle21 ~]# ls -ltr /opt/oracle/product/23c/dbhomeFree/
total 72
-rw-r--r--. 1 oracle oinstall 852 Aug 18 2015 env.ora
-rw-r--r--. 1 oracle oinstall 2927 Jul 20 2020 schagent.conf
-rwxr-x---. 1 oracle oinstall 1991 Jan 19 2022 runInstaller
-rw-r--r--. 1 oracle oinstall 878 Jul 15 2022 ss_oracle.sdo.acl
-rwx------. 1 oracle oinstall 519 Mar 26 06:01 root.sh
-rwxrwxr-x. 1 oracle oinstall 5780 Mar 26 06:02 LICENSE
=======
create Quick database !!!!
# export DB_PASSWORD=sys
# (echo "${DB_PASSWORD}"; echo "${DB_PASSWORD}";) | /etc/init.d/oracle-free-23c configure
[root@oracle21 ~]# export DB_PASSWORD=sys
[root@oracle21 ~]# (echo "${DB_PASSWORD}"; echo "${DB_PASSWORD}";) | /etc/init.d/oracle-free-23c configure
Specify a password to be used for database accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
========
[root@oracle21 ~]# ps -ef|grep -i smon
oracle 153252 1 0 14:26 ? 00:00:00 db_smon_FREE
root 153755 150622 0 14:31 pts/2 00:00:00 grep --color=auto -i smon
[root@oracle21 ~]# su - oracle
[oracle@oracle21 ~]$ cat /etc/oratab
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
FREE:/opt/oracle/product/23c/dbhomeFree:N
[oracle@oracle21 ~]$
[oracle@oracle21 ~]$ sqlplus / as sysdba
SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Mon Jul 31 14:32:31 2023
Version 23.2.0.0.0
Copyright (c) 1982, 2023, Oracle. All rights reserved.
Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 FREEPDB1 READ WRITE NO
SQL>
===
set profile
su - oracle
[oracle@dbdocs ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
umask 022
ORACLE_SID=FREE
ORACLE_BASE=/opt/oracle
ORACLE_HOME=$ORACLE_BASE/product/23c/dbhomeFree
LD_LIBRARY_PATH=$ORACLE_HOME/lib
TMP=/tmp
TMPDIR=/tmp
PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
export ORACLE_SID ORACLE_BASE ORACLE_HOME LD_LIBRARY_PATH TMP TMPDIR PATH
SQL> !echo $ORACLE_BASE
/opt/oracle
SQL> !echo $ORACLE_HOME
/opt/oracle/product/23c/dbhomeFree
[root@oracle21 ~]# su - oracle
[oracle@oracle21 ~]$ sqlplus / as sysdba
SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Mon Jul 31 15:02:53 2023
Version 23.2.0.0.0
Copyright (c) 1982, 2023, Oracle. All rights reserved.
Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
SQL> Disconnected from Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
lsnrctl status
LSNRCTL for Linux: Version 23.0.0.0.0 - Developer-Release on 31-JUL-2023 15:09:14
Copyright (c) 1991, 2023, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DESKTOP-9U3H4SE)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 23.0.0.0.0 - Developer-Release
Start Date 31-JUL-2023 14:12:06
Uptime 0 days 0 hr. 57 min. 7 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service FREE
Listener Parameter File /opt/oracle/product/23c/dbhomeFree/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/oracle21/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle21)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "01c963f8fcc157c8e0655cf8e99edab2" has 1 instance(s).
Instance "FREE", status READY, has 1 handler(s) for this service...
Service "FREE" has 1 instance(s).
Instance "FREE", status READY, has 1 handler(s) for this service...
Service "FREEXDB" has 1 instance(s).
Instance "FREE", status READY, has 1 handler(s) for this service...
Service "freepdb1" has 1 instance(s). ----<<<<<<<<<<<<<<<<<<<<<< pdb!!!!!
Instance "FREE", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oracle21 admin]$
pwd
/opt/oracle/product/23c/dbhomeFree/network/admin
[oracle@oracle21 admin]$ ls -ltr
total 16
-rw-r--r--. 1 oracle oinstall 1866 May 19 2021 shrept.lst
drwxr-xr-x. 2 oracle oinstall 64 Jul 31 14:05 samples
-rw-r-----. 1 oracle oinstall 190 Jul 31 14:12 sqlnet.ora
-rw-r-----. 1 oracle oinstall 371 Jul 31 14:12 listener.ora
-rw-r-----. 1 oracle oinstall 415 Jul 31 14:18 tnsnames.ora
[oracle@oracle21 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle/product/23c/dbhomeFree/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
FREE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-9U3H4SE)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = FREE)
)
)
LISTENER_FREE =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-9U3H4SE)(PORT = 1521))
-rw-r-----. 1 oracle oinstall 371 Jul 31 14:12 listener.ora
-rw-r-----. 1 oracle oinstall 415 Jul 31 14:18 tnsnames.ora
[oracle@oracle21 admin]$ cat listener.ora
# listener.ora Network Configuration File: /opt/oracle/product/23c/dbhomeFree/network/admin/listener.ora
# Generated by Oracle configuration tools.
DEFAULT_SERVICE_LISTENER = FREE
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-9U3H4SE)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
[oracle@oracle21 ~]$ sqlplus sys/sys@//localhost:1521/freepdb1 as sysdba
SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Mon Jul 31 15:05:18 2023
Version 23.2.0.0.0
Copyright (c) 1982, 2023, Oracle. All rights reserved.
Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
SQL>
======
How to rename a Pluggable Database?
show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 FREEPDB1 READ WRITE NO
col FILE_NAME for a50
select FILE_ID,FILE_NAME from dba_data_files;
FILE_ID FILE_NAME
---------- --------------------------------------------------
12 /opt/oracle/oradata/FREE/FREEPDB1/system01.dbf
13 /opt/oracle/oradata/FREE/FREEPDB1/sysaux01.dbf
14 /opt/oracle/oradata/FREE/FREEPDB1/undotbs01.dbf
15 /opt/oracle/oradata/FREE/FREEPDB1/users01.dbf
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 FREEPDB1 READ WRITE NO
alter pluggable database FREEPDB1 close immediate;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 FREEPDB1 MOUNTED
alter pluggable database FREEPDB1 open restricted;
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 FREEPDB1 READ WRITE YES
SQL>
connect FREEPDB1 as sysdba
SQL>
connect FREEPDB1 as sysdba
Enter password:
Connected.
alter pluggable database FREEPDB1 rename global_name to anuj;
SQL>
alter pluggable database FREEPDB1 rename global_name to anuj;
Pluggable database altered.
show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ANUJ READ WRITE YES
SQL> alter session set container=ANUJ ;
Session altered.
col FILE_NAME for a50
select FILE_ID,FILE_NAME from dba_data_files;SQL> SQL>
FILE_ID FILE_NAME
---------- --------------------------------------------------
12 /opt/oracle/oradata/FREE/FREEPDB1/system01.dbf
13 /opt/oracle/oradata/FREE/FREEPDB1/sysaux01.dbf
14 /opt/oracle/oradata/FREE/FREEPDB1/undotbs01.dbf
15 /opt/oracle/oradata/FREE/FREEPDB1/users01.dbf
All the fils are in same location !!!!
mkdir /u02/oradata/CDB2/hugo
SQL> ALTER DATABASE MOVE DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/system01.dbf' TO '/opt/oracle/oradata/FREE/ANUJ/system01.dbf';
ALTER DATABASE MOVE DATAFILE '/opt/oracle/oradata/FREE/FREEPDB1/system01.dbf' TO '/opt/oracle/oradata/FREE/ANUJ/system01.dbf'
*
ERROR at line 1:
ORA-00439: feature not enabled: online move datafile
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 ANUJ READ WRITE YES
SQL> shutdown immediate ;
Pluggable Database closed.
SQL> startup;
Pluggable Database opened.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 ANUJ READ WRITE NO
SQL>
SQL> !oerr ora 439
00439, 00000, "feature not enabled: %s"
// *Cause: The specified feature was not enabled.
// *Action: Do not attempt to use this feature.
SQL> Disconnected from Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
[oracle@oracle21 ~]$ sqlplus / as sysdba
SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Mon Jul 31 18:47:41 2023
Version 23.2.0.0.0
Copyright (c) 1982, 2023, Oracle. All rights reserved.
Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release <<<<< This feature in not enabled .
Version 23.2.0.0.0
No comments:
Post a Comment