Monday, 15 March 2021

Enable and configure mailx in Linux

 To start sending mails from Linux machine we need to install mailx:

dnf install mailx 


Configure the sender information in /etc/mail.rc:

Add below at the end of /etc/mail.rc file:


set smtp=smtps://smtp.gmail.com:465

set smtp-auth=login

set smtp-auth-user=mygmailuser@gmail.COM

set smtp-auth-password=mypassword

set ssl-verify=ignore

set nss-config-dir=/etc/pki/nssdb/


Tuesday, 16 February 2021

.bat file delete files from windows older than 7 days

 REM Remove files backup older than 7 days

forfiles /p "F:\backup\dumps" /s /m *.* /c "cmd /c Del @path" /d -7


Monday, 8 February 2021

Oracle Data Guard 19c TNS-12564: TNS:connection refused

 I faced this error during the switchover in 19c version:

Make sure:

1- Have the correct services statically registered.

2- Configure the local_listener as below in both primary and standby servers:

alter system set local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=primary)(PORT=1521)))' scope=both;

alter system set local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=standby)(PORT=1521)))' scope=both;

  

Friday, 30 October 2020

ping command not working in CentOS

 I created one VM machine on virtualbox Centos 7 and added two network adapters Bridged Adapter and NAT.

When tried ping google:

ping google.com

ping: google.com: Name or service not know


Solution:

dhclient


 

Password prompt taking long time Linux Centos 7

 RHEL7:

Symptom: 34 seconds to prompt password ssh login
Solution (my case):
- vi /etc/ssh/sshd_config
- GSSAPIAuthentication no
- service sshd restart

vi /etc/ssh/sshd_config
UseDNS no

vi /etc/resolv.conf
options single-request-reopen ;in the last line. No network restart required

Monday, 31 August 2020

Oracle Database Find blocking sessions

 select v.sql_text,v.sql_fulltext,sub.* from v$sql v,

(select sample_time,s.sql_id sql_id, session_state, blocking_session,

owner||'.'||object_name||':'||nvl(subobject_name,'-') obj_name,s.program,s.module,s.machine

from dba_hist_active_sess_history s, dba_objects o

where event = 'enq: TX - row lock contention'

and o.data_object_id = s.current_obj#

order by 1 desc) sub where sub.sql_id=v.sql_id;



select s1.username || '@' || s1.machine

|| ' ( THIS SID=' || s1.sid || ' )  is blocking '

|| s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status

from gv$lock l1, gv$session s1, gv$lock l2, gv$session s2

where s1.sid=l1.sid and s2.sid=l2.sid

and l1.BLOCK=1 and l2.request > 0

and l1.id1 = l2.id1

and l2.id2 = l2.id2 ;




SELECT 

'alter system kill session ''' || SID || ',' || s.serial# || ',@'||inst_id||''' immdiate;',sid,username,serial#,process,NVL (sql_id, 0),

sql_address,blocking_session,wait_class,event,p1,p2,p3,seconds_in_wait

FROM gv$session s WHERE blocking_session_status = 'VALID'

OR sid IN (SELECT blocking_session

FROM gv$session WHERE blocking_session_status = 'VALID');

Thursday, 6 August 2020

Import an Oracle APEX Application export file from a higher version into a lower version

Follow the below process to know how and where to change required details:

  • Create one dummy application in target instance and export it
  • Compare export files from source instance and target instance as shown in below table. It can be seen that the p_version and p_release parameter values are different in both the files
In source instance (18.1)  

begin

wwv_flow_api.import_begin (

 p_version_yyyy_mm_dd=>'2018.04.04'

,p_release=>'18.1.0.00.45'

,p_default_workspace_id=>XXXXXXX

,p_default_application_id=>XXXXXX

,p_default_owner=>'XXX'

);

end;
In target instance (5.1.4)

begin

wwv_flow_api.import_begin (

 p_version_yyyy_mm_dd=>'2016.08.24'

,p_release=>'5.1.4.00.08'

,p_default_workspace_id=>XXXXXXX

,p_default_application_id=>XXXXXXX

,p_default_owner=>'XXXX'

);

end;
  • So, change the parameter values of import_begin procedure in source export file. For e.g., the release and the version parameters in export file
    from ‘18.1.0.00.45’  to ‘5.1.4.00.08‘ and
    from    ‘2018.04.04’    to ‘2016.08.24’ respectively
  • Import edited export file in target instance this time it will allow you to run the script

Number of Visitors