Você está na página 1de 70

INDEX

Sr. No. Topics Pg. No. Remarks

1. Database Administrator 1

2. Responsibilities of DBA 2

3. Types of DBA 4

4. Database Administration Tools 5

5. Introduction of Oracle 6

6. Structured Query Language Commands 7

7. Installation of Oracle 10g 37

8. Introduction of MySql 41

9. Backup 42

10. Restore 45

11. Introduction of phpmyadmin 48

12. Installation of phpmyadmin 49

13. Database Migration 55

14. Export and Import 57

15. Privileges 64

16. Workbench 65
1

DATABASE
ADMINISTRATOR
Database administration is the function of managing and maintaining
database management systems (DBMS) software. Mainstream DBMS
software such as Oracle, IBM DB2 and Microsoft SQL Server need
ongoing management. As such, corporations that use DBMS software
often hire specialized IT (Information Technology) personnel called
Database Administrators or DBAs.

A database administrator (DBA) is a person responsible for installation,


configuration, upgrade, administration, monitoring and maintenance of
databases in an organization.

In the other words Centralized control of the database is exerted by a


person or group of persons under the supervision of a high-level
administrator. This person or group is referred to as the database
administrator (DBA). They are the users who are most familiar with the
database and are responsible for creating, modifying, and maintaining its
three levels.

Database Administrator is responsible to manage the DBMS’s use


and ensure that the database is functioning properly.DBA is also
responsible for granting permission to the users of the database and stores
the profile of each user in the database.

The role includes the development and design of database strategies,


system monitoring and improving database performance and capacity and
planning for future expansion requirements. They may also plan, co-
ordinate and implement measures to safeguard the database. The Other
primary roles will include:
2

RESPONSIBILITIES OF
DBA
1. Deciding the information content of the database
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.

2. Deciding the storage structure and access strategy


The DBA must also decide how the data is to be represented in the
database, and must specify the representation by writing the storage
structure definition. In addition, the associated mapping between
storage structure definition and the conceptual schema must also be
specified.

3. Listening with the users


It is the business of the DBA to liaise with users, to ensure that the data
they require is available, and to write the necessary external schemas.
In addition, the mapping between any given external schema and the
conceptual schema must also be specified. In practice the external DDL
will probably include the means for specifying the mapping, but the
schema and the mapping should be clearly distinguishable.
3

4. Defining authorization checks and validation


procedures
Authorization checks and validation procedures may be considered as
logical extensions of the conceptual schema. The conceptual DDL will
include facilities for specifying such checks and procedures.

5. Defining a strategy for backup and recovery


Once an enterprise is committed to a database, it become critically
dependent on the successful operation of that system. In the event of
damage to any portion of the database – caused by human error, say,
or a failure in the hardware or supporting operating system – it is
essential to be able to repair the data concerned with a minimum of
delay and with as little effect as possible on the rest of the system.

6. Some other are


 Database tuning and performance monitoring.
 Application tuning and performance monitoring.
 Setup and maintain documentation and standards.
 Plan growth and changes (capacity planning).
 Work as part of a team and provide 24x7 support when required.
 Do general technical troubleshooting and give cons.
 Database recovery.
4

TYPES OF DBA :
 Installation, configuration and upgrading of Microsoft SQL
Server/MySQL/Oracle server software and related products
 .Evaluate MSSQL/MySQL/Oracle features and
MSSQL/MySQL/Oracle related products.
 Establish and maintain sound backup and recovery policies and
procedures.
 Take care of the Database design and implementation. (create and
maintain users and roles, assign privileges).
 Database tuning and performance monitoring.
 Application tuning and performance monitoring.
 Implement and maintain database security
 Setup and maintain documentation and standards.
 Plan growth and changes (capacity planning).
 Work as part of a team and provide 7×24 supports when required.
 Do general technical trouble shooting and give consultation to
