SQL block in a Shell Script connecting to a local and remote DB
Hi All,
In a Shell scriipt with a SQL block I want to issue a query against a local DB and a remote DB on a remote server. The shell script is running locally.
This is how I connect to the local server. But I want the query to reference remote table in the join. Question can I specify a localServer.DB and RemoteServerDB in the connection command.
Many thanks for your help.
Dave
Moderator's Comments:
Please use code tags next time for your code and data.
I have a shell script which resides on three SCO machines containing some simple sqlplus statments. I need to run these scripts remotely. Currently, I am trying to use rsh to do so:
rsh hostname myscript args
The problem is that the arguments to the sqlplus statements in the remote shell... (4 Replies)
Hi all,
I am running an sql file from unix .In the log file along with the output
i am getting details of connecting and disconnecting sqlplus like
It saves the output with "Connected to Oracle8i Enterprise Edition Release
8.1.7.4.0 Connected as apps" and "disconnected... (1 Reply)
Hi there folks,
I am trying to execute remote sql queries on an Oracle server.
I would like to save the result of the executed sql queries on a text file, and send that text file as an attachment to an email address.
Could anyone give me an idea on how the above could be achieved? Any help... (2 Replies)
Hi I am getting this error while connecting to sql through a shell script, whereas i am able to connect to sql directly.
It was working properly earlier, no clue why i am getting this.
Please find the log below:
FTP to <IP> completed Wed Apr 30 11:42:01 BST 2008
Program ended. Wed Apr 30... (1 Reply)
I need to execute a shell script on a remote linux box. But the shell script resides on the local linux box where I am currently logged in. Is there a way to do this? I know rsh <host> <command> can execute a command on the remote host. (6 Replies)
Hello
I'm beginner in the linux scripting and i would like to get help. I want to create a script that can block one or more Port even see all the TCP port. The ports must be blocked even when starting my machine.
Of course requires a second script which will allow the ports that you want to... (0 Replies)
I need to run a local shell script on a remote machine. I am able to achieve that by executing the command
> ssh -qtt user@host < test.sh
However, when I try to pass arguments to test.sh it fails.
Any pointers would be appreciated. (7 Replies)
local script:
cat > first.sh
cd /tmp
echo $PWD
echo `whoami`
cd /tmp/123
tar -cvf 789.tar 456
sleep 10
except script:
cat > first
#!/usr/bin/expect
set ip 10.5.15.20
set user "xyz123"
set password "123456"
set script first.sh
spawn sh -c "ssh $user@$ip bash < $script" (1 Reply)
I have googled this and found many solutions, but none of them are working for me. I am in a korn shell, most others reference bsh, maybe that is the issue? Anyway, all I am trying to do is use a variable I have declared in my main script in a remote shell I am running through ssh.
So I have a... (8 Replies)
Discussion started by: DJR
8 Replies
LEARN ABOUT SUNOS
list-instances
asadmin-list-instances(1AS) User Commands asadmin-list-instances(1AS)NAME
asadmin-list-instances, list-instances - lists all the instances in the server
SYNOPSIS
list-instances [--user admin_user] [--password admin_password] [--host localhost] [--port 4848] [--domain domain_name] [--local=false]
[--passwordfile filename] [--secure|-s]
Use the list-instances to list all the instance in the server. The list-instances command can be run both locally and remotely. To list
remote instances, the named administration server must be running on the hostname and port number specified. The user authenticates using
the password identified for the administration server.
OPTIONS --user administrative user associated for the instanace.
--password administrative password corresponding to the administrative user.
--host host name of the machine hosting the administrative instance.
--port port number associated with the administrative host.
--domain name of the domain.
--local determines if the command should delegate the request to administrative instance or run locally.
--passwordfile file containing passwords appropriate for the command (e.g., administrative instance).
--secure if true, uses SSL/TLS to communicate with the administrative instance.
Example 1: Using list-instances in local mode
asadmin> list-instances --domain1 --local
admin-server running
server1 running
Where: the server1 and admin-server instances for the domain1 domain is listed.
Example 2: Using list-instances in remote mode
asadmin> list-instances --user admin --passwordfile passwords.txt --host localhost --port 4848
server1 [mayank:80] running
Where: the server1 instance associated with the specified user, passwords, host, and port number specified is listed for the remote
machine.
EXIT STATUS
0 command executed successfully
1 error in executing the command
INTERFACE EQUIVALENT
Server Instance page
asadmin-show-instance-status(1AS)J2EE 1.4 SDK March 2004 asadmin-list-instances(1AS)