Run scripts on remote server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run scripts on remote server
# 1  
Old 07-31-2014
Run scripts on remote server

I have a sql script in my parent server - host1
i can do a passwordless ssh to remote server - host1a and host1b

Can i run the sql script which is present in host1 by connecting to host1a and host1b.
Should i place the sql script in host1a and host1b ? Is there a way i can run without placing the scripts in the 2 child servers.?

Thanks
# 2  
Old 07-31-2014
Confirm if you are not able to connect to database on host1b from host1a
Code:
sqlplus user_name/password@dbname

# 3  
Old 07-31-2014
Probably a little safer to run the SQL like this:-
Code:
sqlplus <<-EOSQL
   user_name/password@dbname
   select Hello from dual;
EOSQL

The other way will publish your predentials to anyone who does a ps at the time and spots your process.

Call me paranoid, but I'm paranoid Smilie



Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to run command on remote server?

Hi I am trying to write a script which when I run from server A it execute few command on another server say B and show me the output. below is the script but it is not showing me the o/p of B machine but instead showing me A machine o/p every time. #!/bin/bash for i in `cat... (14 Replies)
Discussion started by: scriptor
14 Replies

2. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

3. Shell Programming and Scripting

Need script to run the command in remote server

hi, I need script to perform below task. 1. Read the IP address 2. copy the script from origin server to destination. 3. get root access on destination server 4. run the script on destination server 5. return to the origin server Code: #!/bin/bash echo "Enter Server IP... (5 Replies)
Discussion started by: bapu1981
5 Replies

4. Shell Programming and Scripting

Copy and run that script in Remote server

Hi All, I need script to perform below task. 1. I have a script in one server and need to copy this script to remote server 2. login in to remote server 3. run the script which i copied to this server. #!/bin/bash read a scp /tmp/script.sh user@hostname:/tmp ssh user@$a ./scirpt.sh ... (2 Replies)
Discussion started by: bapu1981
2 Replies

5. UNIX for Dummies Questions & Answers

Run perl scripts to a distant server!!!!

Hello everybody; I want to run some scripts perl on my windows pc to a distant server linux which i connect to it via putty,I'm just a small beginner and I want just to know if this is possible or not and if you can send me some docs I will really grateful. (1 Reply)
Discussion started by: bassma
1 Replies

6. Shell Programming and Scripting

Need help on how to exit a script run on a server from a remote server

hi, I am using the below line to run a script from remote server(say server A) to another server(say server B). ssh username@servername ksh script name. The issue is the script logs into server B, executes the script on server B, transfers the file to server A but does not exit from... (4 Replies)
Discussion started by: yohasini
4 Replies

7. Shell Programming and Scripting

Execute scripts on remote server

Hi All, I need to first of all establish a connection to remote unix server non-interactively with the help of a shell script and then connect to oracle database from that server all with this script of mine. Please suggest the best method which could be used to connect to server for executing... (1 Reply)
Discussion started by: m_kapur83
1 Replies

8. Shell Programming and Scripting

Script to connect to a remote server and execute scripts

Hello All I need a script or set of commands which can establish a remote connection with another server and execute some scripts over there. Basically it has to establish the connection with the remote server as an user ,say 'testuser' and then execute the script 'testscript'. and return the... (5 Replies)
Discussion started by: sgbhat
5 Replies

9. Shell Programming and Scripting

run a application from a remote server via script?

I have a ksh script that does a bunch of things, then runs telnet server_b I then manually login, manually run one command (which launches an application with display back to my workstation), then logout at which point the main script takes back over, runs something else, then ends. Is... (4 Replies)
Discussion started by: yankee428
4 Replies

10. UNIX for Dummies Questions & Answers

Running shell scripts on a remote server

Hi - I am running Mac OS X (Terminal) at my current workstation, and I would like to telnet to my local server to run a shell script. The local server is a Solaris machine (don't know the version or the type of Unix being run on it, sorry.) The problem I have is that when I create a #!/bin/sh... (2 Replies)
Discussion started by: pepintheshort
2 Replies
Login or Register to Ask a Question