Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RDC to Oracle Servers

by Paladin (Priest)
on Jun 30, 2004 at 15:57 UTC ( #370792=CUFP: print w/ replies, xml ) Need Help??

At work, I admin a half dozen or so different Oracle servers, and sometimes it's a pain to try and remember which particular DB is on which machine, so I wrote a small script to allow me to RDC to the correct machine given a DB name. Using wperl.exe rather than perl.exe gets rid of the console window opening up when you run it.
#!C:\perl\bin\wperl.exe -w use strict; use warnings; use Win32::Process; use Tk; my $mw = MainWindow->new; $mw->Label(-text => 'Oracle DB:')->pack; my $db = $mw->Entry( -width => 20, )->pack; $db->bind('Tk::Entry', '<KeyPress-Return>', \&connect); $db->bind('Tk::Entry', '<KeyPress-Escape>', sub { exit }); $db->focus; my $message = $mw->Message(-justify => 'center', -text => '')->pack; MainLoop; sub connect { my $dbname = $db->get; my ($server) = `tnsping $dbname` =~ /HOST=([^)]*)/; if (defined $server) { my $ProcessObj; Win32::Process::Create($ProcessObj, "c:\\winnt\\system32\\mstsc.exe", "mstsc /v:$server", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); exit; } else { $message->configure(-text => "The database \"$dbname\" can't b +e found"); } } sub ErrorReport { print Win32::FormatMessage( Win32::GetLastError() ); }

Comment on RDC to Oracle Servers
Download Code
Re: RDC to Oracle Servers
by dba (Monk) on Jul 06, 2004 at 17:13 UTC
    If the problem is remembering db to host mapping, a simple solution would be to ask your network admin to alias db name to hostname in DNS server.
    if your network admin won't allow, update in your XP hosts file.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://370792]
Approved by NovMonk
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-10-01 11:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (9 votes), past polls