Home » RDBMS Server » Server Administration » Connect to another server and execute file
Connect to another server and execute file [message #192785] Wed, 13 September 2006 09:54 Go to next message
skiskis
Messages: 10
Registered: June 2006
Junior Member
Hello,

I'm sure this will seem like a strange question, but I'm risking the possibility of getting flamed and asking anyway. I was wondering if it is possible to connect to another server and execute a SQL script from within an Oracle database. Specifically, I'd like to perform the following:

1. Connect to another Solaris server
2. Run/Execute .SQL script residing on that server

Note: I want to perform this task from within an Oracle db

Any assistance would be appreciated!

Thanks,

Scott.
Re: Connect to another server and execute file [message #192787 is a reply to message #192785] Wed, 13 September 2006 09:59 Go to previous messageGo to next message
email.sandeepnaik
Messages: 121
Registered: August 2006
Senior Member
create entry in tnsnames.ora and then connect to remote database within sqlplus and exeucte your script. Copy of script can be kept local where you are connecting to remote database.

Sandeep
Re: Connect to another server and execute file [message #192789 is a reply to message #192785] Wed, 13 September 2006 10:06 Go to previous messageGo to next message
skiskis
Messages: 10
Registered: June 2006
Junior Member
Hi Sandeep,

Thanks for your reply. I think that will work out perfectly. Here's another question for a different scenario - Do you know if it is possible to connect to a remote server (not the database itself) and execute a shell script or other executable on the target server from within an Oracle database?

Thanks,

Scott

Re: Connect to another server and execute file [message #192850 is a reply to message #192785] Wed, 13 September 2006 21:40 Go to previous messageGo to next message
gkrishn
Messages: 506
Registered: December 2005
Location: Putty a dark screen
Senior Member
Your all doubts will be cleared if you learnt to work on/connect using TELNET.

about shell script-
Any unix command can be executed from SQL> prompt using !
eg: SQL>!ls
SQL>!pwd

similarly SQL>!./shellscript.sh

This should work but not tried.
Re: Connect to another server and execute file [message #192944 is a reply to message #192785] Thu, 14 September 2006 05:56 Go to previous message
email.sandeepnaik
Messages: 121
Registered: August 2006
Senior Member
you can run rsh commands followed by actual command to execute.

rsh "remote server name" "command to execute"

e.g.
rsh myserver01 ls -ltr

Sandeep
Previous Topic: Calling procedure from Shell script
Next Topic: information regarding Stats pack
Goto Forum:
  


Current Time: Wed Dec 07 16:47:33 CST 2016

Total time taken to generate the page: 0.08994 seconds