Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
6 views

Course 1 Oracle Cloud SQLDeveloper

Uploaded by

Azael Santiago
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Course 1 Oracle Cloud SQLDeveloper

Uploaded by

Azael Santiago
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Getting Started with Oracle Autonomous Database in the Cloud

Introduction
This tutorial provides instructions to set up a free Oracle Cloud account and create a free

Autonomous Database instance. While the Oracle Cloud account and most of the basic services

are free to use, a credit card (or similar payment method) is required to verify your identity. You

will also need a cell phone capable of receiving text messages.

Once the Autonomous Database is created, you can use several different tools to work with your

data including Oracle SQL Developer, Oracle APEX and other tools. You may wish to download

and install Oracle SQL Developer on your own computer. The Oracle SQL Developer has

versions for Windows, Mac OS, and Linux.

Sign up Oracle Cloud


The first step involves creation of a new Oracle Cloud account. To get started, visit the Oracle

web site with the URL: https://www.oracle.com/cloud/free/


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 2

Click on the Start for Free button.

Fill in first name, last name, and e-mail address. Read the Oracle Terms of Use and other policies

and then click the Verify my email button when you are ready. Oracle will send an email to

verify your email.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 3

Open your email and click Verify email.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 4

Create a new password for your Oracle Cloud account following the password rules provided

and fill in cloud account name. Cloud Account Name should contain letters only with no spaces

or other punctuation. Keep in mind this will be your Oracle Cloud account (not the database

account – that will be created later). Then, choose your region. After providing these details,

click the Continue button.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 5

Fill in your address (streel, city, state, zip code) and cell phone number. Check your cell phone

for a text message from Oracle to see the code number.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 6

Type in the code number on the Oracle website when prompted and click the Verify button.
6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 7

On the next screen, you need to verify your payment. Read over the notice from Oracle regarding

payment information. Click the Add payment verification method, then click Credit Card.

On the next screen, fill in your credit card information. Click the Finish button when done.

Remember that if you use the “Always Free” services your payment method will not be charged.
6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 8

At this point the new Oracle Cloud account is created. This may take up to 5 minutes to

complete. In some rare cases, if there is any issue verifying your payment information, you may

be contact via e-mail to provide additional information.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 9

Once the account has been created the web browser should re-direct to the login page. Fill in

your Oracle Cloud Account username and password as provided in the prior steps and click on

the Sign-In button.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 10

Create Autonomous Database Instance


To login your Oracle cloud, visit: https://www.oracle.com/cloud/sign-in.html

Enter your cloud account name and click Next.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 11

Enter your username and password, and click Sign In. Once logged in, the Oracle Cloud home

page appears.

Scroll down to Lauch Resource


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 12

Make note of the different services and the ones that are marked with Always Free Eligible. The

“Always Free” services can be used without accruing charges. Click Create an ATP database.

Choose a Compartment (typically the cloud account name you entered when setting up the

account), then provide the Display name and Database name. Note that the Database name

cannot contain punctuation or spaces. Scroll down.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 13

Select the Transaction Processing workload type and choose the Shared Infrastructure as shown

above.

Under the Configure the Database heading, select the Always Free option. By selecting this

option, a basic database with 20 GB of disk space and one virtual CPU will be created. No

charges will accrue in your account for this database.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 14

Supply a new password for the database administrator. The default database administrator

username will be ADMIN. Keep in mind that this will be the username and password for the

ATP Database you are creating. This is different from your Oracle Cloud account.

The next step is to choose network access. By default, the new database will be accessible from

anywhere on the internet. If you would like to restrict access to this database to hosts or clients

on a more limited range of addresses, check the Configure Access Control Rules box and then

follow the prompts to add allowable IP addresses or CIDR blocks.

For this example, we will leave the access open.

Finally, select the License Included option and then click the Create Autonomous

Database button.
6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 15

Note that it may take up to 5 minutes for the new database to be provisioned.
6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 16

Once the new database has been provisioned it should become available. Click on the Tools tab

to view different tools to be used for accessing the database.

Note that this management page will be used should you ever need to re-start your ATP

database. Check under the More Actions… button for these features. Inactive Always Free

Autonomous Databases are automatically stopped after 7 days. When your database is turned off,

you must access the management page and turn on your database under More Actions.

Access Database Instance


The quickest way to access the new database is by using the Oracle SQL Developer Web

