domingo, abril 21, 2013

Event ID 2289 — IIS Worker Process Tracing

À uns dias num projeto que tenho, estava a analisar erros de SCOM relacionados com IIS's e tive de pesquisar e acabei por encontrar este link abaixo.
Dei grants conforme indicado e deixou de ocorrer.


Event ID 2289 — IIS Worker Process Tracing
http://technet.microsoft.com/en-us/library/cc735142(v=ws.10).aspx

Event ID 2289 — IIS Worker Process Tracing

This topic has not yet been rated - Rate this topic
Updated: January 20, 2010
Applies To: Windows Server 2008
yellowIn Internet Information Services (IIS) 7.0, worker processes can trace request activity. Of the requests that reach the worker process, you can log successful requests, failed requests, or all requests. In order to log this information, the worker process identity must have permissions to create directories and subdirectories, and to write files to the directory configured for the site.

Event Details

Product:Internet Information Services
ID:2289
Source:Microsoft-Windows-IIS-W3SVC-WP
Version:7.0
Symbolic Name:W3_EVENT_FAILED_TO_DELETE_FREB_FILE
Message:FailedRequestTracing Module failed to delete at least one log file from the directory '%3'. The problem happened at least %1 times in the last %2 minutes. The data is the error.

 

sábado, abril 20, 2013

How to use Robocopy in a controlled way

Este script permite iniciar num CMD uma cópia de ficheiros com o Robocopy, escreve logs e ainda escreve no event viewer da máquina.

@REM COPY SYSFileStore
cls
eventcreate /ID 100 /L APPLICATION /T INFORMATION  /SO SYSBackupFileStore /D "SYSBackupFileStore Starting Process"
set TodayStr=%date:~6,4%-%date:~3,2%-%date:~0,2% %time:~0,2%^:%time:~3,2%^:%time:~6,2%
set TodayFile=copySYSfilestore_robocopy_status_%date:~6,4%-%date:~3,2%-%date:~0,2%.log
set ActualRobocopyFile=copySYSfilestore_robocopy.log
set PATH1=C:\DIR1
set PATH2=C:\DIR2
echo %TodayStr% ^| DEBUG ^| ^| ^| ^| ********************************************* >> %TodayFile%
echo %TodayStr% ^| DEBUG ^| ^| ^| ^| SYSFileStore started >> %TodayFile%
IF NOT EXIST %PATH2% (
 echo %TodayStr% ^| DEBUG ^| ^| ^| ^| This node is not the active node >> %TodayFile%
) ELSE (
 echo %TodayStr% ^| DEBUG ^| ^| ^| ^| Starting Robocopy : Must see the last robocopy file log  >> %TodayFile%
 Robocopy %PATH1% %PATH2% /MIR /FFT /Z /XA:H /W:1 /NFL /R:1 /LOG:%ActualRobocopyFile% & taskkill /F /IM robocopy.exe)
)
echo %TodayStr% ^| DEBUG ^| ^| ^| ^| SYSFileStore ended  >> %TodayFile%
eventcreate /ID 999 /L APPLICATION /T INFORMATION  /SO SYSBackupFileStore /D "SYSBackupFileStore Ended Process"
:END
exit /b %ERRORLEVEL%

How to write in EventViewer from command line

Para escrever no event viewer a partir do ficheiro *.cmd:

eventcreate /ID 100 /L APPLICATION /T INFORMATION /SO MDSBackupFileStore /D "Starting Process"

eventcreate /ID 999 /L APPLICATION /T INFORMATION /SO MDSBackupFileStore /D "End Process"

e voilá:


 

sexta-feira, abril 12, 2013

Como obter das bases de dados o espaço ocupado

Como obter das bases de dados o espaço ocupado

  1. aceder à bd em causa
  2. correr o comando abaixo
SELECT filename,
       name,
       size,
       Fileproperty(name,'SpaceUsed') AS spaceused
FROM   sysfiles

Para mais informações:

http://strictlysql.blogspot.pt/2010/03/finding-space-usedspace-left-on-data.html

quinta-feira, abril 11, 2013