Link to home
Start Free TrialLog in
Avatar of motioneye
motioneyeFlag for Singapore

asked on

checking users db privilleges in sybase

How do we in Sybase checking user permissions (db role and server role), how do I have this report extracted for 200 users ? I know sp_helprotect will do but is there any other way by using T-sql to extract this information
Avatar of Joe Woodhouse
Joe Woodhouse

Have a look at sp_helprotect in sybsystemprocs. Sybase deliberately does not obscure the source SQL for these procs, so we can look at how they query the system tables.

If you're interested in roles, you should also look at sp_displayroles which can help you figure out what roles have been granted to other roles.

FWIW I agree sp_helprotect isn't very helpful in how it formats its output, I prefer to see it in a crosstab. Unfortunately I'm not in front of an ASE right now so I can't tinker with SQL for you... if this hasn't been answered by someone else by Monday (Australia time) I'll whip something up for you. But I'll be doing exactly what I've suggested to you - ripping off the source for sp_helprotect. :)
To expand on the above, you only have two ways of dealing with "logs are full":

1) remove some logs, or
2) make the log bigger

Bouncing ASE obviously doesn't make the log bigger. Unfortunately it doesn't help remove logs either, since we can only ever remove transaction logs up to the oldest uncommitted transaction. If everything before that point has been removed already, then no truncation method will work.

ie. dump tran won't work
dump tran with truncate_only won't work
dump tran with no_log won't work
restart ASE won't work

If your logs are really 100% full, and it includes one or more incomplete transactions that haven't yet been rolled forward or rolled back, then you can only truncate up to the first of those. If you already have, then your *only* option is to add more log space.

(Well, strictly speaking you can break your database and throw away the contents of the log and build a new one, but I'm not saying anything more about that since, well, it breaks your database and probably loses data. It's also unsupported!!)
Avatar of motioneye

ASKER

Hi Joe_Woodho&
Do you have the scripts which I can use to extract ?
ASKER CERTIFIED SOLUTION
Avatar of Joe Woodhouse
Joe Woodhouse

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial