我们只是为我们的用户创建一个简单的实用程序来触发他们的SQL Server数据库上的跟踪。 应用程序只需获取服务器连接详细信息,然后单击开始跟踪。 在引擎盖下它触发以下探查器命令行:
profiler /S MY-LAPTOP /U sa /P Admin123 /T "Tracer2008" /O "C:\Trace.trc" /M "05-16-14 10:15:46" /Z 20这种工作正常,因为已经有一个Profiler模板导入到名为Tracer2008的探查器中。
我已经导出了Tracer2008.tdf文件。 只是想知道我们如何通过命令行或某些庄园导入模板,以便在我们启动探查器调用之前它已经在系统中?
We are just creating a simple utility for our users to fire off a trace on their SQL Server Database. The App just takes their server connection details and they click start trace. Under the hood it fire the following profiler command line:
profiler /S MY-LAPTOP /U sa /P Admin123 /T "Tracer2008" /O "C:\Trace.trc" /M "05-16-14 10:15:46" /Z 20This works fine in there is already a Profiler template imported into the profiler called Tracer2008.
I've got the Tracer2008.tdf file exported. Just wanting to know how we can go about importing the template via command line or in some manor so that it already in the system before we fire off the profiler call?
最满意答案
您可以添加将模板从某个共享位置复制到预期的本地文件夹的步骤。 检查SQL Profiler模板是否缺失 - 其他修复步骤? 详情。
本地文件夹取决于探查器的版本以及要连接的服务器的版本。
例如,连接到SQL Server 2012的探查器的SQL Server 2012版本使用以下文件夹作为模板:
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Profiler\Templates\Microsoft SQL Server\110
You can add a step that copies the template from some shared location into the expected local folder. Check the SQL Profiler Templates Missing - additional repair steps? for details.
The local folder depends on both the profiler's version as well as the version of the server you are connecting to.
For example, the SQL Server 2012 version of the profiler connecting to the SQL Server 2012 uses the following folder for templates:
C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Profiler\Templates\Microsoft SQL Server\110
更多推荐
发布评论