Group 22
Group 22
1.KIDANEMARIAM…………… CIR/127/10
2.HASAN NURI………….. CIR/ /10
3.GASHEHUN ASNAKE………… CIR/ /10
4.EGNUMA DEBISA………….. CIR/ /10
SUBMIT TO MR.WORKU MULUYE
SECTION B
DEPARTMENT: Information system
1
PROJECT TITLE: COLLEGE OF COMPUTING
AND INFORMATICS
2. What is Database Administration?
Database administration refers to the whole set of activities performed
by a database administrator to ensure that a database is always
available as needed. Other closely related tasks and roles are database
security, database monitoring and troubleshooting, and planning for
future growth.
2
privilege that who gives, revoking those privileges, Security Level
Assignment.
RESPONSIBILITIES OF DATABASE ADMINISTRATOR (DBA)
Deciding the information content of the database (defining
schema)
It is the DBA’s job to decide exactly what information is to be held in
the database - in other words, to identify the entities of interest to the
enterprise and to identify the information to be recorded about those
entities. Having done this, the DBA must then define the content of
the database by writing the conceptual schema.
3
specifying the mapping, but the schema and the mapping should be
clearly distinguishable.
4
In short a database administrator is the specialist or a group of specialists
who has a higher responsibility to control and manage the DBMS. This
specialist or specialists has the following responsibilities
5
o Then we use data integrity rules properly when define the schema
because those rules are the best guard to protect the data in
database environment
o Then if the data integrity rules are defined properly, we use
database security rules to protect the data from personal access
from inside the organization and outside the organization those
rules are:
Access Privileges
o Users should access the database only in ways in which
authorized person.
o Security
o Access restrictions ensure that the database is secure.
o Passwords, encryption, and views implement security.
o Effective password protection is critical.
Data privacy: He owner of the data must be known and customer right
must be protected
6
physical security: Hardware and software related and as well as data
related problem also must planned properly to administrate database
properly
Managerial Controls:
Insiders
o Employee selection & Job termination
o Monitoring suspicious behavior
o Job segmentation (who can do what with data*) Physical & Logical
access limitations
Outsiders
o Physical access limitations
o “Shadowing”
4) Logical Security
7
5. What is role of DBA in your project?
The DBA has the overall control on our project. Those roles: -
6. What is database security and how could you secure database in oracle 12c?
8
a multitude of processes, tools and methodologies that ensure security
within a database environment
In other word, Database security is a protection of information in the
database and protecting data against unauthorized access, disclosure,
alteration, modification and destruction. Database security is making
the database or the data.
The oracle relational database management system (RDBMS): is an
industry leading database system designed for mission critical data
storage and retrieval
The RDBMS is responsible for accurately storing data and
effectively retrieving that data in response to user queries.
In oracle 12c the database security is categorized in three
categories
1. Detective: There are also other mechanisms like activity
monitoring, database firewall, auditing and reporting.
2. Preventive: There are different mechanisms like:
Encryption is the Foundation Preventive Control for Oracle
Databases
o Transparent data encryption: is encrypts data at rest in
Oracle Databases
o Prevents access to data at rest
9
o Built-in two-tier key management architecture: consisting of a
master encryption key and one or more data encryption keys.
o “Near Zero” overhead with hardware
o Integrations with Oracle technologies redaction, masking and sub
setting , privileged user control
3. Administrative: there is an also additional mechanism like key
management, privilege and data discovery, and configuration
management.
10
7.Difference between oracle and MYSQL
Oracle MYSQL
1.uses PL/SQL Server uses T-SQL,
2.Owned by oracle corporation Owned by Microsoft Corporation
3.Complex and more efficient Simpler and easier syntaxes
syntax
4.Clear and crisp error handling Displays error messages in pre-
defined formats
5.Uses a copy of the records while Uses Row or Page blocking and
modifying it and allows Reads of never allows a Read while the page
original data while doing the is blocked
modification
6.Values are not changed before Values are changed even before
commit Commit
7.It is much simpler to handle Transaction Failure requires the
because changes are done only on a data to be modified to the original
copy. before the Write process
8.Roll Back is allowed Roll Back is not allowed during a
transaction
9.Concurrent accesses are Concurrent accesses are not
permitted and waits are generally permitted when a Write is in
less progress. This leads to longer
waits.
10.Good support but with non- Excellent customer support
technical staffs as well
11.Runs on a variety of platforms Runs on Windows platform only
12.Lock sizes varies as per the Locks pages of the same size
11
need
13. Follows Dynamic memory Follows Global memory allocation
allocation and allows DBA to and less intrusion of DBA. Hence,
intrude more. So, chances of fewer chances of human errors.
human error is higher
14.Uses Bitmap, indexes based on No Bitmap, indexes based on
functions, and reverse keys functions, and reverse keys
15.Uses Star query optimization Query optimization is missing
16.Uses both After and Before Allows triggers and mostly uses
triggers After triggers
17.Uses java. Uses linked servers to read or write
to external files
18.complex interface Extremely simple user-interface
8. Describe the purpose of SQLPLUS,SQL developer and Enterprise
Management?
12
and view the results. You can execute data definition language (DDL)
statements to create tables and other objects. DBAs can use SQL*Plus to
start up, shut down, and otherwise administer a database. You can even
enter and execute PL/SQL code.
4) It is a non-GUI, character-based tool that has been around since the
dawn of the Oracle age. SQL Plus understands five categories of text:
1. SQL statements
2. PL/SQL blocks
3. SQL Plus internal commands, for example:-environment control
commands such as SET and environment monitoring commands such as
SHOW
4. Comments
5. External commands prefixed by the ! char
Scripts can include all of these components.
The purpose of SQLPLUS is provide the command line utility that
allows writing SQL and PL/SQL commands.
SQL Developer supports Oracle Database 10g, 11g, and 12c and will run
on any operating system that supports Java. SQL Developer provides
powerful editors for working with SQL, PL/SQL, Stored Java
Procedures, and XML
13
A free graphical user interface, Oracle SQL Developer allows database
users and administrators to do their database tasks in fewer clicks and
keystrokes. A productivity tool, SQL Developer's main objective is to
help the end user save time and maximize the return on investment in the
Oracle Database technology stack."
14
management, the comparing of various configurations, and consistency
management, which can be applied to Oracle DBA environments.
Zone Maps: For full table access, zone maps allow I/O pruning of data
based on the physical location of the data on disk, acting like an anti-
index. Accessing only the relevant data optimizes the I/O necessary to
satisfy a query, increasing the performance significantly and reducing
the resource consumption.
15
Oracle snapshot technology is used internally to further improve the
sharing of homes across clusters and to reduce storage space.
Attribute Clustering:
16
applications using pluggable databases (PDB) in a multitenant
container database.
17
PDB Metadata Clone: An administrator can now create a clone of a
pluggable database only with the data model definition. The dictionary
data in the source is copied as is but all user-created table and index data
from the source is discarded. This feature enhances cloning functionality
and facilitates rapid provisioning of development environments.
18
databases. With file system agnostic snapshot clones, pluggable databases
can be provisioned even faster than before.
19
powerful clause helps convert cumbersome schema-based consolidations
to more agile and efficient pluggable databases.
No User Role
1. Habte Head
2 Feydu Dean
3 Sefidein Instructor
4. Genet Assistant
6. Kidanemariam Student
12. Using SQLPLUS connect as A SYSDBA and create another DBA user
within a pluggable database regarding your project business rule.
Enter user-name: sys as sysdba
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
20
3 ORCLPDB READ WRITE NO
4 DORM READ WRITE NO
5 CCIMS READ WRITE NO
6 CCI READ WRITE NO
SQL> alter session set container=CCI;
Session altered.
13. Connect a new DBA to the database and create other
users that access the database based on your use case.
SQL> create user ADMN identified by admn;
User created.
Grant succeeded.
Grant succeeded.
User created.
21
SQL> alter user Feydu default tablespace users quota unlimited on
users;
User altered.
Grant succeeded.
User created.
Grant succeeded.
User created.
User altered.
22
Grant succeeded.
User created.
User altered.
Grant succeeded.
User created.
User altered.
Grant succeeded.
23
Role created.
Role created.
Role created.
Role created.
Role created.
create profile.
24
3 PASSWORD_LIFE_TIME 60
4 PASSWORD_REUSE_TIME 60
5 PASSWORD_REUSE_MAX 5
6 PASSWORD_LOCK_TIME 1/24
7 PASSWORD_GRACE_TIME 10;
Profile created.
16. Grant system privileges to the Roles may be Alter Database,
Create Pluggable Database, Create Table, Create Any Table,
Alter Any Table, Drop Any Table, Lock Any Table, Select Any
Table, Insert Any Table, Update Any Table, Delete Any Table,
Create Session, Create Any Index, Drop Any Index, Create
Tablespace, Unlimited Tablespace, Create Role, Drop Any Role,
Grant Any Role, Create Trigger, Create Any Trigger, Create
Procedure, Create Any Procedure, Drop Any Procedure, Create
User, Alter User, Drop User, Create View, Create Any View,
Drop Any View…
25
SQL> grant create session, create table, create Any view ,drop Any table
to Head;
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
26
SQL> grant select on ADMN.Student to Student;
Grant succeeded.
Grant succeeded.
Grant succeeded.
18. Create 3rd normalized tables and create triggers that enables
to update and delete data from both parent and child tables since
oracle supports only on delete cascade but not on update
cascade.
Table created.
1 row created.
27
SQL> insert into Department Values('11','SE','second floor of cci
collage','aaaa');
1 row created.
1 row created.
1 row created.
28
SQL> select*from Department;
Table created.
1 row created.
29
SQL> insert into Instructor values('2','mr.sefedin','Male','2
year',7000,29,'11');
1 row created.
1 row created.
2 mr.sefedin Male
2 year 7000 29 11
3 mr.henok Male
3 year 7000 33 10
Table created.
30
SQL> insert into Course values('INSSY1111','Advanced DB',5,'major
course','10');
1 row created.
1 row created.
1 row created.
INSSY011 c#
7
major course 10
INSSY012 OOSAD
5
major course 10
31
Table created.
Table dropped.
Table created.
1 row created.
1 row created.
32
1 row created.
1 row created.
33
Stud_ID varchar(10) ,foreign key(Stud_ID) references
Student(Stud_ID));
Table created.
1 row created.
1 row created.
1 row created.
SQL> select *from Class;
34
SQL>create table StudentPhone(phone_no varchar(20) primary
key,Stud_ID varchar(10) ,foreign key(Stud_ID) references
Student(Stud_ID));
Table created.
SQL>insert into StudentPhone('0947398069','CIR/127/10');
1 row created.
SQL>insert into StudentPhone('09883168069','CIR/120/10');
1 row created.
SQL>insert into StudentPhone('0971738069','CIR/107/10');
1 row created.
SQL>insert into StudentPhone('0918586069','CIR/118/10');
1 row created.
SQL> select* from StudentPhone;
PHONE_NO STUD_ID
-------------------- ----------
0947398069 CIR/127/10
0988168069 CIR/120/10
0971738069 CIR/107/10
0918586069 CIR/118/10
35
1 row created.
SQL>insert into StudentPhone('09883168069','CIR/120/10');
1 row created.
SQL>insert into StudentPhone('0920938947 ','2');
1 row created.
SQL> select*from InstructorPhone;
PHONE_NO INST_ID
-------------------- ----------
0916536522 1
0920938947 2
Table created.
1 row created.
1 row created.
36
SQL> select*from studinstcorsjucnction;
19. The table owner grant object privileges to the Roles or Users may be
Select, Insert, Update, Delete, Alter, Index, References…
Grant succeeded.
Grant succeeded.
Grant succeeded.
Grant succeeded.
37
Grant succeeded.
Grant succeeded.
Grant succeeded.
38
11 ElsIf Updating Then
12 DBMS_OUTPUT.PUT_LINE ('One Row Updated By Mr. '||
userName);
13 ElsIf Deleting Then
14 DBMS_OUTPUT.PUT_LINE ('One Row Deleted By Mr. '||
userName);
15 End If;
16 end;
17 /
Trigger created.
39
13 ElsIf Deleting Then
14 DBMS_OUTPUT.PUT_LINE ('One Row Deleted By '||userName);
15 End If;
16 end;
17 /
Trigger created.
Trigger created.
40
SQL> delete COURSE;
One Row Deleted By ADMN
One Row Deleted By ADMN
One Row Deleted By ADMN
******************BACKUP***************
41
end;
Trigger created.
Trigger created.
42
--------------------DBA AUDIT TRIAL-----------------------------------------
insert into
STUDENT_AUDIT(New_Stud_ID,Old_Stud_ID
,New_Stud_FName,
Old_Stud_FName,New_Stud_LName,Old_Stud_LName,
43
New_Stud_Gender,Old_Stud_Gender,New_GPA,Old_GPA,Ne
w_Birth_Of_date,
Old_Birth_Of_date,New_age,Old_age,New_Section,Old_Sectio
n,New_DepID,
Old_DepID ,USER_NAME,ENTERY_DATE,Operation)
VALUES(:NEW.Stud_ID,NULL,
:NEW.Stud_FNAME,NULL,:NEW.Stud_LNAME,NULL,:NE
W.Stud_Gender,NULL,:NEW.GPA,NULL,
:NEW.Birth_Of_date,NULL,:NEW.Age,NULL,:NEW.Section,
NULL,
:NEW.DepID,NULL,USER_NAME,USED_DATE,'INSERT');
Old_Stud_FName,New_Stud_LName,Old_Stud_LName,New_
Stud_Gender,Old_Stud_Gender,
44
New_GPA,Old_GPA,New_Birth_Of_date,Old_Birth_Of_date,
New_age,Old_age,New_Section,
Old_Section,New_DepID,Old_DepID
,USER_NAME,ENTERY_DATE,Operation)
VALUES(:NEW.Stud_ID,:OLD.Stud_ID,
:NEW.Stud_FNAME,:Old.Stud_FNAME,:NEW.Stud_LNAME,
:Old.Stud_LNAME,:NEW.Stud_Gender,:Old.Stud_Gender,:NE
W.GPA,:Old.GPA,
:NEW.Birth_Of_date,:Old.Birth_Of_date,:NEW.Age,:Old.Age,:
NEW.Section,:Old.Section,
:NEW.DepID,:Old.DepID,USER_NAME,USED_DATE,'UPDA
TE');
45
Old_Stud_FName,New_Stud_LName,Old_Stud_LName,New_
Stud_Gender,Old_Stud_Gender,
New_GPA,Old_GPA,New_Birth_Of_date,Old_Birth_Of_date,
New_age,Old_age,New_Section,
Old_Section,New_DepID,Old_DepID
,USER_NAME,ENTERY_DATE,Operation)
VALUES(NULL,:Old.Stud_ID,NULL,
:Old.Stud_FNAME,NULL,:Old.Stud_LNAME,NULL,:Old.Stud
_Gender,NULL,:Old.GPA
,NULL,:Old.Birth_Of_date,NULL,:Old.Age,NULL,:Old.Sectio
n,NULL,
:Old.DepID,USER_NAME,USED_DATE,'DELETE');
END IF;
END;
AUDIT SELECT ,UPDATE,INSERT,DELETE ON
ADMN.COURSE;
Audit succeeded.
46
AUDIT SELECT ,UPDATE,INSERT,DELETE ON
ADMN.STUDENT;
Audit succeeded.
AUDIT SELECT ,UPDATE,INSERT,DELETE ON
ADMN.CLASS;
Audit succeeded.
AUDIT SELECT ,UPDATE,INSERT,DELETE ON
ADMN.INSTRUCTOR;
Audit succeeded.
AUDIT SELECT ,UPDATE,INSERT,DELETE ON
ADMN.STUD_PHONE;
Audit succeeded.
COURSE
//////////////////////////////////////////////////////////////////////////
47
USER_NAME varchar2(20),ENTERY_DATE varchar2(20),Operation
varchar2(20));
48
ElsIf Updating Then
49
USER_NAME, USED_DATE,'DELETE');
END IF;
END;
50
Ora_Sysevent);
End;
hr _schema_audit
Create or replace trigger hr_Schema_Audit
After DDL On Schema
BEGIN
Insert into Schema_Audit Values(Sysdate,
Sys_context('USERENV', 'CURRENT_USER'),
Ora_Dict_Obj_Type,
Ora_Dict_Obj_Name,
Ora_Sysevent);
End;
51
Sysdate,
To_Char(Sysdate, 'HH24:MI:SS'),
Null,
Null);
Commit;
End;
DISC;
Connect ADMN/admn@//Localhost:1521/CCI;
EVENT_TYPE LOGON_DAT
---------------------------------------- ---------
LOGON_TIME LOGOFF_DA
-------------------------------------------------- ---------
LOGOFF_TIME
--------------------------------------------------
LOGON 01-JUN-19
23:31:01
LOGON 01-JUN-19
23:33:29
EVENT_TYPE LOGON_DAT
---------------------------------------- ---------
LOGON_TIME LOGOFF_DA
-------------------------------------------------- ---------
LOGOFF_TIME
52
--------------------------------------------------
/////////////////////////////////logoff
Create Table ADMN_Event_Audit (
User_name Varchar2(40),
Event_type Varchar2(40),
Logon_date date,
Logon_time Varchar2(50),
Logoff_date date,
Logoff_time Varchar2(50)
);
53
alter user haftamu account lock;
alter user haftamu account unlock;
revoke create any view ,create session, drop any table from
Head;
54
drop user Haftamu;
drop user Werku
55
Integrity control more difficult
Database design more complex
21. Design distributed database model(architecture) for your
project and identify data distribution/allocation strategies and
data storage mechanism to store a single relation in a distributed
database architecture.
56
Local applications: applications which do not require
data from other sites.
Global applications:- applications which do require
data from other sites.
57