A Beginner's Guide to Oracle Databases: Understanding the Fundamentals

Oracle is one of the most widely-used relational database management systems in the world, and a popular choice for enterprise-level applications due to its scalability, performance, and reliability. 


Understanding the fundamentals of Oracle is essential for anyone looking to work with this technology, and this article provides an overview of the key concepts, tools, and features of Oracle for beginners. 


From the basic architecture and components of Oracle databases, to more advanced topics such as security, high availability, and cloud-based services, this article will provide a solid foundation for those who are new to Oracle.

Introduction to Oracle Database Architecture


Oracle Database is a highly scalable and reliable relational database management system. Its architecture is designed to handle large amounts of data and provide high availability and security. In this section, we'll cover an overview of the Oracle Database architecture, the different database models, and the hardware and software requirements needed to run Oracle Database.

Overview of Oracle Database Architecture


The Oracle Database architecture consists of several components that work together to manage and store data. The main components are the Oracle Database software, the instance, and the memory structures. The Oracle Database software is responsible for managing the data and the instance creates a connection between the software and the database. The memory structures manage the data cache and control the database's operation.

Oracle Database Models


Oracle Database supports several data models, including relational, object-oriented, and hierarchical models. The relational model is the most commonly used and is based on tables with columns and rows. The object-oriented model stores data as objects, while the hierarchical model organizes data in a tree-like structure.

Hardware and Software Requirements


To run Oracle Database, you'll need a suitable hardware and software environment. The hardware requirements will depend on the size of the database and the anticipated workload. The software requirements include an installation of Oracle Database and an operating system that is supported by the database.

Key Features and Benefits of Oracle Database


Oracle Database has several key features and benefits that make it a popular choice for enterprise-level organizations. In this section, we'll cover the scalability and performance, reliability and availability, and security and compliance of Oracle Database.

Scalability and Performance


Oracle Database is designed to scale horizontally and vertically, allowing organizations to accommodate growing data needs. It also has built-in performance optimization tools that can improve query execution times and overall database performance.

Reliability and Availability


Oracle Database is known for its high reliability and availability. It has built-in mechanisms for data recovery and backups, and it can handle hardware and software failures without interrupting operations.

Security and Compliance


Oracle Database provides advanced security features, such as encryption, access control, and auditing, to protect against unauthorized access and data breaches. It is also compliant with regulatory standards, including GDPR, HIPAA, and SOX.

Oracle Database Components and Tools


Oracle Database has several components and tools that help manage and control the database's operation. In this section, we'll cover the Oracle Database instance, memory structures, and control and management tools.

Oracle Database Instance


The Oracle Database instance is the set of memory structures and processes that manage the database's operation. It includes the system global area (SGA), the program global area (PGA), and the background processes that perform maintenance tasks.

Oracle Database Memory Structures


The Oracle Database memory structures manage the data cache and control the database's operation. The SGA is the primary memory structure and stores shared memory areas, such as buffer cache, shared pool, and redo log buffer.

Oracle Database Control and Management Tools


Oracle Database provides several control and management tools, including Oracle Enterprise Manager (OEM), SQL Developer, and SQL*Plus. These tools can help manage the database's operation, monitor performance, and perform maintenance tasks.

Understanding SQL and PL/SQL in Oracle


SQL and PL/SQL are core components of Oracle Database and are essential for managing and querying data. In this section, we'll cover an introduction to SQL, PL/SQL programming fundamentals, and stored procedures, functions, and triggers.

Introduction to SQL


SQL (Structured Query Language) is a standard language for managing and querying data in a relational database. It allows users to perform operations such as selecting, inserting, updating, and deleting data from tables.

PL/SQL Programming Fundamentals


PL/SQL (Procedural Language/Structured Query Language) is a powerful programming language that is used to write complex queries and stored procedures. It is a block-structured language that allows users to define variables, loops, and conditions within a program.

Oracle Stored Procedures, Functions, and Triggers


Oracle Database supports stored procedures, functions, and triggers, which are pre-written programs that can be executed with specific parameters. Stored procedures and functions are used to perform complex operations, while triggers are used to automatically execute a set of actions when a specific event occurs.


FAQ:



What is Oracle, and what is it used for?


Oracle is a relational database management system (RDBMS) that is designed to store, organize, and retrieve large amounts of data. It is used by organizations to manage enterprise-level applications, such as financial management, human resources, and customer relationship management.

