17
DATABASE ADMINISTRATOR BACKUP AND RESTORE Presented By Nitil Dwivedi (09BIF094) External Guide Mr. Abhishek Sainani DBA at Capital IQ,Hyderabad Internal Guide Dr. Punnagai Munusami Assistant Professor(SBST)

External Guide Mr. Abhishek Sainani DBA at Capital IQ,Hyderabad

  • Upload
    july

  • View
    23

  • Download
    3

Embed Size (px)

DESCRIPTION

DATABASE ADMINISTRATOR BACKUP AND RESTORE Presented By Nitil Dwivedi (09BIF094). External Guide Mr. Abhishek Sainani DBA at Capital IQ,Hyderabad. Internal Guide Dr. Punnagai Munusami - PowerPoint PPT Presentation

Citation preview

Page 1: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

DATABASE ADMINISTRATOR BACKUP AND RESTORE

Presented By Nitil Dwivedi

(09BIF094)

External Guide

Mr. Abhishek Sainani

DBA at Capital IQ,Hyderabad

Internal Guide

Dr. Punnagai Munusami

Assistant Professor(SBST)

Page 2: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

INTRODUCTION Backup and Restore

A copy of data that can be used to restore and recover the data is called a backup. Backups let

us restore data after a failure. With good backups, we can recover from many failures, such as:

Media failure. User errors, for example, dropping a table by mistake. Hardware failures, for example, a damaged disk drive

or permanent loss of a server. Natural disasters.

3 types of Backup:

1-Full Backup

2- Differential Backup

3-Transaction log Backup

Page 3: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Stored Procedure

A stored procedure is a group of SQL statements compiled into a single execution plan.

To begin writing stored procedures, the following are essential:

A database management system. A database built inside the database management

system. A text editor, such as Notepad or Query Analyzer

Syntax for creating the procedure:

create proc Procedure_name As

SQL statement1;…statement2;..statement3;…..;

Page 4: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Script Generation

A SQL script can contain one or more SQL statements or PL/SQL blocks.When using SQL Scripts, remember the following:

Scipt can be generated for any number of tables present in database.

There is no interaction between SQL Commands and SQL Scripts.

We can cut and paste a SQL command from the SQL Script editor to run it in SQL QUERY Browser.

Page 5: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

E-R Diagram

Page 6: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

SOFTWARE DETAILS1.Database Management Systems(DBMS)2. SQL (Structured Query Language)3. MySQL 5.1 Server4. HTML(Hyper Text Markup Language)5.MsSQL 2008 Server6.CSS(Cascading Style Sheets)7. Java server page8. NETBEANS 6.89.JDK(java development kit)

Page 7: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

1.Do background research for that we need to refer the different articles and tutorials. 2. Create a database(OLSED) -Using Database Management System methods on MySQL 5.1 and MsSQL 2008.3. Create 5 tables named Using SQL•adminlog•adminproduct•cusinfo•cuslog•Payment4.Insert informations in tables.

Methodology

Page 8: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

5.Take Backup of database and save it at specific location.6. Backup may be used to restore the original from the specific location after a data loss event.8.Create procedure for database Backup and Restore.9.Script generation for disaster recovery.10.Create Java Server Pages for the web creation.11. Create a link between the database and JSP usingClass.forName("com.mysql.jdbc.Driver").newInstance();.12. Display the matter on the web page using HTML,CSS.13. The web page is ready to upload.

Page 9: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Flowchart

Page 10: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Now we can use DBMS(Database management System) to make Database and tables inside it. We can also fetch data from

tables :

Creating a Database:

Create Database <Database name>;

for example:

Create Database OLSED;

Creating a table:

Create Table <Table Name>

(<Field 1> <Data Type> <Width>,

<Field 2> <Data Type> <Width>,

…………………………………..);

Inserting into Table:

Insert into <Table Name> Values(“Value1”,”Value2”,…….);

Fetching data from table:

Select * from <Table Name> where <condition>;

For Example:

SELECT * FROM adminlog a;

Database Creation

Page 11: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Database requirements Different types of information is provided regarding in the database(OLSED) Adminlog

Create table adminlog ( admin_name(45) primary key,admin_password(45); Adminproduct

Create table adminproduct (product_name varchar(45) primary key,company_name not null,dateof_entry not null,dateof_exit not null, price varchar(10) not null);

Cusinfo

Create table cusinfo(username varchar(50) primary key,name not null,row char(45) not null,age not null,occupation char(10) not null,city varchar(max) not null,state char(45)), country char(45));

Cuslog

Create table cuslog(username varchar(50) primary key,password varchar(45) not null);

Payment

Create table payment(username varchar(45) primary key,mode_of_payment varchar(50) Not Null,bank_name char(45),account_no int(45) Not Null,amount int(45) Not Null);

Page 12: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Java Server Page creation

Connect mySQL with netbeans 6.8 using

Class.forName method():

Class.forName("com.mysql.jdbc.Driver");

Connectioncon=DriverManager.getConnection("jdbc:mysql://localhost:3306/olsed","root","root");

This line loads the specified jdbc driver class and creates an instance of the same and returns it when we load database drives using Class.forName() to add them to the known drivers list of DriverManager.

Page 13: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Result and Discussions

Backup,Restore and ProcedureThe resultant database is really helpful for administration.Backup, Retore and procedure creation shows the best examlpe for database administration.

create proc backuprestore AsBACKUP DATABASE olsed TO DISK='c:\olsed.bak‘;RESTORE DATABASE olsed FROM DISK='c:\olsed.bak‘;exec backuprestore;

 

Page 14: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Website

Created database is used in web creation for online shopping where products are available like laptops,mobiles,books,fax machine,printer,desktop,camera,scanner and accessories are hard disk,head phones,mother board,processor,ram,pen drive,LCD screen.ups,cortage DVD Drive etc.

Page 15: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Home page of WEB

Page 16: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

References1. NovaBACKUP Professional / Server / Business EssentialsLast | published on Updated: Feb 11, 2013

2. John Charles Olamendy in Articles | SQL Server 2012 | published on February 25, 2008

3. Ravi Saive Under: CentOS, Fedora, Linux Commands, Linux Distros, MySQL, RedHat, Ubuntu | published On: November 2, 2012

4. NovaBACKUP Professional / Server / Business EssentialsLast | published on Updated: Feb 11, 2013

5. Jennifer Schiff | Published on: 14-Dec-10

6. Bill Graziano | published on 12 February 2007

Page 17: External Guide Mr.  Abhishek Sainani DBA at Capital  IQ,Hyderabad

Thank You