19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining...

26
19 th October 2017

Transcript of 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining...

Page 1: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

19th October 2017

Page 2: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

SQL Content:

• Defining SQL

• History of the SQL

-Pronouncing SQL: (S-Q-L or Sequel)

• Types of Languages- DDL & DML

-Examples of DDL & DML command statements

Page 3: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Database Systems, 8th Edition 3

SQL:

Is defined as computer

language used to store,

manipulate and retrieve

data stored in relational

databases.

Page 4: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

History of the SQL • SQL was developed at IBM in 1970s

• Initially called SEQUEL: Structured English Query Language

• Later it was shorten to SQL. Both words are still correct to use.

• The RDBMS model (i.e. a database using tables for data storage)

was implemented by many vendors such as: Microsoft (SQL Server),

Oracle, IBM (DB2), MySQL, Postgres, etc.

• Each RDBMS has the SQL acting as the dialect to it. Example a

country called France (RDBMS) has a language dialect called French

(SQL). The British also speak a language called English. SQL, is like

the natural languages; some words in the dialect are common. Some

words are unique in each RDBMS type. But it may be used for the

same function such as to “DELETE” an item in both RDBMS brands.

(i.e. command syntax is different; but it performs same function)

• Reason: To differentiate one RDBMS from other brands, vendors

prefer to change the syntax for writing the commands.

Page 5: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

5

Page 6: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Examples:

• Data Definition Language NB: For each RDBMS brand you need to learn the DDL &

DML syntax or structure. Some are unique others similar

• SQL uses the following set of commands to define database schema:

• CREATE • Creates new databases, tables, and views

from RDBMS.

• For example:

• Create database tutorialspoint;

• Create table article;

• Create view for_students; 6

Page 7: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

DDL

• DROP • Drops commands, views, tables, and

databases from RDBMS.

• For example:

• Drop object_type object_name;

• Drop database tutorialspoint;

• Drop table article;

• Drop view for_students;

7

Page 8: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

DDL

• ALTER

• Modifies database schema.

• Alter object_type object_name parameters; 13.

• For example:

• Alter table article add subject varchar;

This command adds an attribute in the relation

article with the name subject of string type.

8

Page 9: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Data Manipulation Language • SELECT/FROM/WHERE

• SELECT

• This is one of the fundamental query command of SQL. It is similar to the projection operation of relational algebra. It selects the attributes based on the condition described by WHERE clause.

• FROM

• This clause takes a relation name as an argument from which attributes are to be selected/projected. In case more than one relation names are given, this clause corresponds to Cartesian product.

• WHERE

• This clause defines predicate or conditions, which must match in order to qualify the attributes to be projected.

• For example:

• Select author_name

• From book_author

• Where age > 50;

This command will yield the names of authors from the relation book_author whose age is

greater than 50. 9

Page 10: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

DML • INSERT INTO/VALUES

• This command is used for inserting values into the rows of a table (relation).

• Syntax:

• INSERT INTO table (column1 [, column2, column3 ... ]) VALUES (value1 [, value2, value3 ... ])

• Or

• INSERT INTO table VALUES (value1, [value2, ... ])

• For example:

• INSERT INTO tutorialspoint (Author, Subject) VALUES ("anonymous", "computers");

10

Page 11: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

DML • UPDATE/SET/WHERE

• This command is used for updating or modifying the values of columns in a table (relation).

• Syntax:

• UPDATE table_name SET column_name = value [, column_name = value ...] [WHERE condition]

• For example:

• UPDATE tutorialspoint SET Author="webmaster" WHERE Author="anonymous";

11

Page 12: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

DML

• DELETE/FROM/WHERE • This command is used for removing one or

more rows from a table (relation).

• Syntax:

• DELETE FROM table_name [WHERE condition];

• For example:

• DELETE FROM tutorialspoint

• WHERE Author="unknown"; 12

Page 13: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

PHASE 2

