Python Script to format the output of one SQL statement

I received a text file from a client that contains the output of one sql script (The output represents detailed statistics about all sql statements running in one critical database). The output is similar to the following: You can download a sample file similar to that of our client from:https://1drv.ms/u/s!ArrpKxPFc2APxRw0izNXIYqVHGdw?e=UCgUBs The output is not formatted … Continue reading Python Script to format the output of one SQL statement

The Longest SQL Statement I have ever seen !

Below may be the longest SQL statement that I have ever seen. I don't know if it is written by one developer or group of developers and what is the logic behind it? I really don't like this style of writing sql statements. It is very difficult to be functionally understood. Also, it is very … Continue reading The Longest SQL Statement I have ever seen !

sqlcl Multi-Line Paste Issue

What is the issue? I noticed that sometimes when I copy SQL statement from web and paste it on sqlcl , it is copied on many lines and generating errors. For example, when I copied the following statement: And pasted into sqlcl running on the windows command window, it was pasted as follows: So, it … Continue reading sqlcl Multi-Line Paste Issue

Oracle Database 32-bit Funny Migration to 64-bit

Objective: Migrating one 11.1.0.7 32-bit database that resides on an old Windows 2008 (32-bit) (4GB memory) to Windows 2008 64-bit (no upgrade) on a brand new server with 64GB memory. {At 2017 and still there is 11.1.0.7 database ==> yes there is!} Introduction and Background I have a client with the following very old environment: … Continue reading Oracle Database 32-bit Funny Migration to 64-bit

Oracle SQL: Normalize the UnNormalized

What is the problem? Sometimes you are faced with a bad (poorly normalized) schema design. For example: But, you may need the output to be in the following normalized form: The correct solution may be to fix the schema design, but in most cases this will not be feasible. Test Case 1: We need to … Continue reading Oracle SQL: Normalize the UnNormalized