Sie sind auf Seite 1von 7

Data and information are as important for an organization as blood in human body .

In case data and information become unavailable due to any reason, all the wor king of the organization stops and it becomes unmanageable loss. In order to avo id such big loss, Database Administrator (DBA) must take backup of his database frequently according to the nature of the database. Normally full backup are don e after one week but incremental backup are done on daily basis. Backup can be d efined as second copy of original database produced by backup facilities provide d by DBMS or operating system. This second copy or saved copy of original databa se is produced on separate storage media such as magnetic tape, external hard di sk and on CD-drives. These should be placed in a separate and secure location, w here unauthorized persons do not have any access. The best way, you can store yo ur database backup online using Internet and you can access this backup any time , from any location using Internet. There are two important types of backup. Hot Backup You can say hot backup is dynamic or active backup. Hot backup is taken when dat abase is running and data is being updated, added, or read by its users but does n't handle running transactions. Only database management system (DBMS) facility can be used to take hot backups. Make sure that hot backups should only be done during low working hours. Hot backup is taken in environments where database ne eds to remain online 24-hours a days and 7-days a week, because they do not requ ire downtime as in cold backup. Cold Backup Cold backup is taken when database is offline, not accessible for updating and u sers cannot do anything on the database.. DBMS as well as operating system faci lities can be used to take the cold backup. Normally, cold backup is taken at th e end of a working day or at weekends when database comes offline. Cold backup i s suitable in environments where database is not running 24-hours a day. Instead , there are sometime intervals when it remains off. Backups can be taken manually through the DBA or these can be taken automaticall y by configuring the DBMS. In case of automatic backups, you must specify day, t ime, and location on storage media where DBMS will take the backups. These setti ngs are required when configuring the DBMS

Phases in Database Development Life Cycle: The database development process comprises a series of phases. The major phases in information engineering are: Planning Analysis Design DBMS Selection Implementation Maintenance Database planning The database-planning phase begins when a customer requests to develop a databas e project. It is set of tasks or activities, which decide the resources required in the database development and time limits of different activities. During pla nning phase, four major activities are performed. Review and approve the database project request. Prioritize the database project request. Allocate resources such as money, people and tools.

Arrange a development team to develop the database project. Database planning should also include the development of standards that govern h ow data will be collected, how the format should be specified, what necessary do cumentation will be needed. Requirements Analysis Requirements analysis is done in order to understand the problem, which is to be solved. It is very important activity for the development of database system. T he person responsible for the requirements analysis is often called "Analyst". In requirements analysis phase, the requirements and expectations of the users a re collected and analyzed. The collected requirements help to understand the sys tem that does not yet exist. There are two major activities in requirements anal ysis. Problem understanding or analysis Requirement specifications. Design The database design is the major phase of information engineering. In this phase , the information models that were developed during analysis are used to design a conceptual schema for the database and to design transaction and application. In conceptual schema design, the data requirements collected in Requirement Anal ysis phase are examined and a conceptual database schema is produced. In transaction and application design, the database applications analyzed in Req uirement Analysis phase are examined and specifications of these applications ar e produced. There are two major steps in design phase: Database Design Process Design DBMS In this phase an appropriate DBMS is selected to support the information system. A number of factors are involved in DBMS selection. They may be technical and e conomical factors. The technical factors are concerned with the suitability of t he DBMS for information system. The following technical factors are considered. Type of DBMS such as relational, object-oriented etc Storage structure and access methods that the DBMS supports. User and programmer interfaces available. Type of query languages. Development tools etc. Implementation After the design phase and selecting a suitable DBMS, the database system is imp lemented. The purpose of this phase is to construct and install the information system according to the plan and design as described in previous phases. Impleme ntation involves a series of steps leading to operational information system tha t includes creating database definitions (such as tables, indexes etc), developi ng applications, testing the system, developing operational procedures and docum entation, training the users and populating the database. In the context of info rmation engineering, it involves two steps. Database definitions. Creating applications.

