Author Archives: alesk

Windows Server 2008 – short notes from the course 6416B

I decided to attend Microsoft Official Course, 6416B Updating your Network Infrastructure and Active Directory Technology Skills to Windows Server 2008, as part of the benefit that we get from the Enterprise Agreement Contract. As a bonus, every attendee of this course got free MS Window Server 2008 Standard Edition with 5 CAL licenses (btw. this promotional offer will expire at end of the year 2008).

License for Windows Server 2008 Std. will serve me well in my home lab for both, experimenting with Oracle software on Windows OS, as well as a replacement for my venerable Windows XP workstation, allowing me to completely skip Vista.

License that I receive will allow me to run Windows Server 2008 Standard Edition as parent partition in Hyper-V, plus another instance of Server 2008 Std. as a Hyper-V child. Howard Rogers wrote about setting up his Windows Server 2008 as a workstation in not so distant blog article, thought he also find out that Hyper-V doesn’t do multimedia very well, which doesn’t bother me much, as I’ll use my “workstation” more or less for experimenting with Oracle, Windows Server 2008 itself, some writing, perhaps a bit of photo editing with Adobe Lightening ant that’s pretty much all.

I do like the look and feel of Hyper-V management, thought it bothers me the lack of support for Linux. Suse being the only Linux distribution that can use so-called synthetic (as opposed to emulated) drivers. What a shame, because I put SUSE on my “dirty-list” of Linux distributions a long time ago. If I’ll find performance of Centos 5 under Hyper-V unsatisfactory, I’ll probably replace Hyper-V with soon to be released production version of VMWare Server 2.0.

Let’s see some new features of Windows Server 2008 that are in my opinion worth spending some time studying and understanding them.


  • built-in multipath I/O and Storage Manager for SAN
  • Bitlocker drive encryption (not something I wouldn’t lightly choose for Oracle production server – but it can get handy for securing deployment of various kinds of databases on laptops)
  • services for NFS
  • Windows PowerShell – not exactly new, but it ships with Win2008 and should be one of the first features to be installed
  • brand new Windows Backup – for better or worse, Microsoft decided to redone Windows backup, completely replacing ntbackup with Windows Backup. For medium and large shops Microsoft recognizes that there are third party tools that are way better at doing backup and recovery. For a smaller shops, however, Windows Backup might be enough – I got an impression that Microsoft wanted to deliver backup tool for the dummies. Microsoft completely removed support for tape backups and added support for optical media with UDF support (in addition to disk and network drives for backup store). Limited scheduling possibilities and the fact that your only choice for a backup is complete volume (during recovery you have a chance to select files and folders, but not during backup) it’s hard to believe that many professionals will be happy with WBA. Another difference is the backup format itself, which is vhd file instead of bkf – so getting something restored is much simpler than in the old days.
  • remote differential compression – Microsoft is using this feature in new DFRS (Distributed File System Replication), allowing only changed parts of the file to be replicated – in a similar way rsync is used for a long time ;-).
  • Windows PE – Preinstallation Environment can run entirely from memory and can boot from CD, USB key – something we would have to buy from third party vendors, at least so far…
  • Windows RE – Recovery Environment – special variant of Windows PE dedicated to recovery
  • NTFS improvements – NTFS v6 brings two new features; self-healing NTFS that will reduce the need for chkdsk to run in exclusive mode and transactional NTFS with Kernel Transaction Manager
  • complete redesign of TCP/IP stack – IPv4 and IPv6 are now integrated in the tcpip.sys, they call this dual IP architecture. There are numerous improvements, especially on performance front. In older releases TCP/IP receive windows was by default fixed (at 64KB), no matter over what kind of network we communicated. With Windows Server 2008 (Vista) they introduced receive window auto-tuning that can considerably improves network performance.
  • multi CPU network interface access – in Windows Server 2003 only one CPU could access network interface – causing performance bottleneck in case if that particular CPU was overloaded, leaving little CPU cycles to handle server network traffic. In Windows Server 2008, several CPU’s can access network interface.
  • SMB 2.0 protocol allows several commands to be embedded in single packet, further enhancing network performance of high latency network connections
  • Policy based Quality of Service – network bandwidth throttling
  • Windows Remote Shell (winrm & winrs) – one “new” possibility for remote administration from command line. Network traffic is encrypted with SSL, other than that, we could do the same job with pstools from Sysinternals for years.
  • servermanager.exe – another command lined tool for administration
  • RSAT – Remote Server Administration Toolkit works on Vista and Windows Server 2008 only, unfortunately leaving vast majority of sysadmins that are still using Windows XP without this option.
  • RRAS (Routing and Remote Access Service) – has new possibility, SSTP – Secure Socket Tunneling Protocol over well known port 443
  • NAP – Network Access Protection
  • Hyper-V – it’ll be interesting to follow Microsoft success with Hyper-V, considering VM Ware decision to offer ESXi for free.
  • restartable AD Data store service
  • PHP 5.2.1support in IIS 7
  • redesign of monolithic IIS6 into highly modular IIS7
  • replacing binary IIS metastore with flexible, file based xml configuration that can be copied from machine to another machine
  • TS Gateway – TS Gateway serves as a “proxy” between client (somewhere on the Internet) and some internal TS server. TS Gateway uses port 443 and SSL encryption. Smaller shops without dedicated VPN equipment will appreciate this feature.
  • TS Remote APP – this feature is really cool. It allow us to “publish” certain applications hosted on terminal server to end users. Really neat.
  • TS Easy Print – major enhancement, we don’t need anymore printer drivers on our TS server for every printer that we have out there – instead, drivers installed on the client workstations are used
  • RDP 6.1 protocol – (available for Windows XP SP3), 32-bit color support, up to 4096 x 2048 screen size that can be displayed over several monitors, display data prioritization, single-sign on, PNP redirector, Audio Mixer …

