2013/05/09

SQL Agent Log Error The process could not be created for step 1 of job reason 1314

今天發現一個錯誤訊息

The process could not be created for step 1 of job reason 1314

 

尋線追查後發現,若 SQL Agent 帳號有變更,需加入群組 SQLServer2005SQLAgentUser$<machine_name>,再重啟 SQL Agent 服務後排除問題

http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/f5201165-d675-46a7-abc7-24c92adb362b/

1314 = "A required privilege is not held by the client."
It is the SQL Agent account with the trouble perhaps, and not just the proxy account.
Make sure you reset the SQL Server service account by using the Configuration Manager, so that the service account you choose gets added into SQLServer2005SQLAgentUser$<machine_name>. If the current service account for SQL Agent is not in that group, add it to that group manually, or swap the service account to local system, save, then swap it back again to the desired account and type the password (using configuration manager)
You may have missed a couple of the user rights (administrators group may not include these privileges)
http://msdn.microsoft.com/en-us/library/ms143504(SQL.90).aspx
- Log on as a service (SeServiceLogonRight)
- Act as part of the operating system (SeTcbPrivilege) (only on Windows 2000)
- Log on as a batch job (SeBatchLogonRight)

- Replace a process-level token (SeAssignPrimaryTokenPrivilege)
- Bypass traverse checking (SeChangeNotifyPrivilege)
- Adjust memory quotas for a process (SeIncreaseQuotaPrivilege)

2013/05/07

KB-The EXECUTE permission was denied on the object usp_Michael, database dbMichael, schema 'dbo'

若帳號只屬於 db_reader,不是屬於 db_owner 角色時,語法中含有 store procedure or function 時,會出現此類錯誤訊息

The EXECUTE permission was denied on the object ????, database ????, schema 'dbo'

 

解決方式:

1.建立角色

CREATE ROLE [myRole] AUTHORIZATION [dbo]

2.設定執行預存程序或函式權限給與角色

GRANT EXEC ON dbo.usp_Michael TO myRole

 

3.將登入帳號加入角色

EXEC sp_addrolemember N'myRole', N'login_user'

2013/04/24

TF10151 Can not lock item xxx.dll for check out. this item has been xxx check out on xxx workspace (VS2010)

SNAGHTMLb3abfd0

 

---------------------------
Microsoft Visual Studio
---------------------------
TF10151: 無法鎖定項目 $/xxxx.Wcf.dll 以簽出。項目 $/xxxx.dll 已在工作區 xxxxxx 中由 xxxx 簽出。
---------------------------
OK  
---------------------------

---------------------------
Microsoft Visual Studio
---------------------------
The command you are attempting cannot be completed because the file xxxx.dll' that must be modified cannot be changed. If the file is under source control, you may want to check it out; if the file is read-only on disk, you may want to change its attributes.
---------------------------
OK  
---------------------------

 

發生的原因在於 VS2010 在 WebSite Project 的 Reference DLL 會自動 check out,加上 TFS 針對 DLL 這個類型是不允許合併(non-mergable),所以就會自動 Lock 鎖定。

 

目前我解決的方式是將 Team Project Collection 中,針對 dll 這種型別 check out 時,不需進行鎖定

image

 

SNAGHTMLb503434

2013/03/18

The connection name 'OraAspNetConString' was not found in the applications configuration or the connection string is empty

Event code: 3008
Event message: A configuration error has occurred.
Event time: 2013/3/18 下午 04:36:49
Event time (UTC): 2013/3/18 上午 08:36:49
Event ID: 14538e1dd6d04500b57f0eaee698b821
Event sequence: 103
Event occurrence: 1
Event detail code: 0
Application information:
    Application domain: /LM/W3SVC/1/ROOT/TEST/xxxxx 
    Trust level: Full
    Application Virtual Path: /TEST/xxxxx
    Application Path: D:\WEB\TEST\xxxxx\
    Machine name: MichAdelPC
Process information:
    Process ID: 38460
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
    Exception type: ConfigurationErrorsException
    Exception message: 在應用程式組態中找不到連線名稱 'OraAspNetConString', 或者連線字串空白. (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config line 284)
   at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
   at System.Web.Configuration.ProvidersHelper.InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType)
   at System.Web.Configuration.SiteMapSection.get_ProvidersInternal()
   at System.Web.SiteMap.Initialize()
   at System.Web.SiteMap.get_Providers()
   at Admin.Menu.BindMenu() in d:\WEB\TEST\xxxxx\admin\menu.ascx.cs:line 85
   at Admin.Menu.OnLoad(EventArgs e) in d:\WEB\TEST\xxxxx\admin\menu.ascx.cs:line 60
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\xxxxxx\1cb83f19\15321ffe\App_Web_4cg0xawa.8.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

在應用程式組態中找不到連線名稱 'OraAspNetConString', 或者連線字串空白.
   at Oracle.Web.Util.ReadConnectionString(NameValueCollection config)
   at Oracle.Web.SiteMap.OracleSiteMapProvider.Initialize(String name, NameValueCollection config)
   at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)

 

原因: Oracle Client 於 11gR5 之後,提供 ASP.NET Membership for Oracle,但是在安裝 Oracle 時,會要再進階設定才會正常

修正方式:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

<system.web>

<membership><providers>:移除 

<add name="OracleMembershipProvider" type="Oracle.Web.Security.OracleMembershipProvider, Oracle.Web, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName="" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />

<profile><providers>:移除

<add name="OracleProfileProvider" type="Oracle.Web.Profile.OracleProfileProvider, Oracle.Web, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName="" />

<roleManager><providers>:移除

<add name="OracleRoleProvider" type="Oracle.Web.Security.OracleRoleProvider, Oracle.Web, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName="" />

<siteMap><providers>:移除

<add name="OracleSiteMapProvider" type="Oracle.Web.SiteMap.OracleSiteMapProvider, Oracle.Web, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName="" securityTrimmingEnabled="true" />

<webParts><personalization><providers>:移除

<add name="OraclePersonalizationProvider" type="Oracle.Web.Personalization.OraclePersonalizationProvider, Oracle.Web, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" applicationName="" />

<healthMonitoring><providers>:移除

<add name="OracleWebEventProvider" type="Oracle.Web.Management.OracleWebEventProvider, Oracle.Web, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionStringName="OraAspNetConString" buffer="true" bufferMode="OracleNotification" />

2013/02/09

PPPoE/ADSL/光世代固定IP如何自動撥接?(Windows平台)

建立一個設定檔取名叫做 rasinfo.bin

(重要:請將設定檔放在一個安全的地方,例如 c:\windows\)

格式:

<PPPoE名稱>【tab】<撥接使用者名稱>【tab】<撥接密碼>

說明:

<PPPoE名稱>:要跟下圖撥接名稱相符

image

 

建立一個批次檔,DslAutoDial.bat

==========================================================

@echo off
setlocal enabledelayedexpansion
::rasinfo.txt
:: one line
:: <connection name><tab><username><tab><password>
:: Nothing else!!
for /F "tokens=1-3 delims=    " %%a in (c:\windows\rasinfo.bin) do (
    set ras_connect=%%a
    set ras_user=%%b
    set ras_pass=%%c
)
for /f "tokens=1* delims=:" %%a in ('ipconfig') do set exclude=%%b
set exclude=%exclude:~1,-1%

:loop
ping google.com -n 1|find /v "%exclude%"|>nul find /i "reply"
if not errorlevel 1 (
    echo Connected ^^ sleep 10 sec...
     >nul ping 0.0.0.0 -n 10
) else (
    ping google.com -n 1|find /v /i "%exclude%"|>nul find /i "reply"
    if errorlevel 1 (
        echo "PACKETS NOT BEING RECIEVED Orz..."
        rasdial %ras_connect% /disconnect
        rasdial %ras_connect% %ras_user% %ras_pass%
    )
)
goto loop

===================================================

說明:此批次檔會去 ping 0.0.0.0 若是沒有收到封包時就會撥接 PPPoE

 

 

設定排程:

啟動時間有兩個,一個是開機時跑,另一個是每小時跑一次

image

 

 

這樣子做就可以省一些錢去買自動撥接的軟體囉

2013/01/28

怪現象 TFS2012 , TF14045 the identity guid is not a recognized identity

遇到 TF14045 識別(Identity)錯誤,原本以為是 TFS2012 Update1的錯誤,但是與微軟連繫後,取得 hotfix 安裝後,仍是無法解決。

 

後來直接使用 SQL Profiler 抓取 TFS 的動作後,發現有以下指令

 

↓SQL Profilier請抓取 SP:Completed 及 RPC:Completed 這兩個事件

image

 

 

[copy code]
   1:  declare @p3 dbo.typ_GuidInt32Table
   2:  insert into @p3 values('<IDENTITY-GUID>',0)
   3:   
   4:  exec prc_ReadIdentities @partitionId=1,@descriptors=default,@ids=@p3
   5:   
   6:  declare @p2 dbo.typ_GuidTable
   7:  insert into @p2 values('<IDENTITY-GUID>')
   8:   
   9:  exec prc_ReadGroupMembership @partitionId=1,@identityIds=@p2,@childrenQuery=0,@parentsQuery=0,@includeRestricted=0,@minInactivatedTime=NULL,@scopeId='<SCOPE-GUID>',@returnVisibleIdentities=1;

LINE4,會出現結果,但是 LINE9就回傳空的結果集,這就有可能造成爆炸的原因。

 

解決的方式為:

在專案中加入此使用者,再查詢後就會 Active=1 的結果,若不需要此使用者繼續參與專案的話,可以再移除,此時會出現 Active=0

 

image

 

 

參考資訊:

升级TFS2012查看SOURCE-history部分提示TF14045: The identity xxx is not a recognized identity

升级TFS2012查看SOURCE-history部分提示TF14045: The identity xxx is not a recognized identity

2013/01/25

怪現象 VS2012 Publish not working

遇到了一個怪現象, VS2012 的 Publish 不動作,開啟茶包訊息輸出也找不到原因

SNAGHTML5c6f18d

 

3>        Done building target "GatherAllFilesToPublish" in project "xxxx.csproj".
3>Done building project "xxxx.csproj".
3>Publishing folder /...
3>
========== Build: 0 succeeded or up-to-date, 0 failed, 2 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

 

Publish Profiles 有放在專案裡面,設定檔砍掉再試試看一次,結果…成…功…了!!

image

 

找了一下網路的解決方式,似乎對我沒有用,我已經將我的解決方法丟至 StackOverFlow。

http://stackoverflow.com/questions/12201146/visual-studio-2012-web-publish-doesnt-copy-files