473,603 Members | 2,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database restore

Hi All,

I am trying to restore a database from backup on another system [my
client's] but I had to follow some weired steps.

Step 1. Restore the database from EM 's GUI.
[Users as on My machine get restored but their logins are not
activated. So I have to follow the next steps]

sp_helpuser shows me the userName but null LoginName and
DefaultDatabase

Step 2. Create a new login , grant access to the DB

Step 3. Then run the script to change the ownership from earlier DB
user to new user.

Step 4. In EM make new user as dbo.

Really weired steps.

There should be easier way to restore the database in simple and
effective manner

With warm regards
Jatinder

Jul 23 '05 #1
3 1291
jsfromynr (ja************ @clovertechnolo gies.com) writes:
I am trying to restore a database from backup on another system [my
client's] but I had to follow some weired steps.

Step 1. Restore the database from EM 's GUI.
[Users as on My machine get restored but their logins are not
activated. So I have to follow the next steps]

sp_helpuser shows me the userName but null LoginName and
DefaultDatabase

Step 2. Create a new login , grant access to the DB

Step 3. Then run the script to change the ownership from earlier DB
user to new user.

Step 4. In EM make new user as dbo.


Look at sp_change_users _login in Books Online.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #2
Thanks Erland,
It worked, I have another problem
by mistake I created all of my table in a user not as SA.so I tried
this to change the ownership

select 'EXEC sp_changeobject owner oldusername'+
char(39)+name+c har(39)+','+ char(39) +'dbo'+char(39) from sysobjects
where uid=6 {old user's ID}
It works but I am looking for some easy methods

With warm regards
Jatinder

Jul 23 '05 #3
jsfromynr (ja************ @clovertechnolo gies.com) writes:
It worked, I have another problem
by mistake I created all of my table in a user not as SA.so I tried
this to change the ownership

select 'EXEC sp_changeobject owner oldusername'+
char(39)+name+c har(39)+','+ char(39) +'dbo'+char(39) from sysobjects
where uid=6 {old user's ID}
It works but I am looking for some easy methods


It can't get any easier than that!

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6033
by: Jon Jacobs | last post by:
I attempt to back up a database on one server and restore it on my local machine. This is what the query text looks like: restore database model from Disk='c:\JQJ\mydump\model.bak' with replace I get this error:
5
7952
by: Kevin | last post by:
Can anyone recommend the easiest way to get a full copy of a database from one server to another. The servers are not part of the same organization or network. I have received a backup of the database created with enterprise manager but am unable to restore it into a database of the same name on my server. Thanks, Kevin
5
14696
by: Hassan Naqvi | last post by:
Hi, Basically, I am Java developer. In past I have played with Oracle using Java (JDBC). But this is the time to play with IBM DB2 using Java (JDBC). So kindly help this DB2 newbie. I have a file of 32 MB, named as "fdbk5.0". This is actually a database created in DB2 and containing records. I am interested in viewing the *structure of this database, i.e. table names, column names and finally all the records. How I can do this? Which...
4
8374
by: Knokmans | last post by:
Hi, All of this is still a test envinonment, but has to go on production.... I restore a database a database the follwing way db2 restore db <database> from <directory. taken at <timestamp> replace existing Then i only rollforward the (minumum) logs which are needed for recovery db2 rollforward db <database> to end of logs and complete The database in NOT in any pending state anymore
2
4130
by: anna_cheng11 | last post by:
We do not have a DBA available, and this is a development environment, hence I was asked to do the work. I am not a DBA. I need some help to clarify my understanding of DB2 recovery and I am reading the following as well. http://publib.boulder.ibm.com/infocenter/db2help/index.jsp I have a database say DB_INV on machine A and the database is backed up to tape, I am going to create a second system, say machine B with a database called...
2
3257
by: Stefan Schneider | last post by:
Hi, I have to copy an existing database from one Windows-Server to another one. The source database is a 8.1.0 database on a Windows 2000 Server, the destination database will be a newer 8.x database on a Windows 2003 Server. What is the preferred way to copy the old data to the new server? Should I use the backup/restore tools or is there a better way like copying the tablespace files?
1
6331
by: Mohammed Abdel-Razzak | last post by:
Dear sirs I`ve used SQLDMO to make a backup to my database How can I use it to restore database? thanks Mohammed
1
2287
by: ad | last post by:
I want to backup and restore a database in asp.net. The backup process is successful and fail when restore with message: User does not have permission to RESTORE database 'Health'. RESTORE DATABASE is terminating abnormally the restore SQL is : restore database Health from disk = 'D:\Data\ASPNET\Health8\Backup\myback.bck' and the backup SQL is:
5
3224
by: HSP | last post by:
hi. i need to restore an old database. The db was backed up using a DLT drive, using 2 volumes. The content for the tapes was copied to file onto Solaris machine using rsh and dd (for backup purposes). Now, the drive is defective and can't read the tapes anymore. Server is AIX 4.3.2 and database is IBM DB2 Server (DB2 for AIX Version 2.1.2)
5
4314
by: chow.justy | last post by:
Dear all, I'm a new beginner of DB2. I face 2 question during restore the data. I have 2 DB2 servers on my company. Server A is running on V7.2 and Server B is running on v8.2 (Enterprise Server). I backup a database from Server A and restore it on Server B. Question 1) "SQL2542N database name is not match on the source file" error
0
7996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7928
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3951
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.