Category Archives: 未分類

效能監控

感謝承修提醒了一個效能監控軟體 Windows Performance Analyzer 的連結討論,

http://www.qa-knowhow.com/?cat=67

它的安裝畫面與 blog 中稍有不同

image

廣告

設定 PowerShell 的 Credential Delegation

看來 PowerShell 若不設定 Credential Delegation 無法在遠端存取共享資源…

從 N1 透過 PowerShell 遠端登入到 N3,並要求 N3 存取共享資源,會有因為沒有身分而授權失敗的錯誤:

image

範例語法:

PS C:\Users\administrator.I> Enter-PSSession -ComputerName n3

[n3]: PS C:\Users\administrator.I\Documents> dir \\n1\logs
dir : 存取被拒。
    + CategoryInfo          : PermissionDenied: (\\n1\logs:String) [Get-ChildItem], UnauthorizedAccessException
    + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
 
dir : 找不到 ‘\\n1\logs’ 路徑,因為它不存在。
    + CategoryInfo          : ObjectNotFound: (\\n1\logs:String) [Get-ChildItem], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

參考 https://rkeithhill.wordpress.com/2009/05/02/powershell-v2-remoting-on-workgroup-joined-computers-%E2%80%93-yes-it-can-be-done/ 設定 Credential Delegation

  • 因為要連到 N3,所以 N3 現在扮演 Server,在 N3 以系統管理員身分執行 Enable-WSManCredSSP -Role Server

image

  • 在 Client,也就是 N1 執行 Enable-WSManCredSSP -Role Client -DelegateComputer n3

image

沒有做文中的群組原則設定,已經可以存取:

image

不知是否是測試用的機器在 Domain 內,可以走 Kerberos 而非 NTLM

image

 

在測通之後,嘗試透過以下的語法,從 n1 發起,一次存取 n1,n2,n3 的 log,放回到 \\n1\logs 共享目錄:

$ScriptPath=($MyInvocation.MyCommand.Path | Split-Path) + "\"
$cred=New-Object System.Management.Automation.PSCredential  (Get-Content ($ScriptPath + "id.txt")),(ConvertTo-SecureString (Get-Content ($ScriptPath + "pwd.txt")) -AsPlainText -Force)

Invoke-Command -ComputerName (Get-Content ( $ScriptPath + "ServerName.txt")) `
-FilePath ($ScriptPath + "GetMultiServerSQLInstanceProperties.ps1") `
-Credential $cred -Authentication Credssp

得到如下的錯誤:

