Oracle Database Administration
Oracle Database Administration
BY
MD.MAHMODUL HASAN
ID: 142-15-3442
Supervised By
Co Supervised By
Mr.Ahmed Al Marof
Lecturer
Department of CSE
Daffodil International University
Supervised by:
Co Supervised by:
Submitted by:
We really grateful and wish our profound our indebtedness to MR. Shah Md. Tanvir
Siddiquee, Senior Lecturer, Department of CSE Daffodil International University, Dhaka. Deep
Knowledge & keep interest of our supervisor in the field of “Oracle Database Administration”
to carry out this project. His endless patience, scholarly guidance ,continual encouragement,
constant and energetic supervision, constructive criticism , valuable advice ,reading many
inferior draft and correcting them at all stage have made it possible to complete this project.
We would like to express our heartiest gratitude to Dr. Syed Akhter Hossain,Head, Department
of CSE, for his kind help to finish our project and also to other faculty member and the staff of
CSE department of Daffodil International University.
We would like to thank our entire course mate in Daffodil International University, who took
part in this discuss while completing the course work.
Finally, we must acknowledge with due respect the constant support and patients of our parents.
iii
CONTENTS PAGE
Board of examiner I
Declaration ii
Acknowledgement iii
Abstract iv
CHAPTER
1.1 Introduction 1
1.2 Motivation 1
1.5 Outcome 2
2.1 Introduction 4
3.1 Introduction 9
3.2 Objective 9
3.3Tools to be used 9
3.7 Challenges 43
4.3 Reflections 44
APPENDIX 46
REFERENCES 47
FIGURES PAGE NO
Introduction
1. Introduction:
An Oracle database is a collection of data treated as a unit. The purpose of a database is to store
and retrieve related information. A database server is the key to solving the problems of
information management. In general, a server reliably manages a large amount of data in a
multiuser environment so that many users can concurrently access the same data. All this is
accomplished while delivering high performance. A database server also prevents unauthorized
access and provides efficient solutions for failure recovery.
2. Motivation:
A database administrator's job involves working with a variety of databases, from banks' account
systems to hospital record management. Oracle is worldwide leader and Oracle database is most
popular globally. Most of the companies are using Oracle database on various platforms. Means
chances of Oracle DBA jobs are more at any type of industry like telecom, finance, banking, etc.
3. Internship Objectives:
Database Administrators work to ensure that databases are secured and that they are performing
properly. They work on development as well. They make sure that data is consistent in the
database and that it is clearly defined. Database Administrators monitor user access, determine
user needs, design databases, perform tests, ensure standards are maintained and work with other
IT professionals and managers to ensure database integrity and security are kept up with.
Important skills include technical, communication, analytical and problem-solving skills.
SYS DEV LTD is one of the most robust and leading End-to-End Software Development,
Professional Skill Development and Support Solutions Company in Bangladesh. Since its
SYS DEV LTD has started its journey as a proprietorship company named “DEV NET IT” in
2011. It was very robust and quick growing company in Bangladesh. With good reputation and
full furnished product its form as a company as the name of “SYS DEV LTD” in 2015.
Services Provide:
• Software Development
Android and IOS apps Development
• Corporate IT Solution
• IT Consultancy
• Provide Professional and Fundamental Training
• Web Application Design and Development
• Web based and Client Server Application Design Development
• Networking and Automation
• Export/Import of software and hardware
• Hardware and security devices sales and supply
1.5 Outcome:
After completing the internship, I hope it will increase my skill and give me the professional
experience. That will be helpful to build my career and easy to get a job.
1. Learn how to install and configure the Electricity Billing Management software.
https://en.wikipedia.org/wiki/Oracle_Database
Database administrators works to ensure that databases are secured and they are performing
properly. Database administrators monitor user access, determine user needs, design databases,
perform tests, ensure standards are maintained and work with other it professionals and managers
to ensure database integrity.
2. Market Situation:
A database administrator builds and maintains custom databases to meet the specific data needs
of a company or organization. Increase the demand is expected in computer careers such as this
over the next 10 years, although here are fewer databases administrator jobs anticipated than in
other similar fields, such as network security specialist and telecommunication
specialist.Database administrators who are employed in a permanent position by a company to
maintain an internal database often work full-time.Database administration is a growing field
that should stay relevant for a long time.
3. Target Group:
There are many opportunities in DBA jobs. Because in every sector Database must be need. I
contact with Markentile Bank authority for internship. I hope they will give me the job
opportunity.
4. SWOT Analysis:
Strengths:
2. Open source.
Weaknesses:
1. Low reliability
Opportunities:
Threats:
Our expertise lies in clearly perceiving the business goals of our customers, choosing the most
appropriate technology and efficiently designing and developing solutions. We strongly believe
that this increases business value much more than the mere development of the software
application. Therefore we design and develop innovative and high quality end-to-end software
and business solutions that help our clients reduce their work time and cost of business operation.
SL Software Name
2 e-Office Management
10 Vehicle Management
11 House Keeping
18 Blood Bank
21 Mobile Application
Open Source Linux, Unix, MySQL, PHP, Java, Java Script, etc
Tools:
6. Care Bangladesh
16. UNDP
https://en.wikipedia.org/wiki/Oracle_Database
1. Introduction:
The system is fully database application. There is need to install the Database software. All you
have to need a personal ID and password for open the oracle user. To view temporary data the
server gets the request from the user and gate data from the database. And the required
information will appeared in the DB window. The admin can easily add, delete or update data
easily in the database. And users also have the facility to update delete and add command.
2. Objective:
Objective List the features of Oracle. Discuss the theoretical and physical aspects of a relational
database Describe the Oracle implementation of the RDBMS and ORDBMS. The admin can
easily add, delete or update data easily in the database. And users also have the facility to update
delete and add product.
3. Tools to be used:
# PL/SQL
4. Daily Tasks
and Activities
(SQL plus):
I want to create SELECT statements that can be used again and again. This lesson also covers the
use of SQL commands to execute SQL statements.
CREATE
© Daffodil USER RIPON
international IDENTIFIED BY ABC;
university 18
GRANT DBA TO ABC;
2. User Delete:
(ID Number,
Name varchar2(20),
Department_namevarchar2(20),
Salary number);
Declare
x number; y number;
Begin
x:=20; y:=30;
Sm:=x+y; Sb:=x-y;
Ag:=(x+y)/2;
dbms_output.put_line('********* ');
end;/
Declare
p number; q number;
Begin
p:=x+z;
dbms_output.put_line('Total '||p);
dbms_output.put_line('Total '||p);
end;
declare
v_namevarchar2(30)
; v_sal number;
begin
whereemployee_id=120;
end;
declare
v_sum number;
v_max
number; begin
wheredepartment_id=30;
end;
1. Print Number 1 to 10
Sequentially: (single
loop)
Code:
Begin
dbms_output.put_line(i);
© Daffodil international university 24
end loop;
end;/
declare
v_tax number;
begin
dbms_output.put_line('name'|| i.last_name);
dbms_output.put_line('salary'|| i.salary);
dbms_output.put_line('job'|| i.job_id);
end loop;
dbms_output.put_line(i.department_name);
end loop;
end;
Declare
v_tax number;
begin
fori in empcur
loop
dbms_output.put_line('name'|| i.last_name);
dbms_output.put_line('salary'|| i.salary);
dbms_output.put_line('job'|| i.job_id);
end loop;
end;
3.5.6
Examp
le of
single
point
and 3
outputs
in each
point:
begin
dbms_output.put_line('outer loop');
dbms_output.put_line('inner'|| j);
© Daffodil international university 26
end loop;
dbms_output.put_line('out'|| i);
end loop;
7.To show employees department's all department By single identification &
it will use again & again by x called(without null) :
declare
begin
dbms_output.put_line('department'|| x.department_name);
dbms_output.put_line('name'|| i.last_name);
dbms_output.put_line('salary'|| i.salary);
end loop;
dbms_output.put_line('...........');
end loop;
end;
declare
begin
dbms_output.put_line('department'|| x.department_name);
dbms_output.put_line('name'|| i.last_name);
dbms_output.put_line('salary'|| i.salary);
end loop;
dbms_output.put_line('...........');
end loop;
end;
declare
x number;
y varchar2(25);
begin
select salary
if x<200 then
y:='senior officer';
else
y:='jonior officer';
end if;
dbms_output.put_line(y);
dbms_output.put_line(x);
end;
Output:
employee_id=&emp;
new 6: into x from employees where employee_id=201;
jonior officer
13000
3.5.9.2 Using multiple if else Condition & input value then find the result:
declare
x number:=&data;
y varchar2(25);
begin
if x= 1 then
y:='Best';
end if;
dbms_output.put_line(y);
end;
Output:
old 2: x number:=&data;
new 2: x number:=1;
Best
3.5.10 Process:
1. to create table:--
(id number,
lname varchar2(25),
sal number,
dt date,
dep number)
v_namevarchar2(25);
v_sal number;
v_dt date;
v_dept number;
begin
whereemployee_id=pid;
values (pid,v_name,v_sal,v_dt,v_dept);
commit;
end;
4. executex_proc(120);
is
© Daffodil international university 32
begin
delete pr_5;
commit;
end;
5.Another
procedure
by using
cursor in
same table
by
replacing:-
(p_id number)
is
wheredepartment_id = p_id;
begin
end loop;
commit
; end;
/
© Daffodil international university 33
executeins_p(20);
3.5.11Function:
(pid number)
return varchar2
is
v_namevarchar2(25)
; begin
selectdepartment_na
me into v_name
from departments
where
department_id=pid;
returnv_name;
end;
To Check:
selectx_fn(100
) from dual;
2. Function:
create a
function &
assign the
id to find
the fisrt&
last
Name:-
© Daffodil
create or international university 34
replace
function x_fnc
(pid number)
begin
returnv_name;
end;/
To Check:
(pid number)
return
number is
v_tax number;
v_sal
number;
begin
ifv_sal<5000 then
v_tax:= v_sal * .1 ;
© Daffodil international university 35
elsev_tax:= v_sal * .15;
end if;
returnv_tax;
end;
Tocheck:
selectem
ployee_i
d,salary,f
_tax(100
) from
employe
es;
3.5.12
Find
out
Name
Depart
ment
Name
and
Tax
from
functio
ns:
Need to
create 3
functions
for Name
Departm
ent Name
andDaffodil
© Tax international university 36
Because
we have
no
function
whereemployee_id=id;
return v1;
end;/
Function
2:
(pid number)
return varchar2
is
vn varchar2(30);
Begin
wheredepartment_id=pid;
returnvn;
end;
Functio
n 3:
(id number)
return
number is
© Daffodil international university 37
tx number;
sal number;
Begin
whereemployee_id=id
; ifsal<=5000 then
tx :=sal * .05;
elsifsal<=10000 then
tx:=sal * .1;
elsetx:=sal * .15;
end if;
returnx;
end;
Final
one:
(vidnumber,did number)
is
v_namevarchar2(30)
v_tax number;
begin
select
fx2(vid),df2(d
id),tf2(vid)
dbms_output.put_line('name '||v_name);
dbms_output.put_line('department '||v_dept);
dbms_output.put_line('tax '||v_tax);
end;
Output:
execute test82(110,20)
(id number)
return
varchar2is v1
varchar2(30);
Begin
© Daffodil international university 39
selectlast_name||'
'||first_name into
v1
from employees
whereemployee_id=id
v1; end;
Figure 3.7: Function for getting together last name and first name
3.5.14 Delete one table and also insert another table in one command:
create table aud_1
(id number,
l_namevarchar2(30)
, sal number,
dt date,
usr varchar2(30))
as select
employee_id,last_name
, salary from
employees end;/
begin
values(:old.employee_id,:old.last_name,
:old.salary,sysdate,USER);
end; /
3.5.15 Inserting or
Deleting in Multiple
Table By Using
Trigger:
create
table t3s
(ids
number,
sals
number,
© Daffodildts
international university 41
date,
coms
varchar2(10
create table t2m
(idm
number,
salm number,
dtm date);
begin
if inserting then
values(:new.idm,:new.salm,:new.dtm);
end if;
if deleting then
values(:old.idm,:old.salm,:old.dtm);
end if;
© Daffodil international university 42
end;/
values(100,5000,sysdate);
values(200,6000,sysdate);
http://dbmanagement.info/Books/MIX/Oracle11g_PLSQL_Devel_(1)_PLSQL.pdf
http://dbmanagement.info/Books/MIX/Oracle11g_PLSQL_Devel_(2)_Oracle_PLSQL.pdf
https://www.guru99.com/pl-sql-tutorials.html
http://holowczak.com/oracle-sqlplus-tutorial/
First of all need to make a table and insert data on SQL Plus. For create this project need to make
some initial table like as Time Slot, Vehicle, Tran details, Transaction and which table we need.
Then we use oracle forms builder to design the user interface. We make some module on forms
builder. In those modules we use some button. For each and every button we use different code.
We use some internal system of oracle database to make this project like
LOV WIZARD
DATA BLOCK WIZARD
LAYOUT WIZARD
On forms need to create some module for this project. For this project we need
1. PATINFO
2. VEHICLE
3. TIMESLOT
4. PATMAIN
This is user interface for query. All things are linkup with this.
Divided 24 hour in six slot .That’s make easy to find all vehicles details. And also we can insert
new time if we want to change or add new time zone.
2. Vehicles Entry:
That’s project is offline project. So that we need to insert new vehicles that we find
3. Pump Entry:
In our area we need to find all pump station and need to insert all pump station name and id on
that table.
4. Transaction:
Reason of offline mood we need to entry all things. Use CTRL + L and select the name or id of
the pump station. Then again we need to select the time slot same process using CTRL+L. Then
we have to entry the vehicles and save.
This is the main things of this project. Using CTRT+L select pump name and the time slot .Then
we press GO button and that we get the value of selected pump station.
3.6 Challenges:
Need to go back for daily tasks and activities. For my first project its helps to pickup challenge
for finish this project and perfectly work on this oracle database. Helps to pickup new challenges
for new project on oracle database.
1. Competencies Earned:
Many things I have earned & learned from my internship. First of all help to know every details
about oracle database. Help to learn about PL/SQL & also SQL plus works. Which is very
important for oracle database. Helps to know difference between SQL plus & PL/SQL. Structure
of the PL/SQL block and also know the different types of PL/SQL blocks. So many things I have
learned from my internship. That makes me know about the details about this oracle database.
Evaluate PL/SQL & SQL plus statement. Experience of real-world. This internship helps me to
develop my communication skill. Know about the database theory and the database designing
skills. Control the database. If anything getting problem in database I can solve this problem.
Learned how to backup database and also recovery skills. Build up a project related in oracle
database. This internship helps to earned many potential skills. Works in under pressure, find out
the right and wrong things and also find out the critical problems. This all things I have learned
from my internship.
2. Smart Plan:
My internship topic is Oracle Database. Last 6 months I’m just learn and working on this topic
and I like it. Its helps me to become a certified OCA &OCP . Certified in oracle database it’s a
big things for my future.“Finding Comparatively Idle Petrol Pump Nearby” this is my first
project in oracle database. Now I’m working on a new project. I think working in oracle database
helps to build my good future and helps to get many opportunities for bright future.
5.3 Reflections:
“Finding Comparatively Idle Petrol Pump Nearby” this is my first project in oracle database.
Now I’m working on a new project.
Learning and working on this topic and I like it. Its helps me to become a certified OCA &OCP.
Certified in oracle database it’s a big things for my future.“Finding Comparatively Idle Petrol
Pump Nearby” this is my first project in oracle database. Now I’m working on a new project. I
think working in oracle database helps to build my good future and helps to get many
opportunities for bright future.
[1] ‘‘‘Oracle Database 11g: Develop PL/SQL Program Units (Volume 1),” April 2009. [Online] Available:
http://dbmanagement.info/Books/MIX/Oracle11g_PLSQL_Devel_(1)_PLSQL.pdf [Last accessed: 06-04-2018 at
9.47 pm].
2‘‘‘Oracle Database 11g: Develop PL/SQL Program Units (Volume 2),” April 2009. [Online] Available:
http://dbmanagement.info/Books/MIX/Oracle11g_PLSQL_Devel_(2)_Oracle_PLSQL.pdf [Last accessed: 06-04-
2018 at 9.59 pm].
3‘‘‘Oracle Database 11g: Develop PL/SQL Fundamentals,” September 2009. [Online] Available:
http://dbmanagement.info/Books/MIX/4_Oracle_Database_11g_PLSQL_Fundamentals_PLSQL.pdf[Last accessed:
06-04-2018 at 11.16 pm].