development teams.
 Interface with MSSQL/MySQL/Oracle for technical support.
 ITIL Skill set requirement (Problem Management/Incident
Management/Chain Management
5

DATABASE
ADMINISTRATOR TOOLS
DBA works with two tools:
• Server Tools
• Client Tools Server Tools
It includes the followings:
• Oracle Server
• MySql Enterprise
• Sql Server Client Tools It includes the followings:
• phpmyadmin
• MySql command shell
• MySql workbench
• MySql webmin module
• Emma
6

INTRODUCTION OF
ORACLE
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. Oracle Database is the first database designed for
enterprise grid computing, the most flexible and cost effective way to
manage information and applications. Enterprise grid computing creates
large pools of industry-standard, modular storage and servers. With this
architecture, each new system can be rapidly provisioned from the pool
of components. There is no need for peak workloads, because capacity
can be easily added or reallocated from the resource pools as needed. A
DBMS must also be secure from unauthorized access and provide
efficient solutions for failure recovery. The ORACLE Server provides
efficient and effective solutions for the major database features. ORACLE
consists of many tools that allow you to create an application with ease
and flexibility. You must determine how to implement your requirements
using the features available in ORACLE, along with its tools. The features
and tools that you choose to use to implement your application can
significantly affect the performance of your application. Several of the
more useful features available to ORACLE application developers are
integrity constraints, stored procedures and packages, database triggers,
cost-based optimizer, shared SQL, locking and sequences.
7

STRUCTURED QUERY LANGUAGE


COMMANDS
SQL commands are instructions, coded into SQL statements, which
are used to communicate with the database to perform specific tasks,
work, functions and queries with data.

SQL commands can be used not only for searching the database but also
to perform various other functions like, for example, you can create
tables, add data to tables, or modify data, drop the table, set permissions
for users. SQL commands are grouped into four major categories
depending on their functionality.

The main categories are

 DDL (Data Definition Language)


 DML (Data Manipulation Language)
 DQL (Data Query Language)
 DCL (Data Control Language)
 Data administration commands

a) DDL- DDL is a language for defining Data Structured. The term


was first introduced in relation to database model, where schema of
database was written in data definition language describing records,
fields and sets making up user data model. DDL statements create,
modify, and remove Database objects like tables, indexes, functions,
procedures etc. Common DDL statements are creating alter and
drop. DDL has a pre-defined syntax for describing data various
DDL commands are:
1. CREATE- To create objects in Database.
2. ALTER- Alters the structures in Database.
3. DROP- Delete objects from Database.
4. TRUNCADE- Remove all the records from table including all
the space allocated for the records.
5. RENAME- Changes the name of database object.
8

b) DML- DML statements access and manipulate data in existing


database objects. These statements do not implicitly (automatically)
commit the current transaction. DML is a family of computer
languages used to retrieve, delete and update the data. Following are
some DML statements or commands.
1. SELECT- Retrieve Data from Database Table.
2. INSERT- Inserts Data into a table.
3. UPDATE- Updates existing data within a table.
4. DELETE- Delete the records from the table but space for the
records remain as it is.
5. CALL- Calls a PL/SQL or JAVA sub-program.
There are two types of DML:
i. Processional- User specifies what data is needed and how to get
it.
ii. Non-Processional- User only specifies what data is needed. It is
easier for user but it may not generate code as efficient as
produced by processional language.

c) DCL- DCL is computer language and a subset of SQL to control


access to data in database. DCL is a part of SQL used to control
access to data. DCL statements are used to provide a kind of security
to database. Users can be granted privileges (rights) or roles to allow
restricted access to database.
Common DCL commands are:
1. GRANT- It is used to give permissions to the user to allow him
to perform specified task.
2. REVOKE- It is used to cancel previously granted permissions.

d)TCL-TCL statements are used to manage changes made by DML


statements. It allows statements to be grouped together into logical
transactions
Common TCL commands are:
1. COMMIT- Saves the work done.
2. SAVE POINT- Identifies a point in a transaction to which you
can roll back.
9

3. ROLL BACK- Restores the database to original since the last


