ITPub博客

首页 > 数据库 > Oracle > 12c非归档模式备份

12c非归档模式备份

原创 Oracle 作者:sjw1933 时间:2023-01-27 18:59:25 0 删除 编辑

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;

 


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23825935/viewspace-2932987/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
11年数据库行业经验,Oracle ACE、PG ACE、OCM、IBM Certified DBA、MySQL OCP、PolarDB技术专家、KCP、PCTP、PCSD、达梦师资认证、PolarDB开源社区技术顾问、ITPUB认证专家、某高校外聘教师

注册时间:2019-05-05

  • 博文量
    295
  • 访问量
    300833