Monday, April 29, 2024

Restore a snapshot in elasticsearch

Suppose you want to restore indice software on another machine. Move the snap pieces and create same repository as in source. After that execute below command which will restore "Software" indices.


 [elk@elknode2 backup]$ curl -X POST "http://localhost:9200/_snapshot/esbackup/29thapril_snapshot/_restore?pretty" -H 'Content-Type: application/json' -d'

{

"indices": "software"

}'


Above should return as below:


{

  "accepted" : true

}


Wednesday, April 24, 2024

Postgres installation on different mount point other than default installation

 1) Download PostgreSQL:website: https://www.postgresql.org/ftp/source/ 


2) Download file and place on required directory.


3) complete installation step by step.


cd /software

tar -xvzf postgresql-14.0.tar.gz

cd postgresql-14.0

mkdir -p /u01/postgres/v14

cd /software/postgresql-14.0

./configure --prefix=/u01/postgres/v14

make

make install

Now you will find complete bin on /u01/postgres/v14

cd /u01/postgres/v14/bin >> Verify if contents are showing

cd /u01/postgres/v14

mkdir data

cd data

chown -R postgres:postgres /u01/postgres/v14/data


4) Now create data directory using below command:

sudo -u postgres /u01/postgres/v14/bin/initdb -D /u01/postgres/v14/data

5) Above all done using root or priv users. Now switch user:

su - postgres

Go to location and start PG server:

cd /u01/postgres/v14/data

/u01/postgres/v14/bin/pg_ctl -D /u01/postgres/v14/data -l logfile start


Check processes using below:
ps -ef|grep postgres

psql 
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

while connecting to db getting this error.

6) Below changes in "postgresql.conf" 

listen_addresses = '*'  
max_connections = 100 
unix_socket_directories = '/tmp' 
log_destination = 'stderr'
logging_collector = on 
log_directory = 'log'  
log_filename = 'postgresql-%a.log'


7) RESTART SERVER

.bash_profile
export PGHOST=/tmp
/u01/postgres/v14/bin/pg_ctl -D /u01/postgres/v14/data restart

You should be login to PG server using psql now.





Tuesday, April 23, 2024

Create a ssh key for different users and suders privilege for the users. ( Oracle Cloud)

      1) Use puttygen to generate private and public keys. Save both private and public keys.
 2)     On server go to .ssh directory under user home. Here creates a file name  authorized_keys and copy the private key content here.
 3)     Give permission 600 to authorized_keys.
 4)      In file /etc/ssh/sshd_config add below lines
   AllowUsers opc postgres elk 

a    Also need to add users in /etc/sudoers file

%oracle ALL=(ALL) NOPASSWD: ALL

 5)      systemctl restart sshd


Thursday, April 18, 2024

Take backup of elasticsearch using curl command

Add below path ( as per directory structure) to yml file. 


[elk@PGNODE1 ~]$ cat /u01/elasticsearch-8.13.1/config/elasticsearch.yml

path.repo: ["/u01/backup"]


Restart Elasticsearch services.


[elk@PGNODE1 ~]$ curl -XPUT -H "content-type:application/json" 'http://localhost:9200/_snapshot/esbackup' -d '{"type":"fs","settings":{"location":"/u01/backup","compress":true}}'

{"acknowledged":true}[elk@PGNODE1 ~]$

[elk@PGNODE1 ~]$

[elk@PGNODE1 ~]$ curl -XGET 'http://localhost:9200/_snapshot/_all?pretty'

{

  "esbackup" : {

    "type" : "fs",

    "settings" : {

      "compress" : "true",

      "location" : "/u01/backup"

    }

  }

}

[elk@PGNODE1 ~]$ curl -XGET 'http://localhost:9200/_cat/indices'

yellow open song     U-bMfpDvR-mBYC0D00bhVg 1 1 0 0 249b 249b 249b

yellow open hardware akZTxoR4QmWSzdoOCNzcIg 1 1 0 0 249b 249b 249b

[elk@PGNODE1 ~]$ curl -XPUT 'http://localhost:9200/_snapshot/esbackup/first-snapshot?wait_for_completion=true'

