Wednesday, September 28, 2022

RPM based Oracle 19c Database installation and Creation in RHEL7 64bit

 RPM-based Oracle 19c Database installation and Creation in RHEL7 64bit

Installed few OS important rpm first. Please download rpm software from the oracle site.

[root@db101 Packages]# rpm -ivh ksh-20120801-19.el7.x86_64.rpm
warning: ksh-20120801-19.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:ksh-20120801-19.el7              ################################# [100%]

[root@db101 Packages]# rpm -ivh libaio-devel-0.3.109-12.el7.x86_64.rpm
warning: libaio-devel-0.3.109-12.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:libaio-devel-0.3.109-12.el7      ################################# [100%]

[root@db101 Packages]# rpm -ivh libaio-0.3.109-12.el7.x86_64.rpm
warning: libaio-0.3.109-12.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
        package libaio-0.3.109-12.el7.x86_64 is already installed

[root@db101 GRID]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64\ \(1\).rpm
warning: compat-libstdc++-33-3.2.3-72.el7.x86_64 (1).rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:compat-libstdc++-33-3.2.3-72.el7 ################################# [100%]
Download preinstall RPM from Oracle as mentioned below:
https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

[root@db101 GRID]# rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracle-database-preinstall-19c-1.################################# [100%]
[root@db101 GRID]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
warning: oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
        installing package oracle-database-ee-19c-1.0-1.x86_64 needs 2055MB on the / filesystem
[root@db101 GRID]#

Solution - Cleanup/mount to have enough space and proceed ahead.

[root@db101 GRID]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
warning: oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
[SEVERE] The install cannot proceed because ORACLE_BASE directory (/opt/oracle)
is not owned by "oracle" user. You must change the ownership of ORACLE_BASE
directory to "oracle" user and retry the installation.
error: %pre(oracle-database-ee-19c-1.0-1.x86_64) scriptlet failed, exit status 1
error: oracle-database-ee-19c-1.0-1.x86_64: install failed
[root@db101 GRID]# 

Solution - Change the permission of /opt and proceed ahead.

Now running main installation rpm:

[root@db101 GRID]# rpm -ivh oracle-database-ee-19c-1.0-1.x86_64.rpm
warning: oracle-database-ee-19c-1.0-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracle-database-ee-19c-1.0-1     ################################# [100%]
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure

[root@db101 GRID]# /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.

And here is the magic:

[oracle@db101 ~]$ ps -ef|grep pmon
oracle    44672      1  0 21:02 ?        00:00:00 ora_pmon_ORCLCDB
oracle    45135  45088  0 21:06 pts/1    00:00:00 grep --color=auto pmon

[oracle@db101 ~]$ ps -ef|grep tns
root        274      2  0 08:45 ?        00:00:00 [netns]
oracle    41638      1  0 20:43 ?        00:00:00 /opt/oracle/product/19c/dbhome_1/bin/tnslsnr LISTENER -inherit
oracle    45137  45088  0 21:06 pts/1    00:00:00 grep --color=auto tns

SQL> select name,open_mode,database_role from v$database;
NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ORCLCDB   READ WRITE           PRIMARY

[oracle@db101 ~]$ lsnrctl status LISTENER
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db101.test.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                22-Aug-2021 20:43:53
Uptime                    0 days 0 hr. 23 min. 46 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/db101/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db101.test.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=db101.test.com)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/ORCLCDB/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "ORCLCDB" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "ORCLCDBXDB" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "e9bf7aa0b829afd5e0535289a8c0e740" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "orclpdb1" has 1 instance(s).
  Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
The command completed successfully



Thursday, September 22, 2022

Undo tablespace usage

 Below are the undo tablespace usage sql queries

1.

select a.sid, a.serial#, a.username, b.used_urec used_undo_record, b.used_ublk used_undo_blocks
from v$session a, v$transaction b
where a.saddr=b.ses_addr ;

2.

