<?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"
	>

<channel>
	<title>Ravi Khanal</title>
	<atom:link href="http://ravikhanal.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ravikhanal.com</link>
	<description>Just another nerd</description>
	<pubDate>Sat, 18 Jul 2009 20:27:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>List of DMV in SQL Server 2005 and 2008</title>
		<link>http://ravikhanal.com/list-of-dmv-in-sql-server-2005-and-2008/</link>
		<comments>http://ravikhanal.com/list-of-dmv-in-sql-server-2005-and-2008/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 04:18:27 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[SQL Server 2005]]></category>

		<category><![CDATA[SQL Server 2008]]></category>

		<category><![CDATA[DMV]]></category>

		<category><![CDATA[Dynamic Management View]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=440</guid>
		<description><![CDATA[Dynamic Management Views(DMVs) are system views that surface the internal counters of the database engine and help present an easily comprehendible dashboard of the database engine performance that can be used to monitor the health of a server instance, diagnose problems, and tune performance.
List of DMV in SQL Server 2005
1. sys.dm_broker_activated_tasks
2. sys.dm_broker_connections
3. sys.dm_broker_forwarded_messages
4. sys.dm_broker_queue_monitors
5. sys.dm_clr_appdomains
6. [...]]]></description>
			<content:encoded><![CDATA[<p>Dynamic Management Views(DMVs) are system views that surface the internal counters of the database engine and help present an easily comprehendible dashboard of the database engine performance that can be used to monitor the health of a server instance, diagnose problems, and tune performance.</p>
<p><strong>List of DMV in SQL Server 2005</strong></p>
<p>1. sys.dm_broker_activated_tasks<br />
2. sys.dm_broker_connections<br />
3. sys.dm_broker_forwarded_messages<br />
4. sys.dm_broker_queue_monitors<br />
5. sys.dm_clr_appdomains<br />
6. sys.dm_clr_loaded_assemblies<br />
7. sys.dm_clr_properties<br />
8. sys.dm_clr_tasks<br />
9. sys.dm_db_file_space_usage<br />
10. sys.dm_db_index_usage_stats<br />
11. sys.dm_db_mirroring_connections<br />
12. sys.dm_db_missing_index_details<br />
13. sys.dm_db_missing_index_group_stats<br />
14. sys.dm_db_missing_index_groups<br />
15. sys.dm_db_partition_stats<br />
16. sys.dm_db_session_space_usage<br />
17. sys.dm_db_task_space_usage<br />
18. sys.dm_exec_background_job_queue<br />
19. sys.dm_exec_background_job_queue_stats<br />
20. sys.dm_exec_cached_plans<br />
21. sys.dm_exec_connections<br />
22. sys.dm_exec_query_memory_grants<br />
23. sys.dm_exec_query_optimizer_info<br />
24. sys.dm_exec_query_resource_semaphores<br />
25. sys.dm_exec_query_stats<br />
26. sys.dm_exec_query_transformation_stats<br />
27. sys.dm_exec_requests<br />
28. sys.dm_exec_sessions<br />
29. sys.dm_fts_active_catalogs<br />
30. sys.dm_fts_index_population<br />
31. sys.dm_fts_memory_buffers<br />
32. sys.dm_fts_memory_pools<br />
33. sys.dm_fts_population_ranges<br />
34. sys.dm_io_backup_tapes<br />
35. sys.dm_io_cluster_shared_drives<br />
36. sys.dm_io_pending_io_requests<br />
37. sys.dm_os_buffer_descriptors<br />
38. sys.dm_os_child_instances<br />
39. sys.dm_os_cluster_nodes<br />
40. sys.dm_os_hosts<br />
41. sys.dm_os_latch_stats<br />
42. sys.dm_os_loaded_modules<br />
43. sys.dm_os_memory_allocations<br />
44. sys.dm_os_memory_cache_clock_hands<br />
45. sys.dm_os_memory_cache_counters<br />
46. sys.dm_os_memory_cache_entries<br />
47. sys.dm_os_memory_cache_hash_tables<br />
48. sys.dm_os_memory_clerks<br />
49. sys.dm_os_memory_objects<br />
50. sys.dm_os_memory_pools<br />
51. sys.dm_os_performance_counters<br />
52. sys.dm_os_ring_buffers<br />
53. sys.dm_os_schedulers<br />
54. sys.dm_os_stacks<br />
55. sys.dm_os_sublatches<br />
56. sys.dm_os_sys_info<br />
57. sys.dm_os_tasks<br />
58. sys.dm_os_threads<br />
59. sys.dm_os_virtual_address_dump<br />
60. sys.dm_os_wait_stats<br />
61. sys.dm_os_waiting_tasks<br />
62. sys.dm_os_worker_local_storage<br />
63. sys.dm_os_workers<br />
64. sys.dm_qn_subscriptions<br />
65. sys.dm_repl_articles<br />
66. sys.dm_repl_schemas<br />
67. sys.dm_repl_tranhash<br />
68. sys.dm_repl_traninfo<br />
69. sys.dm_tran_active_snapshot_database_transactions<br />
70. sys.dm_tran_active_transactions<br />
71. sys.dm_tran_current_snapshot<br />
72. sys.dm_tran_current_transaction<br />
73. sys.dm_tran_database_transactions<br />
74. sys.dm_tran_tran_locks<br />
75. sys.dm_tran_session_transactions<br />
76. sys.dm_tran_top_version_generators<br />
77. sys.dm_tran_transactions_snapshot<br />
78. sys.dm_tran_version_store</p>
<p><strong>New DMV in SQL Server 2008</strong><br />
1. sys.dm_audit_actions<br />
2. sys.dm_audit_class_type_map<br />
3. sys.dm_cdc_errors<br />
4. sys.dm_cdc_log_scan_sessions<br />
5. sys.dm_cryptographic_provider_properties<br />
6. sys.dm_database_encryption_keys<br />
7. sys.dm_db_mirroring_auto_page_repair<br />
8. sys.dm_db_mirroring_past_actions<br />
9. sys.dm_db_persisted_sku_features<br />
10. sys.dm_db_script_level<br />
11. sys.dm_exec_procedure_stats<br />
12. sys.dm_exec_trigger_stats<br />
13. sys.dm_filestream_file_io_handles<br />
14. sys.dm_filestream_file_io_requests<br />
15. sys.dm_fts_fdhosts<br />
16. sys.dm_fts_outstanding_batches<br />
17. sys.dm_os_dispatcher_pools<br />
18. sys.dm_os_dispatchers<br />
19. sys.dm_os_memory_brokers<br />
20. sys.dm_os_memory_node_access_stats<br />
21. sys.dm_os_memory_nodes<br />
22. sys.dm_os_nodes<br />
23. sys.dm_os_process_memory<br />
24. sys.dm_os_spinlock_stacks<br />
25. sys.dm_os_sys_memory<br />
26. sys.dm_resource_governor_configuration<br />
27. sys.dm_resource_governor_resource_pools<br />
28. sys.dm_resource_governor_workload_groups<br />
29. sys.dm_server_audit_status<br />
30. sys.dm_tran_commit_table<br />
31. sys.dm_xe_map_values<br />
32. sys.dm_xe_object_columns<br />
33. sys.dm_xe_objects<br />
34. sys.dm_xe_packages<br />
35. sys.dm_xe_session_event_actions<br />
36. sys.dm_xe_session_events<br />
37. sys.dm_xe_session_object_columns<br />
38. sys.dm_xe_session_targets<br />
39. sys.dm_xe_sessions</p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/list-of-dmv-in-sql-server-2005-and-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to migrate DTS Package into SSIS 2008 package</title>
		<link>http://ravikhanal.com/migrate-dts-package-to-ssis-2008/</link>
		<comments>http://ravikhanal.com/migrate-dts-package-to-ssis-2008/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 21:41:18 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[SQL Server 2008]]></category>

		<category><![CDATA[DTS]]></category>

		<category><![CDATA[Migration]]></category>

		<category><![CDATA[Package]]></category>

		<category><![CDATA[SQL Server 2000]]></category>

		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=373</guid>
		<description><![CDATA[If You are planning to migrate DTS Package of SQL Server 2000 to SQL Server 2008&#8217;s SSIS Package then first open the Sql Server Management Studio. Connect to the database engine and open the Migration Wizard as shown in the image.


 


I have my DTS package on my File System, so I am choosing Structured Storage File. [...]]]></description>
			<content:encoded><![CDATA[<p>If You are planning to migrate DTS Package of SQL Server 2000 to SQL Server 2008&#8217;s SSIS Package then first open the Sql Server Management Studio. Connect to the database engine and open the Migration Wizard as shown in the image.<a href="http://ravikhanal.com/wp-content/uploads/2009/01/dts_2.jpg"></a></p>
<p><img class="size-medium wp-image-377 alignleft" style="text-decoration: underline;" title="dts_1" src="http://ravikhanal.com/wp-content/uploads/2009/01/dts_1-274x300.jpg" alt="" width="274" height="300" /></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2009/01/dts_2.jpg"><img class="alignnone size-medium wp-image-378" title="dts_2" src="http://ravikhanal.com/wp-content/uploads/2009/01/dts_2-300x289.jpg" alt="" width="364" height="300" /></a></p>
<p> </p>
<p><span id="more-373"></span></p>
<p style="text-align: center;"><a href="http://ravikhanal.com/wp-content/uploads/2009/01/dts_3.jpg"><img class="size-medium wp-image-379 aligncenter" title="dts_3" src="http://ravikhanal.com/wp-content/uploads/2009/01/dts_3-300x291.jpg" alt="" width="242" height="235" /></a></p>
<p>I have my DTS package on my File System, so I am choosing Structured Storage File. If you have your DTS Package on the Database then you can choose the Source as SQL Server.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p style="text-align: center;"> </p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2009/01/dts_4.jpg"><img class="size-medium wp-image-380 aligncenter" title="dts_4" src="http://ravikhanal.com/wp-content/uploads/2009/01/dts_4-300x295.jpg" alt="" width="240" height="236" /></a></p>
<p>Then You have to choose the destination. In my case again I am using DTSX file as my destination.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"><a href="http://ravikhanal.com/wp-content/uploads/2009/01/dts_5.jpg"><img class="size-medium wp-image-381 aligncenter" title="dts_5" src="http://ravikhanal.com/wp-content/uploads/2009/01/dts_5-300x290.jpg" alt="" width="240" height="232" /></a></p>
<p>Then you can choose the package and edit the destination package name.</p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"><a style="text-decoration: none;" href="http://ravikhanal.com/wp-content/uploads/2009/01/dts_6.jpg"><img class="size-medium wp-image-382 aligncenter" title="dts_6" src="http://ravikhanal.com/wp-content/uploads/2009/01/dts_6-300x291.jpg" alt="" width="240" height="233" /></a></p>
<p>Then you can specify the log file.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>Then the Package Migration is completed.</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2009/01/dts_7.jpg"><img class="alignnone size-medium wp-image-383" title="dts_7" src="http://ravikhanal.com/wp-content/uploads/2009/01/dts_7-300x289.jpg" alt="" width="300" height="289" /></a><a href="http://ravikhanal.com/wp-content/uploads/2009/01/dts_8.jpg"><img class="alignnone size-medium wp-image-384" title="dts_8" src="http://ravikhanal.com/wp-content/uploads/2009/01/dts_8-300x295.jpg" alt="" width="300" height="295" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/migrate-dts-package-to-ssis-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>10 Technology Forecast for the year 2009</title>
		<link>http://ravikhanal.com/10-technology-forecast-for-the-year-2009/</link>
		<comments>http://ravikhanal.com/10-technology-forecast-for-the-year-2009/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 20:42:29 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[2009]]></category>

		<category><![CDATA[forecast]]></category>

		<category><![CDATA[Prediction]]></category>

		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=363</guid>
		<description><![CDATA[There would be lots of ups and downs in the world of technology in year 2009. Ten things that might happen in the year 2009 would be:
1. Google’s advertizing model will start facing problems:
Google will have some problems with their advertizing model in the year 2009 and advertisers would be less interested in Google’s ads. [...]]]></description>
			<content:encoded><![CDATA[<p>There would be lots of ups and downs in the world of technology in year 2009. Ten things that might happen in the year 2009 would be:</p>
<p>1. Google’s advertizing model will start facing problems:<br />
Google will have some problems with their advertizing model in the year 2009 and advertisers would be less interested in Google’s ads. Google’s ad should not be context based but rather be user based. Google should read the mind of the user and display the ad, exactly what he is looking for. There should be more localization in the Google’s ads. Now a day people are not so much interested in the Google’s ads, so either Google has to change its advertizing model or it will start facing problems.</p>
<p>2. Microsoft will inch ahead due to Google’s loss of reputation:<br />
Year 2009 will be really bad for the Google. Google is acting as a spy and tracking all the data from cookies. Everybody will think twice before using Google. So the charm of Google is reducing day by day and it will slowly fall behind in the race against Microsoft.</p>
<p>3. Standards will evolve in the Clouds:<br />
Till now everybody has defined cloud according to their way. But in the year 2009, some standards will evolve in the clouds and there will be SLAs .</p>
<p><span id="more-363"></span></p>
<p>4. Amazon will appear as the next big thing after Microsoft and Google:<br />
Amazon has now everything and it will evolve as the next big thing after Microsoft and Google. Amazon’s Cloud will be the major success in the year 2009.</p>
<p>5. Virtual Societies will evolve on top of the social networking<br />
Social networking sites will be a downward spiral. Virtual Societies will evolve on the top of the social networking on the year 2009. People will start making virtual societies around them with the same kind of interest and website promoting these virtual societies will become the major highlight for the year 2009.</p>
<p>6. Research will happen on Image Search and Video Search:<br />
Till now we are having Image Search and Video Search only based on the text search associated with the Image and Video. But there would be research on Image Search and Video Search. Till now if the title of any videos is different then we could never get to the videos but if we have Video Search option available then this would be the milestone for stopping piracy on videos. So in the year 2009, big media companies will be sponsoring Universities to research on “Search based on Image and Video”.</p>
<p>7. Yahoo as a Company might be divided into several pieces.<br />
Yahoo as a Company might be divided into several pieces and Google will buy some part of it and Microsoft will buy some part of it. Microsoft will likely buy the search part of the yahoo. Google will buy the messenger of yahoo and combine with their gtalk.</p>
<p>8. Google will buy Mozilla:<br />
Due to and despite the modest success of the Chrome, Google will buy Mozilla to compete against the Internet Explorer.</p>
<p>9. Google App Engine will support Ruby<br />
Till now Google App Engine only supports Python but in the year 2009, it will also support Ruby.</p>
<p>10. Java will evolve through dynamic languages but the SUN will be in crisis<br />
Since Java is moving more towards the open source, Java will evolve through other dynamic languages but SUN will be in crisis.</p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/10-technology-forecast-for-the-year-2009/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Whats new with SQL Server 2008</title>
		<link>http://ravikhanal.com/whats-new-with-sql-server-2008/</link>
		<comments>http://ravikhanal.com/whats-new-with-sql-server-2008/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 04:03:34 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[SQL Server 2008]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=191</guid>
		<description><![CDATA[Improvement in Business Intelligence

Enterprise Reporting Engine

There are two major infrastructure changes for Reporting Services. Reporting Services enhances the processing engine and rendering extensions to enable new functionality, such as Tablix support, and scalability as well as remove the dependency on IIS. Additionally, new report designer and configuration tool are provided that improve usability and workflow [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Improvement in Business Intelligence</strong></p>
<ul>
<li><strong>Enterprise Reporting Engine</strong></li>
</ul>
<p>There are two major infrastructure changes for Reporting Services. Reporting Services enhances the processing engine and rendering extensions to enable new functionality, such as Tablix support, and scalability as well as remove the dependency on IIS. Additionally, new report designer and configuration tool are provided that improve usability and workflow for RS customers.</p>
<ul>
<li><strong>Analysis Services Time Series</strong></li>
</ul>
<p>This improvement adds a new time series forecasting algorithm (ARIMA: Auto Regressive Integrated Moving Average) to the data mining algorithm suite that provides more stable long term predictions.</p>
<p>In Data warehouses, spaces used to be always wasted due to the NULL values. Columns having lots of NULL value is actually allocating lots of space without storing any values. This problem has been taken care in SQL Server 2008 by the introduction of a sparse columns. This columns allows NULL values to be stored without taking any physical space on the disk.</p>
<p><strong>T-SQL Improvements</strong></p>
<p>Object Dependencies: The object dependencies improvement provides reliable discovery of dependencies between objects through newly introduced catalog view and dynamic management functions. Dependency information is always up-to-date for both schema-bound and non-schema-bound objects. Dependencies are tracked for stored procedures, tables, views, functions, triggers, user-defined types, XML schema-collections, and more.</p>
<p><span id="more-191"></span></p>
<p><strong>Performance Data Collection</strong><br />
Collect data from various sources in SQL Server and OS to help with performance troubleshooting and server maintenance. With this improvement, organizations improve their analysis of common performance issues:</p>
<ul>
<li> Define what data is collected and organize the collection into collection sets</li>
<li> Start/stop/manipulate collection sets programmatically (T-SQL and .NET API)</li>
<li> Define where data is stored (relational database)</li>
<li> View data through reports in SQL Server Management Studio.</li>
<li> Provide platform to plug in more data collectors in the future.</li>
</ul>
<p><strong>Extended Events</strong></p>
<p>SQL Server Extended Events is a general event-handling system for server systems. The Extended Events infrastructure supports the correlation of data from SQL Server, and under certain conditions, the correlation of data from the operating system and database applications. In the latter case, Extended Events output must be directed to Event Tracing for Windows (ETW) in order to correlate the event data with operating system or application event data.</p>
<p><strong>Database Mirroring Enhancements</strong><br />
SQL Server 2008 builds upon the momentum of SQL Server 2005 by providing a more reliable platform with enhanced database mirroring:</p>
<p>Automatic bad page repair – allows the principal and mirror machines to transparently recover from 823/824 types of data page errors by requesting a fresh copy of the corrupted page from the mirroring partner.</p>
<p>Log stream compression – compression of the outgoing log stream in order to minimize the network bandwidth used by database mirroring.</p>
<p><strong>Miscellaneous performance enhancements</strong>:<br />
using asynchronous log write requests on the mirror in order to shorten the log write time and thus speed-up the commit acknowledgement.</p>
<p>better utilization of the mirroring log send buffers in order to pack multiple smaller log blocks into a single network send.</p>
<p><strong>Supportability and diagnosability improvements:</strong><br />
additional performance counters to allow for more granular accounting of the time spent across the different stages of the DBM log processing.</p>
<p>new DMVs and extensions of existing views in order to expose additional information about the mirroring sessions.</p>
<p><strong>ORDPATH Improvement</strong><br />
ORDPATH improvement provides an important new functionality to our customers who use hierarchical data. It provides a superior way of modeling hierarchies in SQL Server by introducing the HierarchyID system data type and corresponding built-in methods which are designed to make it easier to store, query and operate hierarchical data. HierarchyID is also optimized for representing trees, the most common type of hierarchical data.</p>
<p><strong>Large User-Defined Types Improvement</strong><br />
Large user-defined types allows users to expand the size of defined data types by eliminating the 8‑KB limit.</p>
<p><strong>DATE/TIME Data Types</strong><br />
SQL Server 2008 introduces new date and time data types. The new data types enable applications to have separate date and time types, larger year ranges for date value, larger fractional seconds precision for time value, time-zone offset aware datetime type that containing date, time and time zone offset portion, user defined option on fractional seconds precision of time related types and datetime2 and datetimeoffset provide standards conformant semantics. Along with the T-SQL support on the new types, both native (ODBC, OLEDB) and managed (SqlClient) providers also provide the full support through the client driver APIs.</p>
<p><strong>Improved XML Support</strong><br />
To leverages the new date and time types, SQL Server’s XML Schema collection now provides full support for the xs:date, xs:time and xs:dateTime data types. Support for union types is also enhanced by returning correct results for “instance of” queries when union types are involved, and adding support for lists of unions and unions of lists constructs in XML Schemas.</p>
<p><strong>SSMS Improvement</strong><br />
SQL Server Management Studio(SSMS) has been improved a lot in SQL Server 2008. Most important improvement in SSMS 2008 are:</p>
<ul>
<li>Activity Monitor</li>
<li>Object Explorer Details</li>
<li>Object Search</li>
<li>Multi-server Queries</li>
<li>Intellisense added to the query Editor</li>
<li>T-SQL Debugger Added to the Query Editor</li>
</ul>
<div><strong>Backup Compression</strong></div>
<div>Backup Compression is one of the very important feature added in SQL Server 2008. It can be done by</div>
<pre>Backup Database test
to disk='C:\test\test1.bak'
with compression</pre>
<p><strong>Plan Freezing</strong></p>
<div>SQL Server 2008 enables high query performance, stability and predictability by providing new function to freeze the query plans.</div>
<p><strong>Data Compression</strong></p>
<div>SQL Server 2008 supports two types of data compressions. They are Row Compression and Page Compression. Row compression compresses the individual columns of a table. Page Compression compresses data pages using row, prefix, and dictionary compression.</div>
<p><strong>Hot-Add CPUs and Hot-Add Memory</strong></p>
<div>Hot-add CPUs is a feature available with 64 bit edition of SQL Server Enterprise edition which allows CPUs to be dynamically added to servers as needed without the need of shutting down the server or limiting client connections. Similarly Hot-add Memory allows memory to be dynamically added to the servers without any downtime</div>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/whats-new-with-sql-server-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Synchronize Logins and manage Orphaned Users</title>
		<link>http://ravikhanal.com/how-to-manage-orphaned-user/</link>
		<comments>http://ravikhanal.com/how-to-manage-orphaned-user/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 06:52:13 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[SQL Server 2005]]></category>

		<category><![CDATA[Logins]]></category>

		<category><![CDATA[orphan user]]></category>

		<category><![CDATA[SSIS]]></category>

		<category><![CDATA[synchronization]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=286</guid>
		<description><![CDATA[Database movement between servers is one of the common task for the DBA. But when the database is moved from one server to another or from one instance to other, the logins do not get transferred. So as a DBA you have to manually transfer the logins to remove this problem.
So let&#8217;s discuss what is the [...]]]></description>
			<content:encoded><![CDATA[<p>Database movement between servers is one of the common task for the DBA. But when the database is moved from one server to another or from one instance to other, the logins do not get transferred. So as a DBA you have to manually transfer the logins to remove this problem.</p>
<p>So let&#8217;s discuss what is the cause behind this. SQL Server logins are stored in the master database and they are mapped against individual databases. The Login informations on SQL Server 2005 are visible through sys.server_principals system catalog view and the sys.logins view. The mapping information of the database user is stored in the sysusers system table. This table includes the name of the database user and the SID of the corresponding SQL Server Login. The SID is the security identifier and SID tracks the logins throughout the entire systems.</p>
<p>So when we move or copy our database from one server to another or from one instance to another then the windows login will have the same SID but the SQL logins may have the different SIDs. So when the SID of the new server instance and the older instance doesn&#8217;t matches we have a Orphaned User.</p>
<p><span id="more-286"></span></p>
<p>So if you are copying or moving a database from one server to another, then you should follow these steps:</p>
<ol>
<li>Backup the source database.</li>
<li>Create the logins on the destination server.</li>
<li>Restore the database on the destination server.</li>
<li>Synchronize logins if not completed in step 2.</li>
</ol>
<div>So if you have windows login at the source then you just need to make exact same windows login in the destination. There is no need of synchronizing the logins for the windows login.</div>
<div>So now lets discuss how to deal with the orphaned user for SQL Login. Let us suppose in our source database we have login like john, dave and lisa. </div>
<div>So when we copy database to the new server then these users will be orphaned. </div>
<p>So for Synchronizing the logins, first you need to check all the users that are present.<br />
<code>Select 'user', * from sys.sysusers </code></p>
<p>Then check whether those users have logins or not by<br />
<code>Select 'Login', * from sys.server_principals </code></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/login1.jpg"><img class="alignnone size-full wp-image-287" title="login1" src="http://ravikhanal.com/wp-content/uploads/2008/12/login1.jpg" alt="" width="500" height="27" /></a></p>
<p> </p>
<p>If there is orphaned user for user &#8216;dave&#8217; then you should create the login with the same SID as its SID in the source server. This can be done by</p>
<p><code>Create login dave with Password = 'password', SID=0x8103F8ADEEADFA44BC4FE23836BCCE93<br />
</code></p>
<p>Another way of synchronizing the login can be done by system stored procedure.</p>
<p><code>Exec sp_change_users_login Report </code></p>
<p>This code will list out all the orphaned users and their corresponding SID.</p>
<p>Then after this you can do</p>
<p><code>Exec sp_change_users_login AUTO_FIX, 'lisa', 'password' </code></p>
<p>So the Auto_Fix will create a new login with the new SID and then match those with the User&#8217;s SID.</p>
<p>After this also you have more orphaned user then you can do</p>
<p><code>Exec sp_change_users_login 'update one', 'john', 'password' </code></p>
<p>But there is one major problem with using the stored procedure sp_change_users_login, when you restore the database again then the sp_change_users_login will be gone. So you would have to again do the whole process again. So sp_change_users_login is fine if you are moving database only once. If it is a repeatable transfer of a database from server to server then this sp_change_users_login is not useful.</p>
<p>Login Synchronization can be done through SSIS as well. SSIS also uses random SIDs at the destination and sp_change_users_login type to work to remap the users accounts to the newly generated SIDs.</p>
<p>Another way of Synchronization can be done through sp_help_revlogin. So we need to first download sp_help_revlogin from the Microsoft&#8217;s kb246133, then execute sp_help_revlogin on the source and copy the result. Then run the copied result in the destination server. So this will solve the orphaned users problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/how-to-manage-orphaned-user/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SSIS Package for merging data sources and applying transformations</title>
		<link>http://ravikhanal.com/ssis-package-for-merging-data-sources-and-applying-transformations/</link>
		<comments>http://ravikhanal.com/ssis-package-for-merging-data-sources-and-applying-transformations/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 22:10:24 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[SQL Server 2005]]></category>

		<category><![CDATA[2005]]></category>

		<category><![CDATA[character map]]></category>

		<category><![CDATA[Control flow task]]></category>

		<category><![CDATA[data flow task]]></category>

		<category><![CDATA[derived column]]></category>

		<category><![CDATA[Excel Source]]></category>

		<category><![CDATA[Flat file source]]></category>

		<category><![CDATA[Integration services]]></category>

		<category><![CDATA[merge]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[OLEDB destination]]></category>

		<category><![CDATA[sort]]></category>

		<category><![CDATA[SSIS]]></category>

		<category><![CDATA[transformation]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=230</guid>
		<description><![CDATA[Scenario:
I have file in different heterogeneous sources like Text file and Excel File and I want to merge it into the SQL Server Table. But before loading the data into SQL Server table I have to change the First Name Column into Upper Case and also I need to give 20% raise in the salary. [...]]]></description>
			<content:encoded><![CDATA[<p>Scenario:<br />
I have file in different heterogeneous sources like Text file and Excel File and I want to merge it into the SQL Server Table. But before loading the data into SQL Server table I have to change the First Name Column into Upper Case and also I need to give 20% raise in the salary. So I should have the proposed salary column added to the table.</p>
<p>Solution:</p>
<p>So First I need to have the data flow task for this.<a href="http://ravikhanal.com/wp-content/uploads/2008/12/dataflowtask1.jpg"><img class="alignnone size-medium wp-image-234" title="dataflowtask1" src="http://ravikhanal.com/wp-content/uploads/2008/12/dataflowtask1.jpg" alt="" width="166" height="69" /></a></p>
<p>Then in the data flow the package would be like this:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/package.jpg"><img class="alignnone size-medium wp-image-236" title="package" src="http://ravikhanal.com/wp-content/uploads/2008/12/package-300x298.jpg" alt="" width="500" height="496" /></a></p>
<p><span id="more-230"></span><br />

<!-- Begin Google Adsense code -->

<script type="text/javascript"><!--
google_ad_client = "pub-3769852819788005";
/* 468x60, created 12/7/08 */
google_ad_slot = "8921495124";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
<br />
Let us first add the flat file connection Manager, Excel Connection Manager, and Oledb Connection Manager.</p>
<p>In the flat file Source add the Flat file connection Manager.</p>
<p>In the Excel Source add the Excel Source connection Manager.</p>
<p>Since the data in Excel is in Unicode format so it should be converted into string format using Data Conversion Transformation.</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dataconversion.jpg"><img class="alignnone size-medium wp-image-240" title="dataconversion" src="http://ravikhanal.com/wp-content/uploads/2008/12/dataconversion-300x298.jpg" alt="" width="300" height="298" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/sort.jpg"><img class="alignnone size-medium wp-image-241" title="sort" src="http://ravikhanal.com/wp-content/uploads/2008/12/sort-271x300.jpg" alt="" width="271" height="300" /></a></p>
<p>Before the data is merged, it should be sorted. So lets sort the Flat file Source and converted data of Excel by First Name and Last Name.</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/sort1.jpg"><img class="alignnone size-medium wp-image-242" title="sort1" src="http://ravikhanal.com/wp-content/uploads/2008/12/sort1-270x300.jpg" alt="" width="270" height="300" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/merge.jpg"><img class="alignnone size-medium wp-image-243" title="merge" src="http://ravikhanal.com/wp-content/uploads/2008/12/merge-300x296.jpg" alt="" width="300" height="296" /></a></p>
<p>Then after Sorting the data, it should be merged.</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/character-map.jpg"><img class="alignnone size-medium wp-image-244" title="character-map" src="http://ravikhanal.com/wp-content/uploads/2008/12/character-map-268x300.jpg" alt="" width="268" height="300" /></a></p>
<p>Then after merging the data, the first name column should be changed to uppercase. So the Character Map Transformation should be used.</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/derived-column.jpg"><img class="alignnone size-medium wp-image-245" title="derived-column" src="http://ravikhanal.com/wp-content/uploads/2008/12/derived-column-300x283.jpg" alt="" width="300" height="283" /></a> </p>
<p>After changing the data into uppercase, we have to add a new Salary column which could show the raise in the salary. So the derived column transformation has to be used which will calulate the 20% increase in salary.</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/destination.jpg"><img class="alignnone size-medium wp-image-260" title="destination" src="http://ravikhanal.com/wp-content/uploads/2008/12/destination-300x294.jpg" alt="" width="300" height="294" /></a></p>
<p>Then finally the OLEDB destination is added where all the data is dumped. In this OLEDB Destination the OLEDB Connection manager is added and the desired table is selected and mapped.</p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/ssis-package-for-merging-data-sources-and-applying-transformations/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQL Server 2008&#8217;s Installation Snapshot</title>
		<link>http://ravikhanal.com/sql-server-2008s-installation-snapshot/</link>
		<comments>http://ravikhanal.com/sql-server-2008s-installation-snapshot/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 01:47:23 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[SQL Server 2008]]></category>

		<category><![CDATA[Installation]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=193</guid>
		<description><![CDATA[ 

 









 
     
 
]]></description>
			<content:encoded><![CDATA[<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/11.jpg"><img class="alignnone size-medium wp-image-195" title="1-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/11-300x148.jpg" alt="" width="500" height="148" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/2.jpg"><img class="alignnone size-medium wp-image-196" title="2-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/2-300x287.jpg" alt="" width="500" height="287" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/3.jpg"><img class="alignnone size-medium wp-image-197" title="3-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/3-300x223.jpg" alt="" width="500" height="223" /></a> <a href="http://ravikhanal.com/wp-content/uploads/2008/12/4.jpg"><img class="alignnone size-medium wp-image-198" title="4-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/4-300x211.jpg" alt="" width="500" height="211" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/5.jpg"><br />
<span id="more-193"></span> <br />

<!-- Begin Google Adsense code -->

<script type="text/javascript"><!--
google_ad_client = "pub-3769852819788005";
/* 468x60, created 12/7/08 */
google_ad_slot = "8921495124";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
</a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/5.jpg"> </a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/5.jpg"><img class="alignnone size-medium wp-image-199" title="5-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/5-300x221.jpg" alt="" width="300" height="221" /></a> <a href="http://ravikhanal.com/wp-content/uploads/2008/12/7.jpg"><img class="alignnone size-medium wp-image-200" title="6-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/7-300x224.jpg" alt="" width="300" height="224" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/8.jpg"><img class="alignnone size-medium wp-image-201" title="7-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/8-300x225.jpg" alt="" width="300" height="225" /></a> <a href="http://ravikhanal.com/wp-content/uploads/2008/12/9.jpg"><img class="alignnone size-medium wp-image-202" title="8-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/9-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/10.jpg"><img class="alignnone size-medium wp-image-203" title="9-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/10-300x225.jpg" alt="" width="300" height="225" /></a> <a href="http://ravikhanal.com/wp-content/uploads/2008/12/111.jpg"><img class="alignnone size-medium wp-image-204" title="10-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/111-300x223.jpg" alt="" width="300" height="223" /></a> <a href="http://ravikhanal.com/wp-content/uploads/2008/12/12.jpg"><img class="alignnone size-medium wp-image-205" title="11-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/12-300x223.jpg" alt="" width="300" height="223" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/13.jpg"><img class="alignnone size-medium wp-image-206" title="12-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/13-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/14-hunu-parne.jpg"><img class="alignnone size-medium wp-image-207" title="13-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/14-hunu-parne-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/14.jpg"><img class="alignnone size-medium wp-image-208" title="14-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/14-300x225.jpg" alt="" width="300" height="225" /></a> <a href="http://ravikhanal.com/wp-content/uploads/2008/12/15-hunu-parne.jpg"><img class="alignnone size-medium wp-image-209" title="15-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/15-hunu-parne-300x223.jpg" alt="" width="300" height="223" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/16.jpg"><img class="alignnone size-medium wp-image-211" title="17-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/16-300x227.jpg" alt="" width="300" height="227" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/15.jpg"><img class="alignnone size-medium wp-image-210" title="16-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/15-300x222.jpg" alt="" width="300" height="222" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/17.jpg"><img class="alignnone size-medium wp-image-212" title="18-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/17-300x225.jpg" alt="" width="300" height="225" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/18.jpg"><img class="alignnone size-medium wp-image-213" title="19- SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/18-300x226.jpg" alt="" width="300" height="226" /></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/19.jpg"><img class="alignnone size-medium wp-image-214" title="20-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/19-300x223.jpg" alt="" width="300" height="223" /></a></p>
<p> <a href="http://ravikhanal.com/wp-content/uploads/2008/12/20.jpg"><img class="alignnone size-medium wp-image-215" title="21-SQL 2008" src="http://ravikhanal.com/wp-content/uploads/2008/12/20-300x224.jpg" alt="" width="300" height="224" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/sql-server-2008s-installation-snapshot/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to remove fragmentation in table?</title>
		<link>http://ravikhanal.com/how-to-remove-fragmentation-in-table/</link>
		<comments>http://ravikhanal.com/how-to-remove-fragmentation-in-table/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 19:46:14 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[SQL Server 2005]]></category>

		<category><![CDATA[database]]></category>

		<category><![CDATA[Fragmentation]]></category>

		<category><![CDATA[remove fragmentation in table]]></category>

		<category><![CDATA[Reorganization]]></category>

		<category><![CDATA[Truncate]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=160</guid>
		<description><![CDATA[Hey, Our Application is down!
This is the common thing you hear while you are working as a DBA. The reason for this is not always evident. Perhaps the number of transactions issued has increased or maybe the volume of the data has increased. But sometimes this might not be the cause of the problem. The [...]]]></description>
			<content:encoded><![CDATA[<p>Hey, Our Application is down!</p>
<p>This is the common thing you hear while you are working as a DBA. The reason for this is not always evident. Perhaps the number of transactions issued has increased or maybe the volume of the data has increased. But sometimes this might not be the cause of the problem. The problem might be due to disorganization of the database. Database disorganization occurs when a database&#8217;s logical and physical storage allocation contains many scattered areas of storage that are too small, not physically contiguous, or too disorganized to be used.</p>
<p>Database disorganization or fragmentation can occur when modifying data with INSERT, UPDATE, or DELETE statements, which over time cause gaps in each page. If a query search is based on a table scan or partial table scan, then it will create overhead for the SQL Server process with additional page reads, leading to high CPU activity and unresponsiveness.</p>
<p><span id="more-160"></span><br />

<!-- Begin Google Adsense code -->

<script type="text/javascript"><!--
google_ad_client = "pub-3769852819788005";
/* 468x60, created 12/7/08 */
google_ad_slot = "8921495124";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
</p>
<p>To minimize fragmentation, database objects must be restructured on a regular basis.</p>
<p>Some of the steps that you need to perform for database reorganization is</p>
<ul>
<li>Take the object level backups using BCP, Import/Export Wizard. If the database has constraints disable them.</li>
<li>Truncate the table.</li>
<li>Import the data back to the table.</li>
<li>Enable the constraints if you had disabled them.</li>
</ul>
<p> </p>
<p>Database reorganization is an offline process. So you should be aware of the downtime and do this only in off-peak hours. If the database is mission critical and no downtime is accepted then the split mirror backups can be used by completely using different set of disk. Then the database reorganization can be done on the database and replace the disk back again.</p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/how-to-remove-fragmentation-in-table/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sample SSIS Package</title>
		<link>http://ravikhanal.com/sample-ssis-package/</link>
		<comments>http://ravikhanal.com/sample-ssis-package/#comments</comments>
		<pubDate>Sat, 06 Dec 2008 07:31:09 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[SQL Server 2005]]></category>

		<category><![CDATA[DTS]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[Package]]></category>

		<category><![CDATA[SQL Server 2000]]></category>

		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=81</guid>
		<description><![CDATA[Scenario:
In the inbound location, I have to create a directory which would be like “DealerSales and Current Date” and then download files from the remote location to that directory. Then I have to move the files from there to the working directory. Then I have to unzip the zip files and load the text files [...]]]></description>
			<content:encoded><![CDATA[<h2>Scenario:</h2>
<p>In the inbound location, I have to create a directory which would be like “DealerSales and Current Date” and then download files from the remote location to that directory. Then I have to move the files from there to the working directory. Then I have to unzip the zip files and load the text files to the database and delete the text files from the working directory and move the zip from the working directory to the Archive folder. The directory’s date format should be in MMDDYYYY format.</p>
<h2 class="MsoNormal" style="margin: 0in 0in 0pt;">Solution:</h2>
<p>There could be a different approach to make the SSIS Package. One of the easier way to make the Package for this type of scenario could be like this:</p>
<ol>
<li>Let’s first have the File System Task which will create a directory like &#8220;DealerSales12052008&#8243; inside download directory, if it doesn’t exist.</li>
<li>Then let’s have the FTP Task which will download files from remote location to that folder.</li>
<li>Then let’s have the File System Task which will create a directory like &#8220;DealerSales12052008&#8243; inside the working directory, if it doesn’t exist.</li>
<li>Then let’s have the For Each Loop Container and File System task which will move files from download directory to the working directory.</li>
<li>Then let’s have the For Each Loop Container and Execute Process Task which will unzip the Zip files.</li>
<li>Then let’s have the For Each Loop Container and Data Flow Task which will load all the text files into the SQL Server database.</li>
<li>Then let’s have the File System Task which will create a directory like &#8220;DealerSales12052008&#8243; inside the Archive Directory.</li>
<li>Then let’s have the For Each Loop Container and File System Task which will move the zip files to the Archive Directory.</li>
<li>Then let’s have the For Each Loop Container and File System Task which will delete the text files from the working directory.</li>
<li>Then let’s have a File System tasks which will clean up our download directory and working directory.</li>
</ol>
<p>So now let’s begin by making the skeleton of the package by dragging the task and which would look like this:</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><a href="http://ravikhanal.com/wp-content/uploads/2008/12/1.jpg"><img class="alignnone size-full wp-image-111" title="1" src="http://ravikhanal.com/wp-content/uploads/2008/12/1.jpg" alt="" width="500" height="291" /></a></p>
<p><span id="more-81"></span><br />

<!-- Begin Google Adsense code -->

<script type="text/javascript"><!--
google_ad_client = "pub-3769852819788005";
/* 468x60, created 12/7/08 */
google_ad_slot = "8921495124";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<!-- End Google Adsense code -->
</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">First of all lets make download, Archive, Workdir Directories inside the C:\SSIS folder. In the download directory we will download the files from remote location. Workdir is our working directory where we will copy the files from download directory. When the datas are inserted into the tables, then we will move the zip files to the Archive directory.</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">Now let&#8217;s feed our tasks. Let&#8217;s start by creating variables first.</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">Let&#8217;s create a Package level Variable called dname01 with String datatype and Value as C:\SSIS\download.</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">Let&#8217;s create another Package level Variable called dname02 with string datatype. Let&#8217;s make its EvaluateAsExpression True and on Expression let&#8217;s write as:</p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;"><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname022.jpg"></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname02.jpg"><img class="alignnone size-full wp-image-112" title="dname02" src="http://ravikhanal.com/wp-content/uploads/2008/12/dname02.jpg" alt="" width="500" height="449" /></a></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt;">
<p>Now let&#8217;s create another Package level Variable dname03 of String Datatype. Let&#8217;s make its EvaluateAsExpression True with Expression as</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname03.jpg"><img class="alignnone size-full wp-image-114" title="dname03" src="http://ravikhanal.com/wp-content/uploads/2008/12/dname03.jpg" alt="" width="500" height="449" /></a></p>
<p>Now let&#8217;s configure the File System task as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/download.jpg"><img class="alignnone size-full wp-image-115" title="download" src="http://ravikhanal.com/wp-content/uploads/2008/12/download.jpg" alt="" width="499" height="479" /></a></p>
<p>Now we have created the directory called &#8220;DealerSales12052008&#8243; inside the download directory. Now we are downloading the files inside this directory from the remote location using FTP task. In our Remote Location we have Some ZIP files starting with the name of DealerSales. So we can configure our FTP task as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/ftp.jpg"><img class="alignnone size-full wp-image-116" title="ftp" src="http://ravikhanal.com/wp-content/uploads/2008/12/ftp.jpg" alt="" width="500" height="486" /></a></p>
<p>Now the zip files are already downloaded on the download directory. So now we have to move those files into working directory. So first of all we have to create a directory DealerSales12052008 inside the working directory. So lets create a package level variable dname04 with string datatype and expression as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname04.jpg"><img class="alignnone size-full wp-image-117" title="dname04" src="http://ravikhanal.com/wp-content/uploads/2008/12/dname04.jpg" alt="" width="500" height="450" /></a></p>
<p>Then let&#8217;s configure the file system task as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/workdir.jpg"><img class="alignnone size-full wp-image-118" title="workdir" src="http://ravikhanal.com/wp-content/uploads/2008/12/workdir.jpg" alt="" width="500" height="485" /></a></p>
<p>Now we have created the directory inside the working directory. So let&#8217;s move the files from download directory to the working directory by configuring the For Each Loop Container and File System task inside it.</p>
<p>Now let&#8217;s create a Package level variable fname01 of String datatype and Value any string like &#8220;dummy&#8221;.</p>
<p>Let&#8217;s configure For Each Loop Container as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/move1.jpg"><img class="alignnone size-full wp-image-119" title="move1" src="http://ravikhanal.com/wp-content/uploads/2008/12/move1.jpg" alt="" width="500" height="482" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/move2.jpg"><img class="alignnone size-full wp-image-120" title="move2" src="http://ravikhanal.com/wp-content/uploads/2008/12/move2.jpg" alt="" width="500" height="481" /></a></p>
<p>Now let&#8217;s configure the File System task as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/move_file_system_task.jpg"><img class="alignnone size-full wp-image-121" title="move_file_system_task" src="http://ravikhanal.com/wp-content/uploads/2008/12/move_file_system_task.jpg" alt="" width="500" height="488" /></a></p>
<p>Now the files are inside the working directory so now we have to unzip all the files inside the directory. So now let&#8217;s create a Container level variable name01 of String datatype.</p>
<p>Now let&#8217;s configure the For each loop Container as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/unzip.jpg"><img class="alignnone size-full wp-image-122" title="unzip" src="http://ravikhanal.com/wp-content/uploads/2008/12/unzip.jpg" alt="" width="500" height="483" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/unzip2.jpg"><img class="alignnone size-full wp-image-123" title="unzip2" src="http://ravikhanal.com/wp-content/uploads/2008/12/unzip2.jpg" alt="" width="500" height="474" /></a></p>
<p>Now let&#8217;s configure the Execute Process task as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/process_task.jpg"><img class="alignnone size-full wp-image-124" title="process_task" src="http://ravikhanal.com/wp-content/uploads/2008/12/process_task.jpg" alt="" width="500" height="439" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/process_task2.jpg"><img class="alignnone size-full wp-image-125" title="process_task2" src="http://ravikhanal.com/wp-content/uploads/2008/12/process_task2.jpg" alt="" width="500" height="440" /></a></p>
<p>Now we have unzipped the files. So now we have to load those text files into the SQL server Database.</p>
<p>So let&#8217;s create a package level variable bname01 of string datatype with expression as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/bname01.jpg"><img class="alignnone size-full wp-image-126" title="bname01" src="http://ravikhanal.com/wp-content/uploads/2008/12/bname01.jpg" alt="" width="500" height="452" /></a> <a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname022.jpg"></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname02.jpg"></a></p>
<p>Now let&#8217;s configure the For Each Loop Container for loading data into SQL Server as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/data1.jpg"><img class="alignnone size-full wp-image-127" title="data1" src="http://ravikhanal.com/wp-content/uploads/2008/12/data1.jpg" alt="" width="499" height="480" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/data2.jpg"><img class="alignnone size-full wp-image-128" title="data2" src="http://ravikhanal.com/wp-content/uploads/2008/12/data2.jpg" alt="" width="500" height="481" /></a></p>
<p>Now let&#8217;s configure the data Flow task as</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dataflowtask.jpg"><img class="alignnone size-full wp-image-129" title="dataflowtask" src="http://ravikhanal.com/wp-content/uploads/2008/12/dataflowtask.jpg" alt="" width="219" height="208" /></a></p>
<p>Now the data is loaded from text file to the SQL Server. So now let&#8217;s create a folder in the Archive directory. For that we have to create a package level Variable dname05 of string datatype with expression as</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname05.jpg"><img class="alignnone size-full wp-image-130" title="dname05" src="http://ravikhanal.com/wp-content/uploads/2008/12/dname05.jpg" alt="" width="500" height="443" /></a></p>
<p>Now we have to configure the File System Task for creating the folder inside Archive directory as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/archivedir.jpg"><img class="alignnone size-full wp-image-131" title="archivedir" src="http://ravikhanal.com/wp-content/uploads/2008/12/archivedir.jpg" alt="" width="500" height="488" /></a></p>
<p>Now we have to move those zip files into Archive directory. So lets create a Container level variable aname01 of string datatype with some string value like &#8220;dummy&#8221;.</p>
<p>Then we have to configure the for each loop container for moving zip files to Archive directory as</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname022.jpg"></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/dname02.jpg"></a><a href="http://ravikhanal.com/wp-content/uploads/2008/12/archiveforeach1.jpg"><img class="alignnone size-full wp-image-132" title="archiveforeach1" src="http://ravikhanal.com/wp-content/uploads/2008/12/archiveforeach1.jpg" alt="" width="500" height="479" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/archiveforeach2.jpg"><img class="alignnone size-full wp-image-133" title="archiveforeach2" src="http://ravikhanal.com/wp-content/uploads/2008/12/archiveforeach2.jpg" alt="" width="500" height="487" /></a></p>
<p>And we have to configure the file system task inside the Archive For Each Loop Container as</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/archiveforeachfilesystemtask.jpg"><img class="alignnone size-full wp-image-134" title="archiveforeachfilesystemtask" src="http://ravikhanal.com/wp-content/uploads/2008/12/archiveforeachfilesystemtask.jpg" alt="" width="499" height="484" /></a></p>
<p>Now we have to delete the text files that have been extracted and loaded into SQL Server.</p>
<p>For that we have to create a Container Level variable tname01 of string datatype and some string value as &#8220;dummy&#8221;. Then we have to configure the for each loop container for deleting the text file as</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/deleteforeach1.jpg"><img class="alignnone size-full wp-image-135" title="deleteforeach1" src="http://ravikhanal.com/wp-content/uploads/2008/12/deleteforeach1.jpg" alt="" width="500" height="484" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/deleteforeach2.jpg"><img class="alignnone size-full wp-image-136" title="deleteforeach2" src="http://ravikhanal.com/wp-content/uploads/2008/12/deleteforeach2.jpg" alt="" width="499" height="479" /></a></p>
<p>Similarly we have to configure the file system task inside the Delete Text file for each loop container as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/deletefilesystem.jpg"><img class="alignnone size-medium wp-image-137" title="deletefilesystem" src="http://ravikhanal.com/wp-content/uploads/2008/12/deletefilesystem-300x288.jpg" alt="" width="491" height="330" /></a></p>
<p>So finally we have to configure our File System task to delete the contents from the download directory and the working directory as:</p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/deletedownload.jpg"><img class="alignnone size-full wp-image-139" title="deletedownload" src="http://ravikhanal.com/wp-content/uploads/2008/12/deletedownload.jpg" alt="" width="500" height="483" /></a></p>
<p><a href="http://ravikhanal.com/wp-content/uploads/2008/12/deleteworkdir.jpg"><img class="alignnone size-full wp-image-140" title="deleteworkdir" src="http://ravikhanal.com/wp-content/uploads/2008/12/deleteworkdir.jpg" alt="" width="500" height="486" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/sample-ssis-package/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hadoop and Bigtable</title>
		<link>http://ravikhanal.com/hadoop-and-bigtable/</link>
		<comments>http://ravikhanal.com/hadoop-and-bigtable/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 20:15:23 +0000</pubDate>
		<dc:creator>Ravi Khanal</dc:creator>
		
		<category><![CDATA[Google]]></category>

		<category><![CDATA[Bigtable]]></category>

		<category><![CDATA[Hadoop]]></category>

		<category><![CDATA[relational database]]></category>

		<guid isPermaLink="false">http://ravikhanal.com/?p=16</guid>
		<description><![CDATA[Are Apache Hadoop and Google&#8217;s Bigtable becoming the major threat for the relational database?
The relational database is the dominent database till now. When Object Oriented Database came into market. Everybody at that time expected that Object Oriented Database was the evolutionary step in the database and it would replace all the relational databases. But it never happened. The main [...]]]></description>
			<content:encoded><![CDATA[<p>Are Apache Hadoop and Google&#8217;s Bigtable becoming the major threat for the relational database?</p>
<p>The relational database is the dominent database till now. When Object Oriented Database came into market. Everybody at that time expected that Object Oriented Database was the evolutionary step in the database and it would replace all the relational databases. But it never happened. The main thing we should note is that although Object Oriented Programming language is so popular, the Object Oriented Database failed. If we look closely for the failure of OODBMS&#8217;s against traditional RDBMS then its due to the lack of interoperability with a great number of features and tools that we use with SQL like reporting tools, OLAP tools, backups and recovery standards. Moreover OODBMS had weakness on query support due to the lacking of formal mathematical foundation.<br />
<span id="more-16"></span><br />
Now the google&#8217;s Bigtable and Apache Hadoop seems promising threat to relational database. Although big giants like Google and Yahoo had successfully implemented these distributed databases, it has lots of flaws.</p>
<p>Major Flaw of these distributed database is it does not support transactional systems and they are vendor dependent and not Portable. If your data is in Google&#8217;s BigTable, you can&#8217;t pull it out. No big enterprise company wants to have their data elsewhere but they want everything on their own hardware.</p>
<p>The relational database has its own beauty. Multiple applications work on the common database and uses tools like Reporting Services, OLAP, Integration Services. It would be quite difficult to replace the relational database.</p>
<p>The performance and high availability provided by BigTable and Hadoop had given very good opportunities for the Developers to choose between Relational Databases and Distributed Databases. It is on the grave of future that whether distributed databases will become more mature and popular or it will fail against traditional relational databases.</p>
]]></content:encoded>
			<wfw:commentRss>http://ravikhanal.com/hadoop-and-bigtable/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
