Making Connections To A Local Oracle Database
Making Connections To A Local Oracle Database
This document provides instructions about connecting to a local Oracle database after
installing the Oracle server standard edition. Installation videos do not seem to cover these
details. Learners sometimes can get stuck after installing Oracle, not knowing how to connect
and use a local Oracle database. This document demonstrates creating a connection to a local
database using the SQL Developer and then using the connection to execute SQL statements.
machine using the Database Configuration Assistant. The most important information that you
provide is the administrative password. You must remember the administrative password to
completing the Database Configuration Assistant. The message indicates that the default
database has ORCL as the Global Database Name and System Identifier (SID). The message also
indicates that you can use two predefined accounts to connect to the standard database, SYS and
SYSTEM. Oracle has no default passwords for the SYSTEM and SYS accounts. You must use
the administrative password that you specified during the configuration process.
5/11/2020 Making Connections to a Local Database Page 2
site (http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html).
There is no cost to use the Oracle SQL Developer although you must have a TechNet account.
Developer, you will see the New Gallery window in Figure 2 if you have not previously created
connections. You should select Connections and click the Ok button. An empty window will
If you have already created connections, you will see the Connections tab as shown in
Figure 3 instead of the New Gallery window. You will only see the connections that you have
already created, not the connections shown in Figure 4. After clicking the + button, the
For your initial connection, you should use the SYS account and the administrative
password that you gave in the configuration process. Complete the properties as described in the
following list. Figure 5 shows the completed connection. After you have specified the properties,
you should use the Test button to try the connection. You should see a successful connection.
You should use the administrative password that you specified in the configuration
The host name is “localhost” because you are connecting to a database on your own
machine.
5/11/2020 Making Connections to a Local Database Page 5
The SID is “ORCL”, the database name specified in the configuration process.
After completing the connection properties, you can use the connection. To open a
connection, you should right click the connection name in the Connection tab and select the
Connect item. If you are still inside the Connection window, you can click the Connect button.
You will be prompted for the user name and password if you did not enter the password in the
connection properties. After the connection is made, you will see a list of object types in your
connection as shown in Figure 6. After you create objects, you will see them when you select the
object type.
5/11/2020 Making Connections to a Local Database Page 6
create another user for your work in this course and specialization. In the SQL Worksheet, you
should enter the ALTER SESSION command as shown in Figure 7. You should execute the
command using the Run Script button ( ). In the Script Output pane, you should see a message
that the ALTER SESSION executed. If the ALTER SESSION command executes with an error,
you should skip to the last section in this tutorial. Make sure that you typed the statement
You will then create a new user and grant the DBA role to the new user. You should right
click on the Other Users icon at the bottom of the object list (Figure 6) and select Create User …
You should enter a user name such as LocalUser1 as shown in Figure 8. You also need to create
a password for the new user and select the default tablespace (USERS) and temporary tablespace
(TEMP). In the Roles tab (Figure 9), you should select DBA. The generated SQL code should
appear as shown in Figure 10 if you select the SQL tab. Click the Apply button and close the
window.
Close the current connection by right clicking on the connection name (Figure 6) and
selecting Disconnect. You should click the + button to create a new connection for the user that
you previously created. You should enter property values as shown in Figure 11. You can enter a
different value for the Connection Name if you want. You need to enter the password that you
gave in Figure 8. Note that you need to use a service name (pdborcl) instead of the ORCL SID
used for your SYS AS SYSDBA connection. You should test and save the connection. You
should use this connection to create and populate tables and write SELECT statements using
connection using SYSTEM as the user name. You should use SYSTEM as the user name, not
SYSTEM as SYSDBA. You should use the same administrative password that you provided in
the configuration process. You should use the other connection properties as shown in Figure 5.
You can use this connection to create and populate tables and write SELECT statements using
your tables as indicated in ungraded exercises and graded assignments in the course.
5/11/2020 Making Connections to a Local Database Page 10
statements. To open a connection, you should the connection name in the Connections pane
expand by clicking on the plus symbol by the connection name. You will see a list of object
types for the open connection as depicted in Figure 12. After you create tables, you can see them
You can create and execute SQL statement using the Worksheet. Type a statement and
click on the Run Script button ( ) as depicted in Figure 13. The results are displayed in the
5/11/2020 Making Connections to a Local Database Page 11
Script Output tab below the Worksheet. You can execute any SQL statement such as CREATE
TABLE and INSERT statements required in Module 3 and SELECT statements required in
Modules 4 and 5.