More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  Pankaj's BlogPhotosProfileFriendsMore Tools Explore the Spaces community
There are no music lists on this space.

Pankaj's Blog

Project Manager ( Database Specialist )
July 25

Make a CAT5 Intercom

It has been over a century and a half since Alexander Graham Bell whispered the words ‘Mary had a little lamb’ and changed the way mankind communicated. Modern life is unimaginable without a telephonic device—be it a sophisticated cell phone or an archaic pulse dial telephone still in use in certain parts of India. If you have gone fully digital, don’t thrown out your land line instruments in a hurry. This workshop will help you make a functional small distance intercom device.

 

 

 

A straightforward way to build a simple intercom at home is to use two old land line telephone handsets, run a wire between them and apply some power. An improvised circuit can include a buzzer at both ends, so that the person at the other end can be alerted to pick up the phone. First of all, you need to decide which rooms you will install the intercom. Then you need to collect all the materials listed on this page before getting down to work.

 

There are different ways to power the circuit. The first is to simply use a 9V battery. However, the downside to this option is that battery will drain out in no time leaving the intercom connection dead. Alternatively, you can power the circuit using any good pure 12 V DC power adapter. Any laptop’s idle or unused power adapter is the best choice. Don’t worry if the voltage level isn’t exactly 9 V—anything with an output voltage below 24 V will do the job. Note that the intercom needs to be powered at one end of the circuit only.

 

 

 

 

The scenario for which we designed and built this intercom included two rooms having computers connected over a network CAT5 cross-cable. Since a network cable consists of four pairs of wires, of which only two pairs are used by the network adapter, the other two unused pairs were perfect for our purpose. We only require four wires for the intercom to function, so if you don’t already have a network cable connecting computers between floors or rooms, you can use any ordinary telephone cable with four cores or two pair wires.

 

 

Construction

 

If you plan on using an existing network cable, (like in our workshop), note that pins one, two, three, and six (from the RJ45 connector) are used by the network adapter while the rest are just not needed. Check which wires are used in your cable. In our case it turned out to be the orange and orange-white, green and green-white. Using a wire cutter, we need to cut and separate out the remaining four wires. We shall now be using these four wires for our workshop. Now simply cut the sleeve of the CAT5 cable carefully and dig out the unused wires, then cut them carefully. The other wires can continue to be connected to the RJ45 connector, and be used for the existing network.

 

 

 

 

Now that the wires are ready to be used for the workshop, twist the ends so that you have pointed tips. Refer to the circuit diagram above and connect all the elements—the switches, buzzers and RJ11 jacks. Finally, hook up the telephone’s cord to the RJ11 jack and power up the circuit with the battery. Now, your intercom device is all ready to be used.

 

Testing

 

Press any one switch to check if the buzzer beeps at both ends to confirm whether the ringer is functioning. Next, pick up the handsets at both ends, start a conversation with the person at the other end of the line to confirm the working of the intercom circuit. And Voila! the intercom is ready.

 

 

 

 

 

If the intercom doesn’t seem to be working properly, refer to the circuit diagram and find the fault to ensure that the connections of the circuit are correct. This short workshop described a method to install an intercom device in your home. To improve on this, you can design your own complicated array of switches in a more efficient manner by connecting more wires and handsets to make a larger intercom.

July 18

SQL Server clustering

What is Clustering?
A Microsoft SQL Server Cluster is nothing more than a collection of two or more physical servers with identical access to shared storage that provides the disk resources required to store the database files. 

These servers are referred to as "nodes".  Each of the nodes talk to one another via a private network, sending a heartbeat signal between them.  Should one node not communicate its heartbeat to the other node in the cluster the secondary node will take ownership of any dependent services being run by the node that lost communication.  This process is referred to as "failover". 

