<?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-851395547916017363</id><updated>2011-11-27T15:46:07.123-08:00</updated><category term='IBM DB2'/><category term='MS SQL Server'/><title type='text'>RATHEESH K NAIR</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rknairblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rknairblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>R.K.Nair</name><uri>http://www.blogger.com/profile/13916752870489217925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_IH0C9WcxhaQ/S_NuU4siP9I/AAAAAAAAEFc/g65ZlqcDesc/S220/B2_bomber3.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-851395547916017363.post-358160427976846823</id><published>2010-07-18T22:57:00.000-07:00</published><updated>2010-07-18T22:57:37.542-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS SQL Server'/><title type='text'>SQL Server Page Verification</title><content type='html'>You know how SQL server checks whether the page is good or corrupted? &lt;br /&gt;&lt;br /&gt;There are two ways by which SQL Server finds the corrupted page:Torn Page Detection and Checksum. &lt;br /&gt;&lt;br /&gt;Checksum is a new type of page verification introduced in SQL Server 2005 which offers better corruption checking than torn page detection.This is why when we create a new database in SQL Server 2005 or 2008 the checksum option is turned on by default. &lt;br /&gt;&lt;br /&gt;What Checksum do? &lt;br /&gt;For a database with checksum ON SQL Server computes the checksum of the page both when a page is written and when a page is read. The SQL Server computes the checksum based on the bit pattern on the page, stores it in the page header and then issues an I/O to write the page. When the SQL Server reads the page, it re-computes the checksum using the same logic and then compares it with the value available in the page header. If the checksum value matches then it is assumes the page did not get corrupted during the write-read cycle.Keep in mind that checksum is not 100% accurate and there are cases when corruption remains undetected even if you have checksum enabled.&lt;br /&gt;&lt;br /&gt; How Torn Page Detection works? &lt;br /&gt;Torn page detection on the other hand does a different type of page verification in which it writes a bit for every 512 byte of a page. This will help you in finding whether the page has been succesfully written or not but it cant tell you whether the data you have written is correct or not. We can use the same checksum for verifying backup.This will give added protection for backup. &lt;br /&gt;&lt;br /&gt;How to enable page verification? &lt;br /&gt;--CHECKSUM &lt;br /&gt;ALTER DATABASE RKN set PAGE_VERIFY CHECKSUM &lt;br /&gt;&lt;br /&gt;--TORN PAGE DETECTION &lt;br /&gt;ALTER DATABASE RKN SET PAGE_VERIFY TORN_PAGE_DETECTION&lt;br /&gt;&lt;br /&gt;You can also change the page verify option using GUI&lt;br /&gt;DATABASE PROPERTIES--&gt;OPTIONS--&gt;PAGE VERIFY Here you can select the type of page verification you want.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/851395547916017363-358160427976846823?l=rknairblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rknairblog.blogspot.com/feeds/358160427976846823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rknairblog.blogspot.com/2010/07/sql-server-page-verification.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/358160427976846823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/358160427976846823'/><link rel='alternate' type='text/html' href='http://rknairblog.blogspot.com/2010/07/sql-server-page-verification.html' title='SQL Server Page Verification'/><author><name>R.K.Nair</name><uri>http://www.blogger.com/profile/13916752870489217925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_IH0C9WcxhaQ/S_NuU4siP9I/AAAAAAAAEFc/g65ZlqcDesc/S220/B2_bomber3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-851395547916017363.post-5081802706637595349</id><published>2010-07-12T22:25:00.000-07:00</published><updated>2010-07-12T22:25:17.049-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IBM DB2'/><title type='text'>LOCKS in DB2</title><content type='html'>I found it not as easy as SQL Server to manage DB2 servers when it comes to administration.&lt;br /&gt;&lt;br /&gt;Here I am briefing on how to find the locks on DB2 and how to configure the configuration manager so that we can capture the locks.&lt;br /&gt;&lt;br /&gt; First we need to update the database manager for configuration to change the parameter DFT_MON_LOCK to ON.&lt;br /&gt;&lt;br /&gt;UPDATE DATABASE MANAGER CONFIGURATION USING DFT_MON_LOCK ON&lt;br /&gt;&lt;br /&gt;Then we need to update the monitor switches so that we can view the locks&lt;br /&gt;&lt;br /&gt;UPDATE MONITOR SWITCHES USING LOCK ON&lt;br /&gt;The above command will help you in updating the monitor switch.&lt;br /&gt;&lt;br /&gt;Now we have all set so that we can check the locks on particular database.&lt;br /&gt;&lt;br /&gt;GET SNAPSHOT FOR LOCKS ON DB_NAME will give us the list of all locks currently on that particular database.&lt;br /&gt;&lt;br /&gt;We can kill the process by using the command&lt;br /&gt;&lt;br /&gt;FORCE APPLICATION(APPLICATION_HANDLE)&lt;br /&gt;APPLICATION_HANDLE is a unique number which we will get when we check the lock using GET SNAPSHOT FOR LOCKS ON DB_NAME along with the object name causing lock.&lt;br /&gt;&lt;br /&gt;FORCE APPLICATION ALL will kill all the process on the particular database where we executing the command.&lt;br /&gt;&lt;br /&gt;Here comes a handy script for viewing locks.This is very helpful as it gives a detailed information on application connecting,IP address,Victim etc.&lt;br /&gt;&lt;br /&gt;--SCRIPT TO VIEW LOCKS&lt;br /&gt;Select substr(ai.appl_name,1,10) as Application,&lt;br /&gt;substr(ai.primary_auth_id,1,10) as AuthID,&lt;br /&gt;int(ap.locks_held) as "# Locks",&lt;br /&gt;int(ap.lock_escals) as "Escalations",&lt;br /&gt;int(ap.lock_timeouts) as "Lock Timeouts",&lt;br /&gt;int(ap.deadlocks) as "Deadlocks",&lt;br /&gt;int(ap.int_deadlock_rollbacks) as "Dlock Victim",&lt;br /&gt;substr(inbound_comm_address,1,15) as "IP Address"&lt;br /&gt;from sysibmadm.snapappl ap, sysibmadm.snapappl_info ai&lt;br /&gt;where ap.agent_id = ai.agent_id&lt;br /&gt;;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/851395547916017363-5081802706637595349?l=rknairblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rknairblog.blogspot.com/feeds/5081802706637595349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rknairblog.blogspot.com/2010/07/locks-in-db2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/5081802706637595349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/5081802706637595349'/><link rel='alternate' type='text/html' href='http://rknairblog.blogspot.com/2010/07/locks-in-db2.html' title='LOCKS in DB2'/><author><name>R.K.Nair</name><uri>http://www.blogger.com/profile/13916752870489217925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_IH0C9WcxhaQ/S_NuU4siP9I/AAAAAAAAEFc/g65ZlqcDesc/S220/B2_bomber3.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-851395547916017363.post-1897431533755018915</id><published>2010-06-18T05:30:00.000-07:00</published><updated>2010-07-12T21:55:35.054-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS SQL Server'/><title type='text'>Symmetric Key Encryption</title><content type='html'>Symmetric Key Encryption&lt;br /&gt;In a symmetric key algorithm, there is but one key. That same key is used to encrypt the data and decrypt, the data. If someone were to get possession of the key, that person could take anything you've encrypted, and decrypt it immediately.&lt;br /&gt;&lt;br /&gt;Advantages&lt;br /&gt;Symmetric key encryption is known to be faster and stronger than their asymmetric counterpart. It uses less overhead on system resources. For simple encryption this is the best way.&lt;br /&gt;When a symmetric key is created, the symmetric key must be encrypted by using at least one of the following: certificate, password, symmetric key, asymmetric key, or PROVIDER. The key can have more than one encryption of each type. In other words, a single symmetric key can be encrypted by using multiple certificates, passwords, symmetric keys, and asymmetric keys at the same time&lt;br /&gt;Here I am going to explain the simplest way of encrypting data in a database, i.e. Symmetric Key Encryption with Password&lt;br /&gt;Symmetric Key Encryption with Password&lt;br /&gt;Using this method is very simple and can be used if we want to encrypt data in whole column.&lt;br /&gt;The simple example below will help you understand.&lt;br /&gt;USE master&lt;br /&gt;GO&lt;br /&gt;CREATE DATABASE RKN_Test&lt;br /&gt;ON PRIMARY ( NAME = N'RKN_Test', FILENAME = N'D:\RKN_Test.mdf')—Any Path you prefer&lt;br /&gt;LOG ON ( NAME = N'RKN_Test_log', FILENAME = N'D:\RKN_Test_log.ldf')&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;Master key is used to encrypt the Certificates and Keys in a database.&lt;br /&gt;Passwords should meet windows password policy if you have set any.&lt;br /&gt;&lt;br /&gt;USE RKN_Test&lt;br /&gt;GO&lt;br /&gt;CREATE MASTER KEY ENCRYPTION&lt;br /&gt;BY PASSWORD = 'RKN@123'&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;We can use many types of algorithm while creating Symmetric keys like DES, TRIPLE_DES, TRIPLE_DES_3KEY, AES_128, AES_192, AES_256 etc.Please be careful while choosing the encryption algorithm.&lt;br /&gt;&lt;br /&gt;USE RKN_Test&lt;br /&gt;GO&lt;br /&gt;CREATE SYMMETRIC KEY RKN_TableKey&lt;br /&gt;WITH ALGORITHM = TRIPLE_DES &lt;br /&gt;ENCRYPTION BY PASSWORD='Passw0rd1'&lt;br /&gt;&lt;br /&gt;USE RKN_Test&lt;br /&gt;GO&lt;br /&gt;CREATE TABLE TestTable (FirstCol INT, SecondCol VARBINARY(256))&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;SELECT * FROM TestTable&lt;br /&gt;&lt;br /&gt;USE RKN_Test&lt;br /&gt;GO&lt;br /&gt;OPEN SYMMETRIC KEY RKN_TableKey DECRYPTION&lt;br /&gt;BY PASSWORD='Passw0rd1'&lt;br /&gt;INSERT INTO TestTable VALUES (1,&lt;br /&gt;ENCRYPTBYKEY(KEY_GUID('RKN_TableKey'),'Testing'))&lt;br /&gt;GO&lt;br /&gt;CLOSE SYMMETRIC KEY RKN_TableKey&lt;br /&gt;&lt;br /&gt;USE RKN_Test&lt;br /&gt;GO&lt;br /&gt;OPEN SYMMETRIC KEY RKN_TableKey DECRYPTION&lt;br /&gt;BY PASSWORD='Passw0rd1'&lt;br /&gt;SELECT FirstCol,CONVERT(VARCHAR(50),DECRYPTBYKEY(SecondCol)) AS DecryptedValue&lt;br /&gt;FROM TestTable&lt;br /&gt;GO&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/851395547916017363-1897431533755018915?l=rknairblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rknairblog.blogspot.com/feeds/1897431533755018915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rknairblog.blogspot.com/2010/06/symmetric-key-encryption.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/1897431533755018915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/1897431533755018915'/><link rel='alternate' type='text/html' href='http://rknairblog.blogspot.com/2010/06/symmetric-key-encryption.html' title='Symmetric Key Encryption'/><author><name>R.K.Nair</name><uri>http://www.blogger.com/profile/13916752870489217925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_IH0C9WcxhaQ/S_NuU4siP9I/AAAAAAAAEFc/g65ZlqcDesc/S220/B2_bomber3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-851395547916017363.post-6837503008077404154</id><published>2010-05-18T22:44:00.000-07:00</published><updated>2010-07-12T23:33:10.162-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS SQL Server'/><title type='text'>SSIS DEPLOYMENT</title><content type='html'>SSIS Packages can be deployed in 2 ways&lt;br /&gt;1. File System Deployment&lt;br /&gt;2. SQL Server Deployment&lt;br /&gt;File System Deployment&lt;br /&gt;This will install SSIS package and their dependencies to the specified folder in the file system.&lt;br /&gt;SQL Server Deployment&lt;br /&gt;This installs the SSIS package in SQL Server. This option is typically used if you use SQL Server for sharing SSIS packages between Servers. Package dependencies will be installed in a folder in the file system.&lt;br /&gt;File System Deployment&lt;br /&gt;Double Click the file having .SSISDeploymentManifest extension automatically takes to package installation wizard.&lt;br /&gt;&lt;br /&gt;Click Next&lt;br /&gt;&lt;br /&gt;Here we can choose the type of deployment. There is check box available in this page which enables us to validate the package after installation&lt;br /&gt;Going ahead with File system Deployment takes you to a page where we can specify the location on which package to be installed&lt;br /&gt;&lt;br /&gt;By default the location is Program Files\Microsoft SQL Server\100\DTS\Packages\Package_Name&lt;br /&gt;We can change the location using browse button provided.&lt;br /&gt;Click NEXT will take you to a confirm installation page&lt;br /&gt;&lt;br /&gt;Click NEXT shows Finish installation page which contains the summary &lt;br /&gt;-------------------------&lt;br /&gt;SQL Server Deployment&lt;br /&gt;&lt;br /&gt;Select SQL Server Deployment in wizard, click next&lt;br /&gt;&lt;br /&gt;Give preferred authentication (Windows or SQL Server)&lt;br /&gt;Entering proper username and password enables the browse button for selecting the package location.&lt;br /&gt;&lt;br /&gt;Select the location to which the package has to be saved and click OK.&lt;br /&gt;&lt;br /&gt;Click NEXT&lt;br /&gt;&lt;br /&gt;Select the folder for installing the package dependencies and then click NEXT&lt;br /&gt;After confirm installation page click NEXT&lt;br /&gt;&lt;br /&gt;Click Finish.&lt;br /&gt;Thus your package is saved in SQL Server.&lt;br /&gt;You can view the package by connecting to SQL Server Integration service, expand stored packageMSDBspecific folder on which the package have been installed&lt;br /&gt;&lt;br /&gt;NB:I am not able to paste the images of every step which I create for SSIS deployment steps&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/851395547916017363-6837503008077404154?l=rknairblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rknairblog.blogspot.com/feeds/6837503008077404154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rknairblog.blogspot.com/2010/05/ssis-deployement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/6837503008077404154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/6837503008077404154'/><link rel='alternate' type='text/html' href='http://rknairblog.blogspot.com/2010/05/ssis-deployement.html' title='SSIS DEPLOYMENT'/><author><name>R.K.Nair</name><uri>http://www.blogger.com/profile/13916752870489217925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_IH0C9WcxhaQ/S_NuU4siP9I/AAAAAAAAEFc/g65ZlqcDesc/S220/B2_bomber3.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-851395547916017363.post-6312055691953617191</id><published>2010-05-18T20:57:00.001-07:00</published><updated>2010-05-31T00:50:59.755-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS SQL Server'/><title type='text'>can Truncate Rolled back??</title><content type='html'>This is my very first blog and I got the inspiration to start only because of misunderstanding that exists on truncate command.&lt;br /&gt;The question is can we rollback Truncate?&lt;br /&gt;In many webistes and forums I found the answer to be a big NO and I know many who reading this blog have the same mind set.&lt;br /&gt;The exact answer to the question is YES..Amazed??&lt;br /&gt;we can verify the same by simple scripts&lt;br /&gt;Just create a simple table insert some values truncate that and run rollback.&lt;br /&gt;USE RKN&lt;br /&gt;CREATE TABLE TEST(NAME CHAR('10'))&lt;br /&gt;SELECT * FROM TEST&lt;br /&gt;This will give an empty result&lt;br /&gt;INSERT INTO TEST VALUES('RKNAIR')&lt;br /&gt;GO 1000&lt;br /&gt;Will insert 1000 records&lt;br /&gt;Now I am truncating the table&lt;br /&gt;BEGIN TRAN&lt;br /&gt;TRUNCATE TABLE TEST&lt;br /&gt;We can cross check whether the table got truncated by selecting the whole table.&lt;br /&gt;SELECT * FROM TEST&lt;br /&gt;This will give empty result as expected.&lt;br /&gt;Now execute the rollback command&lt;br /&gt;ROLLBACK&lt;br /&gt;We can check the roll back worked by again issusing the select.&lt;br /&gt;SELECT * FROM TEST&lt;br /&gt;&lt;span style="color: red; font-size: 130%;"&gt;&lt;strong&gt;AMAZED????? :-)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Yes we can rollback Truncate.&lt;br /&gt;Many believe truncate that truncate is a no logged operation which is far from truth. Truncate is MINIMALLY LOGGED and can be rolled back.&lt;br /&gt;Hope this will help.&lt;br /&gt;&lt;br /&gt;Please post your comments .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/851395547916017363-6312055691953617191?l=rknairblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rknairblog.blogspot.com/feeds/6312055691953617191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rknairblog.blogspot.com/2010/05/can-truncate-rolled-back.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/6312055691953617191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/851395547916017363/posts/default/6312055691953617191'/><link rel='alternate' type='text/html' href='http://rknairblog.blogspot.com/2010/05/can-truncate-rolled-back.html' title='can Truncate Rolled back??'/><author><name>R.K.Nair</name><uri>http://www.blogger.com/profile/13916752870489217925</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_IH0C9WcxhaQ/S_NuU4siP9I/AAAAAAAAEFc/g65ZlqcDesc/S220/B2_bomber3.jpg'/></author><thr:total>3</thr:total></entry></feed>