{"snapshot":{"snapshot":"first-snapshot","uuid":"fGBkr1i4Qi-F1RH9PI1xng","repository":"esbackup","version_id":8503000,"version":"8503000","indices":[".ds-ilm-history-7-2024.04.09-000001",".internal.alerts-observability.apm.alerts-default-000001",".apm-custom-link",".internal.alerts-default.alerts-default-000001",".internal.alerts-observability.slo.alerts-default-000001",".ds-.kibana-event-log-ds-2024.04.18-000002",".internal.alerts-security.alerts-default-000001",".kibana_security_session_1",".kibana_task_manager_8.13.2_001",".internal.alerts-observability.logs.alerts-default-000001",".kibana_alerting_cases_8.13.2_001",".internal.alerts-ml.anomaly-detection.alerts-default-000001",".internal.alerts-transform.health.alerts-default-000001",".internal.alerts-observability.metrics.alerts-default-000001","song",".kibana_security_solution_8.13.2_001",".internal.alerts-observability.uptime.alerts-default-000001",".kibana-observability-ai-assistant-kb-000001",".security-7","hardware",".internal.alerts-observability.threshold.alerts-default-000001",".slo-observability.summary-v3.temp",".slo-observability.sli-v3",".kibana_ingest_8.13.2_001",".security-profile-8",".internal.alerts-ml.anomaly-detection-health.alerts-default-000001",".ds-ilm-history-7-2024.04.18-000002",".slo-observability.summary-v3",".internal.alerts-stack.alerts-default-000001",".apm-agent-configuration",".kibana_analytics_8.13.2_001",".apm-source-map",".kibana-observability-ai-assistant-conversations-000001",".kibana_8.13.2_001",".ds-.kibana-event-log-ds-2024.04.09-000001"],"data_streams":["ilm-history-7",".kibana-event-log-ds"],"include_global_state":true,"state":"SUCCESS","start_time":"2024-04-18T12:47:09.069Z","start_time_in_millis":1713444429069,"end_time":"2024-04-18T12:47:09.878Z","end_time_in_millis":1713444429878,"duration_in_millis":809,"failures":[],"shards":{"total":35,"failed":0,"successful":35},"feature_states":[{"feature_name":"security","indices":[".security-7",".security-profile-8"]},{"feature_name":"kibana","indices":[".kibana_ingest_8.13.2_001",".kibana_security_solution_8.13.2_001",".kibana_8.13.2_001",".kibana_alerting_cases_8.13.2_001",".kibana_analytics_8.13.2_001",".apm-custom-link",".apm-agent-configuration",".kibana_task_manager_8.13.2_001",".kibana_security_session_1"]}]}}[elk@PGNODE1 ~]$ curl -XGET 'http://localhost:9200/_snapshot/esbackup/_all?pretty'

{

  "snapshots" : [

    {

      "snapshot" : "first-snapshot",

      "uuid" : "fGBkr1i4Qi-F1RH9PI1xng",

      "repository" : "esbackup",

      "version_id" : 8503000,

      "version" : "8503000",

      "indices" : [

        ".ds-ilm-history-7-2024.04.09-000001",

        ".internal.alerts-observability.apm.alerts-default-000001",

        ".apm-custom-link",

        ".internal.alerts-default.alerts-default-000001",

        ".internal.alerts-observability.slo.alerts-default-000001",

        ".ds-.kibana-event-log-ds-2024.04.18-000002",

        ".internal.alerts-security.alerts-default-000001",

        ".kibana_security_session_1",

        ".kibana_task_manager_8.13.2_001",

        ".internal.alerts-observability.logs.alerts-default-000001",

        ".kibana_alerting_cases_8.13.2_001",

        ".internal.alerts-ml.anomaly-detection.alerts-default-000001",

        ".internal.alerts-transform.health.alerts-default-000001",

        ".internal.alerts-observability.metrics.alerts-default-000001",

        "song",

        ".kibana_security_solution_8.13.2_001",

        ".internal.alerts-observability.uptime.alerts-default-000001",

        ".kibana-observability-ai-assistant-kb-000001",

        ".security-7",

        "hardware",

        ".internal.alerts-observability.threshold.alerts-default-000001",

        ".slo-observability.summary-v3.temp",

        ".slo-observability.sli-v3",

        ".kibana_ingest_8.13.2_001",

        ".security-profile-8",

        ".internal.alerts-ml.anomaly-detection-health.alerts-default-000001",

        ".ds-ilm-history-7-2024.04.18-000002",

        ".slo-observability.summary-v3",

        ".internal.alerts-stack.alerts-default-000001",

        ".apm-agent-configuration",

        ".kibana_analytics_8.13.2_001",

        ".apm-source-map",

        ".kibana-observability-ai-assistant-conversations-000001",

        ".kibana_8.13.2_001",

        ".ds-.kibana-event-log-ds-2024.04.09-000001"

      ],

      "data_streams" : [

        "ilm-history-7",

        ".kibana-event-log-ds"

      ],

      "include_global_state" : true,

      "state" : "SUCCESS",

      "start_time" : "2024-04-18T12:47:09.069Z",

      "start_time_in_millis" : 1713444429069,

      "end_time" : "2024-04-18T12:47:09.878Z",

      "end_time_in_millis" : 1713444429878,

      "duration_in_millis" : 809,

      "failures" : [ ],

      "shards" : {

        "total" : 35,

        "failed" : 0,

        "successful" : 35

      },

      "feature_states" : [

        {

          "feature_name" : "security",

          "indices" : [

            ".security-7",

            ".security-profile-8"

          ]

        },

        {

          "feature_name" : "kibana",

          "indices" : [

            ".kibana_ingest_8.13.2_001",

            ".kibana_security_solution_8.13.2_001",

            ".kibana_8.13.2_001",

            ".kibana_alerting_cases_8.13.2_001",

            ".kibana_analytics_8.13.2_001",

            ".apm-custom-link",

            ".apm-agent-configuration",

            ".kibana_task_manager_8.13.2_001",

            ".kibana_security_session_1"

          ]

        }

      ]

    }

  ],

  "total" : 1,

  "remaining" : 0

}




