Skip to content

Instantly share code, notes, and snippets.

View haballan's full-sized avatar

Mahmmoud ADEL haballan

View GitHub Profile
@haballan
haballan / dbalarm
Last active July 31, 2023 08:44
Oracle Database Monitoring Script (Monitors the alertlog, listener logs, CPU, FILESYSTEM, TABLESPACES, ASM, long running queries, locks, alter system/database commands, export/import operations, startup/shutdown activities) http://dba-tips.blogspot.com/2014/02/database-monitoring-script-for-ora-and.html
#!/bin/bash
# ##################################################################################################################################################################
# Database Server Monitoring Script [dbalarm].
VER="[8.0]"
SCRIPT_NAME="dbalarm${VER}"
# Features:
# Report ERRORS in DB, ASM Instance, GRID INFRASTRUCTURE, GOLDENGATE and LISTENERS ALERTLOG plus dmesg DEVICE DRIVER OS log.
# Report TABLESPACES, ASM DISKGROUPS and FRA when reach %USED THRESHOLD.
# Report OFFLINE databases.
# Report CPU, FILESYSTEM, TABLESPACES When hit the THRESHOLD.
@haballan
haballan / start_tracing
Last active July 4, 2020 09:32
Shell Script to Easily Start Tracing An Oracle DB Session http://dba-tips.blogspot.com/2014/02/script-to-trace-oracle-sesson.html
# #####################################################################################################
# Script to Enable the trace on an Oracle Session.
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 24-12-11 # # # # #
#
# Modified: 31-12-13 Customized the script to run on various environments.
# 04-05-14 Enhanced trace file search criteria.
# 16-06-20 Enhanced trace file search criteria.
#
@haballan
haballan / stop_tracing
Last active July 4, 2020 09:32
Shell Script To Stop Tracing an already being Traced Oracle Session http://dba-tips.blogspot.com/2014/02/script-to-trace-oracle-sesson.html
# #################################################
# Script to STOP tracing an Oracle Traced Session.
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 24-12-11 # # # # #
# Modified: 31-12-13
# Customized the script to run on
# various environments.
# 04-05-14 Enhanced search criteria
# for generated trace file.
# ##############################################################################################
# This script shows AUDIT records for DB User.
# To be run by ORACLE user
# # # #
# 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 / export_data
Last active October 19, 2022 16:12
Shell Script To Export Data in Oracle along with preparing script to support the import process http://dba-tips.blogspot.com/2014/02/script-to-export-data-using-data-pump.html the import shell script is available in another link: http://dba-tips.blogspot.com/2020/12/import-shell-script-for-importing-data.html
# ###################################################################################################################################################
# Ver: 3.4
# EXPORT DATABASE | SCHEMA | TABLE.
# To be run by ORACLE user
# # # #
# Author: Mahmmoud ADEL # # # # ###
# # # # # #
# Created: 03-02-2014
# Modified: 26-05-2014 Hashed METADATA export lines to clear the confusion.
# 21-08-2014 Added DEGREE OF PARALLELISM calculation.
@haballan
haballan / oracle_cleanup
Last active February 3, 2021 21:39
Shell Script To Clean Up Oracle Logs and rotate DB & Listener alertlogs http://dba-tips.blogspot.com/2014/02/oracle-logs-cleanup-script.html
# ###################################################################################
# This script Backup & Cleanup the database logs.
# To be run by ORACLE user
# [Ver 2.0]
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 03-06-2013 # # # # #
# Modified: 02-07-2013
# 14-01-2014 Customized the script to run on various environments.
# 14-06-2017 Increased the script accuracy and elimiated tar bug.
@haballan
haballan / COLD_BACKUP
Last active July 4, 2020 09:30
Shell Script To Perform Database COLD BACKUP http://dba-tips.blogspot.com/2014/02/cold-backup-script.html
# ##################################################################################################
# Database COLD Backup Script.
# [Ver 1.6] # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 22-12-13 # # # # #
#
# Modified: 16-05-14 Increased linesize to avoid line breaking.
#
#
# ##################################################################################################
@haballan
haballan / dbdailychk.sh
Last active April 5, 2024 06:33
Shell Script To Perform Oracle Database Health Check (Performs multiple DB health checks and report them in one report to the user via E-mail) http://dba-tips.blogspot.com/2015/05/oracle-database-health-check-script.html
# ##################################################################################################################################
# DATABASE DAILY HEALTH CHECK MONITORING SCRIPT
VER="[6.2]"
# ===================================================================================================
# CAUTION: THIS SCRIPT MAY CAUSE A SLIGHT OVEARHEAD, DO NOT RUN IT TOO FREQUENT, ONCE A DAY IS IDEAL.
# ===================================================================================================
# ***********
# How To Use:
# ***********
# 1- Set your Email by modifying this parameter below: EMAIL="[email protected]"
@haballan
haballan / configuration_baseline.sh
Last active October 19, 2022 16:11
This shell script collect the main configuration baseline data for Linux OS and Oracle databases http://dba-tips.blogspot.com/2016/12/configuration-baseline-script-for-linux.html
# #######################################################################################################################
# Ver [3.4]
# CONFIGURATION BASELINE COLLECTOR SCRIPT FOR ORACLE DATABASE & LINUX OS
# THIS SCRIPT WILL WRITE FOUR LOG FILES:
# - ONE FOR DATABASE CONFIGURATIONS [One log for EACH database].
# - ONE CONTAINS CREATION/GRANTED PRIVILEGES DDL STATEMENTS FOR ALL DB USERS [One log for EACH database].
# - ONE FOR CONTROLFILE BACKUP TO TRACE [One log for EACH database].
# - ONE FOR OS CONFIGURATIONS.
#
# FEATURES:
@haballan
haballan / RMAN_FULL_BACKUP
Last active May 10, 2023 01:41
Shell Script To Perform RMAN full backup in nohup mode http://dba-tips.blogspot.com/2017/03/rman-backup-script.html
#!/bin/bash
# #####################################################################################################
# This script takes an on-demand RMAN Backup.
# [Ver 5.2]
# # # #
# Author: Mahmmoud ADEL # # # # ###
# # # # # #
# Created: 24-09-11
# Modified: 31-12-13 Customized the script to run on various environments.
# 12-03-16 Run RMAN command in the background to avoid job fail when session terminate.