Skip to content

Instantly share code, notes, and snippets.

View haballan's full-sized avatar

Mahmmoud ADEL haballan

View GitHub Profile
@haballan
haballan / KILL_ALL_PROCESSES_MATCHING_STRING_LINUX.sh
Last active August 24, 2023 23:15
Shell Script to Kill All Processes having Specific Pattern/String in Their Name or Description
# #############################################################################################################################################
# This script KILLS all linux processes that match specific pattern provided by the user:
# Ver 1.0
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 08-05-23 # # # # #
# Modified:
# #############################################################################################################################################
# Terminate the Script if the OS is not Linux:
1f 8b 08 00 4b 6e 51 63 00 03 ec 3d 7b 5f db 48
92 f9 d7 fa 14 15 85 1d 43 82 9f 40 f2 1b 33 cc
ae c0 02 7c e3 07 67 99 10 96 30 46 d8 32 d6 c6
b6 bc 96 0c 61 62 ee b3 5f 55 77 4b 6a f9 09 04
d8 e4 ce da 1d 62 a9 5f d5 f5 ee ea 6a 29 bf ab
d5 77 8f cb f9 a2 fe 21 f5 ea 99 ae 34 5e 1f b6
b6 5e a5 33 5b d9 f4 87 0d fe ef fb 0c 7b 2e ae
57 99 cd 8d ec 66 f6 fd 7b fc 0f cb b3 9b ef d3
af 60 eb b9 00 92 af a1 eb 99 03 80 57 ce c0 6c
74 ac d9 f5 1c bb 87 35 3b 9d 97 80 e9 05 af bc
@haballan
haballan / get_SQLText_for_goldengate_XID.sh
Created September 30, 2021 19:04
Get the SQL TEXT/SQLID of the Transaction Which Goldengate Extract is Lagging At
# #############################################################################
# Script to get the SQLID for a goldengate transaction id XID
# Ver 1.0
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 23-09-21 # # # # #
#
#
#
# #############################################################################
@haballan
haballan / search_audit_data.sh
Last active October 4, 2021 14:50
Search Audit Data in Oracle Shell Script [Breif Description: http://dba-tips.blogspot.com/2021/09/major-update-on-search-audit-data-script.html ]
# ####################################################################################################
# This script shows AUDIT records for DB User.
# To be run by ORACLE user
# Ver 2.2
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 25-04-2013 # # # # #
#
# Modified: 07-03-2019 Allow the user to control the display of LOGIN/LOGOFF data.
# 10-03-2019 Added the option of excluding specific audit action from the report.
@haballan
haballan / import_data.sh
Last active April 9, 2024 15:02
Data Import Shell Script For Oracle using impdp
# #########################################################################################################################################
# DISCLAIMER: THIS SCRIPT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. IT IS PROVIDED "AS IS".
# THE AUTHOR WILL NOT BE HELD RESPONSIBLE TO ANY PERSON OR ENTITY WITH RESPECT TO ANY DATA LOSS OR DAMAGES CAUSED BY THIS SCRIPT.
#
# Ver: 1.3
# This script help with importing data using impdp.
#
# # # #
# Author: Mahmmoud ADEL # # # # ###
# # # # # #
@haballan
haballan / sql_tune.sh
Last active October 19, 2022 16:05
Script to tune a SQL Statement using DB Features. Complete Instructions in this link: http://dba-tips.blogspot.com/2020/10/sql-tuning-script.html
# ########################################################################################################################################
# Retrieve the SQLTEXT + BIND VARIABLES + EXEC PLAN + PLAN HISTORY + BASELINE + FIX PLAN + TUNING ADVISOR
VER="[3.6]"
# # # #
# Authors: Mahmmoud ADEL # # # # # #
# Farrukh Salman # # # ####
# Created: 24-12-11 # # # # #
# Modified: 31-12-13 Customized the script to run on various environments.
# 06-05-14 Getting the Bind Variable info for the SQLID
# 05-11-15 Fix Divided by Zero error
@haballan
haballan / monitor_audit_records.sh
Last active February 3, 2021 21:35
Script to Monitor and Report Audit Trail Records in Oracle sys.aud$ How to use: http://dba-tips.blogspot.com/2020/10/script-to-monitor-and-report-audit.html
# #####################################################################################################################################################
# Monitor audit records [Failed login attempts & MAJOR AUDIT RECRODS] on audit trail table
VER="[1.0]"
SCRIPT_NAME="monitor_audit_records"
# #####################################################################################################################################################
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 28-09-20 # # # # #
#
#
@haballan
haballan / rebuild_table.sh
Last active October 19, 2022 16:06
SCRIPT TO REBUILD A GIVEN TABLE AND ITS INDEXES USING ONLINE FEATURES DBMS_REDEFINITION/ONLINE REBUILD IF AVAILABLE OR OFFLINE REBUILD AS A FINAL RESORT http://dba-tips.blogspot.com/2019/05/rebuild-table-script-and-reclaim-wasted.html
# #########################################################################################################################################################
# Ver 3.2
# SCRIPT TO REBUILD A GIVEN TABLE AND ITS INDEXES USING ONLINE FEATURES DBMS_REDEFINITION/ONLINE REBUILD IF AVAILABLE OR OFFLINE REBUILD AS A FINAL RESORT
# #########################################################################################################################################################
#
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 16-06-14 # # # # #
#
# Modified: 17-06-14 Inform the user if the DB is in Force Logging Mode.
@haballan
haballan / schedule_rman_image_copy_bkp.sh
Last active July 29, 2021 11:58
Script to be used on crontab to schedule an RMAN Image/Copy Backup (Variables in the first section must be modified before use)
# ##############################################################################################
# Script to be used on crontab to schedule an RMAN Image/Copy Backup
VER="[1.2]"
# ##############################################################################################
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 01-10-17 # # # # #
#
# Modified: 02-10-17
# 10-03-19 Add the option of deleting old CONTROLFILE AUTOBACKUP files.
@haballan
haballan / schedule_rman_full_bkp.sh
Last active March 29, 2022 09:18
Script to be used on the crontab to schedule an RMAN Full Backup (Variables in the first section must be modified before using the script)
# ##############################################################################################
# Script to be used on the crontab to schedule an RMAN Full Backup
VER="[1.3]"
# ##############################################################################################
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 04-10-17 # # # # #
#
# Modified:
# 10-03-19 Add the option of deleting old CONTROLFILE AUTOBACKUP files.