You are on page 1of 43

A

PROJECT ON

SQL

SERVER

SUBMITTED IN PARTIALFULFILLMENT OF THE REQIREMENT FOR THE AWARD OF THE DIPLOMA OF


B.Sc. INFRASTRUCTURE MANAGEMENT SYSTEM

Project Guide:Mr.Jayant Vaishnav Technical Coordinator


IIHT Jaipur

Submitted by:
Abhishek Sharma
REG.NO.-520840838 B.Sc. IMS (6 SEM.)

India Institute of Hardware & Technology, Gandhi Path Vaishali Nagar, Jaipur-302021 Rajasthan

CANDIDATES DECLARATION

This is to certify that work, which is being presented in the Project entitled SQL SERVER
submitted by undersigned student of BSCIMS in partial fulfillment for award of Degree of post B.SC. of IMS is a record of my own work carried out by me under guidance and supervision of Mr. Jayant Vaishnav. This work has not submitted elsewhere for award of any other degree

Date: - 24/6/2011 Place: - Jaipur

Name & Signature of Students ABHISHEK SHARMA

CERTIFICATE

This is to certify that Abhishek sharma of BScIMS 6th semester of IIHT Academy Vaishali Nagar Jaipur, has completed his project report on the topic of SQL SERVER under the supervision of Jayant Vaishnav (Tech Head). To best of my knowledge the report is original and has not been copied or submitted anywhere else. It is an independent work done by his

Mr. Jayant Vaishnav Technical Coordinator IIHT Academy , Jaipur

ACKNOWLEDGMENT

It is great happiness and privilege for me to present this project report on June 24, 2010. I have completed this project under Mr. Jayant Vaishnav, (faculty guide.) IIHT, Jaipur. This is an essential requirement to take project as a student of BSc (IMS) three year master degree course. We would like to express our gratitude towards all those people who have in various ways, helped in successful completion of our project. We express our deep sense of respect to Mr Vinod Arora Director and Mr. Jayant Vaishnav (Tech. Coordinator, IIHT, Jaipur) Project Guide, , for extending his full support to me and for giving me a golden opportunity to work on this project

We are also grateful to our Director Sir, parents, Sr. teachers, for them valuable suggestions and continuous monitoring. .

Date: 24/6/2011

Abhishek Sharma

CONTENTS:
Definition of SQL History of SQL

Configuration Tools Installation Creating Data base Back up Restore

Definition of SQL Server:

SQL (pronounced "ess-que-el") stands for Structured Query Language. It is used to communicate with database. By using SQL we can store the data on database server. We can store on retrieve data from database .IT is used with different data bases. Such as M.S.Access, Informix, Oracle and Sybase. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, Ingres, etc. Although most database systems use SQL, most of them also have their own additional proprietary extensions that are usually only used on their system. However, the standard SQL commands such as "Select", "Insert", "Update", "Delete", "Create", and "Drop" can be used to accomplish almost everything that one needs to do with a database..

Brief History and Purpose of SQL:


Structured Query Language (SQL) was created to shield the database programme from understanding the specifics of how data is physically stored in each database management system and also to provide a universal foundation for updating, creating and extracting data from database systems that support an SQL interface. Now a DB programmer only had to worry about the tables that made up a database and how each table related - a programmer could now focus more on the meaning of the data and much less on how this data was physically stored. An interesting footnote is that SQL originated from work done in Mathematics Set Theory and a language called SEQUEL (Structured English Query Language) an API created by IBM for its first relational database management system System/R. In fact many people still pronounce SQL as SEQUEL. For some more interesting titbits on the origins of SQL and relational database theory check out the links at the bottom of this article. Microsoft SQL training is important to IT professionals interested in knowing how to work on the product. A history of Microsoft SQL server is also very important. Basically, the code for MS SQL came from the Sybase SQL Server, which was the first database Microsoft attempted. It competed against Sybase, IBM and Oracle. It ended up being pretty much the same as the third edition of the Sybase SQL Server. Then, the Microsoft SQL Server 4.2 was available in 1992. When the 4.21 version was available it was at the same time as Windows NT 3.1. The first version of SQL that did not include any assistance from Sybase was the Microsoft SQL Server v6.0. When Windows NT made an appearance Sybase and Microsoft moved on to pursue their own interests. This allowed Microsoft to negotiate exclusive rights to the versions of SQL that were written for Microsoft systems. The Sybase server actually changed its name to Adaptive Server Enterprise to keep it from being confused with the Microsoft version. Many revisions have been made without assistance from Sybase since the two parted ways. The first database server written on GUI was a complete change from the Sybase code. Currently, Microsoft SQL Server 2005 is the most recent version. It was launched beside the Visual Studio 2005. Free download of the SQL Server 2005 Express Edition is available, which is a nice bonus for people who need it. Since the release of SQL Server 2000 there have been many advancement and changes to the product. Performance has been improved, complementary systems are now available with the system, and client IDE tools are included. Some of the new systems included are Analysis Services, ETL, and messaging technologies like notification services and service broker.With all the changes going on with each edition it is important for IT techs to take SQL 2005 training classes. With SQL 2005 training IT techs are better able to provide support for users running SQL 2005 as well as other versions. There are quite a few classes available online for SQL training or else classes are offered in

person in boot camps, night classes, or weekend classes. You just have to find the right class for you, take it, and then you will be prepared to work on all of the SQL servers.

Latest version of Sql - Server 2008 :


The latest version of SQL Server, SQL Server 2008, was released (RTM) on August 6, 2008 and aims to make data management self-tuning, self organizing, and self maintaining with the development of SQL Server Always On technologies, to provide near-zero downtime. SQL Server 2008 also includes support for structured and semi-structured data, including digital media formats for pictures, audio, video and other multimedia data. In current versions, such multimedia data can be stored as BLOBs (binary large objects), but they are generic bit streams. Intrinsic awareness of multimedia data will allow specialized functions to be performed on them. Server Applications, Microsoft Corp., SQL Server 2008 can be a data storage backend for different varieties of data: XML, email, time/calendar, file, document, spatial, etc as well as perform search, query, analysis, sharing, and synchronization across all data types. Other new data types include specialized date and time types and a Spatial data type for location-dependent data. Better support for unstructured and semi-structured data is provided using the new FILESTREAM data type, which can be used to reference any file stored on the file system. Structured data and metadata about the file is stored in SQL Server database, whereas the unstructured component is stored in the file system. Such files can be accessed both via Win32 file handling APIs as well as via SQL Server using T-SQL; doing the latter accesses the file data as a BLOB. Backing up and restoring the database backs up or restores the referenced files as well. SQL Server 2008 also natively supports hierarchical data, and includes T-SQL constructs to directly deal with them, without using recursive queries. The Full-Text Search functionality has been integrated with the database engine. According to a Microsoft technical article, this simplifies management and improves performance. SQL Server includes better compression features, which also helps in improving scalability. It enhanced the indexing algorithms and introduced the notion of filtered indexes. It also includes Resource Governor that allows reserving resources for certain users or workflows. It also includes capabilities for transparent encryption of data (TDE) as well as compression of backups. SQL Server 2008 supports the ADO.NET Entity Framework and the reporting tools, replication, and data definition will be built around the Entity Data Model. SQL Server Reporting Services will gain charting capabilities from the integration of the data visualization products from Dundas Data Visualization, Inc., which was acquired by Microsoft. On the management side, SQL Server 2008 includes the Declarative Management Framework which allows configuring policies and constraints, on the entire database or certain tables, declaratively. The version of SQL Server Management Studio included with SQL Server 2008 supports IntelliSense for SQL queries against a SQL Server 2008 Database Engine. SQL Server 2008 also makes the databases available via Windows PowerShell

providers and management functionality available as Cmdlets, so that the server and all the running instances can be managed from Windows PowerShell.

SQL Server 2008 R2