Operational Maintenance Once the database system is implemented, the operational maintenance phase of th e database system begins. The operational maintenance is the process of monitori ng and maintaining the database system. Maintenance includes activities such as adding new fields, changing the size of existing field, adding new tables, and s o on. As the database system requirement change, it becomes necessary to add new tables or remove existing tables and to reorganize some files by changing prima ry access methods or by dropping old indexes and constructing new ones. Some que ries or transactions may be rewritten for better performance. Database tuning or reorganization continues throughout the life of database and while the requirem ents keep changing.

How to Recover Dropped Tablespace Oracle Ver: 10gr1/Win 2003 Backup Method: User Managed (hot Bkp) SQL> conn sys/oracle as sysdbaConnected. SQL> alter database begin backup; Database altered. SQL> ---copy all datafiles to bkp location SQL> alter database end backup; Database altered. SQL> alter system switch logfile; System altered. SQL> alter database backup controlfile to 'd:\bkp\control01.ctl'; Database altered. SQL> drop tablespace test including contents and datafiles; Tablespace dropped. SQL> ---oops by mistake drop production tablespace SQL> conn scott/tiger Connected. SQL> select count(*) from a; select count(*) from a * ERROR at line 1: ORA-00942: table or view does not exist SQL> conn sys/oracle as sysdba Connected. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> ---delete all datafiles & controlfile. SQL> startup nomount; ORACLE instance started.

Total System Global Area 293601280 bytes Fixed Size 789100 bytes Variable Size 94631316 bytes Database Buffers 197132288 bytes Redo Buffers 1048576 bytes SQL> --restore controlfile from bkp SQL> alter database mount; Database altered. SQL> --restore all datafiles from bkp SQL> --now perform time based recovery. SQL> --check ALERT.LOG file for exact time when tablespace was dropped. SQL> --perform TIME BASED recovery just before dropped tablespace. SQL> recover database using backup controlfile UNTIL TIME '2008-03-25 08:47:00'; ORA-00279: change 461791 generated at 03/25/2008 08:43:31 needed for thread 1 ORA-00289: suggestion :D:\ORACLE\PRODUCT\10.1.0\DB_1\RDBMS\ARC00002_0650232706.0 01 ORA-00280: change 461791 for thread 1 is in sequence #2 Specify log: {=suggested filename AUTO CANCEL} auto ORA-00279: change 461827 generated at 03/25/2008 08:44:45 needed for thread 1 ORA-00289: suggestion :D:\ORACLE\PRODUCT\10.1.0\DB_1\RDBMS\ARC00003_0650232706.0 01 ORA-00280: change 461827 for thread 1 is in sequence #3 ORA-00278: log file'D:\ORACLE\PRODUCT\10.1.0\DB_1\RDBMS\ARC00002_0650232706.001' no longer needed for this recovery ORA-00308: cannot open archived log'D:\ORACLE\PRODUCT\10.1.0\DB_1\RDBMS\ARC00003 _0650232706.001' ORA-27041: unable to open fileOSD-04002: unable to open file O/S-Error: (OS 2) The system cannot find the file specified. SQL> --Open database with RESETLOGS SQL> alter database open resetlogs; Database altered. SQL> --now check dropped tablespace is exist SQL> select name from v$datafile where name like '%TEST%'; NAME -------------------------------------------------------------------------------D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\TEST01.DBF SQL> conn scott/tiger Connected. SQL> select count(*) from a; COUNT(*) ---------10000 =======================================================

