Oracle sqldeveloper - how to connect DB from command line - oracle

I am writing a small DB utility. I would like to give the user the ability to open an instance of Oracle sqldeveloper directly from this utility. Is it possible to open Oracle sqldeveloper IDE that already connected to a specific DB?
Something like sqldeveloper USERID/PASSWORD#DATABASE

/? works rather than /h. There are options to override the cofiguration file so whether you can do that or not is probably determined by the facilities offered by the config file.

Luckily, yes. This is now possible using Oracle's ConnectionHelper extension.
It's a bit of hacky workflow, though. Hopefully they'll figure out a way to include in SQLDeveloper itself, because if management learns about adding a 'githubusercontent' repo they might misjudge the risks.
Also, be sure you make use of a pretty recent SQLDeveloper (20.2+).
But here goes:
In SQLDeveloper, add the following update source, by going to Help -> Check for Updates and hitting 'Add': https://raw.githubusercontent.com/bjeffrie/sqldev-update-center/master/update-center.xml
Select 'Connection Helper' and next-next-finish the wizard (you'll need to restart SQLDeveloper).
Go to Tools -> Preferences and in the left pane, click the node 'Connection Helper', then in the main pane enable 'Accept command line connections'. You don't need any of the other check boxes for what you're asking.
Close SQLDeveloper and start it from CLI: sqldeveloper -myCLIconnection=user/pw#host:port/service
[This is a combination of what's documented by Oracle's thatjeffsmith on his blog and what Oracle's Brian Jeffries put in Oracle's github repo.]

This is now possible with a free, open-source extension as long as you're using version 20.2 or higher of SQL Developer.
I have step-by-step instructions here
A quick GIF of it working...

It doesn't seem so. sqldeveloper.exe /h shows us possible launch parameters, and none of them seem to have anything in common with your demand.

Related

Create the database button is not active in Oracle SQL Developer

I don't know how to describe the problems with the Oracle SQL developer program. I am new at this. The story is here;
I downloaded Oracle SQL Developer 22.2. And I started sqldeveloper.exe. Oracle SQL Developer is started but I am not doing anything in this program. Everything freezes. The Create database button is inactive. Press the... button and press .. but nothing changes.
My computer is a gaming computer and not old. The hardware is above the minimum requirements to install the program.
I tried resetting the windows factory settings...
I tried deleting and installing it.
I tried the old version of sqldevelepor.exe...
How can I solve this problem?
SQL Developer is a GUI tool we use to access (most usually) an Oracle database.
But, to do that, you need a database. According to what you said so far, there's none so - SQL Developer itself can't do much.
I'd suggest you to visit the same site (Oracle Technology Network, OTN) from which you downloaded SQL Developer, and this time download the database. Pick the Express Edition (XE) as it is easy to install and use. Along with the installation process, the setup will create the database for you (so you won't have to create it manually).
Then, once it is done, you should be able to use SQL Developer to connect to it. At first, you'll use SYSTEM or SYS users (pay attention to connect as SYSDBA in that case). Don't use these users for anything but administration purposes - create a new user (you can call it e.g. "berfin"), grant privileges to it (most usual are create session, create table, create view, create procedure) so that you could start working with it. In that schema (i.e. user) create your own tables, insert data, do whatever you planned to do).
I believe you should read some documentation first; OTN has it all. Start with the Concepts book, see short DBA (so that you'd be able to create your own user, etc.), have a look at SQL reference book (if you don't know SQL already). That should get you started. On the other hand, you could take shortcuts and check some YouTube videos/tutorials, ask here and there, Google for problems you meet but - in a long turn, if you really want to work with Oracle - read documentation.
tools --> preferences --> environment --> look and feel: windows (not oracle)

would you like to import preferences from previous sql developer installation

First Time I am installing sql developer in my new laptop and I am being ask would you like to import preferences from previous sql developer installation. What should I need to do now?
Please suggest.
If you do not have a prior sqldev on this machine , ignore this dialog and close it.
SQL Developer is a tool which enables you to access a database. Without a database, there's no much use of it.
Therefore, as you asked which username, password and SID you should enter, make sure that there's an available database you could connect to. If there's none, you can install it on your computer.
I'd suggest you to go with Oracle 11g XE which is easy to install (requires several NEXT clicks) and use. The same (download) page contains documentation, just in case you need it.

How to download and setup sqlplus for running sql commands?

