Skip to content

Instantly share code, notes, and snippets.

@Shyamswami
Shyamswami / dbalarm
Created February 3, 2021 21:41 — forked from haballan/dbalarm
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
# #####################################################################################################################################################
# Database Server Monitoring Script [dbalarm].
VER="[6.7]"
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.
# Report LONG RUNNING operations/Active SESSIONS on DB when the CPU hits the THRESHOLD.
# ##############################################################################################
# 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.
# ##############################################################################################
@Shyamswami
Shyamswami / export_data
Created February 3, 2021 21:40 — forked from haballan/export_data
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.0
# 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.
@Shyamswami
Shyamswami / oracle_cleanup
Created February 3, 2021 21:39 — forked from haballan/oracle_cleanup
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.
@Shyamswami
Shyamswami / configuration_baseline.sh
Created February 3, 2021 21:39 — forked from haballan/configuration_baseline.sh
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.0]
# 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:
@Shyamswami
Shyamswami / report_long_runing_queries.sh
Created February 3, 2021 21:38 — forked from haballan/report_long_runing_queries.sh
Shell Script To monitor long running queries (running for more than 1 hour [Default]) | For Oracle database on Linux. How to use: http://dba-tips.blogspot.ae/2018/04/report-long-running-queries-long-active.html
# ##################################################################################
# Checking long running queries run by specific user
# [Ver 1.2]
#
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 09-03-17 # # # # #
# Modified: 21-01-19 Enhanced the fetch for ORACLE_HOME.
# 19-02-19 Enabled the HTML report version.
# 06-07-20 New calculation method for 12c+ updated.
@Shyamswami
Shyamswami / kill_long_running_queries.sh
Created February 3, 2021 21:37 — forked from haballan/kill_long_running_queries.sh
Shell Script To Kill long running queries that run from specific program e.g. SQL Developer | You have to specify ORACLE_SID, DURATION, MODULE_NAME inside the script. http://dba-tips.blogspot.ae/2018/04/automatic-kill-of-long-running-sessions.html
# #######################################################################
# Kill queries running for more than N hours based on specific criteria.
# #######################################################################
VER="[1.0]"
# # # #
# Author: Mahmmoud ADEL # # # # ###
# Created: 11-01-18 # # # # #
#
#
#
@Shyamswami
Shyamswami / goldengate_lag_mon.sh
Created February 3, 2021 21:37 — forked from haballan/goldengate_lag_mon.sh
This shell script monitors goldegate lag based on predefined LAG threshold inside the script - More Details: http://dba-tips.blogspot.ae/2018/05/linux-shell-script-to-monitor-and.html
# ####################################################################################################################
# This Script Detects GOLDENGATE LAG If The LAG Hits the Pre-defined Threshold
# [Ver 1.0]
#
# To get this script work you need to Define the following variables:
# ORACLE_HOME # Must be set to the ORACLE_HOME path of the database where GoldenGate is running against.
# GG_HOME # Should be set to the Goldengate installation home directory path.
# LAG=xxxx # The number of minutes of lag, if reached an email alert will be sent [10 minutes is the default].
# EXL_PROC_NAME="DONOTREMOVE|REP11|REP12" In case you want to exclude specific processes e.g. REP11 & REP12
# LOG_DIR # The location of script logs [/tmp by default].
@Shyamswami
Shyamswami / dbdailychk_html.sh
Created February 3, 2021 21:36 — forked from haballan/dbdailychk_html.sh
Shell Script To Perform Oracle Database Health Check (Performs multiple DB health checks and report them in one HTML report to the user via E-mail) More details: http://dba-tips.blogspot.ae/2017/11/oracle-database-health-check-report-in.html
# ########################################################################################################################
# DATABASE DAILY HEALTH CHECK MONITORING SCRIPT [HTML VERSION]
VER="[v4.3]"
# ===============================================================================
# CAUTION:
# THIS SCRIPT MAY CAUSE A SLIGHT PERFORMANCE IMPACT WHEN IT RUN,
# I RECOMMEND TO NOT RUN THIS SCRIPT SO FREQUENT.
# E.G. YOU MAY CONSIDER TO SCHEDULE IT TO RUN ONE TIME BETWEEN 12:00AM to 5:00AM.
# ===============================================================================
#
@Shyamswami
Shyamswami / rebuild_table.sh
Created February 3, 2021 21:36 — forked from haballan/rebuild_table.sh
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.1
# 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.