Oracle 10gr1/Win2003 Backup Method: RMAN C:\>rman target sys Recovery Manager: Release 10.1.0.5.0 - Production Copyright (c) 1995, 2004, Oracle. All rights reserved. target database Password: connected to target database: ORCL (DBID=1178009698) RMAN> run 2> { 3> backup database plus archivelog; 4> backup current controlfile; 5> } Starting backup at 25-MAR-08 current log archived using target database controlfile instead of recovery catal og ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00001 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBF input datafile fno=00003 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSAUX01.DBF input datafile fno=00002 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\UNDOTBS01.DB F input datafile fno=00005 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\TEST01.DBF input datafile fno=00004 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBF channel ORA_DISK_1: starting piece 1 at 25-MAR-08 channel ORA_DISK_1: finished piece 1 at 25-MAR-08 piece handle=D:\ORACLE\PRODUCT\10.1.0\DB_1\DATABASE\0BJC4UJ5_1_1 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset including current controlfile in backupsetincluding current SPFILE in backupset channel ORA_DISK_1: starting piece 1 at 25-MAR-08 channel ORA_DISK_1: finished piece 1 at 25-MAR-08 piece handle=D:\ORACLE\PRODUCT\10.1.0\DB_1\DATABASE\0CJC4UJK_1_1 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Finished backup at 25-MAR-08 SQL> conn sys/oracle as sysdba Connected. SQL> drop tablespace test including contents and datafiles; Tablespace dropped. SQL> ---oops dropped production tablespace SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. C:\>REM delete all controlfile and datafiles C:\>rman target sys/oracle Recovery Manager: Release 10.1.0.5.0 - Production Copyright (c) 1995, 2004, Oracle. All rights reserved. connected to target database (not started)

RMAN> startup nomount; Oracle instance started Total System Global Area 293601280 bytes Fixed Size 789100 bytes Variable Size 94631316 bytes Database Buffers 197132288 bytes Redo Buffers 1048576 bytes NOTE: restore controlfile from backupset. RMAN> restore controlfile from 'D:\oracle\product\10.1.0\Db_1\database\0CJC4UJK_ 1_1'; Starting restore at 25-MAR-08 allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=160 devtype=DISK channel ORA_DISK_1: restoring controlfile channel ORA_DISK_1: restore complete output filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL01.CTL output filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL02.CTL output filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL03.CTL Finished restore at 25-MAR-08 RMAN> alter database mount; database mounted released channel: ORA_DISK_1 RMAN> run 2> { 3> set UNTIL TIME "to_date('2008-03-25 09:19:44','YYYY-MM-DD HH24:MI:SS')"; 4> restore database; 5> recover database; 6> } executing command: SET until clause Starting restore at 25-MAR-08 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=160 devtype=DISK channel ORA_DISK_1: starting datafile backupset restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00001 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBF restoring datafile 00002 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\UNDOTBS01.DBF restoring datafile 00003 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSAUX01.DBF

restoring datafile 00004 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBF restoring datafile 00005 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\TEST01.DBF channel ORA_DISK_1: restored backup piece 1 piece handle=D:\ORACLE\PRODUCT\10.1.0\DB_1\DATABASE\0BJC4UJ5_1_1 tag=TAG20080325 T091205 channel ORA_DISK_1: restore complete Finished restore at 25-MAR-08 Starting recover at 25-MAR-08using channel ORA_DISK_1 starting media recovery archive log thread 1 sequence 2 is already on disk as file D:\ORACLE\PRODUCT\10. 1.0\ORADATA\ORCL\REDO01.LOG archive log thread 1 sequence 3 is already on disk as file D:\ORACLE\PRODUCT\10. 1.0\ORADATA\ORCL\REDO02.LOG archive log filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\REDO01.LOG thread=1 s equence=2 archive log filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\REDO02.LOG thread=1 s equence=3 media recovery complete Finished recover at 25-MAR-08 RMAN> alter database open resetlogs; database opened NOTE: 1. I am using Controlfile Instead of Recovery catalog for RMAN repository 2. Don't use AUTOBACKUP controlfile option becuase we need backup controlfile fo r incomplete recovery not current controlfile.

Das könnte Ihnen auch gefallen