RMAN备份恢复测试

[oracle@modb ~]$ sqlplus / as sysdba

SQL*Plus: Release 21.0.0.0.0 - Production on Wed Feb 2 22:46:56 2022
Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.


Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /opt/oracle/homes/OraDBHome21cXE/dbs/arch
Oldest online log sequence     1
Next log sequence to archive   3
Current log sequence           3
SQL> exit
Disconnected from Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

[oracle@modb ~]$ rman target /

Recovery Manager: Release 21.0.0.0.0 - Production on Wed Feb 2 22:47:10 2022
Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle and/or its affiliates.  All rights reserved.

connected to target database: XE (DBID=2976754108)

RMAN> backup as compressed backupset database format '/home/oracle/backup/XE_full_%U.bak' plus archivelog format '/home/oracle/backup/XE_arch_%U.bak' delete input;


Starting backup at 02-FEB-22
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=131 device type=DISK
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=1 STAMP=1095634038
channel ORA_DISK_1: starting piece 1 at 02-FEB-22
channel ORA_DISK_1: finished piece 1 at 02-FEB-22
piece handle=/home/oracle/backup/XE_arch_010ks33n_1_1_1.bak tag=TAG20220202T224719 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/opt/oracle/homes/OraDBHome21cXE/dbs/arch1_3_1095633404.dbf RECID=1 STAMP=1095634038
Finished backup at 02-FEB-22

Starting backup at 02-FEB-22
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/opt/oracle/oradata/XE/system01.dbf
input datafile file number=00003 name=/opt/oracle/oradata/XE/sysaux01.dbf
input datafile file number=00004 name=/opt/oracle/oradata/XE/undotbs01.dbf
input datafile file number=00007 name=/opt/oracle/oradata/XE/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-FEB-22
channel ORA_DISK_1: finished piece 1 at 02-FEB-22
piece handle=/home/oracle/backup/XE_full_020ks33q_2_1_1.bak tag=TAG20220202T224722 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00010 name=/opt/oracle/oradata/XE/XEPDB1/sysaux01.dbf
input datafile file number=00009 name=/opt/oracle/oradata/XE/XEPDB1/system01.dbf
input datafile file number=00011 name=/opt/oracle/oradata/XE/XEPDB1/undotbs01.dbf
input datafile file number=00012 name=/opt/oracle/oradata/XE/XEPDB1/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-FEB-22
channel ORA_DISK_1: finished piece 1 at 02-FEB-22
piece handle=/home/oracle/backup/XE_full_030ks35h_3_1_1.bak tag=TAG20220202T224722 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/opt/oracle/oradata/XE/pdbseed/sysaux01.dbf
input datafile file number=00005 name=/opt/oracle/oradata/XE/pdbseed/system01.dbf
input datafile file number=00008 name=/opt/oracle/oradata/XE/pdbseed/undotbs01.dbf
channel ORA_DISK_1: starting piece 1 at 02-FEB-22
channel ORA_DISK_1: finished piece 1 at 02-FEB-22
piece handle=/home/oracle/backup/XE_full_040ks360_4_1_1.bak tag=TAG20220202T224722 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 02-FEB-22

Starting backup at 02-FEB-22
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=2 STAMP=1095634127
channel ORA_DISK_1: starting piece 1 at 02-FEB-22
channel ORA_DISK_1: finished piece 1 at 02-FEB-22
piece handle=/home/oracle/backup/XE_arch_050ks36g_5_1_1.bak tag=TAG20220202T224848 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/opt/oracle/homes/OraDBHome21cXE/dbs/arch1_4_1095633404.dbf RECID=2 STAMP=1095634127
Finished backup at 02-FEB-22