Database Security and Administration

13

Page 14: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

• Determining which data items are sensitive in a database depends on the application.

Examples: levels of sensitivity

1. Library Public Catalog (Less sensitive data)

2. A university Databases (Mid-sensitive data).

3. Military and Defense Databases (High sensitive data),

NB: It is important to understand Data Lifecycle

Data lifecycle

Page 15: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Database Systems, 8th Edition

Page 16: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

DATABASE ADMINISTRATOR (DBA) Whenever a person or a group of persons needs to

access a database system, the individual or group must first apply for a user account.

The DBA will then create a new account & password for the user if there is a legal need to access the database.

The user must login to the DBMS by entering the account name/number & password whenever database access is needed.

The database Administrator must also keep track of all operations on the database that are applied by a certain user throughout each login session.

By:-Gourav Kottawar 16

Page 17: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Database Systems, 8th Edition

Page 18: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

In a multi-user Database System , DBMS must provide techniques to enable certain users or user groups to access selected portions of a database without granting access to the rest of the database.

There are two types of security mechanisms:

Discretionary security Mechanisms: These are used to grant privileges to users , including the capability to access specific data files, records , or fields in a specific mode (such as read , insert , delete or update)

Mandatory Security Mechanisms: These are used to enforce multilevel security by classifying data & users into various security classes.

Ex. A role based security , which enforces policies & privileges based on the concept of roles. (Student cannot access VC folder)

By:-Gourav Kottawar 18

Page 19: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

A major problem to all computer systems is that of preventing unauthorized persons from accessing the system itself.

The security mechanisms of DBMS must include provisions for restricting access to the database system as a whole.

The function is called Access Control & is handled by creating user accounts & passwords to control the login process by the DBMS.

DBA is the central authority for managing a database system.

DBA’s responsibilities include:

Account Creation

Privilege granting

Privilege revocation

Security level assignment

By:-Gourav Kottawar 19

Page 20: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

◦ Accountability and audit: maintaining a log of security-relevant events that have occurred, listing each event and the person responsible.

◦ Intrusion detection system: A software that builds usage patterns of the normal system and triggers an alarm anytime the usage is abnormal.

Page 21: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Data management is a critical activity for any organization ◦ Data should be treated as a corporate asset

DBMS is the most commonly used electronic tool for corporate data management

DBMS has impact on organization’s managerial, technological, and cultural framework

Data administration function evolved from centralized electronic data processing ◦ Applications began to share common repository

Database Systems, 8th Edition

Page 22: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Database administrator (DBA) is responsible for managing corporate database

Broader data management activity is handled by data administrator (DA)

DA is more managerially oriented than more technically oriented DBA ◦ DA function is DBMS-independent ◦ DBA function is more DBMS-dependent

When there is no DA, DBA executes all DA functions

Database Systems, 8th Edition

Page 23: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Managerial services of DBA function: ◦ Supporting end-user community

◦ Defining and enforcing policies, procedures, and standards for database function

◦ Ensuring data security, privacy, and integrity

◦ Providing data backup and recovery services

◦ Monitoring distribution and use of data in database

Database Systems, 8th Edition

Page 24: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Technical role of DBA: ◦ Evaluating, selecting, and installing DBMS

◦ Designing and implementing databases and applications

◦ Testing and evaluating databases and applications

◦ Operating DBMS, utilities, and applications

◦ Training and supporting users

◦ Maintaining DBMS, utilities, and applications

Database Systems, 8th Edition

Page 25: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data

Security ensures confidentiality, integrity, availability of information system and data

Security policy is a collection of standards, policies, and practices

Security vulnerability is a weakness in system component

Information engineering guides development of data administration strategy

CASE tools and data dictionaries translate strategic plans to operational plans

Database Systems, 8th Edition

Page 26: 19th October 2017 · Managerial services of DBA function: Supporting end-user community Defining and enforcing policies, procedures, and standards for database function Ensuring data