有没有办法从所有用户(sa,dba,代理作业等除外)隐藏数据库而不使其脱机 [英] Is there a way of Hiding a database from all users (except sa, dba, agent jobs, etc.) without taking it Offline

查看:125
本文介绍了有没有办法从所有用户(sa,dba,代理作业等除外)隐藏数据库而不使其脱机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个应该适用于SQL 2008或更高版本的问题....也可能会降到2005年的水平。

This is a question that should be applicable to SQL 2008 or above.... and possibly go down to 2005 level, too.

我们想做一些旧的数据库对外部用户不可见而不会更改权限。

We want to make some old databases invisible to outside users without changing permissions.

你会说 - 把它们脱机......但这会导致Ola的maint作业脚本出现一些问题;主要是索引统计工作。  (因为如果服务器上只有一个db离线,一些或一个dmv会产生错误)

You would say - take them OFFLINE …. but that causes some issues with Ola's maint job scripts; primarily index stat jobs.  (because some or one dmv generates error if only one db is offline on the server)

任何实用的想法?

来自波士顿的可爱的Cornelia

Lovely Cornelia from Boston

推荐答案

不幸的是,数据库不是安全的,所以唯一的选择是从puoblic中撤销权限VIEW ANY DATABASE。但现在用户只能看到他们拥有的系统数据库和数据库。他们仍然可以说"使用那个db"。如果他们
有权访问它。

Unfortunately, databases are not securables, so the only option is revoke the permission VIEW ANY DATABASE from puoblic. But now users will only be able to see the system databases and databases they own. They can still say "USE thatdb" if they have permission to access it.


这篇关于有没有办法从所有用户(sa,dba,代理作业等除外)隐藏数据库而不使其脱机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