Thanks,
searchinoracle

Saturday, October 14, 2023

ORA-24454: client host name is not set

 ORA-24454: client host name is not set


SQL> shut abort
ORACLE instance shut down.
ERROR:
ORA-24454: client host name is not set

Solution:
In our case issue related to /etc/hosts file has wrong value for the database server.

Thanks,


RMAN Cold backup restoration ( rman cold backup and then restore using rman)

 
Below can be followed for rman cold backup restoration ( Rare scenario)
=====================================================

From Source:
-----------
1. shut immediate;
2. startup mount;
3. Take rman backup using below script
rman target / 
spool log to '/backup/db_mig/DB_COLD_BKP.log'
run { 
allocate channel c1 device type disk ;
allocate channel c2 device type disk ;
allocate channel c3 device type disk ;
allocate channel c4 device type disk ;
backup database tag='COLD_BKP' format '/backup/db_mig/DB_COLD_s%s_p%p-t%T.bck';
backup tag='COLD_BKP' format '/backup/db_mig/%d_cfile_s%s_p%p_open.bck' current controlfile;
backup tag DB_CTL current controlfile format '/backup/db_mig/%d_%T_%s_%p_CONTROL';
backup spfile format '/backup/db_mig/%d_spfile_s%s_p%p_%T_dbid%I.rman';
sql 'alter database backup controlfile to TRACE';
release channel c1;  
release channel c2;
release channel c3;
release channel c4;
}

4. Copy the backup pieces to Target server.


Now go to Target server
===========================
Make sure you are in Target database.

If Target database is up and running then:
5. shut immediate;
6. startup mount restrict;
7. drop database;
8. startup nomount pfile='pfile.ora'
9. Restore using below for rman cold backup restore.
rman  auxiliary /
run
{
ALLOCATE AUXILIARY CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL c2 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL c3 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL c4 DEVICE TYPE DISK;
SET NEWNAME FOR DATABASE   TO '/u01/inttest/data/%b';
DUPLICATE target DATABASE TO  'INTTEST' backup location ='/u02/RMAN_BKP' nofilenamecheck noredo;
}
10. Validate it.



Thanks

Monday, September 18, 2023

Could not obtain an exclusive lock to the embedded LDAP data files

EBS weblogic not coming up : Could not obtain an exclusive lock to the embedded LDAP data files


Remove lok files from Domain/Servers/AdminServer/Ldap/ location.

Clear the tmp and cache directory from AdminServer.


It came up fine.


Oracle EBS 12.2 weblogic admin server taking huge time

 Oracle EBS 12.2 weblogic admin server taking huge time


Admin server taking a huge time to come up in Solaris:

Issue due to tmp directory getting huge size. 

cd /var
mv tmp tmp_old

Friday, May 12, 2023

Concurrent Program is running more than 120 mins

 Concurrent Program is running more than 120 mins / 2 Hours


