收藏 分销(赏)

配置和使用恢复管理器.ppt

上传人:可**** 文档编号:14786721 上传时间:2026-11-25 格式:PPT 页数:67 大小:2.19MB 下载积分:8 金币
下载 相关
配置和使用恢复管理器.ppt_第1页
第1页 / 共67页
配置和使用恢复管理器.ppt_第2页
第2页 / 共67页


点击查看更多>>
资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,PPT,文档演模板,Office,PPT,25 十一月 2026,配置和使用恢复管理器,Backup and Recovery:Review,The major backup and recoveryrelated topics covered in the Database Administration I Course are:,Types of failure that can happen,Statement,session,instance,media,and so on,How to configure,ARCHIVELOG,mode,How to automate backups,How to do incremental backups,How to perform and tune instance recovery,Serversession,Channel,Serversession,Enterprise Manager,Recovery Manager Components,Targetdatabase,Recoverycatalog database,Auxiliarydatabase,Disk,Flash recoveryarea,Channel,Channel,MML,Options,RecoveryManager(RMAN),Recovery Manager Components(notes only slide),Steps for Configuring RMAN,1.Determine the repository location:control file or recovery catalog.,2.Define database and environment variables.,3.Start RMAN and connect to the target and,optionally,the recovery catalog databases.,4.Configure persistent settings.,RMAN Repository Data Storage:Comparison of Options,Control file:,Simpler administration,Default,Recovery catalog:,Replicates control file data,Has room for more data,Can service many targets,Can store RMAN scripts,Metadata,Backup set list,Image copy list,.,.,.,RMAN Repository Data Storage:Comparison of Options(notes only slide),Backup Destinations,Backups can be written to:,Disk directory,Media Management Library(tape device),Typically used for disaster recovery,when disk backups are lost,Flash recovery area,This is a disk area set aside for backup and recovery and flashback database purposes.,You define the location and the size.,Files are automatically named by using Oracle Managed Files.,Files are automatically retained and deleted as necessary.,Media Management,Recovery Manager,Media management server software,Media management library,Serversession(channel),Oracle SecureBackup with,built-in MML,Or,Using a Flash Recovery Area with RMAN,You can configure RMAN to use the flash recovery area.,Database area,RMAN backupprocess,Flash recovery area,DB_RECOVERY_FILE_DEST=/u01/oracle/fra,DB_RECOVERY_FILE_DEST_SIZE=2G,Using a Flash Recovery Area with RMAN(notes only slide),Monitoring the Flash Recovery Areawith EM,Flash Recovery Area Space Usage,Configure the retention policy to the minimum value appropriate for your database.,Back up the archive log files regularly and delete the files upon completion of the backup.,Use the RMAN,REPORT,OBSOLETE,and,DELETE,OBSOLETE,commands to remove backups and file copies that are not required.,V$FLASH_RECOVERY_AREA_USAGE,You can query,V$FLASH_RECOVERY_AREA_USAGE,to view the flash recovery area disk space usage.,SQL SELECT file_type,2 percent_space_used AS used,3 percent_space_reclaimable AS reclaimable,4 number_of_files AS number,5 FROM,v$flash_recovery_area_usage,;,FILE_TYPE USED RECLAIMABLE FILES,-,V$FLASH_RECOVERY_AREA_USAGE,Output from the,V$FLASH_RECOVERY_AREA_USAGE,query,FILE_TYPE USED RECLAIMABLE FILES,-,CONTROLFILE 0 0 0,ONLINELOG 0 0 0,ARCHIVELOG 69.13 0 593,BACKUPPIECE 0 0 0,IMAGECOPY 0 0 0,FLASHBACKLOG 1.77 0 37,Backing Up the Flash Recovery Area,RMAN,BACKUP RECOVERY FILES;,Benefits of Using a Flash Recovery Area,Using the flash recovery area for recovery-related files:,Simplifies the location of database backups,Automatically manages the disk space allocated for recovery files,Does not require changes to existing scripts,Puts database backups,archive logs,and control file backups in the flash recovery area,Setting Parameters That Affect RMAN,Database initialization parameters,CONTROL_FILE_RECORD_KEEP_TIME,DB_RECOVERY_FILE_DEST,and,DB_RECOVERY_FILE_DEST_SIZE,if using the flash recovery area,Environment variables,NLS_DATE_FORMAT,NLS_LANG,Setting Parameters that Affect RMAN(notes only slide),RMAN Usage Considerations,Resources:Shared memory,more processes,Privileges given to users:,Database:,SYSDBA,Operating system:Access to devices,Remote operations:,Set up the password file,Ensure that the password file is backed up,Connection Types with RMAN,Targetdatabase,Recoverycatalog DB,Auxiliarydatabase,Recovery Manager,Starting RMAN,Starting RMAN locally,Starting RMAN remotely,UNIX:$ORACLE_SID=DB01;export ORACLE_SID$rman target/,rman target sys/passwordDB01,Windows NT:C:set ORACLE_SID=DB01,C:rman target/,Additional RMAN Command-Line Arguments,Writing RMAN output to a log file,Executing a command file when RMAN is invoked,Establishing database connections on RMAN startup,$rman TARGET sys/oracle CMDFILE=$HOME/scripts/my_rman_script.rcv,$rman TARGET sys/oracle LOG=$HOME/oradata/u03/rman.log APPEND,$rman TARGET SYS/sys_pwdorcl CATALOG rman/rmanrcat,Configuring RMAN Settings by Using EM,Control File Autobackups,RMAN CONFIGURE CONTROLFILE AUTOBACKUP ON;,Best practice:Oracle recommends that you enable control file autobackup.,Control File Autobackups(notes only page),A retention policy describes which backups will be kept and for how long.,There are two types of retention policies:,Recovery window,:Establishes a period of time within which point-in-time recovery must be possible,Redundancy,:Establishes a fixed number of backups that must be kept,These policies are mutually exclusive and can be set with the,CONFIGURE,command.,Retention Policies,Now,Seven-day retention,File1,File2,File2 needsto be backed up:,Retention Policies(notes only page),Managing Persistent Settings,Use the,SHOW,command to list current settings:,Use the,CLEAR,command to reset any persistent setting to its default value:,RMAN SHOW CONTROLFILE AUTOBACKUP FORMAT;,RMAN SHOW EXCLUDE;,RMAN SHOW ALL;,RMAN CONFIGURE BACKUP OPTIMIZATION CLEAR;,RMAN CONFIGURE MAXSETSIZE CLEAR;,RMAN CONFIGURE DEFAULT DEVICE TYPE CLEAR;,Channel Allocation,Channel(DISK),BACKUP,RESTORERECOVER,Server,session,Server,session,Targetdatabase,Channel(SBT),RMAN,Automatic and Manual Channel Allocation,An automatic channel is one that is preconfigured and used for subsequent commands.To change the default device type for automatic channel allocation,use:,A manually allocated channel is one that overrides the automatic channel setting.This channel overrides the automatic channel for this run block:,RMAN,CONFIGURE DEFAULT DEVICE TYPE TO sbt;,RMAN,RUN 2,ALLOCATE CHANNEL c1 DEVICE TYPE disk;3,BACKUP,DATAFILE,/u01/oradata/user01.dbf;4,Channel Control Options,Configure parallelism:,Specify the maximum backup piece size:,Format the name of generated backup files:,RMAN,CONFIGURE DEVICE TYPE DISK PARALLELISM 3;,RMAN,CONFIGURE CHANNEL DEVICE TYPE DISK,2,MAXPIECESIZE 2G;,RMAN,RUN,2,ALLOCATE CHANNEL d1 DEVICE TYPE DISK 3,FORMAT/disk1/backups/%U;,4,BACKUP DATABASE PLUS ARCHIVELOG;,Summary,In this lesson,you should have learned how to:,Use either the control file or a recovery catalog for the RMAN repository,Change RMAN default settings with,CONFIGURE,Use the flash recovery area for RMAN operations,Monitor the flash recovery area by using,v$,views and Enterprise Manager,Implement recovery window and redundancy retention policies,Implement manual and automatic channel allocation,Issuing Recovery Manager Commands,Interactive client,Enter commands at RMAN prompt.,Use when performing analysis,or when running reports or stored scripts.,Batch mode,Use with automated jobs.,Specify a command file when starting RMAN.,Specify the log file name to capture session log.,Pipe interface,Specify the,PIPE,command-line argument.,Use to communicate data between sessions or between RMAN and an external application.,Issuing Recovery Manager Commands,(notes only slide),Types of RMAN Commands,RMAN commands are of the following types:,Stand-alone command:,Is executed individually at the RMAN prompt,Cannot appear as subcommands within,RUN,Job command:,Must be within the braces of a,RUN,command,Is executed as a group,Some commands can be executed as either astand-alone or a job command.,Job Commands:Example,Job commands appear inside a,RUN,command block:,RMAN,RUN 2,BACKUP AS BACKUPSET 3,FORMAT/u01/db01/backup/%d_%s_%p 4 DURATION 10:00 MINIMIZE LOAD,5,(DATABASE);,6,SQL,alter system archive log current;7,RMAN Commands:Overview,Targetdatabase,REPORT,LIST,Catalog database,Enterprise Manager,RESTORE,RECOVER,FLASHBACK,SPFILE,BACKUP,Controlfile,Archivedlog files,RMAN,Catalog maintenance,CROSSCHECK,DELETEEXPIRED,CHANGE,Storedscripts,RMAN Command Overview(notes only slide),BACKUP,Command,RMAN BACKUP AS BACKUPSET 2 FORMAT/BACKUP/df_%d_%s_%p.bus 3 TABLESPACE hr_data;,Backupset,Data file 1,Data file 2,Data file 3,Data file 1,Data file 2,Data file 3,Tablespace,HR_DATA,Commands,BACKUP,Block C.T.,Inc.Update,LIST,REPORT,DELETE,Backup Constraints,The database must be mounted or open.,You cannot back up online redo logs.,Only“clean”backups are usable in,NOARCHIVELOG,mode.,Only“current”data file backups are usable in,ARCHIVELOG,mode.,Parallelization of Backup Sets,For performance,allocate multiple channels and assign files to specific channels.,Data file 4,Data file 1,Data file 5,Channel,MML,Backuppiece 1,Backuppiece 2,Data file 2,Data file 3,Data file 9,Channel,MML,Data file 6,Data file 7,Data file 8,BackupPiece 3,Channel,MML,Compressed Backups,RMAN BACKUP AS 2 COMPRESSED BACKUPSET,3 DATABASE;,RMAN CONFIGURE DEVICE TYPE 2 DISK PARALLELISM 2 3 BACKUP TYPE TO,4 COMPRESSED BACKUPSET;,Compressed backup files,Database files,Image Copy,Copy of data file 3,Copy of archived log,Data file 3,Archivedlog file,Data file 3,Archivedlog file,RMAN BACKUP AS COPY 2 DATAFILE/ORADATA/users_01_db01.dbf 3 FORMAT/BACKUP/users01.dbf;RMAN BACKUP AS COPY,4 ARCHIVELOG LIKE arch_1060.arc 5 FORMAT arch_1060.bak;,Tags for Backups and Image Copies,A tag is a logical name assigned to a backup set or image copy.,month_full_backup,week_full_backup,Data file 3,Data file 4,Backup set,Data files 1,3,Data files 2,4,Backup set,BACKUP,Command Options,Check for physical block corruptions.,Scan for logical corruptions and physical corruptions.,Set a threshold on the number of detected corruptions allowed before aborting.,Validate the target input files before performing a backup operation.,Duplex the backup set.,Overwrite an existing backup set or image copy.,Pass control of the data transfer between storage devices and the data files on disk to the media management layer.,Encrypt the backup files.,Backing Up Archived Redo Logs,Online redo log file switch is automatic.,Archived log failover is performed.,You can specify a range of archived redo logs to back up.,Backup sets of archived redo log files cannot contain any other type of file.,RMAN BACKUP,2 FORMAT/disk1/backup/ar_%t_%s_%p,3 ARCHIVELOG FROM SEQUENCE=234,4 DELETE INPUT;,Backing Up Archived Redo Logs(notes only slide),Whole Database Backup,RMAN,BACKUP DATABASE PLUS ARCHIVELOG;,Archived log file copies,SPFILE,Controlfile,Data file copies,RMAN Backup Types,A,full backup,contains all used data file blocks.,A,level 0 incremental backup,is equivalent to a full backup that has been marked as level 0.,A,cumulative level 1 incremental backup,contains only blocks modified since thelast level 0 incremental backup.,A,differential level 1 incremental backup,contains only blocks modified since the last incremental backup.,Differential,incremental backup,Cumulative,incremental backup,Full,or level 0incremental backup,Differential Versus Cumulative,A differential incremental backup contains all blocks changed since the last incremental backup.,A cumulative incremental backup contains all blocks changed since the last level 0 incremental backup.,Lvl,Day,Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun,Level 0,Level 0,1,1,1c,1,1,0,0,1c,Block Change Tracking,The backup process can be streamlined by enabling block change tracking,which:,Records changed blocks in a change tracking file,Is used automatically by RMAN,if enabled,Optimizes incremental backups by avoiding full data file scans during backup,List of changed blocks,Redogeneration,Redo log,1011001010110,0001110100101,1010101110011,Change,trackingfile,SGA,CTWR,Commands,BACKUP,Block C.T.,Inc.Update,LIST,REPORT,DELETE,Enabling Block Change Tracking,SQL ALTER DATABASE ENABLE,2 BLOCK CHANGE TRACKING 3 USING FILE/mydir/rman_change_track.f 4 REUSE;,Incrementally UpdatingBackups,Incremental backup files,Recovered data file,Image copyof data file,Image copy of data file updated to a more recent state,RMAN RECOVER COPY OF 2 DATAFILE,n,|,file_name,3 WITH TAG incr_upd_df1;,Commands,BACKUP,Block C.T.,Inc.Update,LIST,REPORT,DELETE,LIST,Command,List backup sets and copies of data files:,List backup sets and copies of any data file for a specified tablespace:,List backup sets and copies containing archive logs for a specified range:,RMAN LIST BACKUP OF DATAFILE,2 /db01/ORADATA/u03/users01.dbf;,RMAN LIST BACKUP OF DATABASE;,RMAN LIST COPY OF TABLESPACE SYSTEM;,RMAN LIST COPY OF DATABASE ARCHIVELOG 2 FROM TIME=SYSDATE-7;,Commands,BACKUP,Block C.T.,Inc.Update,LIST,REPORT,DELETE,REPORT,Command,Produces a detailed analysis of the repository,Produces reports to answer:,What are the data files in the database?,Which files need a backup?,Which backups can be deleted?,Which files are unrecoverable?,Commands,BACKUP,Block C.T.,Inc.Update,LIST,REPORT,DELETE,REPORT,NEED,BACKUP,Command,Lists all data files that require a backup,Assumes that the most recent backup is used during a restore,Provides four options:,Incremental,Days,Redundancy,Recovery window,Uses the current retention policy configuration if no options are specified,REPORT,NEED,BACKUP,:Examples,Files that need more than three incremental backups for recovery:,Files that have not been backed up for three days:,Backup needed if there are not two or more backups already:,Backup needed to recover to three days ago:,RMAN REPORT NEED BACKUP days 3;,RMAN REPORT NEED BACKUP incremental 3;,RMAN REPORT NEED BACKUP redundancy 2;,RMAN REPORT NEED BACKUP,2 recovery window of 3 days;,REPORT,OBSOLETE,and,DELETE,OBSOLETE,Find all recovery files that are deemed obsolete according to the current retention policy settings:,List the obsolete recovery files,if no more than two backup copies are needed:,Delete the backup set with a backup set key of 4:,Delete the recovery files considered obsolete,because they have more than two backups:,RMAN REPORT OBSOLETE REDUNDANCY 2;,RMAN REPORT OBSOLETE;,RMAN DELETE BACKUPSET 4;,RMAN DELETE OBSOLETE REDUNDANCY 2;,Commands,BACKUP,Block C.T.,Inc.Update,LIST,REPORT,DELETE,Managing Backups with EM,Navigation aid:Database home page Maintenance Manage Current Backups,RMAN Dynamic Views,V$ARCHIVED_LOG,V$BACKUP_CORRUPTION,V$BACKUP_DEVICE,V$BACKUP_FILES,V$BACKUP_PIECE,V$BACKUP_REDOLOG,V$BACKUP_SET,V$BACKUP_SPFILE,V$COPY_CORRUPTION,V$RMAN_CONFIGURATION,
展开阅读全文

开通  VIP、SVIP  下载更划算
下载10份以上建议开通 VIP 会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        关注我们

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服