XMing – Lightweight X-Server for Windows

Leave a comment

Oracle DBAs working on windows laptops and connecting to unix/linux environments need an Xwindows server. An Xwindows server is the software you need on your laptop in order to run the GUI interfaces for Oracle installation programs on unix. My favorite Xwindows server is Xming, whose home site is located here, and whose binaries are here.

I’ve used the Exceed product before for an Xwindows server, but have always found the software cumbersome and confusing. It contains many more features and utilities than I need and takes up a fair amount of disk space too. Xming is easy to install, tiny in size and just does one thing: Xwindows server. Configuring it to work with putty is simple. Putty seems to be known to just about everybody in IT that ever had to login to a remote machine via telnet or ssh, but I think Xming is probably a bit less famous.

Installing Xming is simple. I accepted all defaults, which lets use run multiple separate programs from your remote host, each in its own window. Xming also provides some choices of automated integration with putty, which I haven’t used.

To get Xming and putty correctly configured to work with SSH, here’s what I had to do in my environment.

After installing Xming, I ran the Xlaunch utility that comes with Xming. Xlaunch controls the manner in which Xming starts. Xlaunch has a wizard interface, and I accepted the defaults, except on this screen.
Xlaunch screen
Here I made sure the “No access control” check box was checked.

On the putty front, I enabled X11 port forwarding for your session. See the below picture on how to do that. In my environment, I don’t have to set the DISPLAY variable at the unix prompt after making the above two settings.
X11 port forwarding in putty.

With the above two settings in place, I can login via ssh using putty from my windows laptop to remote unix sessions and then successfully start Xwindows programs.

msconfig – System Configuration Utility

Leave a comment

After using Windows for years, I just became aware of a utility called msconfig. Use msconfig to adjust aspects of the windows system, particularly startup configuration. You can adjust what programs and services get launched upon startup, as well as the startup mode.

You can launch this program with Start – Run – msconfig.

The binary msconfig.exe is located on XP and Windows 2003 in the \Windows\PCHealth\HelpCtr\Binaries directory. On Vista and Windows 2008 it’s in \Windows\System32.

Here’s the UI for msconfig for windows vista and 2008. Note the tools tab, which is not present in the XP version.
Msconfig for Windows Vista and 2008

The Windows 2003 version. Has tools tab, plus system, win and boot ini tabs.
Msconfig for Windows 2003

Lastly, here’s the XP version. No tools tab, but has the 3 ini file tabs.
Msconfig on Windows XP

Make Your Reservation for that Port

Leave a comment

Not a port of call, not port wine, but computer ports!

A colleague of mine tracked this down on the microsoft site.

To ensure that your Oracle Listener or SQL Server database starts correctly, you want to avoid other software starting up and grabbing the port needed by Oracle or SQL Server. In my shop, we’ve seen backup software, among others, grab a port and then prevent SQL Server from starting.

Here’s the link on how to do this:
http://support.microsoft.com/kb/812873/en-us

It involves making a registry edit to the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters and then adding a new ReservedPorts. The port numbers added here will only be used if specifically requested by software.

This will not prevent conflicts if you configure two separate programs to request the same port. But it will save you from Windows automatically assigning the port number in question to software that did not specifically request a port.

windows, sysinternals, processes and disk space

Leave a comment

If you work on both unix and windows, you may find yourself wishing for unix tools like du, ps, df, proc and fuser to use on windows systems. Such tools make it easier to investigate process activity and disk utilization.

Sysinternals and vbscript to the rescue!

Sysinternals is the website run by Mark Russinovich, now at Microsoft. The utility process explorer gives you everything ps does and more! With process explorer, you can quickly find if a particular process is locking a file, for example. There’s a windows version of du that works really well. With du, you can find out what directory is consuming space very quickly. And there’s many other tools that I have yet to explore.

Lastly, the unix utility df makes it easy to see space consumed by each mountpoint from the command line. In windows, you can do this via the GUI by going to My Computer and checking there. But there’s no easy way to do this from the command line with the built-in operating system commands. Here’s a vscript file to help. To run it, place the code in a file, say get_drive_utilization.vbs. Then invoke cscript from the command prompt like this:
C:\> cscript get_drive_utilization.vbs

' Windows scripting host script in VB Script
' to list Used, Free, Total and % Free on all fixed disk drives.

Function ShowDriveList

	Dim fso, d, dc, s, n
	Set fso = CreateObject("Scripting.FileSystemObject")
	Set dc = fso.Drives

	s = s & "DriveLetter | ShareName | DriveType | Used | Free | Total | % Free " & Chr(10) 

	For Each d in dc
		n = ""
		
		If d.DriveType = 3 Then
			n = d.ShareName
		ElseIf d.IsReady Then
			n = d.VolumeName
		Else
			n = "[Drive not ready]"
		End If
	      
		Select Case d.DriveType
			Case 0: t = "Unknown"
			Case 1: t = "Removable"
			Case 2: t = "Fixed"
			Case 3: t = "Network"
			Case 4: t = "CD-ROM"
			Case 5: t = "RAM Disk"
		End Select
	
		If t = "Fixed" Then
			s = s & d.DriveLetter & " | " 
			free_space = FormatNumber(d.AvailableSpace/(1024*1024*1024), 2)      		
			total_space = FormatNumber(d.totalsize/(1024*1024*1024), 2)      		
			used_space = formatnumber(((d.totalsize - d.availablespace)/(1024*1024*1024)), 2)
			pct_free = formatnumber(free_space / total_space, 2)
'			s = s & n & " | " & t & " | U: " & used_space & " GB | F: " & free_space & _
'				" GB | T: " & total_space & " GB | %Free: " & pct_free & Chr(10) 
			s = s & n & " | " & t & " | " & used_space & " GB | " & free_space & _
				" GB | " & total_space & " GB | " & pct_free & Chr(10) 
	

		End If
	      
	Next
	
	ShowDriveList = s
   
End Function

a = showdrivelist
wscript.stdout.write a