set pagesize 1000
set pause off
set linesize 150
column fcr.request_id format a10 heading 'RQST_ID'
column fu.user_name format a10 heading 'Username'
column fr.responsibility_name format a35 heading 'Resp Name'
column fcp.user_concurrent_program_name format a40 heading 'Program Name'
column fcr.actual_start_date format a30 heading 'Start Date'
column fcr.status.code heading 'Status'
column fcr.actual_start_date format a10 heading 'Runtime Minutes'
column fcr.os_process_id format a15 heading 'SID, SERIAL'
column fcr.os_process_id format a10 heading 'SPID'
column fcr.os_process_id format a10 heading 'OS PID'
prompt
SELECT   fcr.request_id rqst_id
        ,fu.user_name
        ,fr.responsibility_name
        ,fcp.user_concurrent_program_name program_name
        ,TO_CHAR (fcr.actual_start_date, 'DD-MON-YYYY HH24:MI:SS')start_datetime
        ,DECODE (fcr.status_code, 'R', 'R:Running', fcr.status_code) status
        ,ROUND (((SYSDATE - fcr.actual_start_date) * 60 * 24), 2) runtime_min
        ,fcr.oracle_process_id "SPID"
        ,fcr.os_process_id os_pid
    FROM apps.fnd_concurrent_requests fcr
        ,apps.fnd_user fu
        ,apps.fnd_responsibility_vl fr
        ,apps.fnd_concurrent_programs_vl fcp
   WHERE fcr.status_code LIKE 'R'
     AND fu.user_id = fcr.requested_by
     AND fr.responsibility_id = fcr.responsibility_id
     AND fcr.concurrent_program_id = fcp.concurrent_program_id
     AND fcr.program_application_id = fcp.application_id
     AND ROUND (((SYSDATE - fcr.actual_start_date) * 60 * 24), 2) > 120
ORDER BY fcr.concurrent_program_id
        ,request_id DESC;

SQL to get currently running Concurrent Program

 SQL to get currently running Concurrent Program


set pages 200
set lines 200
col Manager_Name for a15;
col User_Name for a20;
col Manager_Name for a10;
col Program for a30;
col OSprocess for a10;
col LocalProcess for a12;
Select /*+ RULE */ substr(Concurrent_Queue_Name,1,12) Manager_Name,
       Request_Id Request, User_Name,
       fpro.OS_PROCESS_ID OSprocess,
      fcr.oracle_process_id LocalProcess,
       substr(Concurrent_Program_Name,1,35) Program, Status_code,
       To_Char(Actual_Start_Date, 'DD-MON-YY HH24:MI') Started
       from apps.Fnd_Concurrent_Queues fcq, apps.Fnd_Concurrent_Requests fcr,
      apps.Fnd_Concurrent_Programs fcp, apps.Fnd_User Fu, apps.Fnd_Concurrent_Processes fpro
       WHERE
       Phase_Code = 'R' And
       Status_Code <> 'W' And
       fcr.Controlling_Manager = Concurrent_Process_Id       And
      (fcq.Concurrent_Queue_Id = fpro.Concurrent_Queue_Id    And
       fcq.Application_Id      = fpro.Queue_Application_Id ) And
      (fcr.Concurrent_Program_Id = fcp.Concurrent_Program_Id And
       fcr.Program_Application_Id = fcp.Application_Id )     And
       fcr.Requested_By = User_Id
       order by Started; 

Oracle EBS Log/Out files suddenly stopped working and showing blank page

 Oracle EBS Log/Out files suddenly stopped working and showing blank page


User starting complaining that they unable to see output of reports. When we submited the active users and facing the issue. 

Cause of the issue:

txkFNDWRR.pl 1 KB size in location $EBS_ORACLE_HOME/common/scripts.

File looks corrupted. 

Solution: We have copied the file from Non-Prod and it started working 

Saturday, February 25, 2023

Unable to find an Output Post Processor service to post-process request

 

Unable to find an Output Post Processor service to post-process request


Issue due to OPP shutdown was abnormal. Showing Pending state in Internal Manager.
From backend updated all the pending request to completed for Internal Manager.
Then took complete CM bounce.
Ran CMCLEAN.

After above action plan issue got resolved.

Thanks,

ORA-12547 TNS lost contact - During Listener startup

 ORA-12547 TNS lost contact - During Listener startup


Issue due to SQLNET.ORA file has tcp_validate_nodes enables, after disabled it it came up fine.

This issue can be because of many reasons as documented in Doc ID 555565.1


Thanks,




ORA-27271: szingroup: group lookup failure - During Instance startup

 

ORA-27271: szingroup: group lookup failure


In one of clone instance, we found after OS bounce oracle user group got changed. 
Fixed the OS issue using usermod command.
Still issue was coming so we did oracle home clone and that fixed the issue, we able to start the database.

Thanks,

Thursday, December 8, 2022

Kafka installation and setup

 Kafka installation and setup


Once you unzipped Kafka tar create below data directory:

Datadir:
================
/u03/kafkadata1
/u03/kafkadata2
/u03/kafkadata3

Create PID 
================
echo 1 > /u03/kafkadata1/myid
echo 2 > /u03/kafkadata2/myid
echo 3 > /u03/kafkadata3/myid
Modify zookeeper1.properties,zookeeper2.properties and zookeeper3.properties
=================