What are the benefits of using Oracle?


Oracle offers a wide range of benefits, including high performance, scalability, and reliability. It also offers advanced security features to protect sensitive data, and supports a variety of operating systems and platforms. Additionally, Oracle provides a range of tools and features for managing and optimizing databases.

What are some common tools used for administering Oracle databases?


Oracle provides a range of tools for administering databases, including Oracle Enterprise Manager, SQL*Plus, and the Oracle Universal Installer. These tools are used for tasks such as monitoring database performance, managing database users and permissions, and backing up and restoring databases.

Can you suggest some effective methods to ensure the security of Oracle databases?


To secure Oracle databases, it is important to use strong passwords, limit access to sensitive data, and regularly monitor database activity. Additional best practices include keeping software up to date, applying security patches promptly, and implementing encryption for sensitive data. It is also important to have a disaster recovery plan in place in case of data loss or breach.


Queries :


DDL: Data Definition Language 

create

alter

drop

DML: Data Manipulation Language 

insert

update

delete

DCL:  Data Control language 

commit

rollback

savepoint

DAL: Data Access Language

grant

revoke


 
in database system data are stored into tabular format
 
Data types:----
 
oracle datatype:-----number , char , varchar , date , file , blop , clop ,decimal
mysql datatype------int , double , char , float , file , text , blob , clob
 
create table
syntax:---------
 
create table table_name
(
col1_name datatype(size),
col2_name datatype(size),
-----
-----
);
In mysql:------
exp:----
create table student
(
sid int,
sname char(15),
dob date,
feebal double,
phone int
);
mysql> desc student;
 
 Field      Type       Null Key   Default  Extra|
 
 sid             int(11)         YES           NULL          
 sname      char(15)      YES           NULL         
 feebal       double        YES           NULL         
 phone      int(11)         YES           NULL          
 
insert into student values(100,'rajiv','1982-01-23',199.81,123);
insert into student values(101,'raman','1984-04-21',199.89,159);
insert into student values(102,'suman','1987-09-13',190.82,198);
insert into student values(103,'radha','1989-10-30',99.59,456);
 
mysql> select * from student;
 
   sid   sname             dob             feebal       phone
  100|    rajiv              1982-01-23          199.81        123
  101      raman          1984-04-21          199.89        159
  102      suman          1987-09-13         190.82         198
  103      radha           1989-10-30          99.59           456
 
if we want to insert data for limited  number of column out of many, then specify only those
column & insert data in the same order .it will take corresponding field value and which will not
putting into the table will show as null(default)
 
insert into student(sid,sname,feebal)values(111,'ganesh',111.77);
insert into student(sid,sname,phone)values(222,'mohan',999);
insert into student(sname,dob,feebal)values('gandhi','2008-09-16',111.77);
 
mysql> select * from student;
 sid       sname          dob              feebal      phone
  100        rajiv                 1982-01-23    199.81           123  
  101       raman              1984-04-21    199.89           159
  102       suman             1987-09-13    190.82           198
 103|       radha              1989-10-30      99.59           456
  111      ganesh               NULL               111.77          NULL
  222      mohan               NULL               NULL              999
 NULL     gandhi              2008-09-16    111.77          NULL
 
7 rows in set (0.00 sec)
 
mysql> update student set sid=333,phone=888 where feebal=199.81;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0
 
mysql> select * from student;
 
 sid       sname           dob                feebal        phone
  333        rajiv             1982-01-23             199.81           888
  101        raman          1984-04-21            199.89           159
  102       suman           1987-09-13            190.82           198
  103|      radha            1989-10-30             99.59            456
  111       ganesh           NULL                        111.77          NULL
  222       mohan           NULL                        NULL             999
 NULL      gandhi          2008-09-16              111.77          NULL
 
7 rows in set (0.00 sec)
 
mysql> delete from student where sid=101;
Query OK, 1 row affected (0.03 sec)
 
mysql> delete from student;
Query OK, 6 rows affected (0.02 sec)
 
mysql> select * from student;
Empty set (0.00 sec)
 
 
In oracle--------------------
 
create table student
(
sid number(10),
sname char(15),
dob date,
feebal  number(6,2),
phone number
);
 