SQL Server 2008 R2 (formerly codenamed SQL Server "Kilimanjaro") was announced at TechEd 2009, and was released to manufacturing on April 21, 2010. SQL Server 2008 R2 adds certain features to SQL Server 2008 including a master data management system branded as Master Data Services, a central management of master data entities and hierarchies. Also Multi Server Management, a centralized console to manage multiple SQL Server 2008 instances and services including relational databases, Reporting Services, Analysis Services & Integration Services. SQL Server 2008 R2 includes a number of new services, including PowerPivot for Excel and SharePoint, Master Data Services, StreamInsight, Report Builder 3.0, Reporting Services Add-in for SharePoint, a Data-tier function in Visual Studio that enables packaging of tiered databases as part of an application, and a SQL Server Utility named UC (Utility Control Point), part of AMSM (Application and Multi-Server Management) that is used to manage multiple SQL Servers.

Hardware And Software Requirement

Hardware requirement
Processor: Intel Pentium or compatible 600 megahertz or higher

processor(recommended 1 ghtz) Memory: 256 megabytes of memory (recommended 512 mb) Disk Space: 95-300 MB of disk space minimum. Typical installation required 250 MB disk space Monitor: screen resolution of 1024 x 786 Pointing Device Network adapter CD/DVD drive for installation from disk. Cluster installation requirements: 8 node cluster installations are supported in 32 and 64 bit platforms

Software Requirement

Operating system: Windows Server 2003 (Enterprise or embedded), Windows XP with SP1, Windows 2000 Professional with SP 4 and Windows 2000 Server SP4. 1. Microsoft Windows Installer 3.0, 2. Microsoft Windows .NET Framework 2.0, 3. Microsoft SQL Server Native Client, 4. Microsoft SQL Server Setup Support files.

Microsoft SQL Server 2005 Installation Wizard


Step by step installation of Microsoft SQL Server 2005 is being

describe in this document.


Description & Prerequisite :

Before beginning the installation process, check the following prerequisites: Ensure the computer meets the system requirements . Make sure you have administrator permissions on the computer where Microsoft SQL Server 2005 (SQL Server 2005) will be installed. Back up the Exact Globe database on the SQL Server. Verify that the disk where SQL Server 2005 to be installed is uncompressed. If you attempt to install SQL Server 2005 to a compressed drive, Setup will fail. Exit antivirus software while installing SQL Server 2005. Stop all services that depend on SQL Server, including any service using Open Database Connectivity (ODBC), such as Internet Information Services (IIS). Exit Event Viewer and registry editors (Regedit.exe or Regedt32.exe). Once these prerequisites are met, proceed to install the SQL Server 2005.

Installation :To begin the installation process, insert the SQL Server 2005 DVD into your DVD drive. If the autorun feature on your DVD drive does not launch the installation program, navigate to the root of the DVD and launch splash.hta. If installing from a network share, navigate to the network folder and launch splash.hta.

From the autorun dialog, click Server components, tools, Books Online, and
samples.

On the End User License Agreement page, read the license agreement, and then select

the check box to accept the licensing terms and conditions. Accepting the license agreement will activates the Next button. To continue, click Next. To end Setup, click Cancel.

On the Installation Prerequisite page, Setup installs software required for SQL Server 2005. For more information about component requirements, click the Help button at the bottom of the page. To begin the component update process, click Install. To continue after the update completes, click Finish.

On the Welcome page of the SQL Server Installation Wizard, click Next to continue.

On the System Configuration Check (SCC) page, the installation computer is scanned for conditions that may block Setup. For information about configuration check items, click Help at the bottom of the page. To interrupt the scan, click Stop. To display a list of check items grouped by result, click the Filter button and then select a category from the drop-down list. To view a report of SCC results, click the Report button and then select an option from the drop-down list. Options include viewing the report, saving the report to a file, copying the report to the Clipboard, and sending the report as e-mail. To proceed with Setup after the SCC scan completes, click Continue. Note: A warning message will be shown if the SCC detect incompatibility on the installation.

