Oracle – Dynamic Queries and Reporting

There are various tools to provide enterprise-level reports. But what to do if you need yo create reports for yourself? In this article I’m going to describe how to manage simple reports using Oracle 10g.

Read the rest of this entry »

Microsoft SQL Server – Complex Cleanup

Today my team manager asked me to create small interesting sql script.┬áThis script recieves time interval on input, splits given time interval into smaller parts (let’s say 24 hours per interval), counts total number of records for each interval, outputs this information and deletes records. Script mustn’t delete top”fresh” records though. E.g. manager would like to specify offset parameter, so records from interval [today-offset;today] mustn’t be deleted. Read the rest of this entry »

Microsoft SQL Server – gathering tables information

Let’s examine how we can output some statistical information about database tables.

Read the rest of this entry »

Microsoft SQL Server – measure operation time

In previous post we’ve described how to get simple good looking information about your data. Now let’s try to find out how we can measure time required by db operation (stored procedure, sql query etc) to perform. Read the rest of this entry »

Oracle stats (Part 3)

Finally let’s find out how to gather per table statistics.

Read the rest of this entry »

Microsoft SQL Server – statistics

I’ve recieved interesting task from my boss. I need to prepare a few stats for MS SQL Server so let’s do it.

Read the rest of this entry »

Oracle stats (Part 2)

This time we will monitor tablespace stats. I’d like to create one stats table per tablespace and use the same technique as in Part 1

Read the rest of this entry »