Bart's Weblog

Just a blog…

Archive for March, 2011

SQL Server: Shrinking SQL transaction log

Posted by bartvdw on 1313/0303/2011

Had an issue recently regarding shrinking SQL transaction log of a system DB. Short information about below, full in the link at the bottom (Tibor Karaszi). Really helped me in understanding and solving my issue!

By default the model system DB is configured with recovery model Full. This makes that it has a transaction log that will grow in time… Below how to accomplish shrinking use SQL Query, which gives you best info:

  • Simple recovery model
    USE dbname
    CHECKPOINT
    –First param below is fileno for log file, often 2. Check with sys.database_files
    –Second is desired size, in MB.
    DBCC SHRINKFILE(2, 500)
    DBCC SQLPERF(LOGSPACE) –Optional
    DBCC LOGINFO –Optional
    Now repeat above commands as many times as needed!
  • Full or bulk_logged recovery model
    USE dbname
    BACKUP LOG dbname TO DISK = ‘C:\x\dbname.trn’
    –First param below is fileno for log file, often 2. Check with sys.database_files
    –Second is desired size, in MB.
    DBCC SHRINKFILE(2, 500)
    DBCC SQLPERF(LOGSPACE) –Optional
    DBCC LOGINFO –Optional
    Now repeat above commands as many times as needed!

 

Recovery Models for System Databases
http://msdn.microsoft.com/en-us/library/ms365937%28v=sql.90%29.aspx

Why you want to be restrictive with shrink of database files
http://www.karaszi.com/SQLServer/info_dont_shrink.asp

System Databases in SQL Server
http://www.sql-server-performance.com/articles/dba/System_Databases_in_SQL_Server_p1.aspx

SQL Server 2005 Recovery Models
http://dbarecovery.com/backup-and-recovery-overview/sql-server-2005/sql-server-2005-recovery-models.html

Posted in SQL | 1 Comment »

IPv6: How to configure with GPO

Posted by bartvdw on 1313/0303/2011

By default as from Vista/2008 on, IPv6 is enabled. You can configure this through the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents (32-bit DWORD value)

  1. Type 0 to enable all IPv6 components.
    Note The value "0" is the default setting.
  2. Type 0xffffffff to disable all IPv6 components, except the IPv6 loopback interface. This value also configures Windows Vista to use Internet Protocol version 4 (IPv4) instead of IPv6 in prefix policies.
  3. Type 0x20 to use IPv4 instead of IPv6 in prefix policies.
  4. Type 0x10 to disable native IPv6 interfaces.
  5. Type 0x01 to disable all tunnel IPv6 interfaces.
  6. Type 0x11 to disable all IPv6 interfaces except for the IPv6 loopback interface.

Download the IPv6Configuration.zip file, extracted and copy the files like listed below:

  • IPv6Configuration.admx – Copy this file to %SYSTEMROOT%\PolicyDefinitions
  • IPv6Configuration.adml – Copy this file to %SYSTEMROOT%\PolicyDefinitions\en-US (Replace en-US with your country’s language, as necessary)

Now you can add these in your GPO editor to configure the values described in the MS KB (see link below). Possible values:

  • Enable all IPv6 components (Windows default)
  • Disable all IPv6 components (the setting you probably want)
  • Disable 6to4
  • Disable ISATAP
  • Disable Teredo
  • Disable Teredo and 6to4
  • Disable all tunnel interfaces
  • Disable all LAN and PPP interfaces
  • Disable all LAN, PPP and tunnel interfaces
  • Prefer IPv4 over IPv6

 

How to Configure IPv6 Using Group Policy
http://www.expta.com/2009/02/how-to-configure-ipv6-using-group.html

How to disable certain Internet Protocol version 6 (IPv6) components in Windows Vista, Windows 7 and Windows Server 2008
http://support.microsoft.com/kb/929852/en-us

Posted in Group Policy, Windows | Leave a Comment »

Proxycfg on Vista/2008 and later

Posted by bartvdw on 1313/0303/2011

Those who use the proxycfg utility will find out that as from Vista/2008 it no longer exists. It has been incorporated in the netsh utility instead. Below a short overview:

  • proxycfg -u = netsh winhttp import proxy ie
  • proxycfg -d = netsh winhttp reset proxy
  • proxycfg -p = netsh winhttp set proxy proxy-server="PROXY.COM:8080" bypass-list="SERVER.COM"

To show current proxy: netsh winhttp show proxy

Brief list op commands:

  • dump           – Displays a configuration script.
  • import         – Imports WinHTTP proxy settings. (equiv of proxycfg -u)
  • reset          – Resets WinHTTP settings. (equiv of proxycfg -d)
  • set            – Configures WinHTTP settings.
  • show           – Displays currents settings.

 

Netsh.exe and ProxyCfg.exe Proxy Configuration Tools
http://msdn.microsoft.com/en-us/library/aa384069%28VS.85%29.aspx

Posted in Windows | Leave a Comment »

Clear cached WPAD script

Posted by bartvdw on 1313/0303/2011

When you use a WPAD script, it’s begin cached. When you want to perform testing, this is not very interesting. Default this is 50 minutes, IE uses 1 hour.

To have a clean starting point, use following steps:

  1. Clear the Internet Explorer cache completely: ActiveX Controls, Cookies, History, etc..
  2. Close all instances of Internet Explorer.
  3. Delete all WPAD script instances. Open a command window as administrator and type the following command:
    del \wpad*.dat /s
  4. Clear the DNS and Netbios name caches. Open a command window as administrator and type the following commands:
    ipconfig /flushdns
    nbtstat -R

Now you have a clean starting point for your tests.

 

Clearing the Cached WPAD Script (Stefaan Pouseele Blog)
http://blogs.isaserver.org/pouseele/2007/11/09/clearing-the-cached-wpad-script/

Posted in Windows | Leave a Comment »