On the Registration Information page, enter information in the Name and

Company text boxes. To continue, click Next.

On the Components to Install page, select the components for your installation. A description for each component group appears in the Components to be Installed pane when you select it. You can select any combination of check boxes. To install individual components, click Advanced. Otherwise, click Next to continue.

For Exact Globe and Exact Synergy, check the following two components:

SQL Server Database Services Workstation components, Books Online and development tools checkbox only.

If you clicked Advanced on the previous page, the Feature Selection page is displayed. On the Feature Selection page, select the program features to install using the drop-down boxes. To install components to a custom directory, select the feature and then click Browse. For more information about the functionality of this page, click Help. To continue when your feature selections are complete, click Next. On the Instance Name page, select a default or named instance for your installation. If a default or named instance is already installed, and you select the existing instance for your installation, Setup upgrades it and provides you the option to install additional components. To install a new default instance, there must not be a default instance on the computer.

To install a new named instance, click Named Instance and then type a unique instance name in the space provided. For more information about instance naming rules, click Help at the bottom of the page, or see the Instance Name topic in SQL Server 2005 Books Online. Caution 1: When you upgrade to SQL Server 2005, the previous SQL Server instance will be overwritten and will no longer exist on your computer. Before upgrading, back up SQL Server databases and other objects associated with the previous SQL Server instance. Caution 2: If your computer has SQL Server 2000 Management Tools and a default instance of SQL Server 2005 installed, SQL Server Setup will permit you to install a SQL Server 2000 default instance. However, doing so will disable the installed instance of SQL Server 2005. Therefore, do not install a default instance of SQL Server 2000 when SQL Server 2000 Management Tools and a default instance of SQL Server 2005 already exist on the compute

R (to install a new instances)

On the Service Account page, specify the user name, password, and domain name for SQL Server service accounts. You can use one account for all of the services. Optionally, you can specify an individual account for each service. To specify an

individual account for each service, select Customize for each service account, select a service name from the drop-down box, and then provide login credentials for the service. To proceed, click Next. Note: The domain name cannot be a full Domain Name System (DNS) name. For example, if your DNS name is my-domain-name.com, use my-domain-name in the Domain field. SQL Server does not accept my-domain-name.com in the Domain field.

On the Authentication Mode page, choose the authentication mode to use for your SQL Server installation. You must also enter and confirm a strong password for the sa

login. Choose Mixed Mode (Windows Authentication and SQL Server Authentication) for Exact Globe and Exact e-Synergy. To proceed, click Next.

On the Collation Settings page, specify the collation for your SQL Server instance. You can use one account for SQL Server and Analysis Services, or you can specify collations for individual components. To set separate collation settings for SQL Server and Analysis Services, select the Customize for each service account check box. After you select the check box, a drop-down selection box appears. Select a service from the drop-down selection box and then assign its collation. Repeat for each service. To proceed, click Next. In this example,the default Collation which follows the regional setting is chosen.

If you selected Reporting Services as a feature to install, the Report Server Virtual Directories page is displayed. Accept the default directory names, or specify a location for the directories. For more information about this page, click Help at the bottom of the page. To proceed, click Next.

On the Error Reporting page, optionally clear the check box to disable error reporting. For more information about error reporting functionality, click Help at the bottom of the page. To proceed, click Next.

On the Ready to Install page, review the summary of features and components for your SQL Server installation. To proceed, click Install.

On the Setup Progress page, you can monitor installation progress as Setup proceeds. To view the log file for a component during installation, click the product or status name on the Setup Progress page.

On the Completing the Microsoft SQL Server Installation Wizard page, you can view the Setup summary log by clicking the link provided on this page. To exit the SQL Server Installation Wizard, click Finish.

Note - If you are instructed to restart the computer, do so now. It is important to read the message from the Setup program when you are done with installation. Failure to restart the computer may cause failures when you run the Setup program in the future.

Backups and Restorations :