interface. Click on the Database Action button.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 17

Click on the SQL button.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 18

Once logged in, the SQL Developer Web worksheet will appear. There are three main sections.

Schemas (users) and their objects (tables, views etc.) are displayed in the left-hand window

under Navigator. SQL Statements can be typed in using the Worksheet section. Query results

and other feedback are provided in the window to the lower right.

The Oracle Sales History (SH) sample schema is available in the database so it can be used to

easily test queries as shown below.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 19

Connecting to the Oracle Cloud Database using SQL Developer


The client Oracle SQL Developer has more features than the Web version. The Oracle SQL

Developer has versions for Windows, Mac OS, and Linux. For download of the Oracle SQL

Developer, search using “SQL Developer download”. If you do not have the Java Development

Kit installed, choose the version with the current JDK included.

After installing the SQL Developer, you can download the Oracle Cloud Wallet credentials from

the Oracle Cloud database instance and use those to connect to your Cloud database. From the

Autonomous Database home screen, click on the DB Connection button.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 20

Connecting to a cloud database requires both a Wallet and a connection string. Click on the

button to download the wallet.

Provide a new password for the wallet and then click on the Download button.
6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 21

Be sure to store the wallet file in a secure location.

Creating a new Database Connection from SQL Developer


After starting the SQL Developer, the following window appears.

In Oracle SQL Developer, click the green plus sign to create a New Database Connection.
6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 22

Give the new database connection a name and supply the ADMIN username and associated

password. Change the Connection Type to Cloud Wallet. Click the Browse…button, navigate

to the folder with your cloud wallet and select that file.

Click the Test button to make sure the connection is working. If the connection succeeds,

“Success” appears beside Status.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 23

Finally click the Save button to save this connection and then click the Connect button to

connect to the cloud database.

Once connected, a new worksheet will open where SQL Statements can be entered.
6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 24

Note that this connection was done with the ADMIN user. Any new database development work

should be done with a separate database user account. The next section shows steps to create a

new Oracle database user to use for your work in the course.

Creating a New Oracle Database User


The ADMIN user of the Cloud Database has the necessary permissions to create additional

database users and grant them the necessary privileges. SQL Developer can be used to create a

new database user. The following statement shows SQL syntax to create a new user in Oracle

with a small quota (10 megabytes). Without a quota specification, rows cannot be inserted into

tables of the user.

CREATE USER StoreSalesDBA IDENTIFIED BY DBAStoreSales123


QUOTA 10M ON ADMIN;

An Oracle user password should contain a mix of upper- and lower-case letters and numbers. In

addition, the password should not contain the username.

Some permissions need to be granted to connect to the database and create objects such as tables

and views. Use this list of GRANT statements to provide necessary permissions.

GRANT CONNECT, RESOURCE TO StoreSalesDBA;

GRANT CREATE TABLE TO StoreSalesDBA;

GRANT CREATE SEQUENCE TO StoreSalesDBA;

GRANT CREATE VIEW TO StoreSalesDBA;

GRANT CREATE SESSION TO StoreSalesDBA;

GRANT CREATE PROCEDURE TO StoreSalesDBA;

GRANT CREATE MATERIALIZED VIEW TO StoreSalesDBA;

GRANT UNLIMITED TABLESPACE to StoreSalesDBA;


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 25

Now that the new user created and assigned the appropriate permissions, we can create a new

connection to the database with this user’s credentials. Then same wallet will be used.

You can execute SQL statements using the StoreSalesDBA connection. Alternatively, you can

use the SQL Developer Web.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 26

After a new user is created, you can create a connection from that user. To create a connect to

ISMG6480 database, please refer to steps in previous part “Connecting to the Oracle Cloud

Database using SQL Developer software”.


6/6/2024 Tutorial for Oracle Cloud Usage in SQL Developer 27

Click the Test button to make sure the connection is working. Then save the connection and

finally click the Connect button to connect to the database using this new username.

Once the connection is established, SQL statements can be entered and executed.

For more details about using the SQL Developer, search using “SQL Developer tutorials”. You

can find Web tutorials and video instructions. Oracle provides excellent resources.

Holowczak.com also provides an excellent tutorial using an older version of SQL Developer

although most details easily transfer to the current version.

https://www.oracle.com/database/sqldeveloper/

http://holowczak.com/getting-started-with-oracle-sql-developer/

You might also like