[N1] 連線到遠端伺服器 N1 失敗,傳回下列錯誤訊息: WinRM 用戶端無法處理該要求。電腦原則不允許委派使用者認證至目標電腦。 請使用 gpedit.msc 並查看下列原則: 電腦設定 -> 系統管理範本 -> 系統 -> 認證委派 -> 允許委派新認證。 請確認已啟用該原則且設定適合目標電腦的 SPN。 例如,目標電腦名稱若為 "myserver.domain.com
",SPN 可為下列其中之一: WSMAN/myserver.domain.com 或 WSMAN/*.domain.com。 如需詳細資訊,請參閱 about_Remote_Troubleshooting 說明主題。
    + CategoryInfo          : OpenError: (N1:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : -2144108125,PSSessionStateBroken
[N2] 連線到遠端伺服器 N2 失敗,傳回下列錯誤訊息: WinRM 用戶端無法處理該要求。電腦原則不允許委派使用者認證至目標電腦。 請使用 gpedit.msc 並查看下列原則: 電腦設定 -> 系統管理範本 -> 系統 -> 認證委派 -> 允許委派新認證。 請確認已啟用該原則且設定適合目標電腦的 SPN。 例如,目標電腦名稱若為 "myserver.domain.com
",SPN 可為下列其中之一: WSMAN/myserver.domain.com 或 WSMAN/*.domain.com。 如需詳細資訊,請參閱 about_Remote_Troubleshooting 說明主題。
    + CategoryInfo          : OpenError: (N2:String) [], PSRemotingTransportException
    + FullyQualifiedErrorId : -2144108125,PSSessionStateBroken

可以理解,因為 Enable-WSManCredSSP -Role Client -DelegateComputer n3 執行時,並未有包含 n1,n2,但再度執行 Enable-WSManCredSSP -Role Client -DelegateComputer n3,n1,n2 依然有如上的錯誤

所以直接透過本機群組原則編輯器加入:

image

image

image

image

 

若在 N2 未以系統管理員身分執行 Enable-WSManCredSSP -Role Server,依然會有相同錯誤訊息

但 n1 自己對自己永遠失敗,改以 SPN 才行:

image

image

換句話說,n1 連 n1 自己,要用 n1.i.com (我的 domain 取 i.com)

參考資源:

https://technet.microsoft.com/en-us/magazine/jj853299.aspx

http://www.ravichaganti.com/blog/wp-content/uploads/2010/12/A%20layman’s%20guide%20to%20PowerShell%202.0%20remoting-v2.pdf

AS Tabular 的 Row Level 的 Role Base Model Security

Tabular Model 設計如下:

image

image

image

角色定義如下:

image

image

以 AS 的 Administrator 角色透過 Connection String 模擬 Role1 的結果

image

Provider=MSOLAP.6;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=TabularProject1_Byron_6f652aee-a22e-41fb-8df2-d60c4b278c0e;Data Source=SQL2014\I2;MDX Compatibility=1;Roles=Role1;Safety Options=2;MDX Missing Member Mode=Error;Optimize Response=3;Cell Error Mode=TextValue

 

直接以 C 帳號登入的結果

image

搭配 RS 時,透過動態產生連接字串:

image

其內容定義:

image

=IIF(Parameters!Role.Value="None","Provider=MSOLAP.6;Data Source=.\i2;Initial Catalog=TabularProject1","Provider=MSOLAP.6;Data Source=.\i2;Initial Catalog=TabularProject1;Role=" + Parameters!Role.Value)

報表參數定義:

image

報表設計如下:

image

其執行結果如下:

image

 

另外,有點奇怪的是:

在設計報表時,若資料來源選用 Analysis Services

image

則查詢一定要用 MDX 的產生器,因此不能寫 DAX

image

但若資料來源採用 OLE DB 的 Microsoft OLE DB Provider for Analysis Services 12.0

image

則可以自行編輯 DAX

image

由於 DirectQuery 只支援 DAX,所以若要採用 DirectQuery Mode 而非 InMemory Mode,且要利用 RS 呈現,或可如此撰寫 DAX

上述範例專案與報表:

https://onedrive.live.com/redir?resid=BF14192BD27975CB!56936&authkey=!AEM6dSaoa70pNmk&ithint=file%2czip

參考資料:

MVA — Implementing Tabular Model Solutions

Use EffectiveUserName with Excel Services (SharePoint Server 2013)

測試 Blog 移轉到 WordPress

試試看 Windows Live Writer 2011 Beta 是否可以發佈,若看得到應就是正常了…

SQL 2008 中文正式版自 MSDN 可以下載了

http://msdn.microsoft.com/en-us/subscriptions/default.aspx

Visual Studio 2008 SP1 中文正式版也可以下載了

瞌睡蟲

炎炎夏日,陣陣蟬鳴,微風徐來,嘹揚樂音。
但,滿腦子瞌睡蟲,是 AS 2008 引來的吧…沒有什麼明顯的新功能可以逐蟲,大杯的咖啡已經喝了,無效。

轉來寫網誌,是否能殺蟲呢…

好像不能,腦裡的漿糊正濃…

2008 準備

2008 年應該是個令人期待與懼怕的年頭,新玩具一籮筐,要學的技術好多。自己的技術以 SQL Server 為本,就以此為核心,向外推廣吧。
列一下個人的優先順序與目前的學習進度百分率
SQL Server 2008(2.5%)
   依然是管理、開發和 BI,又將是一場硬戰。自己的本,只有全面努力(5%)…
   Performance Point 2007(0%)
 
.NET Framework 3.5(5%)
   ADO.NET + LINQ(5%)
   WCF、WF(5%)
 
Windows 2008(1%)
   IIS 2008(1%)
 
隨著資訊進入每個角落,每項新技術都變成小眾市場,學習的時間和精力變成珍貴資源,如何有效投資需要仔細思考。

我們都只知道問題,但是永遠不知道跨過問題、另外一邊是甚麼

遍尋不著 SQL 2005 SqlDiag 工具程式的相關說明,只有一份韓國微軟的 PPT 看來還可用(http://download.microsoft.com/download/c/4/0/c40eec0a-c937-448d-a430-9643824fa713/1123_T1_S6.ppt),透過 Google 的韓文翻譯英文,然後猜天書吧(若再把它從英文翻成繁體中文,就更有加密的效果了)…
 
 SQL Server 2005 where it uses SQLDiag  
Efficiency diagnosis
Kim kind nine division chiefs (jkkim@microsoft.com)
With Korean microphone soft
 
 
SQLDiag is?
SQL Server 2005 diagnosis data acquisition services
PSSDiag tool chests with SQLDiag name fringe land.
It substitutes with the name whose SQLDiag where it is used from SS2K/7.0 is identical.
SQL the tool it will be able to collect all diagnosis data about Server relation issues in once
 
 
History
It draws up in 2001.
From inside the customer technical support department it was used in majority of SQL Server relation cases.
Tech support Edo use of different product. (Exchange backs)
It opens to the public to the public at 2003.
SQL from Server 2005 in server the internal organs.
SQL from from Server 2005 the tech support start against SQLDiag.
 
 
SQLDiag will be able to collect? 
Profiler trace
Blocking script/trace
Perfmon/Sysmon logs
Server configuration and state info
SQL Server error logs
Event logs
MSInfo
Virtually any other diagnostic
 
 
Service vs. Console App
Two branch multi operation possibility.
The case unmanned operational possibility which will be operated with service.
It records in log file and event log.
Supports self-registration/deregistration (/R, /U)
Supports service control (START, STOP and STOP_ABORT)
 
 
Start and middle finger
Console app
Run SQLDiag.exe to start it
Press Ctrl+C to stop it or create “stop file”
Press Ctrl+C a second time to stop ASAP
Service
SQLDIAG START to start it
SQLDIAG STOP to stop it
SQLDIAG STOP_ABORT to stop ASAP
 
 
Configuration file
XML and INI format supports
/I option it leads, designation
text with editor B GUI configuration app set possibility
 
 
Configuration file
From SQLDiag 3 branch default file provision:
SQLDiag.XML (default) – snapshot of error logs, configuration and state info and MSInfo
SD_General.XML – lightweight version of all diagnostics – Profiler, Perfmon and event logs and etc.
SD_Detailed.XML – heavier version of all diagnostics (stmt-level Trace events)
 
 
Objective machine and Instance
It designates from configuration file.
Basic price currently from all Instance of machines data collection
Specific machine or Instance designation possibility
 
 
Security
SQL about member of Server sysadmin groups Oh! box.
Login must be possible in the object Instance.
About member of Administrators groups Oh! box.
 
    When /G (Generic mode) to the case which is 3 bays it is sufficient.
 
 
Output
Basic output folder… 90 Tools Binn SQLDiag
/O it leads, fringe land possibility
Profiler and Perfmon rollover supports
While data acquisition /C1 option NTFS compressive possibilities about under using
 
 
Output 
The folder will become the name fringe land with automatic, or, it will cover, the possibility writing it was. (/N)
Profiler trace after being recorded in Log folder of server, movement.
Output file names machines and Instance names inclusion
Internal output file “have ##” prefix
 
 
Scheduling
/B option it leads beginning time set:
   SQLDIAG /B 20050819_11: 00: 00
Before the beginning time becomes by, CPU it does not use.
/E option it leads, middle finger timely set:
SQLDIAG /E 20050819_13: 00: 00
Regarding a start and the middle finger relative timely set possibility:
    SQLDIAG /B +02: 00: 00 /E +01: 00: 00
– It starts in 2 hour after, during 1 hour end after data acquisition
 
 
Scheduling 
/X option about under using corresponding point of view (snapshot) after data acquisition middle finger
/L option about under using with automatic after the middle finger which becomes schedule re-start
SQLAgent tube printed style of writing Scheduling possibility
 
 
Data acquisition of long period
With service execution about under registering
Target data collection hazard schedule use
Output folder renaming and auto-restart uses
.TRC and the hazard /C1 option use consideration which economizes the space where it is caused by with rolled over of .BLG file fields
 
 
Clusters
Against a lower part fact about all virtual server data with automatic extraction:
With objective server name “.”This the case which is set (default)
Becomes the accomplishment from Cluster, node the case where
/G (generic mode) the case which is not set (default)
It confirms Cluster virtual servers, about all Instance of each virtual server a data it collects.
 
 
Remote Machines
Recommend approach is to install the service on remote machines
SQLDiag regarding a remote server data acquisition possibility
TRC files come to move after being stored in corresponding server.
Different data in the machine where SQLDiag is accomplished store
 
 
Multiple Machines
Section against each machine in configuration file addition
All the data which is collected is together stored with output folder.
Each machine is allocated each Cabinet conference worker thread.
All efficiency log in low my BLG files south chaff burden.
 
 
Custom Tasks
Supports wide variety of custom tasks:
TSQL command
TSQL script (with parameters)
Registry query and backup
Copy file and list file
ActiveX scripts (VBScript, JScript and etc.)
Batch files, utilities and etc.
Groups and nesting
 
 
Custom Tasks
Support built-in and user-defined variables
Variables can be used within a task and embedded in TSQL scripts and or passed to sub-processes
Built-in:
startup_path, output_path
server, instance and server_instance
rsinstance, olapinstance
authmode, ssuser and sspwd
ssver, sspath, ssregroot and ssbatchrunner
output_name, internal_output_name
quietmode, compressionmode, genericmode and outputfoldermode
starttime, endtime
Environment variables
 
 
User-defined Variables
From configuration file designation or /V option designation possibility about under using
   SQLDIAG /V foo=bar
SQLDiag can prompt for variable values at runtime (console app only)
 
 
The effect which goes mad to Server
Performance
Minimal for collector itself (<10% CPU)
Usually equal to sum of selected diagnostics
Dominated by Profiler trace cost
Support objects
Created in tempdb and dropped afterward
Registry entries
None for console app
Deleted by service deregistration
 
 
GUI Configuration App
The creation and editing support against a configuration file
Against Collection, services the control support
Provides limited automatic problem diagnosis
 
 
SQLDiag vs. PSSDiag
Essentially the same tool (same code)
SQLDiag does not include support files for down level versions of SQL Server
SQLDiag does not support ZIP compression
SQLDiag can only be run by Administrators
 
 
Yukon SQLDiag vs. Sphinx SQLDiag
Yukon SQLDiag is a superset of Sphinx SQLDiag
Sphinx/Shiloh SQLDiag was a snapshot of error logs, configuration and etc.
No Perfmon, Profiler, blocking info, or customization
Snapshot collection only (no polling support)
No multi-instance or multi-machine support
No scheduling or built-in compression
Diagnostics collected serially rather than in parallel
 
 
FAQ
What’s the perf impact of running this?
Can I add new Perfmon counters or Profiler trace events?
Can I filter the Profiler trace?
Can I run SQLDiag via SQLAgent?
Can I add my own diagnostics to the collection set?
Can I collect diagnostics for Reporting Services, Analysis Services, Notification Services, etc.?
Can I customize the built-in scripts SQLDiag runs?
Can I run multiple instances of SQLDiag?
Is a 64-bit version available?
How do I troubleshoot problems with SQLDiag itself?
 
 
以上的過程是:
  1. 透過 Google 將韓文的 PPT 轉成 HTML
  2. 把韓文 HTML 貼到 Blog
  3. 用 Google 把該篇韓文 Blog 翻譯成英文
  4. 再把英文貼回 Blog

不知是否有更好的 idea 呢微笑

穩點吧

今天螢幕當了三次,在 Vista 64 雙螢幕且第二個螢幕的解析度調為 1400*1050 下,ATI X1600 常常一開 Windows Media 撥影像檔就會水波紋顫抖。
寫個文章,看個 Microsoft 的線上研討會,螢幕花了。
VPC 全螢幕要關機,螢幕當了,兩個螢幕都全白不回應。
重新開機後,再啟動 VPC,VPC 剛才是以當掉結束,一開始的 BIOS 畫面就占據整個子螢幕,雙銀幕都閃爍一下後,子銀幕再度水波紋。God!!!
耐心等 VPC 正常開機後再正常關機。然後重新啟動整個 Vista,如此才能 reset 顯示卡。
 
好不容易 ATI 網站的訊息似乎是提供了Vista 64 bit 的新 Driver,但 IE 7 卻以安全為由,禁止下載。
又需要透過 VPC 來下載。下載完開始安裝才發現是個舊版本 8.31.100.32
 
今天不過要寫點文章,就跟環境纏鬥了個把小時。
微軟的軟硬體上下游,大夥兒,穩點吧!!!