Starting Control File and SPFILE Autobackup at 02-FEB-22
piece handle=/opt/oracle/homes/OraDBHome21cXE/dbs/c-2976754108-20220202-00 comment=NONE
Finished Control File and SPFILE Autobackup at 02-FEB-22
RMAN> list backup of database;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    412.09M    DISK        00:00:53     02-FEB-22      
        BP Key: 2   Status: AVAILABLE  Compressed: YES  Tag: TAG20220202T224722
        Piece Name: /home/oracle/backup/XE_full_020ks33q_2_1_1.bak
  List of Datafiles in backup set 2
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  1       Full 2624842    02-FEB-22              NO    /opt/oracle/oradata/XE/system01.dbf
  3       Full 2624842    02-FEB-22              NO    /opt/oracle/oradata/XE/sysaux01.dbf
  4       Full 2624842    02-FEB-22              NO    /opt/oracle/oradata/XE/undotbs01.dbf
  7       Full 2624842    02-FEB-22              NO    /opt/oracle/oradata/XE/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    100.07M    DISK        00:00:15     02-FEB-22      
        BP Key: 3   Status: AVAILABLE  Compressed: YES  Tag: TAG20220202T224722
        Piece Name: /home/oracle/backup/XE_full_030ks35h_3_1_1.bak
  List of Datafiles in backup set 3
  Container ID: 3, PDB Name: XEPDB1
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  9       Full 2624869    02-FEB-22              NO    /opt/oracle/oradata/XE/XEPDB1/system01.dbf
  10      Full 2624869    02-FEB-22              NO    /opt/oracle/oradata/XE/XEPDB1/sysaux01.dbf
  11      Full 2624869    02-FEB-22              NO    /opt/oracle/oradata/XE/XEPDB1/undotbs01.dbf
  12      Full 2624869    02-FEB-22              NO    /opt/oracle/oradata/XE/XEPDB1/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4       Full    97.66M     DISK        00:00:14     02-FEB-22      
        BP Key: 4   Status: AVAILABLE  Compressed: YES  Tag: TAG20220202T224722
        Piece Name: /home/oracle/backup/XE_full_040ks360_4_1_1.bak
  List of Datafiles in backup set 4
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  5       Full 2617387    02-FEB-22              NO    /opt/oracle/oradata/XE/pdbseed/system01.dbf
  6       Full 2617387    02-FEB-22              NO    /opt/oracle/oradata/XE/pdbseed/sysaux01.dbf
  8       Full 2617387    02-FEB-22              NO    /opt/oracle/oradata/XE/pdbseed/undotbs01.dbf

RMAN> set line 999

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: "archivelog, autobackup, auxiliary, auxname, backup, catalog, command, compression, controlfile, database, dbid, decryption, default, echo, encryption, high, incarnation, incremental, long, maxcorrupt, maxseq, newname, nocfau, numwidth, passphrase, preplugin, restore, snapshot, tenantid, to restore point, until restore point, until, "
RMAN-01008: the bad identifier was: line
RMAN-01007: at line 1 column 5 file: standard input

RMAN> list backup of controlfile;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6       Full    17.95M     DISK        00:00:00     02-FEB-22      
        BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: TAG20220202T224849
        Piece Name: /opt/oracle/homes/OraDBHome21cXE/dbs/c-2976754108-20220202-00
  Control File Included: Ckp SCN: 2624914      Ckp time: 02-FEB-22

RMAN> list backup of archivelog all;


List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
1       13.90M     DISK        00:00:01     02-FEB-22      
        BP Key: 1   Status: AVAILABLE  Compressed: YES  Tag: TAG20220202T224719
        Piece Name: /home/oracle/backup/XE_arch_010ks33n_1_1_1.bak

  List of Archived Logs in backup set 1
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    3       2615375    02-FEB-22 2624817    02-FEB-22

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
5       48.50K     DISK        00:00:00     02-FEB-22      
        BP Key: 5   Status: AVAILABLE  Compressed: YES  Tag: TAG20220202T224848
        Piece Name: /home/oracle/backup/XE_arch_050ks36g_5_1_1.bak

  List of Archived Logs in backup set 5
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    4       2624817    02-FEB-22 2624893    02-FEB-22
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值