I intentionally left out other features targeted more or less to system administration – such as Active Directory related enhancements, new deployment infrastructure (Windows Deployment Services), DNS improvements, Auditing Directory Domain Services etc.

You may ask why I didn’t mention Server Core version? Well, I believe this version in the current state is seldom usable. Certainly I wouldn’t bother to install, run and support Oracle10g/11g on this release. The major handicap of this release at present is the lack of .NET framework and hence PowerShell. I don’t expect more than 3% of Windows Server 2008 deployments will use Server Core in production. I’m afraid Microsoft released Core, at least 10 years too late to have any serious impact on enterprises that run most of their production on Windows.


Final disclaimer:
Don’t believe everything you read here. Above comments of the features are the result of my personal notes taken during the class. They might be inaccurate or miss leading. I’ll post any correction or explanation in the form of comment to this blog entry.


VMWare Infrastructure Toolkit for Windows

It was only a question of time when it will be released – a VMWare specific toolkit for Windows PowerShell. I hope I’ll have a time to test this toolkit soon with VMWare Server 2.0 (after it’ll be released); nevertheless, even on paper it sounds promising with 120+ powershell cmdlets centered around managing and automation of VM.


Note: As you might know I was not a particular fan of PowerShell, but I changed my mind :-). I was skeptical about PowerShell when Microsoft announced new scripting environment (what’s wrong with WSH that I’m already familiar with?), but now I understand the importance and potential of this product, it really deserves power in it’s name. If you’re Windows system administrator you’re better off to start learning Powershell right now (if you’re already not) – it’ll make your life much easier and your employment prospect safer;-).


sed one-liners

SED and AWK are my favorites when it comes to (pre)processing data (…before I go and write python script). While my primary source of reference is book titled Sed & Awk, 2nd ed. (O’Reilly), I also have some prints of various sed one-liners hanging on the wall in my office. I never bothered to write down url on which we can find many “popular” sed one-liners, so here it is:

http://sed.sourceforge.net/sed1line.txt

Just an example of how handy this list of one-liners can be. It helped me the other day when someone on the dba-village forum asked about how to load data from comma separated file. There are five fields in the file, but the problem is that the third field may contain any number of commas. (This is a common type of a question that I receive from time to time at my workplace as well — and I almost always resolve for a solution to the sed.)

For example, let’s say that we have file (test.txt) with comma separated data such as this:


COL1,COL2,COL3-with, some, data, with, commas,COL4,COL5

We should enclose field 3 within quotes and then use OPTIONALLY ECNLOSED BY clause in SQL*Loader control file to load the data.

Basically we need to replace second comma with ,’ and next to last comma with ‘, .

The first part is easy:

cmd> cat test.txt | sed "s/,/,'/2" ....will replace second comma with ,'

The second part, replacing next to the last comma with ‘, is more complex and was finally derived from an example written in the one-liner list mentioned above:

cmd> cat test.txt | sed "s/\(.*\)\,\(.*\,\)/\1',\2/"

We're using grouping ( ) and then addressing each of the two groups with 1 and 2. Backslashes are there to escape characters that are part of the syntax, but admittedly making command line string harder for humans to parse. But consider this, lighter example where we want to split days with two consecutive semicolons) :

cmd> echo MondayTuesday | sed "s/\(Monday\)\(Tuesday\)/\1::\2/"
Monday::Tuesday

So that in the end we can get desired result:

cmd> cat test.txt | sed "s/,/,'/2" | sed "s/\(.*\)\,\(.*\,\)/\1',\2/" > test_out.txt

cmd> cat test_out.txt

COL1,COL2,'COL3-with, some, data, with, commas',COL4,COL5

Free PowerShell Commands for Active Directory

Only recently I stumble over Quest “ActiveRoles Management Shell for Active Directory”, a free cmdlets for scripting with AD as a source (and destination). For example, all you need to spool users with their descriptions from AD into csv file is this one liner:

[PS] E:\>Get-QADUser -sizeLimit 0 | select name, Description | Export-Csv ADusers.csv

