Systems Engineering and RDBMS

Archive for February 6th, 2008

Sharing drives and clipboard with Remote Desktop in Windows

Posted by decipherinfosys on February 6, 2008

In your day to day work, you would be using remote desktop quite often to terminal serve into other servers in order to do your work.  Besides invoking it from the GUI (Start/All Programs/Accessories/Remote Desktop Connection ==> in Windows 2003 OS), you can also invoke it from: Start/Run, type mstsc and press enter.  It will bring up the remote desktop connection box like the one shown below:

rdp1.jpg

In order to allow sharing of the local drives and clipboard, you can then click on options, then the Local Resource tab and then under Local devices and resources pane (as shown in the image below):

rdp2.jpg

select Printers, Clipboard if they are not already selected and then click on More… and you will get the image that is shown below.

rdp3.jpg

Check the Drives check box and click Ok all the way through. Please note that I am using Windows 2003 Server as my OS.  If you are using Windows XP, the images shown above will be a bit different and under Local Resources itself, you will be able to see the Disk Drives check box.  If for some reason, the clipboard cut and paste is not working for you, then on the remote server that you have terminal serve’d into, look for rdpclip.exe in task manager (under the processes tab) and you will need to end that process.

You can also chose to save your connection options and then save this information.  In Windows 2003, Start/All Programs/Administrative Tools/Remote Desktops will get you the console that you see in the image below.  You can then configure your connections over there and just click on those in order to be logged into the remote machines.

rdp4.jpg

Posted in Windows | Leave a Comment »

Getting table and Index names for fragmented indexes in SQL Server 2005

Posted by decipherinfosys on February 6, 2008

One of the readers had asked this question so we are posting the answer for that question.  Getting the table and Index names for fragmented indexes in SQL Server 2005 is pretty simple to do.  All we need to do is query the DMV and join it with sys.indexes.  Here is a simple script to demonstrate that:

SELECT
OBJECT_NAME(DMV.object_id)        AS TABLE_NAME
,SI.NAME                        AS INDEX_NAME
,avg_fragmentation_in_percent    AS FRAGMENT_PERCENT
FROM sys.dm_db_index_physical_stats(DB_ID(), NULL, NULL, NULL, ‘Detailed’) as DMV
LEFT OUTER JOIN SYS.INDEXES AS SI
ON DMV.OBJECT_ID = SI.OBJECT_ID
AND DMV.INDEX_ID = SI.INDEX_ID
WHERE avg_fragmentation_in_percent > 10
AND index_type_desc IN(‘CLUSTERED INDEX’, ‘NONCLUSTERED INDEX’)
ORDER BY FRAGMENT_PERCENT DESC

Posted in SQL Server | Leave a Comment »