Why Backups used ?
In Information Technology, a backup or the process of backing up refers to making copies of data so that these additional copies may be used to restore the original after a data loss event. The verb form is back up in two words, whereas the noun is backup
In order to begin working on backups, the business needs define a database

recovery model. In essence, a recovery model defines what you're going to do with the transaction log data.

Types of backups :

Performing a Full Backup:- A full backup makes a full copy of the database. This
type of backup is most reliable, but it is also the most time and resource consuming. Even so, users can continue connecting to the database, reading and changing data while full backup is in progress. Full backups take longer than any other type of backup, but they're also easiest to recover from as long as no transactional activity has occurred since the last full backup.

Performing a differential Backup . :- A differential backup records


changes that have occurred in the database since the last full backup. Differential backups are faster and smaller than full backups. However, in case of a disaster the full backup must be restored prior to restoring any differential backups. If you weren't taking transaction log backups, you would only lose transactions that occurred from 4PM to the time when database became corrupted.

Performing transaction Backup :- Transaction log backups are not supported


by the SIMPLE recovery model (recall that the 'trunc. log on chkpt.' option has the same effect as the SIMPLE recovery model). Transaction log backups can only be restored after a full backup and differential backups (if any) have been restored. Transaction log backups impose less overhead on the server than full and differential backups; therefore, transaction log backups should be taken more frequently. Although transaction log backups take the least amount of time to generate, the total time required for recovering a database using such backups is the longest; you must restore the full backup first, then differential backups (if any) followed by all transaction log backups taken since the last differential backup.

Performing Backup .
1. Database a database that you want to backup. 2. Backup type you can select 2 options: Full and Differential. If this is the first time you backup the database, you must select Full. 3. Name Name of this backup, you can name anything as you want. 4. Destination the file that will be backup to. You can leave as default. Default will backup to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup 5. Click OK to proceed backup.The following dialog box appears 6. Database a database that you want to backup. 7. Backup type you can select 2 options: Full and Differential. If this is the first time you backup the database, you must select Full. 8. Name Name of this backup, you can name anything as you want. 9. Destination the file that will be backup to. You can leave as default. Default will backup to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup 10. Click OK to proceed backup.The following dialog box appears

Backup working process

. Select backup type Enter backup file name Provide path to save backup

The Database is the name of the currently selected Analysis Services database. They type of recovery will have to be specified. A timestamp for expiry of the database will have to be specified. Finally the destination will have to be specified. Under options the user will have the option to overwrite on a media or append to an existing database file. He will also be able to set an option to check media set name and backup set expiration or backup into a new media set and erase all backup sets. He will set options for verifying the backup when the operation is complete and perform a checksum before writing to the media. He can maintain transaction logs and write to a tape media and unload the tape after writing. Once he has set the options he can create the backup by selecting OK.

Wait for a while and youll see a pop-up message when backup is finished.

Click OK to exit the message box.

Browse to the destination, youll see a backup file (.bak format) which you can copy to other server for restore in the next step. Default backup directory is C:\Program Files\Microsoft SQL erver\MSSQL.1\MSSQL\Backup.

Restore the database.


1. Copy the backup file from source server to destination server. Ive copied into the same directory as source server.

2 3

. Connect to destination server. Open Microsoft SQL Server Management Studio Express and connect to BK01BIZ001. . Right-click on Databases. Select Restore Database

. Restore

Database window appears. On Source for restore, select From device and click [...] buttton to browse file.

5.

On Specify Backup, ensure that Backup media is File and click Add.

6 .On Locate Backup File, select the backup file. This is the backup file that was created in Backup a database section and was copied to this server. Click OK. OK.

Back to Restore Database window.

1.

On Destination for restore, select AdventureWorks. Note: If you havent added the backup file on Source before (step 4-6), you wont see the database name on Destination. On Source for restore, check the box in front of the backup name (in Restore column). Click OK.

2. 3.

Wait until restore finish and therell be a pop-up message notify.

Now youll see the restored database on the destination SQL Server.

You might also like