Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get back dbo

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
CA
Hi,

I am creating a new account and I want to set it to have a similar access as "sa", using DBArtisan, at the last step of choosing the option, I select "User type: dbo", but I DON'T select the check mark for "Transfer Alias and Permision".... execute it. The end result is the current dbo account is shipped to my new created account, which causes some trouble of accessing. I then remove the old account, but recognizing that the dbo is also removed (yes, except the other db such as tempdb, master can not be interfered), but the dbo of my customer db is removed. Now I want to add it back, how can I do it?

Once I read somewhere in this forum that sa = dbo, is that true? However, I compare with another database and I still can see 2 separate account for sa and dbo. This confuses me. Anyway, the main thing here is how can I add back the dbo for the database?

Thanks
 
Trying to understand your problem.

User "sa" assigns a role of "dbo" in every database that it accesses. However, please do the following:

use <database>
go
sp_helpuser
go
sp_helpuser dbo
go

and send the output
 
Hi sybaseguru,

I already solve the problem, but still not satisfy with my solution.

- The problem is I don't have the original set up any more, it's gone, so if I use the sp_helpuser dbo, it will give me the information of what I set up, which I assign the account &quot;dbowner&quot; to &quot;dbo&quot;. Here it is anyway.

- The database we use for this is dbadmin
1> sp_helpuser dbo
2> go
Users_name ID_in_db Group_name Login_name
----------------- -------- ----------------- -----------
dbo 1 public sa
Users aliased to user.
Login_name
------------------------------
dbowner
(return status = 0)

- I'm not sure there are 2 seperate accounts of dbo and dbowner or just dbo with the login name is dbowner

thanks
 
There is no such thing as &quot;dbo&quot; login in sybase. &quot;dbo&quot; is a role. If you log in to sybase as &quot;sa&quot;, then &quot;sa&quot; automatically assumes the dbo role in whichever database it goes to.

In the above example you have got a Sybase login called &quot;dbowner&quot; and you have used sp_addalias dbowner, dbo (or a tool like dbartisan) to create this dbo alias for you in that database. As far as Sybase is concerned, any user can assume the role of dbo in a given database. Normally &quot;sa&quot; creates the alias as follows:

use <database>
go
sp_addalias <a Sybase login>, dbo
go

&quot;a Sybase login&quot; above can either be a normal user in this database (then sa does sp_adduser <a Sybase login>) or an alias to &quot;dbo&quot; but NOT both.


Have you or your dba backed up the database the night before you changed!

Ask your DBA to load the database somewhere if you have space or create a temporary device and load the dump on this newly created database. All you need to do is sp_help and sp_helpuser dbo on the old database to give you all the info you need. Otherwise once the old database is loaded bcp out &quot;sysusers&quot; and &quot;sysalternates&quot; tables and send it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top