How to download and setup sqlplus for running sql commands? - oracle

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

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)

How can I configure DOS and SQL Developer to use the TNSAMES file I want to use?

I am using SQL Developer to connect to a few Oracle databases on different versions i.e. 18.0.0 and 11.2.0.
I have installed both sets of drivers on my PC. It appears that when I use TNSPING (via a command prompt); it uses the TNSNAMES file in the 18.0.0 folder and when I use the SQL Developer tool (https://www.oracle.com/uk/tools/downloads/sqldev-v192-downloads.html) it uses the TNSNAMES file in the 11.2.0 folder.
How can I configure DOS (TNSPING) and SQL Developer at runtime to use the TNSAMES file I want to use?
I have spent one hour Googling this, but I have not found an answer.
Two platforms, two different answers.
For 'DOS' - or say a command line interface running from the Oracle Client. SQLPlus is set to honor an ENV Var called TNS_ADMIN, but it will also check the ORACLE_HOME/network/admin folder, and it will also check the Windows Registry under HKEY_LOCAL_MACHINE and Oracle, also for TNS_ADMIN.
For SQL Developer, a Java application using JDBC driver, it also tries to honor the TNS_ADMIN environment variable, although it does NOT go into the Windows Registry, looking for known TNSNames.ora files. It will also look in the current folder, or it will look where you TOLD it to look, in the application preferences.
You can see for yourself where SQL Developer is looking, but running this command through the script engine (F5) -
show tns
This will show you what files we've found and are using, in addition to the first dozen or so services.
TNS Lookup locations
--------------------
1. USER Home dir
C:\Users\jdsmith
Location used:
-------------
C:\Users\jdsmith
Available TNS Entries
---------------------
LISTENER_ORCL12C
ORCL
ORCL12C
If you want to tell SQLDev which tnsnames to use, look at the perferences
If you google 'tnsnames sql developer' the first couple of hits are StackOverflow questions that already cover this, and the 3rd one is to my blog.

Need help installing ODAC 122011x64 so I can connect ADW to Power BI

So I have successfully installed Oracle DB 19c and connected it to Oracle SQL Developer. I am able to create tables and run queries. Furthermore, I can connect to ADW with both python and SQL Developer and any changes that I commit are seen in all locations. I am trying to connect the ADW database to Power BI. I am running all this on a personal Windows 10 Pro laptop with plenty of SSD & RAM.
In a new window of Power BI I click Get Data and then Oracle Database followed by Connect. When I do this I get a pop up that says:
The recommended provider ('Oracle.DataAccess.Client') is not installed. You can continue with your current provider, however it has been deprecated and may not work correctly.
I clock OK. Enter my Server as the TNS Name that I have used for my python and SQL Developer instances. In my ADW database, I have a table called TEST. It's a simple table with 1 column with the years 2015 through 2020 in it. Been using this to test to see if things are working. So I click on the DirectQuery and run the SQL statement SELECT * FROM TEST under the Advanced options menu and select OK. A sign in window pops up and I select the Database table and enter my correct ADW username and password. The same one that I can use to access this table from SQL Developer and then select Connect. When I do, I get this error:
Details: "The provider being used is deprecated: 'System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.'. Please visit https://go.microsoft.com/fwlink/p/?LinkID=272376 to install the official provider."
So I go to the website and download the ODAC122011_x64 file from Oracle and unzip it. When I double click the setup.exe file inside the directory I get a yes/no user control account menu and I select yes and then a command prompt window flashes very quickly and then nothing happens. I ran a super slow motion capture from my phone to capture what the command window showed and below is what I see:
Starting Oracle Universal Starter...
Checking monitor: must be configured to display at least 256 color Higher than 256 . Actual 4294967290 Passed
Preparing to launch Oracle Universal Installer from C:\Users\<my username>\AppData\Local\Temp\OraInstall2020 09:20_09-04 {???}
Please wait .._
It does nothing after this I have tried running the oui.exe file under the install subdirectory and get nothing and I have tried running the install.exe file in Oracle Universal Installer that I acquired when installing Oracle DB 19c and I get the following error when I target the install.exe file for installation:
OUI-10118:C/Users/{my username}/Downloads/ODAC122011_x64/Setup.exe is either a directory or a corrupt file. Specify a valid filename.
This is a file that I just directly downloaded from Oracle's website and unzipped to a directory with no spaces in the directory location. I have the latest version of Java installed (JDK 15).
I am not sure the proper work around here. Why can't I get my Power BI to connect to my Oracle ADW table using the methods described in this article. Those are the instructions that I used. It appears that I need this ODAC application but I don't understand why it won't install.
Can anyone help me resolve this issue? Thanks!
Edit: I am using 64-bit on each application.
Update: Still having issues. I checked the log and this is what I am seeing:
Using paramFile:
C:\Oracle\Oracle_PowerBI_ODAC\ODAC122011_x64\install\oraparam.ini
Checking monitor: must be configured to display at least 256 colors. Actual 4294967296 Passed
The number of files bootstrapped for the jre is 0.
The number of files bootstrapped for the oui is 0.
the client version need not match the server version, Removing all other versions, and making sure that I had the x64 version,
You need the latest ODP.net library to use Oracle. Please download it here:http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
I figured out the solution after reviewing this post. Apparently having over 2TB of free space on a hard drive causes this problem. You have to go into command prompt and create a temporary file to get your free space under 2TBs using something like this:
fsutil file createnew temp_1TB_file 1200000000000
Run the setup.exe again and then delete the temp file after.
Update: After doing all this I still was running into the same issues in Power BI. Then I read the troubleshooting notes from this page more closely and realized that I might have found the problem when it said:
If you downloaded Power BI Desktop from the Microsoft Store, you might be unable to connect to Oracle databases because of an Oracle driver issue.
I uninstalled the PowerBI Desktop that I had installed from Microsoft Store and installed it from the download from its website and tried connecting to Oracle ADW again through PowerBI and IT WORKED!!! So much troubleshooting but it finally works!

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 access an Informix database on localhost (Windows)

I have a very simple question. After installing Informix (iif.12.10.FC2DE.win2003.zip) on my computer, the database system seems to be running.
How can I access it? I even installed Server Studio (serverstudio_w_sentinel_win_9.1.10397.zip), but all frontends ask for so many things (what is the difference between host ans server, btw), and I don't know what to enter.
I have a lot of experience with HP-SQL, Oracle and PostgreSQL (all on Unix/Linux). In PostgreSQL, you just enter psql on the command line as the user postgres and create users and databases.
There is a bit of a missing link. Can anybody help me with this? Unfortunately, the computer runs Windows 8, so there is no helpful Start Menu.
Thanks in advance!
I never installed Informix at Windows 8 , AFAIK should not be different of any other windows.
First, as common knowledgment the "pre-configured" and basic access to Informix database is with an utility called dbaccess , you can compare it with sqlplus from Oracle, mysql from MySQL and psql from Postgre.
It run only in CUI mode, but something as "ncurses like" based on menus (it isn't by self a command line like the others mentioned)
So, answering the question , to start the basic access with dbaccess you should open the Informix Command Line which is a shortcut what should have been created during the installation at you windows Informix Apps Menu.
Logged with Informix , at Start menu, you should have access to Apps menu clicking at the lower arrow at the bottom of the screen.
Look for Informix command line icon, it's a shortcut to .bat very specify to your instance configuration, this file will define the informix environment variables (INFORMIXSERVER, PATH, etc) and open the prompt to you.
Then just type dbaccess and voila , there is...
At windows 7 you need run this command line as administrator (right click on icon and choose the administrator option). Not sure if Windows 8 is the same...
Basically that's all...
But I always see windows users "up theirs noses" to dbaccess because it isn't friendly for a windows user, since it run at command line and windows command line is very limited if compared with any *nix shell.
Now if you ask for any informix user at Unix/Linux world the history is different...
So, alternatives graphics tools to access Informix like DBeaver, ServerStudio, SquirrelSQL, DbVisualizer, etc... you must know some configurations of your instance:
Looking from client point of view, for a TCP/IP connection, you must know :
INFORMIX SERVER : Is the name of your instance/engine (not database) and is directly associated to the instance listeners.
One instance can have multiples names (listeners) and one machine can have multiple instances running simultaneously. At basic install and with auto configuration you probably will found only one name, something like ol_#####.
For oracle this is similar of ORACLE_SID .
if you open your Informix command line, you can discovery this typing echo %INFORMIXSERVER%
HOSTNAME : The hostname/IP of the machine where is the engine.
This can be the localhost/127.0.0.1 but depends if it was configured ant the listeners of the engine. Probably will be the hostname of your windows..
SERVICE NAME : this is the network service configuration / port number for TCP/IP listener.
This can be a number or the name, if you use the name, then you need configure the services file. Probably you will find it at: c:\windows\system32\Drivers\etc\services
PROTOCOL : There a few options here, but by default use the onsoctcp, unless you configure/choose other like Data Driver (DR).
DATABASE NAME : This is will be the default database used by the connection, if you don't have anyone set to "sysmaster" which is the mainly database of the engine.
but don't play with it! it is like SYS/SYSTEM database for Oracle...
USER/PASSWORD : By default Informix uses OS authentication, so only users which exists at Windows will able to login at the database (of course, they will need the grants to access databases, tables, etc).
This is a connection string for a JDBC client (like SquirrelSQL) :
jdbc:informix-sqli://<host_name>:<port_number>/<database_name>:INFORMIXSERVER=<server_name>
If you like to know more information about the network configured at your instance/engine check this :
SetNet32 : the utility specify for Windows which configure the listeners used by the engine.
(this is only for windows where they use windows registry to save the information. At *nix world is used the $INFORMIXDIR/etc/sqlhosts file or any other pointed by $INFORMIXSQLHOSTS file).
ONCONFIG : the mainly configuration file of your engine, located at %INFORMIXDIR%/etc/onconfig.%INSTANCENAME% .
inside it, look for DBSERVERNAME, DBSERVERALIASES
For more information you can look at online informix Manual : http://pic.dhe.ibm.com/infocenter/informix/v121/index.jsp or download the PDFs (you will find the link to download at the main page of this link)
DBeaver and SquirrelSQL
This tools are FREE Java I-SQL where both works fine with Informix.
DBeaver have an advantage , it's automatically download and install the JDBC driver for you.
For SquirrelSQL you need setup it manually (but isn't hard).
When you install informix there is an option for install default instance and at the end you can choose if want start it and open command line or not. If you select yes a command line will be prompted and you'll can access to bin folder and type
dbaccess.exe
(bin folder usually is in your informix instalation folder)
Now you can manage your informix server.
If you want create your own instance you'll can't execute dbaccess -at least you open the correct command line-. To open the correct command line you need access to your instalation folder and execute the cmd according your instance, for example myinstance.cmd, this will open a command line and now you can go to bin folder and execute 'dbaccess.exe'.
This is a very very high exaplanation but it seems to be usefull for my team.
If you need more info the #ceinmart anwer is awsome, or:
http://www-01.ibm.com/support/docview.wss?uid=swg21651873
https://www.ibm.com/support/knowledgecenter/en/SSGU8G_11.50.0/com.ibm.igmsw.doc/ids_iw_020x.htm

Resources