[root@kafkaserv config]# pwd
/u03/kafka/config
[root@kafkaserv config]# vi zookeeper1.properties
[root@kafkaserv config]# vi zookeeper2.properties
[root@kafkaserv config]# vi zookeeper3.properties
add below lines
tickTime=2000
initLimit=5
syncLimit=2
server.1=localhost:2887:3887
server.2=localhost:2888:3888
server.3=localhost:2889:3889
maxClientCnxns=0


Then start zookeeper services:
==============================
[root@kafkaserv bin]# ./zookeeper-server-start.sh -daemon /u03/kafka/config/zookeeper1.properties
[root@kafkaserv bin]# ./zookeeper-server-start.sh -daemon /u03/kafka/config/zookeeper2.properties
[root@kafkaserv bin]# ./zookeeper-server-start.sh -daemon /u03/kafka/config/zookeeper3.properties

Check if services came up using
===============================
[root@kafkaserv bin]# nc -v localhost 2181
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to ::1:2181.
^C
[root@kafkaserv bin]#
[root@kafkaserv bin]# nc -v localhost 2182
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to ::1:2182.
^C
[root@kafkaserv bin]#
[root@kafkaserv bin]# nc -v localhost 2183
Ncat: Version 6.40 ( http://nmap.org/ncat )
Ncat: Connected to ::1:2183.
^C


Optional, if you wanted to start using OS service command then create below service:
============================
cd /etc/systemd/system
vi zookeeper1.service
[Unit]
Description=Zookeeper1 Service
[Service]
Type=simple
WorkingDirectory=/u03/kafkadata1
PIDFile=/u03/kafkadata1/myid
SyslogIdentifier=zookeeper1
User=root
Group=root
ExecStart=/u03/kafka/bin/zookeeper-server-start.sh /u03/kafka/config/zookeeper1.properties
ExecStop=/u03/kafka/bin/zookeeper-server-stop.sh
Restart=always
TimeoutSec=20
SuccessExitStatus=130 143
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable zookeeper1.service
[root@kafkaserv system]# systemctl enable zookeeper1.service
ln -s '/etc/systemd/system/zookeeper1.service' '/etc/systemd/system/multi-user.target.wants/zookeeper1.service'
[root@kafkaserv system]#
[root@kafkaserv system]# systemctl enable zookeeper1.service
ln -s '/etc/systemd/system/zookeeper1.service' '/etc/systemd/system/multi-user.target.wants/zookeeper1.service'
[root@kafkaserv system]# systemctl status zookeeper1.service
zookeeper1.service - Zookeeper1 Service
   Loaded: loaded (/etc/systemd/system/zookeeper1.service; enabled)
   Active: inactive (dead)
[root@kafkaserv system]# systemctl start zookeeper1.service
[root@kafkaserv system]# systemctl status zookeeper1.service
zookeeper1.service - Zookeeper1 Service
   Loaded: loaded (/etc/systemd/system/zookeeper1.service; enabled)
   Active: active (running) since Sun 2022-12-04 12:29:22 IST; 3s ago
 Main PID: 24948 (java)
   CGroup: /system.slice/zookeeper1.service
           └─24948 java -Xmx512M -Xms512M -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+Ex...
Dec 04 12:29:22 kafkaserv.nsdr.com systemd[1]: Started Zookeeper1 Service.
Modify /u03/kafka/config/server.properties file 
===============================
Check if any error is there:
[root@kafkaserv bin]# ./kafka-server-start.sh /u03/kafka/config/server.properties
If above commands completed find then run it from backend
[root@kafkaserv bin]# ./kafka-server-start.sh -daemon /u03/kafka/config/server.properties
[root@kafkaserv bin]#


===============================
Create a TOPIC
=================================
[root@kafkaserv bin]# ./kafka-topics.sh --bootstrap-server 192.168.137.76:9092  --create --topic BroadcastTopic --replication-factor 1-partitions 1
Created topic BroadcastTopic.
[root@kafkaserv bin]#
[root@kafkaserv bin]# ./kafka-topics.sh --list --bootstrap-server 192.168.137.76:9092                                  BroadcastTopic
BroadcastTopic1


Produce and Consume Msg
===============================
[root@kafkaserv bin]# ./kafka-console-producer.sh --broker-list 192.168.137.76:9092 --topic BroadcastTopic
>Apple
>Oranage
>Lemon
>Grapes
[root@kafkaserv bin]# ./kafka-console-consumer.sh --bootstrap-server 192.168.137.76:9092 --topic BroadcastTopic --from-beginning
Apple
Oranage
Lemon
Grapes



Thanks,


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,