<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5982854563710370404</id><updated>2012-01-17T09:16:03.190-08:00</updated><category term='managers'/><category term='linked server'/><category term='string manipulation'/><category term='&quot;Event log analysis&quot;'/><category term='rare stamp'/><category term='.NET IDE Bug'/><category term='Powershell'/><category term='organizational changes'/><category term='interview questions'/><category term='SQL Server'/><category term='TSM Cross-node restore'/><category term='PSSDIAG'/><category term='share window folder'/><category term='Admin Shares irpstacksize'/><category term='delegation'/><category term='SQL Express Beginners'/><category term='SQL Patch level'/><category term='SQL Job Status Reporting'/><category term='SQL10007N'/><category term='gvphubli'/><category term='SQLDump'/><category term='sysobjects'/><category term='&quot;temporary tables&quot;'/><category term='SQL Connection'/><category term='Litespeed'/><category term='Disk Free Space'/><category term='&quot;Notification Service&quot;'/><category term='defrag'/><category term='Backup Monitoring Across Multiple Servers'/><category term='Automation'/><category term='database'/><category term='backup'/><category term='db2 merge'/><category term='db2 restore'/><category term='SQL1035N'/><category term='SQL Server 2008'/><category term='&quot;Default database file path&quot;'/><category term='db2 luw WLM'/><category term='Maintenance Plan'/><category term='deployment'/><category term='xtype'/><category term='db2 luw Event monitors'/><category term='monitoring'/><category term='Heap Table'/><category term='Enumerate'/><category term='DB2INSTANCE'/><category term='universal database'/><category term='Availability'/><category term='technologyyogi'/><category term='Backup Compression'/><category term='joke'/><category term='T-SQL'/><category term='forfiles mingle backup mysql'/><category term='Red-gate'/><category term='New Features'/><category term='timeout'/><category term='isAlive'/><title type='text'>Technology Yogi</title><subtitle type='html'>Microsoft SQL Server and db2 LUW 9 - Monitoring, Administration, Optimization, Tips &amp;amp; Tricks and my experiences.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>50</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-7281272442169910541</id><published>2011-08-19T10:11:00.001-07:00</published><updated>2011-08-19T10:30:05.850-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='db2 restore'/><title type='text'>db2 restore with automatic storage tablespace</title><content type='html'>I was trying to restore a db from inst1 to inst2. The db path (file system paths) in inst1 were different as compared to inst2. The file systems between the 2 have very restricted permissions. Usually when I am restoring a database from one system to another I am used to creating a blank database with correct path and then in the restore I specify REDIRECT keyword. And my assumption in doing so was the restore will happen to the path that is there in the database (not in the backup set). So, when I tried to restore a db from inst1 to inst2, my assumption did not work, received following error message,&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;SQL0970N  The system attempted to write to a read-only file.  SQLSTATE=55009&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I looked at the db2diag.log and found following message.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;INSTANCE: inst2                NODE : 000         DB   : {existing db name}&lt;br /&gt;EDUID   : 9933                 EDUNAME: db2loggr ({existing db name}) 0&lt;br /&gt;FUNCTION: DB2 UDB, oper system services, sqlomkdirp, probe:10&lt;br /&gt;MESSAGE : ZRC=0x840F0001=-2079391743=SQLO_ACCD "Access Denied"&lt;br /&gt;          DIA8701C Access denied for resource "", operating system return code&lt;br /&gt;          was "".&lt;br /&gt;CALLED  : OS, -, mkdir&lt;br /&gt;OSERR   : EACCES (13) "Permission denied"&lt;br /&gt;DATA #1 : File name, 78 bytes&lt;br /&gt;/home/inst1/db2fs/inst1/NODE0000/{old db name}/LOGARC/inst2/{existing db name}/NODE0000/C0000001/&lt;br /&gt;DATA #2 : signed integer, 4 bytes&lt;br /&gt;488&lt;br /&gt;DATA #3 : signed integer, 4 bytes&lt;br /&gt;488&lt;br /&gt;DATA #4 : String, 105 bytes&lt;br /&gt;Search for ossError*Analysis probe point after this log entry for further&lt;br /&gt;self-diagnosis of this problem.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Looks like db2 still tries to restore to the path that is there hidden in the backup set. In my case inst2 was trying to restore on inst1's (db) file system paths, to which it did not had access permissions.&lt;br /&gt;&lt;br /&gt;So whats the solution ? use following format of restore command.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;db2 "RESTORE DB {dbname in image} FROM {backup image file path} TAKEN AT {timestamp} ON {db2fs_path} DBPATH ON {db_path} INTO {existing db name}&lt;br /&gt;db2 "rollforward db {existing db name} complete"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And this the case with "automatic storage tablespace paths" and I guess the DMS should not have this issue.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-7281272442169910541?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/7281272442169910541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=7281272442169910541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7281272442169910541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7281272442169910541'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/08/db2-restore-with-automatic-storage.html' title='db2 restore with automatic storage tablespace'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-8540630293674429057</id><published>2011-07-17T10:43:00.000-07:00</published><updated>2011-12-03T16:50:21.292-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='share window folder'/><title type='text'>How to share Windows folder on Ubuntu (guest OS)</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;My system environment looks as follows - Windows host with Ubuntu 10 guest OS in VMWare&lt;br /&gt;&lt;br /&gt;I followed the below URL from wmware to setup Windows share on Ubuntu. &lt;span style="background-color: yellow;"&gt;http://www.vmware.com/support/ws3/doc/ws32_running9.html&lt;/span&gt;. But this did not quiet work in a single given the fact that I am new to Ubuntu/Window intraction. &lt;br /&gt;&lt;br /&gt;Try command "&lt;span style="color: blue;"&gt;smbmount&lt;/span&gt;" if this works that means the smb pieces are install, else install them&lt;br /&gt;&lt;br /&gt;if smb components are not install then run "&lt;span style="color: blue;"&gt;apt-get install smbfs&lt;/span&gt;" - ensure that the installation goes correct.&lt;br /&gt;&lt;br /&gt;Create a directory that will be mapped to window share "&lt;span style="color: blue;"&gt;mkdir /home/gvphubli/win_shared&lt;/span&gt;"&lt;br /&gt;&lt;br /&gt;Here is the last command in this process&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;mount -t smbfs -o username=win_user,password=win_user_pwd&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;//win_system_IP/Java_Learning  /home/gvphubli/win_shared&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In case of CentOS or Fedora follow these steps,&lt;br /&gt;&lt;br /&gt;Test for samba, run this command in terminal "smbd -V" if samba is installed and available the version number will be displayed, else you will see bash error.&lt;br /&gt;&lt;br /&gt;If you see error, install samba using following steps, I used my root privileges to do so.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;yum install samba-swat samba-client&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After successfull installation, use the same command "smbd -V" to verify. If things look good go to next stop of creating a mount, here is he command&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;mount -t &lt;u&gt;cifs&lt;/u&gt; -o username=win_user,password=win_user_pwd //win_system_IP/Java_Learning&amp;nbsp; /home/gvphubli/win_shared&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: one difference in this command for Ubuntu v/s RH (Fedora and CentOS) is the change from "smbfs" to "cifs"&lt;br /&gt;&lt;br /&gt;You should be all set to share files between host and guest OS&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-8540630293674429057?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/8540630293674429057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=8540630293674429057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8540630293674429057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8540630293674429057'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/07/how-to-share-windows-folder-on-ubuntu.html' title='How to share Windows folder on Ubuntu (guest OS)'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-1703046830739951477</id><published>2011-07-08T09:03:00.000-07:00</published><updated>2011-07-08T09:41:01.788-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='db2 restore'/><title type='text'>db2 restore with mix of full and incremental backups</title><content type='html'>Following are the steps to restore db2 database when you have mix of db backup with full, incremental and delta are involved.This illustration is based on Windows system.&lt;br /&gt;&lt;br /&gt;text in blue are db2 commands&lt;br /&gt;text in green are my comments&lt;br /&gt;text in black are output seen on command line console.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;db2 create db zzz_tmp&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;db2 restore db zzz incremental automatic from C:\ taken at 20110707154108 into zzz_tmp&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;db2 rollforward db zzz_tmp to end of backup and complete&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-- you will see following message, if roll-forward is not complete&lt;br /&gt;&lt;br /&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;SQL4970N Roll-forward recovery on database "ZZZ_TMP" cannot reach the&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;specified stop point (end-of-log or point-in-time) on database partition(s)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;"0". Roll-forward recovery processing has halted on log file "S0000026.LOG".&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;-- if you see a message as listed above you need to get(copy or restore from TSM) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;-- the specified log file to zzz_tmp's active log directory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;db2 rollforward db zzz_tmp to end of backup and complete&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;-- if successfull (you mostly will be) you will see following message&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Rollforward Status&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Input database alias = zzz_tmp&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Number of nodes have returned status = 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Node number = 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Rollforward status = not pending&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Next log file to be read = Log files processed = S0000026.LOG - S0000026.LOG&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Last committed transaction = 2011-07-07-22.41.13.000000 UTC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;DB20000I The ROLLFORWARD command completed successfully.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;-- do some smoke testing, by connecting and possibly quering the db&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;db2 connect to zzz_tmp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Database Connection Information&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Database server = DB2/NT 9.7.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;SQL authorization ID = db2admin&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: x-small;"&gt;Local database alias = ZZZ_TMP&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-1703046830739951477?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/1703046830739951477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=1703046830739951477' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1703046830739951477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1703046830739951477'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/07/db2-restore-with-mix-of-full-and.html' title='db2 restore with mix of full and incremental backups'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-2329776654966910167</id><published>2011-07-07T11:21:00.000-07:00</published><updated>2011-07-25T10:51:59.668-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='db2 merge'/><title type='text'>db2 merge backup - utility test</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was very excited about "db2 merge backup" tool. As per the documentation this tool is supposed to merge incremental and delta backup and merge it with the most recent full db backup prior to these incremetnal or delta backups. More details about this utility can be found &lt;a href="http://www-01.ibm.com/software/data/db2/linux-unix-windows/tools/db2-merge-backup-luw/"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So, if you have this tool working you take one full backup and there are after you just do delta backups and keep merging them with you full backup. Here after you never take full db backups again.&lt;br /&gt;&lt;br /&gt;Out of excitement I decided to test this tool. Downloaded this tool and set it up on my window workstation. I did my full backup, ran couple of database transactions and took the delta backup. Below is the control file options and the command used and the output as well.&lt;br /&gt;&lt;br /&gt;Below are the contents from "SampleMergeCtrlFile.txt" control file used in the test. I used the control file examples from the following link &lt;a href="http://publib.boulder.ibm.com/infocenter/idm/docv3/index.jsp?topic=/com.ibm.datatools.mbk.doc/mbkucon_overview.html"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MERGE DATABASE ZZZ&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;PART (0)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;START FROM "C:" TAKEN AT 20110707153755&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;END FROM "C:" TAKEN AT 20110707154108&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;OUTPUT TO "C:\Merged\"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Below is the my db2 merge command output.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New', Courier, monospace;"&gt;db2mbk -i DB2INST1 -f SampleMergeCtrlFile.txt -s -p 0&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKI445W Warning: you are still using a temporary license.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;you need to enroll DB2 Merge Backup for Linux, UNIX, and Windows within 29 days.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKM031I DB2 Merge Backup for Linux, UNIX, and Windows 01.01.000(110505) 32 bits 7/7/2011 (Windows)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----10----+----11----+----12----+----13--&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;000001 MERGE DATABASE ZZZ&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;PART (0)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;START FROM "C:" TAKEN AT 20110707153755&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;END FROM "C:" TAKEN AT 20110707154108&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;OUTPUT TO "C:\Merged\"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB005I MBK control step start &amp;nbsp; : 16:00:40.287.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB037I Merged backups will not be registered into DB2.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB005I [0] MBK control step start &amp;nbsp; : 16:00:40.302.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB006I [0] MBK control step end &amp;nbsp; &amp;nbsp; : 16:00:40.318.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB006I MBK control step end &amp;nbsp; &amp;nbsp; : 16:00:40.318.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB053I MBK run step start &amp;nbsp; &amp;nbsp; &amp;nbsp; : 16:00:40.318.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB007I [0] MBK inventory step start : 16:00:40.318.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB021I [0] The partition 0 backup image taken at 20110707154108 is involved in the merge (type INCREMENTAL ONLINE DATABASE, device DISK)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB008I [0] MBK inventory step end &amp;nbsp; : 16:00:40.349.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB009I [0] MBK merge step start &amp;nbsp; &amp;nbsp; : 16:00:40.349.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB028I [0] The utility will build the partition 0 backup image taken at 20110707154109 (type FULL ONLINE DATABASE, device DISK)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB021I [0] The partition 0 backup image taken at 20110707153755 is involved in the merge (type FULL ONLINE DATABASE, device DISK)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB010I [0] MBK merge step end &amp;nbsp; &amp;nbsp; &amp;nbsp; : 16:00:41.849.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKB054I MBK run step end &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : 16:00:41.849.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;MBKI442I MBK successfully ended: real time -&amp;gt; 0m1.562530s&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As per the output the merge was successfull. Then I attempted to restore above merged backup set to a new database. Remember merged backup image is equivalent to full backup. The attempted restore failed and db2 complained that the backup image is corrupt!!&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New', Courier, monospace;"&gt;db2 restore db zzz from C:\ taken at 20110707154109 into zzz_tmp&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;SQL2529W &amp;nbsp;Warning! &amp;nbsp;Restoring to an existing database that is different from&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;the backup image database, and the alias name "ZZZ_TMP" of the existing&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;database does not match the alias name "ZZZ" of the backup image, and the&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;database name "ZZZ_TMP" of the existing database does not match the database&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;name "ZZZ" of the backup image. The target database will be overwritten by the&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;backup version. The Roll-forward recovery logs associated with the target&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;database will be deleted.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Do you want to continue ? (y/n) y&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;SQL2530N &amp;nbsp;The backup image is corrupted. &amp;nbsp;Restore of database from this backup&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;image is not possible.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I felt may be my original backups (full and delta) are corrupt. I restored those backups sets instead of the merged and they work just fine. This concluded that the db2 merge utility is doing something funky.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div closure_uid_mzm1hn="153"&gt;If you find my test is not appropriate, correct me by leaving a comments.&lt;/div&gt;&lt;div closure_uid_mzm1hn="153"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div closure_uid_mzm1hn="153"&gt;&lt;span style="color: blue;"&gt;&lt;em&gt;&lt;u&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/u&gt; I was testing this on db2 express 9.7.0 on Window XP. Looks like this issue got resolved after I upgraded db2 to FP4. Later I also fond that if you don't want to upgrade db2 you can modify the merge utility configutaion with following file entry "vendor_object = no" in the configuration file located at "DB2TOOLS\MergeBackup11\cfg\db2mbk.cfg"&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;div closure_uid_mzm1hn="153"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-2329776654966910167?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/2329776654966910167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=2329776654966910167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2329776654966910167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2329776654966910167'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/07/db2-merge-backup-utility-test.html' title='db2 merge backup - utility test'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-3501476853089973463</id><published>2011-05-25T08:02:00.000-07:00</published><updated>2011-05-25T08:07:50.528-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DB2INSTANCE'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL10007N'/><title type='text'>db2 error SQL10007N - Reason code: "3"</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Have you ever encountered errors like,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;SQL10007N Message "-1390" could not be retrieved. &amp;nbsp;Reason code: "3".&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;or&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Error encountered during the Add record action: Failed to lock the registry&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;I usually encounter these issues when we are managing multiple instances on the same box. So, to set the db2 instance context for commands like db2stop, db2start etc. The way we set context is to change the environment variable to DB2INSTANCE, the command is&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;export DB2INSTANCE=db2inst1&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After setting the instance context using above command, all the instance level command and all the db2 command will be directed to that instance, in our case all the commands like db2stop, db2start, db2 list db directory etc. will be directed to "db2inst1"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;However instance name used in export command is case-sensitive. So accidentally if you typed&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;export DB2INSTANCE=DB2INST1&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Then when you run any db2 commands they will complain with error message&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;SQL10007N Message "-1390" could not be retrieved. &amp;nbsp;Reason code: "3".&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;You can't even do &amp;nbsp;"db2 ? SQL10007N" to get help. For your reference here is the help text&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;SQL10007N &amp;nbsp;Message "&lt;msgno&gt;" could not be retrieved. Reason code:&lt;/msgno&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "&lt;code&gt;".&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Explanation:&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;The requested message &lt;msgno&gt; could not be retrieved from the message&lt;/msgno&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;file. Reason code &lt;code&gt; is one of the following:&amp;nbsp;&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;1. The environment variable "DB2INSTANCE" is either not set, or is set&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;to an invalid instance. Correct it and try again.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;2. The message file was found, but the file could not be opened because&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;of permissions. Check the file permissions of the files under the&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;message directory.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;3. The message file could not be found. Either the file does not exist,&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;or the directory the message file should be in does not exist. Check&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;that either a default directory or a directory with the same name as&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;the 'LANG' environment variable exists under the message directory.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;4. The requested message does not exist in the message file. Either the&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;message file is outdated, or it is the wrong one.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;5. Either DB2CODEPAGE is set to a code page which the database does not&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;support, or the client's locale is not supported by the database.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;6. An unexpected system error occurred. Try execution again. If problem&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;persists, contact your IBM representative.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;7. Not enough memory. An attempt to get private memory failed. Try&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;again.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;User response:&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;Reissue the command after verifying the following:&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;* &amp;nbsp;ensure that the DB2INSTANCE environment variable is set to the&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;correct literal string for the username attempting this command&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;* &amp;nbsp;ensure that correct home directory is specified for the username&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;attempting this command (i.e. in the /etc/passwd file)&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;* &amp;nbsp;ensure that the LANG environment variable is set to the correct value&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;for the installed language, or is set to 'C', on the username&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;attempting this command&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;* &amp;nbsp;Even if the message file is outdated, you can still find up-to-date&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;information about the message in the database server documentation.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;If all of the above are correct and the error still occurs, reinstall&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;DB2.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;div style="font-family: Verdana, sans-serif;"&gt;&lt;code&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;If you do db2ilist you get the instance list along a message..&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Error encountered during the Add record action: Failed to lock the registry&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;These are some of the side effects when you don't set the DB2INSTANCE variable correctly.&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-3501476853089973463?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/3501476853089973463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=3501476853089973463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3501476853089973463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3501476853089973463'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/05/db2-error-sql10007n-reason-code-3.html' title='db2 error SQL10007N - Reason code: &quot;3&quot;'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-7430650841819209577</id><published>2011-04-21T15:21:00.000-07:00</published><updated>2011-04-21T15:21:47.308-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL1035N'/><category scheme='http://www.blogger.com/atom/ns#' term='db2 luw Event monitors'/><title type='text'>db2 drop db error !</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div class="MsoNoSpacing"&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;I was trying to drop database but was getting following error,&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;SQL1035N&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;The database is currently in use.&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/span&gt;SQLSTATE=57019&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;So, while I logged in as instance owner, I tried following.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;-- first attempt&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 list applications global&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;No sessions were listed except my own local connections. Then I tried following set of statements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;-- second attempt&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 deactivate db myDB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 drop database myDB&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;Still no luck, I kept getting the same message. Then I tried another variation&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;-- third attempt&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 connect to myDB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 quiesce database immediate force connections&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 connect reset&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 terminate&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 drop database myDB&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;Finally I tried this,&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;-- final attempt&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 terminate&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;span style="color: red; font-family: &amp;quot;Courier New&amp;quot;;"&gt;db2 drop database myDB&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;I was puzzled, why my third attempt did not work and the final one worked?&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;I thought it might be the sequence of statements. I looked into the "db2 terminate" command documentation on db2 information center, and her is what it says,&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;Although TERMINATE and CONNECT RESET both break the connection to a database, only TERMINATE results in termination of the back-end process.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;It is recommended that TERMINATE be issued prior to executing the db2stop command. This prevents the back-end process from maintaining an attachment to a database manager instance that is no longer available.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;What all this means is always use "db2 terminate" if you really want to disconnect your connections/sessions before doing db level options like db drop etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNoSpacing"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-7430650841819209577?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/7430650841819209577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=7430650841819209577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7430650841819209577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7430650841819209577'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/04/db2-drop-db-error.html' title='db2 drop db error !'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-8905960045178977216</id><published>2011-04-14T10:09:00.000-07:00</published><updated>2011-04-14T10:09:53.535-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='db2 luw Event monitors'/><title type='text'>db2 luw 9.7 - Event monitors</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Quick steps to setup event monitoring to capture the db2 sql activity and get to the output to some readable format.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span class="Apple-style-span" style="color: green; font-family: 'Courier New'; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span class="Apple-style-span" style="color: green; font-family: 'Courier New'; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-- db2 event monitoring for tracking sql statements etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-- first created for troubleshooting PowerDesigner issue.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-- sql statement to create evt monitor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;CREATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; EVENT MONITOR evtmon_pd_issue&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;FOR&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; STATEMENTS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;WHERE&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; AUTH_ID &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;=&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;'USER_ID'&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;WRITE&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;TO&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;FILE&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;'/home/db2admin'&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;span style="mso-tab-count: 1;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="background: white; color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-- this is a directory path&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;MAXFILES &lt;/span&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;5&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;MAXFILESIZE &lt;/span&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;1024&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;NONBLOCKED &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;APPEND&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2 &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"set event monitor evtmon_pd_issue state 1"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2 &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"set event monitor evtmon_pd_issue state 0"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;--After stopping the evt monitor you will see a file in "/home/&lt;span class="Apple-style-span" style="color: grey;"&gt;db2admin&lt;/span&gt;" which has word "evt" in its name and has sequential number at the end if there are many files created&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-- this will format out the evt monitor captured data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2evmon &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;path&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;'/home/db2admin'&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; evtmon_pd_issue&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-- in *.out file you see output in readable format (txt)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: green; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-- ones done with your experiements, drop the evt monitor(s)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2 &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"drop event monitor evtmon_pd_issue"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;For more information on event monitors go to&lt;/span&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;o:p&gt;&lt;a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.admin.mon.doc/doc/c0055386.html"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.admin.mon.doc/doc/c0055386.html&lt;/span&gt;&lt;/a&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-8905960045178977216?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/8905960045178977216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=8905960045178977216' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8905960045178977216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8905960045178977216'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/04/db2-luw-97-event-monitors.html' title='db2 luw 9.7 - Event monitors'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-3025687235960194790</id><published>2011-03-14T22:51:00.000-07:00</published><updated>2011-04-14T10:52:21.075-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='db2 luw WLM'/><title type='text'>db2 luw monitoring using WLM</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11pt;"&gt;Quick steps to setup WLM (workload manager) and its related tables. This is an extension to event monitoring. In this sample I am using default system WLM service class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: black; font-size: 13.5pt;"&gt;&lt;br style="mso-special-character: line-break;" /&gt; &lt;br style="mso-special-character: line-break;" /&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;-- create workload (uses default system service classes)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; WORKLOAD &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"WL_POWERDESIGNER"&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SYSTEM_USER&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;'APPUSER_ID'&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;COLLECT&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; ACTIVITY &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;DATA&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;ON&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; COORDINATOR DATABASE &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;PARTITION&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WITH&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; DETAILS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;AND&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;VALUES&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;GRANT&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;USAGE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;ON&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; WORKLOAD WL_POWERDESIGNER &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TO&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;PUBLIC&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SET&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CURRENT&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SCHEMA&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;=&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"WLM"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;-- following create statements will create all the required tables for capturing the trace output.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; EVENT MONITOR &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"DB2STATISTICS"&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FOR&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; STATISTICS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WRITE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TO&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONTROL &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"CONTROL_DB2STATISTICS"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; HISTOGRAMBIN &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"HISTOGRAMBIN_DB2STATISTICS"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; QSTATS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"QSTATS_DB2STATISTICS"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCSTATS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"SCSTATS_DB2STATISTICS"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WCSTATS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"WCSTATS_DB2STATISTICS"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WLSTATS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"WLSTATS_DB2STATISTICS"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOSTART&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; EVENT MONITOR &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"DB2ACTIVITIES"&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FOR&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; ACTIVITIES&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WRITE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TO&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACTIVITY &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"ACTIVITY_DB2ACTIVITIES"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACTIVITYSTMT &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"ACTIVITYSTMT_DB2ACTIVITIES"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACTIVITYVALS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"ACTIVITYVALS_DB2ACTIVITIES"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONTROL &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;"&gt;"CONTROL_DB2ACTIVITIES"&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;,&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOSTART&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; EVENT MONITOR DB2THRESHOLDVIOLATIONS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FOR&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; THRESHOLD VIOLATIONS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WRITE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TO&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THRESHOLDVIOLATIONS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; THRESHOLDVIOLATIONS_DB2THRESHOLDVIOLATIONS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;),&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONTROL &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;(&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;TABLE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; CONTROL_DB2THRESHOLDVIOLATIONS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;IN&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; USERSPACE1 &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;)&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AUTOSTART&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;-- activate the EM's &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;-- SET STATE = 1 and STATE = 0 to deactivate&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SET&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; EVENT MONITOR DB2ACTIVITIES &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;STATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #ff8000; font-family: 'Courier New'; font-size: 10pt;"&gt;1&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SET&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; EVENT MONITOR DB2STATISTICS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;STATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #ff8000; font-family: 'Courier New'; font-size: 10pt;"&gt;1&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SET&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; EVENT MONITOR DB2THRESHOLDVIOLATIONS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;STATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #ff8000; font-family: 'Courier New'; font-size: 10pt;"&gt;1&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11pt;"&gt;Now run some queries on the given database and data will be captured in below tables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: green; font-family: 'Courier New'; font-size: 10pt;"&gt;-- following are the table to look at, I used activity_id to link the two.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;*&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FROM&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; WLM&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;ACTIVITYSTMT_DB2ACTIVITIES&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;*&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;FROM&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; WLM&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: navy; font-family: 'Courier New'; font-size: 10pt;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;ACTIVITYVALS_DB2ACTIVITIES&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: black; font-family: 'Times New Roman', serif;"&gt;Note the “&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;CREATE&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; WORKLOAD&lt;/span&gt;&lt;span style="color: black; font-family: 'Times New Roman', serif;"&gt;” statement has “&lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;WITH&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; DETAILS &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;AND&lt;/span&gt;&lt;/b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;VALUES&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black; font-family: 'Times New Roman', serif;"&gt;” clause, which means we capture the statements and also the host variables passed to the statements if any. So, the “&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;ACTIVITYVALS_DB2ACTIVITIES&lt;/span&gt;&lt;span style="color: black; font-family: 'Times New Roman', serif;"&gt;” table will have multiple rows for every row in “&lt;/span&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;ACTIVITYSTMT_DB2ACTIVITIES&lt;/span&gt;&lt;span style="color: black; font-family: 'Times New Roman', serif;"&gt;” table depending on how many variables were passed in the statements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="color: black; font-family: 'Times New Roman', serif;"&gt;&lt;o:p&gt;For more details go to&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif;"&gt;&lt;a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.admin.mon.doc/doc/c0055386.html"&gt;Creating workloads and defining limits&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-3025687235960194790?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/3025687235960194790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=3025687235960194790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3025687235960194790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3025687235960194790'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/04/db2-luw-monitoring-using-wlm.html' title='db2 luw monitoring using WLM'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-242429535187374071</id><published>2011-02-15T10:15:00.000-08:00</published><updated>2011-04-14T10:19:22.279-07:00</updated><title type='text'>db2 Automation - HADR status check</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 13.5pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;Ever wanted to check what's the HADR status, on multiple instances and multiple databases on the same host?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;noformat&gt;&lt;span style="color: black; font-size: 13.5pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;#!/usr/bin/ksh&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/noformat&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;# file name - "hadr_status_check_v2.sh"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;# Crontab entry -------- &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;# 0 6 * * * . $HOME/.profile; /db2_maint_scripts/hadr_check.sh&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;#&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;#&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;clear&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;rm hadr_check&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2ilist &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;|&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;while&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;read&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; instance &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; hadr_check&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;2&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;amp&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;1&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;do&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;export DB2INSTANCE&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;=&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;$instance&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2 &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;o &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;terminate&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;/&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;dev&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;/&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;null&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;2&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;amp&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;1&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2 list active databases&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;|&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;grep &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;i &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;'Database name'&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;|&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;awk &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;'{print $NF}'&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;|&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;while&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;read&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; dbname&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;do&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;echo &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"Checking HADR Status for - $dbname on Instance $instance"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;echo &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"\n========== HADR Status for - $dbname on Instance $instance ==========\n"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; hadr_check&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;2&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;amp&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;1&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2 &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;get&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; snapshot &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;for&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; database &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;on&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; $dbname &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;|&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; grep &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;p &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;i &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;'HADR Status'&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; hadr_check&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;2&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;gt&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&amp;amp;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;amp&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;1&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;done&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;done&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;# email the report&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;[&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"$?"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;=&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"0"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;];&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;then&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;cat hadr_check&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;|&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; mail &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;s &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"HADR Status Report for host: `hostname`"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"someone@email.com"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;else&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;cat hadr_check&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;|&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; mail &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;-&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;s &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"HADR Status Report errored on host: `hostname`"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"someone_else@email.com"&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;fi&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;echo &lt;/span&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;"========== Check out the file "&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;hadr_check&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="background: white; color: blue; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: grey; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;" for actual details =========="&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;"&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;# --- end of script ------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;If you run this script as the db2 instance owner or with any user with privileges as db2 sys admin you should be able to run this script successfully.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;To get it to work as a scheduled job, make any entry in the crontab as follows - while logged in as db2 instance owner or as user with db2 sys admin.&lt;/span&gt;&lt;span style="color: black; font-size: 13.5pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;0&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;span style="background: white; color: #ff8000; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;6&lt;/span&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;*&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;*&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;*&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; $HOME&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;/.&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;profile&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;/&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;db2_maint_scripts&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;/&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;hadr_check&lt;/span&gt;&lt;b&gt;&lt;span style="background: white; color: navy; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;.&lt;/span&gt;&lt;/b&gt;&lt;span style="background: white; color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; mso-highlight: white;"&gt;sh&lt;/span&gt;&lt;span style="color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;run every morning 6 AM at 0th minute every day, every month etc...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;If you carefully look at the crontab command, I use ". $HOME/.profile;" to call the profile so that it picks up the db2 profile setting as well. Otherwise the db2ilist and other db2 commands will fail. Other pieces are "db2_maint_scripts" - is where my scripts are located and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;"hadr_check.sh" - is the script name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;If other settings like email and privileges are setup as required, you should receive one email&amp;nbsp;every morning with HADR status details for each database on each instance on a given host. Please if the database is in deactivated state the "LIST ACTIVE DATABASES" will not list all databases. Any thoughts on how to get around this?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;Apart from HADR status check, this script also demonstrates how to use unix command output to create a loop and this script can be easily adapted to monitor and take some action like failing over to other stand-by database - to trigger a TAKOVER command.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: .0001pt; margin: 0in;"&gt;&lt;span style="color: black; font-size: 11.0pt;"&gt;Please post any questions or troubleshooting help in the comments sections.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-242429535187374071?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/242429535187374071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=242429535187374071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/242429535187374071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/242429535187374071'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/02/db2-automation-hadr-status-check.html' title='db2 Automation - HADR status check'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-4019008553722134638</id><published>2010-12-07T01:00:00.000-08:00</published><updated>2011-02-07T13:15:17.731-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TSM Cross-node restore'/><title type='text'>Cross-node TSM Restore</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Cross-node TSM restore is all about restoring a database TSM backups from some other server on to another server while accessing TSM directly from the new server. If you don't want to deal with all this you can&amp;nbsp;&lt;u&gt;&lt;b&gt;extract&lt;/b&gt;&lt;/u&gt;&amp;nbsp;the files locally and copy them over to other server.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;On your original instance open and check the contents of the following file "/usr/tivoli/tsm/client/api/bin64/dsm.sys" and list your TSM node names&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;After identifying the node name grant appropriate previlages to the user that you will mostly like use for db restore/recover purposes.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, sans-serif;"&gt;Assuming your node name is "db2inst2x-db2", your instance name owner name is "xyzp01" and your dbname is "DB001P01" - following are are the sample commands&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New', Courier, monospace;"&gt;db2adutl revoke user xyzp01 on nodename db2inst2x for db DB001P01&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New', Courier, monospace;"&gt;db2adutl grant user xyzp01 on nodename db2inst2x-db2 for db DB001P01&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New', Courier, monospace;"&gt;db2adutl query db DB001P01 nodename db21p1x-db2 owner xyzp01&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color: blue; font-family: 'Courier New', Courier, monospace;"&gt;db2 restore db DB001P01 use tsm options "'-fromnode=db21p1x-db2 -fromowner=xyzp01'" TAKEN AT 20101112080432 INTO DB001P01 REDIRECT&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-4019008553722134638?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/4019008553722134638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=4019008553722134638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4019008553722134638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4019008553722134638'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2011/02/cross-node-tsm-restore.html' title='Cross-node TSM Restore'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-4380950505856483991</id><published>2010-05-05T14:09:00.000-07:00</published><updated>2010-05-05T14:21:47.037-07:00</updated><title type='text'>Changing you Unix/AIX Profile to enable DB2 commands</title><content type='html'>&lt;span style="font-family: Verdana, sans-serif;"&gt;I am writing this article with DB2 newbies in mind and to keep my own knowledge and experiences available when I want it :)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;When I log in to AIX/Unix box and if I try to run DB2 command it fails with following message&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;"ksh: db2: not found"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;This is becauase the DB2 user profile is not loaded into your shell environment. To load it automatically whenever you login, you need to edit your ".profile" file. Below are the step for the same. This is very similar to window DOS environment setup with environment variables and set path etc.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;type "vi .profile" in the console window. vi editor should open up with the contents of the .profile file. After the vi is open, it's in command mode, so whatever you type it will not be visible on the screen. By chance you some some valid vi command you will see some action else nothing will be happening.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;In my case here is how it looks like, just so that you know how the vi editor looks like&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_h-wHXdbkoAM/S-Hech9lnbI/AAAAAAAAIEE/ARSzUtdawbo/s1600/editProfile.GIF" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_h-wHXdbkoAM/S-Hech9lnbI/AAAAAAAAIEE/ARSzUtdawbo/s320/editProfile.GIF" tt="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;editprofile.gif&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;You can refer to below URL for vi commands. With the help of vi command you should be able to put the following text into the .profile that you have opened.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;# The following three lines have been added by UDB DB2.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;if [ -f /home/db2inst1/sqllib/db2profile ]; then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;. /home/db2inst1/sqllib/db2profile&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Or you may want to just copy above line and just paste it {ESC}i and right click with a mouse(assuming the contents are in the clipboard)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;After you are done with editing enter ":wq" command to save and quit the editor.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;For this profile change to take effect you need to log-off and log back in. When you log back in, try db2 and it should take you to DB2 prompt.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Hope this serves some help to people who are new to DB2 and coming from windows background like I do.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-4380950505856483991?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/4380950505856483991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=4380950505856483991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4380950505856483991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4380950505856483991'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2010/05/changing-you-unixaix-profile-to-enable.html' title='Changing you Unix/AIX Profile to enable DB2 commands'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_h-wHXdbkoAM/S-Hech9lnbI/AAAAAAAAIEE/ARSzUtdawbo/s72-c/editProfile.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-3312376964661145975</id><published>2009-10-05T16:19:00.001-07:00</published><updated>2009-10-05T16:20:27.228-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='universal database'/><title type='text'>Universal Database</title><content type='html'>&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;There are hundred’s of websites that ask you to register and in the member registration screen / page they usually ask you to fill-in your residential or shipping address details like STATE and COUNTRY. If you go to any ecommerce sites like eBay or PayPal they usually ask for CURRENCY that you like to trade-in. Look at currency exchange site, so may countries are listed with CURRENCY abbreviations. Similarly if you go to sites where you buy and sell used automobiles like www.autotrader.com, there you will see automobile MAKE and MODEL listed, even these two fields are repeated in many other similar sites. These some of the examples that we can easily see over the web, but imagine about the desktop applications in every organization – its mind blowing to think how many copies of this same set of data is sitting and what it might be costing.&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/?xml:namespace&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Anyways let’s get going, details like STATE, State abbreviations (CT, NY etc), Days (Monday, Tuesday …Sunday), TIME (00:15, 00:30….. 23:45 etc…), MONTH (Jan, Feb, Mar etc) – let me call them as generic for the purpose of writing this article. Below are the examples that I am talking about.&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/?xml:namespace&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Examples:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt; &lt;td&gt;DAY:&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;select name="Day"&gt;&lt;br /&gt;&lt;option&gt;Select Your Day&lt;/option&gt;&lt;br /&gt;&lt;option value="Mon"&gt;Monday&lt;/option&gt;&lt;br /&gt;&lt;option value="Tue"&gt;Tuesay&lt;/option&gt;&lt;br /&gt;&lt;option value="..."&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="..."&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="Sun"&gt;Sunday&lt;/option&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;TIME:&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;select name="Time"&gt;&lt;br /&gt;&lt;option&gt;Select Time&lt;/option&gt;&lt;br /&gt;&lt;option value="Midnight"&gt;Midnight&lt;/option&gt;&lt;br /&gt;&lt;option value="12:00 AM"&gt;12:00 AM&lt;/option&gt;&lt;br /&gt;&lt;option value="12:15 AM"&gt;12:15 AM&lt;/option&gt;&lt;br /&gt;&lt;option value="12:30 AM"&gt;12:30 AM&lt;/option&gt;&lt;br /&gt;&lt;option value="12:30 AM"&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="12:30 AM"&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="12:30 AM"&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="11:00 PM"&gt;11:00 PM&lt;/option&gt;&lt;br /&gt;&lt;option value="11:15 PM"&gt;11:15 PM&lt;/option&gt;&lt;br /&gt;&lt;option value="11:30 PM"&gt;11:30 PM&lt;/option&gt;&lt;br /&gt;&lt;option value="11:45 PM"&gt;11:45 PM&lt;/option&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;TIMEZONES:&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;select name="Timezone"&gt;&lt;br /&gt;&lt;option&gt;Select Time Zone&lt;/option&gt;&lt;br /&gt;&lt;option value=-12&gt;(GMT -12:00 hours) Eniwetok, Kwajalein&lt;/option&gt;&lt;br /&gt;&lt;option value=-11&gt;(GMT -11:00 hours) Midway Island, Samoa&lt;/option&gt;&lt;br /&gt;&lt;option value=-10&gt;(GMT -10:00 hours) Hawaii&lt;/option&gt;&lt;br /&gt;&lt;option value=-9&gt;(GMT -9:00 hours) Alaska&lt;/option&gt;&lt;br /&gt;&lt;option value=-8&gt;(GMT -8:00 hours) Pacific Time (US &amp; Canada)&lt;/option&gt;&lt;br /&gt;&lt;option value=-. &gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value=-. &gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value=-. &gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value=12&gt;(GMT +12:00 hours) Auckland, Fiji, Marshall Island&lt;/option&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;CURRENCY:&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;select Name="Currency"&gt;&lt;br /&gt;&lt;option&gt;Select your currency&lt;/option&gt;&lt;br /&gt;&lt;option value=AFN&gt;Afghanistan, Afghani (AFN)&lt;/OPTION&gt;&lt;br /&gt;&lt;option value=ALL&gt;Albania, Lek (ALL)&lt;/OPTION&gt;&lt;br /&gt;&lt;option value=DZD&gt;Algeria, Dinar (DZD)&lt;/OPTION&gt;&lt;br /&gt;&lt;option value=...&gt;...&lt;/OPTION&gt;&lt;br /&gt;&lt;option value=...&gt;...&lt;/OPTION&gt;&lt;br /&gt;&lt;option value=...&gt;...&lt;/OPTION&gt;&lt;br /&gt;&lt;option value=WST&gt;Samoa, Tala (WST)&lt;/OPTION&gt; &lt;br /&gt;&lt;option value=ZWD&gt;Zimbabwe, Dollar (ZWD)&lt;/OPTION&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;&lt;td&gt;CAR MAKE:&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;select&gt;&lt;br /&gt;&lt;option value=""&gt;Car Make&lt;/option&gt;&lt;br /&gt;&lt;option value="ACURA"&gt;Acura&lt;/option&gt;&lt;br /&gt;&lt;option value="ALFA"&gt;Alfa Romeo&lt;/option&gt;&lt;br /&gt;&lt;option value="..."&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="..."&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="..."&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="YUGO"&gt;Yugo&lt;/option&gt;&lt;br /&gt;&lt;/select&gt; **Model depends on Make&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;COUNTRY&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;select&gt;&lt;br /&gt;&lt;option&gt;Select country&lt;/option&gt;&lt;br /&gt;&lt;option value="AF"&gt;Afghanistan&lt;/option&gt;&lt;br /&gt;&lt;option value="AL"&gt;Albania&lt;/option&gt;&lt;br /&gt;&lt;option value="DZ"&gt;Algeria&lt;/option&gt;&lt;br /&gt;&lt;option value="..."&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="..."&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="..."&gt;...&lt;/option&gt;&lt;br /&gt;&lt;option value="ZW"&gt;Zimbabwe&lt;/option&gt;&lt;br /&gt;&lt;option value="AX"&gt;Åland Islands&lt;/option&gt;&lt;br /&gt;&lt;/select&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/?xml:namespace&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/?xml:namespace&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/?xml:namespace&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;What came next to my mind was, how about having Universal Database? All the above generic information stored and maintained as one single copy by some organization/ person/ entity, of course with all the disaster recovery and availability in place&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/?xml:namespace&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;How do we share this data with the world – may be via Web services or may be via &lt;br /&gt;&lt;st1:place w:st="on"&gt;&lt;br /&gt;&lt;st1:city w:st="on"&gt;AJAX&lt;/st1:city&gt;&lt;/st1:place&gt;. Create JavaScript (AJAX) functions to fill up the combo boxes; the client website will call the JavaScript function or API to fill the dropdown in his page.&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/?xml:namespace&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Most of the time these fields are used to ensure that the end user does not make typo errors while entering his details and then the details are stored as is. However many a time the data is stored in relational model and there you need these physical (tables with generic data) table itself to generate your reports. If that is also addressed i.e. if the consumers of the generic data is given access to join with these tables with generic data that would solve the problem.&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/?xml:namespace&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;These are just my meandering – don’t take it serious. But these are near future possibilities or may be already in use who knows – at least I don’t know. However I found something interesting – &lt;a href="http://www.freebase.com/"&gt;&lt;span style="FONT-FAMILY: Times New Roman"&gt;www.freebase.com&lt;/span&gt;&lt;/a&gt;. This site is trying to gather/ organize all the information and is like wiki, anyone can update the database. This massive database can be queried, watch the video posted over there – it’s cool!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-3312376964661145975?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/3312376964661145975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=3312376964661145975' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3312376964661145975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3312376964661145975'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2009/10/universal-database.html' title='Universal Database'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-4047492249285266219</id><published>2009-09-03T17:26:00.000-07:00</published><updated>2009-09-03T17:26:54.724-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Powershell for SQL Database Administrators</title><content type='html'>Here is list of links that can get you started with Power Shell for SQL Database Administrators (DBA)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.databasejournal.com/features/mssql/article.php/3681061/Microsoft-Windows-PowerShell-and-SQL-Server-2005-SMO--Part-I.htm"&gt;http://www.databasejournal.com/features/mssql/article.php/3681061/Microsoft-Windows-PowerShell-and-SQL-Server-2005-SMO--Part-I.htm&lt;/a&gt;&lt;br /&gt;This is a 3 part article that start from installation and how to interact with Power Shell (PS)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mssqltips.com/tip.asp?tip=1680"&gt;http://www.mssqltips.com/tip.asp?tip=1680&lt;/a&gt;&amp;nbsp;- again this one introduces how to use PS and makes you comfortable with couple of commands&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.simple-talk.com/sql/database-administration/why-this-sql-server-dba-is-learning-powershell/"&gt;http://www.simple-talk.com/sql/database-administration/why-this-sql-server-dba-is-learning-powershell/&lt;/a&gt;&lt;br /&gt;This one directly delves into how to us PS to automate some of the SQL Server admin task, includes good practical samples.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://itknowledgeexchange.techtarget.com/dba/powershell-sql-server-health-check-script/"&gt;http://itknowledgeexchange.techtarget.com/dba/powershell-sql-server-health-check-script/&lt;/a&gt;&amp;nbsp;- Here is the really working sample that dumps the database information into an excel sheet.&lt;br /&gt;&lt;br /&gt;Using the above links you should be able to build a script which can scan all your SQL Servers (listed in a given txt file) and dump the required information into a nicely formatted excel sheet.&lt;br /&gt;&lt;br /&gt;But in my case most of the automation that I built around SQL Server was using VB Script, HTML templates and DOS!&lt;br /&gt;&lt;br /&gt;I think Power Shell is for new age Database Administrators.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-4047492249285266219?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/4047492249285266219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=4047492249285266219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4047492249285266219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4047492249285266219'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2009/09/powershell-for-sql-database.html' title='Powershell for SQL Database Administrators'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-181210359228376659</id><published>2009-08-30T06:46:00.000-07:00</published><updated>2009-08-30T06:46:35.409-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='organizational changes'/><title type='text'>Organizational Changes - why they are painful ?</title><content type='html'>Why changes don't happen easily in organizations, why are they painful?&lt;br /&gt;&lt;br /&gt;Most common reasons, employees don't like it. As popular saying goes "Change is painful".&lt;br /&gt;&lt;br /&gt;My understanding is different. Human being always like change, it makes them feel they are alive and that's why they change their furniture's and personal vehicles and on top of it they pay for it and they enjoy doing so. &lt;br /&gt;&lt;br /&gt;So why does it not work in organizations?&lt;br /&gt;&lt;br /&gt;First reason I think is - it is because the process “change” starts from Management and flows down to people/employees, so it's not their idea or thought that is being implemented. It's an idea of some manager sitting somewhere in an isolated area. Though the change might be strategically the best one - but people at each desk think differently about the management.&lt;br /&gt;&lt;br /&gt;Second reason as per my knowledge is the "process" of change is painful. This can be best explained with typical case. Suppose in an organization a developer is writing his Java programs in a notepad and saving it into a source control application which is totally external (not integrated). He has been doing this from last couple of years, let’s say 7 years and it involves very simple steps. Most of the developers know how to use it and also troubleshoot. Apart from this there are good amount website and forums that talk about this current method of Java development setup. Now organization decided to bring in some Integrated Development Environment (IDE) to improve the productivity of the developers. And they decided to bring in some XYZ IDE. Management decided on this "XYZ IDE" as the comity involved in the decision making decided so. Now developers are asked to use this development environment.&lt;br /&gt;&lt;br /&gt;All the assumptions or the predictability that developer had about the old process, over course of time are now invalid. He doesn’t know whom to approach, what to look for. Of course this is common thing with every thing that changes in life. What if that developer is given some training? -  Even that will not work any magic. I would say people should be given with learning resources that can help them right when they want it.  If this kind of help is not available I am sure the change is going to bring just frustration, no productivity, in fact negative productivity.  Individual's productivity loss will further spread into his other job areas.&lt;br /&gt;&lt;br /&gt;Here what I think should be done:&lt;br /&gt;&lt;br /&gt;Involve as many people as possible while implementing change, make it their own. Involve them in brain storming, testing and evaluation processes. So that knowledge start building in the community before the change is brought.&lt;br /&gt;&lt;br /&gt;Secondly I would suggest forming a mentor groups before bringing in change. The individuals affected by these changes should be aware of resources that can help them, when they need it. The resources could be the documentation, on-demand video or  a co-worker sitting next to him&lt;br /&gt;&lt;br /&gt;If someone commits mistakes, he should not be discouraged, by making it painful to fix it or worst case by a office wide memo publicizing his name. Such events will discourage individuals from exploring the "NEW" tools or techniques. Most of the inventions are brought to the world via accidents (while exploring), not by the dedicated R&amp;D efforts, so exploration is good.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-181210359228376659?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/181210359228376659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=181210359228376659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/181210359228376659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/181210359228376659'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2009/08/organizational-changes-why-they-are.html' title='Organizational Changes - why they are painful ?'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-8002589858474529632</id><published>2009-06-30T06:49:00.000-07:00</published><updated>2009-08-30T06:52:33.117-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='delegation'/><category scheme='http://www.blogger.com/atom/ns#' term='managers'/><title type='text'>Dear Manager - Please Delegate</title><content type='html'>&lt;div&gt;&amp;nbsp;&lt;/div&gt;Some managers do not delegate work to their sub-ordinates, why?&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;Reasons:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Manager has no patience to teach his sub-ordinates on how to do some of the stuffs.&lt;/li&gt;&lt;li&gt;Manager simply doesn’t trust his sub-ordinates.&lt;/li&gt;&lt;li&gt;He thinks he will lose the control of the department, as he cannot keep up with – “what is happening?” kind of stuff&lt;/li&gt;&lt;li&gt;Some managers hesitate to delegate thinking that, what his subordinates will think of him – “he just dumps everything on us and browses eBay all after-noon”&lt;/li&gt;&lt;li&gt;Manager thinks the sub-ordinates are not intellectually capable of handling the work.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;While manager is one who has capability, maturity, strong business sense and can play the role of a mentor. If this is what manager is then he should not be worried about any of the above.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;As a manager you should trust your sub-ordinates and have full faith in them and depend on them, else your boss will ask you – What is your productivity, with 7-8 members under you? And you will have no answer.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;Many a times, you will face situations where you think, its better you do it yourself instead of teaching your subordinate, just because you don’t have time and patience to deal with, you cannot slip away from taking the role of a “mentor”. You have to develop that quality of being patient and teach your sub-ordinates. Teaching and making your sub-ordinates more productive is the best time-investment that can count on.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;You should keep tab on what is going on in your department to the extent of what is happening, it’s not necessary to understand how it being done. You simply cannot keep account of every piece that happens within the department. It’s like driving the car at its optimal speed, whenever there is some noise or you suspect some performance issue, you need to open the hood and check it out. As a manger you should be spending more time on thinking how to improve the effectiveness of the team rather than looking each individuals tasks and taking account of them.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;Yes manager has to browse the world (not eBay) to gain knowledge and develop new thoughts or ideas. However do not forget your sub-ordinates (your team) have more ready ideas and thoughts that can directly affect your team’s effectiveness. So first listen to them and see if you can materialize them.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;Read the above paragraphs above about your personnel development again. You have to give knowledge, capabilities and have to trust your team and that’s the way you can develop some level of independence within the team. Do not paralyze your team by making it dependent on you for every decision that you make for them, soon you will be the bottleneck and you will be in stress.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-8002589858474529632?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/8002589858474529632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=8002589858474529632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8002589858474529632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8002589858474529632'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2009/06/dear-manager-please-delegate.html' title='Dear Manager - Please Delegate'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-3485842672818196583</id><published>2009-03-29T20:19:00.001-07:00</published><updated>2009-03-29T20:37:15.917-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='interview questions'/><title type='text'>How to Back Up the Transaction Log When the Database Is Damaged</title><content type='html'>&lt;table cellspacing="0" cellpadding="0" border="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top"&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:100%;"&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;This is one of the best and most frequently asked question in the SQL DBA interview especially if you are being interview for "Production Support DBA" role.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;"How to Back Up the Transaction Log When the Database Is Damaged" aka "how to perform tail log backup" - you will face this kind of issues when your database which get corrupted and goes in suspect most while in use or when you recover from a server crash mostly in cases like disk failures. When such failures occur your best method to recover the data is to restore your backup (full/diff/t.logs), so when do we need the tail log backups ?&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Assume a case like this one - you take a full backup every night and differentials every 4 hrs. and t.log backups every 15 minutes, which most of us do. Suppose your t.log backup was about to start at 11:15 AM and crash happens at 11:13 AM. So, we are left with a gap of 11:00 AM to 11:13 AM transaction - how do we recover from this gap, yes we depend on tail log. There is no gurantee that you will recover best all of the data, but is a "best effort" strategy as a responsible DBA.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Here is the T-SQL command,&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;font-size:100%;"&gt;&lt;br /&gt;BACKUP LOG TestDB TO TestDB_FullRM_log1 WITH NO_TRUNCATE&lt;br /&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:100%;"&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Notice the keyword "NO_TRUNCATE", why we need it ? - NO_TRUNCATE clause allows the active part of the t.log to be backed up even if the database is inaccessible/offline, provided the transaction log file is accessible and undamaged, this is very important so keep it in mind :) - for interview as well as for real case where you are required to recover the database from a failure.Why it's called tail log ? - because this is the last backup taken from the failed database in order to recover from failures. &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-3485842672818196583?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/3485842672818196583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=3485842672818196583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3485842672818196583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3485842672818196583'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2009/03/how-to-back-up-transaction-log-when.html' title='How to Back Up the Transaction Log When the Database Is Damaged'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-7065725843711479776</id><published>2009-03-19T12:06:00.001-07:00</published><updated>2009-03-27T12:47:50.476-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Job Status Reporting'/><title type='text'>SQL Job Status Reporting</title><content type='html'>&lt;div class="Section1"&gt;&lt;p class="MsoNormal"&gt;&lt;span style="color:#1f497d;"&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;One day I suddenly see that my LiteSpeed DB backup job is running and running forever ! - though it did not fail but it did not complete so its still a failure in my opinion. This can happen due to third part component failure, or due to bug in the Windows OS or in the SQL Server agent. So, for what so ever reason if job/step is hung, its an issue. To overcome this issue I decided to email out the SQL Job status as a summarised report to myself (and other as required).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Here is the script to achieve the same. It will send out an email (assuming you have configure email feature on your SQL Server) with SQL Job status like LastRun time LastRunStatus and TimeTaken for latest execution.&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--===================================================&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;DECLARE&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @tableHTML &lt;span style="color:blue;"&gt;NVARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;MAX&lt;/span&gt;&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt;@SubjLine &lt;span style="color:blue;"&gt;varchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;500&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;SET&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @tableHTML &lt;span style="color:gray;"&gt;=&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;N&lt;span style="color:red;"&gt;'&amp;lt;H4&amp;gt;SQL Server Job Status Report:&amp;lt;/H4&amp;gt;'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;N&lt;span style="color:red;"&gt;'&amp;lt;table border="1"&amp;gt;'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;N&lt;span style="color:red;"&gt;'&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Job Name&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;is enable ?&amp;lt;/th&amp;gt;'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;N&lt;span style="color:red;"&gt;'&amp;lt;th&amp;gt;LastRunDateTime&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;LastRunDuration&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;LastRunOutCome&amp;lt;/th&amp;gt;'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt; &lt;span style="color:gray;"&gt;(&lt;/span&gt; &lt;span style="color:gray;"&gt;(&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;SELECT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;td &lt;span style="color:gray;"&gt;=&lt;/span&gt; J&lt;span style="color:gray;"&gt;.&lt;/span&gt;&lt;span style="color:blue;"&gt;Name&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;span style="color:red;"&gt;''&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;td &lt;span style="color:gray;"&gt;=&lt;/span&gt; J&lt;span style="color:gray;"&gt;.&lt;/span&gt;Enabled&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;span style="color:red;"&gt;''&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;td &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:gray;"&gt;left(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_date&lt;span style="color:gray;"&gt;,&lt;/span&gt;4&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;'-'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;SUBSTRING&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_date &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;),&lt;/span&gt;5&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;'-'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:gray;"&gt;right(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_date&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt;&lt;span style="color:red;"&gt;' '&lt;/span&gt;&lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;LEFT(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;':'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:fuchsia;"&gt;SUBSTRING&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;3&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;':'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:fuchsia;"&gt;SUBSTRING&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;5&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;),&lt;/span&gt; &lt;span style="color:red;"&gt;''&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;td &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:gray;"&gt;LEFT(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_duration&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_duration &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;':'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:fuchsia;"&gt;SUBSTRING&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_duration&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_duration &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;3&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;':'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:fuchsia;"&gt;SUBSTRING&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_duration&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_duration &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;5&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;),&lt;/span&gt; &lt;span style="color:red;"&gt;''&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;td &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:blue;"&gt;CASE&lt;/span&gt; run_status&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;when&lt;/span&gt; 0 &lt;span style="color:blue;"&gt;then&lt;/span&gt; &lt;span style="color:red;"&gt;'Failed'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;when&lt;/span&gt; 1 &lt;span style="color:blue;"&gt;then&lt;/span&gt; &lt;span style="color:red;"&gt;'Succeeded'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;when&lt;/span&gt; 2 &lt;span style="color:blue;"&gt;then&lt;/span&gt; &lt;span style="color:red;"&gt;'Retry'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;when&lt;/span&gt; 3 &lt;span style="color:blue;"&gt;then&lt;/span&gt; &lt;span style="color:red;"&gt;'Canceled'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;when&lt;/span&gt; 4 &lt;span style="color:blue;"&gt;then&lt;/span&gt; &lt;span style="color:red;"&gt;'Progress'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;end&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;span style="color:red;"&gt;''&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt; msdb&lt;span style="color:gray;"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;sysjobhistory Jh&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;JOIN&lt;/span&gt; msdb&lt;span style="color:gray;"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;sysjobs J &lt;span style="color:blue;"&gt;ON&lt;/span&gt; Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;job_id &lt;span style="color:gray;"&gt;=&lt;/span&gt; J&lt;span style="color:gray;"&gt;.&lt;/span&gt;job_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;WHERE&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;Instance_id &lt;span style="color:gray;"&gt;IN&lt;/span&gt; &lt;span style="color:gray;"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;MAX&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;instance_id&lt;span style="color:gray;"&gt;)&lt;/span&gt; [Instance_Id]&lt;span style="color:green;"&gt;--, J.Job_Id INTO #JobHist&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt; msdb&lt;span style="color:gray;"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;sysjobhistory Jh&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;JOIN&lt;/span&gt; msdb&lt;span style="color:gray;"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;sysjobs J &lt;span style="color:blue;"&gt;ON&lt;/span&gt; Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;job_id &lt;span style="color:gray;"&gt;=&lt;/span&gt; J&lt;span style="color:gray;"&gt;.&lt;/span&gt;job_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;WHERE&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:green;"&gt;--Jh.step_id = 0 -- I don't step details, just job outcome&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:green;"&gt;--AND J.enabled = 1 -- enable this condition to filter out DISABLED jobs&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;J&lt;span style="color:gray;"&gt;.&lt;/span&gt;&lt;span style="color:blue;"&gt;Name&lt;/span&gt; &lt;span style="color:gray;"&gt;IN&lt;/span&gt; &lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; JobName &lt;span style="color:blue;"&gt;FROM&lt;/span&gt; Monitoring&lt;span style="color:gray;"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;SQLJobsToMonitor &lt;span style="color:blue;"&gt;WHERE&lt;/span&gt; ReportedYesNo &lt;span style="color:gray;"&gt;=&lt;/span&gt; 1&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;GROUP&lt;/span&gt; &lt;span style="color:blue;"&gt;BY&lt;/span&gt; J&lt;span style="color:gray;"&gt;.&lt;/span&gt;Job_Id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;ORDER&lt;/span&gt; &lt;span style="color:blue;"&gt;BY&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:fuchsia;"&gt;CONVERT&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:blue;"&gt;DATETIME&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;left(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_date&lt;span style="color:gray;"&gt;,&lt;/span&gt;4&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;'-'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;SUBSTRING&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_date &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;),&lt;/span&gt;5&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;'-'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:gray;"&gt;right(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_date&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt;&lt;span style="color:red;"&gt;' '&lt;/span&gt;&lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;LEFT(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;':'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:fuchsia;"&gt;SUBSTRING&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;3&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;':'&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:fuchsia;"&gt;SUBSTRING&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLICATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'0'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 6&lt;span style="color:gray;"&gt;-&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;LEN&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time&lt;span style="color:gray;"&gt;))&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;Jh&lt;span style="color:gray;"&gt;.&lt;/span&gt;run_time &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;CHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;6&lt;span style="color:gray;"&gt;)),&lt;/span&gt;5&lt;span style="color:gray;"&gt;,&lt;/span&gt;2&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;FOR&lt;/span&gt; &lt;span style="color:blue;"&gt;XML&lt;/span&gt; &lt;span style="color:blue;"&gt;PATH&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'tr'&lt;/span&gt;&lt;span style="color:gray;"&gt;),&lt;/span&gt; &lt;span style="color:blue;"&gt;TYPE&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:blue;"&gt;AS&lt;/span&gt; &lt;span style="color:blue;"&gt;NVARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;MAX&lt;/span&gt;&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;N&lt;span style="color:red;"&gt;'&amp;lt;/table&amp;gt;&amp;lt;br&amp;gt;&amp;lt;h5&amp;gt;Job name: Monitoring - SQL Job Status Report&amp;lt;h5&amp;gt;'&lt;/span&gt; &lt;span style="color:gray;"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;SET&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @SubjLine &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:red;"&gt;'SQLMail Monitor: '&lt;/span&gt;&lt;span style="color:gray;"&gt;+&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;@@ServerName&lt;/span&gt;&lt;span style="color:gray;"&gt;+&lt;/span&gt;&lt;span style="color:red;"&gt;': Job Status Report'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:red;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;EXEC&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; msdb&lt;span style="color:gray;"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;sp_send_dbmail&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@profile_name &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:red;"&gt;'SQLMail_Mail'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@recipients &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:red;"&gt;'emailid_001;Emailid02'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@subject &lt;span style="color:gray;"&gt;=&lt;/span&gt; @SubjLine&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@body &lt;span style="color:gray;"&gt;=&lt;/span&gt; @tableHTML&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@body_format &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:red;"&gt;'HTML'&lt;/span&gt;&lt;span style="color:gray;"&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--===================================================&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;"Monitoring.dbo.SQLJobsToMonitor" is a table which will be holding the list of jobs to be reported, you can add or delete or set the flag "ReportedYesNo" column to 0/1 to filter out the less important jobs from being reported.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Here is the table structure for the same.&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--===================================================&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;CREATE&lt;/span&gt; &lt;span style="color:blue;"&gt;TABLE&lt;/span&gt; SQLJobsToMonitor &lt;span style="color:gray;"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;PkId INTEGER &lt;span style="color:blue;"&gt;IDENTITY&lt;/span&gt; &lt;span style="color:blue;"&gt;PRIMARY&lt;/span&gt; &lt;span style="color:blue;"&gt;KEY&lt;/span&gt; &lt;span style="color:gray;"&gt;NOT&lt;/span&gt; &lt;span style="color:gray;"&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;JobName &lt;span style="color:blue;"&gt;varchar&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;500&lt;span style="color:gray;"&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;ReportedYesNo &lt;span style="color:blue;"&gt;bit&lt;/span&gt; &lt;span style="color:blue;"&gt;default&lt;/span&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--===================================================&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Report Sample:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;h4&gt;SQL Server Job Status Report:&lt;o:p&gt;&lt;/o:p&gt;&lt;/h4&gt;&lt;table class="MsoNormalTable" cellpadding="0" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal" style="TEXT-ALIGN: center" align="center"&gt;&lt;b&gt;Job Name&lt;/b&gt;&lt;b&gt;&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal" style="TEXT-ALIGN: center" align="center"&gt;&lt;b&gt;is enable ?&lt;/b&gt;&lt;b&gt;&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal" style="TEXT-ALIGN: center" align="center"&gt;&lt;b&gt;LastRunDateTime&lt;/b&gt;&lt;b&gt;&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal" style="TEXT-ALIGN: center" align="center"&gt;&lt;b&gt;LastRunDuration&lt;/b&gt;&lt;b&gt;&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal" style="TEXT-ALIGN: center" align="center"&gt;&lt;b&gt;LastRunOutCome&lt;/b&gt;&lt;b&gt;&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 1&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;01:56:31&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;01:56:53&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 4&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;01:57:10&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 9&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;01:58:15&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 6&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;01:58:25&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 3&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;01:58:38&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 2&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;01:59:18&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 5&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;01:59:36&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 7&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;03:22:27&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;SS Maint Job - exec Prc_FutureRevenue @Thread = 8&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;0&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;2009-03-14 01:15:17&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;03:23:24&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt"&gt;&lt;p class="MsoNormal"&gt;Succeeded&lt;span style="font-family:'Times New Roman','serif';font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-7065725843711479776?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/7065725843711479776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=7065725843711479776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7065725843711479776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7065725843711479776'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2009/03/re-sql-job-status-reporting.html' title='SQL Job Status Reporting'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-1595856113695757609</id><published>2009-02-18T03:46:00.000-08:00</published><updated>2009-03-20T16:14:39.122-07:00</updated><title type='text'>File Monitoring Using T-SQL</title><content type='html'>&lt;div class="Section1"&gt;&lt;p class="MsoNormal"&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Ever wanted to check for the files and then take some action? - this is very common situation where some team will be providing a data feed or extract (as some people call it). Which are usually in flat file format. Before consuming those files you may want to check if you have received all the files are not and then start the consumption.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;But in my case what happened was the SSIS flow was written in such way, it will start consuming the files and then at the end when it finds that one of the file is missing it used to rollback the operation which used to take 30-40 minutes to realize. So I put a step before that SSIS execution step to check for file and following is my implementation&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;-- Check if my files are available&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;DECLARE&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @return_status &lt;span style="color:blue;"&gt;INT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;DECLARE&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @myFileMask &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;50&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;SET&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @myFileMask &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:gray;"&gt;LEFT(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLACE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;CONVERT&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:blue;"&gt;varchar&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;GETDATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(),&lt;/span&gt; 120&lt;span style="color:gray;"&gt;),&lt;/span&gt; &lt;span style="color:red;"&gt;'-'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;span style="color:red;"&gt;''&lt;/span&gt;&lt;span style="color:gray;"&gt;),&lt;/span&gt; 8&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:gray;"&gt;LEFT(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;REPLACE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia;"&gt;CONVERT&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:blue;"&gt;varchar&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;GETDATE&lt;/span&gt;&lt;span style="color:gray;"&gt;(),&lt;/span&gt; 114&lt;span style="color:gray;"&gt;),&lt;/span&gt; &lt;span style="color:red;"&gt;':'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; &lt;span style="color:red;"&gt;''&lt;/span&gt;&lt;span style="color:gray;"&gt;),&lt;/span&gt; 2&lt;span style="color:gray;"&gt;)&lt;/span&gt; &lt;span style="color:gray;"&gt;+&lt;/span&gt; &lt;span style="color:red;"&gt;'*.*'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;EXEC&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @return_status &lt;span style="color:gray;"&gt;=&lt;/span&gt; dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;prc_CheckForFiles&lt;span style="color:blue;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@FileMask &lt;span style="color:gray;"&gt;=&lt;/span&gt; @myFileMask&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@FullPath &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:red;"&gt;'E:\FlatFilesDump\'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@FileCount &lt;span style="color:gray;"&gt;=&lt;/span&gt; 7&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;IF&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @return_status &lt;span style="color:gray;"&gt;=&lt;/span&gt; 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;RAISERROR &lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'My files are not available yet. Please check !'&lt;/span&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; 16&lt;span style="color:gray;"&gt;,&lt;/span&gt; 1&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--consume files if all are available&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;IF&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @return_status &lt;span style="color:gray;"&gt;=&lt;/span&gt; 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;PRINT&lt;/span&gt; &lt;span style="color:red;"&gt;'Files are available!'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;EXEC&lt;/span&gt; dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;usp_Test&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:green;"&gt;-- this is just a test SP&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;END&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;---===================================================================================&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Here is the script for prc_CheckForFiles&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;---===================================================================================&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;SET&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; &lt;span style="color:blue;"&gt;ANSI_NULLS&lt;/span&gt; &lt;span style="color:blue;"&gt;ON&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;SET&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; &lt;span style="color:blue;"&gt;QUOTED_IDENTIFIER&lt;/span&gt; &lt;span style="color:blue;"&gt;ON&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;/**&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;Author: Girish&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;Purpose: To validate if the set of files exist or not (YES/NO)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;Usage: Its takes 3 inputs, root path, file mask and count&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;**/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; &lt;span style="color:blue;"&gt;PROC&lt;/span&gt; [dbo]&lt;span style="color:gray;"&gt;.&lt;/span&gt;[prc_CheckForFiles]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@FileMask &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;50&lt;span style="color:gray;"&gt;),&lt;/span&gt; &lt;span style="color:green;"&gt;-- search mask like ab*_.txt etc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@FullPath &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;1000&lt;span style="color:gray;"&gt;),&lt;/span&gt; &lt;span style="color:green;"&gt;-- search path like "C:\DumpFilePath\"... UNC paths are NOT ALLOWED&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;@FileCount &lt;span style="color:blue;"&gt;INT&lt;/span&gt; &lt;span style="color:green;"&gt;-- integer to indicate the number of files to be looked for, based on which success or failure is indicated&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;AS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;SET&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; &lt;span style="color:blue;"&gt;NOCOUNT&lt;/span&gt; &lt;span style="color:blue;"&gt;ON&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--PRINT @FileMask&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--PRINT @FullPath&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--PRINT @FileCount&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; &lt;span style="color:blue;"&gt;TABLE&lt;/span&gt; #Tmp&lt;span style="color:gray;"&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;cmdOutput &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;500&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:gray;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;DECLARE&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @DateStamp &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;30&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; @CMD &lt;span style="color:blue;"&gt;VARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;1000&lt;span style="color:gray;"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt; @myRowCount &lt;span style="color:blue;"&gt;INT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;SET&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @CMD &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:red;"&gt;'DIR '&lt;/span&gt;&lt;span style="color:gray;"&gt;+&lt;/span&gt;@FullPath&lt;span style="color:gray;"&gt;+&lt;/span&gt;&lt;span style="color:red;"&gt;''&lt;/span&gt;&lt;span style="color:gray;"&gt;+&lt;/span&gt;@FileMask&lt;span style="color:gray;"&gt;+&lt;/span&gt;&lt;span style="color:red;"&gt;' /B'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:red;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--PRINT @CMD&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;INSERT&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; &lt;span style="color:blue;"&gt;INTO&lt;/span&gt; #Tmp &lt;span style="color:blue;"&gt;EXEC&lt;/span&gt; &lt;span style="color:blue;"&gt;master&lt;/span&gt;&lt;span style="color:gray;"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray;"&gt;.&lt;/span&gt;&lt;span style="color:maroon;"&gt;xp_cmdshell&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;@CMD&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;SET&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @myRowCount &lt;span style="color:gray;"&gt;=&lt;/span&gt; &lt;span style="color:fuchsia;"&gt;@@ROWCOUNT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:fuchsia;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;IF&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @myRowCount &lt;span style="color:gray;"&gt;&amp;gt;=&lt;/span&gt; @FileCount&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;RETURN&lt;/span&gt; 1 &lt;span style="color:green;"&gt;-- expected number of files were found&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;IF&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; @myRowCount &lt;span style="color:gray;"&gt;&amp;lt;&lt;/span&gt; @FileCount&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt;&lt;span style="color:blue;"&gt;RETURN&lt;/span&gt; 0 &lt;span style="color:green;"&gt;-- expected number of files NOT found&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;DROP&lt;/span&gt;&lt;span style="font-family:'Courier New';font-size:10;"&gt; &lt;span style="color:blue;"&gt;TABLE&lt;/span&gt; #Tmp&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;--end&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:green;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:'Courier New';font-size:10;color:blue;"&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="color:#1f497d;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Please note, since this depends on xp_cmdshell and DOS – it might limit you ability to implement in your specific environments.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="color:#1f497d;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-1595856113695757609?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/1595856113695757609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=1595856113695757609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1595856113695757609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1595856113695757609'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2009/03/file-monitoring-using-t-sql.html' title='File Monitoring Using T-SQL'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-3210613061088593185</id><published>2008-12-29T03:18:00.000-08:00</published><updated>2009-01-09T15:19:51.932-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='interview questions'/><title type='text'>Interview Question - DB Mirroring vs Clustering</title><content type='html'>&lt;table cellspacing="0" cellpadding="0" border="0" &gt;&lt;tr&gt;&lt;td valign="top" style="font: inherit;"&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Database mirroring and Clustering – both can serve the purpose of high availability and data protection. However Database mirroring is at database level only. Clustering is at server level, all databases on the instance are covered. In case of clustering there is a single copy of your data and log files where in case of mirroring you have multiple copies of files – on primary and secondary server both, &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;which increases your chances of recovery in case of disaster. In case of mirroring you cannot mirror the system databases viz. master, msdb etc. For mirroring to work database recovery model has to be set to "full recovery". I would see mirroring as a sophisticated log shipping mechanism with automatic failover capability.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-3210613061088593185?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/3210613061088593185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=3210613061088593185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3210613061088593185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/3210613061088593185'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/12/interview-question-db-mirroring-vs.html' title='Interview Question - DB Mirroring vs Clustering'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-4419302713387137404</id><published>2008-12-17T18:41:00.001-08:00</published><updated>2009-03-27T12:03:17.885-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Patch level'/><title type='text'>SQL server - version question</title><content type='html'>&lt;span style="font-family:verdana;font-size:130%;"&gt;Most of the people who deal with SQL Server know how to get the current SQL Server version (build number or information in other words). Let me give the command once again&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;select @@version&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The output would look something like,&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;----------------------------------------------------------------- ---------------------------------------------------------------&lt;br /&gt;2008-11-23 19:13:25.29 Server Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86) Jul 9 2008 14:43:34 Copyright (c) 1988-2008 Microsoft Corporation Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, looking at the build number or the version details “10.0.1600.22” you really cannot make out at what patch level or service pack level your SQL Server instance is at. So, here is a handy web page by SQL Security.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.sqlsecurity.com/FAQs/SQLServerVersionDatabase/tabid/63/Default.aspx"&gt;&lt;span style="font-family:verdana;font-size:130%;color:#3333ff;"&gt;http://www.sqlsecurity.com/FAQs/SQLServerVersionDatabase/tabid/63/Default.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;br /&gt;&lt;br /&gt;It lists all the version/build number with respective patch number along the side. In this case “10.0.1600.22” refers to SQL Server version 10 i.e. 2008 RTM. Once you apply some service pack this number will increase to something else and sometime its listed in either KB article or in this SQL Security website.&lt;br /&gt;&lt;br /&gt;This should help you on - how to figure out the patch level of your SQL Server instance without asking anyone.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-4419302713387137404?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/4419302713387137404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=4419302713387137404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4419302713387137404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4419302713387137404'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/12/how-can-i-tell-if-sql-server-on-my.html' title='SQL server - version question'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-8631675241123449660</id><published>2008-12-17T10:37:00.001-08:00</published><updated>2008-12-17T18:42:26.260-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Connection'/><title type='text'>How to connect SQL SERVER instance ?</title><content type='html'>&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;This article is for those who are new to SQL Server or for those who are new to windows platform.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;Quiet a lot of people go to Google and search for these key words “SQL Server”+FREE. Top in the results listed is the Microsoft SQL Server Express edition. Yes- Microsoft SQL Server Express edition is free to user and it comes with certain limitations please read the documentation before you start using it. Curious to learn the SQL Server quickly most of us download and install it. Next is how do I connect and start writing and testing some queries, as it does not come with standard client connectivity GUI tools&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;There are two methods of user authentication in SQL Server unlike most of the RDBMS products like Oracle, MySQL, Sybase etc. The two authentication methods are know are &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;Window Authentication and&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;SQL Server Authentication&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:130%;"&gt;&lt;u&gt;In case of “Window Authentication”&lt;/u&gt; your connection request is authenticated against the windows operating system. if you are using SQL Server Management studio or another other GUI’s tools and if you are the local admin of your system (which mostly we are all) you need to make following selections in your connection screen &amp;gt;&amp;gt; SQL Server Name and Authentication = “Window Authentication” (or integrated authentication in some cases) no need of password anywhere.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;If you are using OSQL or SQLCMD – the command line client utility to manage SQL Server, which is mostly installed when you install SQL Server (any edition). You just need to type following command at command prompt&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;img src="http://docs.google.com/File?id=dc3r33hj_20c34xvffp_b" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;a href="http://www.paulkovacs.com/InstallSQLServer2005Express/image005.jpg"&gt;&lt;span style="font-family:verdana;font-size:130%;color:#800080;"&gt;http://www.paulkovacs.com/InstallSQLServer2005Express/image005.jpg&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;{Third party GUI Tools}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;br /&gt;&lt;div id="o..." style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 1em; PADDING-TOP: 1em; TEXT-ALIGN: left"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;img src="http://docs.google.com/File?id=dc3r33hj_21h6m2k6dk_b" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;a href="http://www.sqlfindandreplace.com/images/SQL-Find-And-Replace-Net-Database-Management-Utility-DOC-002.gif"&gt;&lt;span style="font-family:verdana;font-size:130%;color:#0000ff;"&gt;http://www.sqlfindandreplace.com/images/SQL-Find-And-Replace-Net-Database-Management-Utility-DOC-002.gif&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;osql -E -S computer_name\instance_name&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;Where computer_name = your desktop/pc name, &lt;u&gt;no&lt;/u&gt; need of keying in any PASSWORD as you have specified –E option i.e. to use window authentication. If you (logged in user) are a valid windows user and have a local admin privileges you will be successfully connecting to SQL Server instance.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:130%;"&gt;&lt;u&gt;In case of “SQL Server Authentication”&lt;/u&gt; your connection request is authenticated by the SQL Server itself. In this case you need to pass one more value i.e. password along with user name and also you need to opt for “SQL Server authentication” if there is any in you GUI tool. In this case the OSQL command would be,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;osql -S computer_name\instance_name –U &amp;lt;SQL_userId&amp;gt; -P &amp;lt;respective password&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;{command line utils}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;br /&gt;&lt;div id="fda5" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 1em; PADDING-TOP: 1em; TEXT-ALIGN: left"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;img src="http://docs.google.com/File?id=dc3r33hj_23cpp83jdj_b" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;a href="http://decipherinfosys.files.wordpress.com/2007/12/sqlcmd_1.jpg"&gt;&lt;span style="font-family:verdana;font-size:130%;color:#800080;"&gt;http://decipherinfosys.files.wordpress.com/2007/12/sqlcmd_1.jpg&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-8631675241123449660?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/8631675241123449660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=8631675241123449660' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8631675241123449660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8631675241123449660'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/12/untitled.html' title='How to connect SQL SERVER instance ?'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-2068805394043722205</id><published>2008-08-09T23:08:00.001-07:00</published><updated>2008-08-09T23:09:54.354-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='&quot;Event log analysis&quot;'/><title type='text'>NT Event log analysis (for DBA's)</title><content type='html'>Have ever looked "deep" into your NT Event logs ? - most of we DBA's will say NO. Here I am describe a simple and little easy way to do that trick. Using this trick you are going to generate a report of type of errors that your server logging into the logs and you will woundering what is all this junk on my server.&lt;br /&gt;&lt;br /&gt;We are going to use SQL Server to do this, as it is our strenght !&lt;br /&gt;&lt;br /&gt;First pick your box to analyze and export the NT Event logs CSV format. Why CSV - because we are going to import that into a SQL Server and do a "deep" analysis of the issues that are going on you server (sort of a health report). Here are the steps for your convience&lt;br /&gt;&lt;br /&gt;Open Event viewer&lt;br /&gt;Right click on the "Application Log"&lt;br /&gt;Choose "Save Log File As" option from the pop up menu&lt;br /&gt;Save dialogue will appear&lt;br /&gt;Type the filename and select file type as "CSV (Comma delimited) (*.csv)"&lt;br /&gt;&lt;br /&gt;Simple isn't ? (this is not all that I wanted to share in this article). Similary you an save other logs too if you are interested.&lt;br /&gt;&lt;br /&gt;Ok, once we have the NT Event logs saved in CSV format out next step is to load them into a SQL Server table, so that we can query, slice and dice the data in this log(s). We are going to import the CSV file into SQL Server using a linked server. Why linked server, because its easy :), here is the simple command to create a linked server,&lt;br /&gt;&lt;br /&gt;EXEC sp_addlinkedserver EventLogs, 'Jet 4.0', &lt;br /&gt;   'Microsoft.Jet.OLEDB.4.0',&lt;br /&gt;   'C:\MyEventLogs\',&lt;br /&gt;   NULL,&lt;br /&gt;   'Text'&lt;br /&gt;&lt;br /&gt;"C:\MyEventLogs" is the folder where my all the eventlogs are stored, "EventLogs" is my linked server name. Refer to SQL Books online for specifics of sp_addlinkedserver command, if you are interested.&lt;br /&gt;&lt;br /&gt;After linked server is created, run the following command,&lt;br /&gt;&lt;br /&gt;EXEC sp_tables_ex EventLogs&lt;br /&gt;&lt;br /&gt;This will display a recordset and if you look at the column "TABLE_NAME",  you will see that all the CSV files under the folder "C:\MyEventLogs\"  will be listed. Lets assume that you NT Eventlogs were save a file named "PefCounter.csv" the file will be listed as "PefCounter#csv". Now let query this "PefCounter#csv" table. Here is a simple query,&lt;br /&gt;&lt;br /&gt;SELECT * FROM EventLogs...PefCounter#csv&lt;br /&gt;&lt;br /&gt;Was't is simple and neat idea !&lt;br /&gt;&lt;br /&gt;Now don't run your analytics directly on the file directly (linked server) it will be slow. Instead import it into a table. Below is the table structure that I use and it mostly works all the time, I mean the datatypes, come take a look,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IF OBJECT_ID('EventLog_BeforeQ2') &gt; 0&lt;br /&gt; DROP TABLE [dbo].[EventLog_BeforeQ2]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[EventLog_BeforeQ2](&lt;br /&gt; [LogDate] [datetime] NULL,&lt;br /&gt; [LogTime] [nvarchar](255) NULL,&lt;br /&gt; [LogSource] [nvarchar](255) NULL,&lt;br /&gt; [LogType] [nvarchar](255) NULL,&lt;br /&gt; [LogCategory] varchar(5) NULL,&lt;br /&gt; [LogEvent] [INT] NULL,&lt;br /&gt; [LogUser] [nvarchar](255) NULL,&lt;br /&gt; [LogComputer] [nvarchar](255) NULL,&lt;br /&gt; [LogErrDesc] [ntext] NULL&lt;br /&gt;) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]&lt;br /&gt;&lt;br /&gt;SELECT * INTO [dbo].[EventLog_BeforeQ2] FROM EventLogs...PefCounter#csv&lt;br /&gt;&lt;br /&gt;At this point your data is sitting in EventLog_BeforeQ2 table. You can run any query again this table now to do any kind of analysis that you want, but my intention of writing this article was about looking "deep" into the event logs. So, first thing I do is&lt;br /&gt;&lt;br /&gt;SELECT DATEDIFF(DD, MIN(LogDate), MAX(logDate))  FROM EventLog_BeforeQ2&lt;br /&gt;&lt;br /&gt;This will tell how many days worth of logs you have in your table. Try the below query for more detials,&lt;br /&gt;&lt;br /&gt;SELECT LogEvent, COUNT(LogEvent)[Count] FROM [EventLog_BeforeQ2] &lt;br /&gt;WHERE LogType= 'Error'&lt;br /&gt;GROUP BY LogEvent&lt;br /&gt;ORDER BY COUNT(LogEvent) DESC&lt;br /&gt;&lt;br /&gt;Below is the output that I see on my logs.&lt;br /&gt;&lt;br /&gt;LogEvent    Count&lt;br /&gt;----------- -----------&lt;br /&gt;6043        2813&lt;br /&gt;4019        823&lt;br /&gt;6013        528&lt;br /&gt;1              381&lt;br /&gt;318         303&lt;br /&gt;17052       217&lt;br /&gt;4045        122&lt;br /&gt;&lt;br /&gt;You can also try to find out what specific applications/services are logging most of the erorrs using following query,&lt;br /&gt;&lt;br /&gt;SELECT LogSource, COUNT(LogEvent)[Count] FROM [EventLog_BeforeQ2] &lt;br /&gt;WHERE LogType= 'Error'&lt;br /&gt;GROUP BY LogSource&lt;br /&gt;ORDER BY COUNT(LogEvent) DESC&lt;br /&gt;&lt;br /&gt;This is how I target to improve my SQL Server's Maintenance, Monitoring and Performance. I will leave rest of the creativity of log analysis to the readers of this article.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-2068805394043722205?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/2068805394043722205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=2068805394043722205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2068805394043722205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2068805394043722205'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/08/nt-event-log-analysis-for-dbas.html' title='NT Event log analysis (for DBA&apos;s)'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-1875377958405611439</id><published>2008-05-09T15:44:00.000-07:00</published><updated>2008-05-12T20:46:48.235-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Heap Table'/><category scheme='http://www.blogger.com/atom/ns#' term='defrag'/><title type='text'>DeFragmenting Heap Tables.</title><content type='html'>&lt;!-- Converted from text/rtf format --&gt; &lt;BR&gt; &lt;UL&gt; &lt;P&gt;&lt;FONT COLOR="#000080" FACE="Verdana"&gt;Ever wanted to know how to deal with fragmentation on tables without any index/primary key, the heap tables. Here is a script that one of my friend forwarded to me when I asked him this question.&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;BEGIN&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TRAN&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ALTER&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TABLE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [dbo]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[XYX_HeapTable] &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ADD&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [c] &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;VARCHAR&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;1&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;NULL&lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;CREATE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;CLUSTERED&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INDEX&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [i] &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ON&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [dbo]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[XYX_HeapTable] &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[c]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;WITH&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;FILLFACTOR&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;=&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; 100 &lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DROP&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INDEX&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [dbo]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[XYX_HeapTable]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[i]&lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ALTER&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TABLE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [dbo]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[XYX_HeapTable] &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DROP&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;COLUMN&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [c]&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;COMMIT&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TRAN&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Verdana"&gt;Where XYZ_HeapTable is a name of the table which in heap (no primary key nor indexes on it). I wanted to test run this script to see the effectiveness of the above script. So I wrote down the following batch of scripts,&lt;/FONT&gt;&lt;FONT FACE="Times New Roman"&gt; &lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;USE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; Tempdb&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;GO&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;CREATE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TABLE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; XYX_HeapTable &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT SIZE=2 FACE="Courier New"&gt;TrackId &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INTEGER&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;,&lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT SIZE=2 FACE="Courier New"&gt;Fname &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;VARCHAR&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;200&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;),&lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT SIZE=2 FACE="Courier New"&gt;Sname &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;VARCHAR&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;200&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;SET&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;NOCOUNT&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ON&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DECLARE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @iCount &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INTEGER&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;SET&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @iCount &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;=&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; 0&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;WHILE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @iCount &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; 10000&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;BEGIN&lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INSERT&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INTO&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; XYX_HeapTable &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;VALUES&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;@iCount&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;,&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#FF0000" SIZE=2 FACE="Courier New"&gt;'234234234234232432as34234232432dfasdfasdfasdfasdfasdfasdfasdfasdf'&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;,&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#FF0000" SIZE=2 FACE="Courier New"&gt;'asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf'&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;SET&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @iCount &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;=&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @iCount &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;+&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;1&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;END&lt;/FONT&gt; &lt;/P&gt; &lt;BR&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DECLARE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @ObjectId &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INTEGER&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;SELECT&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @ObjectId &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;=&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#FF00FF" SIZE=2 FACE="Courier New"&gt;OBJECT_ID&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT COLOR="#FF0000" SIZE=2 FACE="Courier New"&gt;'XYX_HeapTable'&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DBCC&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; SHOWCONTIG &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;@ObjectId&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;,&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;0&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;WITH&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TABLERESULTS&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;,&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;FAST&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;GO&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;BEGIN&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TRAN&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ALTER&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TABLE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [dbo]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[XYX_HeapTable] &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ADD&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [c] &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;VARCHAR&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;1&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;NULL&lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;CREATE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;CLUSTERED&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INDEX&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [i] &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ON&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [dbo]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[XYX_HeapTable] &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[c]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;WITH&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;FILLFACTOR&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;=&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; 100 &lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DROP&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INDEX&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [dbo]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[XYX_HeapTable]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[i]&lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;ALTER&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TABLE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [dbo]&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;.&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;[XYX_HeapTable] &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DROP&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;COLUMN&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; [c]&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;COMMIT&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TRAN&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;GO&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DECLARE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @ObjectId &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;INTEGER&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;SELECT&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; @ObjectId &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;=&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#FF00FF" SIZE=2 FACE="Courier New"&gt;OBJECT_ID&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT COLOR="#FF0000" SIZE=2 FACE="Courier New"&gt;'XYX_HeapTable'&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DBCC&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; SHOWCONTIG &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;(&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;@ObjectId &lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;,&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;0&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;)&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;WITH&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TABLERESULTS&lt;/FONT&gt;&lt;FONT COLOR="#808080" SIZE=2 FACE="Courier New"&gt;,&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;FAST&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;GO&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;DROP&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" SIZE=2 FACE="Courier New"&gt;TABLE&lt;/FONT&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt; XYX_HeapTable &lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;U&gt;&lt;FONT FACE="Verdana"&gt;Conclusion:&lt;/FONT&gt;&lt;/U&gt;&lt;FONT FACE="Verdana"&gt; I saw good improvement in ScanDensity and ExtentFragmentation after running of the above script, so it works.&lt;/FONT&gt;&lt;/P&gt; &lt;/UL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-1875377958405611439?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/1875377958405611439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=1875377958405611439' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1875377958405611439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1875377958405611439'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/05/defragmenting-heap-tables.html' title='DeFragmenting Heap Tables.'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-5618808273167635506</id><published>2008-05-09T14:57:00.000-07:00</published><updated>2008-05-09T15:00:27.549-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linked server'/><title type='text'>CSV or TXT file as a database !</title><content type='html'>&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT    color=#000080&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Verdana color=#000080&gt;Do you    have a large CSV ( or delimited txt ) file which you cannot open in XL sheet,    because of XL's 65K row limit ? Because you are unable to load you are unable    to data analysis - here is what I did.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Verdana    color=#000080&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#000080&gt;As    a SQL Server DBA/Developer I am assuming you have SQL Server installed on your    PC or at least a instance is available for you with Sys. Admin    &amp;nbsp;previlages on it. Connect to the instance&lt;/FONT&gt; using query analyzer    and create a linked server. Use following command..&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT    face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;FONT    color=#0000ff&gt;   &lt;P&gt;&lt;FONT face="Book Antiqua"&gt;EXEC&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Calibri&gt;&lt;FONT    size=2&gt;&lt;FONT face="Book Antiqua"&gt;&lt;FONT size=3&gt; master&lt;FONT    color=#808080&gt;.&lt;/FONT&gt;dbo&lt;FONT color=#808080&gt;.&lt;/FONT&gt;&lt;FONT    color=#800000&gt;sp_addlinkedserver&lt;/FONT&gt; @server &lt;FONT color=#808080&gt;=&lt;/FONT&gt;    N&lt;FONT color=#ff0000&gt;'txtsrv'&lt;/FONT&gt;&lt;FONT color=#808080&gt;,&lt;/FONT&gt;    @srvproduct&lt;FONT color=#808080&gt;=&lt;/FONT&gt;N&lt;FONT color=#ff0000&gt;'Jet    4.0'&lt;/FONT&gt;&lt;FONT color=#808080&gt;,&lt;/FONT&gt; @provider&lt;FONT    color=#808080&gt;=&lt;/FONT&gt;N&lt;FONT    color=#ff0000&gt;'Microsoft.Jet.OLEDB.4.0'&lt;/FONT&gt;&lt;FONT color=#808080&gt;,&lt;/FONT&gt;    @datasrc&lt;FONT color=#808080&gt;=&lt;/FONT&gt;N&lt;FONT color=#ff0000&gt;'C:\&lt;SPAN    class=902393121-09052008&gt;My_CSV_Files&lt;/SPAN&gt;\JetDatabase'&lt;/FONT&gt;&lt;FONT    color=#808080&gt;,&lt;/FONT&gt; @provstr&lt;FONT color=#808080&gt;=&lt;/FONT&gt;N&lt;FONT    color=#ff0000&gt;'Text'&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT    face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Verdana&gt;Lets look&amp;nbsp;at each    of the parameters specified in above command. @server is pointing to txtsrv    i.e. "use text files as database", then use Jet 4.0 as a provider, @datasrv -    is the data source name. In this case it is a folder path where my text/CSV    files are located,&amp;nbsp;that I want to access or query. Once you add the    linked server successfully, try the following command.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT    face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Calibri&gt;&lt;FONT color=#0000ff    size=2&gt;   &lt;P&gt;&lt;FONT face="Book Antiqua" size=3&gt;EXEC&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT    face="Book Antiqua"&gt; &lt;FONT color=#800000&gt;sp_tables_ex&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT    size=3&gt; txtsrv&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN    class=902393121-09052008&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Verdana&gt;The output will show    you the list of table(s) available for querying. These tables are nothing but    the files that are located in the folder "C:\My_CSV_Files\JetDatabase". In my    case the output shows following tables Server_A01#txt, Server_A02#txt. Now    lets try querying the data in those files. Try the following    command..&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT    face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Calibri&gt;&lt;FONT color=#0000ff    size=2&gt;   &lt;P&gt;&lt;FONT face="Book Antiqua" size=3&gt;select&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT    face="Book Antiqua"&gt; &lt;FONT color=#0000ff&gt;TOP&lt;/FONT&gt; 10 &lt;FONT    color=#808080&gt;*&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;from&lt;/FONT&gt; txtsrv&lt;FONT    color=#808080&gt;...&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT    size=3&gt;Server_A01#txt&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT    face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;   &lt;DIV&gt;&lt;SPAN class=902393121-09052008&gt;&lt;FONT face=Verdana&gt;Wow, I see the output    as if its a real table from my SQL Server Engine. You can run all the sorts of    queries on this data(file data) like you do with real table. The performance    looks somewhat slow but for adhoc data analysis and processing purpose this is    just great.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT  face=Calibri&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-5618808273167635506?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/5618808273167635506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=5618808273167635506' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5618808273167635506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5618808273167635506'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/05/csv-or-txt-file-as-database.html' title='CSV or TXT file as a database !'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-2120579334922699202</id><published>2008-05-02T14:03:00.000-07:00</published><updated>2008-05-09T14:59:03.626-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='forfiles mingle backup mysql'/><title type='text'>Backing up MySQL Database</title><content type='html'>&lt;h3&gt;How is it done:&lt;/h3&gt;&lt;br /&gt;&lt;strong&gt;mingle&lt;/strong&gt; database is hosted on mySQL. To backup this database we use &lt;strong&gt;mysqldump&lt;/strong&gt; utility which is invoked through a VB script. Earlier we were using "My SQL Administrator" utility, but it lacks some capabilities and due to which we saw that some of tables were missing in the backup. After testing we found that &lt;strong&gt;mysqldump&lt;/strong&gt; is good for our purpose.&lt;br /&gt;&lt;br /&gt;Here is how the VB script looks like&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;'Mingle_Bkp.vbs&lt;br /&gt;on error resume next&lt;br /&gt;&lt;br /&gt;Dim TodaysFileName, BatchFileTxt&lt;br /&gt;&lt;br /&gt;Set WshShell = WScript.CreateObject("WScript.Shell")&lt;br /&gt;&lt;br /&gt;TodaysFileName = DatePart("yyyy", Now) &amp;amp; Lpad(DatePart("m", Now), "0", 2) &amp;amp; Lpad(DatePart("d", Now), "0", 2) &amp;amp; _&lt;br /&gt;     "_" &amp;amp; Lpad(DatePart("h", Now), "0", 2) &amp;amp; Lpad(DatePart("n", Now), "0", 2)  &amp;amp; _&lt;br /&gt;     Lpad(DatePart("s", Now), "0", 2)&lt;br /&gt;&lt;br /&gt;BatchFileTxt = "mysqldump -uroot -p" &amp;amp; CryptVBS("#^rT4", "mingle") &amp;amp; " mingle &gt; ""E:\Backups\Mysql Daily\Mingle_"&amp;amp; _&lt;br /&gt;     TodaysFileName &amp;amp;".sql"""&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'*** Add delete old backup files using FORFILES cmd&lt;br /&gt;BatchFileTxt = BatchFileTxt &amp;amp; vbcrlf &amp;amp; "forfiles /P ""E:\Backups\Mysql Daily"" /M *.SQL /D -3 /C ""CMD /c del @file"" "&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'*** Add delete "myself" step to batch file&lt;br /&gt;BatchFileTxt = BatchFileTxt &amp;amp; vbcrlf &amp;amp; "del backup.bat"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'*** create a batch file with all the step/commands&lt;br /&gt;OpenTextFileForWrite BatchFileTxt, "backup.bat"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'*** invoke the batch file&lt;br /&gt;WshShell.Run "backup.bat"&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;'*** Function to LEFT pad the number to create fixed length number string. ***&lt;br /&gt;Function Lpad (MyValue, MyPadChar, MyPaddedLength)&lt;br /&gt; Lpad = string(MyPaddedLength - Len(MyValue),MyPadChar) &amp;amp; MyValue&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;'*** Procedure to DECRYPT the string ***&lt;br /&gt;Function CryptVBS(Text, Key)&lt;br /&gt; KeyLen = Len(Key)&lt;br /&gt; For i = 1 To Len(Text)&lt;br /&gt;  KeyPtr = (KeyPtr + 1) Mod KeyLen&lt;br /&gt;  sTxtChr = Mid(Text, i, 1)&lt;br /&gt;  wTxtChr = Asc(stxtchr)&lt;br /&gt;  wKeyChr = Asc(Mid(Key, KeyPtr + 1, 1))&lt;br /&gt;  CryptKey = Chr(wTxtChr Xor wKeyChr)&lt;br /&gt;  hold = hold &amp;amp; CryptKey&lt;br /&gt; Next&lt;br /&gt; CryptVBS = hold&lt;br /&gt;End Function&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;'*** Procedure to WRITE the output to a given file ***&lt;br /&gt;Sub OpenTextFileForWrite (TxtToWrite, strFileName)&lt;br /&gt;&lt;br /&gt; Const ForReading = 1, ForWriting = 2, ForAppending = 8&lt;br /&gt; Dim fso, f&lt;br /&gt; Set fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt; Set f = fso.OpenTextFile( strFileName, ForWriting, True)&lt;br /&gt; f.Write TxtToWrite &amp;amp; VBCRLF&lt;br /&gt; f.Close&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This is how the output batch file would look like..at the end it delets itself!&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;:backup.bat&lt;br /&gt;mysqldump -uroot -p****** mingle &gt; "E:\Backups\Mysql Daily\Mingle_20080508_111407.sql"&lt;br /&gt;forfiles /P "E:\Backups\Mysql Daily" /M *.SQL /D -3 /C "CMD /c del @file"&lt;br /&gt;del backup.bat&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Currently VB script &lt;strong&gt;Mingle_Bkp.vbs&lt;/strong&gt; is located in &lt;strong&gt;WINNT&lt;/strong&gt; system folder on C:\ drive and that is where it creates the &lt;strong&gt;backup.bat&lt;/strong&gt; and triggers it from.&lt;br /&gt;&lt;br /&gt;The backup file retention period is set to 3 days, any files older than 3 days will get deleted. We are doing it using *FORFILES* utility. forfiles.exe is part of windows OS &amp;amp; is available on all windows systems(computers).&lt;br /&gt;&lt;br /&gt;The script lines are not completely written by me I picked them up from different places and modified them to suite my requirements, but you are free to use it as you like.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-2120579334922699202?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/2120579334922699202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=2120579334922699202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2120579334922699202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2120579334922699202'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/05/backing-up-mysql-database.html' title='Backing up MySQL Database'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-2638921147995513550</id><published>2008-04-10T15:25:00.000-07:00</published><updated>2009-03-27T12:10:43.885-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='&quot;Default database file path&quot;'/><title type='text'>Default database file path</title><content type='html'>&lt;span style="font-size:130%;"&gt;I keep seeing this question in many forums. When you fire "CREATE DATABASE &amp;lt;database name&amp;gt;" T-SQL command without any parameters. The database will get created and its file will be located in some path, lets say "C:\Program Files\MS SQL\Data". But if you want to have the files located else where, lets assume "D:\SQL_Data\" then there are two options that you can think of.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;1 - specify the file path in the "CREATE DATABASE &amp;lt;database name&amp;gt;" command or&lt;br /&gt;2- set the default path location in server configuration.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;For option one refere to BOL, here is how to workout Option-II: again there are two ways to do this task. one, using GUI (Management Studio/Enterprise manager) - right click on server node, select properties from pop-up menu, look for "Database Settings" in that section there two boxes - one for LOG and other for DATA file. Key in the appropriate values and save it. This change does NOT require SQL Server re-start.&lt;br /&gt;The other way to achieve this configuration change is using T-SQL, as show below,&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:130%;"&gt;USE [master]&lt;br /&gt;GO&lt;br /&gt;EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData', REG_SZ, N'D:\SQL_Data'&lt;br /&gt;GO&lt;br /&gt;EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultLog', REG_SZ, N'D:\SQL_Data'&lt;br /&gt;GO &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Yes, its instance specific registery entry that it takes to set this property. Here the command is using extended stored procedure "xp_instance_regwrite" to do the trick. This type of command can be used in cases where you want to standardise you SQL Server setup and you may want to add this step as a post installation procedure/batch file etc.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Update 12:18 PM 3/26/2009&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Couple of people have asked me how to find the database file paths, i.e basically they are asking - how do I know which database is linked to which file. Here is the query,&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:130%;"&gt;select * from master.dbo.sysaltfiles --where db_name(dbid) = 'x_db_name' &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Above query will display the list of all the database files located on that server. But if you want to to be spcific then use &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-family:courier new;"&gt;select * from x_db_name.dbo.sysfiles&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To understand more on interpreting the results (meaning of each column displayed) you may want to check documentation in "Book Online" aka. BOL ! &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-2638921147995513550?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/2638921147995513550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=2638921147995513550' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2638921147995513550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2638921147995513550'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/04/default-database-file-path.html' title='Default database file path'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-1270031547856593361</id><published>2008-02-25T09:26:00.000-08:00</published><updated>2008-02-25T10:03:33.661-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Backup Monitoring Across Multiple Servers'/><title type='text'>Backup Monitoring Across Multiple Servers</title><content type='html'>&lt;P&gt;Here is a simple back verification solution. "back verification " I am basically looking to answer following question(s)&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;1 &gt; When was the last FULL backup was done?&lt;br /&gt;2 &gt; When was the last T.LOG backup was done?.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;P&gt;This solution is very handy if you are monitoring lot of SQL Server(s) in your environment. The solution is split into 3 files as follows,&lt;br /&gt;&lt;/P&gt;&lt;br /&gt;1 &gt; Batch file&lt;br /&gt;2 &gt; SQL Query file&lt;br /&gt;3 &gt; Server list file&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;What is in Batch file?&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;In this batch file I am just calling OSQL with required parameters. The dos "FOR" loop is very fantastic and I found that from the web (thanks to the author).&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Cls&lt;br /&gt;for /f "tokens=1,2,3" %%i in (SrvList.txt)  do OSQL.exe -E -S"%%i"   -q -i"BkpDetails.sql" -n -w 2000 &gt;&gt; %random%log.txt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;BkpDetails.sql - T-SQL Query&lt;/h3&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;SET NOCOUNT ON&lt;br /&gt;PRINT ' DB Backup details for server ... ['+@@ServerName+'] as on '+ CONVERT(VARCHAR(30), GETDATE())&lt;br /&gt;PRINT ''&lt;br /&gt;SELECT A.NAME [DB_Name], MAX(backup_finish_date) [Bkp Date], MAX(type) [Bkp Type] INTO #Tmp1&lt;br /&gt;FROM master..sysdatabases A&lt;br /&gt;LEFT JOIN msdb..backupset ON a.NAME = database_name&lt;br /&gt;WHERE type = 'L'&lt;br /&gt;GROUP BY A.NAME&lt;br /&gt;ORDER BY [Bkp Date] ASC&lt;br /&gt;&lt;br /&gt;SELECT A.NAME [DB_Name], MAX(backup_finish_date) [Bkp Date], MAX(type) [Bkp Type] INTO #Tmp2&lt;br /&gt;FROM master..sysdatabases A&lt;br /&gt;LEFT JOIN msdb..backupset ON a.NAME = database_name&lt;br /&gt;WHERE type = 'D'&lt;br /&gt;GROUP BY A.NAME&lt;br /&gt;ORDER BY [Bkp Date] ASC&lt;br /&gt;&lt;br /&gt;select  LEFT(#Tmp2.[DB_Name], 30), LEFT(#Tmp2.[Bkp Date], 30) AS [Last Full Bkp Done At], &lt;br /&gt; LEFT(#Tmp1.[Bkp Date], 30) AS [Last T.Log Bkp Done At]&lt;br /&gt;from  #Tmp2&lt;br /&gt; LEFT JOIN #Tmp1 ON #Tmp2.[DB_Name] = #Tmp1.[DB_Name]&lt;br /&gt;ORDER BY #Tmp1.[Bkp Date] ASC&lt;br /&gt;&lt;br /&gt;DROP TABLE #Tmp1&lt;br /&gt;DROP TABLE #Tmp2&lt;br /&gt;PRINT ' ------------------------------ ------------------------------ ------------------------------ '&lt;br /&gt;PRINT ''&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;What is in SrvList.txt ?&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;In this txt file I am just listing all my servers that I want to monitor. One server name per line only. In this case I have repeated same server name multiple times to show sample output&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;LVEPL3KC824\LOCAL&lt;br /&gt;LVEPL3KC824\LOCAL&lt;br /&gt;LVEPL3KC824\LOCAL&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Sample Output..&lt;/h3&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt; DB Backup details for server ... [MSSQL_2K5] as on Feb 25 2008  9:37AM&lt;br /&gt;&lt;br /&gt;                                Last Full Bkp Done At          Last T.Log Bkp Done At        &lt;br /&gt; ------------------------------ ------------------------------ ------------------------------&lt;br /&gt; msdb                           Feb 25 2008  9:33AM            NULL                          &lt;br /&gt; master                         Feb 25 2008  9:33AM            NULL                          &lt;br /&gt; model                          Feb 25 2008  9:33AM            Feb 25 2008  9:34AM           &lt;br /&gt; TestDB                         Feb 25 2008  9:33AM            Feb 25 2008  9:34AM           &lt;br /&gt; TestDB_Prod                    Feb 25 2008  9:33AM            Feb 25 2008  9:35AM           &lt;br /&gt; InboxDB                        Feb 25 2008  9:33AM            Feb 25 2008  9:35AM           &lt;br /&gt;&lt;br /&gt; ------------------------------ ------------------------------ ------------------------------&lt;br /&gt;&lt;br /&gt; DB Backup details for server ... [MSSQL_2K5] as on Feb 25 2008  9:37AM&lt;br /&gt;&lt;br /&gt;                                Last Full Bkp Done At          Last T.Log Bkp Done At        &lt;br /&gt; ------------------------------ ------------------------------ ------------------------------&lt;br /&gt; msdb                           Feb 25 2008  9:33AM            NULL                          &lt;br /&gt; master                         Feb 25 2008  9:33AM            NULL                          &lt;br /&gt; model                          Feb 25 2008  9:33AM            Feb 25 2008  9:34AM           &lt;br /&gt; TestDB                         Feb 25 2008  9:33AM            Feb 25 2008  9:34AM           &lt;br /&gt; TestDB_Prod                    Feb 25 2008  9:33AM            Feb 25 2008  9:35AM           &lt;br /&gt; InboxDB                        Feb 25 2008  9:33AM            Feb 25 2008  9:35AM           &lt;br /&gt;&lt;br /&gt; ------------------------------ ------------------------------ ------------------------------&lt;br /&gt;&lt;br /&gt; DB Backup details for server ... [MSSQL_2K5] as on Feb 25 2008  9:37AM&lt;br /&gt;&lt;br /&gt;                                Last Full Bkp Done At          Last T.Log Bkp Done At        &lt;br /&gt; ------------------------------ ------------------------------ ------------------------------&lt;br /&gt; msdb                           Feb 25 2008  9:33AM            NULL                          &lt;br /&gt; master                         Feb 25 2008  9:33AM            NULL                          &lt;br /&gt; model                          Feb 25 2008  9:33AM            Feb 25 2008  9:34AM           &lt;br /&gt; TestDB                         Feb 25 2008  9:33AM            Feb 25 2008  9:34AM           &lt;br /&gt; TestDB_Prod                    Feb 25 2008  9:33AM            Feb 25 2008  9:35AM           &lt;br /&gt; InboxDB                        Feb 25 2008  9:33AM            Feb 25 2008  9:35AM           &lt;br /&gt;&lt;br /&gt; ------------------------------ ------------------------------ ------------------------------&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-1270031547856593361?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/1270031547856593361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=1270031547856593361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1270031547856593361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1270031547856593361'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/02/db-backup-details-for-server_25.html' title='Backup Monitoring Across Multiple Servers'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-6697539162860579712</id><published>2008-02-22T16:25:00.000-08:00</published><updated>2008-02-25T09:26:11.890-08:00</updated><title type='text'>SQL Express for Absolute Beginners!</title><content type='html'>&lt;!-- Converted from text/rtf format --&gt; &lt;BR&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;Lesson 1: What is a database?&lt;/FONT&gt;&lt;/B&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;This introduction covers the questions and terminology SQL Server beginners need to create and manage databases, such as: What is a SQL Server database? How is a SQL Server database different from an Excel spreadsheet? What do SQL Server databases do in my Web site or software applications? What's SQL Server Express' relation to Visual Studio Express? What do terms like &amp;quot;ADO.NET&amp;quot; mean? &lt;/FONT&gt;&lt;A HREF="http://go.microsoft.com/?linkid=6143248"&gt;&lt;U&gt;&lt;FONT COLOR="#0000FF" FACE="Arial"&gt;Download the Video&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;Lesson 2: Understanding Database Tables and Records&lt;/FONT&gt;&lt;/B&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;SQL Server beginners will learn about tables and definitions of data types, properties, keys, etc. in this second video. Find out how table rows, columns, and fields interrelate and whether columns can be empty. &lt;/FONT&gt;&lt;A HREF="http://go.microsoft.com/?linkid=6143249"&gt;&lt;U&gt;&lt;FONT COLOR="#0000FF" FACE="Arial"&gt;Download the Video&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;Lesson 3: More about Column Data Types and Other Properties&lt;/FONT&gt;&lt;/B&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;SQL Server beginners will explore data integrity, learn which data types to use for what, and avoid common data type pitfalls. &lt;/FONT&gt;&lt;A HREF="http://go.microsoft.com/?linkid=6143250"&gt;&lt;U&gt;&lt;FONT COLOR="#0000FF" FACE="Arial"&gt;Download the Video&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;Lesson 4: Designing Relational Database Tables&lt;/FONT&gt;&lt;/B&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;Why are relational databases the most popular? SQL Server beginners will learn to differentiate between primary and foreign keys, design relational database tables, and learn about normalization rules and de-normalization.&lt;/FONT&gt;&lt;A HREF="http://go.microsoft.com/?linkid=6143251"&gt;&lt;U&gt;&lt;FONT COLOR="#0000FF" FACE="Arial"&gt;Download the Video&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;Lesson 5: Manipulating Database Data&lt;/FONT&gt;&lt;/B&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;SQL Server beginners will learn about ADO.NET objects and execution of SQL statement from ADO.NET. Explore SQL and learn about insert, update, and delete statements.&lt;/FONT&gt;&lt;A HREF="http://go.microsoft.com/?linkid=6143252"&gt;&lt;U&gt;&lt;FONT COLOR="#0000FF" FACE="Arial"&gt;Download the Video and Project&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;Lesson 6: More Structured Query Language&lt;/FONT&gt;&lt;/B&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;SQL Server beginners will discover more SQL statements like sub-select and learn stored procedures and their counterparts in C# and VB methods.&lt;/FONT&gt;&lt;A HREF="http://go.microsoft.com/?linkid=6143253"&gt;&lt;U&gt;&lt;FONT COLOR="#0000FF" FACE="Arial"&gt;Download the Video&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;/P&gt; &lt;BR&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-6697539162860579712?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/6697539162860579712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=6697539162860579712' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/6697539162860579712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/6697539162860579712'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/02/sql-express-for-absolute-beginners_22.html' title='SQL Express for Absolute Beginners!'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-8820601059600222856</id><published>2008-02-22T15:51:00.000-08:00</published><updated>2008-02-22T16:20:45.981-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Express Beginners'/><title type='text'>SQL Express for Absolute Beginners !</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Nice video(s) for absolute beginners, these videos introduce to couple of SQL Terms and Microsoft's Express Edition of SQL Server. SQL Server Express Edition is freely downloadble from Microsoft's website.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lesson 1: What is a database? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This introduction covers the questions and terminology SQL Server beginners need to create and manage databases, such as: What is a SQL Server database? How is a SQL Server database different from an Excel spreadsheet? What do SQL Server databases do in my Web site or software applications? What's SQL Server Express' relation to Visual Studio Express? What do terms like "ADO.NET" mean? &lt;/span&gt;&lt;a href="http://go.microsoft.com/?linkid=6143248"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Download the Video&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Lesson 2: Understanding Database Tables and Records&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;SQL Server beginners will learn about tables and definitions of data types, properties, keys, etc. in this second video. Find out how table rows, columns, and fields interrelate and whether columns can be empty. &lt;a href="http://go.microsoft.com/?linkid=6143249"&gt;Download the Video&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-8820601059600222856?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/8820601059600222856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=8820601059600222856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8820601059600222856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8820601059600222856'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/02/sql-express-for-absolute-beginners.html' title='SQL Express for Absolute Beginners !'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-5054654426021834106</id><published>2008-01-28T11:58:00.000-08:00</published><updated>2008-01-28T12:02:11.998-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='timeout'/><category scheme='http://www.blogger.com/atom/ns#' term='&quot;Notification Service&quot;'/><title type='text'>Notification Service Deployment :: Timeout expired</title><content type='html'>&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;While working on one of the Notification services deployment I was getting following error message.&lt;/span&gt; &lt;/p&gt;&lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt;An attempt to run a Transact-SQL CREATE PROCEDURE statement failed.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt;SqlCommandText: CREATE PROCEDURE dbo.&amp;lt;procedure name&amp;gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt;Source&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;.&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt;Net SqlClient Data Provider &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt;Number&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;-&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt;2 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;State&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; 0 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt;Class&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; 11 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;Server&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; myServer&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;Message&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;Timeout&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; expired&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;.&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; The &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;timeout&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; period elapsed &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;prior&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;to&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; completion &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;of&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; the operation &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;or&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; the &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;server&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;is&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;not&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; responding&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;.&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;Procedure&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt;Line Number&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; 0 &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;Timeout&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; expired&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;.&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; The &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;timeout&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; period elapsed &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;prior&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;to&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; completion &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;of&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; the operation &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;or&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; the &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#0000ff;"&gt;server&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;is&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;not&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;"&gt; responding&lt;/span&gt;&lt;span style="font-family:Book Antiqua;font-size:85%;color:#808080;"&gt;.&lt;/span&gt; &lt;/p&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Timeout error for just creation of stored procedure? - I did check the stored procedure, it's T-SQL was 200 line long that; should not matter anyway. However I went ahead and ran the "CREATE PROCEDURE" code in query analyzer. I got created fine, just in slit seconds.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Did some search on web for "&lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;Message&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;:&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;Timeout&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; expired&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;.&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; The &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;timeout&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; period elapsed &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;prior&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;to&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; completion &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;of&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; the operation &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;or&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; the &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;server&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;is&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;not&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; responding&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;.&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;" - lot of forums were discussing about increasing timeout - command, connection everything, and some counter-argueing why increase timeout parametes its like "passing the buck to next developer " :) which is alo true. Anyway in my case I didn't had a way to change any parameters as NSControl.exe (the one which runs all the T-SQL scripts) is provided by MS and I am not aware of any way to set it. So we just gave a shot to reboot the server and it worked.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;I did further research and found that this is a know issue with NSControl.exe. Here is the link &lt;/span&gt;&lt;a href="http://support.microsoft.com/kb/870657"&gt;&lt;u&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;http://support.microsoft.com/kb/870657&lt;/span&gt;&lt;/u&gt;&lt;/a&gt;&lt;span style="font-family:Arial;"&gt;. Per this article "problem occurs if the application databases for the instance of Notification Services are large", but in my case the databases are very small, like 50 subscriptions and 50 members in the list (ofcourse this was TEST environment). Anyway I have decided to apply the patch, with the hope that this issue will not occur again. If it occurs again, I will use my technique - "just reboot".&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-5054654426021834106?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/5054654426021834106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=5054654426021834106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5054654426021834106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5054654426021834106'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/01/notification-service-deployment-timeout_28.html' title='Notification Service Deployment :: Timeout expired'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-5228258690738640378</id><published>2008-01-26T08:26:00.000-08:00</published><updated>2008-01-26T08:33:13.081-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='&quot;temporary tables&quot;'/><title type='text'>Caution about Temporary Tables !</title><content type='html'>&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;If you run the following statement, it will create a temporary table with Primary key named as "Pk_Col",&lt;/span&gt; &lt;/p&gt;&lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;TABLE&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; #Tmp &lt;/span&gt;&lt;span style="font-family:Courier New;color:#808080;"&gt;(&lt;/span&gt;&lt;br /&gt;        &lt;span style="font-family:Courier New;"&gt;col_01 &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;INT&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;CONSTRAINT&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; Pk_Col &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;PRIMARY&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;KEY&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#808080;"&gt;)&lt;/span&gt; &lt;/p&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;I will open another connection using same username and run the same statement it should run successfully. However it will fail with following error.&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Courier New;color:#ff0000;"&gt;Msg 2714, Level 16, State 4, Line 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#ff0000;"&gt;There is already an object named 'Pk_Col' in the database.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#ff0000;"&gt;Msg 1750, Level 16, State 0, Line 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#ff0000;"&gt;Could not create constraint. See previous errors.&lt;/span&gt; &lt;/p&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;From the error message it is very clear that there is a object name conflict not the #Tmp, but the Pk_Col. Unlike #Tmp the Pk_Col is not treated as temporary object.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;So to avoide such issue, and in the sprit of "good practice" don't give name to the constraint. If you don't give name to a constraint SQL Server will automatically give some arbitrary name like Pk_Col_A2340 which would never conflict if you rerun the command again and again. So the T-SQL should look like,&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;TABLE&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; #Tmp &lt;/span&gt;&lt;span style="font-family:Courier New;color:#808080;"&gt;(&lt;/span&gt;&lt;br /&gt;        &lt;span style="font-family:Courier New;"&gt;col_01 &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;INT&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;PRIMARY&lt;/span&gt;&lt;span style="font-family:Courier New;"&gt; &lt;/span&gt;&lt;span style="font-family:Courier New;color:#0000ff;"&gt;KEY&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;color:#808080;"&gt;)&lt;/span&gt; &lt;/p&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Note that I have not given a name, so the primary key was named as&lt;/span&gt; &lt;span style="font-family:Courier New;font-size:78%;"&gt;PK__#Tmp______________1CF15040&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Actually this issue occurred bit differently in my case. I was troubleshooting some T-SQL which was part of schedule job. While troubleshooting I ran the statement and everything looked fine. So went to Management studio and opened the job and pasted this modified T-SQL and executed the job. The job failed! - I looked at the job history and found that its failing due same error as above "Object name conflict". First I was surprise, b'cos both connections are separate and the primary key was on temporary table, but suddenly I realized the issue.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;So, best option all the time is NOT to give a name to a constraints used for temporary tables (# tables). This behaviour is seen in SQL 2000 &amp;amp; 2005 both.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-5228258690738640378?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/5228258690738640378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=5228258690738640378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5228258690738640378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5228258690738640378'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/01/caution-about-temporary-tables.html' title='Caution about Temporary Tables !'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-5231648057268932242</id><published>2008-01-24T08:47:00.000-08:00</published><updated>2008-01-24T12:53:33.311-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Admin Shares irpstacksize'/><title type='text'>Not enough server storage is available to process this command</title><content type='html'>&lt;ul&gt;&lt;p&gt;&lt;u&gt;&lt;span style="font-family:Arial;"&gt;Problem:&lt;/span&gt;&lt;/u&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;In one of the deployment procedure we detach the orginal databases and attach them as bak_&amp;lt;Original Name&amp;gt; while doing this we have to rename the file so that we can avoide  file name conflict while createing a new instance of databases. In order to rename we use &lt;/span&gt;&lt;a href="file://%26lt;ServerName%26gt;/I$"&gt;&lt;u&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;\\&amp;lt;ServerName&amp;gt;\I$&lt;/span&gt;&lt;/u&gt;&lt;/a&gt;&lt;span style="font-family:Arial;"&gt; as the access path, where I$ is the administrative share. But for some reason this was not accessable and was showing an on-screen error message as follows.&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;p&gt;&lt;b&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;"Not enough server storage is available to process this command"&lt;/span&gt;&lt;/b&gt; &lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;And in the System event logs following error message was logged.&lt;/span&gt; &lt;/p&gt;&lt;ul&gt;&lt;p&gt;&lt;b&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;"The server's configuration parameter "irpstacksize" is too small for the server to use a local device.  Please increase the value of this parameter".&lt;/span&gt;&lt;/b&gt; &lt;/p&gt;&lt;br /&gt;&lt;/ul&gt;&lt;p&gt;&lt;u&gt;&lt;span style="font-family:Arial;"&gt;Resolution:&lt;/span&gt;&lt;/u&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;As the onscreen error message was showing "Not enough server storage is available to process this command" we tried rebooting the system once, as the article &lt;/span&gt;&lt;a href="http://support.microsoft.com/kb/q126401/"&gt;&lt;u&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;http://support.microsoft.com/kb/q126401/&lt;/span&gt;&lt;/u&gt;&lt;/a&gt;&lt;span style="font-family:Arial;"&gt; suggested there could be possible memory issue, but that did not resolve the issue. Then contacted NT Admin team to trouble shoot this issue. From the update that I got from that team was that - they followed the steps given in aticle &lt;/span&gt;&lt;a href="http://support.microsoft.com/kb/285089"&gt;&lt;u&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;http://support.microsoft.com/kb/285089&lt;/span&gt;&lt;/u&gt;&lt;/a&gt;&lt;span style="font-family:Arial;"&gt;, but still they also don't know the root cause of this behaviour.  After this change mentioned in the article was implemented the $ share path was accessable as usuall.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;u&gt;&lt;span style="font-family:Arial;"&gt;Intrim Solution Steps( This was creative me)&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family:Arial;"&gt; :&lt;/span&gt;&lt;u&gt;&lt;/u&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;While NT Admin team was working on this, we decided to run our deployment procedure manually. So were not sure how do we go about it, b'cos our deployment procedure is made up of lot DOS and SQL Scripts and some of these scripts are created as dynamically during run time and executed. So decided to run the steps one-by-one manually, but that was very tedious. Instantaly we got an idea to introduced a PAUSE in one of the CMD files, just before the line where it was erroring out. So when we triggered the process it came until that pause and was waiting to hit some key. Here we went opened dynamically created files and modified the commands in one of the files to use I:\  instead of  I$. Then went back to process window and hit enter key to continue. We were able to run the deploy process successfully. This was just an intrim workaround for that day only.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-5231648057268932242?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/5231648057268932242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=5231648057268932242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5231648057268932242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5231648057268932242'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/01/not-enough-server-storage-is-available.html' title='Not enough server storage is available to process this command'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-4474321088640714897</id><published>2008-01-17T15:20:00.000-08:00</published><updated>2008-01-08T08:15:06.879-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Backup Compression'/><category scheme='http://www.blogger.com/atom/ns#' term='Litespeed'/><category scheme='http://www.blogger.com/atom/ns#' term='Red-gate'/><title type='text'>SQL 2008 - Backup Compression feature</title><content type='html'>&lt;!-- Converted from text/rtf format --&gt; &lt;BR&gt; &lt;UL&gt; &lt;P&gt;&lt;FONT FACE="Arial"&gt;All these days we spent time and resources on identifying the best SQL Backup utility that has compression mechanism. Finally we heard that MS-IT uses SQL Litespeed for its operations and most of the people out there bought LiteSpeed, those who couldn't afford settled with other softwares like Red-Gate etc. Put some time in implementing it with custom code to fire backup commands and to clean the old backup files as these tools are not tightly integrated with SQL Maintenance Plans.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;FONT FACE="Arial"&gt;In SQL-2008 MS has introduced &amp;quot;Compressed Backups&amp;quot; - yes all your energy is (that we talked about in above paragraph) is wasted. Instead of saying wasted just assume that you got some knoledge and working of some product like LiteSpeed and Red-Gate etc. Also this &amp;quot;compression of backups&amp;quot; feature is available in &amp;quot;Enterprise Edision&amp;quot; only. And certainly you can resore the &amp;quot;Compressed backups&amp;quot; onto other edition like Standard, &amp;amp; Developer etc.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;FONT FACE="Arial"&gt;Now, Lets look what actually is this new feature in SQL 2008 is doing. Ok - it&amp;#8217;s the same compression technique, basically it will compress the data in the memory and dump it into a file in that format which reduced the disk space used, plus the time taken to complete the backup - b'cos the disk I/O is less in this case. I don't see encryption feature in here which is mostly available with third party tools. And the other point is that there are couple of restrictions on the having compressed backups, which are,&lt;/FONT&gt;&lt;/P&gt;  &lt;UL&gt; &lt;LI&gt;&lt;FONT FACE="Arial"&gt;This feature is only available on SQL 2008 - &amp;quot;Enterprise Edition&amp;quot;&lt;/FONT&gt;&lt;/LI&gt;  &lt;LI&gt;&lt;FONT FACE="Arial"&gt;Compressed and Un-compressed backups cannot be in the same media set (i.e SQL 2008 - &amp;quot;Enterprise Edition&amp;quot; will understand the media set, however the older versions of SQL Server will fail to read the media set.)&lt;/FONT&gt;&lt;/LI&gt;  &lt;LI&gt;&lt;FONT FACE="Arial"&gt;NTbackups cannot share a tape with compressed SQL Server backups (I am NOT sure why - may be bc'os of the above reason)&lt;/FONT&gt;&lt;/LI&gt; &lt;BR&gt; &lt;/UL&gt; &lt;P&gt;&lt;U&gt;&lt;FONT FACE="Arial"&gt;So how do we enable this feature on SQL 2008 ?&lt;/FONT&gt;&lt;/U&gt;&lt;FONT FACE="Arial"&gt; - This is done via sp_configure system stored procedure. By default when instance is installed this value is set to OFF (0), so in order to enable it you need to run &lt;/FONT&gt;&lt;/P&gt; &lt;UL&gt; &lt;P&gt;&lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;USE&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; master&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Book Antiqua"&gt;GO&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;EXEC&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#800000" FACE="Book Antiqua"&gt;sp_configure&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#FF0000" FACE="Book Antiqua"&gt;'backup compression default'&lt;/FONT&gt;&lt;FONT COLOR="#808080" FACE="Book Antiqua"&gt;,&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#FF0000" FACE="Book Antiqua"&gt;'1'&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;RECONFIGURE&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;WITH&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; OVERRIDE&lt;/FONT&gt; &lt;/P&gt; &lt;/UL&gt; &lt;P&gt;&lt;FONT FACE="Arial"&gt;Also, here is the command that you can use in case if you don't want to enable the compression at server level, but want only for specific backup command then,&lt;/FONT&gt;&lt;/P&gt; &lt;UL&gt; &lt;P&gt;&lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;BACKUP&lt;/FONT&gt;&amp;nbsp; &lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;DATABASE&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; &lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT FACE="Book Antiqua"&gt;AdventureWorks &lt;/FONT&gt;  &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;TO&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; &lt;/FONT&gt;&lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;DISK&lt;/FONT&gt;&lt;FONT COLOR="#808080" FACE="Book Antiqua"&gt;=&lt;/FONT&gt;&lt;FONT COLOR="#FF0000" FACE="Book Antiqua"&gt;'Z:\SQLServerBackups\AdvWorksData.bak'&lt;/FONT&gt;&lt;FONT FACE="Book Antiqua"&gt; &lt;/FONT&gt;  &lt;BR&gt;&lt;FONT COLOR="#0000FF" FACE="Book Antiqua"&gt;WITH&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;   &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT FACE="Book Antiqua"&gt;COMPRESSION&lt;/FONT&gt; &lt;/P&gt; &lt;/UL&gt; &lt;P&gt;&lt;FONT FACE="Arial"&gt;After reading all this I was curious to think - is there any change in backupset system table in MSDB. And yes, there is a new column in backupset table named&amp;nbsp; &amp;quot;compressed_backup_size&amp;quot;. The value in this column will tell you the byte count of the file (compressed) stored in the disk. If this value is NULL then that backup set is NOT_COMPRESSED.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;U&gt;&lt;FONT FACE="Arial"&gt;Performance wise&lt;/FONT&gt;&lt;/U&gt;&lt;FONT FACE="Arial"&gt; - Certainly compression demands extra CPU cycles, good that MS has provided two more counter to help use deal with performance related to compression. The counter are&lt;B&gt; Device Throughput Bytes/sec&lt;/B&gt; (in SQLServer:Backup Device object) and&lt;B&gt; Backup/Restore Throughput/sec&lt;/B&gt; counter (in SQLServer:Databases object) with these two I think we should be able to deal with perf. Issue related to backup process involving compression.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;U&gt;&lt;FONT FACE="Arial"&gt;Compression Ratio&lt;/FONT&gt;&lt;/U&gt;&lt;FONT FACE="Arial"&gt; - This is something that depends on couple of factors like is the data repeated too much in that case you can achieve high level of compression. As you migh know binary data cannot be compressed much so in those situation as well as in case of encrypted data character repeation happen very less, so you get less compression ratios.&lt;/FONT&gt;&lt;/P&gt; &lt;/UL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-4474321088640714897?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/4474321088640714897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=4474321088640714897' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4474321088640714897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/4474321088640714897'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/01/sql-2008-backup-compression-feature.html' title='SQL 2008 - Backup Compression feature'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-7970406831157852758</id><published>2008-01-08T10:07:00.000-08:00</published><updated>2008-01-03T10:51:02.784-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Automation'/><category scheme='http://www.blogger.com/atom/ns#' term='PSSDIAG'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLDump'/><title type='text'>Capturing PSSDIAG/SQLDump, Right In Time</title><content type='html'>&lt;ul&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Usually when you contact Microsoft PSS for SQL Server related issue they will ask you to run the PSSDIAG if its performance issue or if its SQL Server hung/restart issue they will ask you to capture memory dumps. If the issue is known to occur at certain time or if you can reprooduce the issue its fine you can trigger PSSDIAG or SQLDump well in time. But usually that is not the case. The issues are totally random and unknown in that kind of situation as a DBA you will face one problem - how will you run PSSDIAG or SQLDump right at the time of issue occurance.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;u&gt;&lt;span style="font-family:Arial;"&gt;Understand the symtoms:&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family:Arial;"&gt; If you know the symptoms like heavy blocking, slow down, unresponsiveness etc you can write a VBScript or combination of DOS and OSQL to detect the symptoms. So lets take un-responsiveness as an example. If this is the case I would write an Vscript and ping the SQL Server if the connection time is beyound 3-4 seconds then I will trigger the PSSDIAG or SQLDump whatever MS Support engineer has asked me to capture. This would totally automate the process and no human intervention is required.&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;In one of my cases what happened was there was an issue with SQL Server and it used to restart automatically. This behaviour was very much random was not sure when would the next re-start would occur. After initial investigation we found that the MS Clustering service was causing the SQL Server to restart. The way MS Clustering service works is - if the resource (in this case SQL service) is not responding (failure of isAlive check) then it will attempt to restart it. After restart attempts exceeds the configured thershold value Clustering service will attempt to failover. Which means the SQL Service will stop &amp;amp; has to start from the other node and hence I used to see the restart event occuring. So what I did was, I whipped out a simple VBScript to detect the SQL Server's situation and trigger the memory dump. Along with this I also changed the threshold timer and number of attempts in cluadmin so that Clustering service will not failover before my script does its job.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_h-wHXdbkoAM/R30mTzPNryI/AAAAAAAABmA/0KkBmOUIbjk/s1600-h/CluProp.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5151315670395105058" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_h-wHXdbkoAM/R30mTzPNryI/AAAAAAAABmA/0KkBmOUIbjk/s320/CluProp.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;Note:&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;b&gt;&lt;/b&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt; Pls evaluate the Pros/Cons or risks before making any change in Cluster Configurations.&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;So this is how I was successful in capturing the SQLDump right in time and sent it to PSS for analysis. We found that the SQL Server was running out of "worker thread" and due to which applications were failing (new connections) to connect to SQL Server. And even Clustering service was unable to do its "isAlive" checks and it used to interpret this as serice failure.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Similarly like what I explained above you can execute PSSDIAG or any other utility of choice if required.&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-7970406831157852758?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/7970406831157852758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=7970406831157852758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7970406831157852758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7970406831157852758'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/01/how-to-capture-pssdiag-when-you-want-it.html' title='Capturing PSSDIAG/SQLDump, Right In Time'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_h-wHXdbkoAM/R30mTzPNryI/AAAAAAAABmA/0KkBmOUIbjk/s72-c/CluProp.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-5407166174729360063</id><published>2008-01-05T15:48:00.000-08:00</published><updated>2007-12-26T15:55:05.089-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='joke'/><title type='text'>Who is incharge ?</title><content type='html'>&lt;p&gt;&lt;br /&gt;&lt;br /&gt;All the organs of the body were having a meeting, trying to decide who was the one in charge .&lt;br /&gt;&lt;br /&gt;'I should be in charge,' said the brain , 'Because I run all the body's systems, so without me nothing would happen .'&lt;br /&gt;&lt;br /&gt;'I should be in charge,' said the blood , 'Because I circulate oxygen all over so without me you'd all waste away .' 'I should be in charge,' said the stomach,' Because I process food and gi! ve all o f you energy .'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'I should be in charge,' said the legs , 'because I carry the body wherever it needs to go .'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'I should be in charge,' said the eyes , 'Because I allow the body to see where it goes .'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'I should be in charge,' said the rectum-Asshole' 'Because I'm responsible for waste removal.' All the other body parts laughed at the rectum And insulted him, so in a huff, he shut down tight.&lt;br /&gt;Within a few days, the brain had a terrible headache, the stomach was bloated, the legs got wobbly, the eyes got watery, and the blood was toxic . They all decided that the rectum should be the boss . The Moral of the story? Even though the others do all the work.&lt;br /&gt;&lt;br /&gt;The asshole is usually in charge .&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-5407166174729360063?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/5407166174729360063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=5407166174729360063' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5407166174729360063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5407166174729360063'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/01/who-is-incharge.html' title='Who is incharge ?'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-2015963461307629402</id><published>2008-01-02T16:07:00.000-08:00</published><updated>2008-01-02T16:05:32.951-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='New Features'/><title type='text'>SQL Server 2008 - New Security Features</title><content type='html'>&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Transparent Data Encryption:&lt;/strong&gt; What actually this means is - in earlier versions of SQL Server anybody could restore or attach and use the data in the database, of course if assuming if the unauthorized person got hold of the physical backup/data files. But SQL 2008 enables encryption of an entire database, data files or log files, without the need for application changes, plus search the encrypted data using both range and fuzzy searches, search secure data from unauthorized users, and data encryption without any changes in existing applications (developers must me happy). So in this scenerio if unauthorised person has to get access to data he needs to have the Master key, not just copy of physical backup/data file. Once encryption is turned on, the data is secured. This is not available in current CTP, soon it might be available to explore. I am expecting some kind of performance degradation on encrypted databases access, as one extra layer of data transformation is involved, but I am not sure.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Extensible Key Management:&lt;/strong&gt; This feature was there in SQL Server 2005 but was kinda basic solution for encryption and key management. In SQL Server 2008 it even supports third-party key management and HSM (Hardware Security Modules) products, and they say usage of HSM's are much more secured. Hardware Security Module (HSM) is a hardware-based security device that generates, stores and protects cryptographic keys. It provides the foundation for a high-level secure campus certification authority. Certification modules are also available in software, but a hardware device provides a higher level of security. (source: &lt;a href="http://www.cren.net/crenca/onepagers/hsm2.html"&gt;http://www.cren.net/crenca/onepagers/hsm2.html&lt;/a&gt;)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Auditing:&lt;/strong&gt; I am very happy to see this feature since SQL 2005. You can create and manage auditing via DDL while simplifying compliance by providing more comprehensive data auditing. This enables organizations to answer "basic" questions such as "What data was retrieved?".&lt;/p&gt;&lt;p&gt;All these above great features are available for usage via your favourite T-SQL command, isn't it great?&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-2015963461307629402?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/2015963461307629402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=2015963461307629402' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2015963461307629402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2015963461307629402'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/01/sql-server-2008-new-security-features.html' title='SQL Server 2008 - New Security Features'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-605975520412906984</id><published>2008-01-02T15:56:00.000-08:00</published><updated>2008-01-02T16:05:03.156-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xtype'/><category scheme='http://www.blogger.com/atom/ns#' term='sysobjects'/><category scheme='http://www.blogger.com/atom/ns#' term='T-SQL'/><title type='text'>Why use object type identifier ?</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Following is the typical T-SQL statement found in most of the database object deployment scripts. Let me describe the script a little bit - the below script will find the object "[dbo].[fnHasMarketingOptions]" which is of TYPE FN (Scalar function), IF (In-lined table-function) OR TF (Table function) and if FOUND it will drop that function.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;IF&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;EXISTS&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;(&lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;*&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;FROM&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; dbo&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;.&lt;/span&gt;&lt;span style="font-family:Arial;color:#008000;"&gt;sysobjects&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;WHERE&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; id &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;=&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#ff00ff;"&gt;OBJECT_ID&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;(&lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'[dbo].[fnHasMarketingOptions]'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;)&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;and&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; xtype &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;in&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;(&lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'FN'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;,&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'IF'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;,&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'TF'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;))&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;DROP&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;FUNCTION&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; [dbo]&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;.&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;[fnHasMarketingOptions]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;"&gt;GO&lt;/span&gt; &lt;/p&gt;&lt;br /&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;I don't understand why use "&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;and&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; xtype &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;in&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;(&lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'FN'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;,&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'IF'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;,&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'TF'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;)&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;" this part - because anyway you can't create a TABLE and PROCEDURE/FUNCTION with the same names in a database. Below is the illustration T-SQL statements,&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;TABLE&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; Test &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;(&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;col1 varchar&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;(&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;30&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;))&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;GO&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;CREATE&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;PROC&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; test &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;AS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;SELECT&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#ff00ff;"&gt;GETDATE&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;()&lt;/span&gt; &lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Here is the error message….&lt;/span&gt; &lt;/p&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;Msg 2714, Level 16, State 5, Procedure test, Line 4&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;There is already an object named 'test' in the database.&lt;/span&gt; &lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;If two object types (TABLE/PROCEDURE/TRIGGER) cannot be created with same name then why use "&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;and&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; xtype &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;in&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;(&lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'FN'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;,&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'IF'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;,&lt;/span&gt;&lt;span style="font-family:Arial;"&gt; &lt;/span&gt;&lt;span style="font-family:Arial;color:#ff0000;"&gt;N'TF'&lt;/span&gt;&lt;span style="font-family:Arial;color:#808080;"&gt;)&lt;/span&gt;&lt;span style="font-family:Arial;"&gt;" ?&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-605975520412906984?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/605975520412906984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=605975520412906984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/605975520412906984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/605975520412906984'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/01/why-use-object-type-identifier_02.html' title='Why use object type identifier ?'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-7828785182506166729</id><published>2007-12-29T10:35:00.000-08:00</published><updated>2008-01-03T12:04:50.027-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Availability'/><category scheme='http://www.blogger.com/atom/ns#' term='monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Server Availability Monitoring - Part II</title><content type='html'>&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;In this part of the article I will show you how to deploy the solution that I built in the previous article &lt;/span&gt;&lt;a href="http://gvphubli.blogspot.com/2007/12/sql-server-availability-monitoring-part_21.html"&gt;&lt;u&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;SQLServer Availability Monitoring Part I&lt;/a&gt;&lt;/span&gt;&lt;/u&gt; &lt;span style="font-family:Arial;"&gt;. The solution was designed to monitor SQL Server in an environment from another monitoring SQL Server. Here I have assumed that I have a dedicated box with SQL Server setup for monitoring. In my case I had a MOM database server which was used only for monitoring purposes. I created my solution specific table(s) in the same server by creating another database called DBA_Benchmark.&lt;br /&gt;&lt;br /&gt;Below are the steps involved in the solution deployment.&lt;br /&gt;&lt;br /&gt;Create a table to store logging info that comes from Sub.vbs,following is the script for the same. The column names are self explanatory,&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3 Tbl_isAlive Table creation script&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;"&gt;CREATE TABLE [dbo].[Tbl_isAlive2] (&lt;br /&gt;[RecDateTime] [datetime] NULL ,&lt;br /&gt;[RecInstName] [varchar] (50) NULL ,&lt;br /&gt;[ResSeconds] [numeric](8, 6) NULL ,&lt;br /&gt;[ResDesc] [varchar] (500) NULL&lt;br /&gt;) ON [PRIMARY]&lt;/span&gt; &lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Next create a SQL job that triggers SQLPing.vbs. Instead of calling the vbs directly I have used a wrapper batch file. Batch file actually came into picture because earlier I had an idea of using it as a NT Scheduled job, however I changed my mind and decided to play with SQL Server only.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;4 Launch.bat&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;"&gt;:Path on my the server where VBS is located&lt;br /&gt;CD "C:\isAlive\UsingVB"&lt;br /&gt;SQLPing.vbs SrvList.txt&lt;/span&gt; &lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;In the above DOS command the SrvList.txt is the txt file that holds my entire list of SQL Server one per line. Thecontents as are shown below.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;5 SrvList.txt&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;"&gt;Sun\SQLSrv_2K&lt;br /&gt;Sun\SQLSrv_2K5&lt;br /&gt;Sun\MSDE&lt;/span&gt; &lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Now, its time to create a job in SQL Server to trigger theLaunch.bat. This layer of batch file can be surely avoided ifrequired.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;6 SQL Batch creation script&lt;/span&gt;&lt;/b&gt; &lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;"&gt;BEGIN TRANSACTION&lt;br /&gt;DECLARE @JobID BINARY(16)&lt;br /&gt;DECLARE @ReturnCode INT&lt;br /&gt;SELECT @ReturnCode = 0&lt;br /&gt;IF (SELECT COUNT(*) FROM msdb.dbo.syscategories WHERE name = N'[Uncategorized (Local)]') &amp;lt; 1&lt;br /&gt;EXECUTE msdb.dbo.sp_add_category @name = N'[Uncategorized (Local)]'&lt;br /&gt;IF (SELECT COUNT(*) FROM msdb.dbo.sysjobs WHERE name = N'isAliveChk') &amp;gt; 0&lt;br /&gt;PRINT N'The job "isAliveChk" already exists so will not be replaced.'&lt;br /&gt;ELSE&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;-- Add the job&lt;br /&gt;&lt;br /&gt;EXECUTE @ReturnCode = msdb.dbo.sp_add_job @job_id = @JobID OUTPUT , @job_name = N'isAliveChk', @owner_login_name = N'sun\girish', @description = N'Job Comments.',&lt;br /&gt;@category_name = N'[Uncategorized (Local)]', @enabled = 1, @notify_level_email = 0,&lt;br /&gt;@notify_level_page = 0, @notify_level_netsend = 0, @notify_level_eventlog = 2,&lt;br /&gt;@delete_level= 0&lt;br /&gt;&lt;br /&gt;IF (@@ERROR &amp;lt;&amp;gt; 0 OR @ReturnCode &amp;lt;&amp;gt; 0) GOTO QuitWithRollback&lt;br /&gt;&lt;br /&gt;-- Add the job steps&lt;br /&gt;&lt;br /&gt;EXECUTE @ReturnCode = msdb.dbo.sp_add_jobstep @job_id = @JobID, @step_id = 1, @step_name = N'step_01_01', @command = N'-- run for 3 times in a minute.&lt;br /&gt;&lt;br /&gt;DECLARE @iCount INT&lt;br /&gt;&lt;br /&gt;SET @iCount=0&lt;br /&gt;&lt;br /&gt;WHILE (@iCount &amp;lt; 5)&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;EXEC master..xp_cmdshell ''D:\isAliveChk\Launch.bat'', no_output&lt;br /&gt;&lt;br /&gt;WAITFOR DELAY ''00:00:10''&lt;br /&gt;&lt;br /&gt;SET @iCount=@iCount+1&lt;br /&gt;&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;-- end&lt;br /&gt;&lt;br /&gt;', @database_name = N'master', @server = N'', @database_user_name = N'', @subsystem = N'TSQL', @cmdexec_success_code = 0, @flags = 0, @retry_attempts = 0, @retry_interval = 1, @output_file_name = N'', @on_success_step_id = 0, @on_success_action = 1, @on_fail_step_id = 0, @on_fail_action = 2&lt;br /&gt;&lt;br /&gt;IF (@@ERROR &amp;lt;&amp;gt; 0 OR @ReturnCode &amp;lt;&amp;gt; 0) GOTO QuitWithRollback&lt;br /&gt;&lt;br /&gt;EXECUTE @ReturnCode = msdb.dbo.sp_update_job @job_id = @JobID, @start_step_id = 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IF (@@ERROR &amp;lt;&amp;gt; 0 OR @ReturnCode &amp;lt;&amp;gt; 0) GOTO QuitWithRollback&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- Add the job schedules&lt;br /&gt;&lt;br /&gt;EXECUTE @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @JobID, @name = N'Sch_isAlive', @enabled = 1, @freq_type = 4, @active_start_date = 20070607, @active_start_time = 0, @freq_interval = 1, @freq_subday_type = 4, @freq_subday_interval = 1, @freq_relative_interval = 0, @freq_recurrence_factor = 0, @active_end_date = 99991231, @active_end_time = 235959&lt;br /&gt;&lt;br /&gt;IF (@@ERROR &amp;lt;&amp;gt; 0 OR @ReturnCode &amp;lt;&amp;gt; 0) GOTO QuitWithRollback&lt;br /&gt;&lt;br /&gt;-- Add the Target Servers&lt;br /&gt;&lt;br /&gt;EXECUTE @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @JobID, @server_name = N'(local)'&lt;br /&gt;&lt;br /&gt;IF (@@ERROR &amp;lt;&amp;gt; 0 OR @ReturnCode &amp;lt;&amp;gt; 0) GOTO QuitWithRollback&lt;br /&gt;&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;COMMIT TRANSACTION&lt;br /&gt;GOTO EndSave&lt;br /&gt;QuitWithRollback:&lt;br /&gt;IF (@@TRANCOUNT &amp;gt; 0) ROLLBACK TRANSACTION&lt;br /&gt;EndSave: &lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;"&gt;In the job I execute the following T-SQL Code&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Book Antiqua;"&gt;DECLARE @iCount INT&lt;br /&gt;SET @iCount=0&lt;br /&gt;WHILE (@iCount &amp;lt; 5)&lt;br /&gt;BEGIN&lt;br /&gt;EXEC master..xp_cmdshell ''D:\isAliveChk\Launch.bat'', no_output&lt;br /&gt;WAITFOR DELAY ''00:00:10''&lt;br /&gt;SET @iCount=@iCount+1&lt;br /&gt;END&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;This is basically I want to check the service availabilityevery 10 seconds and SQL Agent in SQL 2000 does not allow to run any task withfrequency of less than a minute. So I use above code to overcome thatlimitation.&lt;br /&gt;&lt;br /&gt;After implementation is over, query the table Tbl_isAliveand see if results are getting logged, at least there should some rows, becausewe query and log results every 10 seconds, unless you have changed it tosomething different.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;Troubleshooting:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-family:Arial;"&gt; In case if you see that its notworking correctly then disable the SQL Job first and try to launch the batchfile manually by dbl clicking on the file. If it works fine then looks like thepath what you have specified in the SQL Job may not be correct so fix the pathto point at the correct location.&lt;br /&gt;&lt;br /&gt;In case there is any other issue, the error details willbe logged in the file called as AppErrorLog.txt. If there iserror connecting to the server that it is logging the results to then you willsee the following kind of error message in the Errorlog,&lt;br /&gt;&lt;br /&gt;06/15/2007@ 11:52:08 AM -- Error : -2147467259 ==&amp;gt; [Microsoft][ODBC SQL ServerDriver][DBNETLIB]SQL Server does not exist or access denied.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Otherwise if its having an issue with connecting to theservers to be monitored then entry in log file or SQL Server table would looklike,&lt;br /&gt;&lt;br /&gt;06/15/2007@ 11:52:08 AM INSERT INTO DBA_BenchMark.dbo.Tbl_isAlive VALUES('06/15/200711:51:44 AM', 'NonExistant', 12.1875, '[Microsoft][ODBC SQL ServerDriver][DBNETLIB]SQL Server does not exist or access denied.')&lt;/span&gt;&lt;/p&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-7828785182506166729?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/7828785182506166729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=7828785182506166729' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7828785182506166729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7828785182506166729'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2008/01/sql-server-availability-monitoring-part.html' title='SQL Server Availability Monitoring - Part II'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-17225686298395537</id><published>2007-12-27T14:35:00.000-08:00</published><updated>2007-12-27T14:53:09.581-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rare stamp'/><title type='text'>Rare 'Jenny' stamp sells for $825,000</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_h-wHXdbkoAM/R3QpCzPNroI/AAAAAAAABkQ/AXFPm2PVrVc/s1600-h/rare_stamp.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_h-wHXdbkoAM/R3QpCzPNroI/AAAAAAAABkQ/AXFPm2PVrVc/s320/rare_stamp.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5148785402081816194" /&gt;&lt;/a&gt;&lt;br /&gt;In this undated photo provided by Heritage Auction Galleries of Dallas, a rare 24-cent stamp depicting an upside-down airplane is shown. The 1918 stamp depicts a Curtiss JN-4 'Jenny,' a World War I training aircraft that became an airmail plane. A collector from New York has purchased the rare 24-cent stamp depicting the upside-down airplane for $825,000, according to Heritage Auction Galleries.&lt;br /&gt;(AP Photo/Heritage Auction Galleries) &lt;br /&gt;&lt;br /&gt;The rare 1918 24-cent stamp, depicting an upside-down Curtis JN-4 biplane known as "Jenny," was sold privately this week to a Wall Street executive who did not want to be identified.&lt;br /&gt;&lt;br /&gt;Heritage Auction Galleries president Greg Rohan, who brokered the sale, said the buyer is the same collector who lost an auction last month in which another "Inverted Jenny" sold for $977,500. Rohan said his client, whom he described as not being a rare stamp collector, was glad to get another chance at the prized misprint.&lt;br /&gt;&lt;br /&gt;"I suspect he's going to enjoy owning it and showing it to a few close friends," Rohan said.&lt;br /&gt;&lt;br /&gt;The mint condition red, white and blue stamp is one of the finest known surviving stamps from the original sheet of 100 misprints. The original 100 were bought at a Washington, D.C., post office in 1918.&lt;br /&gt;&lt;br /&gt;Randy Shoemaker, founder of Professional Stamp Experts, said there are probably fewer than 1,000 collectors in the world with the money and obsession to seriously pursue such a rare item.&lt;br /&gt;&lt;br /&gt;"This is the Rolls-Royce," Shoemaker said. "It's the most expensive airmail stamp in the world."&lt;br /&gt;&lt;br /&gt;Rohan said Heritage acquired its stamp from Sonny Hagendorf, a dealer from Scarsdale, N.Y. Rohan said the copy sold by Heritage is one of fewer than five to have never been hinged, meaning affixed with adhesive to be placed in a stamp album.&lt;br /&gt;&lt;br /&gt;I am saving this image and article just who knows one day this also might fetch some money :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-17225686298395537?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/17225686298395537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=17225686298395537' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/17225686298395537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/17225686298395537'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/12/rare-jenny-stamp-sells-for-825000.html' title='Rare &apos;Jenny&apos; stamp sells for $825,000'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_h-wHXdbkoAM/R3QpCzPNroI/AAAAAAAABkQ/AXFPm2PVrVc/s72-c/rare_stamp.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-8506514496169313289</id><published>2007-12-21T10:46:00.000-08:00</published><updated>2008-01-03T12:06:50.059-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Availability'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='isAlive'/><title type='text'>SQL Server Availability Monitoring - Part I</title><content type='html'>&lt;ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;The most typical issue that any production support DBA faces is SQL Server "SERVICE" availability. Many times it happens that the 24/7 support team calls up and says XYZ application is down and it shows the message as “Database Error”. I log in remotely and check the service, and service looks like is up and running, and when I check back the application, it's running fine now. So what went wrong in the mean time ?&lt;br /&gt;&lt;br /&gt;Usually the SQL Server might be busy and the application might have timed out, either lock or connection timeout issue either way from application's point of view the database service was not available. So the trouble here is&lt;br /&gt;&lt;br /&gt;1 - Exactly when the application/database was was experiencing the issue?&lt;br /&gt;2 - Was application connection timeout setting was too low?&lt;br /&gt;3 - Do you have statistics of SQL Server service availability?&lt;br /&gt;&lt;br /&gt;Lot of questions will be raised when the issue is escalated and both app and database management team sit for discussions.&lt;br /&gt;&lt;br /&gt;To address all such situation I came up with a utility/script "SQLPing". Yes, you got it right I will ping the SQL Server not to kill but tocheck if the service is available or not, so that I have answers to all abovequestions. I have implemented this as a VB Script because of its obvious advantage and I can edit as and when I want to change some parameter. And theother advantage is I don’t have to document it to make other understand what is it all about, have a look at the code and you will get what it is doing.&lt;br /&gt;&lt;br /&gt;Let me quickly explain the files used in providing this solution,&lt;/span&gt; &lt;/p&gt;&lt;ul&gt;&lt;p&gt;&lt;b&gt;&lt;span style="font-family:Arial;"&gt;1 - SQLPing.VBS&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;"&gt;' Script description&lt;br /&gt;'----------------------&lt;br /&gt;' This procedure only reads the SQL Server name from the given(paramer) file&lt;br /&gt;' and launches the sub.vbs per SQL Server found in the file.&lt;br /&gt;' This design was choosed to avoide the delay caused in pinging subsequent server while&lt;br /&gt;' ping scirpt is waiting for current one. Also, all servers can be pinged almost (difference of fraction seconds)&lt;br /&gt;' at the same time.&lt;br /&gt;&lt;br /&gt;'CODE STARTS&lt;br /&gt;&lt;br /&gt;Set WshShell = WScript.CreateObject("WScript.Shell")&lt;br /&gt;IF Wscript.Arguments.Count = 0 THEN&lt;br /&gt;                MsgBox "Server List Missing", vbCritical, "Provide the list of servers."&lt;br /&gt;                Wscript.Quit&lt;br /&gt;END IF&lt;br /&gt;&lt;br /&gt;PingSQLServer&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'*** Procedure to query database and create the HTMLlized content ***&lt;br /&gt;Sub PingSQLServer&lt;br /&gt;&lt;br /&gt;                Dim conn, rs, Qry_Txt, Qry_01, Qry_02, Qry_03, sTarget, RptFileName&lt;br /&gt;                const RptFldr = "C:Girish_PatilisAliveUsingVB"&lt;br /&gt;                SET fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;                SET oFileTargets = fso.OpenTextFile(Wscript.Arguments(0),1)&lt;br /&gt;                DO UNTIL oFileTargets.AtEndOfStream&lt;br /&gt;                                WshShell.Run "sub.vbs " &amp;amp; oFileTargets.ReadLine&lt;br /&gt;                LOOP&lt;br /&gt;End Sub&lt;/span&gt; &lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Save the contents of about table to a file and name it as SQLPing.vbs. This file basically when executed, reads the server name from the file (passedas input parameter) and in-turn executes the Sub.vbs&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;p&gt;&lt;b&gt;&lt;span style="font-family:Book Antiqua;"&gt;2 - Sub.VBS&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Book Antiqua;"&gt;' Script description&lt;br /&gt;IF Wscript.Arguments.Count &amp;lt;&amp;gt; 0 THEN&lt;br /&gt;                SQLWork Wscript.Arguments(0)&lt;br /&gt;END IF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'*** Procedure to connect to SQL Server ***&lt;br /&gt;Sub SQLWork(SqlSrv)&lt;br /&gt;                On Error Resume Next&lt;br /&gt;                myTimer=timer&lt;br /&gt;                TstTime=formatdatetime(now, 0)&lt;br /&gt;                set conn = CreateObject("ADODB.Connection")&lt;br /&gt;                conn.ConnectionTimeout = 3&lt;br /&gt;                RecDate = formatdatetime(now, 0) ' current time on monitoring system.&lt;br /&gt;                conn.open("DRIVER=SQLServer; SERVER="&amp;amp; SqlSrv &amp;amp; ";DATABASE=master;Trusted_Connection=Yes")&lt;br /&gt;                if err.number &amp;lt;&amp;gt; 0 Then&lt;br /&gt;                                WriteToDB "INSERT INTO DBA_BenchMark.dbo.Tbl_isAlive VALUES('" &amp;amp; TstTime &amp;amp; "', '" &amp;amp; SqlSrv &amp;amp; "', " &amp;amp; timer-myTimer &amp;amp; ", '" &amp;amp; REPLACE(Err.description, "'","''") &amp;amp; "')"&lt;br /&gt;                                err.clear&lt;br /&gt;                                exit sub&lt;br /&gt;                End If&lt;br /&gt;                set rs = CreateObject("ADODB.Recordset")&lt;br /&gt;                set rs = conn.execute("select getdate() AS [DateTime]")&lt;br /&gt;                WriteToDB "INSERT INTO DBA_BenchMark.dbo.Tbl_isAlive VALUES('" &amp;amp; TstTime &amp;amp; "', '" &amp;amp; SqlSrv &amp;amp; "', " &amp;amp; timer-myTimer &amp;amp; ", '" &amp;amp; "Response " &amp;amp; RS(0) &amp;amp; "')"&lt;br /&gt;                rs.Close&lt;br /&gt;                Set rs = Nothing&lt;br /&gt;                conn.Close&lt;br /&gt;                Set conn = Nothing&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'*** Procedure to WRITE the output to a given file ***&lt;br /&gt;Sub WriteToDB (TxtToWrite)&lt;br /&gt;On Error Resume Next&lt;br /&gt;                err.clear '-- clearing the error from previous sub&lt;br /&gt;                set conn = CreateObject("ADODB.Connection")&lt;br /&gt;                conn.ConnectionTimeout = 10&lt;br /&gt;                conn.open("DRIVER=SQL Server;SERVER=SQL2K5;DATABASE=DBA_Benchmark;Trusted_Connection=Yes")&lt;br /&gt;                ' Error handler / Timeouts&lt;br /&gt;                if err.number &amp;lt;&amp;gt; 0 Then&lt;br /&gt;                                LogErrors ("-- Error : " &amp;amp; Err.Number &amp;amp; " ==&amp;gt; " &amp;amp; Err.description)&lt;br /&gt;                                LogErrors TxtToWrite&lt;br /&gt;                                Err.Clear&lt;br /&gt;                                exit sub&lt;br /&gt;                End If&lt;br /&gt;&lt;br /&gt;                'run a query to log the results&lt;br /&gt;                conn.execute (TxtToWrite)&lt;br /&gt;                conn.Close&lt;br /&gt;                Set conn = Nothing&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'*** Procedure to WRITE the output to a given file - for error logging ***&lt;br /&gt;Sub LogErrors (TxtToWrite)&lt;br /&gt;&lt;br /&gt;                Const ForReading = 1, ForWriting = 2, ForAppending = 8&lt;br /&gt;                Dim fso, f&lt;br /&gt;                Set fso = CreateObject("Scripting.FileSystemObject")&lt;br /&gt;                Set f = fso.OpenTextFile( "AppErrorLog.txt", ForAppending, True)&lt;br /&gt;                f.Write date &amp;amp; " @ " &amp;amp; time &amp;amp; VBTAB &amp;amp; TxtToWrite &amp;amp; VBCRLF&lt;br /&gt;                f.Close&lt;br /&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;Sub.vbs is the one which actually connects to SQL Server and checksif it’s responding, and collects the response time. In case of connection timeout and query timeout it will log the same information.&lt;br /&gt;&lt;br /&gt;I will explain how to deploy this solution in my next article &lt;/span&gt;&lt;a href="http://gvphubli.blogspot.com/2008/01/sql-server-availability-monitoring-part.html"&gt;&lt;u&gt;&lt;span style="font-family:Arial;color:#0000ff;"&gt;SQL Server Availability Monitoring Part-II&lt;/span&gt;&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-8506514496169313289?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/8506514496169313289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=8506514496169313289' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8506514496169313289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8506514496169313289'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/12/sql-server-availability-monitoring-part_21.html' title='SQL Server Availability Monitoring - Part I'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-55175482548975500</id><published>2007-12-20T12:51:00.000-08:00</published><updated>2008-01-08T13:00:25.959-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maintenance Plan'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Exporting SQL Maintenance Plans &amp; Jobs</title><content type='html'>&lt;!-- Converted from text/rtf format --&gt; &lt;UL&gt; &lt;P&gt;&lt;FONT FACE="Arial"&gt;&amp;nbsp;&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;The best way that I have employed is to restore the MSDB database. That will get you all the jobs, maintenance plans and their histories and also backup set details.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;FONT FACE="Arial"&gt;However if you say that you don&amp;#8217;t want anything except Maintenance plan only then here is the method. Don&amp;#8217;t forget that there are jobs attached to maintenance plan as well. So I would import the data from following tables.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;sysdbmaintplan_databases&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; - Contains one row for each database that has an associated maintenance plan. This table is stored in the&lt;/FONT&gt;&lt;B&gt; &lt;FONT FACE="Arial"&gt;msdb&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; database.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;sysdbmaintplan_history&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; - Contains one row for each maintenance plan action performed. This table is stored in the&lt;/FONT&gt;&lt;B&gt; &lt;FONT FACE="Arial"&gt;msdb&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; database.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;sysdbmaintplan_jobs -&lt;/FONT&gt;&lt;/B&gt; &lt;FONT FACE="Arial"&gt;Contains one row for each maintenance plan job. This table is stored in the&lt;/FONT&gt;&lt;B&gt; &lt;FONT FACE="Arial"&gt;msdb&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; database.&lt;/FONT&gt;  &lt;BR&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;sysdbmaintplans&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; - Contains one row for each database maintenance plan. This table is stored in the&lt;/FONT&gt;&lt;B&gt; &lt;FONT FACE="Arial"&gt;msdb&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; database.&lt;/FONT&gt; &lt;/P&gt;  &lt;P&gt;&lt;FONT FACE="Arial"&gt;For jobs following tables need to be copied/ imported.&lt;/FONT&gt;  &lt;BR&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;sysjobs&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; - Stores the information for each scheduled job to be executed by SQL Server Agent. This table is stored in the&lt;/FONT&gt;&lt;B&gt; &lt;FONT FACE="Arial"&gt;msdb&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; database.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;sysjobschedules&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; - Contains schedule information for jobs to be executed by SQL Server Agent. This table is stored in the&lt;/FONT&gt;&lt;B&gt; &lt;FONT FACE="Arial"&gt;msdb&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; database.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;sysjobsteps -&lt;/FONT&gt;&lt;/B&gt; &lt;FONT FACE="Arial"&gt;Contains the information for each step in a job to be executed by SQL Server Agent. This table is stored in the&lt;/FONT&gt;&lt;B&gt; &lt;FONT FACE="Arial"&gt;msdb&lt;/FONT&gt;&lt;/B&gt;&lt;FONT FACE="Arial"&gt; database.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;I&gt;&lt;FONT FACE="Arial"&gt;NOTE: Table definitions are as given in the books online (help files)&lt;/FONT&gt;&lt;/I&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;So basically we have to move data from following queries to respective tables.&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;SELECT * FROM sysdbmaintplans&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;SELECT * FROM sysjobs WHERE job_id in (SELECT job_id FROM sysdbmaintplan_jobs)&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;SELECT * FROM sysjobsteps WHERE job_id in (SELECT job_id FROM sysdbmaintplan_jobs)&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;SELECT * FROM sysjobschedules WHERE job_id in (SELECT job_id FROM sysdbmaintplan_jobs)&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;Table names are self explained.&lt;/FONT&gt;  &lt;BR&gt;&lt;FONT FACE="Arial"&gt;Similarly DTS packages can also be moved. Check it out here &lt;/FONT&gt;&lt;A HREF="http://www.sqldts.com/204.aspx"&gt;&lt;U&gt;&lt;FONT COLOR="#0000FF" FACE="Arial"&gt;http://www.sqldts.com/204.aspx&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt; &lt;/P&gt; &lt;/UL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-55175482548975500?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/55175482548975500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=55175482548975500' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/55175482548975500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/55175482548975500'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/12/exporting-sql-maintenance-plans-jobs.html' title='Exporting SQL Maintenance Plans &amp; Jobs'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-6191695622793897797</id><published>2007-08-08T12:49:00.000-07:00</published><updated>2008-01-08T13:05:48.586-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Enumerate'/><category scheme='http://www.blogger.com/atom/ns#' term='Disk Free Space'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Enumerate Disks &amp; Disk Free Space On SQL Server</title><content type='html'>&lt;!-- Converted from text/rtf format --&gt; &lt;BR&gt; &lt;UL&gt; &lt;P&gt;&lt;FONT FACE="Arial"&gt;Ever cameup with a situation wherein you want to create a databaes on the fly and to decide dynamically where to place your data and log files, yes I faced it and cameup with the following solution.&lt;/FONT&gt;&lt;/P&gt;  &lt;P&gt;&lt;FONT FACE="Arial"&gt;You have one stored procedure and one function that can help, first xp_fixeddrives and second one is a system function fn_servershareddrives. xp_fixeddrives procedure outputs the list of drives with free space available on each of the drives, but does not tell you which is shared(SAN drive) and which is local. This is important because you cannot create a database on a local drive when SQL Server is running in clustered environment. And function fn_servershareddrives() does not list the free space available and also does not report local drives so combine the results of both and list every thing and pick what you want and create the database, based on isClusterd() server property output. Here is what I did.&lt;/FONT&gt;&lt;/P&gt; &lt;BR&gt; &lt;UL&gt; &lt;P&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;SET NOCOUNT ON&lt;BR&gt; &lt;BR&gt; CREATE TABLE #DriveSpace (&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drive char(1),&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MBFree int&lt;BR&gt; )&lt;BR&gt; &lt;BR&gt; -- get availabe drives and free space on each of them&lt;BR&gt; INSERT INTO #DriveSpace EXEC xp_fixeddrives&lt;BR&gt; &lt;BR&gt; SELECT * INTO #DriveUnion FROM&lt;BR&gt; (&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&amp;nbsp; A.DriveName COLLATE Latin1_General_CI_AS&amp;nbsp;&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Drives Available], #DriveSpace.MBFree, 'X'[Shared]&amp;nbsp;&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp;&amp;nbsp;&amp;nbsp; ::fn_servershareddrives() A&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEFT JOIN #DriveSpace on&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.DriveName COLLATE Latin1_General_CI_AS = #DriveSpace.drive&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNION&lt;BR&gt; &lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&amp;nbsp; Drive COLLATE Latin1_General_CI_AS [Drives Available],&amp;nbsp;&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MBFree, '-'[Shared]&amp;nbsp;&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp;&amp;nbsp;&amp;nbsp; #DriveSpace&amp;nbsp;&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE&amp;nbsp;&amp;nbsp; Drive NOT IN (SELECT DriveName COLLATE Latin1_General_CI_AS&amp;nbsp;&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM ::fn_servershareddrives())&lt;BR&gt; ) A&lt;BR&gt; &lt;BR&gt; /**&lt;BR&gt; &amp;nbsp;-- if clustered environment eliminate local drives from the list.&lt;BR&gt; &amp;nbsp;IF SERVERPROPERTY('isClustered')=1&lt;BR&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DELETE FROM #DriveUnion where Shared='-'&lt;BR&gt; SELECT * FROM #DriveUnion&lt;BR&gt; **/&lt;BR&gt; &lt;BR&gt; DROP TABLE #DriveSpace&lt;BR&gt; DROP TABLE #DriveUnion&lt;/FONT&gt; &lt;/UL&gt; &lt;P&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;&amp;nbsp;&lt;/FONT&gt;  &lt;BR&gt;&lt;B&gt;&lt;FONT FACE="Arial"&gt;Sample Output&lt;/FONT&gt;&lt;/B&gt;  &lt;BR&gt;&lt;FONT SIZE=2 FACE="Courier New"&gt;&lt;BR&gt; 'X' indicates shared drive, where as '-' indicates local drive.&amp;nbsp;&lt;BR&gt; Drives Available MBFree&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shared&lt;BR&gt; ---------------- ----------- ------&lt;BR&gt; C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 50469&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;BR&gt; D&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 36053&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;BR&gt; E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 267942&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X&lt;BR&gt; F&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 39384&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X&lt;BR&gt; G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3657&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X&lt;BR&gt; H&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 179584&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X &lt;/FONT&gt; &lt;/P&gt; &lt;/UL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-6191695622793897797?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/6191695622793897797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=6191695622793897797' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/6191695622793897797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/6191695622793897797'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/08/enumerate-disks-disk-free-space-on-sql.html' title='Enumerate Disks &amp; Disk Free Space On SQL Server'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-5353441657814036132</id><published>2007-05-11T11:43:00.000-07:00</published><updated>2007-05-11T11:54:27.531-07:00</updated><title type='text'>Object Search Window missing !!</title><content type='html'>&lt;span style="font-family:courier new;"&gt;One of my friend asked me is there a way to search for specific object (table,sp, trigger or column) based on key word. Immediately I said yes and tried to look for that search utility within the SQL 2005 Server Management Studio and tried pressing F4 also but nothing popped-up.&lt;br /&gt;&lt;br /&gt;I was really surprise and woundering where the Object search window is. Out of frustration I look into Google, not for objects but to know where the Object search window is gone. Then came up with the anwers that Object search functionality is taken out of SQL 2005 tool set. After all this research decided to write my query to do the task, and here is the T-SQL query solution for the problem &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;SELECT name[ObjectName],&lt;br /&gt;CASE xtype&lt;br /&gt;WHEN 'C' THEN 'CHECK constraint'&lt;br /&gt;WHEN 'D' THEN 'Default or DEFAULT constraint'&lt;br /&gt;WHEN 'F' THEN 'FOREIGN KEY constraint'&lt;br /&gt;WHEN 'L' THEN 'Log'&lt;br /&gt;WHEN 'FN' THEN 'Scalar function'&lt;br /&gt;WHEN 'IF' THEN 'Inlined table-function'&lt;br /&gt;WHEN 'P' THEN 'Stored procedure'&lt;br /&gt;WHEN 'PK' THEN 'PRIMARY KEY constraint (type is K)'&lt;br /&gt;WHEN 'RF' THEN 'Replication filter stored procedure'&lt;br /&gt;WHEN 'S' THEN 'System table'&lt;br /&gt;WHEN 'TF' THEN 'Table function'&lt;br /&gt;WHEN 'TR' THEN 'Trigger'&lt;br /&gt;WHEN 'U' THEN 'User table'&lt;br /&gt;WHEN 'UQ' THEN 'UNIQUE constraint (type is K)'&lt;br /&gt;WHEN 'V' THEN 'View'&lt;br /&gt;WHEN 'X' THEN 'Extended stored procedure'&lt;br /&gt;END as ObjectType&lt;br /&gt;FROM sysobjects WHERE NAME LIKE '%customer%'&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT object_name(id)+' &gt;&gt; '+name, 'column' FROM syscolumns WHERE NAME LIKE '%customer%'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;**/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;Here is how the output looks like&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/_h-wHXdbkoAM/RkS7WrKFwCI/AAAAAAAAAlk/r_eABsbdAAM/s1600-h/ObjSearch.GIF"&gt;&lt;img id="BLOGGER_PHOTO_ID_5063377879287840802" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_h-wHXdbkoAM/RkS7WrKFwCI/AAAAAAAAAlk/r_eABsbdAAM/s320/ObjSearch.GIF" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-5353441657814036132?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/5353441657814036132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=5353441657814036132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5353441657814036132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5353441657814036132'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/05/object-search-window-missing.html' title='Object Search Window missing !!'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_h-wHXdbkoAM/RkS7WrKFwCI/AAAAAAAAAlk/r_eABsbdAAM/s72-c/ObjSearch.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-6244395067421710142</id><published>2007-05-01T11:46:00.000-07:00</published><updated>2007-12-27T14:54:56.091-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET IDE Bug'/><title type='text'>Unable to start in debug mode(VS.Net)</title><content type='html'>&lt;div&gt;&lt;span style="font-family:courier new;"&gt;I was working on my project as usuall. And found that one of my database query is not returning any row(s). I checked the query and found that there was a date parameter in WHERE clause due to which I was unable to get the data. So I reset the clock on my system to one month back i.e when it was 01-May it reset it to 01-Apr. After doing this system change I was unable to start the VS.Net project in debug mode. First I didn't realize the fact that it is due to change in my system clock. I kept trying to understand what the heck is wrong. Finally I reset back the date to 01-May, but still I am facing the same issue. If I start the application by pressing F11, I get the following message box. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_h-wHXdbkoAM/RjeLTrKFwAI/AAAAAAAAAk8/xMlhNFvXVwM/s1600-h/debug.GIF"&gt;&lt;img id="BLOGGER_PHOTO_ID_5059665876492861442" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_h-wHXdbkoAM/RjeLTrKFwAI/AAAAAAAAAk8/xMlhNFvXVwM/s320/debug.GIF" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Then I deleted the folded bin &amp;amp; obj listed under the root of project folder, and thats it things are sorted out.&lt;br /&gt;&lt;br /&gt;This behaviour looks like is very specific to C# Console application, I tried to simulate with VB.NET Windows App. I couldn't recreate the issue.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-6244395067421710142?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/6244395067421710142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=6244395067421710142' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/6244395067421710142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/6244395067421710142'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/05/unable-to-start-in-debug-modevsnet.html' title='Unable to start in debug mode(VS.Net)'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_h-wHXdbkoAM/RjeLTrKFwAI/AAAAAAAAAk8/xMlhNFvXVwM/s72-c/debug.GIF' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-8224274091214200907</id><published>2007-04-26T09:42:00.000-07:00</published><updated>2007-12-27T14:55:21.348-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='string manipulation'/><title type='text'>VB.Net String Manipulation</title><content type='html'>&lt;div&gt;I was trying to cut the fixed length string to the given specification thought I will post this Vb code as a sample code snippet on my blog.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_h-wHXdbkoAM/RjDYIrKFuqI/AAAAAAAAAXM/TNkJ6uu_2vE/s1600-h/vbcode_001.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5057780025072663202" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" height="238" alt="" src="http://2.bp.blogspot.com/_h-wHXdbkoAM/RjDYIrKFuqI/AAAAAAAAAXM/TNkJ6uu_2vE/s320/vbcode_001.JPG" width="371" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;The output would look as shown below&lt;/div&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_h-wHXdbkoAM/RjDaYLKFusI/AAAAAAAAAXc/s3P-2QO0wFY/s1600-h/vbcode_001_OutPut.JPG"&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_h-wHXdbkoAM/RjDcGrKFutI/AAAAAAAAAXk/0_zOgvn5v60/s1600-h/vbcode_001_OutPut.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5057784388759435986" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_h-wHXdbkoAM/RjDcGrKFutI/AAAAAAAAAXk/0_zOgvn5v60/s320/vbcode_001_OutPut.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-8224274091214200907?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/8224274091214200907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=8224274091214200907' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8224274091214200907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/8224274091214200907'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/04/vbnet-string-manipulation.html' title='VB.Net String Manipulation'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_h-wHXdbkoAM/RjDYIrKFuqI/AAAAAAAAAXM/TNkJ6uu_2vE/s72-c/vbcode_001.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-1848366367617537495</id><published>2007-04-26T06:29:00.000-07:00</published><updated>2007-12-26T14:45:51.154-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='backup'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Database Backup Solution</title><content type='html'>&lt;span style="font-family:courier new;"&gt;As I said in one of my articles, we usually work from remote and don't have a common database server for our development purposes. So one day what happened was one of my developer was doing some db object changes, like almost 20-25 changes. However after he did his changes he didn't backup it up (not a DBA). Next day he was supposed to send the script to me so that I make the same changes on my copy of database and distribute it to others so that every developer and myself are on the same version of database. But unfortunately one of his computer's disk crashed and he lost almost all development work. And database work was totally lost,&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;n&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;or we had any database backup to recover the work from. And most of the developers use SQL Express edition so they might not be well equiped with proper tool&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Usually I have seen developers when working in organised manner they usually don't worry about the database server anyway its a DBA job to maintain it. But in the scenerio that I explained, developer is expected to do it himself and protect his work. However SQL Server does not allow physical file backup, so the next best option and the best practise is to backup the database using backup commands.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Here is a simple win batch file for the same,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;/********** backup.bat **************************/&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;date/T &gt;&gt; BackupLog.txttime /T&gt;&gt; BackupLog.txt&lt;br /&gt;osql -E -SSLYSLE-PC\GP_SQL2K5 -Q"BACKUP DATABASE TestDB TO DISK = 'C:\Girish_Patil\DB_Backup\DB_Backup_%random%.BAK'" -w4000 &gt;&gt; BackupLog.txt&lt;br /&gt;time /T&gt;&gt; BackupLog.txtdate/T &gt;&gt; BackupLog.txt&lt;br /&gt;echo "X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~X~" &gt;&gt; BackupLog.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;/**************************************************/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;The parameters are hardcoded, you can modify them as per your requirements. This script logs all the message to BackupLog.txt file if you want to analyze anytime if something goes wrong. I use %random% variable to generate random number and concatenate with backup file name so that there is no overwriting of backup files or any file name conflicts. Now, to automate it further just using Windows Scheduler to run this backup.bat file as scheduled job. Thats it your done with simple database backup solution that meets your purpose.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-1848366367617537495?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/1848366367617537495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=1848366367617537495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1848366367617537495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/1848366367617537495'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/04/database-backup-solution-for-developers.html' title='Database Backup Solution'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-7598369895018252968</id><published>2007-04-25T17:02:00.000-07:00</published><updated>2008-01-08T13:04:56.707-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='deployment'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Database deployment - How to ?</title><content type='html'>&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;I was working on one of the projects where I was doing database development and another two guys were working on .Net development. We did't had common DEV server to which we connect and do the work. So in such situation obviously I will have to give a new version of database to each of these developers. So obvious next way is to backup and restore, but I will have to teach the developer how to do it. So I came-up with new option and i.e. batch script. Below is the content of the batch file. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;/****** RestoreDB.bat *********************/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;::CD "C:\Girish_Patil\Deployment\Restore"&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;::restoreDB Ultra_V2 C:\Girish_Patil\Deployment\Restore\DB_Backup.BAK C:\Girish_Patil\Deployment\Restore SLYSLE-PC\GP_SQL2K5&lt;br /&gt;echo off&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;cls&lt;br /&gt;if "%1"=="" goto usage&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;if "%2"=="" goto usage&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;if "%3"=="" goto usage&lt;br /&gt;echo.echo Database is being restored pls. wait..&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo =================================&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;osql -E -S%4 -Q"if exists(select name from master..sysdatabases where name = '[%1]') drop database [%1]" -w4000 &gt;&gt; RestoreLog.txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;osql -E -S%4 -Q"RESTORE DATABASE [%1] FROM DISK = N'%2' WITH FILE = 1, MOVE N'ULTRA' TO N'%3\%1_Data.mdf', MOVE N'ULTRA_log' TO N'%3\%1_Log.ldf', NOUNLOAD, REPLACE, STATS = 10" -w4000&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;echo.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo =================================&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo [%1] Database is restored and is ready for use !!!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;goto end&lt;br /&gt;:usage&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;echo.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;echo usage: RestoreDB DBName BkpFilePath DbPhysicalFilePath SrvName&lt;br /&gt;:end&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;pause&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;/******************************************************/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;I takes 4 parameter&lt;br /&gt;1=Database name to restore as,&lt;br /&gt;2=DB Backup file name with path,&lt;br /&gt;3=Where do you want the new database files to be located,&lt;br /&gt;4=SQL Server name, with instance name.&lt;br /&gt;&lt;br /&gt;In my senario the SQL Server used to be running locally. So this script is ment to work smoothly as is on the local server. However if you want to restore it on remote server, in that case you need to place the DB Backup file on the remote server and provide the path local to it.&lt;br /&gt;&lt;br /&gt;Pls. mail/contact me if you need any thing more specific.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-7598369895018252968?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/7598369895018252968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=7598369895018252968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7598369895018252968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/7598369895018252968'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/04/database-deployment-how-to.html' title='Database deployment - How to ?'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-2722132880608804401</id><published>2007-04-25T13:47:00.000-07:00</published><updated>2007-04-25T17:47:39.744-07:00</updated><title type='text'>Missed opportunity</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;Look at this link &lt;/span&gt;&lt;a href="http://www.sql-server-performance.com/forum/topic.asp?ARCHIVE=true&amp;TOPIC_ID=9152"&gt;&lt;span style="font-family:courier new;"&gt;http://www.sql-server-performance.com/forum/topic.asp?ARCHIVE=true&amp;amp;TOPIC_ID=9152&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:courier new;"&gt;, it says I have won some prize, unfortunately I didn't log to this site for quiet a long period and thats how I miss something.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;/************&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;This is the second month of our new forum contest. Now, anyone who has posted at least once anytime during the month is elgible to win in a random drawing. Below are the winners for June 2005.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;To claim your prize, you MUST CONTACT ME, using the e-mail account you used when you registered with the forum. Once I get your e-mail, I will make the arrangements for you to receive your gift. If you don't contact me within 30 days, then you loose out.&lt;br /&gt;Below are the winners, selected at random, along with the gift they have won:&lt;br /&gt;gvphubli: ApexSQL Doc ($249) from ApexSQL Software&lt;br /&gt;billbobcu: SQL Scribe Documentation Builder ($400) from A&amp;G Software&lt;br /&gt;jastone: Book: In the Trenches with SQL Server &amp;amp; .NET: Advanced Techniques &amp;amp; Real World Solutions ($150)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;James B UK: DbNetGrid ($599) from DBNetLink&lt;br /&gt;ryanFX: SQLZip ($500) from SQLZip Software&lt;br /&gt;snoopy: myLittleAdmin for SQL Server ($490) from myLittleTools&lt;br /&gt;-----------------------------Brad M. McGehee, MVPWebmasterSQL-Server-Performance.Com&lt;/span&gt;&lt;/p&gt;&lt;p&gt;************/&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;"&gt;So, keep posting and helping others every alternate day&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-2722132880608804401?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/2722132880608804401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=2722132880608804401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2722132880608804401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/2722132880608804401'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2007/04/missed-opportunity.html' title='Missed opportunity'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-5852826154553940689</id><published>2001-12-20T10:53:00.000-08:00</published><updated>2008-12-22T14:53:01.546-08:00</updated><title type='text'>Search Results</title><content type='html'>&lt;div id="cse-search-results"&gt;&lt;/div&gt;&lt;script type="text/javascript"&gt;  var googleSearchIframeName = "cse-search-results";  var googleSearchFormName = "cse-search-box";  var googleSearchFrameWidth = 600;  var googleSearchDomain = "www.google.com";  var googleSearchPath = "/cse";&lt;/script&gt;&lt;script src="http://www.google.com/afsonline/show_afs_search.js" type="text/javascript"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-5852826154553940689?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5852826154553940689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5852826154553940689'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/2001/12/search-results.html' title='Search Results'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5982854563710370404.post-5722386052533804496</id><published>1997-01-19T08:56:00.000-08:00</published><updated>2008-01-26T07:56:46.475-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gvphubli'/><category scheme='http://www.blogger.com/atom/ns#' term='technologyyogi'/><title type='text'>My Profile</title><content type='html'>Girish Patil&lt;br /&gt;Age: 32&lt;br /&gt;Gender: Male&lt;br /&gt;Astrological Sign: Taurus&lt;br /&gt;Zodiac Year: Rabbit&lt;br /&gt;Industry: &lt;a href="http://www.blogger.com/profile-find.g?t=j&amp;amp;ind=TECHNOLOGY"&gt;Technology&lt;/a&gt;&lt;br /&gt;Occupation: &lt;a href="http://www.blogger.com/profile-find.g?t=o&amp;amp;q=SQL+DBA"&gt;SQL DBA&lt;/a&gt;&lt;br /&gt;Location: &lt;a href="http://www.blogger.com/profile-find.g?t=l&amp;amp;loc0=US&amp;amp;loc1=Washington&amp;amp;loc2=Seattle"&gt;Seattle&lt;/a&gt; : &lt;a href="http://www.blogger.com/profile-find.g?t=l&amp;amp;loc0=US&amp;amp;loc1=Washington"&gt;Washington&lt;/a&gt; : &lt;a href="http://www.blogger.com/profile-find.g?t=l&amp;amp;loc0=US"&gt;United States&lt;/a&gt;&lt;br /&gt;About Me&lt;br /&gt;By profession I am a DBA (MS-SQL) with total 10 yrs of experience in IT, out of that 7 yrs as SQL DBA. I have handled Developer, plus production support roles.&lt;br /&gt;Interests&lt;br /&gt;&lt;a href="http://www.blogger.com/profile-find.g?t=i&amp;amp;q=Technology"&gt;Technology&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/profile-find.g?t=i&amp;amp;q=Driving+on+country+side"&gt;Driving on country side&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/profile-find.g?t=i&amp;amp;q=Watching+action+movies"&gt;Watching action movies&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/profile-find.g?t=i&amp;amp;q=Personal+Finance+%26+Investment+%3A%29"&gt;Personal Finance &amp;amp; Investment :)&lt;/a&gt;&lt;br /&gt;Favorite Books&lt;br /&gt;&lt;a href="http://www.blogger.com/profile-find.g?t=b&amp;amp;q=A+Random+Walk+Down+Wall+Street+-+by+Burton+G.+Malkiel"&gt;A Random Walk Down Wall Street - by Burton G. Malkiel&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/profile-find.g?t=b&amp;amp;q=The+Great+Mutual+Fund+Trap+-+by+Gregory+Arthur+Baer+%26+Gary+Gensler"&gt;The Great Mutual Fund Trap - by Gregory Arthur Baer &amp;amp; Gary Gensler&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/profile-find.g?t=b&amp;amp;q=The+Warren+Buffett+Way+By+Robert+G.+Hagstrom"&gt;The Warren Buffett Way By Robert G. Hagstrom&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5982854563710370404-5722386052533804496?l=gvphubli.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gvphubli.blogspot.com/feeds/5722386052533804496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5982854563710370404&amp;postID=5722386052533804496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5722386052533804496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5982854563710370404/posts/default/5722386052533804496'/><link rel='alternate' type='text/html' href='http://gvphubli.blogspot.com/1997/01/my-profile.html' title='My Profile'/><author><name>Technology Yogi</name><uri>http://www.blogger.com/profile/01999049310266723278</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
