z***y 发帖数: 7151 | 1 问题来了!
这个是考察DBA的基本管理技能,主要看DBA是不是头脑清楚。 大概是去年的电面。
sql server 2005 only
1. As DBA, you need to drop one login from your db instance. Not only drop
the login, you also need to drop associated user with this login from all
databases.
Currently this user might be active in several databases.
what would you do?
Use script to give a solution.
2是关于security controls。
2. Project architect need to view the definitions of two stored procedures
on production server. Currently this user only has db_datareader |
c*****d 发帖数: 6045 | 2 1. logins and users
the following sql gives you a little hint
select
'select master..syslogins.name as login_name,'
+ name +
'..sysusers.name as user_name
from master..syslogins inner join sysusers
on master..syslogins.sid = sysusers.sid'
from
master..sysdatabases
【在 z***y 的大作中提到】 : 问题来了! : 这个是考察DBA的基本管理技能,主要看DBA是不是头脑清楚。 大概是去年的电面。 : sql server 2005 only : 1. As DBA, you need to drop one login from your db instance. Not only drop : the login, you also need to drop associated user with this login from all : databases. : Currently this user might be active in several databases. : what would you do? : Use script to give a solution. : 2是关于security controls。
|
p********l 发帖数: 279 | 3 1. sp_helplogins, sp_dropalias, sp_droplogin, sp_dropuser
2. Actually they already can view the source as datareader.
【在 z***y 的大作中提到】 : 问题来了! : 这个是考察DBA的基本管理技能,主要看DBA是不是头脑清楚。 大概是去年的电面。 : sql server 2005 only : 1. As DBA, you need to drop one login from your db instance. Not only drop : the login, you also need to drop associated user with this login from all : databases. : Currently this user might be active in several databases. : what would you do? : Use script to give a solution. : 2是关于security controls。
|
z***y 发帖数: 7151 | 4 1. Not complete...let's use new feature of SQL Server 2005 instead. Also,
can you drop user when the user has active connection? If you can, why? If
you cannot, how to proceed?
2. Are you sure?
【在 p********l 的大作中提到】 : 1. sp_helplogins, sp_dropalias, sp_droplogin, sp_dropuser : 2. Actually they already can view the source as datareader.
|
B*****g 发帖数: 34098 | 5 1最后两句说反了
【在 z***y 的大作中提到】 : 1. Not complete...let's use new feature of SQL Server 2005 instead. Also, : can you drop user when the user has active connection? If you can, why? If : you cannot, how to proceed? : 2. Are you sure?
|
S***k 发帖数: 370 | 6 1.
Get mapped users of a login
sp_helplogins
Get principal_id of a database user
select * from sys.database_principals
Get schema owned by the database user
select * from sys.schemas
change schema ownership if necessary
ALTER authorization on schema::schema_name to other_principal_name
Drop database user
Drop user user_name
Get session id of connections
select * from sys.dm_exec_sessions where login_name = 'login_name'
Kill session_id
DROP Login login_name
2.
Grant VIEW Definition ON OBJECT::Pro |
z***y 发帖数: 7151 | 7 多谢回复!窃以为这是最好的回答。
【在 S***k 的大作中提到】 : 1. : Get mapped users of a login : sp_helplogins : Get principal_id of a database user : select * from sys.database_principals : Get schema owned by the database user : select * from sys.schemas : change schema ownership if necessary : ALTER authorization on schema::schema_name to other_principal_name : Drop database user
|
p********l 发帖数: 279 | 8 Oops, I forgot this is for SQL 2005. There are a lot of differece between 2k
and 2k5. |