Friday, November 13, 2009

NetApp Perfstat tool Usage

Perfstat is a NetApp tool that you can monitor and reveal your NetApp Storage devices . You can download it from NetApp web site.

Usage of perfstat is;

perfstat -f IPAddressofNetAPP -t 10 -i 12 > perfstat.out

10 : Get statistics for every 10 minutes;
12 : Number of sample
perfstat.out : Name of the file that log will be saved into.
Read more...

Monday, August 24, 2009

Reindex SQL Server Database

Sometimes you may need to reindex your database while you transport it from SQL 2000 to SQL 2005.

Execute the command below(Write your db name instead of mydatabasename)



DECLARE @Database VARCHAR(255)
DECLARE @Table VARCHAR(255)
DECLARE @cmd NVARCHAR(500)
DECLARE @fillfactor INT
SET @fillfactor = 90
DECLARE DatabaseCursor CURSOR FOR
SELECT name FROM master.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb','distrbution')
ORDER BY 1
OPEN DatabaseCursor
FETCH NEXT FROM DatabaseCursor INTO @Database
WHILE @@FETCH_STATUS = 0
BEGIN
SET @cmd = 'DECLARE TableCursor CURSOR FOR SELECT table_catalog + ''.'' + table_schema + ''.'' + table_name as tableName
FROM ' + @Database + '.INFORMATION_SCHEMA.TABLES WHERE table_type = ''BASE TABLE'''
-- create table cursor
EXEC (@cmd)
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @Table
WHILE @@FETCH_STATUS = 0
BEGIN
-- SQL 2000 command
--DBCC DBREINDEX(@Table,' ',@fillfactor)
-- SQL 2005 command
SET @cmd = 'ALTER INDEX ALL ON ' + @Table + ' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR(3),@fillfactor) + ')'
EXEC (@cmd)
FETCH NEXT FROM TableCursor INTO @Table
END
CLOSE TableCursor
DEALLOCATE TableCursor
FETCH NEXT FROM DatabaseCursor INTO @Database
END
CLOSE DatabaseCursor
DEALLOCATE DatabaseCursor

Read more...

Hide SQL Server Database(s)

Sometimes you may want to hide SQL Server databases from unauthorized users.(Like hosting firm etc.)
To show SQL databases to only authorized users follow the steps below;

Open New Query;

Execute the command below to remove "view all database(s) right" from public role;

USE master
GO
DENY VIEW any DATABASE TO public

Thsn Execute command below to append users to view and own database

USE database_name
GO
EXEC sp_changedbowner username

Read more...

Thursday, May 28, 2009

Event ID: 17896

Event Type: Information
Event Source: MSSQLSERVER
Event Category: (2)
Event ID: 17896
Description:

The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.







Check the Links Below;
http://blogs.msdn.com/psssql/archive/2006/11/27/sql-server-2005-sp2-will-introduce-new-messages-to-the-error-log-related-to-timing-activities.aspx



http://support.microsoft.com/default.aspx?scid=kb;en-us;931279




CPU numberStatements to enable processor affinity
02 CPUsexec sp_configure 'affinity mask', 0x00000003
GO
reconfigure
GO
04 CPUsexec sp_configure 'affinity mask', 0x0000000F
GO
reconfigure
GO
08 CPUsexec sp_configure 'affinity mask', 0x000000FF
GO
reconfigure
GO
16 CPUsexec sp_configure 'affinity mask', 0x0000FFFF
GO
reconfigure
GO
32 CPUsexec sp_configure 'affinity mask', 0xFFFFFFFF
GO
reconfigure
GO


Read more...

Wednesday, May 27, 2009

Get Missing indexes on your Database(s)

Execute the command below;


SELECT DB_NAME(database_id) AS [DATABASE],
Equality_Columns, Inequality_Columns,
Included_Columns, STATEMENT
FROM sys.dm_db_missing_index_details
ORDER BY 1

where DATABASE is your DB Name where missing index(es) found.
equality_columns index is required on these columns
inequality_columns is list of columns that are used for inequality comparison and index is required on these.
included_columns is list of columns that are used in query for other than comparison and covering index on these is suggested.
Statement is name of table along with column where index is missing

Read more...

SQL Server 2005 recovery Models

The recovery model of database determines the type of database transactions are logged and the degree of concern that provided to data loss in case of any failure.

Full Recovery Model of SQL Server 2005

The full recovery model does the most extensive logging and allows the database to be recovered to the point of failure. Full recovery model presents the highest protection against data loss. You should always configure all production databases to use full recovery.

Bulk-logged Recovery Model of SQL Server 2005


The bulk-logged recovery model fully logs transactions but mostly bulk operations, such as bulk loads, Select statements. Bulk-logged recovery model allows the database to be recovered to the end of a transaction log backup only when the log backup contains bulk changes. Recovery to the point of failure is not supported.

Simple Recovery Model of SQL Server 2005

Simple recovery model logs most transactions, logging only the information required to ensure database consistency after a system crash or after restoring a database backup. With simple recovery model the database can be recovered only to the most recent backup. This recovery model has the should not be used where data loss in the event of a crash cannot be tolerated.


Read more...

View SQL Server Error log's detail by SQL Commands

Execute the command below to get error logs Archive number.




exec sp_enumerrorlogs






Then execute ;


exec sp_readerrorlog archivenumber






Read more...

Wednesday, May 20, 2009

SQL Server System Statistical Functions

@@TIMETICKS
Number of millionths of a second in a timer tick.
@@CONNECTIONS
The number of connections or attempted connections.
@@CPU_BUSY
Timer ticks that the CPU has been working for SQL Server.
@@IDLE
Time in timer ticks that SQL Server has been idle.
@@IO_BUSY
Timer ticks that SQL Server has spent performing I/O operations.
@@PACKET_ERRORS
Number of network packet errors that have occurred.
@@PACK_RECEIVED
Number of packets read from the network.
@@PACK_SENT
Number of packets written to the network.
@@TOTAL_ERRORS
Number of read/write errors during I/O operations.
@@TOTAL_READ
Number of disk reads.
@@TOTAL_WRITE
Number of disk writes.

Usage:



Example : (Get SQL Server I/O)





Read more...

Tuesday, May 12, 2009

Check if index(es) used in your Query.

Open New Query and write your query. Before executing your query press CTRL + L see estimated execution for your query. You can mouse over each node in the execution plan to get more information about that step, such as the type of operation that node represents, the number of rows affected, and a breakdown of the costs associated with that step.






Read more...

Monday, May 11, 2009

Check if Trace is running on your SQL Server

Execute the code below on SQL Management Studio check if trace is running on SQL server.

SELECT * FROM fn_trace_getinfo(default);
GO
Read more...

Saturday, May 9, 2009

HP NC373i Disappears after Installing HP PSP Version 8.x

If your NIC Card (NC373i) has disappeared on HP BL460c server after applying PSP 8.x Pack follow the steps below to bring it back.

To resolve this issue, delete the wdf01000.sys from c:\windows\system32\drivers\ , and then re-run the HP PSP package.
Read more...

Blue Screen Error 0x0000007E (0x00000005, 0x80888D615, 0xF7906C08, 0xF7906904) on HP Servers

If you are getting Blue Screen Error 0x0000007E (0x00000005, 0x80888D615, 0xF7906C08, 0xF7906904) on HP BL460c while trying to shutdown your HP server (BL,DL series ) read and apply the steps below;




Cause : You probably have installed the PSP 7.80 nic drivers (v3.0.5).

Solution : You should rollback your driver to previous version or apply the latest version of your Nic drivers.


I have applied the CP008415.exe pack from PSP 8.00 and the problem has gone away now.

If your are trying Nic drivers coming with PSP 8.20 , you could experience the problem;

Notice: (Revision) HP NC-Series Broadcom 1GbE Multifunction Driver for Windows Server - First Update to Version 4.6.16.0 To Avoid Message "HP Virtual Bus Device Installation Requires a Newer Version. Version 4.6.16.0 is Required."

Check the Link Below;

http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c01684544&dimid=1002159936&dicid=alr_apr09&jumpid=em_alerts/us/apr09/all/xbu/emailsubid/mrm/mcc/loc/rbu_category/alerts

Read more...

Thursday, May 7, 2009

SQL Server Detailed Memory Usage Information.

You can use DBCC Memorystatus command to view detailed memory information.





Check http://support.microsoft.com/kb/907877 for meanings

Read more...

Wednesday, May 6, 2009

Enable Network Connection for MSDE

By default remote connecion to MSDE engine is disabled. You should enable network connections on MSDE to connect remotely.

Follow the steps below;
1) Start --> Run --> svrnetcn (This command Launchs SQL Server Network utility)

Choose TCP/IP connections click --> Enable

Click Apply -> OK

And Restart SQL Server service.



MSDE starts to listen requests from TCP 1433


Read more...

Monday, May 4, 2009

View MAC Address(es) and IP Address of devices connected to Cisco Router

Execute the show arp command and get the MAC and IP address of devices connected to Cisco Router.
Read more...

CPU(s) operating at reduced performance level due to a low power cap

You should disable power capping or set it to a value which is greater then the current in the iLO2.

Open ILO2 Choose Power Management TAB.


If power capping feature is not available;



install latest version of Power Management Module.

Read more...

Message Tracking in Exchange 2007

By default in Exchange 2007 , message tracking system is enabled. Youcan use message message tracking logs for mail flow analysis as well as troubleshooting .

You can get message tracking system settings by using Get-TransportServer for Edge and Hub transport roles and the Get-MailboxServer for Mailbox server roles.








You can modify the message tracking settings by using the Set-TransportServer and Set-MailboxServer





Using these commands above you can ;

Enable or disable message tracking system (Enabled by default)
Enable or disable logging of message subject lines (Enabled by default)


Set the maximum size of log files (10MB by default)
Set the maximum size of the log file directory (250MB by default)
Change the path of the log file (‘C:\Program Files\Microsoft\Exchange Server\TransportRoles\Logs\MessageTracking’ by default)


Set the maximum age of message tracking log files (30 days by default)





Example Command





Set Maximum Directory size 1 GB maximum log file age 40 days





C:\>[PS] C:\Users\Administrator\Desktop>Set-TransportServer SV2008 -MessageTrackingLogMaxDirectorySize 1GB -MessageTrackingLogMaxAge 40.00:00:00[PS]






Searching Message Tracking Logs

Message sent from ittips@tricks.com to test@exchange2007.net between dates releated. (First 50 Result)

[PS] C:\>Get-MessageTrackingLog -Server SV2008 -EventID SEND -Sender ittips@tricks.com -Recipients test@exchange2007.net -Start 1/1/2009 -End 2/4/2009 –ResultSize 50

Search By Subject

$hubs Get-MessageTrackingLog -MessageSubject "Production" -Start "1/01/2009 00:00:00" -End "1/04/2009 23:59:59


Read more...

The properties on 'user name' have invalid data Error on Exchange 2007

If you get The properties on ''username" have invalid data. If you click OK, default value will be used instead and will be saved if you do not change them before hitting Apply or OK on the property page. If you click cancel, the object will be displayed read-only and corrupted values will be retained.The following values have invalid data: Database error on Exchange 2007 try the steps below.

1)Remove the users from within Exchange Server and Reboot Server,
2)Add users again and assigen them to the primary mail database


or check!

http://support.microsoft.com/kb/951710

Read more...

Saturday, May 2, 2009

Terminal Services Black Screen RDP Session

Solution Offer.
Cause to this situation can be MTU settings.

Try the following Steps Below.

1. Start > Run > Regedit
2. Navigate to HKLM \ System \ Current Control Set \ Services \ TCPIP\ Parameters
3. In the right hand pane, Right Click > New > DWORD
4. Call it EnablePMTUBHDetect set its hex value to 1
5. Reboot
Read more...

Expired Credentials. Windows needs your current credentials to ensure network connectivity.

If you get the warning "Expired Credentials. Windows needs your current credentials to ensure network connectivity. Please lock this computer then unlock it using your most recent password or smart card." after logging to your computer .

Follow these steps below,

1) Check if your computer system time is matched +/- 5 minutes to your DC's time.
2)Try Use "net use * /d" command to delete all mapping drives. Then use "net use \\servername password /u:domainname\username" to cache the credentials. Relogon
3)Check the link
http://searchwindowsserver.techtarget.com/tip/0,289483,sid68_gci1022111,00.html
Read more...

Wednesday, April 29, 2009

Deleted Files are shown while performing search on Windows Vista

In order to view correct search results we should rebuild search index.

Start --> Run --> control srchadmin.dll


Search Database will be automaticly reindexed.

Read more...

Tuesday, April 28, 2009

Disable Cisco Password Recovery

Cisco devices permits to password recovery by default during the reload system. But if person has a physical access to devices he can change password.For this reason, you may want to disable password recovery procedure.

Use the “no service password-recovery” command
When you do this carefully read the warning message.

Router(config)#no service password-recovery
WARNING:
Executing this command will disable password recovery mechanism.
Do not execute this command without another plan for
password recovery.
Are you sure you want to continue? [yes/no]: yes
Router(config)#
Read more...

Block Dictionary Attack on Cisco

To block dictionary attack on Cisco routing and switching devices we can use login block- for command.
By using this command we can block for ‘x’ seconds after failed ‘y’ logins are tried within ‘z’ seconds.
The following example shows how block login access for 100 seconds after 4 failed login attempts within 20 seconds:

login block-for 100 attempts 4 within 20

During this block period all types of login attempts( Telnet, SSH, and HTTP) are denied.

But it is possible to exclude IP address for this blocking.
Ex: Exclude 192.168.1.0 Network (C Class)

login quiet-mode access-class 10
access-list 101 permit ip 192.168.1.0 0.0.0.255 any
Read more...

View Possible Bad indexes on SQL Database

Execute the following code to view possible bad indexes in SQL Database;

SELECT object_name(s.object_id) AS 'Table', i.name AS 'Index ', i.index_id,
user_updates AS 'Total Number of Writes', user_seeks + user_scans + user_lookups AS 'Total Number of Reads',
user_updates - (user_seeks + user_scans + user_lookups) AS 'Difference'
FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK)
INNER JOIN sys.indexes AS i WITH (NOLOCK)
ON s.object_id = i.object_id
AND i.index_id = s.index_id
WHERE objectproperty(s.object_id,'IsUserTable') = 1
AND s.database_id = db_id()
AND user_updates > (user_seeks + user_scans + user_lookups)
AND i.index_id > 1
ORDER BY 'Difference' DESC, 'Total Number of Writes' DESC, 'Total Number of Reads' ASC;


Read more...

View SQL Server Hardware Information by SQL Commands

Execute the following Command to view detailed CPU , Memory information.

SELECT cpu_count AS 'Logical CPU Count', hyperthread_ratio AS 'Hyperthread Ratio',
cpu_count/hyperthread_ratio As 'Physical CPU Count',
physical_memory_in_bytes/1048576 AS 'Physical Memory (MB)'
FROM sys.dm_os_sys_info;



Read more...

Monday, April 27, 2009

Hide Users from Global Address List on Exchange 2007

Open Exchange Management Shell and Execute the command Below;

Set-Mailbox "Mailbox Name" -HiddenFromAddressListsEnabled $true






Read more...

Enable HTTPS-HTTP Bridging on the TS Gateway

Open TS Gateway Manager.

In the TS Gateway Manager console tree, right click to the TS Gateway server, click Properties.





On the SSL Bridging tab, select the Use HTTPS-HTTP bridging check box, click OK.

A warning message will appear, stating that for the SSL bridging settings to take effect, you must recycle the default application pool of IIS. If you want to recycle the default application pool now click Yes. To recycle the default application pool manually later, click No.


ISA Server Configuration for TS Gateway

Read more...

Friday, April 24, 2009

View SQL Server Database Columns Collations that different from Database

Execute the code below to find out which columns have different collation.




SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLLATION_NAME FROM information_schema.columnsWHERE COLLATION_NAME IN (SELECT DISTINCT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNSEXCEPT(SELECT DATABASEPROPERTYEX('sds', 'Collation')UNION ALLSELECT NULL))


Read more...

Wednesday, April 22, 2009

Get Creation Time for SQL Database

Execute The Command Below;

select @@servername + ' '+ convert(varchar(20),crdate,111) + ' '+ [Name] from sys.sysdatabases order by crdate desc



Read more...

Get Last Modified Date for SQL Server Objects

Execute the command below;


SELECT name
FROM sys.objects
WHERE DATEDIFF(D,modify_date, GETDATE()) <>




Read more...

Get SQL Server Version

Execute the command below on SQL Server Management Studio

select @@version
Read more...

Monday, April 20, 2009

Block Conficker Script ISA 2004 & ISA 2006

Download the script file from the link above.

Block_Conficker_Script

Execute on the server that ISA server installed by double clicking the file.

New HTTP signatures will be automaticly created.



Read more...

Friday, April 17, 2009

Disable Autorun via Group Policy

In order to disable autorun features of all drives in domain computers follow these steps below.

Open Group Policy Object Editor , and edit releated Domain Policy.

Locate Computer Policy\Computer Configuration\Administrative Templates\System in the left pane then find "Turn Off Autoplay" in the right pane.







Double click and set feature to enable set Turn of Autoplay to : All Drives

Disable Autorun in Vista;

Open : Gpedit.msc

Locate the following policy;

Local Computer Policy\Computer Configuration\Administrative Templates\Windows Components\AutoPlay Policies


Read more...

Thursday, April 16, 2009

SQL 2005 Processes Detailed Status Query

Use the quey below to find detailed information about processes.
How many process are working? , How many are sleeping..., and the total number of processes.

SELECT COUNT(*) AS ProcessStatusCount,CASE Status
WHEN 'Running' THEN 'Number of Process Currently Running One or More Requests '
WHEN 'Sleeping ' THEN 'Number of Process Currently Sleeping'
ELSE 'Dormant – Session resets
END Status
FROM sys.dm_exec_sessions GROUP BY Status


Read more...

Exchange 2007 Mailbox Size

Use the command below on Exchange Management Shell to get Mailbox Sizes on Exchange 2007.

Get-MailboxStatistics -database “Mailbox Database” Select DisplayName, TotalItemSize Format-Table



Read more...

Wednesday, April 15, 2009

W32Time Error Event ID:48

Possible reason is you have problem about connecting to time server or time server is experiencing diffuculties.

List of time servers is available at ;
http://support.microsoft.com/kb/262680

After choosing time server follow the steps below;

net stop w32time
w32tm /unregister
w32tm /register
net time /setsntp:TimeServerIPNumber
net start w32time

If you want to use a FQDN instead of the IP address as time server, add ",0x1" at the end of the net time command

net time /setsntp:time-a.nist.gov,0x1


Read more...

Block or Allow Google Earth Through Firewall

In order to deny or allow access to Google Earth , block or allow access to these address on your firewall;

http://maps.google.com/
http://auth.keyhole.com/
http://kh.google.com/
Read more...

View SQL 2005 Database Logical File Name

Execute the EXEC sp_helpfile command on New Query window.
First Columns indicates the logical name of database file(s).


Read more...

Windows 2008 Certification Paths

WinServer2008-CertPaths ew

Read more...

Friday, April 10, 2009

Check if Group Policy Applied on Domain Group

You can check if your Group Policy is applied on Group by using ,
GPRESULT command.

Start -> Run -> (Execute the Commands Below) .

GPRESULT
GPRESULT /USER targetusername /V
GPRESULT /S system /USER targetusername /SCOPE COMPUTER /Z
GPRESULT /S system /U username /P password /SCOPE USER /V


Read more...

Check If Group Policy Applied on Client

You can check if group policy applied on client by using "Resultant set of Group Policy" Console

Execute Start -> Run -> rsop.msc










After policy is processed;

Check if your Group Policy is applied on Client successfully.




Read more...

Thursday, April 9, 2009

Disconnect all users from SQL Database

Run the code below on SQL Management Studio,

DECLARE @User VARCHAR(8000)
SELECT @user=COALESCE(@user,'')+'Kill '+CAST(spid AS VARCHAR(10))+ '; '
FROM sys.sysprocesses WHERE DBID=DB_ID('EF_GR') EXEC(@user)

//EF_GR is a name of database


Read more...

Wednesday, April 8, 2009

Exchange 2007 Check User Storage Limits

Excute the command below on Exchange Management Shell to get Storage statistics.
get-mailboxstatistics



Read more...

Exchange 2007 "Send As" Feature

How to Grant Send As Permission.
Open Exchange Management Shell.

Execute the following command.

Add-ADPermission "Mailbox" –User "Domain\User" –Extendedrights SendAs

Example:
This command grant test2 user to send as permission for egemen mailbox

Read more...

Tuesday, April 7, 2009

Remove, Disable, Enable etc .. Devices by Command Prompt (Devcon.exe)

Download devcon.exe

Download And Extract it to any Folder.

Enter to the folder by using command prompt.

Example (Com port remove and rescan)

devcon remove @ACPI\PNP0501\*
devcon rescan

Example (Listing all classes)

devcon classes

Example (Listing all usb devices Hardware IDs)

devcon /hwids *usb*
Read more...

If you get [::1] while ping to localhost



::1 is a short way of writing 0000:0000:0000:0000:0000:0000:0000:0001

Disable IPv6 from network connections properties , if you don't use.
Read more...

Modify Group Policy Refresh Interval

By default, Group Policy refresh happens every 90 minutes for clients and users , every 5 minutes for domain controllers (DCs).

We can modify these refresh intervals by following the steps below.

Open the relevant Group Policy Object (GPO). Then click Edit.Expand Computer Configuration, Administrative Templates, System, Group Policy.




For Computers
Find "Group Policy refresh interval for computers," then select Enabled. Enter the new refresh rate and the maximum random time to wait for the refresh (to prevent all machines getting GPO updates at the same time), click OK.
For DCs
If required, open Group Policy refresh interval for domain controllers," then select Enabled. Enter the new refresh rate, this refresh rate must be significantly less than average computer policy refresh rate, and the maximum random time to wait for the refresh (to avoid all machines updating at the same time), click OK.
For Users
Expand User Configuration, Administrative Templates, System, Group Policy.



Double-click "Group Policy refresh interval for users."

Select Enabled, set the values, then click OK.

Close the Group Policy Editor (GPE).


Read more...

Monday, April 6, 2009

Block Skype using Group Policy

   Copy the following below  code to the text file and save as Skype.adm then import to your Domain Group Policy.

 Then use various options to limit Skype usage.
  

Read more...

Block Skype on ISA 2006 & ISA 2004

There is a research from Columbia University about Skype Blocking.
http://www1.cs.columbia.edu/~library/TR-repository/reports/reports-2004/cucs-039-04.pdf

By preventing all protocols access to 80.160.91.11 (Skype Auth Server), you can Block Skype.
Read more...

View MAC Addresses of devices connected to HP Procurve Switch

Connect to HP Procurve Switch via Telnet.

Execute show mac-address command.
You will see the connected devices MAC addresses and which port they are connected to.



Read more...

Remove APEX SQL Log tables from database

If you want to remove all tables about APEX SQL Log from database after uninstalling the program.


Execute the code below;


IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Stop') EXEC master.dbo.xp_ApexSqlLogMonitor_Stop
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Stop') EXEC master.dbo.xp_ApexSqlConnectionMonitor_Stop
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLog') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLog'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogApi') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogApi'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_InitLogNav') EXEC master.dbo.sp_dropextendedproc 'xp_InitLogNav'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_UnInitLogNav') EXEC master.dbo.sp_dropextendedproc 'xp_UnInitLogNav'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Stop') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor_Stop'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Info') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor_Info'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Enable') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor_Enable'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlLogMonitor_Disable') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlLogMonitor_Disable'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Stop') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Stop'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Info') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Info'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Enable') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Enable'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_ApexSqlConnectionMonitor_Disable') EXEC master.dbo.sp_dropextendedproc 'xp_ApexSqlConnectionMonitor_Disable'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_EnableLiveLog') EXEC master.dbo.sp_dropextendedproc 'xp_EnableLiveLog'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_DisableLiveLog') EXEC master.dbo.sp_dropextendedproc 'xp_DisableLiveLog'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'xp_GetLiveLogStatus') EXEC master.dbo.sp_dropextendedproc 'xp_GetLiveLogStatus'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_open') EXEC master.dbo.sp_dropextendedproc 'ln_open'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_is_open') EXEC master.dbo.sp_dropextendedproc 'ln_is_open'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_is_valid') EXEC master.dbo.sp_dropextendedproc 'ln_is_valid'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_seekga') EXEC master.dbo.sp_dropextendedproc 'ln_seekga'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_seekgr') EXEC master.dbo.sp_dropextendedproc 'ln_seekgr'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_tellg') EXEC master.dbo.sp_dropextendedproc 'ln_tellg'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_read') EXEC master.dbo.sp_dropextendedproc 'ln_read'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'ln_close') EXEC master.dbo.sp_dropextendedproc 'ln_close'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'sp_ApexSqlLogMonitor_Start') EXEC master.dbo.sp_procoption 'sp_ApexSqlLogMonitor_Start', 'startup', 'false'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'sp_ApexSqlLogMonitor_Start') EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlLogMonitor_Start'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'sp_ApexSqlConnectionMonitor_Start') EXEC master.dbo.sp_procoption 'sp_ApexSqlConnectionMonitor_Start', 'startup', 'false'
IF EXISTS(SELECT * FROM master.dbo.sysobjects WHERE name = 'sp_ApexSqlConnectionMonitor_Start') EXEC master.dbo.sp_executesql N'DROP PROCEDURE sp_ApexSqlConnectionMonitor_Start'
DBCC LogNavXp (FREE)
DBCC ApexSqlLogXprocs (FREE)
DBCC ApexSqlServerXprocs (FREE)




Read more...

Update Statistics on SQL 2005 Database

Execute the command Below;

SELECT

sum(cache_plan.size_in_bytes)

FROM sys.dm_exec_cached_plans as cache_plan

outer apply sys.dm_exec_sql_text (cache_plan.plan_handle) as sql_text 

Read more...

Total Used Cache SQL Server 2005

Use the Query below to find total used cache in bytes;

SELECT

sum(cache_plan.size_in_bytes)

FROM sys.dm_exec_cached_plans as cache_plan

outer apply sys.dm_exec_sql_text (cache_plan.plan_handle) as sql_text 

Read more...

Check SQL Database Health Status

Execute ;
DBCC Checkdb

Read more...

Exchange 2007 Local Continuous Replication

You can provide High Availibility to your Exchange 2007 server by using Local Continious future without using another hardwares.


To enable this future open Exchange Management Console. Choose Mailbox Under Server Configuration.

In the right pane in database managment TAB, Right click "First Storage Group" and Choose "Enable Local Continuous Replication".



click NEXT .



Enter path for system and log files .



Cick Next and Enter the path for LCR database.


(Using another physical disk will increase performance of your replication.)

You must use identical name for your LCR database file name.

Click Next. And click Enable on the next screen.
After successful completion . Click finish.



Control creation of new files by comparing two locations.


LatestAvailableLogTime
The time stamp on the source storage group of the most recently detected new transaction log file.
LastCopyNotificationedLogTime
The time associated with the last new log generated by the active storage group and known to the copy.
LastCopiedLogTimeThe time stamp on the source storage group of the last successful copy of a transaction log file.
LastInspectedLogTimeThe time stamp on the target storage group of the last successful inspection of a transaction log file.
SeedingIndicates that seeding is in progress. Possible values are True and False.


Read more...

Enable Anti-Spam updates on Exchange 2007

Open Exchange Management Shell,

Execute the command below;

This command will enable Antispam automatic updates and options in Microsoft Update.

"Enable-AntispamUpdates -Identity SV2008 -IPReputationUpdatesEnabled $True -MicrosoftUpdate RequestNotifyDownload -UpdateMode Automatic -SpamSignatureUpdatesEnabled $True"

Type your Exchange server name to the bold part (SV2008).Do not use quotas.
Read more...

Exchange Server 2007 Limit Mailbox Sizes

Start Exchange Management Console,
Under the Server Configuration ,Clik Mailbox. On the right pane find the database that you want to set quotas. Right click ,click properties.


Chose Limits TAB from the window and enter the limits for users mailbox.

Read more...

Exchange 2007 Mailbox Sizes

Open Exchange Management Shell and execute the command below.


Get-MailboxStatistics Sort-Object TotalItemSize –Descending ft DisplayName,TotalItemSize,ItemCount



Read more...

Search and Delete Files on Windows Domain Structure

Use the script below to find and delete files according to their extensions.

strComputer = "."Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colFiles = objWMIService.ExecQuery _("Select * from CIM_DataFile where Extension = 'mp3' OR Extension = 'mp4'")For Each objFile in colFilesobjFile.DeleteNext
Read more...

Friday, April 3, 2009

Windows DHCP Server MAC Filtering

By Default Windows Server 2003 DHCP hasn't got any ability to filter client mac address.

To enable this function you should install "MAC Filter Callout" third party tool to enable this feature.
You can download this tool from the link below.

Download

After downloading. Install it on your DHCP Server. And Restart DHCP Server service from services console. After installation check for registry keys for macfiltercallout.

HKLM\System\ControlSet001\Services\DHCPServer\Parameters\


In the right pane check for registry keys stated in the picture below.






CalloutEnabled (DWORD) value = 1 (Enable) 0(Disable)

CalloutErrorLogFile = Indicating the place of Error Log file

CalloutInfoLogFile = Indicating the place of Information Log file

CalloutMACAddressListFile = Indicating the place of file that will be used for allowing or denying MAC Address


MAC Filtering



Locate and open the MACList.txt file. This file can be used for one purpose at a time.(Allowing or Denying)



For using allowing purpose first line in the file should be like MAC_ACTION={allow} (Devices that have these MAC addresses will be allowed other will be denied to get IP Address from DHCP Server)



For using denying purpose first line in the file should be like MAC_ACTION={deny}


MAC Address should be written in Lowercase.



You should Restart DHCP Server service every time you change MACList.txt







Read more...

Thursday, April 2, 2009

SQL Query that search all column names based on criteria

Search All Column that names like (at..)

select * from INFORMATION_SCHEMA.COLUMNS where
"COLUMN_NAME" LIKE '%at%';
Read more...

GFI Mail Essentials Log View

Firstly each GFI MailEssentials anti-spam module may be configured to record all blocked emails to a log file. This can be enabled as follows:

Open the GFI MailEssentials configuration.
Expand ‘Anti-Spam’ and click on the module you want to enable logging for.
Click on ‘Properties’ and select the ‘Other’ tab.
Enable ‘Log occurrence to this file’.
Configure the path to the log file or leave as default.
Lastly you can gind GFI Mail Essentials system logs on "C:\Program Files\GFI\MailEssentials\DebugLogs" directory.

Read more...

Wednesday, April 1, 2009

SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection.

If you getting this error on SQL Server 2005 SP2




Add the following registry key and reboot the server. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\SycAttackProtect{DWORD} = 0





SynAttackProtect


Read more...
 
span.fullpost {display:none;}