commit.
4. SET TRANSACTION- Changes the transaction options like-
isolation level, and what roll back segment to use.
10

CREATE TABLE AND INSERT VALUES INTO THE TABLE


11
12

SELECT STATEMENT
The SQL SELECT command is used to fetch data from the MySQL
database.
13

ALTER STATEMENT

The alter table statement is used to add, delete, or modify columns in an


existing table.
14
15

DROP TABLE STATEMENT

The alter table statement is also used to add and drop various constraints
on an existing table.
16
17

MODIFY COMMAND

The MODIFY Keyword allows you to Modify Column Data Type and
Modify Column Constraints
18

ADDING PRIMARY KEY CONSTRAINTS


19

ADDING NOT NULL CONSTRAINT


20

ADDING UNIQUE CONSTRAINT


21
22

ADDING A NEW COLUMN USING MODIFY STATEMENT


23
24

UPDATE STATEMENT
An SQL UPDATE statement changes the data of one or more records in
a table. Either all the rows can be updated, or a subset may be chosen
using a condition.
25
26

SELECT STATEMENT TO SHOW ONE PARTICULAR


COLUMN DATA FROM THE TABLE
27

SELECT STATEMENT USAGE TO SHOW ONLY TWO OR


MORE COLUMNS DATA FROM TABLE
28

SELECT STATEMENT USING WHERE CLAUSE


29

SELECT STATEMENT USING DISTINCT KEYWORD


30

SELECT STATEMENT USING * (ASTERISK) TO SHOW ALL


THE COLUMNS AND ROWS
31

CREATING INDEX ON TABLE


32

CREATING VIEW
33

SELECT STATEMENT ON VIEW


34

CREATING USER ID , REVOKE AND GRANT PRIVILEGE


35
36
37

Installation of Oracle 10g


Steps to install oracle:
38
39
40
41

INTRODUCTION OF
MYSQL
Administrator MySQL is the world's most widely used open-source
relational database management system (RDBMS) that runs as a server
providing multiuser access to a number of databases, though SQLite
probably has more total embedded deployments. The SQL phrase stands
for Structured Query Language MySQL Administrator is a program for
performing administrative operations, such as configuring, monitoring
and starting and stopping a MySQL server, managing users and
connections, performing backups, and a number of other administrative
tasks. Most tasks can be performed using a command-line client such as
mysqladmin, or mysql, but MySQL Administrator has the following
advantages:
• Its graphical user interface makes it more intuitive.
• It provides a better overview of the settings that are crucial for the
performance, reliability, and security of your MySQL servers.
• It displays performance indicators graphically, thus making it easier to
determine and tune server settings. MySQL Administrator is designed to
work with MySQL versions 4.0 and higher.
MySQL Administrator is, to a large extent, the result of feedback received
from many users over a period of several years. There are so many
features of mysql some of them are:
• Cross-platform support
• Triggers
• Cursors
• Updatable views
• Independent storage engines
• Replication support
42

BACKUP
In information technology, a backup, or the process of backing up, refers
to the copying and archiving of computer data so it may be used to restore
the original after a data loss event. Backups have two distinct purposes.
The primary purpose is to recover data after its loss, be it by data deletion
or corruption. Data loss can be a common experience of computer users.
The secondary purpose of backups is to recover data from an earlier time,
according to a user-defined data retention policy, typically configured
within a backup application for how long copies of data are required.
Though backups popularly represent a simple form of disaster recovery,
since a backup system contains at least one copy of all data worth saving,
the data storage requirements can be significant. Organizing this storage
space and managing the backup process can be a complicated
undertaking. A data repository model can be used to provide structure to
the storage. Nowadays, there are many different types of data storage
devices that are useful for making backups. There are also many different
ways in which these devices can be arranged to provide geographic
redundancy, data security, and portability.
43

Step 1 :

Step 2:
44

Step 3:

Step 4:
45

RESTORE
In data management, restore is a process that involves copying backup
files from secondary storage (tape, zip disk or other backup media) to hard
disk. A restore is performed in order to return data to its original condition
if files have become damaged or to copy or move data to a new location.
One should backup one's wiki regularly, even if one never needs to restore
it: backups provide peace of mind. However, a backup is useless if one
cannot restore, and practice restoring a backup prevents later anguish.
Data Restore is the process of salvaging and handling the data through the
data from damaged, failed, corrupted, or inaccessible secondary storage
media when it cannot be accessed normally. Often the data are being
salvaged from storage media such as internal or external hard disk drives,
solid-state drives (SSD), USB flash drive, storage tapes, CDs, DVDs,
RAID, and other electronics. Recovery may be required due to physical
damage to the storage device or logical damage to the file system that
prevents it from being mounted by the host operating system (OS). The
most common data recovery scenario involves an operating system
failure, accidental damage etc. (typically on a single disk, single-partition,
single-OS system), in which case the goal is simply to copy all wanted
files to another disk
46

Step 1 :

Step 2 :
47

Step 3 :
48

INTRODUCTION OF
PHPMYADMIN
PhpMyAdmin is a free and open source tool written in PHP intended to
handle the administration of MySQL with the use of a web browser. It can
perform various tasks such as creating, modifying or deleting databases,
tables, fields or rows; executing SQL statements; or managing users and
permissions.
FEATURES OF PHPMYADMIN
• Web interface
• MySQL database management
• Import data from CSV and SQL
• Export data to various formats: CSV, SQL, XML, PDF, ISO/IEC 26300
– Open Document Text and Spreadsheet, Word, Excel, LaTeX and others
• Administering multiple servers
• Creating PDF graphics of the database layout
• Creating complex queries using Query-by-Example (QBE)
• Searching globally in a database or a subset of it
• Transforming stored data into any format using a set of predefined
functions, like displaying BLOB-data as image or download-link.
• Live charts to monitor MySQL server activity like connections,
processes, CPU/Memory usage, etc.
49

INSTALLATION OF
PHPMYADMIN
Steps to install phpmyadmin :
• Welcome window shown click next to install.
• Click on I agree to accept the license agreement.
• Now choose the location where you want to install.
• Now select the components and click next to processed.
• Now fill the information of apache HTTP server and click on next.
• Now configure the mysql server by enter the password root and then
click on install.
• Installation is absorbed.
• After Installation Create Database
50

Step 1:

Step 2 :
51

Step 3 :

Step 4 :
52

Step 5 :

Step 6 :
53

Step 7 :

Step 8 :
54

Step 9:

Step 10:
55

Database Migration
Data migration is the process of transferring data between storage types,
formats, or computer systems. It is a key consideration for any system
implementation, upgrade, or consolidation. Data migration is usually
performed programmatically to achieve an automated migration, freeing
up human resources from tedious tasks. Data migration occurs for a
variety of reasons, including: Server or storage equipment replacements
or upgrades; Website consolidation; Server maintenance; and Data center
relocation.

To achieve an effective data migration procedure, data on the old system


is mapped to the new system providing a design for data extraction and
data loading. The design relates old data formats to the new system's
formats and requirements. Programmatic data migration may involve
many phases but it minimally includes data extraction where data is read
from the old system and data loading where data is written to the new
system.

Categories
Data is stored on various media in files or databases, and is generated and
consumed by software applications which in turn support business
processes. The need to transfer and convert data can be driven by multiple
business requirements and the approach taken to the migration depends
on those requirements. Four major migration categories are proposed on
this basis.

Storage migration
A business may choose to rationalize the physical media to take advantage
of more efficient storage technologies. This will result in having to move
physical blocks of data from one tape or disk to another, often using
virtualization techniques. The data format and content itself will not
usually be changed in the process and can normally be achieved with
minimal or no impact to the layers above.
56

