Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

SQL Server 2000 Installation Rollout Backout Plan


Published on

Published in: Technology
  • Be the first to comment

SQL Server 2000 Installation Rollout Backout Plan

  1. 1. Rollout and Back out plan for new SQLServer 2000 installationDetails Plan for SQL server Installation on a Standalone server discussing aspects of withPre/ Post considerations in brief with visual objects for real time implementation.10/13/2011TATA CONSULTANCY SERVICES LTD.Supreme MandalSystem EngineerAssociated ID 473199Version 1.01
  2. 2. INDEX -------------------------------------------------------------------------------------SQL Server Installation Rollout Plan Pre-Installation checkup ……………………………………………….. 3 Un-installation of SQL Server DB Engine ……………………………………………….. 7 Re-installation of SQL Server ……………………………………………….. 8 Post -installation Checkup ……………………………………………….. 19 Disaster Recovery ……………………………………………….. 23SQL Server Installation Back out Plan Pre-Installation checkup …………………………………………………. 44 TATA CONSULTANCY SERVICES Page 2
  3. 3. SQL Server 2000 Installation Roll-Out Plan Pre Installation Checkup Step 1: The First and Foremost thing is that after log-in on Server we have to check the status SQL Server ServiceManger in the system-tray the usual green-arrow indicates that the service (sqlservervr.exe) is running. Step 2:-If the Abnormal Red square blip on system tray then definitely SQL Server Service is stopped TATA CONSULTANCY SERVICES Page 3
  4. 4. Step 3:-Where the services means all three services (MSDTC, MS SQL Server, SQL Server Agent) Step 4:-We can stop SQL Server Service from Command Prompt Or from SQL Server Service Manger Residing in System Tray Step 5:- Detach Application database(s)Our Next Step will be Detach the application database (i.e like Northwind) and prior to detach ensure that"Update statistics prior to detach option" checkbox is checked Caution! Prior to detachment update statistics for db must be checked so after the reinstallation TATA CONSULTANCY SERVICES Page 4
  5. 5. Of SQL Server database Engine when we would like to attach the database it will be in updated version thusalleviating any user complaints Caution! Here we are not applying Conventional well –practiced Backup-Restore option though theprovision is there because after restoring the backup we have to re-check user access once again and that willput extra burden on post-installation check–up list TATA CONSULTANCY SERVICES Page 5
  6. 6. Step 6:-Database successfully detached Step 7:-Now if we return to Enterprise Manager, the Northwind database is no longer visible.(If it is still visible for you right click on "Databases" and choose "refresh").T-SQL Steps: In query analyzer, connect to the Northwind database and run sp_helpfile. This will give you the name andpaths for all of the files that you will need to attach. Note that the full path isnt shown in the image below dueto space constraints. Connect to the master database in Query Analyzer and detach the Northwind database. TATA CONSULTANCY SERVICES Page 6
  7. 7. Note that the Northwind database is gone. You cant connect to it using the dropdown list of databases inQuery Analyzer Un-installation SQL Server database engine Things to consider before you remove Microsoft SQL Server 2000 Caution!: You may have databases that you want to save in their present state. You may also want to savechanges that were made to the default databases. If either is true, before you follow the steps in this article,make sure that you have a known good backup of the data or that you save a copy of all the data and log files ina folder other than the MSSQL folder, because you must delete the MSSQL folder.The files you must save include these database files that Microsoft SQL Server 2000 installs:  Distmdl.*  Master.*  Mastlog.*  Model.*  Modellog.*  Msdbdata.*  Msdblog.*  Northwnd.* (optional install)  Pubs.*  Pubs_log.*  Tempdb.*  Templog.Warning If the SQL Server installation is also being used in conjunction with Microsoft SQL Server ReportingServices, make sure that the following folders and the sub-folders are also saved or renamed:  Default pathReporting Services  Default pathMSSQLReporting Services  Default pathSQL Server Instance nameReporting Services  Default path80ToolsReport Designer TATA CONSULTANCY SERVICES Page 7
  8. 8. Note Default path refers to %ProgramFiles%Microsoft SQL ServerRemove a default instance of SQL ServerTo remove a default instance of SQL Server locate, and then delete these registry keys:  HKEY_LOCAL_MACHINESOFTWAREMicrosoftSearch  HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMSSQLServer  HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesSQLSERVERAGENTRemove a named instance of SQL ServerTo remove a named instance of SQL Server, follow these steps:Locate, and then delete these registry keys for a Named Instance, where InstanceName is the name of the instance thatyou are removing.  HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMSSQLServer$InstanceName  HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesSQLSERVERAGENT$InstanceName In case of any error countered SQL Server 2000 Uninstall Option Does Not Remove All Files hereMicrosoft provided the FIX Re-installation of SQL Server Step 1:-The Auto run setup.bat File is located in the CD TATA CONSULTANCY SERVICES Page 8
  9. 9. Step 2:-Installation window launchedStep 3:-Welcome to setup Wizard TATA CONSULTANCY SERVICES Page 9
  10. 10. Step 5:-Choosing installation on local computerStep 6:-Creating a new instance TATA CONSULTANCY SERVICES Page 10
  11. 11. Step 7:-Furnishing User InformationStep 8:-Accepting End-User License Agreement TATA CONSULTANCY SERVICES Page 11
  12. 12. Step 9:-Installing both server and Client tool Step 10:-Choosing the Default Instance or you can opt for Named Instance TATA CONSULTANCY SERVICES Page 12
  13. 13. Step 11:-Checking Disk Cost before launching final installation Step 12:-Using local System Account On the following screen chooses “Use the same account for eachservice. Auto start SQL Server service” and “Use the local system account” TATA CONSULTANCY SERVICES Page 13
  14. 14. Step 13:-Choosing Windows Authentication Mode you can also opt for SQL Server Authentication whichcan be referred as Mixed Mode authentication. In case security perspective it will be wise to make Windows Authentication which is bonded with ActiveDirectory credentials thus leveraging robust security for possible thwarting of SQL Injection attack on Webserver As well as Data server. Step 14:-Set up starts copying program files in default location i.e. C:Program FilesMicrosoft SQL Server TATA CONSULTANCY SERVICES Page 14
  15. 15. Step 15:-If there is specific Service Pack like SP3 needed to be installed then it will be like below TATA CONSULTANCY SERVICES Page 15
  16. 16. Step 16:-Choosing Windows Authentication over SQL Server Authentication Step 17:-SP3 will detect if there in case of any blank password set earlier and it will indicate this flaw Step 18:-Service pack Setup Upgrade Wizard last information page will appear and checkbox must bechecked. TATA CONSULTANCY SERVICES Page 16
  17. 17. Step 19:-Error reporting assistance from Microsoft will appear as well. TATA CONSULTANCY SERVICES Page 17
  18. 18. Step 20:-Set up starts copying files Before Final rolling out last warning for backing up master & msdb database will appear as a part ofabsolute precaution measurement Step 21:-Set up finally Completed SP 3 on your machine TATA CONSULTANCY SERVICES Page 18
  19. 19. Post Installtion Checkup Step 1:-Well, First and Foremost thing after just pressing Finish button you have to rush to System RootFolder and search for setup.iss and sqlstp.log/sqlsp.log for details installation information.In current Version of SQL Server like 2008 the path should be navigated to C:Program FilesMicrosoft SQLServer100Setup BootstrapLog. Step 2:-Checking the Registry for some highly important piece of information likeYou can find out the install paths from the registry key corresponding to each instance.HKEY_LOCAL_MACHINESoftwareMicrosoftMicrosoft SQL Server{InstanceName} MSSQLServerSetupSQLPathThe names of all SQL Server instances on a computer can be found from the InstalledInstances valueHKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL ServerInformation related to SQL Server 2000 setup and minimal configuration information is storedHKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SQL Server Step 3:-Using Query Analyzer checking instance name and user logged in once again for confirmation TATA CONSULTANCY SERVICES Page 19
  20. 20. Step 4:-Install the Service Pack, Hotfixes and Cumulative Updates Step 5:-Configure SQL Server Services including SQL Server VSS Writer which is not available from enterprisemanager. Step 6:-Each & Every aspects of SQL Server properties must be checked like Server Settings, DatabaseSettings, Replication, Physical Memory, Processor, Security and Connection including Startup parameter andNetwork Configurations.Also three auto start policy checkboxes must be checked if they are found unchecked TATA CONSULTANCY SERVICES Page 20
  21. 21. Step 7:-Configure TempDB Step 8:-Set max degree of parallelism sp_configure option based on the number of physical CPU coresinstalled and anticipated workload Step 9:-Set cost threshold of parallelism sp_configure option based on the anticipated load. Step 10:-Attaching SQL Server Application databaseWe could copy these detached files to another server and attach them there if we wished (assuming that theserver setups were the same), but were not going to do that, were just going to reattach them to the samedatabase. In Enterprise Manager, right click on "Databases" and choose "All Tasks" then "Attach Database" TATA CONSULTANCY SERVICES Page 21
  22. 22. Step 10.1:-The "Attach Database" screen pops up. Hit the ellipses button to search for the .mdf (primarydata file) of the database to attach. Once selected, all files belonging to the database will appear. In our case, theprimary data file and the transaction log for the Northwind database are displayed. Choose the name of thedatabase to attach as, specify the database owner, then click the "OK" button. You will receive a notificationthat the attaching of the database has gone successfully. Click OK to continue. If you go into EnterpriseManager like in step 3, you will now see that Northwind appears in the database list (if it doesnt right click ondatabases and choose "Refresh"). Our Detach/Attach operation is now complete.T-SQL StepIn query analyzer, run the sp_attach_db stored procedure. Specify a database name and all file locations to pullfrom. You will get a notification in the Query Analyzer results pane that the command has completedsuccessfully. The Northwind database will once again appear in the dropdown list databases that are availablefor connection. The detach/attach operation is now complete. TATA CONSULTANCY SERVICES Page 22
  23. 23. Disaster Recovery Corruption of Master and msdb database and recovery procedureIn case of corruption of master and msdb databases steps are discussed here for a preemptive operation ofprobable disaster recovery technique Caution! Restoring Master DatabaseRecovering From a Situation Where SQL Server 2000 Wont Start Because the Master Database Has Been Lost You will need to have a backup device already created - for the exercise on creating a backup device, Getbackups of the system databases - the restore process will overwrite all of them, so its a good idea to have abackup Create a new database. In Enterprise Manager, right click on "Databases" and choose "New Database" The "Database Properties" screen pops up. Name your database "newdatabase" and click the "OK" button.You dont even have to look at the Data Files or Transaction Log tabs, well just take the defaults. TATA CONSULTANCY SERVICES Page 23
  24. 24. Create four backup devices. One for each of the following databases: model, master, msdb, newdatabase.Remember where you are putting these backup devices on the file system, you will need to know the locationlater. Below is how we set up our master backup device.. TATA CONSULTANCY SERVICES Page 24
  25. 25. Now back up each of the four databases mentioned in step 1 (master, model, msdb, newdatabase) to theirrespective backup devices that we created earlier in this exercise. Be very careful not to back them all up to thesame device, match each database to its own backup device. We are now going to find all of the files belonging to the master database. Right click on the masterdatabase and choose properties. Once on the properties screen, note the location of the data files and transaction log files by looking at thecorresponding tabs. We are going to delete these files to simulate a complete loss of the master database. TATA CONSULTANCY SERVICES Page 25
  26. 26. Exit out of Enterprise Manager and Query Analyzer if they are open. Stop SQL Server by right clicking onthe SQL Server icon in the systray. Youll be prompted to make sure that this is what you want to do, click the"Yes" button. At this point, you should probably make copies of the files we discovered in step 6 and rename them. Thatway if the restore doesnt work the first time, you should be able to just put the files back and restart thedatabase. After you have made the copies, delete the master database files that we found in step 6. If you now attempted to start the database by right clicking on the SQL Server icon in the systray andchoosing "MSSQLServer-Start", nothing would happen. The master database is damaged, and you need themaster database to even start SQL Server. Due to the bug mentioned in the Setup portion of this exercise, we need to do a little manual labor. Find thex86data directory on your installation CD and copy all files in this directory to a designated folder on yourhard drive. The folder I copied the files into is C:masterrecover. As you probably already know, when youcopy a file from CD to the hard drive, the file will be read only. The files must be made read-write for therebuild master utility to work. Highlight all of the files and right click. The properties screen will pop up.Uncheck the "Read only" box in the attributes section. We are now going to rebuild the master database and then eventually bring back the backup that we createdearlier in this exercise. Go to the directory that contains the rebuildm.exe application and run it. It will be in theMicrosoft SQL Server80ToolsBinn directory. TATA CONSULTANCY SERVICES Page 26
  27. 27. The Rebuild Master utility appears. Enter your server name and the directory on your hard drive whereyou copied all of your files to. Then click the "Rebuild" button. You will get notifications about copies occurring and about server configuration. If all goes well, you willeventually get the following prompt: For illustrative purposes, we are going to restart SQL Server. Right click on the SQL Server icon as shownin step 7, only this time select "MSSQLServer - Start". Start Enterprise Manager and browse the databases.Note that the "newdatabase" that we created earlier in this exercise is now gone. All of the system databasesshown have been copied directly off of the installation CD (via the directory that we copied these CD files to)."newdatabase" that we created earlier isnt shown because the master database keeps track of all of the usercreated databases, and the master database is contains only the information from the new installation. Also notethat all of the backup devices we created before are gone as well because we are dealing with a brand newmaster database as well as a new msdb database, which keeps track of backup devices, backups, and jobsamong other things. Were going to have to restore master and msdb to get the newdatabase back and to get ourbackup devices back. Exit Enterprise Manager and query analyzer if they are open. Start up SQL Server in single user mode asshown below. The sqlservr.exe application should be located in the MSSQLbinn directory. Start the databaseusing the -c and -m options. Minimize this DOS window to keep it out of the way, but dont close it. TATA CONSULTANCY SERVICES Page 27
  28. 28. -c option shortens startup time -m option starts up the database in single user mode. The database must be in single user mode to restore the master database.For more information, on starting the database in single user mode, look in Books Online under "StartupOptions" Start up Enterprise Manager. Right click on the master database, then choose "All Tasks" and "RestoreDatabase". The Restore Database screen pops up. Click the "From Device" radio button and then click on the "SelectDevices..." button. TATA CONSULTANCY SERVICES Page 28
  29. 29. The "Choose Restore Devices" screen pops up. Were going to restore from disk, to do this, we need to findour file, click the "Add" button. TATA CONSULTANCY SERVICES Page 29
  30. 30. The "Choose Restore Destination" screen is now shown. We cant choose a backup device because ourdatabase in its current form doesnt recognize any of our backup devices, and it wont until we restore the msdbdatabase - which we will do later. For now, click the "File name:" radio button and click on the ellipses tosearch for our master backup device. Find the master backup device you created very early in the exercise and click the "OK" button. TATA CONSULTANCY SERVICES Page 30
  31. 31. Youll now progress back through the screens weve already been on. Click "OK" on the "Choose RestoreDestination" screen. Click "OK" on the "Choose Restore Devices" screen. TATA CONSULTANCY SERVICES Page 31
  32. 32. Once were back on the "Restore Database" screen, click on the "Options" tab. TATA CONSULTANCY SERVICES Page 32
  33. 33. Youre just viewing the files that are going to be restored. Note that these files will overwrite our existingdata files, which is exactly what we want. Click the "OK" button. Youll see a restore progress screen. Once the restore is complete, youll get the following notification - thisis not an error message. The database has been successfully restored and now you are no longer connected insingle user mode. Youll also receive a message indicating that your connection in Enterprise Manager has beenbroken. Just close completely out of Enterprise Manager to avoid the annoying error messages. TATA CONSULTANCY SERVICES Page 33
  34. 34. Start up SQL Server by right clicking on the icon and selecting "MSSQLServer - Start" Go into Enterprise Manager and browse the databases. The newdatabase has once again returned. We neverwiped out the data files for "newdatabase", but now we have restored our original master database which has allrequisite information to load the master database. Your next step will be to restore the msdb database. The steps will be similar to the master database restore(steps 16-24) except you dont need to be in single user mode to restore the msdb database. After you restore themsdb database, restoring other databases on the server becomes much easier because the backup devices havebeen restored. If you go to restore model or northwind, the suggested restore files are presented directly to you,instead of having to try to find the .BAK file on disk. Rebuild Master failed with error -1:The other day I was trying to rebuild the master database for a SQL Server 2000 box. Everything was goingwell until the “Configuring Server” dialog popped up.The progress bar went across about 4 times and then an error message popped up. TATA CONSULTANCY SERVICES Page 34
  35. 35. That’s weird, you have rebuilt the master database a few times before and you have never encountered errorslike this one. You have to look for the error details and started with the cnfgsvr.out log file located inC:Program FilesMicrosoft SQL ServerMSSQLInstallBy looking at the log file, I could confirm the error, but it didn’t help to explain as why the connections hadfailed. So I ran eventvwr. One of the system log error mentioned something about MSSQLSERVER servicefailed to start. TATA CONSULTANCY SERVICES Page 35
  36. 36. At that point, I was still not sure what’d happened, so I then ran services.msc and tried to start theMSSQLSERVER service manually.The error message matched what I had seen in the event viewer. Path? What path? Suddenly as if stricken bylightening, I noticed “Path to executable:” had the short file names for the path. The question became obvious,what was MICROS~3?A quick look in the explorer revealed 5 long name folders starting with the word “Microsoft”.MICROS~3 happened to be “Microsoft Office” instead of “Microsoft SQL Server”. Now the cause of the issuehad been identified, I needed a way to work around it. For what I was doing at the time, I could not just reinstallSQL Server, therefore I decided to move the “80” and “mssql” folders into “Microsoft Office”. TATA CONSULTANCY SERVICES Page 36
  37. 37. What I had effectively done was making C:PROGRA~1MICROS~3MSSQLbinnsqlservr.exe a valid path.Then I reran rebuildm.exe and as expected, everything worked. Caution! Restoring msdb Database The msdb database stores all of our backup information and our job information. Were going to assume inthis exercise that we lose the data and transaction log for the msdb database. Fortunately, we have a backup thatwell be able to restore. The msdb database restore is a typical database restore, except that you must make surethat SQL Server Agent is stopped during the restore. Likewise master db You will need to have a backup devicealready created In Enterprise Manager, back up the msdb database by right clicking on the msdb database and choosing"All Tasks", "Backup Database". The backup database screen appears. Choose "msdb" as the database, provide a id, and give the database acomplete backup. Choose a destination device, and click the "OK" button. You will be notified that the backupoperation completed successfully. TATA CONSULTANCY SERVICES Page 37
  38. 38. Find out where the msdb data and transaction log files are. In Enterprise Manager, right click on the msdbdatabase and choose "Properties". The properties menu appears. Click on the Data Files and Transaction Log Files tabs to find the filelocations. TATA CONSULTANCY SERVICES Page 38
  39. 39. Shut down SQL Server by going into Enterprise Manager, right clicking on the Server and choosing"Stop". Delete the files that we found in step 4 from the operating system. Restart SQL Server by right clicking on the server in Enterprise Manager (just like in step 5) and choosing"Stop". Although it is difficult to replicate in this example, make sure that the SQL Server Agent is stopped beforewe begin the restore process. You cant restore a database unless you have exclusive access, and in the case ofthe msdb database, SQL Server Agent would ruin the exclusive access. In Enterprise Manager, right click on the msdb database, choose "All Tasks", and "Restore Database". Youwill probably get multiple error messages letting you know that there is a problem with the database and it cantbe opened. Just continue to click "OK" for each message. TATA CONSULTANCY SERVICES Page 39
  40. 40. After the error messages, the Restore database screen appears. Click the "From Device" radio button, thenclick on the "Select Devices" button. The other defaults should be fine (Were restoring a complete databasebackup set). You are taken to a "Choose Restore Devices" screen. Make sure that the disk radio button is selected andclick the "Add" button. We now choose a restore destination. Were going to click on the "Backup Device" radio button and selectthe same device that we backed our database to earlier in the exercise. Click the "OK" button. TATA CONSULTANCY SERVICES Page 40
  41. 41. Just click the "OK" button when you are returned to the "Choose Restore Devices" screen. Notice that ourDevice name is now established. You are returned to the "Restore Database" screen. Just click the "OK" button and the database will berestored. TATA CONSULTANCY SERVICES Page 41
  42. 42. We are notified that our restore process is complete and were done.T-SQL Steps: Backup the database in Query Analyzer. While connected to the msdb database in Query Analyzer, find the path for the msdb data and transactionlog files by using sp_helpfile (The entire path is truncated in the image). Shutdown the server from Query Analyzer. Delete the files from step 2 in the Operating system. Start up SQL Server in Enterprise Manager by right clicking on the server and choosing "Start". TATA CONSULTANCY SERVICES Page 42
  43. 43. Although it is difficult to replicate in this example, make sure that the SQL Server Agent is stopped beforewe begin the restore process. You cant restore a database unless you have exclusive access, and in the case ofthe msdb database, SQL Server Agent would ruin the exclusive access. We need to get a file number for our RESTORE DATABASE statement. We run the RESTOREHEADERONLY statement while connected to the master database and discover that there is only one file in ourbackup device, and this is the backup set that we will need to restore. Restore the msdb database while still connected to the master database in Query Analyzer, and our restoreprocess is complete. TATA CONSULTANCY SERVICES Page 43
  44. 44. SQL Server 2000 Installation Back-Out Plan Pre-installation CheckupConsidering the hardware factors on the stand alone server we have to repeat from Step 1 to Step 7 as the preinstallation checkup. Un-installation SQL Server database engineCompleting Pre-installation Checkup we shall ramble down to the street of un-installation if face some someunexpected error like “SQL Server 2000 Uninstall Option Does Not Remove All Files” then we have tocheck Microsoft support center site mentioned earlier Once you remove SQL Server executables from stand alone machine then there we would have benn leftno choice but to move forward accepting next stage i.e. Re-installation of SQL Server. So you have to be verycautious before removing un-installation and during removal of Default or Named Instance. There must be proper back up of each data file (.mdf) and log file (.ldf) for each database (system andapplication both) running under SQL server database engine. If case of any discrepancy occurred (like Hardware unable to meet requirement or any other runtimeerror) if you have no choice but to abort the mission then perform step 10 in Re-installation of SQL Serverand attach those database files after restarting sqlservr.exe service After attaching those file Run below command against each database here Northwind If there is no error message then everything is fine TATA CONSULTANCY SERVICES Page 44