Moving,SQL,Server,Database,ord DIY Moving A SQL Server Database


Normal 0 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable{mso-style-name:"Table Normal";mso-tstyle-rowband-size:0;mso-tstyle-colband-size:0;mso-style-noshow:yes;mso-style-parent:"";mso-padding-alt:0in When starting a new work at home business it is very easy to become consumed by it. We spend so much time trying to get the business up and running that we may end up becoming burned out and lose our motivation. There is so much to learn and


In order to get the database moved with minimal downtime, be sure to complete as many tasks ahead of time as possible to move quickly during this process. Many times, a database move requires that the application that uses it to be offline and this time should be minimized as much as possible. These tasks include:1. Identifying and opening all files that include connection string information to the database.2. Open all necessary windows/applications to perform necessary tasks:1. Locate and make note of the path and the name of the database .mdf / .ldf files on both the current and new SQL server for the database.2. Identify all usernames and passwords for the database.3. Open Query Analyzer on the new SQL server to run SQL commands.4. Open Enterprise Manager on both the current and new SQL server to complete necessary tasks. 3. Read through instructions at least once to help the process go smoothly. In summary, we'll backup the database, detach it, and then reattach it on the new sever. This process can be completed with Query Analyzer, but these instructions will be done via Enterprise Manager. Let's get started!Backup DatabaseThis is done as a precautionary step. This will allow us to have a good backup of the database up to the time of the move. (I actually do this before I make any changes to a database; you can never have too many backups!)1. Open Enterprise Manager, and navigate to databases.2. Right-click the database being backed up, select 'All Tasks' and then click 'Backup Database…'.3. Verify and make note of database name and the backup destination path. I usually change the destination path to 'd: empdbname.bak'. It isn't necessary to change it, but ensure you can find it if you need it.4. Under the 'Overwrite' section, select 'Overwrite existing media'.5. On the 'Options' tab, put a check next to 'Verify backup upon completion'.6. Click 'OK'. Detach the Database1. Right-click the database, select 'All Tasks', and then click 'Detach Database…'.2. At this point the current number of connections to the database will be displayed. If there are any connections, they must be cleared before the database can be detached. Click 'Clear'. You will then be prompted with 'This will end all active transactions in this database which is required before the database can be detached. Is it OK to proceed?' Click 'OK'. The next prompt is regarding notifying users. It will ask 'Do you want to notify the currently connected users that their sessions in the database will be ended?' I always click 'No' for web applications. And then click 'OK' to detach the database.3. At this point the database is detached (it will not appear in Enterprise Manager). Next, you'll need to copy the data file (.mdf) and transaction log (.ldf) file to the new server. By default, SQL server will create databases and put these files in the same directory (it's usually Program FilesMicrosoft SQL ServerMSSQLData). However, for performance gains, this may be changed so the transaction log file is put on another hard drive. Be sure to check the new SQL server to see how it is setup. If the transaction log files are setup on a different hard drive, it should be copied there and the data file should be put in its appropriate directory. And, when attaching the database, be sure the paths to the files are correct.Attaching the Database1. Right-click the database, select 'All Tasks', and then click 'Attach Database…'.2. Navigate to the data file by clicking the button that has 3 dots on it (…).3. Once you've selected the database .mdf file, you'll see the data file path (which should be verified for both the data and transaction log file) and have the option to choose the database name and owner. Attach it as the database name, and ensure the owner name is 'sa'.4. Verify the path for the transaction log file is correct. If the path isn’t correct, update it to the appropriate directory.5. Click ‘OK’. Note: If you didn't move the transaction log file to the new server with the data file, you'll be prompted to create a new one. If you choose to create a new one, it will be done for you automatically.Orphaned UsersIf the database user doesn't exist on the new server, create it now. When creating it, you may receive an error that it already exists, but that's ok, the work that needs completed by SQL Server to add the user account is done. After you receive the error that the user already exists, press cancel and continue on to the next user.Moving the database to a new server will result in orphaned users. You will need to run a stored procedure that will map the user in the database to a user on the server. This stored procedure will change the relationship between a Microsoft SQL Server login and a SQL Server user in the current database. Basically, it changes the SID in the database to match the one generated by the local server, which allows all custom permissions to be retained - it remembers the access and permissions.1. Open Query Analyzer.2. Select the database in the drop-down box on the tool bar if it isn't already selected.3. For each database user, we'll need to execute the command: "sp_change_users_login 'update_one', 'db_username', 'db_username'*" (without the double-quotes). *change the db_username to the actual database username in both places.Now update any connection strings to point to the new SQL server (this could have been done while the database was moving between servers to utilize all available time) and test it well. Also, check any DTS jobs, Full-Text Indexes and Replication configurations to ensure that they are set up on the new server as they won't fully move during this process. Now you should be set. Test it well and sit back, relax and reflect on a job well done.Sources:http://vyaskn.tripod.com/moving_sql_server.htmhttp://www.databasejournal.com/features/mssql/article.php/2224361http://vyaskn.tripod.com/troubleshooting_orphan_users.htmDesirée Harris is a support specialist with ORCS Web - a company that provides managed hosting services for clients who develop and deploy their applications on Microsoft Windows platforms.

Moving,SQL,Server,Database,ord

DIY

Soil testing as important as oil changes are for engines

When you have a vehicle that you are driving a lot, you know that oil changes are something that you need to do on a regular basis to keep your vehicle in good condition. This is the same as soil testing. Soil testing ensures that your soil ...

DIY

Foam bitumen - Sustainable Eco-friendly Roads

Dont you think it will be great if we have eco-friendly roads that will be sustainable and durable as well? If there are roads that are not harming the environment anymore? This isnt just something that is for the future. There are countrie ...

DIY

Soil Testing: It’s all about that soil

Soil testing. The success of your harvest is all about the quality of the soil. And, the only way to ensure that you have the best soil, is to know what your soil needs.Many dont think that soil testing is needed. They are only adding nutrie ...

DIY

Mobile Work and Aluminum Platforms That Fit Your Needs

There are many domestic, trade and industrial applications where an extension ladder is the best and safest choice. Although many people try to make do with tall stepladders, most don't know it's hazardous to stand on the top work platform o ...

DIY

Truck Access Platforms That suitable for you

Looking to plan and specialist a few kinds of platforms that give your workers safe access to single or multiple hatches on an assortment of Tank Trucks. In the event that your administrators are as of now getting to the highest points of tr ...

DIY

How to Choose a Custom T-shirt Printing Company?

Be it a family event, a noble cause, company event, or personal interest, wearing custom t-shirts gives importance to it. The fame of personalized shirts is soaring high with this. More and more men and women are wearing custom shirts while ...

DIY

Moving Jurney By Interm Packers and Movers

They perceive the ins and outs of transferring so it's a protected option to allow them to deal with your whole belongings as a result of they'll do it proper and do it with care. When you might be in a predicament corresponding to not havin ...

DIY

Use a Vacuum Excavation for an Unearthing Project

You may very well get yourself that you have to utilise a vacuum excavation for an uncovering venture. This can be anything from disposing of a channel that is blocked or to penetrate a gap in the ground without harming the encompassing zone ...

DIY

Detailed Information about Non-Destructive Digging

At the point when you consider digging a gap in the ground, the principal thing that rings a bell is this ordinarily winds up a total wreckage around the gap.Be that as it may, there is one technique called non-destructive digging. This is t ...

DIY

A Complete Guide to buying a Vacuum Truck

Buying a vacuum truck are something that you should consider on the off chance that you are searching for another business opportunity. There are a few advantages to having this sort of business in the event that you have a completely prepar ...

DIY

Best Methods of Underground Cable Detection!

While we are continually fabricating and remolding properties, unearthing is unavoidable and can be attempted for an assortment of reason. What we are going to discover right now while playing out an exhuming, you should discover any undergr ...

DIY

Vacuum Trucks Can Deal with Exact Unearthing Needs!

Some intriguing data about vacuum trucks. That it will have the option to give in your precise excavation and drilling needs. You may imagine that those enormous trucks won't have the option to penetrate precisely, without harming anything a ...

DIY

Utility Locators - Locating Underground Cable

There are numerous reasons why it is imperative to locate underground cables. Also, if the Cables can't be found effectively, the fiasco will be immense and can be destroying.This is the reason you have to ensure that you know however much a ...

DIY

Important Information about Hydro Excavation

Hydro excavation is the way toward expelling or moving soil with pressurized water. An air movement or vacuum is then used to move the dirt or trash to a garbage tank. This takes into account a non-damaging and progressively exact approach t ...

DIY

Foam Bitumen - Lab Tests for Pavement Construction

Foam Bitumen. Something that you probably won't have found out about. All in all, for what reason would it be advisable for you to consider what the different lab tests on bitumen for asphalt development are? But on the off chance that you a ...

DIY

Soil Testing & analysing Is Worth the Effort

There's nothing of the sort as a free lunch, even in the nursery. Contingent upon your soil's local ripeness and what you develop, your plants may perform for quite a long time without requiring extra manure. Be that as it may, at some point ...

DIY

Soil Testing For Construction

Soil testing is a significant piece of building and street development. Truth be told, no development task can continue without first ensuring the soil can bolster the heap. Subsequently, the reason for soil testing for construction is to de ...

DIY

Soil Testing Services for Construction Projects

Regardless of whether you are building your fantasy home, making an expansion to your current home or building up a business property, there is one thing that is of most extreme significance, soil testing. There are various building consulta ...

DIY

Property Insurance

Property is Peoples HopeIt is not wrong to say that property is a hope and main aim of every person. People put all their efforts and then purchase some property for time ahead reliability and safety. This property is result of a long term s ...