In addition to “ActiveRoles Management Shell for Active Directory”, you’ll need to install PowerShell itself and Microsoft Core XML Services – if they’re not already installed on your machine (Quest installer will prompt you if that’s is the case).
In “Quest Software” program directory you’ll find link named “ActiveRoles Management Shell for Active Directory” which starts PowerShell.

One problem that I could not find a solution for, is related to spooled file encoding which will loose all non-ASCII characters in my environment (CP1250 for GUI, CP852 for command prompt), even after specifying UTF8 encoding like this:

[PS] E:\>Get-QADUser -sizeLimit 0 | select name, Description | Export-Csv ADusers.csv
[PS] E:\>$OutputEncoding

BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001

I also tried with console encoding:

[PS] E:\>$OutputEncoding = [console]::OutputEncoding
[PS] E:\>$OutputEncoding


IsSingleByte      : True
BodyName          : ibm852
EncodingName      : Central European (DOS)
HeaderName        : ibm852
WebName           : ibm852
WindowsCodePage   : 1250
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : False
IsMailNewsSave    : False
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : True
CodePage          : 852

No luck – in .csv file all “special” characters are lost.

Side notes from our patchset 10.2.0.4 installation tests on Windows 2003/SP2/x64

Short notes taken during the test phase for installation of patchset 10.2.0.4


Let me start with a bit harsh, but nevertheless a realistic warning: if your search engine landed you here and if you’re looking for quick and dirty list of steps to upgrade your Oracle database, then please, stop reading and keep searching! And don’t make fool of yourself asking on public forums questions like this: “…can you please give me step by step instructions for patchset installation…it’s really URGENT…” – someone asking questions like this one should not be the one who is installing anything on the server, including patchset. Personally, I’ll always make sure to keep such people as far away as I can from the back office (and hence away from myself!).
If you’re totally new to Oracle patchset installation, you need one and only one starting document, with interesting name – readme.html.

At the time of this writing (end of July 2008) there are some known issues listed in Metalink note 555579.1 “10.2.0.4 Patch Set – Availability and Known Issues”. Make sure you read it. In particular the following notes:

  • Note:580561.1 “ORA-600 [kddummy_blkchk][file#][block#][18038] during extent operations like TRUNCATE”; if you’re using ASSM tablespaces and direct path loads/inserts (as well as drop/truncate on those segments), you should apply patch 5386204 (at the time of this writing patch is not yet available for Windows x64)
  • if you’re running Oracle10g on Windows 2003 SP1 make sure you read Metalink note 464683.1 “Unexplained Database Slowdown Seen on Windows 2003 Service Pack 1”
  • and a non-critical one; Metalink note:726418.1ALERT: “The 10.2.0.4 Windows Patchset Overwrites %ORACLE_HOME%\network\admin\sqlnet.ora”, nevertheless Oracle republished 10.2.0.4 patchset on 10. July 2008 (first release for x64 was on 19. May 2008). You can simply backup sqlnet.ora file an restore it after wards – meaning that you don’t need to re-download updated version just to fix this bug, if you have version from 19th of May.
  • Bug 5082178 – Bind peeking may occur when it should not — this bug was fixed in 10.2.0.4, meaning that some queries that’re now running fine (due to the bind peeking taking place, even when it should not) can now experience performance problems. I don’t think we can truly test this due to a large number of schemas, applications etc. We’ll see how lucky we’re ;-)
  • We’ll take particular care for these three critical bugs introduced in 10.2.0.4:

  • Bug 7038750 – Dump (ksuklms) / instance crash — it’s less likely to happen on non-RAC but still possible…fortunately there is workaround available to avoid crash.
  • Bug 5868257 – Dump / memory corruption from UPDATE DML
  • Bug 6917874 – Wrong results from multi level push of join predicates
  • In readme.html you’ll find in section “15.19 Native Full Outer Join Implementation” Oracle recommendation to turn on hidden parameter:

    _optimizer_native_full_outer_join =force
    

    I’ll certainly not follow their advice. If they’re confident in the benefit of turning this parameter on, then why is it listed in patchset as as step that should be performed by DBA. Are they afraid of possible regression? ;-)

    It’s always interesting to examine platform specifix bugs that were fixed by patchset. The bugs fixed in 10.2.0.4 on Windows x64 that caught my attention:

  • 5940550 VIRTUAL MEMORY OF ORACLE.EXE GROWS ON 64 BIT X86 WINDOWS PLATFORM
  • 5205552 EXCEPTIONAL HIG VM SIZE USAGE FOR ORACLE.EXE ON 64 BIT X86 WINDOWS PLATFORM
  • 5041672 64-BIT WIN2K3 OS IS INCORRECTLY REPORTED AS 32-BIT WIN2K3
  • 4927774 UNRESPONSIVE SYSTEM WITH HIGH KERNEL CPU UTLIZATION

One thing that remains open at this stage of testing 10.2.0.4 is Large Pages support in 10g. We failed miserably trying to setup Oracle10g to use Large pages with 10.2.0.3. For now, it remains unclear which fault it is; Oracle, Microsoft or simply ours.