on 2017 May 01 2:19 PM
I am unable to connect to my database in a batch script. When I ping it, it fails. But when I open up scjview and connect (either with a connection profile or entering in the username, password, database file, and encryption key) it works. How can I do this sequence just on the commandline to connect and then run a script?
This is what is not working
dbisql -c "uid=DBA;pwd=sql;eng=servername" myscript.sql
This ping also does not work
dbping -d -c "uid=DBA;pwd=sql"
However, if I do this:
dbisql -c "uid=DBA;pwd=sql;eng=servername"
and then manually enter in the database file and encryption key, the previous commands all work. How do I include entering the database file and encyption key to this command?
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The pattern you are describing indicates you desire/require the database to autostart.
It is unfortunate that dbisql won't prompt the connection dialog AND read the cmdline at the same time. I run into that regularily myself. You can always try including DBF= ...; and DBK=...; in your connection string.
The main issue with doing that is your client now knows the decryption key. It is usually better to have the database running as a service and take further measures to protect that key from casual expose.
If you are in the middle of development you could also consider leaving off encrypting your databases until you have real production or user information that needs protection.
If you must autostart the database and provide the encryption key you can consider burying the key inside of a configuration file and reference that in your cmdline as in:
dbisql @at_isql.txt
customizing that file as suited to your needs and combine that with other parameter as needed. The key can then be protected by using dbfhide.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
9 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.