Get started Oracle DB Express for development

Oracle database is a Relational database developed by Oracle, Oracle DB provides high performance with failure recovery features, easy to manage the database, and has a good reputation for supporting Enterprise level applications.

For you database admin or software developer that are newly using Oracle database, you can follow this simple get started guide. Follow each one of the instructions from installation to launch and create a new database table.

Download and install Oracle DB

Download the oracle database express edition from the following link : https://www.oracle.com/database/technologies/xe-downloads.html

When the installation process is running, then you should set the default password that you will use for login.

Login using SqlPlus

Open terminal or command prompt and type "sqlplus”.

Then enter the username SYSTEM and password you choose on the installation step earlier.

Create new user

Before the SYSTEM user can create new user, you have to execute this command:

alter session set "_ORACLE_SCRIPT"=true; 

Then begin to step to create a new user with the following commands:

CREATE USER adam IDENTIFIED BY “Password123”;

Specify your new username and password that will be used to login.

Grant user login

grant create session to adam;

Grant user all privileges

GRANT ALL PRIVILEGES TO adam;

Add user an unlimited quota

alter user adam quota unlimited on users;

Try login using Navicat

You can use Navicat GUI database management to manage your Oracle database. The login information you can specify is something like this.


Try to create table

We then create an SQL query to create a table named “user” with some columns. Following are the Create table query.

CREATE TABLE "ADAM"."USER" (
  "ID" NUMBER GENERATED by default on null as IDENTITY,
  "NAME" VARCHAR2(255 BYTE) ,
  "EMAIL" VARCHAR2(255 BYTE) ,
  "REGISTRATION_DATE" TIMESTAMP(6) ,
  PRIMARY KEY ("ID")
);

And here’s the table representation viewed on table design in the GUI program.


JDBC Connection

If you are developing a Java application using JDBC, you may use this JDBC URL connection:

jdbc:oracle://localhost:1521/XE

Or if you are using R2DBC it is you just need to change JDBC to R2DBC like the following:

r2dbc:oracle://localhost:1521/XE

It’s not that much of a big difference if you are already familiar with other database systems like Postgres or MySQL. Only some concepts that sometimes differ from one database system to another. But actually there’s general SQL queries that you can use and apply to cross database systems, just a little bit tuning sometimes.


Comments

Popular posts from this blog

ERROR 1348 Column Password Is Not Updatable When Updating MySQL Root Password

Spring Kafka - how to use ReplyingKafkaTemplate send and reply synchronously

How To Create Spring Boot Project Using Netbeans

How To Connect SSH Using PEM Certificate On Windows

Step by Step How To Use cURL Library Using C From VS Code Windows