select
s.sid,s.serial#,
NVL(s.username, 'NA') orauser,
s.program,r.name undoseg,
t.used_ublk * TO_NUMBER(x.value)/1024||'K' "Undo"
from
sys.v_$rollname r,
sys.v_$session s,
sys.v_$transaction t,
sys.v_$parameter x
where s.taddr = t.addr
AND r.usn = t.xidusn(+)
AND x.name = 'db_block_size';

3.

SET LINESIZE 200
COLUMN username FORMAT A15
SELECT s.username,
       s.sid,
       s.serial#,
       t.used_ublk,
       t.used_urec,
       rs.segment_name,
       r.rssize,
       r.status
FROM   v$transaction t,
       v$session s,
       v$rollstat r,
       dba_rollback_segs rs
WHERE  s.saddr = t.ses_addr
AND    t.xidusn = r.usn
AND    rs.segment_id = t.xidusn
ORDER BY t.used_ublk DESC;

4.

SELECT s.inst_id,
        r.name                   rbs,
        nvl(s.username, ‘None’)  oracle_user,
        s.osuser                 client_user,
        p.username               unix_user,
        to_char(s.sid)||’,’||to_char(s.serial#) as sid_serial,
        p.spid                   unix_pid,
        TO_CHAR(s.logon_time, ‘mm/dd/yy hh24:mi:ss’) as login_time,
        t.used_ublk * 8192  as undo_BYTES,
                st.sql_text as sql_text
   FROM gv$process     p,
        v$rollname     r,
        gv$session     s,
        gv$transaction t,
        gv$sqlarea     st
  WHERE p.inst_id=s.inst_id
    AND p.inst_id=t.inst_id
    AND s.inst_id=st.inst_id
    AND s.taddr = t.addr
    AND s.paddr = p.addr(+)
    AND r.usn   = t.xidusn(+)
    AND s.sql_address = st.address
  AND t.used_ublk * 8192 > 1073741824
  ORDER
       BY undo_BYTES desc
/

5.
select s.sid, t.name, s.value
from v$sesstat s, v$statname t
where s.statistic#=t.statistic#
and t.name='undo change vector size'
order by s.value desc;

6.
select sql.sql_text, t.used_urec records, t.used_ublk blocks,
(t.used_ublk*8192/1024) kb from v$transaction t,
v$session s, v$sql sql
where t.addr=s.taddr
and s.sql_id = sql.sql_id
and s.username ='&USERNAME';

7.
select SID,PROGRAM from v$session where TYPE='BACKGROUND';

8.
col machine for a10;
select  s.sid,s.serial#,username,s.machine,
t.used_ublk ,t.used_urec,(rs.rssize)/1024/1024 MB,rn.name
from    v$transaction t,v$session s,v$rollstat rs, v$rollname rn
where   t.addr=s.taddr and rs.usn=rn.usn and rs.usn=t.xidusn and rs.xacts>0;

Wednesday, September 14, 2022

While startup "ORA-00845: MEMORY_TARGET not supported on this system"

 While Startup got "While startup "ORA-00845: MEMORY_TARGET not supported on this system"


SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system

Solution - on Linux not enough space allocated to /dev/shm during setup as below:

tmpfs                  1.4G   96K  1.4G   1% /dev/shm   >> Need to increase it


Solution:

[root@oranode1 ~]# mount -t tmpfs shmfs -o size=2048m /dev/shm

[oracle@oranode1 ~]$ df -h /dev/shm
Filesystem      Size  Used Avail Use% Mounted on
shmfs           2.0G  1.5G  576M  72% /dev/shm

After above DB came up fine:

[oracle@oranode1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed Feb 13 07:55:47 2020
Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 1593835520 bytes
Fixed Size                  8621184 bytes
Variable Size            1459618688 bytes
Database Buffers          117440512 bytes
Redo Buffers                8155136 bytes
Database mounted.
Database opened.
SQL>


Thanks



Tuesday, September 13, 2022

Oralce Golden Gate few known issue

Below are the few known issue which we have encountered and it is documented in Oracle. 


Issue - ggsci: error while loading shared libraries: libnnz12.so: cannot open shared object file: No such file or directory

Solution - LD_LIBRARY_PATH should contain oracle client path.


[oracle@oranode1 ~]$ ggsci

ggsci: error while loading shared libraries: libnnz12.so: cannot open shared object file: No such file or directory

[oracle@oranode1 ~]$ echo $LD_LIBRARY_PATH

/u02/app/gg_home/lib:

[oracle@oranode1 ~]$ export LD_LIBRARY_PATH=/u02/app/gg_home/lib:/u02/app/oracle/product/12.2.0/dbhome_1/lib

[oracle@oranode1 ~]$ ggsci



Oracle GoldenGate Command Interpreter for Oracle

Version 12.2.0.2.2 OGGCORE_12.2.0.2.0_PLATFORMS_170630.0419_FBO

Linux, x64, 64bit (optimized), Oracle 12c on Jun 30 2017 16:12:28

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2017, Oracle and/or its affiliates. All rights reserved.

GGSCI (oranode1.test.com) 1> 


Able to login . 

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

Issue - Cannot load ICU resource bundle 'ggMessage', error code 2 - No such file or directory

Solution - permission issue on ggMessage.dat file.


[oracle@oranode1 ~]$ ggsci

Cannot load ICU resource bundle 'ggMessage', error code 2 - No such file or directory

Aborted (core dumped)

[oracle@oranode1 ~]$ cd $GG_HOME

[oracle@oranode1 gg_home]$ ls -ltr *.dat

-rw-r-----. 1 oracle oracle 43150372 Jun 30  2017 ggparam.dat

-rw-r-----. 1 oracle oracle  1866528 Jun 30  2017 ggMessage.dat

[oracle@oranode1 gg_home]$ chmod 775 ggMessage.dat ggparam.dat

[oracle@oranode1 gg_home]$ ggsci


Oracle GoldenGate Command Interpreter for Oracle

Version 12.2.0.2.2 OGGCORE_12.2.0.2.0_PLATFORMS_170630.0419_FBO

Linux, x64, 64bit (optimized), Oracle 12c on Jun 30 2017 16:12:28

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2017, Oracle and/or its affiliates. All rights reserved.


GGSCI (oranode1.test.com) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING

GGSCI (oranode1.test.com) 2> exit





Thanks

Oracle 12c runInstaller pre-check failed - ( Soft Limit - Maximum stack size )

 Oracle 12c runInstaller pre-check failed - ( Soft Limit - Maximum stack size )


During the run of 12c runInstaller we got below error:







As a super user ran below:

ulimit -Ss 10240

and set the below on /etc/security/limits.conf

oracle soft stack 10240


Rerun the runInstaller.

Thanks,


PRVF-0002 while running 12c runInstaller

 PRVF-0002 while running runInstaller


While running 12c runInstaller you might get below error:



This error might come if you haven't set host entries like below:

[root@oranode1 software]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.135.40 oranode1.test.com oranode1


So update /etc/hosts using super user and run the runInstaller again.



Thanks,



Sunday, September 11, 2022

Be careful while remove the /var/tmp/.oracle directory .. RAC hidden socket information

 Be careful while remove the /var/tmp/.oracle directory .. RAC hidden socket information


    Sometimes oracle suggests you remove files from the .oracle directory. Be careful while removing the contents from this hidden directory. We had landed one scenario where one of the colleagues removed the .oracle directory. Good thing is that it was in test instance.

Impact - Clusterware services are not coming up

Solution:

Stop all the clusterware services from all the nodes.

Create the directory  and give the permission. 

cd /var/tmp
mkdir .oracle
chmod 01777 .oracle


After above action plan services came up fine.


Thanks,
SM