MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 22nd, 2003, 09:10 AM
Dagk's Avatar
Dagk Dagk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Scotland
Posts: 10 Dagk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Importing a database

Hi,

I have SQL Server 2000 running on an NT server.

I have set up another server also running SQL Server 2000 under Windows 2000.

I want to use the 2000 server for test purposes. I have a backup of the existing database on the NT server.

How do I go about importing the backup from the existing database on the NT server into my test server? Do I need to import the following databases ?

master
msdb
actual database

I have tried starting SQL in single user mode and trying to use the restore command to import the master database but this fails. What is the correct procedure for importing a database?

Reply With Quote
  #2  
Old August 22nd, 2003, 12:31 PM
WineIsGood's Avatar
WineIsGood WineIsGood is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: New York
Posts: 49 WineIsGood User rank is Private First Class (20 - 50 Reputation Level)WineIsGood User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 7 m 51 sec
Reputation Power: 10
All you have to do is to import the new actual database... you can leave the others alone. Just turn single-user mode on and lookup how to unlink and take a database offline. When you unlink it, find the data file on disk. Copy that file to the new server. Now go to the new server, create the database and "link" the file you just copied. It's an easy way to copy databases between servers. Of course, it only works if no one is using the server!
-Dave

Reply With Quote
  #3  
Old August 22nd, 2003, 05:52 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,239 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 15 h 17 m
Reputation Power: 4445
I usually just use DTS (Data Transformation Service) and copy objects to an empty db on the target server.

I'm pretty sure but not positive that you can just restore a SQL7 backup into SQL2000, that would be easier yet.

Reply With Quote
  #4  
Old August 23rd, 2003, 06:55 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 11
Send a message via AIM to unatratnag
Yes. It's possible to restore a SQL7 backup to a SQL2000 database but not the other way around.

Please let us know what you're problem is when you say it fails. Import/Export can be finicky and the errors are usually a good hint as to why. But i couldn't agree with Doug G more, DTS packages are definately the way to go in my opinion.

Reply With Quote
  #5  
Old August 24th, 2003, 05:47 AM
Dagk's Avatar
Dagk Dagk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Scotland
Posts: 10 Dagk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Everyone,

I have now used the import/export tool and it imported the db successfully (along with the master). Thanks for that.

I am now trying to connect to the "copy" database that I have just imported but I am now having further problems. In the original database I connect via ODBC settings. The original connection has an entry in the system DSN section. It is configured with a name, decsription and server with SQL server authenitication......using TCP/IP and I have set the default database to the required database. I thought that I would be able to connect to my new test server that has the "copy" database just by changing the name of the server but when I do this I get the following error.

'Data source name not found and no default driver specified'

What else do I need to configure in order to connect to my test database on my test server. What is the relevance of the name and description that is in the original ODBC settings?

Reply With Quote
  #6  
Old August 24th, 2003, 08:41 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 11
Send a message via AIM to unatratnag
well if this is sql 7 and 2000 you ported from to respectivly, i don't think you can just change the name of the ODBC. And you wouldn't want to anyways because other applications using the old ODBC might be using that name to connect to the SQL7 server and you'll be inadvertanly switching them to your test server, but in any case

if you go to system DSN and click the add button, you'll be able to configure a new DSN for your new SQL2000 server, or just delete the old one and remake it for your test server if you plan is to change all old connections to the new test DB. You should be able to select the SQL driver out of the list and continue on as is.

The name field, is what you will say in applications to connect using this ODBC. If i call the name "Black_Sabbath" in my open statements i'd say Conn.open("Black_Sabbath", "username", "password")
The description isn't used, you can type whatever you want here to help you remember what it's being used for specifically, i usually just give it the name of the Database so i know which DB this connects to, it's actually optional....

Reply With Quote
  #7  
Old August 24th, 2003, 10:32 AM
Dagk's Avatar
Dagk Dagk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Scotland
Posts: 10 Dagk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Unatratnag,

The version of SQL is the same on Win NT as it is on Win 2000 i.e MS SQL Server 2000. Is SQL ver 7.0 the same as SQL ver 2000?

I have changed the server name in the original ODBC connection to the new test server name but I am still getting the error messages mentioned previously.

Reply With Quote
  #8  
Old August 24th, 2003, 12:38 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 11
Send a message via AIM to unatratnag
Quote:
Is SQL ver 7.0 the same as SQL ver 2000?

yes, they are different

Quote:
I have changed the server name in the original ODBC connection to the new test server name but I am still getting the error messages mentioned previously.

I don't know what to tell you but to at least try my advice and completely create a new ODBC connection, or create a connection string from scratch....
I really really really think that's the problem....

Reply With Quote
  #9  
Old August 24th, 2003, 02:33 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,239 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 15 h 17 m
Reputation Power: 4445
Does the "test connection" pass in the ODBC manager for your DSN?

If it does, then you may have some typo or error in whatever code you're using to connect to the db.

Reply With Quote
  #10  
Old August 28th, 2003, 08:59 AM
Dagk's Avatar
Dagk Dagk is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Scotland
Posts: 10 Dagk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have tried deleting the old ODBC connection and creating the new one from scratch with the name of the test server instead of the original server.I still receive the following message:

"Data source name not found and no default server specified"

My test data connection failed but I am not concerned about that as the last ODBC connection which worked with the original server also reported a failed test!

Reply With Quote
  #11  
Old August 28th, 2003, 11:08 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 11
Send a message via AIM to unatratnag
well that's creepy, do you think it might be a WINs problem where the server thinks its still up but it's not?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Importing a database

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap