SQL scripts, coding and programming for database administrators
As a DBA you need to check periodically to make sure you have backups. I would recommend you do this daily.
To improve the performance of your code that uses numerous table variables, consider adding the optimizer hint RECOMPILE.
Oracle 21c now offers the possibility of using some PL/SQL data types in SQL*PLus, with some restrictions. Read on to see what types are available and how to use them.
Anytime the optimizer calculates a plan that exceeds a given threshold, the optimizer will consider using plans that will go parallel.
Use this script to find object dependencies.
History to analyze the growth of the databases size over a given period. Additional to the minimum, maximum and average size per week the growth of average size related to the former week is calculated.
Find how much disk space is used on a database in a week. (Between disk space usage differences)
This sequence of scripts can help identify tables that are being blocked and quantify how many locks are happening in your database.
Not all tools provide a GUI interface, making it difficult to find Oracle's object referenced inside a PLSQL stored procedure. This script finds those objects.
This script will monitor CPU Usage Information.
Use this script to generate a random password.
Use this stored procedure to quickly capture all login information when needed, especially for security audit situations.
Practice INSERT into.
Piece of code to search all stored procedures in all databases for keyword.
Helps DBA to find out quickly which database takes a lot of space and which file could be shrunk. Very useful when output is sorted by Drive Letter when "Out of space" occurs.
Add Your Script
SQL Scripts & Samples Archives