How to execute command in DataGrip - datagrip

I'm using DataGrip 2019.2, and I'd like to execute a command (PostgreSQL) such as \h RELEASE SAVEPOINT to get more information about a commmand.
I've tried using the console feature and it complains this is invalid syntax. How do I execute commands such as this?

It is not possible for now. Please follow and vote for the ticket.
https://youtrack.jetbrains.com/issue/DBE-4660

Related

SQL script through bat file

I am trying to automatize some daily checks and now I need to use SQL query.
So I write my SQL script and then tried to run it through batch file to be able to put it to task scheduler.
So I wrote something like this
sqlplus user/pw#DBServer #PathToSQLScript.sql > "DestinationWhereToPutOutput"
It is confusing me because this works normally at any other server that I already automatized but at this one it gave me error
ORA-12154: TNS: could not resolve the connect identifier specified
And wanting me to reenter credentials.
Is there any other way how to run SQL script through batch file?
Thanks in advance for any advice.
The most frequent reason for ORA-12154 is that DBServer can't be found in TNSNAMES.ORA file. Therefore:
create DBServer's alias in TNSNAMES.ORA, or
use EZCONNECT syntax (which doesn't require TNSNAMES.ORA) that looks like host:port/service_name
For example, that would be
sqlplus user/pw#db_server:1521/orcl
For much more info about troubleshooting ORA-12154, see Ed Stevens' blog

Running SQL file in command line using sqlplus result with an error

Using ORACLE 12.0c and SQL Developer.
I try to run a SQL file (myfile.sql) in command line using sqlplus:
sqlplus username/password#schema #myfile.sql resulted with an error.
I run only sqlplus with connection parameters sqlplus username/password#schema and still receive an error (see screenshot).
Typing the username and password didn't help as well.
Only running sqlplus and supply the database domain, port and database name I managed to connect and run the file.
The database is defined in SQL Developer, but I don't see it in TNSNames.ora.
What am I missing?
I give credit to #thatjeffsmith and the answer is... see screenshot:

Spfile and Pfile not created during installtion of Oracle 11g

I need your help concerning an issue with oracle 11g installation, i installed it while connected to a domain account (and still connected to it), after installation complete and a reboot i tried to startup Oracle using windows command line:
>sqlplus /nolog
>connect sys /as sysdba
>startup
After the startup command i get the following error:
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file ORA-27041: unable to open file
C:\oraclexe\app\oracle\product\11.2.0\server\dbs/spfileXE.ora
When i manually went to spfile and file locations, i didn't find anyone of them.
now i am looking for a method to generate of create these files without having to reinstall Oracle 11g. Any ideas please?
PS : i have windows 10.
Thanks in advance
Problem solved, while looking for pfile i was looking for something like PFile.ora, have just found that it is named init.ora, sounds stupid but yeah :D

Using ruby-oci8 with AIX successfully (no ORA-12537)

Has anyone successfully used the current (2.1.7) version of ruby-oci8 against Oracle on AIX?
I can run my ruby-oci8 test script and get it to work against TNS for Linux and TNS for Windows but not AIX.
However, it is not an Oracle Instant Client issue, I can do a command line sqlplus connect from my machine to the Oracle (TNS for AIX) server and it works fine. However when I wrap it in a ruby script (using ruby 1.8.7) it fails with:
oci8.c:513:in oci8lib.so: ORA-12537: TNS:connection closed (OCIError)
from /usr/lib64/ruby/gems/1.8/gems/ruby-oci8-2.1.7/lib/oci8/oci8.rb:148:in initialize' from app/controllers/testdb.rb:32:innew'
from app/controllers/testdb.rb:32
I am not doing anything clever here, just creating a new connection like this:
conn = OCI8.new(username, password)
Any information on this would be great, I haven't tried packet sniffing - yet....
-John
I did eventually get this working, the short answer is that I had success using the full connection string, that is:
OCI8.new("user/password#(description=(address=(protocol=tcp)(host=host.uab.edu)(port=1521))(connect_data=(sid=somesid)))")
The confusing part is that this format isn't mentioned in the API and that I had to use sid= of service_name=.
The details are here:
https://github.com/kubo/ruby-oci8/issues/66

How I configure shell sqlplus to oracle

I'm working in a new developer environment. How I set connection with oracle, because I need to execute any scripts, but I received the message: SQLPLUS NOT FOUND :/
you need to add $ORACLE_HOME/bin into your PATH. and check if $ORACLE_HOME is defined first. If it's not ,define it (just the root folder of your oracle client).
If you don't have an oracle client installed you need to install one

Resources