Quantcast
Viewing all articles
Browse latest Browse all 174

Extract and analyze SHOWBLOCKS/SHOWWHERE data as easy as pie

Short teaser: 
SQL SHOWBLOCKS & SQL SHOWWHERE
Cover Image: 
Image may be NSFW.
Clik here to view.

Tired of parsing the output from Ferret SHOWBLOCKS and SHOWWHERE commands?  You don’t need to do that anymore with the release of the SQL SHOWBLOCKS and SQL SHOWWHERE features. The SQL SHOWBLOCKS feature is available in Teradata Database 15.0, and SQL SHOWWHERE is available in 15.10. These new features allow you to easily extract SHOWBLOCKS and SHOWWHERE data, which can subsequently be queried for analysis using SQL. Not only is this information simpler to view, but the table-based data can easily be exported to third party tools for better view/analysis of the system-level information.

Unlike the Ferret utility, the SQL SHOWBLOCKS and SQL SHOWWHERE macros do not require special console privileges (DBCCONS or CNS supervisor window) to run.  These SQL macros can be run through many user sessions at the same time, whereas the number of sessions that one can initiate through Ferret is limited to the number of CNS Supervisor window sessions that can be started.

SQL SHOWBLOCKS and SQL SHOWWHERE both employ the same two new system macros.  CreateFsysInfoTable creates a target table to hold the file system information and PopulateFsysInfoTable populates the target table with system-level information for SHOWBLOCKS or SHOWWHERE. Once the target tables are populated with SHOWBLOCKS or SHOWWHERE rows, normal SQL queries can be run on those target tables and several system level details, such as Data Block Size Statistics, Cylinder and Block Level Compression related stats, Temperature and grade of the storage, can be obtained.

The example below shows how to create a target table to hold SHOWBLOCKS information:

EXEC DBC.CreateFsysInfoTable (‘SYSTEMINFO’, ‘SHOWBLOCKS_M’,  ‘PERM’, ‘Y’, ‘SHOWBLOCKS’, ‘M’ );

-  Creates the permanent target table ‘SHOWBLOCKS_M’ with fallback in the target database ‘SYSTEMINFO’ for capturing the SHOWBLOCKS’s  medium (‘M’) display rows.

The example below shows how to populate the target table created above:

EXEC DBC.PopulateFsysInfoTable (‘PRODUCTION’, ‘CALLLOG_2015,  ‘SHOWBLOCKS’, ‘M’ , ‘SYSTEMINFO’, ‘SHOWBLOCKS_M’);

-  Populates the target table ‘SYSTEMINFO.SHOWBLOCKS_M’ with SHOWBLOCKS medium (‘M’) display rows of the input table ‘PRODUCTION.CALLLOG_2015’.

For more details on syntax, invocation and other requirements refer to the SQL Functions, Operators, Expressions and Predicates manual  and the SQL SHOWBLOCKS and SQL SHOWWHERE Orange Book listed in Appendix A. 

Figure1 shows the sample rows from a target table “SYSTEMINFO.SHOWBLOCKS_M” which stored SHOWBLOCKS information for a source table “PRODUCTION.CALLOG_2015”.  

Image may be NSFW.
Clik here to view.

Figure 1: Sample SQL SHOWBLOCKS rows from a target table

 

The corresponding SHOWBLOCKS output collected from Ferret is shown in Figure 2.

Image may be NSFW.
Clik here to view.

Figure 2: SHOWBLOCKS /M output from Ferret

 

The sample SQL used to extract data from the target table, which was then used to create the graphs shown in Figure3 and Figure4, is presented below:

Image may be NSFW.
Clik here to view.

Note that these graphs represent multiple invocations of the PopulateFsysInfoTable macro over time into the target table ‘SYSTEMINFO.SHOWBLOCKS_M’ before running the above SQL.

 

Image may be NSFW.
Clik here to view.
      Image may be NSFW.
Clik here to view.

                           Figure3:  Estimated Compression Ratio by Date                                               Figure 4 : Min, Max and Average DB Size values (in units of sectors) by Date                     

 

 

Key Points

  • Compared to the traditional mechanism (the Ferret utility) for extracting SHOWBLOCKS and SHOWWHERE data for analysis of system level information, the new SQL SHOWBLOCKS and SQL SHOWWHERE methods are much easier, and have fewer limitations.
  • System-level data can be captured at multiple points over time, making it easy to collect historical data for long-term analysis
  • Graphs are easier to produce and data interpretation is more straightforward.

 

Appendix A: Reference Material

  1. Teradata Database Manual “SQL Functions, Operators, Expressions and Predicates, Release 15.10”
  2. Teradata Orange Book “SQL SHOWBLOCKS and SQL SHOWWHERE in Teradata Database” , Book# 541-0010699-A02, April 2015
  3. Teradata Orange Book “Block Level Compression, in Teradata 14.0, including Temperature Based and Independent Sub-table Compression; 2011-10”
Ignore ancestor settings: 
0
Channel: 
Apply supersede status to children: 
0

Viewing all articles
Browse latest Browse all 174

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>