Professional Documents
Culture Documents
Data Protection
Data
Protection
Logical
backups
Physical
backups
A backup is a copy
Data Protection
Media Failures
User Errors
Application Errors
Data Preservation
Data preservation is
related to data
protection, but
serves a different
purpose.
DATA
Data Transfer
In some situations you may need to take a backup of a database
or database component and move it to another location.
From
To
Recovery Solutions
Recovery Manager (RMAN)
User-manage
Recovery Manager
Database Backups
Cu trc chnh
RMAN executable
Server processes
Channels
Target database
Revover catalog database (optional)
Media management layer (optional)
Backups, backup sets, and backup pieces
RMAN executable
L chng trnh qun l tt c ton t sao lu v phc hi.
Server processes
RMAN server processes l nhng x l nn, bt u trn server, s dng lin
Channels
Kiu thit b vo/ra ang c hay ghi l a cng hay bng t
S tin trnh ang ng thi truy cp vo mt thit b vo/ra
Kch c ln nht ca file c to trn thit b vo/ra
Tc ln nht v cc file c s d liu c c
S lng ln nht cc file c m ti mt thi im
Target database
L database m RMAN thc hin vic sao lu, phc hi v recovery.
S hu cc datafiles, control files v archived redo files cn sao lu, phc hi
hay recovered.
Xa b backup li thi
Chy lnh sau lit k tt c cc backupset li thi:
RMAN>
REPORT OBSOLETE;
xa backupset li thi dung lnh sau:
RMAN> DELTE OBSOLETE;
Mt file control
Bc 1: Shutdown database
RMAN>
shutdown immediate
Bc 2: Start database trong mode nomount
RMAN> startup nomount
Bc 3: Khi phc control file t backup set trong trng hp khng mun thay i v tr
t control file
RMAN> restore controlfile from autobackup;
Trong trng hp mun thay i v tr t control file, dung lnh
RMAN> restore controlfile to /new_control_file_location
new_control_file_location: ng dn ch n th mc cha cc control file mi c
khi phc
Mt file control
Bc 4: Hiu chnh file initSID.ora tham s control_files ch n v tr mi ca
control file.
Bc 5: i database v mode mount
RMAN> sql alter database mount;
Bc 7: Khi phc li database
RMAN> recover database;
Bc 8: i database v mode open
RMAN> sql alter database open resetlogs;
Mt data file
Bc 1: Start database nhn bit data file b hng.
Bc 2: Shutdown database v start database li trong mode momount
RMAN>
shutdown immediate;
RMAN> startup nomount;
Bc 3: Phc hi data file b hng t backup set
RMAN> restore datafile corrupted_data_file_name_path;
corrupted_data_file_name_path: ng dn ch n file data file b hng.
Mt data file
Bc 4: i database v mode mount
RMAN>
Mt tt c data file
Bc 1: Start database nhn bit nhng data file b hng.
Bc 2: Shutdown database v start database li trong mode nomount.
RMAN>
shutdown immediate;
RMAN> startup nomount;
Bc 3: Phc hi tt c data file b hng t backup set.
RMAN> restore database;
Bc 4: i database v mode mount
RMAN> sql alter database mount;
Bc 5: Khi phc tt c cc data file b hng v s dng tt c archivelog file.
RMAN> recover database;
Bc 6: i database v mode open
Ni dung :
Truy vn V$ ly thng tin sao lu
Sao lu tablespace v data file
Sao lu control file
Sao lu Archive Redo Log
Lu tr trn cc Raw Device
- Kt qu :
Nu ct Status hin th tnh trng l NOT ACTIVE tc l file ang khng trong backup mode, ta cn phi chy
cc cu lnh ALTER TABLESPACE BEGIN BACKUP hoc ALTER DATABASE BEGIN BACKUP
ACTIVE n.
users tablespace.
nh du cho vic bt u ca online tablespace backup (nu backup nhiu d liu cng lc th khng tn tablespace)
V d :
SELECT THREAD#,SEQUENCE#,NAME
FROM V$ARCHIVED_LOG;
Back up mt bn copy ca mi chui log s dng cc ng dng ca H iu
Hnh . V d sau backs up tt c cc log vo a:
% cp $ORACLE_HOME/oracle/trgt/arch/* /disk2/backup/arch
thng tp tin Windows, ngoi tr vic bn nn s dng tin ch Oracle OCOPY hn l copy.exe Windows cung cp hay cc
tin ch ntbackup.exe
ocopy from_file [to_file [a | size_1 [size_n]]]
ocopy -b from_file to_drive
ocopy -r from_drive to_dir
V d :
Oracle
Flashback
Tnh nng
mt hoc nhiu bng trong mt khong thi gian quy nh . ngoi ra, cng c
th ly siu d liu v cc phin bn khc nhau ca cc hng , bao gm thi
gian bt u v kt thc, cc thao tc, v ID m to ra cc phin bn . Bn c
th s dng tnh nng ny phc hi d liu b mt gi tr v kim ton thay
i cc bng truy vn.
Flashback Database
mc vt l , c s d liu Oracle Flashback cung cp bo v d liu thay th
Flashback Database
Flashback Database s dng flashback logs truy cp vo phin bn trc
Flashback Database
Oracle Database cng h tr cc im khi phc cng vi Flashback Database