Oracle SQL Developer 101: The Very Basics

thatjeffsmith SQL Developer 3 Comments

Tell Others About This Story:

We spend a lot of time here talking about tips, tricks, and cool things that you might have missed. These posts generally all assume you’ve been around the Oracle Database block. But many of the folks that ultimately end up here, have NEVER touched an Oracle Database before.

This post is for you. You have decided to use SQL Developer, which is good. Because I can think of at least 10 reasons why SQL Developer is perfect for the beginner.

SQL Developer is a client interface for the Oracle Database. If you have SQL Developer installed, you’ll need a database to interact with. You have 3 options:

  • connect to a database that’s already been created and which you’ve been given an account – the easiest!
  • create your own database – not recommended
  • download our VM and use that to learn and play around with

I talk about the Virtual Machine (VM) option here. If you don’t have a database, and need one super quick…like, your-homework-is-due-tomorrow-morning-and-you’re-just-now-starting-QUICK, go read this.

If someone has given you an account, here’s how to get going.

Create a Connection

Right click in the connection tree, and select ‘New Connection.’

XE is the default SID because we have a free version of Oracle, eXpress Edition whose SID is 'XE'

XE is the default SID because we have a free version of Oracle, eXpress Edition whose SID is ‘XE’

If you’re working with a newer version of Oracle Database, especially 12c, odds are you’ll need to know the Service Name. If the SID doesn’t work, just try putting that same ‘name’ in the Service box.

Also, if you have just created your own database, and you try to connect as SYS – you need to set the ‘Role’ dropdown selector to ‘SYSDBA.’ When you connect as SYS, you are GOD. You can screw stuff up. Create a new user. And then connect as that user and do your playing around stuff. We can help with creating users.

You might also have been given a TNSNames File

The TNSNames file contains a list of database services that you can connect to. It handles knowing what the database server, name, and ports are. Just tell SQL Developer WHERE that file is.

Tools > Preferences, on the Database - Advanced page

Tools > Preferences, on the Database – Advanced page

Once that’s set, change your connection type from Basic to TNS.

Then use the dropdown on Network Alias input to select the database you want to connect to.

If  you use Connect Identifier, you'll HAVE to have an Oracle Client installed and configured, don't do that unless otherwise instructed by your IT admin or DBA.

If you use Connect Identifier, you’ll HAVE to have an Oracle Client installed and configured, don’t do that unless otherwise instructed by your IT admin or DBA.

Now hit ‘Save’, close the dialog. Your connection tree will have a new entry.

Expand it in the tree, you’ll get connected. Or you’ll see an error message. If you get an error message – address what is being complained about. I talk about common connection error messages here.

Otherwise, you’re IN.

The account you connected to, and the collection of the objects found in it, is known as your SCHEMA. Your schema could be empty. Or, it could have a bunch of tables in it.

To find out, expand the Tables tab.

Empty? Not supposed to be? Maybe you have access to stuff, and it’s not in your schema. Read this post.

Otherwise, you’ll see something like this:

Each connection you open will also open a SQL Worksheet.

Each connection you open will also open a SQL Worksheet.

You can change the ‘open object on single click’ behavior in the preferences. I recommend you actually do that. Here’s a list of other preferences I recommend you take a look at.

If you’ve made it this far, take a deep breath.

Getting the software installed – wait, need help with that? – and getting connected to Oracle is the hardest part of getting started. You just did that. Now you can worry about getting your objects built and your queries/code written.

Have questions? We have the Oracle Technology Network (OTN) with a set of Forums dedicated to SQL Developer users. Go check it out. If your question is about SQL or about how to do a conditional block in PL/SQL – be sure to go to the SQL or PL/SQL forum. And search the forums, your question has probably already been answered. A bunch of us also hang out on StackOverflow, Quora, Reddit, OraFaq, Oracle-L, Twitter, Facebook..hell, we’re all over the internet.

Taken that breath? Ready to go kick some butt? I have a ton of more 101 posts for you here.

Tell Others About This Story:

Comments 3

  1. I dont understand the below statement, could you explain-
    “If you use Connect Identifier, you’ll HAVE to have an Oracle Client installed and configured, don’t do that unless otherwise instructed by your IT admin or DBA.”

    1. thatjeffsmith Post
      Author

      it means if you use connect identifier in your TNS connection, we’ll attempt to make a connection using an Oracle Client. If you don’t have one setup and configured correctly, your connection won’t work

  2. Thanks Jeff – even for a ‘seasoned oracle professional’ this was useful. The tnsnames alternate location preference is useful for testing when I don’t want to use our global tnsnames file pointed to by TNS_ADMIN.

    Also the explanation of Network Alias/Connect Identifier was useful also.

Leave a Reply

Your email address will not be published. Required fields are marked *