041224

xiaoxiao2021-03-06  40

Rman

Connect Target Sys / Test

Configure Default Device Type To Disk

Show Default Device Type;

// Set the parallelism while starting 3 Server ProcessConfigure Device Type Disk Parallelism 3;

Show device type;

Configure Channel Device Type Disk Format 'D: / BACKUP / RMAN /% U';

Configure Channel Device Type Disk Maxpiecesize 50M;

Configure Channel Device Type Disk Format 'D: / Backup / RMAN /% U'2> Maxpiecesize 50M;

SHOW CHANNEL;

SHOW ALL;

V $ INSTANCE V $ DATABASEV $ DATAFILE V $ ControlFilev $ logfile dba_data_files

If the Hot Standby v $ backup fails (e.g., when the backup instance failure) Query v $ backup to check backup statusIssue the alter database command to changethe status and unfreeze the headeralter database datafile '' end backup;

Or Use this command in Oracle9ialter Database End Backup;

JOINSELECT T.NAME, D.FILE #, D.NameFrom V $ TABLESPACE T JOIN V $ DATAFILE D Using (TS #);

// binary imageal authentic Database backup control1.bkp '; // text trace filealter Database Backup ControlFile to TRACE DITABASE BACKUP ControlFile To TRACE

Backup sets logic concept Every backup set must be the same blocksizebackup piece a file, physical file

Run {Allocate Channel T1 Type 'sbt'maxpiecesize = 4GBACKUP Format' DF_% T_% S_% P 'FilesPerset 3 {TABLESPACE};

'Sbt' tape drive maxpiecesize = 4G Each PIECE maximum 4GFormat 'DF_% T_% S_% P'% T Time Stamp% S Backup Set% P Backup DiagramPerset Each Backup Set (Backup SET) contains how many data files Fileset 3DataFiles Per SET Each Backup Set 3 data files such as 6 data files then 2 backup sets such as 7 data files, 3 Backup Set

Rman> backup format '/backup/df_%D_%S_%p.bus' database filespers = 2;

Put the almost size file in a backup set, so you can support the stream.

Select * from v $ archived_log where deleded = 'no';

Image CopyRman> Copy DataFile '' to ''; Rman> Copy ArchiveLog '' to ''; Backup ArchiveLog All Delete All Input; To be set

Making Incremental Backups1.Full backups contain all datafile blocks2.Differential incremental backups contain only modified blocks from level n or lower back up the data since a lower-level or n-level backup from the variations

The level of increment is 0-4

Automatic Backup Control File Configure ControlFile Autoback = On (Server Parameter File). EXPLICITLY BACKED UP WITH BACKUP SPFILERMAN> Backup Copies 2 Device Type SBT SPFILE; back up the parameter file two images and back up it on the tape drive. S

Found when v $ archived_log be archived, deleted, an existing archive file v $ Huai block v $ copy_corruption image backup when backup backup_corruption find a backup set Huai block v $ database_block_corruptionv $ backup_datafilev $ backup_redologv $ backup_setv $ backup_piece

Monitor RMAN Backup Use the set command ID command in the RMAN backup to make it easy to confirm that the process is confirmed in the V $ Process and V $ SESSION views that belong to the RMAN backup. V $ SESSION_LOGOPS view, monitor the progress of RMAN backup

Rman> show controlfile autobackup; View the status of the control file Auto Backup Configure ControlFile Autobackup Off; #default

Rman> Configure ControlFile Autobackup ON;

Media RecoveryRecovery Stes1.Restored DataFiles2.redo Applied3.Database Containing Committed and Uncommitted Transactions4.undo Applied5.Recovered Database

Determining Which Files Need Recoveryv $ Recover_File Which DataFiles NEED Recoveryv $ Recovery_log a list of all archived redo log files required for recovery.v $ archived_log

Recover a mounted DatabaseRecover Database / Recover DataFile '/ N;

recover an open databaserecover tablespace users / recover datafile '' / n; User-Managed Procedures for Restoring Datafiles to a New Location1 Use operating system commands to restore the file to the new location Note:.. In the UNIX environment, the files must exist in the new location before you issue the ALTER DATABASE RENAME command. This is not the case in a Windows environment. 2. Start up the instance and mount the database.3. Use the ALTER DATABASE command to update the control file with the new file Name or Location: SQL> ALTER DATABASE RENAME FILE 2> '/ OraData/u03/USERS01.DBF' 3> To '/oradata/u04/Users01.dbf';

Recover Database Using Backup ControlFile; To restore the database, but do not have an online redolog file

Re-Creating Lost Datafiles Without BackupDescription of missing datafile is still in datadictionary and control file.sql> alter database create datafile 'filename'; Re-create the datafile with a different filenamesql> alter database create datafile 'filename' as' new file name "

Recovery without a Backup:.. ExampleDatafile 4 (on disk 1) is lost When restoring the datafile from tape, you receive an error indicating that the file was not backed up You locate the DBA who created the TABLE_DATA tablespace two days ago and find that it contains important user data, but it was never included in the backup strategy Because datafile 4 is not a system or rollback segment datafile, and you have all archived logs for the past two days, you can proceed as follows:.. 1 If the database is closed, then mount the database, take the datafile (with no backup) offline, and open the database. This allows users who do not need the TABLE_DATA tablespace to work on the system. If the database is open, take the datafile or . the tablespace offline Note: If the database is open, the immediate option must be included, to avoid the database writer trying to write to a file that does not exist: SQL> ALTER TABLESPACE table_data OFFLINE IMMEDIATE; Tablespace altered.

转载请注明原文地址:https://www.9cbs.com/read-76453.html

New Post(0)