How to get SQLDeveloper and set up your Oracle Account

Oracle Account using “SQLDeveloper”
For the SQL exercise, you need to access some Oracle server. You have two choices:
1. Use the SQL Developer client program, run it either on the PCs in the CDM labs, or from
your home PC (or notebook). The client will communicate with the server called
CDMOracle with a fixed IP address 140.192.39.58.
2. Install an Oracle server and SQL Developer on your own PC (or notebook), run SQL
Developer client from your PC against the local Oracle server. Or run SLQ* Plus against the
local Oracle server. This option requires more technical skill and is good for the students
who want to have a career in/related to database area.
Here is the introduction for the first option, using the free Oracle SQL Developer software.
Brief picture:
You run the client software provided by Oracle from a client PC. After finishing the
configuration steps, this client program allows you connect to the CDMOracle server directly.
The tables, views that you create are stored in Oracle server. You can use the editor provided by
your local PC (such as notepad) and save the files on your local PC.
Your Oracle account login name: is your CDM account, in most cases, that is same as your
university campus login name.
Your first time login Oracle account password is: cdmxxxxxxx
xxxxxxx is your 7 digit DePaul student ID number.
For an example, your DePaul ID number is 1025566 then your password is cdm1025566.
Step 1. If you plan to work on your own PC, get the software first.
SQLDeveloper software is already installed in the PCs in CDM labs.
If you have a chance to work in the lab, please bring a USB flash drive (more than 140 M). You
can simply copy the whole directory of SQLDeveloper (under “c:\Program files” directory) from
the lab PCs (size: 137 M). Then copy this folder to the local drive on your PC. Make a shortcut
of the file of “sqldeveloper.exe”, move the shortcut to the desktop, double click this icon, then
configure it. You also can start this program just from the flash drive as a local drive.
You may download the SQLDeveloper (free) software from Oracle via the link:
http://www.oracle.com/technology/software/products/sql/index.html,
Go to the “Download Archived Releases” in the lower right corner of the window; pick up
“Oracle SQL Developer 1.5.1”. This is the version we installed in the PCs in the CDM lab.
(The newest version is: Download (March 9, 2009); Oracle SQL Developer 1.5.4)
Check the “accept” button, a few choices on different Operating systems will be available for
clicking. Choose the right OS (Windows, MAC, or Linux). For Windows users, please choose
the
Oracle SQL Developer for Windows (This zip file includes the JDK 1.5.0_06),
It is easier to install the above version.
The size of the file is around 97 M. It is a zipped file. You need to unzip it.
If you need software to unzip, you can download the “winzip” file (v10) from this course web
site, under the directory of “Oracle Account”.
It is recommended that you can download from this site:
http://ipd.cdm.depaul.edu/sqldeveloper/
Step 2 Configure the connection
First, run the SQLDeveloper program by double click the shortcut
or directly double click the file of sqldeveloper.exe.
After a few seconds, a window as below (or similar) will be popped up.
Right click the “Connections”, you will see the menu as below, choose “New Connection”.
You will see a window as below:
Fill out the necessary fields (refer to the figure):
Connection Name: your choice, whatever is good for you to remember. If that is in the lab
PC, other people will see this name too.
Username: this is the Oracle account login name, it should be same as your CDM account
login name (same as your campus login name)
Password: cdmxxxxxxx - (xxxxxxx is your DePaul ID number, 7 digits)
Check box for “Save Password”: do NOT check it if that is a lab PC. You can check it if
that is private PC.
Oracle | Access: leave it as is, the default is “Oracle”
Role:
lease it as default.
Connection Type: basic (this is default)
OS Authentication: leave it unchecked
Proxy Connection: leave it unchecked
Hostname: 140.192.39.58 (fixed IP address)
Port:
1521 (default )
SID:
def
Service Name: (leave it empty)
Then click “Connect”. Cross your finger, if things are set up right, then you will get connected,
and an Oracle SQL Developer worksheet will be automatically opened, see below.
Step 3. In case you want to change your password
In case you want to change your password, here is the command:
Alter User your_login_name identified by Your_new_password ;
For example:
Alter User czhang identified by secret222 ;
Here, secret222 is case sensitive, that is the new password.
After typing your command on the “Enter SQL Statement” (the upper right side) window, click
the “Run Script” icon” (located above the menu bar of “Enter SQL Statement”), you should see
the output or error message in the “Results” (lower right) window, see sample as below.
Step 4. Work on SQL commands
1. Run a single SQL command
In the “Enter SQL Statement” box, you can type some SQL comments, then click “Run Script”
icon, you should see the output in the “Results” box.
For example, type “CREAT TABLE test (Name char (20)) ;”
Then click the “Run Script” icon, you create a table with only one column called Name.
You can click the “Clear” icon in either box to clear the screen of the box.
You can edit the SQL statement in the “Enter SQL statement” box, also you can copy
command from Notepad, then paste into that box.
2. Run a script file
If you have a SQL script (command) file, you can run it by typing the command:
@path\file_name
Say if the file is called hw3_ctr.txt and located in the directory 453 in the D drive, then the
command will be like that:
@d:\453\hw3_ctr.txt
After clicking the “Run Script” icon, you should see the output in the “Results” window.
You can get some sample script files on the col website, and run it for testing.
3. Save output as a local file
You can click the ‘Save” icon – the “Floppy Disk” shape icon to save the result (output) to
your local disk. Remember, if you work in the lab PC, please save it to your USB flash drive.
Do not forget to take the USB with you before you leave lab.
If your USB flash is not with you, you may send an email to your own email box, attaching the
file(s) on the email.
4. No need of SQL* Plus commands here
As this is not a SQL*Plus environment, so it does not support (most of) the SQL*Plus
commands, and you do not need them, such as the “column” command.
5. If you have trouble to connect:
If you try to connect from your company machine to the CDM Oracle server, you may get
the following error message:
Status: Failure - Test failed: Io exception: The network adapter could not establish the
connection.
The reason is that your company network blocks the port 1521. Please contact your
company network manager – if they allow you do your homework from a company
machine .
6. A little bit More
There is a folder expansion (a “plus” sign) icon on the left side of each connection. It is similar
to the MS file folder convention. If you click that icon, you will see it expand to a list of
“Tables, Views, Indexes, …” . If you click the “Tables”, you will get a list of all the tables you
have created.
If you click a table (name), for an example, “Student” table, then the definition of table student
will be shown on the worksheet – if the default menu is on the “Column Name”. If you click the
Data tab on the menu in the worksheet, the content of table is shown.