tfs sql查询_TFS安装中SQL Server课程

tfs sql查询

介绍 ( Introduction )

More often than not (at least in places I’ve worked at), the job of installing, configuring and subsequent administration of Team Foundation Server (TFS) is performed by different individuals to those administering enterprise applications such as Windows Server, SQL Server, SharePoint etc. This is because TFS, unlike other enterprise applications, often has to be administered from both the server side (i.e. TFS Administration Console) as well as the client side (i.e. using Team Explorer in Visual Studio) – it is thus not surprising that a TFS administrators may once had been a developer. The benefit of having a TFS administrator with a software development experience is that it may be easy to get developer-buy-in into the tool. However, the disadvantage to this is that developers usually get accustomed to doing things in a certain way – like connecting to SQL Server using (local) convenience names.

通常(至少在我工作过的地方),Team Foundation Server(TFS)的安装,配置和后续管理工作是由与管理Windows Server,SQL Server, SharePoint等。这是因为与其他企业应用程序不同,TFS通常必须同时在服务器端(即TFS管理控制台)和客户端(即在Visual Studio中使用Team Explorer)进行管理–这并不奇怪TFS管理员可能曾经是开发人员。 拥有具有软件开发经验的TFS管理员的好处是,很容易让开发人员买入该工具。 但是,这样做的缺点是,开发人员通常习惯于以某种方式执行操作,例如使用(本地)便捷名称连接到SQL Server。

In this article we will take you through some of the lessons to look out for when configuring TFS as ignoring them would prove detrimental to the configuration of the tool. We also compare the configuration of SharePoint Server farm against that of TFS and illustrate why you have to pay a closer attention to TFS. We later conclude by recommending that the installation and configuration of TFS has to be a joint exercise between administrators of various applications and systems.

在本文中,我们将引导您完成一些教训,以了解配置TFS时的情况,因为忽略它们会损害该工具的配置。 我们还将SharePoint Server服务器场的配置与TFS的配置进行了比较,并说明了为什么您必须更加注意TFS。 后来,我们通过建议必须将TFS的安装和配置作为各种应用程序和系统的管理员之间的共同练习来得出结论。

第1课:不要使用方便名称作为SQL Server标识符名称 ( Lesson #1: Refrain from using convenience names as SQL Server identifier name )

Although, you can get away with using convenience names (i.e. a dot, (local), or locahost) as SQL Server identifier name during the configuration of a SharePoint server farm as shown in Figures 2 & 3, such a practice is not allowed during configuration of TFS (as shown in Figure 1).

虽然,你可以逃脱SharePoint服务器场的配置过程中使用便利的名字(即一个点,(本地),的locahost)与SQL Server标识符名称, 如图 23,这种做法是不允许的在配置TFS时( 如图1所示)。


The reason for this is that a successful configuration of TFS leads to the creation of databases – if you hosting the databases in an environment that has other instances, you can make a mistake of creating databases in the wrong instance. Although you can later move databases around, I reckon it’s rather better to do things right in the first place and that’s include correctly supplying the full names of the instance in which databases should be created.

原因是成功配置TFS会导致数据库的创建–如果将数据库托管在具有其他实例的环境中,则可能会在错误的实例中创建数据库而犯错误。 尽管您以后可以移动数据库,但我认为最好首先做一些事情,这包括正确提供应该在其中创建数据库的实例的全名。



第2课:SQL Server SID重复 ( Lesson #2: SQL Server SID duplicate )

In all fairness, the errors that lead to Lesson #2 are usually not caused by a SQL Server administrators or that you may have former developer masquerading as TFS administrators. Instead such errors are as a result to machine name changes possibly at the hands of Windows Server administrators. For instance, a change in the domain name in which SQL Server is installed (in our example, the domain name was renamed from computer generated WIN-QK43RU4ULNS to SELECTSIFISOLAB) often doesn’t break the functioning of SQL Server (and its related services) but the change does lead to a SQL Server login security identifier (SID) duplicate error that is depicted in Figure 4.

公平地说,导致第2课的错误通常不是由SQL Server管理员引起的,或者您以前的开发人员可能伪装成TFS管理员。 相反,此类错误是由于计算机名称更改的结果,可能是Windows Server管理员所为。 例如,更改安装SQL Server的域名(在我们的示例中,域名从计算机生成的WIN-QK43RU4ULNS重命名为SELECTSIFISOLAB )通常不会破坏SQL Server(及其相关服务)的功能但是更改确实导致SQL Server登录安全标识符(SID)重复错误, 如图4所示


Although the highlighted error message shown in Figure 4 refers to “SQL Server login”, this error really relates to windows-level principals that are based off windows domain or local logins.

虽然突出显示的错误消息如图4所示 指“ SQL Server登录”,此错误确实与基于Windows域或本地登录的Windows级主体有关。


Anyway, what happens is that generally every principal is assigned a uniqueidentifier generated-value called the security identifier (SID). There is often a one to one relationship between a SID and a principal but in some circumstances – a single SID may *seem to* be shared amongst more than one principal. Notice the emphasis on “seem to”? This is because, although – the changes may have been made to the workgroup or domain, technically – the linking of SID principal hasn’t changed i.e. although I have logged into SQL Server Management Studio using SELECTSIFISOLAB\Administrator as shown in Figure 6, SQL Server still has the administrator principal linked to the WIN-QK43RU4ULNS domain – thus, the source our SID conflict.

无论如何,什么情况是,一般每主要被分配称为安全标识符(SID) 唯一标识符生成值。 一个SID与一个委托人之间通常存在一对一的关系,但是在某些情况下–单个* SID可能*似乎*在多个委托人之间共享。 注意到对“似乎”的强调了吗? 这是因为,尽管-从技术上来说可能已对工作组或域进行了更改-SID主体的链接没有更改,即,尽管我已使用SELECTSIFISOLAB \ Administrator登录到SQL Server Management Studio, 如图6所示,SQL服务器仍然具有链接到WIN-QK43RU4ULNS域的管理员主体,因此,源是我们的SID冲突。


This is in contrast to the configuration of SharePoint whereby we are still able to proceed with our configuration in spite of SID conflicts. For instance, having specified the principal to access the database server as SELECTSIFISOLAB\Administrator (as shown in Figure 7), following the configuration – the principal mapped to SharePoint databases is still WIN-QK43RU4ULNS\Administrator (shown in Figure 8).

这与SharePoint的配置相反,SharePoint的配置尽管存在SID冲突,但仍然能够继续进行配置。 例如,已指定访问数据库服务器的主体为SELECTSIFISOLAB \ Administrator (如在 7中示出),配置以下- WIN-QK43RU4ULNS \ 管理员主要映射到SharePoint数据库仍然是( 8中示出)。



There a several ways that we can address SID conflict errors – all the solutions require that you as a TFS administrator, step out of your “comfort zone” and request assistance from SQL Server and/or Windows administrators (after all, they are the cause of your misfortunes, right? ).

我们有几种方法可以解决SID冲突错误-所有解决方案都要求您作为TFS管理员,退出“舒适区”,并请求SQL Server和/或Windows管理员提供帮助(毕竟,这是原因你的不幸,对吗?)。

  1. SQL Server side

    SQL Server端

    From the SQL Server side, you can replace the old principal with the newer one using one of the following methods:

    从SQL Server方面,可以使用以下方法之一将旧的主体替换为较新的主体:

    Rename using SQLCMD

    使用SQLCMD重命名

    Follow the suggestion provided in the error message (in Figure 4) and use SQLCMD to alter the login as shown in Figure 9.

    遵循错误消息中提供的建议( 图4 ),并使用SQLCMD更改登录名, 如图9所示。



    Figure 9: SQLCMD command
    图9:SQLCMD命令

    Rename using SSMS

    使用SSMS重命名

    In management studio, you can run the below script:

    在Management Studio中,您可以运行以下脚本:



    Figure 10: TSQL Login script-change
    图10:TSQL登录脚本更改

    Remove and Add New Login

    删除并添加新登录

    Another alternative to renaming conflicting principals would be to delete the old principal (WIN-QK43RU4ULNS\Administrator) and add a new principal (SELECTSIFISOLAB\Administrator). However, in my experience, a DELETE operation should always be the last resort. Thus, I recommend that if you were to fix the SID conflict from SQL Server side, rather try renaming conflicting principals.

    重命名冲突的主体的另一种方法是删除旧的主体( WIN-QK43RU4ULNS \ Administrator )并添加新的主体( SELECTSIFISOLAB \ Administrator )。 但是,以我的经验, DELETE操作应该永远是最后的选择。 因此,我建议如果要从SQL Server端解决SID冲突,请尝试重命名冲突的主体。

  2. Windows Server side

    Windows Server端

    The rate at which you will encounter this error is often rare because it’s not very often that organisational domain names or server machine names get renamed – but it happens, otherwise we wouldn’t have had this issue since early versions of TFS. Some of the changes to machine names may be unavoidable (i.e. server migration, company buy-outs, corrupt domain controllers etc.) but as an administrator, you would surely appreciate being informed in advance of any planned changes. So speak to Windows Server administrators about this – also get the SQL Server administrator involved as server changes will ultimately affect SQL Server too.

    您遇到此错误的频率通常很少见,因为组织域名或服务器名称不经常被重命名-但这确实会发生,否则,自TFS的早期版本开始,我们就不会遇到这个问题。 机器名称的某些更改可能是不可避免的(例如,服务器迁移,公司买断,损坏的域控制器等),但是作为管理员,您一定希望在进行任何计划的更改之前得到通知。 因此,请与Windows Server管理员联系-还要让SQL Server管理员参与,因为服务器的更改最终也会影响SQL Server。

结论 ( Conclusion )

Like so many installations of enterprise applications, often you run into installation/configuration interruptions because of failed validations that you were unaware of – a TFS configuration is no different. Thus, you should keep the channels of communications between server administrators as you possibly can.

像许多企业应用程序安装一样,由于您不知道的验证失败而使您经常遇到安装/配置中断的问题– TFS配置也不例外。 因此,您应尽可能保留服务器管理员之间的通信渠道。

看更多 (See more)

Consider these free tools for SQL Server that improve database developer productivity.

考虑使用这些免费SQL Server工具来提高数据库开发人员的生产力。

参考资料 (References)

Principals (Database Engine)
Configure Team Foundation Server using the advanced configuration
Overview of SharePoint 2013 installation and configuration

主体(数据库引擎)
使用高级配置配置Team Foundation Server
SharePoint 2013安装和配置概述

翻译自: https://www.sqlshack.com/sql-server-lessons-from-a-tfs-installation/

tfs sql查询

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值