<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>techs@work</title>
	<atom:link href="http://techsatwork.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://techsatwork.com/blog</link>
	<description>informing technology....</description>
	<lastBuildDate>Sat, 28 Apr 2012 13:58:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Gotcha when restoring database with restrictive access !</title>
		<link>http://techsatwork.com/blog/?p=1310</link>
		<comments>http://techsatwork.com/blog/?p=1310#comments</comments>
		<pubDate>Sat, 28 Apr 2012 13:58:09 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[create database with restrictive]]></category>
		<category><![CDATA[db2 v9.7]]></category>
		<category><![CDATA[no admin privilege after restoring]]></category>
		<category><![CDATA[restoring with restrictive database]]></category>
		<category><![CDATA[restrictive]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1310</guid>
		<description><![CDATA[Starting from DB2 V9.1, IBM added a parameter on the CREATE DATABASE command called RESTRICTIVE.   When this parameter is specified nobody other than the userid creating the database gets any implicit access to the database.  The database is automatically &#8230; <a href="http://techsatwork.com/blog/?p=1310">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Starting from DB2 V9.1, IBM added a parameter on the CREATE DATABASE command called RESTRICTIVE.   When this parameter is specified nobody other than the userid creating the database gets any implicit access to the database.  The database is automatically in a &#8216;locked down&#8217; state.  This is great for businesses that don&#8217;t like giving access to their databases by default. As a production dba, I love it. Only the users that needs to access the database can be granted any access. Very controlled environment. I am sure most of the dbas out there would agree with me.</p>
<p>Restrictive doesn&#8217;t effect the SYSADMIN, DBADMIN, SECADMIN in anyway as long as they are in the right group. You can perform any functions within the database, within the same instance, until you decide to restore the database onto a different instance.  When you restore it to a different instance db2 does not automatically give the new instance owner or the userid/group the dbadmin privelege.  This means, you might lose admin privileges against that database. I am not sure whether its by design or a bug ?  I have opened a PMR with IBM to confirm.</p>
<p>What you can do is, login with a userid that has dbadmin or secadmin privilege on the original database and then give the new instance or new dbadmin user or group dbadmin group.</p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1310</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 10 arrives !</title>
		<link>http://techsatwork.com/blog/?p=1304</link>
		<comments>http://techsatwork.com/blog/?p=1304#comments</comments>
		<pubDate>Mon, 09 Apr 2012 11:36:43 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[adaptive compression]]></category>
		<category><![CDATA[Continuous Data Ingest]]></category>
		<category><![CDATA[db2 10]]></category>
		<category><![CDATA[DB2 galileo]]></category>
		<category><![CDATA[db2 oracle compatiblity]]></category>
		<category><![CDATA[db2 udb v10]]></category>
		<category><![CDATA[db2 v10]]></category>
		<category><![CDATA[db2 v10 features]]></category>
		<category><![CDATA[db2 v10 luw]]></category>
		<category><![CDATA[new db2 features]]></category>
		<category><![CDATA[time travel query]]></category>
		<category><![CDATA[zigzag join]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1304</guid>
		<description><![CDATA[IBM announces DB2 10 for Linux Unix and Windows !  Code named Galileo, DB2 10 arrives with some neat features. We all know DB2 V9.7 was loaded with features, especially with Oracle compatibility. IBM has improved upon the Oracle compatibility &#8230; <a href="http://techsatwork.com/blog/?p=1304">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>IBM <a href="http://www-01.ibm.com/software/data/db2-warehouse-10/" target="_blank">announces</a> DB2 10 for Linux Unix and Windows !  Code named Galileo, DB2 10 arrives with some neat features. We all know DB2 V9.7 was loaded with features, especially with Oracle compatibility. IBM has improved upon the Oracle compatibility mode making it almost 98%.<br />
<a href="http://techsatwork.com/blog/wp-content/uploads/2012/04/MovetoDB2530x150.jpg"><img class="aligncenter size-medium wp-image-1307" title="MovetoDB2530x150" src="http://techsatwork.com/blog/wp-content/uploads/2012/04/MovetoDB2530x150-300x84.jpg" alt="" width="300" height="84" /></a>DB2 10 for LUW should be available for general electronic download on April 30, 2012 and for media order on June 11, 2012.<br />
As usual the new DB2 is feature rich. IBM has packed some neat features on DB2 10. Among them some key ones are:</p>
<ul>
<li>Adaptive Compression</li>
<li>Time Travel Query</li>
<li>Enhanced security</li>
<li>High performance warehouse features (Zigzag join)</li>
<li>Multi Temperature data management</li>
<li>Enhanced Workload Tuner</li>
<li>Continuous data ingestion</li>
<li>DB2 pureScale(enhancements)</li>
</ul>
<p><span class="Apple-style-span" style="font-size: 16px; color: #444444; font-family: Georgia, 'Bitstream Charter', serif; line-height: 24px;">IBM has also made changes to features available on DB2 editions.</span></p>
<p><strong>Summary of DB2 10.1 edition changes:</strong></p>
<p>Resource limits for each edition, where applicable, are also listed below.</p>
<p><strong>DB2 Express-C:</strong></p>
<ul>
<li>Time Travel Query.</li>
<li>IBM Data Studio.</li>
<li>Memory limit has been increased to 4 GB. Processor core limit has been increased to two. Both limits are per physical server, or where partitioned, virtual server.</li>
</ul>
<p><strong>DB2 Express Edition:</strong></p>
<ul>
<li>Row and Column Access Control.</li>
<li>Label Based Access Control</li>
<li>Time Travel Query.</li>
<li>High Availability Disaster Recover (HADR).</li>
<li>IBM Data Studio.</li>
<li>Memory limit has been increased to 8 GB. Processor core limit remains at four. Both limits are per physical server, or where partitioned, virtual server.</li>
</ul>
<p><strong>DB2 Workgroup Server Edition:</strong></p>
<ul>
<li>Row and Column Access Control.</li>
<li>Label Based Access Control.</li>
<li>Time Travel Query.</li>
<li>IBM Data Studio.</li>
<li>Memory limit remains at 64 GB. Processor core limit remains at 16. Both limits are per physical server, or where partitioned, virtual server.</li>
</ul>
<p><strong>DB2 Enterprise Server Edition:</strong></p>
<ul>
<li>Row and Column Access Control</li>
<li>Label Based Access Control</li>
<li>Time Travel Query</li>
<li>Multi-Temperature Data Management</li>
<li>IBM Data Studio</li>
</ul>
<p><strong>DB2 Advanced Enterprise Server Edition:</strong></p>
<ul>
<li>Row and Column Access Control</li>
<li>Label Based Access Control</li>
<li>Time Travel Query</li>
<li>Multi-Temperature Data Management</li>
<li>Storage Optimization Feature, including Adaptive Compression</li>
<li>Continuous Data Ingest</li>
<li>IBM Data Studio</li>
<li>InfoSphere Data Architect (10 users)</li>
<li>InfoSphere Optim Configuration Manager</li>
<li>InfoSphere Optim Performance Manager Extended Edition</li>
<li>InfoSphere Optim Query Workload Tuner</li>
<li>InfoSphere Optim pureQuery Runtime for LUW</li>
</ul>
<p><strong>IBM Database Enterprise Developer Edition:</strong></p>
<ul>
<li>Row and Column Access Control</li>
<li>Label Based Access Control</li>
<li>Time Travel Query</li>
<li>Multi-Temperature Data Management</li>
<li>Storage Optimization Feature, including Adaptive Compression</li>
<li>Continuous Data Ingest</li>
<li>IBM Data Studio</li>
<li>InfoSphere Data Architect</li>
<li>InfoSphere Optim Configuration Manager</li>
<li>InfoSphere Optim Performance Manager Extended Edition</li>
<li>InfoSphere Optim Query Workload Tuner</li>
<li>InfoSphere Optim pureQuery Runtime for LUW</li>
</ul>
<p><span style="font-size: small;">Here is a <a href="http://www-01.ibm.com/common/ssi/cgi-bin/ssialias?subtype=ca&amp;infotype=an&amp;appname=iSource&amp;supplier=897&amp;letternum=ENUS212-074" target="_blank">link</a> that gives you a more in-depth look at the features</span></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1304</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server 2012 Licensing model</title>
		<link>http://techsatwork.com/blog/?p=1293</link>
		<comments>http://techsatwork.com/blog/?p=1293#comments</comments>
		<pubDate>Sun, 01 Apr 2012 13:15:31 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[change in sql server licensing model]]></category>
		<category><![CDATA[denali]]></category>
		<category><![CDATA[introduction to sql server 2012.]]></category>
		<category><![CDATA[sql server 2012]]></category>
		<category><![CDATA[sql server 2012 license model]]></category>
		<category><![CDATA[sql server 2012 licensing]]></category>
		<category><![CDATA[sql server core based licensing model]]></category>
		<category><![CDATA[sql server core license]]></category>
		<category><![CDATA[SQl Server license]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1293</guid>
		<description><![CDATA[With SQL Server 2012, Microsoft has changed its licensing model along with &#8220;consolidating&#8221; the different types of editions. Gone is the workgroup edition. The three mainstream editions Microsoft now offers  are Enterprise, Business Intelligence and Standard . The Web Edition &#8230; <a href="http://techsatwork.com/blog/?p=1293">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With SQL Server 2012, Microsoft has changed its licensing model along with &#8220;consolidating&#8221; the different types of editions. Gone is the workgroup edition. The three mainstream editions Microsoft now offers  are Enterprise, Business Intelligence and Standard . The Web Edition will be offered only to hosters via the Services Provider License Agreement (SLPA).  Developer, Express and Compact Editions will also continue to be distributed without licensing or pricing changes. Well Express edition is free. However the Developer, express and compact editions are not published in the Microsoft website.</p>
<p>Microsoft has also strategically changed from the previous processor based licensing model to a core based licensing model. So what does this mean, previously if you have a 2 processor server irrespective of the number of cores you have or use, you can buy licenses for 2 processor. But now if you have a quad core processor and have 2 processors on a server, you have to buy 8 (2 x 4 core) core SQL Server license. Now this move would make sense if you are in a VM environment where you might have 6-8 processor on the server and you might have assigned only 2 or 4 cores to a SQL Server. But if you are on a dedicated SQL Server it might increase your upgrade cost. How ? Lets say I have a 2 quad core processor(8 cores in total) on a server, previously I had to buy 2 processor license. If I decide to replace the 2 quad core processor with a 2 octa-core processor (16 cores in total) I didn&#8217;t have to buy any new sql server license under the old licensing model). But now under the new licensing model, I have to buy another 8 core worth of license. So my cost of an upgrade have gone up. Microsoft , please explain how this is going to help me reach my ROI quickly ?</p>
<p>If you are in a VM environment, there are multiple options depending on the route you want to go. If you are in a sql server standard edition then either:<br />
1. You can license each VM based on the actual number of virtual cores you are using. However you need to buy a minimum of 4 core license for each SQL Server VM. In other words even if you use 2 virtual core for the sql server, you need a 4 core license (go figure !).<br />
2. You can buy a server license for each VM plus CAL license for each user.<br />
But if you are in an enterprise edition then you can license the server by total amount of physical cores and then create unlimited amount of VMs.</p>
<p>For a failover, if the secondary server is a passive node and is not being used at all then it doesn&#8217;t have to licensed, but if any workload is run against it then must be fully licensed. Also if there is a third passive node, then the third node irrespective of whether its being used or not should be fully licensed.</p>
<p>The cost of the license has also gone up around 20-27%. I hope they don&#8217;t say the hike in gas price caused the license to cost more !</p>
<p>Here is are few useful links that explains the new license changes and model:<br />
<a href="http://download.microsoft.com/download/7/3/C/73CAD4E0-D0B5-4BE5-AB49-D5B886A5AE00/SQL_Server_2012_Licensing_Quick_Reference_Guide_Mar2012.pdf" target="_blank">SQL Server 2012 Licensing Quick Reference Guide</a>.<br />
<a href="http://download.microsoft.com/download/4/F/7/4F74E127-827E-420D-971F-53CECB6778BD/SQL_Server_2012_Licensing_Datasheet_and_FAQ_Mar2012.docx" target="_blank">Licensing Datasheet and FAQ</a></p>
<p>Here is an ebook for <a href="http://download.microsoft.com/download/F/F/6/FF62CAE0-CE38-4228-9025-FBF729312698/Microsoft_Press_eBook_Introducing_Microsoft_SQL_Server_2012_PDF.pdf" target="_blank">Introduction to SQL Server 2012</a></p>
<p>Please let me know how people are coping with these changes and any comments.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1293</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Denali is on its way !</title>
		<link>http://techsatwork.com/blog/?p=1290</link>
		<comments>http://techsatwork.com/blog/?p=1290#comments</comments>
		<pubDate>Sat, 25 Feb 2012 03:01:48 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[Always on]]></category>
		<category><![CDATA[denali]]></category>
		<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[MS SQL Server]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[sql server 2012]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1290</guid>
		<description><![CDATA[Microsoft is coming out with a new version of SQL Server , codenamed &#8216;Denali&#8217; a.k.a SQL Server 2012.  It boasts lot of new features.  I am not going to repeat all of them here now. Go to Microsoft to see all the &#8230; <a href="http://techsatwork.com/blog/?p=1290">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Microsoft is coming out with a new version of SQL Server , codenamed &#8216;Denali&#8217; a.k.a SQL Server 2012.  It boasts lot of new features.  I am not going to repeat all of them here now.</p>
<p>Go to <a href="http://www.microsoft.com/sqlserver/en/us/future-editions.aspx" target="_blank">Microsoft</a> to see all the features.  Here is <a href="http://blogs.technet.com/b/dataplatforminsider/archive/2011/11/01/my-top-5-sql-server-2012-features-by-aaron-bertrand-guest-blogger.aspx" target="_blank">another site</a> that talks about top 5 features.</p>
<p>I will definitely write in detail in few weeks. Right now I am taking a break</p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1290</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merry Christmas !</title>
		<link>http://techsatwork.com/blog/?p=1285</link>
		<comments>http://techsatwork.com/blog/?p=1285#comments</comments>
		<pubDate>Sun, 25 Dec 2011 14:07:19 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[Christmas greetings]]></category>
		<category><![CDATA[holiday greetings]]></category>
		<category><![CDATA[Merry Christmas]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1285</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://techsatwork.com/blog/wp-content/uploads/2011/12/Merry-Christmas.jpg"><img class="aligncenter size-full wp-image-1286" title="Merry-Christmas" src="http://techsatwork.com/blog/wp-content/uploads/2011/12/Merry-Christmas.jpg" alt="" width="390" height="290" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1285</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stored Proc for SQL Server and DB2 UDB</title>
		<link>http://techsatwork.com/blog/?p=1282</link>
		<comments>http://techsatwork.com/blog/?p=1282#comments</comments>
		<pubDate>Wed, 21 Dec 2011 22:31:31 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[dynamic sql]]></category>
		<category><![CDATA[execute]]></category>
		<category><![CDATA[grant]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[sp_executeSQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL/PL]]></category>
		<category><![CDATA[stored procedure]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1282</guid>
		<description><![CDATA[We often grant permissions against table for users. Some use the GUI, some just script it out. I wrote a quick stored procedure that will take couple of input parameter and run the grant against the tables.  Just for the &#8230; <a href="http://techsatwork.com/blog/?p=1282">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We often grant permissions against table for users. Some use the GUI, some just script it out. I wrote a quick stored procedure that will take couple of input parameter and run the grant against the tables.  Just for the fun of it, I wrote it for both DB2 UDB and SQL Server.  I know there are more than one way to write, but here is one way.</p>
<h2><strong><span style="text-decoration: underline;"><span style="color: #99cc00; text-decoration: underline;">DB2 UDB:</span></span></strong></h2>
<p><span style="color: #ff9900;">CREATE PROCEDURE Grant_TablePermissions (</span><br />
<span style="color: #ff9900;">                            IN  oschema  varchar(20),</span><br />
<span style="color: #ff9900;">                            IN  permissions varchar(30),</span><br />
<span style="color: #ff9900;">                            IN  grantee varchar(30),</span><br />
<span style="color: #ff9900;">                            OUT  counter  smallint</span><br />
<span style="color: #ff9900;">                            )</span><br />
<span style="color: #ff9900;">    DYNAMIC RESULT SETS 1</span><br />
<span style="color: #ff9900;">P1: BEGIN</span><br />
<span style="color: #ff9900;">     DECLARE vstmt varchar(3000);</span><br />
<span style="color: #ff9900;">     DECLARE vname varchar(30);</span><br />
<span style="color: #ff9900;">     DECLARE vcounter smallint default 0;</span><br />
<span style="color: #ff9900;">     DECLARE at_end smallint default 0;</span></p>
<p><span style="color: #ff9900;">    DECLARE cursor1 CURSOR WITH RETURN for</span><br />
<span style="color: #ff9900;">        SELECT NAME FROM SYSIBM.SYSTABLES </span><br />
<span style="color: #ff9900;">            WHERE CREATOR = oschema ORDER BY NAME;</span></p>
<p><span style="color: #ff9900;">    DECLARE EXIT HANDLER FOR NOT FOUND</span><br />
<span style="color: #ff9900;">      SET at_end = 1;</span></p>
<p><span style="color: #ff9900;">    SET at_end = 0;</span></p>
<p><span style="color: #ff9900;">    OPEN cursor1;</span></p>
<p><span style="color: #ff9900;">    fetch_loop:</span><br />
<span style="color: #ff9900;">     REPEAT</span><br />
<span style="color: #ff9900;">       FETCH cursor1 INTO vname;</span><br />
<span style="color: #ff9900;">       SET vstmt = &#8216;grant &#8216;||permissions||&#8217; on &#8216;||oschema||&#8217;.'||vname||&#8217; to &#8216;||grantee;</span><br />
<span style="color: #ff9900;">       PREPARE s1 FROM vstmt;</span><br />
<span style="color: #ff9900;">       EXECUTE s1;</span><br />
<span style="color: #ff9900;">       SET vcounter = vcounter + 1;</span><br />
<span style="color: #ff9900;">       SET counter = vcounter;</span><br />
<span style="color: #ff9900;">     UNTIL at_end = 1</span><br />
<span style="color: #ff9900;">    END REPEAT fetch_loop;</span></p>
<p><span style="color: #ff9900;">CLOSE cursor1;   </span></p>
<p><span style="color: #ff9900;">END P1</span></p>
<h2><strong><span style="text-decoration: underline;"><span style="color: #99cc00; text-decoration: underline;">SQL Server:</span></span></strong></h2>
<p><span style="color: #ff9900;">CREATE procedure [dbo].[Grant_TablePermission]</span><br />
<span style="color: #ff9900;">@permissions varchar(30),</span><br />
<span style="color: #ff9900;">@grantee varchar(30)</span><br />
<span style="color: #ff9900;">as</span><br />
<span style="color: #ff9900;">begin</span><br />
<span style="color: #ff9900;">       declare    @sqlcmd nvarchar(4000);</span><br />
<span style="color: #ff9900;">       declare    @tablename nvarchar(50);</span><br />
<span style="color: #ff9900;">       declare    @RowCount int;</span></p>
<p><span style="color: #ff9900;">      select @RowCount = 0;</span><br />
<span style="color: #ff9900;">      declare tablecursor insensitive cursor for</span><br />
<span style="color: #ff9900;">         select name from sys.tables</span></p>
<p><span style="color: #ff9900;">      open tablecursor;</span><br />
<span style="color: #ff9900;">      fetch tablecursor into @tablename;</span></p>
<p><span style="color: #ff9900;">      while (@@FETCH_STATUS = 0)</span><br />
<span style="color: #ff9900;">         begin </span><br />
<span style="color: #ff9900;">           select @sqlcmd = &#8216;GRANT &#8216; + @permissions + &#8216; on dbo.&#8217;+ @tablename + &#8216; TO &#8216;+ @grantee +&#8217;;';</span><br />
<span style="color: #ff9900;">           execute sp_executeSQL @sqlcmd;</span><br />
<span style="color: #ff9900;">           print @sqlcmd;</span></p>
<p><span style="color: #ff9900;">           set @RowCount = @RowCount + 1;</span></p>
<p><span style="color: #ff9900;">           fetch tablecursor into @tablename;</span><br />
<span style="color: #ff9900;">      end;</span></p>
<p><span style="color: #ff9900;">        close  tablecursor;</span><br />
<span style="color: #ff9900;">        deallocate tablecursor;</span></p>
<p><span style="color: #ff9900;">    SELECT &#8216;Number of tables permissions has been granted: &#8216; + CONVERT(varchar, @RowCount) </span></p>
<p><span style="color: #ff9900;">END</span></p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1282</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending an email in unix with attachments</title>
		<link>http://techsatwork.com/blog/?p=1274</link>
		<comments>http://techsatwork.com/blog/?p=1274#comments</comments>
		<pubDate>Tue, 08 Nov 2011 13:34:51 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[attaching file on emails in unix]]></category>
		<category><![CDATA[how to send emails with attachment in unix]]></category>
		<category><![CDATA[mailx]]></category>
		<category><![CDATA[mailx -r]]></category>
		<category><![CDATA[mailx -s]]></category>
		<category><![CDATA[mailx with attachment]]></category>
		<category><![CDATA[sending email with attachment]]></category>
		<category><![CDATA[sending emails on unix]]></category>
		<category><![CDATA[sending emails with attachment on unix]]></category>
		<category><![CDATA[sending emails with body and attachment]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[unix email with attachment]]></category>
		<category><![CDATA[unix email with body and attachment]]></category>
		<category><![CDATA[uuencode]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1274</guid>
		<description><![CDATA[Mailx is an easy way to send email from your unix/linux system.  With mailx you can get your server to send regular email or attach a file using your smtp server.  Ensure your sendmail is configured to let mailx send &#8230; <a href="http://techsatwork.com/blog/?p=1274">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Mailx is an easy way to send email from your unix/linux system.  With mailx you can get your server to send regular email or attach a file using your smtp server.  Ensure your sendmail is configured to let mailx send emails.  A good application for using mailx would be to send alerts, or process a file and then email it to somebody, extract data from your database or etl system and email the resulting data or file, etc.</p>
<p>Here is how to send an email :</p>
<p><em><span style="color: #ff9900;">mailx -s &#8220;Subject goes here&#8221; &#8220;toemail@address&#8221; &#8220;body goes here&#8221;</span></em></p>
<p><em><span style="color: #ff9900;">mailx -r &#8220;sender@emailaddress&#8221; -s &#8221;Subject&#8221; &#8220;toemail@address&#8221; &#8220;body goes here&#8221;</span></em></p>
<p>If the body is on a file :</p>
<p><em><span style="color: #ff9900;">mailx -s &#8220;Subject goes here&#8221; &#8220;toemail@address&#8221; &lt; body.txt</span></em></p>
<p>If you want to send an attachment in the file :</p>
<p><em><span style="color: #ff9900;">uuencode data.csv data.csv|mailx &#8211;s &#8220;Subject goes here&#8221; &#8220;toemail@address&#8221;</span></em></p>
<p>If you want to send an email with body and attachment :</p>
<p><em><span style="color: #ff9900;">uuencode data.csv data.csv &gt; datafile.csv  </span></em><br />
<em><span style="color: #ff9900;"> cat body.txt datafile.csv &gt; combined.file</span></em><br />
<em><span style="color: #ff9900;"> mailx -s &#8220;Subject goes here&#8221; &#8220;toemail@address&#8221; &lt; combined.file</span></em></p>
<p>The above three lines of code will enable you to send an email with body and an attachment.</p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1274</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading db2 tables from another database</title>
		<link>http://techsatwork.com/blog/?p=1270</link>
		<comments>http://techsatwork.com/blog/?p=1270#comments</comments>
		<pubDate>Wed, 02 Nov 2011 22:25:27 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[db2]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[data movement]]></category>
		<category><![CDATA[db2 import]]></category>
		<category><![CDATA[db2 load]]></category>
		<category><![CDATA[db2 load from cursor]]></category>
		<category><![CDATA[db2move]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[fast and easy load]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[load from cursor]]></category>
		<category><![CDATA[loading data from another table]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1270</guid>
		<description><![CDATA[Data movement is a common task that app dev and dbas perform often. DB2 has multiple options to mass add data to tables : IMPORT, LOAD and DB2MOVE.  Each of them have its own pros and cons.  If you are &#8230; <a href="http://techsatwork.com/blog/?p=1270">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Data movement is a common task that app dev and dbas perform often. DB2 has multiple options to mass add data to tables : IMPORT, LOAD and DB2MOVE.  Each of them have its own pros and cons.  If you are loading lots of data and you need it done fast, but can compromise on availability then LOAD is your best bet. The <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0008305.html" target="_blank">load</a> command in DB2 LUW is loaded with different options. I am sure you have loaded ixf and del files to db2 tables.  What if you want to make a copy of a table on the same database ?  The traditional method would be to create a new table like the source table, then export the data in del or ixf format and then load the data using the LOAD command. A newer approach would be to use the cursor option in the load command . Create table, declare a cursor for the source table and load the target table using the cursor. Eg :</p>
<p><em><span style="color: #ff9900;">declare c1 cursor select * from ds1.sales;</span></em><br />
<em><span style="color: #ff9900;">load from c1 of cursor messages load_sales.msg insert into ds1.sales_stage;</span></em></p>
<p>So what if you have to load data from another database (same server or different server) ?  First you need to catalog the remote database on the server and then you can declare a cursor for a remote database and then load using that cursor. Eg:<br />
Assuming you have cataloged the source database on the target server as srcdb</p>
<p><em><span style="color: #ff9900;">connect to targetdb;</span></em><br />
<em><span style="color: #ff9900;">declare c1 cursor database srcdb user user1 using secretpass for select * from ps1.sales;</span></em><br />
<em><span style="color: #ff9900;">load from c1 of cursor messages load_sales.msg insert into ds1.sales_stage nonrecoverable;</span></em></p>
<p>This will load the data on table ps1.sales from the srcdb to ds1.sales_stage on the targetdb eliminating a file extract and then a load from the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1270</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up database mail in SQL server</title>
		<link>http://techsatwork.com/blog/?p=1250</link>
		<comments>http://techsatwork.com/blog/?p=1250#comments</comments>
		<pubDate>Thu, 29 Sep 2011 12:46:35 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[configure database mail]]></category>
		<category><![CDATA[configure sql server mail]]></category>
		<category><![CDATA[database mail]]></category>
		<category><![CDATA[emailing from sql server]]></category>
		<category><![CDATA[emailing from your database]]></category>
		<category><![CDATA[sending emails from sql server]]></category>
		<category><![CDATA[setting up database mail]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Agent emails]]></category>
		<category><![CDATA[sql server email]]></category>
		<category><![CDATA[sql server job failure notifications]]></category>
		<category><![CDATA[sql server notifications]]></category>
		<category><![CDATA[SQLMail]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1250</guid>
		<description><![CDATA[Wouldn&#8217;t it be cool if your database server reached out to you when it wants to let you know something like a job that completed or failed and error messages its getting ? SQL Server has two built-in ways to &#8230; <a href="http://techsatwork.com/blog/?p=1250">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wouldn&#8217;t it be cool if your database server reached out to you when it wants to let you know something like a job that completed or failed and error messages its getting ? SQL Server has two built-in ways to do it: SQLMail and Database Mail. SQLmail is the old way to do it and would require you to install Outlook components on the database server. I personally like database mail since its all nice and tightly integrated with sql server. Unlike SQLMail, database mail is cluster aware and does not stress the database server as it runs outside of the database engine.<br />
Database Mail in SQL Server is pretty robust yet easy to setup. Few weeks ago I wrote an article on how to <a href="http://techsatwork.com/blog/?p=1144" target="_blank">send emails from db2</a>.  In this , I am going to show you how to configure database mail in sql server, create an operator and have sql server agent send out notifications.  Once configured SQL Server Agent can either send you emails or page you for agent jobs or for alerts from the sql server itself.<br />
Here is a video that I created to show you how to accomplish this :</p>
<p><iframe src="http://www.youtube.com/embed/pRMdmxvO7sE?hd=1" frameborder="0" width="640" height="480"></iframe></p>
<p><span style="color: #ff9900;"><sub><em>* If the video is not clear please change the resolution on the youtube video to 1080p and view it full screen.</em></sub></span></p>
<p>Things to remember is :</p>
<p>1. You need database mail configured with an smtp server that the sql server can reach.<br />
2. Setup Operator(s) for the SQL Server Agent to use for notification<br />
3. Enable Mail Session on SQL Server Agent&#8217;s Alert System.<br />
4. Enable notification on SQL Server Agent jobs to use the appropriate Operator profiles to send out emails.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1250</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Azure Clouds bringing database showers</title>
		<link>http://techsatwork.com/blog/?p=1212</link>
		<comments>http://techsatwork.com/blog/?p=1212#comments</comments>
		<pubDate>Sun, 11 Sep 2011 06:01:53 +0000</pubDate>
		<dc:creator>rpillai</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[create sql azure database]]></category>
		<category><![CDATA[database on cloud]]></category>
		<category><![CDATA[how to create sql azure database]]></category>
		<category><![CDATA[microsoft cloud]]></category>
		<category><![CDATA[pay as your go database]]></category>
		<category><![CDATA[sql azure]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[windows azure]]></category>

		<guid isPermaLink="false">http://techsatwork.com/blog/?p=1212</guid>
		<description><![CDATA[My previous post talked about cloud in general. Here I like to talk about databases on the cloud. Just like emails, documents, CRMs and so on cloud computing providers has made database engines available on the cloud as part of SaaS. &#8230; <a href="http://techsatwork.com/blog/?p=1212">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://techsatwork.com/blog/?p=1190">previous post</a> talked about cloud in general. Here I like to talk about databases on the cloud. Just like emails, documents, CRMs and so on cloud computing providers has made database engines available on the cloud as part of SaaS.  Now you don&#8217;t have to have a separate server running database engines to support your applications.  No more waiting on system administrators and database administrators to setup database servers and allocate databases. With a press of couple of buttons and in few minutes a new database environment can be made available.</p>
<p><a href="http://www.microsoft.com/windowsazure/sqlazure/">Microsoft SQL Azure</a> is one such database that is on the cloud.  Microsoft has made avalaible their proud SQL Server as part of your windows azure cloud offering.  With SQL Azure, you can create your own SQL server instances and databases for your applications. It can be accessed by other application fabric either on the cloud or from your own internal infrastructure.  Microsoft has two different versions of the SQL Server on the Azure platform : Web and Business.  Each of those again come in different sizes and options.  You can manage the sql server instance either via the <a href="http://windows.azure.com/">management portal</a> or from your favorite SQL Server management tool.   The <a href="http://www.microsoft.com/windowsazure/pricing/">cost</a> is based on the usage of their windows azure usage.  There is a nice little<a href="http://www.microsoft.com/windowsazure/pricing-calculator/"> price estimator</a> that you use to determine how much it might cost you.</p>
<p>In this video I will walk you through on how to setup a free trial SQL Azure account and create your first SQL Azure database :</p>
<p><object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/M4plJe1SwAc?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/M4plJe1SwAc?version=3" type="application/x-shockwave-flash" width="640" height="505" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Apart from the above video Microsoft also has <a href="http://www.microsoft.com/windowsazure/videos/">few videos</a> that will give you in-depth knowledge of Windows and SQL Azure.</p>
]]></content:encoded>
			<wfw:commentRss>http://techsatwork.com/blog/?feed=rss2&#038;p=1212</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

