Skip to content

Instantly share code, notes, and snippets.

View haballan's full-sized avatar

Mahmmoud ADEL haballan

View GitHub Profile
@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 / 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 / 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.
# ##############################################################################################
# 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 / 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.
@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 / 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.