Check out scripts I wrote on Linux shell and Windows Powershell scripts, plus super PL/SQL scripts to alert notify OS and database conditions, including DataGuard and alerts. Download my Oracle DBA scripts, both Linux and Windows (upon request). Database Performance issue? Typical Diagnosis and prevention: (I learned a lot from Oracle - Tom Kyte, from his books, blogs, and presentations.) Database performance problems: First check wait statistics - Wait event statistics history data reveals various symptoms of problems. I have written a comprehensive running differential query to allow you see the instant wait stats in a time-interval into a history table based on Oracle Tom Kyte's simple illustration example. The key for diagnosis and prevention of database performance issue is to record historical data so you know the baseline and when problem was/is happening. Wait stats is the best indicator so you know how to remedy or prevent repeated incidents. You could run AWR and ADDM if you have license, use statpack if you don't have diagnostic tuning option license. To improve Oracle database performance, first check session and database server performance by checking the following statistics: I have many performance-checking super scripts. I learned a lot from Oracle Tom Kyte, from his books, blogs, and presentations. One of them sets up any interval of repeating capturing statistics per interval for later non-realtime analysis. You can use AWR snapshots or any 3rd party tools you have that can capture intervals of history. Once you identify the performance is on a particular sql statement, after reviewing explain-plan, the following revision can improve performance: You can also associate a sql statement to a particular statistic profile that improves performance by using the much more co-related correct statistics. If none of the above is identified to help, then resize server capacity on where the shortage of resources, such as CPU, memory, IO, is the only last resort. I have 600+ Oracle DBA scriptlets I often used. (including performance checkup and tuning, duplicate database script, Setup/Configure Data Guard Primary and Standby script, DR standby check-up script. RMAN PIT recovery, database management scripts....) ============================================================== Microsoft SQL Server ===================================================================Check out my SQL Server scripts to manage, alert, email notify, diagnose and tune database performance, including my presentation videos. I also started studying MySQL scripts, administration, performance tuning, and Microsoft Azure, Azure SQL database. --------------------------------------------------------------------------------------------------------------------------------------------------- Powershell script to report HTML email failed jobs, failed backup, generate restore scripts. See SQL Saturday #308 presentation.
Powershell script to record CPU, Memory, disk IO, host and SQL Server performance data into a Datawarehouse database with partitioned tables. See Dec.
11, 2012 presentation.
Powershell script to monitor database and server disk space, email notification or alert on high water mark. See Dec.
11, 2012 presentation.
Delete, Insert, Update large number of records from
production without blocking, timeout, T-log space
issues. SQLServer 2008/5 monitor blocking-blocked query with detail like query-text,
query-plan
, last wait type etc. Find Page Latch, Page IO Latch,
Lock contention
.... after SQL Saturday #57,
Jan. 29, 2010.
Find active sessions with detailed info
.... after SQL Saturday #57, Jan. 29,
2010.
A SP auto-generating restore/recovery script using
dynamic SQL with input parameters
Nov. 5, 2009, The
generated script is to be
used for PIT full recovery or
used for refresh QA
or standby.
Automated Index defrag T-SQL
script
Jason S. Wong, Nov.
5, 2009. I have a newer version for SQL2012 with fillfactor as a parameter and allowing LOB column defrag online.
(http://www.sqlservercentral.com/scripts/68671
)
Automated databases refresh with T-SQL
Jason S. Wong, Nov. 5, 2009 (http://www.sqlservercentral.com/scripts/backup+restore+log+shipping/68673/)
Automatic
generated restore-recovery script for refresh from host1:db1 to
host2:db2
Jason S. Wong, Nov. 19, 2010
Find Backupset with T-SQL 2008/2005 Jason S. Wong, Nov. 5, 2009
(http://www.sqlservercentral.com/scripts/Backup+Restore/68676/)
Example
of auto-generated T-SQL script with
T-SQL (this
case is a shrink command) Jason S. Wong,
Sep. 30,
2009
. (http://www.sqlservercentral.com/scripts/68336
)
The danger of select in SQL Server -- where can it
go wrong? Jason S. Wong, Sep.
22, 2010
How to Partition Table with T-SQL 2008/2005 Jason S. Wong, Nov. 5, 2009,
before you partition you should prove first the choosen partition key columns
will benefit in your query scenario. (http://www.sqlservercentral.com/Contributions/Edit/68675)
T-SQL technique for a huge insert..select
not blocking Jason S. Wong, Jun.
28, 2010 (http://www.sqlservercentral.com/scripts/T-SQL/70446/)
T-SQL DBA script to monitor your database disk
space Jason S. Wong, Jun. 8, 2010, after
SQLPASS presentation Houston
Find Foreign Key Table from
PK Table Jason S.
Wong, Sep. 30, 2009
(http://www.sqlservercentral.com/Contributions/Edit/68346)
Search for a Text String in All Stored
Procedures Jason S.
Wong, Sep. 30, 2009 (http://www.sqlservercentral.com/Contributions/Edit/68347
)
more other codes such
as Replication Monitoring query
.... will be published coming soon. |