Oracle Database Administration Scripts | DBA Bundle

Posted: February 16, 2014 in General, Script
Tags: , , ,

This tool call it the DBA Bundle , it’s a tar file contains a group of most useful shell scripts that help the database administrator in the day to day tasks in a smart, safe and easy way, some of these scripts are old but it still doing it’s job efficiently 🙂 for more detail’s please check the below blog for DBA Bundle owner Mr.Mahmmoud ADEL

http://dba-tips.blogspot.ae/

The bundle is downloadable from here:

This tool I call it DBA Bundle , it’s a tar file contains a group of shell scripts, you can DOWNLOAD the latest version from this link: [V. 2.4 25-Apr-2016]
https://www.dropbox.com/s/lgrprfazgkeoxb5/DBA_BUNDLE2.tar?dl=0

 

To call script “aliases_DBA_BUNDLE.sh” use “.” command: e.g.
# . aliases_DBA_BUNDLE.sh

What if I’ve more than one database on the server, how to use “aliases_DBA_BUNDLE.sh” script?

let’s say you’ve two databases running on the same servers (SALESDB & ORCL), if you want to use the shortcuts (alert,tns,bdump,..) for SALESDB just run “aliases_DBA_BUNDLE.sh” script and select SALESDB, once you want to use the shortcuts (aliases) for ORCL DB re-run script “aliases_DBA_BUNDLE.sh” and select ORCL this once, and so on.

That was regarding the shortcut commands (aliases), regarding the aliases of other scripts in this bundle each time you execute an alias of a script it will list to you the current running instances on the server to select the database you want the script to run against .

If you still can’t get the use of “aliases_DBA_BUNDLE.sh” script, still it’s easy, just whenever you want to run any script go to the location where you extracted the bundle and run the script you want from there.

Now let’s move to the function of each script in this bundle:

Script Name | Description
——————-|——————————————–
export_data.sh|  Script Export Full DB|SCHEMA|TABLE data
(gives your the option of using exp or expdp utility for the export).
——————-|——————————————–
RMAN_full.sh | Script Takes an online RMAN full backup for the database
(gives you the option of compressed backup).
—————— |——————————————–
tablespaces.sh | Script Lists All TABLESPACES and it’s size on a database.
——————|———————————————
datafiles.sh      | Script Lists All DATAFILES and it’s size on a database.
——————|———————————————
audit_records.sh| Script Retrieves the AUDIT data for a DB user  in a specific date or number of days back.
http://dba-tips.blogspot.ae/2014/02/extract-oracle-audit-records-script.html
——————|——————————————–
zAngA_zAngA.sh| Script Retrieves the AUDIT data for a DB user in a specific date or number of days back. (this is the one linked to the alias if used “aliases_DBA_BUNDLE.sh” script).

http://dba-tips.blogspot.ae/2014/02/extract-oracle-audit-records-script.html
zanga zanga is a Libyan term used in one of the Gaddafi speeches(the ex-leader of Libya), when he vowed to hunt down protesters alleyway by alleyway but indeed the rebels hunted him down in a sewerage tube.
——————|——————————————–
gather_stats.sh| Script Gathers STATISTICS on a SCHEMA or TABLE using DBMS_STATS
——————|——————————————–
invalid_objects.sh | Script Lists All Invalid Objects on the DB + it’s compile statements.
——————|———————————————
biggest_50_objects.sh | Script Lists the Biggest 50 Objects on a database.
——————|———————————————
session_details.sh| Script Lists the Details of a user session. (if no input, will list all sessions on the instance).
——————|———————————————
all_sessions_info.sh| Script Lists All current sessions on all running instances [RAC DB].
——————|———————————————
db_locks.sh | Script Lists the Blocking LOCKS on a database.
——————|———————————————
unlock_user.sh | Script Unlocks a specific DB User Account + the option of reset the user’s password.
——————|———————————————
sql_id_details.sh| Script Shows the details of a specific SQL STATEMENT by providing it’s SQL_ID.
——————|———————————————
parameter_val.sh| Script Shows the value of a Visible or Hidden initialization Parameter.
——————|———————————————
db_jobs.sh | Script Lists All database Jobs (dba_jobs + dba_scheduler_jobs).
——————|———————————————
process_info.sh| Script Shows the DB Session details when providing it’s Unix PID.
——————|———————————————
oracle_cleanup.sh| Script Backup & Clean up All DB & it’s Listener LOGs.
——————|———————————————
last_logon_report.sh| Script Shows the last login date of ALL users in the database.
——————|———————————————
failed_logins.sh| Script Shows the failed login attempts in the last provided n of days.
——————|———————————————
start_tracing.sh| Script Start TRACING an Oracle Session activities in a logfile.
http://dba-tips.blogspot.ae/2014/02/script-to-trace-oracle-sesson.html
——————|———————————————
stop_tracing.sh| Script Stop TRACING an already traced Oracle Session + provide the logfile and it’s TKPROFED log.
http://dba-tips.blogspot.ae/2014/02/script-to-trace-oracle-sesson.html
——————|———————————————
user_details.sh | Script Generates the Full SQL Creation script for a DB user.
——————|———————————————
object_ddl.sh | Script Generates Full SQL Creation script for a database Object.
——————|——————————————–
Archives_Delete.sh| Script Deletes all Archivelogs older than (provided) number of days.
——————|——————————————–
analyze_objects.sh| Script Analyze All tables under a specific SCHEMA (using ANALYZE command).

Scripts that are not aliased:
***********************************
The following scripts will not be included in the list of aliases because it’s not applicable or need to be used carefully:
————————————————————–
dbalarm.sh | Script Monitors the ALERTLOGs of ALL Databases and Listeners running
on the server and instantly report ORA- errors and TNS- errors that appears
in these logs to the DBA E-mail Address by sending an email to the DBA
(you have to modify this parameter in line number 11
to point to your E-mail Address):
MAIL_LIST=”youremail@yourcompany.com”

> Of course the sendmail service should be configured on the server.

The best use of this script is to schedule running it in the crontab
to run every 5 minutes (or less) to report ORA- and TNS- errors
when they appear in the DBs & listeners logs.
———————–|———————————————-
SHUTDOWN_All.sh| Script to SHUTDOWN ALL running Databases & Listeners on The server.
———————–|———————————————-
COLD_BACKUP.sh | Script Takes a COLD BACKUP of a specific database
(of course the database will be down during the cold backup ;-))
This script will shutdown the database, takes a cold backup,
creates a restore script (in case you want to restore this cold backup
later ) then indeed it will startup the database.
http://dba-tips.blogspot.ae/2014/02/cold-backup-script.html

That’s all regarding this bundle, please note that time by time I’ll update this bundle by adding new scripts or by improving the functionalities of existing ones.

Comments
  1. hany says:

    thanks a lot ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s