Database Administration & Management
Database Administration & Management
Lecture: 02
Database Concepts
Farhad Muhammad Riaz
University Institute of Information Technology (UIIT)
[email protected]
Integrity constraints
Entity Integrity
Domain Integrity
Referential integrity
Insertion rule
We cannot enter value in child without entering in parent/ owner
Deletion rule
We cannot delete value from parent without deleting from child
Cardinality in database
Null/ optional
Mandatory
Example Database
How to create table in Oracle
CREATE TABLE schema_name.table_name (
column_1 data_type column_constraint,
column_2 data_type column_constraint,
...
table_constraint
);
Example
CREATE TABLE ot.persons(
person_id NUMBER GENERATED BY DEFAULT AS IDENTITY,
first_name VARCHAR2(50) NOT NULL,
last_name VARCHAR2(50) NOT NULL,
PRIMARY KEY(person_id)
dept_id NUMBER , -- fk
CONSTRAINT fk_Department_persons FOREIGN KEY( dept_id )
REFERENCES department( dept_id )
ON DELETE CASCADE
);
CREATE TABLE ot.Department(
dept_id NUMBER GENERATED BY DEFAULT AS IDENTITY,
dept_name VARCHAR2(50) NOT NULL,
dept_loc VARCHAR2(50) NOT NULL,
PRIMARY KEY(dept_id)
);
Data/Database Administration
Data Administration
a high-level function that is responsible for the overall management of data
resources in an organization, including maintaining corporate-wide
definitions and standards
headed by a data administrator (DA)
a senior-level manager selected from within the organization rather than a technical
computer expert
requires high level of both managerial and technical skills
Database Administration
a technical function that is responsible for physical database design and for
dealing with technical issues such as security enforcement, database
performance, and backup and recovery
Database administrator (DBA) in charge
requires broad technical background; managerial skills also critical
8
Data Administration Functions
Data policies, procedures, standards
Policies: e.g., “Every user must have a password”
Procedures: e.g., backup and recovery procedures
Standards: e.g., naming conventions
Planning
understand the information requirements of the organization and be able to
contribute to the development of the information architecture
Data conflict resolution
resolve data ownership issues
Internal marketing of data standards
reduce resistance to change and data ownership problems
Managing the information repository
contains the metadata
used by users, CASE tools, applications, DBMS
9
Database Administration Functions
Note: Vast majority of time spent by DBA are on tuning database performance
and improving database query processing time.
10
WHAT IS DATABASE ADMINISTRATOR ?