I am sorry, for bugging you all with a very silly question probably, but I just started learning data base management system, and today I attempted my first sql class where I had to login by providing my login details and learned some introductory syntax. But I already got my first sql assignment where I have to create a table and enter values. For that I need to downlad sql plus in my computer. I opened the Oracle website and got confused. Didn't understand how to do it,neither could find a good step by step instructions by which I can understand it and download. Please provide a step by step process with links by which I can download it properly. Also I would like to say, my school provided sql plus software but it isn't running and giving an error "ocl.dll" error. I really need your help. Thanks in advance.
If you need SQL*Plus you can download the Oracle Instant client from here
Install this and make sure you have the SQL*Plus exe on your path.
Alternatively you can also use Oracle SQLDeveloper from here or SQLcl which is a java based command line for Oracle SQL based on the SQL engine we built for SQLDeveloper. You can download it here.
SQLcl is very easy and you can connect to any Oracle database using EZconnect syntax
sql.exe usernamepassword#yourdatabasemachinename:yoursqlportnumber/databasename
e.g.,
sql barry/omagh#devbox:1521/DEVDB1
Any questions on these, take a look at the community pages here.
Hope this helps.
B
I felt adding sql server and installing took a lot to discover and understand so I am adding some steps to get the same usage that one can find using sql+ tool. This installation is for oracle 11g express edition.
This is the link from which you can download oracle database software.
extract the zip file (don't change the name)
Start the "Setup"
when asked to choose password choose something you
will not forget and write it down
because this can't be changed easily later
When it will be installed completely, you will
see a shortcut in desktop which in most of the cases doesn't work
Open your browser type this link
http://127.0.0.1:8080/apex/f?p=4950
Caution: this port number can be 8081 or something else with respect to your free ports. If its occupied then when installing a window will appear having a PORT number section, one can see the number there.
You will see an Oracle window, choose "Application Express"
when you see a prompt of login put SYSTEM as user name
and give the password you have chosen in 4th step
You will see another window "Create Application
Express Workspace"
Choose "Create New" as "Database Username"
Give a name to "Database Username" and that must be
same with the next "Application Express Username"
Password same as 4th
11.You will see a window again where you have to
give your password
Now you will see 4 options
choose "SQL Workshop"->"sql Commands"
You are all set and you can do everything here.
Otherwise CLIMAX: Go to search button of your pc
type "Run SQL Command Line". You will see the
Command Line Interface.
Type in the window after SQL>
CONNECT USERNAME/PASSWORD
(these credentials are what you created in 9th and 10th
step)
Now you are ready to do whatever you want.
I recently did this for Oracle 19c
Download SqlPlus instant client - instantclient-sqlplus-windows.zip
Download Instant Client - instantclient-basiclite-windows.x64-19.9.0.0.0dbru.zip
Extract files from step #2 into some folder, e.g. c:\Program Files\OraInstClient
Extract files from step #1 into the same folder
Add this folder to the PATH Environment Variable in your Windows system
Open CMD window and type sqlplus
To connect without tnsnames.ora use this syntax
C:\WINDOWS\system32>sqlplus /nolog
SQL> connect sys#'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1522))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=myServiceName)))' as sysdba
Enter Password:
Connected.
SQL>
Optionally, under same folder, create structure - network\admin\tnsname.ora and create TNS name in there

What is the easiest way to open/view a Firebird database?

I have a .FDB Firebird file from an commercial Application we don't use anymore. It contains my customer data an I want to export or access it in some manner.
I have seen many procedures that require Firebird server installation, JDBC, ODBC drivers, GUI (I tried RazorSQL) tools that are just to complex for me to handle. I have been hitting into one problem or another every time, solve point by point but still hitting the wall.
Does anyone have a quick and easy way to simply open it (preferably on Mac OSX)? One that a non-Firebird / database tech guy can actually follow?
I finally found what was the issue.
It turns out that the path file to the .FBD file was the culprit. Mine had Portuguese accented words on the folder name. It seems like isql does not accept it. I moved the file to Desktop and the following command worked fine.
SQL> CONNECT /Users/user_name/Desktop/db_name.FDB;
Still haven't been able to use any Razorsql Gui tool though. It seems to have an issue with the JDBC driver.

How do create a shortcut to get Oracle SQLDeveloper to open and connect to a database [duplicate]

I am writing a small DB utility. I would like to give the user the ability to open an instance of Oracle sqldeveloper directly from this utility. Is it possible to open Oracle sqldeveloper IDE that already connected to a specific DB?
Something like sqldeveloper USERID/PASSWORD#DATABASE
/? works rather than /h. There are options to override the cofiguration file so whether you can do that or not is probably determined by the facilities offered by the config file.
Luckily, yes. This is now possible using Oracle's ConnectionHelper extension.
It's a bit of hacky workflow, though. Hopefully they'll figure out a way to include in SQLDeveloper itself, because if management learns about adding a 'githubusercontent' repo they might misjudge the risks.
Also, be sure you make use of a pretty recent SQLDeveloper (20.2+).
But here goes:
In SQLDeveloper, add the following update source, by going to Help -> Check for Updates and hitting 'Add': https://raw.githubusercontent.com/bjeffrie/sqldev-update-center/master/update-center.xml
Select 'Connection Helper' and next-next-finish the wizard (you'll need to restart SQLDeveloper).
Go to Tools -> Preferences and in the left pane, click the node 'Connection Helper', then in the main pane enable 'Accept command line connections'. You don't need any of the other check boxes for what you're asking.
Close SQLDeveloper and start it from CLI: sqldeveloper -myCLIconnection=user/pw#host:port/service
[This is a combination of what's documented by Oracle's thatjeffsmith on his blog and what Oracle's Brian Jeffries put in Oracle's github repo.]
This is now possible with a free, open-source extension as long as you're using version 20.2 or higher of SQL Developer.
I have step-by-step instructions here
A quick GIF of it working...
It doesn't seem so. sqldeveloper.exe /h shows us possible launch parameters, and none of them seem to have anything in common with your demand.

Resources