Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Restoring database

Author  Topic 

sunnyjassal
Starting Member

28 Posts

Posted - 2004-05-17 : 14:15:27
Hello,

I am new to the administration side of SQL Server 2000, so please bare with me.

What I am trying to do is recover a database that was on someone's else server. I asked them to give me a backup copy of the database and was successfully able to restore the Database.

But here are the problems I am encountering. Once I restore the db the old users that were on their database are showing up on that db. These users are not on my machine, so for security purposes I want to delete these users. I was able to successfully ad a user to the database which I want to use as the primary owner of the db. In this new user's properties I set him to be the owner of the database and in the properties of the existing owner I turn that person off as the owner. Now I try to delete this user, but it wont let me displaying this user is still an owner of objects.

I want to remove this user and use the user that I just created as the owner of the whole thing (tables, queries, Stored Procs, etc...). Or atleast be able to change the password of the existing user.

I am not sure how the following works but according to a line in existing asp code -
Conn.open ("Provider=sqloledb;Data Source=111.111.1.11;Initial Catalog=ZH;User Id=USRA;Password=usrabc;")

it seems like this application was using active directory.
If so... i want the restored database not to use the active directory, which is coming from the backup. Assuming that it is restoring the whole Active Directory stuff, how would I be able to disable this for the restored DB.

Thank you for your time, I would appreciate any help.


Sunny Jassal

nr
SQLTeam MVY

12543 Posts

Posted - 2004-05-17 : 14:37:00
A restore will only restore the database.
You can use sp_changedbowner to change the owner of the database.
You can use sp_changeobjectowner to change the owners of the objects in the database.

Look them up in bol.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-05-17 : 19:44:55
And probably a good lesson to learn while you're learning to be a DBA is that all objects should be owned by dbo unless there is a really, really good reason not to have them owned by dbo. So, when you are changing owners, go ahead and change them to that. Do the same thing in your development environment and see if your applications will still work. If they won't, fix them. If they will, implement the change in production.

Then, you'll never have this issue again. :)

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

sunnyjassal
Starting Member

28 Posts

Posted - 2004-05-18 : 10:34:55
Thank you for your help guys.. I really appreciate it.
Go to Top of Page
   

- Advertisement -