How to connect to open edge data base using .pf file? - openedge

I'm new to open edge progress ABL.
How to connect to the open edge database using .pf file

The PF file is a simple text file with all relevant database connection parameters, e.g.
-db c:\full\path\to\database
or
-db databasename (no .db)
-H hostname or IP address
-S portnumber or portname
Then you start the client with
prowin -pf pffile.pf
prowin32 -pf pffile.pf
_progres -pf pffile.pf

Create a .pf file, I am calling it connect.pf, containing something similar to:
# connect to db using a .pf file
-db dbname
along with any other startup parameters that you might desire and then reference the .pf file on your command line or in the properties of your shortcut:
mpro -pf connect.pf

Related

MariaDB create database via CLI

How do I issue commands to MariaDB via the CLI without actually jumping into the interactive use mode?
I know I can type mysql which will then jump me into the interactive mode where I can write SQL commands like CREATE DATABASE dbname; and then exit to go back to the regular terminal.
However I'd like to skip that and do something like mysql 'CREATE DATABASE dbname;' all in one line.
mysql --help | grep "\-execute"
Output:
-e, --execute=name Execute command and quit
So to create a database with command line client, you just need to execute
mysql -uuser -p -e"CREATE DATABASE dbname"
You can also concatenate several SQL statements, e.g.
mysql -uuser -p -e"CREATE DATABASE dbname;SHOW DATABASES"
Put the commands that you want executed into a text file (optionally with a file extension of .sql) then, from the command line, do mysql -uuser -p < yourtextfile.sql to have all of the commands in the file executed.

R system() call that accepts prompted responses; to login to VPN

How do I use system() and feed it prompted responses? My responses do not change and so if I can set them once in a txt file or other place that is fine as well.
At the command line, I run the following line to connect to a vpn:
/opt/cisco/anyconnect/bin/vpn -s connect web.site.net <<"EOF"
and this prompts 5 lines which I respond to and then it logs into the VPN:
domain
user
password
exit
EOF
When I try to do the same with a system() call in R, I tried this but no joy:
system('/opt/cisco/anyconnect/bin/vpn -s connect web.site.net <<"EOF"'; "domain"; "user"; "password"; "exit"; "EOF"')
Thank you for reading.
First you can create a file with information you need here. Then run it from within the R shell by using system("expect yourFile.sh")

Unable to login to unix server using Plink in batch ifle

we are facing one issue with Plink while running the batch files, we are running batch files using autosys, the batch files are available in my windows client server and one of the batch file will call the plink to connect the unix server but we are facing the issue to connect the unix server, when I run the batch script using command prompt then the plink can be connected the unix server but it is not happening with autosys to run the batch scripts. below is the Plink command...
call %aScrDir%plink -l %hypSrvUser% -pw %hypSrvPwd% %essSvr% "sh /xxxxxxxxxxx"
when we see the error file which is generated by autosys there are some errors
"The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 f9:5e:2a:4a:11:ed:40:91:80:3a:13:04:08:05:e7:ac
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) Connection abandoned."
could you please give the suggestion to avoid this situations and where do we add the host key in the server.
appreciate your action on this.
Option 1 : If allowed, first start a manual connection to the server and confirm the SSH key
Option 2 : If you are running the last version, there is a -hostkey switch to indicate in command line the expected host key
Option 3 : Use something like
echo N | %aScrDir%plink -l %hypSrvUser% -pw %hypSrvPwd% %essSvr% "sh /xxxxxxxxxxx"
That is, pipe the n character to the plink command to answer no to the query to save the host key.
Try this it would be working fine.
cd to the plink.exe file directory
echo Y | .\plink.exe -pw xxyyxxyy root#host_ip 'ls -lah'

Using UNC path with psexec does not work in remote connection

Hi I am trying to open a setup file in serverB in serverA that I am connecting to remotely. When I use the UNC path for folder in serverB the error message states that the network path is not found. I know that there is some security layer that is preventing me from doing this. I tried to map network drive n use that to open the installer but same error message comes up. This is the code. What is preventing me from opening this file? My guess is because I am double hopping is there credssp in psexec like in powershell that enables double hopping?
psexec -s \\serverA -u xxxlab\xx004 -p xxxxx -i 0 -d "\\serverB\npp.6.3.3.Installer.exe"

nohup - dont want nohup.out but want log going to a different file on the remote server

I'm running the following command (where variables have valid values for ssh command and $file - is a .sql file).
nohup ssh -qn ${ssh_user}#${dbs} "sqlplus $dbuser/${dbpswd}#${dbname} <<ENDSQL | tee "${sql_run_output_file}".ssh.log
set echo off
set echo on
set timing on
set time on
set serveroutput on size 1000000
#${file}
ENDSQL
"
When I was using the above command without "nohup" before ssh command, after 1 hour or so, my connection from source server (where im running ssh) was getting an error/message "Connection reset...." and hanging my BASH shell script (which contains this ssh command in it). When, I use nohup, i dont see the connection issue.
Here's what I'm trying to get and need your help.
Change the command shown above so that the command will NOT create a nohup.out
(Did I read that I can use > instead of | tee ... and use 2>&1)
I DO NOT want to run the command giving a "&" (background)
I DO want a LOG file for the sqlplus session that's running on the target DB server via ssh command/connection (initiated from source server).
Thanks.
You can still lose the connection when running ssh under nohup, so it's not really a good solution. If possible, I would recommend that you copy the sql file via scp to the target server, then ssh in to the server, open a screen and run the command from there (Or run it under nohup). Is that an option?

Resources