12c非归档模式备份

来源:这里教程网 时间:2026-03-03 18:20:35 作者:

If a database runs in  NOARCHIVELOG  mode, then the only valid database backup is a  consistent backup . For the backup to be consistent, the database must be mounted after a consistent shutdown. Recovery is not specifically required after restoring the backup, but you would lose any transactions made after the backup. You can recover with archived logs from a consistent backup to minimize data loss.

To make a consistent database backup:

  1. Start RMAN and connect to a target database as described in " Starting RMAN and Connecting to a Database ".
  2. Shut down the database consistently and then mount it. For example, enter the following commands to  guarantee  that the database is in a consistent state for a backup: RMAN> SHUTDOWN IMMEDIATE; RMAN> STARTUP FORCE DBA; RMAN> SHUTDOWN IMMEDIATE; RMAN> STARTUP MOUNT;
  3. Run the  BACKUP DATABASE  command. For example, enter the following command at the RMAN prompt to back up the database to the default backup device: RMAN> BACKUP DATABASE; The following variation of the command creates image copy backups of all data files in the database: RMAN> BACKUP AS COPY DATABASE;
  4. Open the database and resume normal operations. The following command opens the database: RMAN> ALTER DATABASE OPEN;

 

Option

Description

Example

FORMAT

Specifies a location and name for backup pieces and copies. You must use substitution variables to generate unique file names.

The most common substitution variable is  %U , which generates a unique name. Others include  %d  for the DB_NAME,  %t  for the backup set time stamp,  %s  for the backup set number, and  %p  for the backup piece number.

BACKUP    FORMAT 'AL_%d/%t/%s/%p'    ARCHIVELOG LIKE '%arc_dest%';

TAG

Specifies a user-defined string as a label for the backup. If you do not specify a  tag  , then RMAN assigns a default tag with the date and time. Tags are always stored in the RMAN repository in uppercase.

BACKUP   TAG 'weekly_full_db_bkup'    DATABASE MAXSETSIZE 10M;

 

相关推荐