SQL> desc student;
 Name                                    Null?    Type
 ---------------------------------------- -------- --------------
 SID                                                      NUMBER(10)
 SNAME                                              CHAR(15)
 DOB                                                    DATE
 FEEBAL                                               NUMBER(6,2)
 PHONE                                               NUMBER
 
insert into student values(100,'rajiv','10-jan-1982',199.81,123);
insert into student values(101,'raman','10-jan-1984',199.89,159);
insert into student values(102,'suman','10-jan-1987',190.82,198);
insert into student values(103,'radha','10-jan-1989',99.59,456);
 
SQL> select * from student;
 
       SID      SNAME           DOB                FEEBAL      PHONE
----------     ---------------        ----------------           ----------         ----------
       100       rajiv                   10-JAN-82               199.89                123
       100       rajiv                   10-JAN-82               199.81                123
       101       raman               10-JAN-84               199.89                159
       102      suman               10-JAN-87                190.82                198
       103      radha                 10-JAN-89                99.59                 456
 
when you are inserting a record into the database, column values
of the type character & date must be enclosed b/w single quotation mark(' ')
is not require for number type.
exp:----
 
insert into student values(101,'raman','10-jan-1984',199.89,159);
 
 
date format in mysql:--- YYYY/MM/DD----1999-02-27
date format in Oracle:--- DD/MM/YYYY----23-jan-1998
 
if we want to insert data for limited  number of column out of many, then specify only those
column & insert data in the same order. it will take corresponding field value and which will not
putting into the table will show as null(default) .
 
insert into student(sid,sname,feebal)values(111,'ganesh',111.77);
insert into student(sid,sname,phone)values(222,'mohan',999);
insert into student(sname,dob,feebal)values('gandhi','31-mar-2008',111.77);
 
SQL>  select * from student;
 
       SID     SNAME           DOB             FEEBAL      PHONE
----------     ---------------        --------------         ----------         ----------
       100      rajiv                   10-JAN-82          199.89             123
       100      rajiv                   10-JAN-82          199.81             123
       101      raman               10-JAN-84          199.89             159
       102      suman              10-JAN-87           190.82              198
       103      radha                10-JAN-89             99.59               456
       111      ganesh                                           111.77
       222      mohan                                                                   999
                    gandhi               31-MAR-08       111.77
 
8 rows selected.
 
Entities:----100,101,222,199.89,198 etc
attributes:---- sid,sname,dob,feeebal,phone
 
update the column of the row:------
we can update, insert or delete only one row or column at a time for multiple updating ,deletion or insertion
we have to write multiple query.
 
syntax:----
update table_name set col1=val1,col2=val2------
        where condition;
 
update student set sid=333,phone=888 where feebal=199.81;
 
SQL> select * from student;
 
       SID          SNAME        DOB          FEEBAL      PHONE
       ---------- ---------------   --------------- -      ---------          ----------
       333           rajiv               10-JAN-82         199.81           888
       101           raman           10-JAN-84         199.89           159
       102           suman           10-JAN-87         190.82           198
       103           radha             10-JAN-89          99.59            456
       111           ganesh                                      111.77
       222           mohan                                                              999
                        gandhi            31-MAR-08       111.77
 
7 rows selected.
 
deleting rows:-----
syntax:---
delete from table_name where condition;
exp:---
delete from student where sid=101;
delete from student; /* deleting all row.
 
SQL> delete from student where sid=101;
 
1 row deleted.
 
SQL> select * from student;
 
       SID          SNAME           DOB                FEEBAL          PHONE
----------       ---------------     -------------         ----------         ----------
       333           rajiv             10-JAN-82          199.81             888
       102           suman         10-JAN-87          190.82             198
       103           radha           10-JAN-89          99.59               456
       111           ganesh                                     111.77
       222           mohan                                                               999
                        gandhi          31-MAR-08     111.77
 
6 rows selected.
 
SQL> delete from student;
 
6 rows deleted.
 
SQL> select * from student;
 
no rows selected
 
deleting/drop table from database:----------------

syntax:----
drop  table table_name;
 
exp:---
drop table student;
 
SQL> drop table student;
 
Table dropped.

Chandra Sekhar

A Blogger and Author! This post was written and edited by me, a technologist. I started this site to share my inspirations, work, and free materials, which I hope others may find useful as well. Man with a creative streak who enjoys experimenting with various web design strategies.

Previous Post Next Post

Microservice Communication in a Distributed System