A failover can occur both automatically (a server's heartbeat stops communicating) or manually.  A manual failover is beneficial in the event that patching or some other form of maintenance is required at the physical server level.  You would typically implement clustering in order to ensure that if you ever encounter hardware failure on the physical server hosting your SQL instance, your databases would continue to be available for dependent applications and their users. 

Unlike other clustering technologies that are implemented for better performance or for increased processing power via load-balancing, SQL clusters are designed for providing highly-available databases; eliminating downtime associated with hardware failure.  This architectural concept is referred to as "High Availability Clustering" or "HA Clustering" for short.  The service or groups of services that are hosted on a clustered node are respectively referred to as resources and resource groups.  Since these resources must be available to all nodes in a cluster then they must reside on a shared disk array in the form of SAN-NAS disk.  Each resource group will be mapped to a logical drive that is physically hosted on the shared disk array and will also have it's own associated IP address and network name. 

The SQL Server Installation Process on a Cluster
The SQL Server installation process detects when an installation is being attempted on a clustered node and will prompt you as to whether you wish to configure the SQL instance as clustered or not.  If you proceed with creating a clustered instance of SQL Server, the instance will be hosted on a "Virtual" Server.  Resources such as data and log files will be created on the shared SAN-NAS disk for SQL Server, SQL Server Agent, and Full-Text Indexing.

If selected in the installation process, Notification Services and Analysis Services are also cluster-aware in SQL Server 2005.  Conversely, the associated program files for the instance will be installed on the local drives of each of the clustered nodes in an identical fashion and registry values are set identically across all clustered nodes.  Since the "Virtual" server resides solely on the SAN it can be "owned" by any of the nodes you allow.  Each of the nodes can run these resources in identical fashion because each physical server/node has the program files and identical registry settings necessary to run the SQL instance. 

Furthermore, the users are oblivious to the underlying fluidity of the server.  They connect to it as they would any other physical server:  by server name (virtual server name in this case) if the default instance or by virtual server name\instance name if a named instance.  This is key for application connectivity.  Since the SQL instance simply changes ownership during a failover, connection strings the applications rely on to connect to their databases need not be recoded; the physical server may become unavailable, but the virtual server persists after the failover.

Active/Active or Active/Passive Clustering
Clusters are often referred to as either Active/Active or Active/Passive.  Just as you would expect by the name, in an Active/Active cluster there will be two or more nodes, each one owning an instance of Microsoft SQL Server.  If one node fails, the instance it owns would fail over to the other node, running along side (and contending for resources with) the other instance.  An Active/Passive architecture  requires that no matter how many nodes make up the cluster, at least one node is not the owner of an instance of SQL Server.  It is "passive" and only exists to accept a failover of a node hosting a SQL instance in the event of a failover. 

Current Microsoft licensing policies require you to only license the active nodes running Microsoft SQL Server.  The passive node need not be licensed.

How Many Nodes?
Today's clustering technology under Windows 2003 and Microsoft SQL Server 2005 Enterprise Edition allows for up to eight nodes to be combined into a single cluster.  The release of Windows 2008 and Microsoft SQL Server 2008 Enterprise Edition will bring with it the ability to double that to sixteen nodes.  (You are limited to two nodes if you utilize SQL Server Standard Edition.)  Do you want to cluster multiple databases of various SLAs within many nodes on a single cluster?  Is it beneficial to dedicate a two-node cluster to a single database?  The answer is:  "It Depends."  We look into this in detail in a future tip.

Pros and Cons
While clustering protects you from hardware failure relating to the server hosting the SQL Server instance, it does not protect you from media failure.  Unlike replication, database mirroring, or log shipping there is only a single copy of your database.  If the SAN-NAS encounters a failure then you could not only conceivably incur downtime, but possibly data loss.  It is recommended that you incorporate redundancy of your SAN-NAS or database mirroring with your clustering configuration to protect you from media failures.  Hardware and licensing costs may be high.  In an Active/Passive clustering model you'll purchase hardware you hope to never need to use.  The cluster build is more complex than a standalone server setup.  The physical build of the cluster is outside the scope of this discussion however.  Additional benefits for clustering include simplicity for installation of SQL and ease of administration and maintenance.

Summary
There is plenty to consider when planning on clustering SQL Server.  Hopefully you were able to get a better understanding of what clustering is and an idea of the terminology associated with clustering SQL Server 2005.  In the remaining tips in this series we will review these items in greater detail, walking you through the decisions you'll make on architecture, the installation process, the tools available to monitor the state of the cluster and its resources, as well as comparing clustering to the other high-availability options associated with Microsoft SQL Server.

June 13

How to back up a database using script in SQL SERVER 2005

Use this script in order to backup a database :

/*
Author : Suprotim Agarwal
Creation Date: Jan 2, 2008
*/
CREATE PROCEDURE [dbo].[usersp_BackUpDB]
@DBNAME nvarchar(50),
@PATH nvarchar(200),
@BCKUPNAME nvarchar(50)
AS
BACKUP DATABASE @DBNAME
TO DISK = @PATH
WITH NOFORMAT, NOINIT,
NAME = @BCKUPNAME,
STATS = 10

You can call this script using :

DECLARE @return_value int
EXEC @return_value = [dbo].[usersp_BackUpDB]
@DBNAME = N'Northwind',
@PATH = N'C:\temp\Northwind.bak',
@BCKUPNAME = N'NW'
SELECT 'Return Value' = @return_value
GO

Read more about this topic over here :

How to see active connections for each Database in SQL Server 2005

At times, we need to check the number of active connections for each Database on our server. This can be done easily using the following script. The script displays the DatabaseName, the number of connections and the login name :

SELECT db_name(dbid) as DatabaseName, count(dbid) as NoOfConnections,
loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame

June 12

How to send an email using SQL Server 2005

Sql Server Reporting Services provides a few global collections that you can use in your reports to retrieve report information. One such collection is Globals

Globals contains global variables which can display information such as the report name, execution time or page number. You can use these variables as expressions in a textbox and place these textboxes in the report footer. Some of the expressions are as follows:

Execution Time :

= "Your report executed at " & Globals.ExecutionTime

Page Number :

="You are viewing page " & Globals.PageNumber & " of " & Globals.TotalPages

Report Path and Name :

=Globals.ReportFolder & Globals.ReportName

Similary you can also explore Globals.ExecutionTime which displays the execution date and time as well as Globals.ReportServerUrl which displays the URL of the SSRS server on which the report is being executed.

Populate a table from a .CSV or .TXT file using SQL Server 2005

You can use Bulk Insert or SSIS to import text/csv files. There are some advantages and disadvantages using any of these methods. In this article, we will explore how to use the OPENROWSET to read a data file and populate a table.

Note: In SQL Server 2005, OPENROWSET can read from a data file without loading the data into a target table. This lets you use OPENROWSET with a simple SELECT statement.

Follow these steps:

Step 1: Create a database called 'Employees'. Create a table called '
EmployeeDetails' in it using the script given below:

USE [Employee]
GO
/****** Object: Table [dbo].[EmployeeDetails] Script Date: 04/11/2008 11:12:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[EmployeeDetails](
[EmployeeID] [nvarchar](50) NOT NULL,
[EmployeeName] [varchar](50) NULL,
[EmployeeAddress] [varchar](50) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF

Step 2: To run ad-hoc queries on the SQL server, you would first need to enable it using the following query:

sp_configure 'show advanced options',1
RECONFIGURE WITH override
GO
sp_configure 'Ad Hoc Distributed Queries',1
RECONFIGURE WITH override
GO

Step 3: Create a txt/csv file with the following format on your C:\. The file is called 'Employee.csv'

EmployeeID EmployeeName EmployeeAddress
1 Kat 23/Avenue. Park
2 Jim Jeoff Street
3 Tom Lifer Road

Step 4: The final step is to run the query and populate the EmployeeDetails table

USE Employee
GO
INSERT INTO EmployeeDetails(EmployeeID,EmployeeName,EmployeeAddress)
SELECT *
FROM
OPENROWSET('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};
DEFAULTDIR=C:\;Extensions=CSV;','SELECT * FROM Employee.csv')
March 31

Fundamental Programming Namespaces

The .NET Framework class library provides access to system functionality and is designed to be the foundation on which .NET Framework applications, components, and controls are built. The following sections describe many of the namespaces provided in the .NET Framework class library. To browse the entire WinFX class library, see Class Library.( from microsoft.com)

 Fundamental Programming Namespaces
  • System – contains classes and base classes that define commonly used value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions. Other classes provide services supporting data type conversion, method parameter manipulation, mathematics, remote and local program invocation, application environment management, and supervision of managed and unmanaged applications.

  • System.Collections – contains interfaces and classes that define various collections of objects, such as lists, queues, arrays, hashtables, and dictionaries.

  • System.Collections.Generic – contains interfaces and classes that define generic collections, which allow users to create strongly typed collections that provide better type safety and performance than non-generic strongly typed collections.

  • System.IO – contains types that allow synchronous and asynchronous reading and writing on data streams and files.

  • System.Text – contains classes representing ASCII, Unicode, UTF-7, and UTF-8 character encodings; abstract base classes for converting blocks of characters to and from blocks of bytes; and a helper class that manipulates and formats String objects without creating intermediate instances of String.

  • System.Threading – provides classes and interfaces that enable multithreaded programming. This namespace includes a ThreadPool class that manages groups of threads, a Timer class that enables a delegate to be called after a specified amount of time, and a Mutex class for synchronizing mutually exclusive threads.

 Configuration Namespaces
 Data and XML Namespaces
  • System.Data – consists of the classes that constitute the ADO.NET architecture, which is the primary data access method for managed applications.

  • System.Data.Common – contains classes shared by the .NET Framework data providers. Data providers describe a collection of classes used to access a data source, such as a database, in the managed space.

  • System.Xml – contains classes that provide standards-based support for processing XML.

 Globalization and Localization Namespaces
  • System.Globalization – contains classes that define culture-related information, including the language, the country/region, the calendars in use, the format patterns for dates, currency and numbers, and the sort order for strings.

  • System.Resources – provides classes and interfaces that allow developers to create, store, and manage various culture-specific resources used in an application.

  • System.Text – contains classes representing ASCII, Unicode, UTF-7, and UTF-8 character encoding.

 Interop Namespaces
 Networking Namespaces
  • System.Net – contains classes that provides a simple interface to many network protocols.

  • System.Net.Mail – contains classes used to send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery.

  • System.Net.NetworkInformation – provides access to network traffic data, network address information, and notification of address changes for the local computer.

  • System.Net.Sockets – provides a managed implementation of the Windows Sockets (Winsock) interface for developers who need to help control access to the network.

 Reflection Namespaces

System.Reflection – contains classes and interfaces that provide a managed view of loaded types, methods, and fields, with the ability to dynamically create and invoke types.

 Security Namespaces
  • System.Security – provides the underlying structure of the common language runtime security system, including base classes for permissions.

  • System.Web.Security – contains classes that are used to implement ASP.NET security in Web applications.

 Serialization Namespaces
  • System.Runtime.Serialization – contains classes that can be used for serializing and deserializing objects. Serialization is the process of converting an object or a graph of objects into a linear sequence of bytes for either storage or transmission to another location. Deserialization is the process of taking in stored information and recreating objects from it.

 Service Namespaces

The namespaces in the .NET Framework for interacting with a variety of back-end server resources include the following:

  • System.Diagnostics – consists of classes that allow you to debug your application and to trace the execution of your code. System.Diagnostics also provides classes that allow you to start system processes, read and write to event logs, and monitor system performance using performance counters.

  • System.DirectoryServices – consists of classes that provide easy access to the Active Directory from managed code.

  • System.IO – provides classes that listen to the file system change notifications and raises events when a directory, or file in a directory, changes.

  • System.Management – provides classes for managing information and events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure.

  • System.Messaging – provides classes that allow you to connect to message queues on the network, send messages to queues, and receive or peek (read without removing) messages from queues.

  • System.ServiceProcess – provides classes that allow you to install and run services, long-running executables that run without a user interface.

  • System.Timers – provides the server-based Timer component, which allows you to raise an event on a specified interval.



View more entries
 
http://freemeditationguide.blogspot.com/
No list items have been added yet.
Updated 2/18/2008