RDCMan manage multiple mstsc sessions

If you need to manage several servers at the same time your screen can get rather cluttered with lots of MSTSC sessions running.

Try using RDCMan, get it here

http://www.microsoft.com/en-us/download/confirmation.aspx?id=21101

After install, open it up and File->New and create a group container for your specific servers (say you might have 4 UAT servers so call the group “UAT”).

The simply add each server you need to the group.

Then right click and “Connect to Server” on each server in your group.

πŸ™‚ 

SQL Plus Spool as CSV

To get a CSV output from SQL Plus you might be inclined to concatenate the SELECT columns together with commas:

SPOOL MyOutputFile.csv

SELECT col1 ||’,’|| col2 ||’,’|| col3 from table;

SPOOL OFF;

This can get quite messy and doesn’t read well.

But you don’t have to do this, if you set COLSEP to β€œ,” you will get a csv file with tab style spacing and you can keep your SQL formatted with a regular SELECT statement.

SET COLSEP ,

You can then easily suck out the whitespace afterwards with a Perl one liner

                perl -pi.bak -e “s/ *,/,/g;s/, */,/g” MyOutputFile.csv

This makes a backup of the file and does in inline replacement, taking out all spaces following or preceeding a comma.

This will ignore spaces embedded in a string, say “xxx,Mr Joe Bloggs,xxxx”.

SQL Developer cannot find JVM

I installed the Oracle 11gR2 client (32 bit) on to a Win 2008 R2 64bit server, as we have 32 bit apps to support.

When I ‘point’ SQLDeveloper at the Java 6 SE JVM, I get “Unable to find Java Virtual Machine” message.

This is because I have Java 6 SE 64 bit version installed.

You need to install the 32 bit JDK , so that it lives in “C:\Programs Files (x86)”.

Then repoint the variable “SetJavaHome” that is in sqldeveloper.conf, and restart.

Unable to open excel macro from Control-M

I’ve been trying to get several Control-M jobs to work on our new Win 2008 R2 x64 Servers, but they always fail as they are trying to open scripts that call Excel macros as part of their function.

2012-08-14 17 : 24: 59 Error generating Sample Report [SampleRptBatch][CreateFileNames] Microsoft Office Excel cannot access the file ‘D:\SampleReport\SampleFormat.xlsm’. There are several possible reasons:

β€’ The file name or path does not exist.

β€’ The file is being used by another program.

β€’ The workbook you are trying to save has the same name as a currently open workbook.

On analysis, I can see that the Control-M Agent (ver 7) is running jobs as a Service, and not as a TCP or RDP session as I had thought.

This all comes down to an issue with Services, Win 2008 R2 x64 and Excel 2007. For Excel to open, when called from a service, it requires a “Desktop” folder to be placed in

    C:\Windows\SysWOW64\config\systemprofile\Desktop

Qgawa’s reply here, helped me sort this out.

http://social.msdn.microsoft.com/Forums/en/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91

 

ubuntu 12.04 grub2 screw up!

I was messing with my GRUB2 boot settions from the Grub UI Manager and I removed the grub menu link to Ubuntu, so that when I rebooted I couldn’t get into Ubuntu again! Doooh!

To fix you have to get into the GRUB CLI bu pressing ‘C’ at the boot menu.

Next you’ll get presented with a command line with “grub >” as the prompt.

Now you need to see what partitions you have and where your linux image file will be.

 ls

you should see something like

 	(hd0) (hd0,msdos3) (hd0.msdos4) (fd0)

My linux partion was on (hd0,msdos8) or (hd0,8).

 set root=(hd0,8) linux /boot/vml(press the tap key here)ro root=/dev/sda8 initrd /boot/ini(press the tap key here) boot 

Pick out the most recent image from above (you’ll see it once you tab).

If you have no idea which partition your image is on, then simply set root(hd0,x) for each partition shown on the “ls” command and you’ll find it eventually.

Once back into to Ubuntu I reset my Grub menu from the Grub UI Manager and I was back in business.

All the above was sourced from here..

http://www.justlinux.com/forum/showthread.php?t=152790

Ubuntu 12.04 wireless

After upgrading my laptop to 12.04 I found I’d lost my wireless connection. Moreover, it seemed that I was unable to re-add it back into the Network Manager.

So try this from command lne to check you woreless card is ok.

 sudo ifup wlan0 

Then restart your Network Service.

 sudo /etc/init.d/network-manager restart 

Your Network Connection should be back up.

http://askubuntu.com/questions/125850/cant-connect-to-internet-after-update-to-12-04

Using Perl DBI to test ODBC Connections

If you have the DBI perl module, and the Win32 ODBC pm (optional), this little script can be used to check your connections and give a database DSN a quick test.

 

   #!perl -w   use DBI;   use Win32::ODBC;      print "ODBC Drivers \n";   my @drivers = DBI->available_drivers;   print join(", ", @drivers), "\n";      print "-------------------------------------------------------------------------\n";      my $d = join("", @drivers);   print "DBD::ODBC";   print "not" if ($d !~ /ODBC/);   print "installed\n";      print "-------------------------------------------------------------------------\n";      my @dsns = DBI->data_sources('ODBC');   foreach my $d (@dsns)   {   print "$d\n";   }      print "-------------------------------------------------------------------------\n";      my $dbh = DBI->connect('dbi:ODBC:DBASE02', 'browser', 'browser');   $dbh->disconnect() if ($dbh);      print "-------------------------------------------------------------------------\n";      my $dbh32 = DBI->connect('dbi:Win32-ODBC:DBASE02', 'browser', 'browser');   $dbh32->disconnect() if ($dbh32); 

 

 

System DSN on Windows 2008r2 64 bit

Setting up a 32bit VB/Oracle app on a Win2008r2 64bit OS/Server can prove to be problematic.

Heres a link to my discussionfrom the Oracle OTN forum.

https://forums.oracle.com/forums/thread.jspa?messageID=10346952#10346952

The key is using the windows 32 bit panel here c:\windows\sysWOW64\odbcad32.exe to create your connections using the Oracle 32 bit client/driver.

In addition theres a gotcha where you may have to configure, rather than add, an existing System DSN connection to get it to work.

 

Updated 8 May 2013:

ODBC connections can be very finnicky regarding white space. When creating a DSN make sure there is no whitespace at the end of the DSN Alias! It sounds stupid, and it is yes, but this can take a while to figure out πŸ™