473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1283
jsfromynr (ja************@clovertechnologies.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****@sommarskog.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_changeobjectowner oldusername'+
char(39)+name+char(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************@clovertechnologies.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_changeobjectowner oldusername'+
char(39)+name+char(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****@sommarskog.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
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...
5
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...
5
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...
4
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>...
2
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...
2
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...
1
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
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...
5
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...
5
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.