由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - sql server 面试题 (7)
相关主题
SQL SERVER 2K5 schema vs. Oracle schema[转载] Re: Database and XML
sql server 面试题 (8)各位老大,管理数据库的用户,这样行吗?
sql server 面试题 (9)database schema 打印问题
怎么设置多个用户 (Oracle 10g)?question on JOIN on Oracle
SQL Developer, how to switch schema?A question about MS SQL Server database design
请推荐database的经典书database -> xml schema tool?
怎么准备第一份DBA工作关于schema
求指教 分布式数据库 对 DBA是透明的吗?a question on database design
相关话题的讨论汇总
话题: user话题: login话题: drop话题: sql话题: server
进入Database版参与讨论
1 (共1页)
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.
1 (共1页)
进入Database版参与讨论
相关主题
a question on database designSQL Developer, how to switch schema?
这个sql问题谁知道???请推荐database的经典书
我的DBA在生成ORACLE table的时候需要一个一个column看怎么准备第一份DBA工作
请问Facebook是用Mysql and php做的吗? (转载)求指教 分布式数据库 对 DBA是透明的吗?
SQL SERVER 2K5 schema vs. Oracle schema[转载] Re: Database and XML
sql server 面试题 (8)各位老大,管理数据库的用户,这样行吗?
sql server 面试题 (9)database schema 打印问题
怎么设置多个用户 (Oracle 10g)?question on JOIN on Oracle
相关话题的讨论汇总
话题: user话题: login话题: drop话题: sql话题: server