Database migration
Similarly, it may be necessary to move from one database vendor to
another, or to upgrade the version of database software being used. The
latter case is less likely to require a physical data migration, but this can
happen with major upgrades. In these cases a physical transformation
process may be required since the underlying data format can change
significantly.

Application migration

Changing application vendor – for instance a new CRM or ERP platform


– will inevitably involve substantial transformation as almost every
application or suite operates on its own specific data model. Further, to
allow the application to be sold to the widest possible market, commercial
off-the-shelf packages are generally configured for each customer using
metadata. Application programming interfaces (APIs) are supplied to
protect the integrity of the data they have to handle.

Business process migration


Business processes operate through a combination of human and
application systems actions, often orchestrated by business process
management tools. When these change they can require the movement
of data from one store, database or application to another to reflect the
changes to the organization and information about customers, products
and operations. Examples of such migration drivers are mergers and
acquisitions, business optimization and reorganization to attack new
markets or respond to competitive threat.
57

EXPORT AND IMPORT


You can import data that you get from other applications into your web
office database and export data from the database into other applications.
Importing copies existing data from a text file to your database; exporting
copies information from your database to a text file. Importing existing
data saves you the trouble of typing it in by hand. You may need to import
data only once, right before people start to use the database. For example,
if you create a Customer Relationship Management (CRM) database, you
could import existing customer information into it. You may also need to
regularly import data, for example, from a weekly sales report. Exporting
data allows you to use information from your database in another
application outside your web office. For example, you may want to export
data so that you can open it in Microsoft Excel® for charting or further
analysis. Exporting is also an easy way to create a local backup of the data
in your database. Import and Export file formats The Database application
imports data from and exports data to text files, using the two most
common text file formats:
IMPORT AND EXPORT FILE FORMATS
The Database application imports data from and exports data to text files,
using the two most common texts file formats:
Comma separated values (CSV)
In this format, commas separate the field values. The names of CSV files
usually end with the extension .CSV. Many software applications, like
Microsoft Excel®, open and save .CSV files.
Tab delimited
In this format, tabs separate the field values. The names of tab-delimited
files usually end with the extension .TXT. Many software applications,
like Excel and Microsoft.
58

EXPORTING A FILE
59
60
61

IMPORTING A FILE
62
63
64

PRIVILEGES
A privilege is a right to execute a particular type of SQL statement or to
access another user's object. Some examples of privileges include the right
to:
• Connect to the database (create a session)
• Create a table
• Select rows from another user's table
• Execute another user's stored procedure
You grant privileges to users so these users can accomplish tasks required
for their job. You should grant a privilege only to a user who absolutely
requires the privilege to accomplish necessary work. Excessive granting
of unnecessary privileges can compromise security.
A user can receive a privilege in two different ways:
Because roles allow for easier and better management of privileges, you
should normally grant privileges to roles and not to specific users. There
are two distinct categories of privileges:
• System privileges
• Schema object privileges
65

WORKBENCH
MySQL Workbench is a visual database design tool that integrates SQL
development, administration, database design, creation and maintenance
into a single integrated development environment for MySQL database
system. MySQL Workbench 5.0 and 5.1 are specialized visual database
design tools for the MySQL database. While MySQL Workbench 5.0 was
a MS Windows only product cross-platform support was added to
MySQL Workbench Starting with MySQL Workbench 5.2 the application
has evolved to a general database GUI application. Apart from physical
database modeling it features a SQL Editor, database migration tools, a
database server administration interface, replacing the old MySQL GUI.
Features of workbench
• Database Connection & Instance Management
• Schema objects browsing, inspection, and search
• Data modeling
• Reverse engineering from SQL Scripts and live database
• Forward engineering to SQL Scripts and live database Schema
synchronization printing of models
• Database administration
• Start and stop of database instances
• Instance configuration
• Database account management
• Instance variables browsing
• Performance monitoring
• Performance Schema metrics Installation of workbench.
66

Step 1:

Step 2:
67

Step 3:

Step 4:
68

Step 5:

Step 6:
69

Launch Workbench

Você também pode gostar