首页 > 数据库 >ORACLE本地磁盘备份恢复

ORACLE本地磁盘备份恢复

时间:2024-12-07 18:57:01浏览次数:4  
标签:DISK 备份 rmanback cmxdb 2024 oracle ORACLE 磁盘 dbf

1.部署新备份磁盘(源和目标)

[oracle@cmxdb /ora_bak]$ mkdir -p /oracle/rmanback
[oracle@cmxdb /ora_bak]$ chown -R oracle:oinstall /oracle/rmanback
[oracle@cmxdb /ora_bak]$ ls -ld /oracle/rmanback/
drwxr-xr-x 2 oracle oinstall 6 Dec  1 15:37 /oracle/rmanback/


[oracle@cmxbak ~]$ mkdir -p /oracle/rmanback
[oracle@cmxbak ~]$ chown -R oracle:oinstall /oracle/rmanback
[oracle@cmxbak ~]$ ls -ld /oracle/rmanback/
drwxr-xr-x 2 oracle oinstall 6 Dec  1 15:58 /oracle/rmanback/

2.源端备份

2.1备份数据文件

[oracle@cmxdb /ora_bak]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Dec 1 15:39:30 2024

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

connected to target database: CMXDB (DBID=3000047776)

RMAN> backup database format '/oracle/rmanback/data_%U.dbf';

Starting backup at 2024-12-01 15:39:51
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1714 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradata/cmxdb/system01.dbf
input datafile file number=00002 name=/oradata/cmxdb/sysaux01.dbf
input datafile file number=00005 name=/oradata/cmxdb/example01.dbf
input datafile file number=00003 name=/oradata/cmxdb/undotbs01.dbf
input datafile file number=00004 name=/oradata/cmxdb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2024-12-01 15:39:51
channel ORA_DISK_1: finished piece 1 at 2024-12-01 15:40:26
piece handle=/oracle/rmanback/data_0l3bjou7_1_1.dbf tag=TAG20241201T153951 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2024-12-01 15:40:27
channel ORA_DISK_1: finished piece 1 at 2024-12-01 15:40:28
piece handle=/oracle/rmanback/data_0m3bjova_1_1.dbf tag=TAG20241201T153951 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2024-12-01 15:40:28


RMAN>


[oracle@cmxdb /oracle/rmanback]$ ls -l
total 1210592
-rw-r----- 1 oracle oinstall 1229717504 Dec  1 15:40 data_0l3bjou7_1_1.dbf
-rw-r----- 1 oracle oinstall    9928704 Dec  1 15:40 data_0m3bjova_1_1.dbf


ps:当数据量较大时,使用如下方式

run {
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
backup database format '/oracle/rmanback/data_%U.dbf';
release channel c1;
release channel c2;
release channel c3;
}

2.2备份控制文件

RMAN> backup current controlfile format '/oracle/rmanback/control_01.dbf';

Starting backup at 2024-12-01 15:43:04
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 2024-12-01 15:43:05
channel ORA_DISK_1: finished piece 1 at 2024-12-01 15:43:06
piece handle=/oracle/rmanback/control_01.dbf tag=TAG20241201T154304 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2024-12-01 15:43:06

RMAN>

[oracle@cmxdb /oracle/rmanback]$ ls -l
total 2430848
-rw-r----- 1 oracle oinstall    9895936 Dec  1 15:43 control_01.dbf
-rw-r----- 1 oracle oinstall 1229717504 Dec  1 15:40 data_0l3bjou7_1_1.dbf
-rw-r----- 1 oracle oinstall    9928704 Dec  1 15:40 data_0m3bjova_1_1.dbf


主库
alter database backup controlfile to '/oracle/rmanback/control01.ctl';
主库生成文本文件的备份控制文件
alter database backup controlfile to trace as '/home/oracle/tmp/b.ctl';

当需要创建备库时,可以使用如下方式:
alter database create standby controlfile as '/oracle/rmanback/control01.ctl';

2.3备份参数文件

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /oracle/dbsoft/product/ora11g/
                                                 dbs/spfilecmxdb.ora
SQL> create pfile='/oracle/rmanback/init31.ora' from spfile;

File created.

SQL> host ls -l /oracle/rmanback/
total 2430852
-rw-r----- 1 oracle oinstall    9895936 Dec  1 15:43 control_01.dbf
-rw-r----- 1 oracle oinstall 1229717504 Dec  1 15:40 data_0l3bjou7_1_1.dbf
-rw-r----- 1 oracle oinstall    9928704 Dec  1 15:40 data_0m3bjova_1_1.dbf
-rw-r----- 1 oracle oinstall 1229717504 Dec  1 15:42 data_0n3bjp2q_1_1.dbf
-rw-r----- 1 oracle oinstall    9928704 Dec  1 15:42 data_0o3bjp2t_1_1.dbf
-rw-r--r-- 1 oracle oinstall       1183 Dec  1 15:46 init31.ora

3.传输备份

[oracle@cmxdb /oracle/rmanback]$ scp /oracle/rmanback/* 10.0.0.33:/oracle/rmanback/

[oracle@cmxbak ~]$ ll /oracle/rmanback/
total 2430852
-rw-r----- 1 oracle oinstall    9895936 Dec  1 15:59 control_01.dbf
-rw-r----- 1 oracle oinstall 1229717504 Dec  1 16:00 data_0l3bjou7_1_1.dbf
-rw-r----- 1 oracle oinstall    9928704 Dec  1 16:00 data_0m3bjova_1_1.dbf
-rw-r----- 1 oracle oinstall 1229717504 Dec  1 16:00 data_0n3bjp2q_1_1.dbf
-rw-r----- 1 oracle oinstall    9928704 Dec  1 16:00 data_0o3bjp2t_1_1.dbf
-rw-r--r-- 1 oracle oinstall       1183 Dec  1 16:00 init31.ora

4.传输归档日志

1.获取归档存放路径
[oracle@cmxdb /oracle/rmanback]$ sqlplus / as sysdba

SQL> select name from v$archived_log order by 1;

NAME
--------------------------------------------------------------------------------
/archlog/1_10_1185485602.dbf
/archlog/1_11_1185485602.dbf

2.目标端配置相同路径
[oracle@cmxbak ~]$ ll /archlog/
ps:若有旧数据的归档,直接删除

3.传输归档日志
[oracle@cmxdb /oracle/rmanback]$ scp   /archlog/* 10.0.0.33:/archlog
oracle@10.0.0.33's password:
1_10_1185485602.dbf                                                                      100%   31MB 103.3MB/s   00:00
1_11_1185485602.dbf                                                                      100%   36MB  79.3MB/s   00:00
1_12_1185485602.dbf                                                                      100%   29MB  90.4MB/s   00:00

4.目标端查看
[oracle@cmxbak ~]$ ll /archlog/
total 569756
-rw-r----- 1 oracle oinstall 32854528 Dec  1 16:10 1_10_1185485602.dbf
-rw-r----- 1 oracle oinstall 37998080 Dec  1 16:10 1_11_1185485602.dbf

5.目标端配置环境变量

[oracle@cmxbak ~]$ cd

调整目标端的ORACLE_SID
[oracle@cmxbak ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup program
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/oracle/dbsoft
export ORACLE_HOME=/oracle/dbsoft/product/ora11g
export ORACLE_SID=cmxdb
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS";
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
PATH=$PATH:$HOME/bin
export PATH

[oracle@cmxbak ~]$ source .bash_profile

5.恢复

5.1 恢复到nomount状态

1.查看参数文件中的路径并进行创建
[oracle@cmxbak ~]$ cat /oracle/rmanback/init31.ora
cmxdb.__db_cache_size=2516582400
cmxdb.__java_pool_size=16777216
cmxdb.__large_pool_size=33554432
cmxdb.__oracle_base='/oracle/dbsoft'#ORACLE_BASE set from environment
cmxdb.__pga_aggregate_target=1056964608
cmxdb.__sga_target=3154116608
cmxdb.__shared_io_pool_size=0
cmxdb.__shared_pool_size=553648128
cmxdb.__streams_pool_size=0
*.audit_file_dest='/oracle/dbsoft/admin/cmxdb/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/oradata/cmxdb/control01.ctl','/oracle/dbsoft/fast_recovery_area/cmxdb/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='cmxdb'
*.db_recovery_file_dest='/oracle/dbsoft/fast_recovery_area'
*.db_recovery_file_dest_size=1462763520
*.diagnostic_dest='/oracle/dbsoft'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=cmxdbXDB)'
*.fal_client='cmxdb'
*.fal_server='drcmxdb'
*.log_archive_dest_1='LOCATION=/archlog'
*.log_archive_dest_2='SERVICE=drcmxdbdg LGWR ASYNC VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE) DB_UNIQUE_NAME=drcmxdb'
*.open_cursors=300
*.pga_aggregate_target=1049624576
*.processes=1500
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=1655
*.sga_target=3148873728
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'

[oracle@cmxbak ~]$ mkdir -p /oracle/dbsoft
[oracle@cmxbak ~]$ mkdir -p /oracle/dbsoft/admin/cmxdb/adump
[oracle@cmxbak ~]$ mkdir -p /oradata/cmxdb/
[oracle@cmxbak ~]$ mkdir -p /oracle/dbsoft/fast_recovery_area/cmxdb/

2.使用新参数文件启动到nomount状态
startup nomount pfile='/oracle/rmanback/init31.ora';
show parameter instance_name --复核实例名配置是否正常
create spfile from pfile='/oracle/rmanback/init31.ora';
shutdown immediate;
startup nomount;


show parameter ARCH
show parameter fal_server
show parameter fal_client
show parameter standby_file_management
show parameter name

3.检查启动的实例
[oracle@cmxbak ~]$  ps -ef |grep pmon
oracle    23399      1  0 16:16 ?        00:00:00 ora_pmon_cmxdb
oracle    23440  23065  0 16:17 pts/0    00:00:00 grep --color=auto pmon

5.2 恢复到mount状态

1.恢复控制文件
方式一:使用rman恢复指定控制文件
[oracle@cmxbak /oracle/rmanback]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Dec 1 16:19:54 2024

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

connected to target database: CMXDB (not mounted)

RMAN> restore controlfile from '/oracle/rmanback/control_01.dbf';

Starting restore at 2024-12-01 16:20:03
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=572 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oradata/cmxdb/control01.ctl
output file name=/oracle/dbsoft/fast_recovery_area/cmxdb/control02.ctl
Finished restore at 2024-12-01 16:20:04

方式二:查看参数文件中控制文件的位置,将控制文件cp到指定的位置
此种方法需要手动生成的控制文件,并非备份的控制文件
[oracle@cmxbak /oracle/rmanback]$ cat init31.ora  |grep control_files
*.control_files='/oradata/cmxdb/control01.ctl','/oracle/dbsoft/fast_recovery_area/cmxdb/control02.ctl'

[oracle@cmxbak /oracle/rmanback]$ cp /oracle/rmanback/control01.ctl  /oradata/cmxdb/control01.ctl
[oracle@cmxbak /oracle/rmanback]$ cp /oracle/rmanback/control01.ctl  /oracle/dbsoft/fast_recovery_area/cmxdb/control02.ctl

[oracle@cmxbak /oracle/rmanback]$ ll /oradata/cmxdb/control01.ctl
-rw-r----- 1 oracle oinstall 9895936 Dec  5 17:00 /oradata/cmxdb/control01.ctl
[oracle@cmxbak /oracle/rmanback]$ ll /oracle/dbsoft/fast_recovery_area/cmxdb/control02.ctl
-rw-r----- 1 oracle oinstall 9895936 Dec  5 17:00 /oracle/dbsoft/fast_recovery_area/cmxdb/control02.ctl


2.启动到mount状态
RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

3.数据库中查看数据库的状态
SQL> select OPEN_MODE,database_role from v$database;

OPEN_MODE            DATABASE_ROLE
-------------------- ----------------
MOUNTED              PRIMARY

5.3 检查备份和备份片

RMAN> LIST BACKUP OF DATABASE;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
3       Full    1.11G      DISK        00:00:02     2024-11-27 17:00:21
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20241127T170019
        Piece Name: /ora_bak/db_0a3b6np3_1_1
  List of Datafiles in backup set 3
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  1       Full 1148808    2024-11-27 17:00:19 /oradata/cmxdb/system01.dbf
  2       Full 1148808    2024-11-27 17:00:19 /oradata/cmxdb/sysaux01.dbf
  3       Full 1148808    2024-11-27 17:00:19 /oradata/cmxdb/undotbs01.dbf
  4       Full 1148808    2024-11-27 17:00:19 /oradata/cmxdb/users01.dbf
  5       Full 1148808    2024-11-27 17:00:19 /oradata/cmxdb/example01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
7       Full    1.11G      DISK        00:00:02     2024-11-27 17:03:37
        BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: TAG20241127T170335
        Piece Name: /ora_bak/db_0f3b6nv7_1_1
  List of Datafiles in backup set 7
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  1       Full 1149047    2024-11-27 17:03:35 /oradata/cmxdb/system01.dbf
  2       Full 1149047    2024-11-27 17:03:35 /oradata/cmxdb/sysaux01.dbf
  3       Full 1149047    2024-11-27 17:03:35 /oradata/cmxdb/undotbs01.dbf
  4       Full 1149047    2024-11-27 17:03:35 /oradata/cmxdb/users01.dbf
  5       Full 1149047    2024-11-27 17:03:35 /oradata/cmxdb/example01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
9       Full    1.11G      DISK        00:00:01     2024-11-27 17:04:42
        BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: TAG20241127T170441
        Piece Name: /ora_bak/db_0i3b6o19_1_1
  List of Datafiles in backup set 9
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  1       Full 1149136    2024-11-27 17:04:41 /oradata/cmxdb/system01.dbf
  2       Full 1149136    2024-11-27 17:04:41 /oradata/cmxdb/sysaux01.dbf
  3       Full 1149136    2024-11-27 17:04:41 /oradata/cmxdb/undotbs01.dbf
  4       Full 1149136    2024-11-27 17:04:41 /oradata/cmxdb/users01.dbf
  5       Full 1149136    2024-11-27 17:04:41 /oradata/cmxdb/example01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
12      Full    1.15G      DISK        00:00:27     2024-12-01 15:40:18
        BP Key: 12   Status: AVAILABLE  Compressed: NO  Tag: TAG20241201T153951
        Piece Name: /oracle/rmanback/data_0l3bjou7_1_1.dbf
  List of Datafiles in backup set 12
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  1       Full 1391030    2024-12-01 15:39:51 /oradata/cmxdb/system01.dbf
  2       Full 1391030    2024-12-01 15:39:51 /oradata/cmxdb/sysaux01.dbf
  3       Full 1391030    2024-12-01 15:39:51 /oradata/cmxdb/undotbs01.dbf
  4       Full 1391030    2024-12-01 15:39:51 /oradata/cmxdb/users01.dbf
  5       Full 1391030    2024-12-01 15:39:51 /oradata/cmxdb/example01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
14      Full    1.15G      DISK        00:00:02     2024-12-01 15:42:20
        BP Key: 14   Status: AVAILABLE  Compressed: NO  Tag: TAG20241201T154218
        Piece Name: /oracle/rmanback/data_0n3bjp2q_1_1.dbf
  List of Datafiles in backup set 14
  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  1       Full 1391195    2024-12-01 15:42:18 /oradata/cmxdb/system01.dbf
  2       Full 1391195    2024-12-01 15:42:18 /oradata/cmxdb/sysaux01.dbf
  3       Full 1391195    2024-12-01 15:42:18 /oradata/cmxdb/undotbs01.dbf
  4       Full 1391195    2024-12-01 15:42:18 /oradata/cmxdb/users01.dbf
  5       Full 1391195    2024-12-01 15:42:18 /oradata/cmxdb/example01.dbf

RMAN>


查看备份片是否存在
[oracle@cmxbak ~]$ ll /oracle/rmanback/data_0l3bjou7_1_1.dbf
-rw-r----- 1 oracle oinstall 1229717504 Dec  1 16:00 /oracle/rmanback/data_0l3bjou7_1_1.dbf

5.4 恢复到open状态

恢复数据文件

1.恢复数据文件
RMAN> restore database;

Starting restore at 2024-12-01 16:47:50
Starting implicit crosscheck backup at 2024-12-01 16:47:50
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1141 device type=DISK
Crosschecked 14 objects
Finished implicit crosscheck backup at 2024-12-01 16:47:50

Starting implicit crosscheck copy at 2024-12-01 16:47:50
using channel ORA_DISK_1
Crosschecked 4 objects
Finished implicit crosscheck copy at 2024-12-01 16:47:50

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /oradata/cmxdb/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /oradata/cmxdb/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /oradata/cmxdb/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /oradata/cmxdb/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /oradata/cmxdb/example01.dbf
channel ORA_DISK_1: reading from backup piece /oracle/rmanback/data_0n3bjp2q_1_1.dbf
channel ORA_DISK_1: piece handle=/oracle/rmanback/data_0n3bjp2q_1_1.dbf tag=TAG20241201T154218
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 2024-12-01 16:47:53


2.检查
[oracle@cmxbak ~]$ ll /oradata/
total 0
drwxr-xr-x 2 oracle oinstall 128 Nov 27 18:01 cmxdb
[oracle@cmxbak ~]$ ll /oradata/cmxdb/
total 1828544
-rw-r----- 1 oracle oinstall   9846784 Dec  1 16:48 control01.ctl
-rw-r----- 1 oracle oinstall 347348992 Dec  1 16:47 example01.dbf
-rw-r----- 1 oracle oinstall 629153792 Dec  1 16:47 sysaux01.dbf
-rw-r----- 1 oracle oinstall 786440192 Dec  1 16:47 system01.dbf
-rw-r----- 1 oracle oinstall  94380032 Dec  1 16:47 undotbs01.dbf
-rw-r----- 1 oracle oinstall   5251072 Dec  1 16:47 users01.dbf

检查控制文件中的归档日志是否存在

[oracle@cmxbak /oracle/rmanback]$ rman target /

1.检查当前数据库的备份
list backup;


2.将备份注册到数据库中
RMAN> catalog start with '/oracle/rmanback/';

searching for all files that match the pattern /oracle/rmanback/

List of Files Unknown to the Database
=====================================
File Name: /oracle/rmanback/data_0v3buej4_1_1.dbf
File Name: /oracle/rmanback/data_103buej4_1_1.dbf
File Name: /oracle/rmanback/data_113buej4_1_1.dbf
File Name: /oracle/rmanback/data_123buej5_1_1.dbf
File Name: /oracle/rmanback/data_133buej6_1_1.dbf

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /oracle/rmanback/data_0v3buej4_1_1.dbf
File Name: /oracle/rmanback/data_103buej4_1_1.dbf
File Name: /oracle/rmanback/data_113buej4_1_1.dbf
File Name: /oracle/rmanback/data_123buej5_1_1.dbf
File Name: /oracle/rmanback/data_133buej6_1_1.dbf

3.查看全备
RMAN> crosscheck backup;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oracle/rmanback/data_0v3buej4_1_1.dbf RECID=31 STAMP=1186943917
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oracle/rmanback/data_103buej4_1_1.dbf RECID=32 STAMP=1186943917
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oracle/rmanback/data_113buej4_1_1.dbf RECID=33 STAMP=1186943917
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oracle/rmanback/data_123buej5_1_1.dbf RECID=34 STAMP=1186943917
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/oracle/rmanback/data_133buej6_1_1.dbf RECID=35 STAMP=1186943917
Crosschecked 5 objects


4.查看归档
RMAN> crosscheck archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1141 device type=DISK
validation succeeded for archived log
archived log file name=/archlog/1_58_1185485602.dbf RECID=97 STAMP=1186870463
validation succeeded for archived log
archived log file name=/archlog/1_59_1185485602.dbf RECID=99 STAMP=1186937393
Crosschecked 2 objects

恢复数据库

RMAN> recover database;

Starting recover at 2024-12-01 16:50:24
using channel ORA_DISK_1

starting media recovery

unable to find archived log
archived log thread=1 sequence=54
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/01/2024 16:50:25
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 54 and starting SCN of 1391195

报错:执行如下命令,恢复到执行的scn位置
RMAN> recover database until scn 1391195;

Starting recover at 2024-12-01 16:54:17
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 2024-12-01 16:54:17

启动数据库open状态

RMAN> alter database open resetlogs;

database opened

SQL> select OPEN_MODE,database_role from v$database;

OPEN_MODE            DATABASE_ROLE
-------------------- ----------------
READ WRITE           PRIMARY

标签:DISK,备份,rmanback,cmxdb,2024,oracle,ORACLE,磁盘,dbf
From: https://www.cnblogs.com/star888/p/18592511

相关文章

  • ORACLE本地磁盘备份恢复
    1.部署新备份磁盘(源和目标)[oracle@cmxdb/ora_bak]$mkdir-p/oracle/rmanback[oracle@cmxdb/ora_bak]$chown-Roracle:oinstall/oracle/rmanback[oracle@cmxdb/ora_bak]$ls-ld/oracle/rmanback/drwxr-xr-x2oracleoinstall6Dec115:37/oracle/rmanback/[o......
  • Linux硬盘挂载与磁盘分区基础(二)(物理卷、卷组、逻辑卷)
      上篇介绍了分区,都是建立在硬盘的基础之上,但是问题出现了,硬盘的空间是固定的,一般的,无论我们的电脑还是服务器,都可以容纳多块硬盘,甚至还可以使用USB等接口接入额外的存储,这样,如果都是用单个硬盘的分区来管理,比如扩容,非常不方便,有没有办法把多个硬盘视为一个整理,当做一块硬盘来管......
  • Oracle 19C RU补丁升级,从19.7to19.25 -单机
    1.环境信息:角色数据库IP地址数据库版本数据库名称源端单实例172.30.21.19119.7hfzcdb2.安装准备用rman备份数据库,再备份下oracle目录:命令:tarzavforacle.tar/oracle 19.25版本关于19C的补丁内容:Oracle19CGridDatabaseReleaseUpdate19.2......
  • Linux磁盘存储概念
    本文为UbuntuLinux操作系统-第六弹今天开始新的知识点,讲磁盘存储问题上期回顾:Linux文件、目录权限问题今天由帝皇侠陪伴大家学习!!!文章目录磁盘数据组织低级格式化磁盘分区高级格式化磁盘设备命名磁盘分区分区样式:MBR与GPT磁盘分区命名Linux文件系统概述ext4文......
  • dd破坏asm磁盘头恢复---惜分飞
    联系:手机/微信(+8617813235971)QQ(107644445)标题:dd破坏asm磁盘头恢复作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]有朋友对asmdisk的磁盘头dd了2048byte的数据通过分析,gi软件版本,确认是11.2.0.4 OracleDatabase......
  • 常规加载器技术(Conventional Loader Techniques)主要用于操作系统中,负责将程序加载到内
    在Web开发中,常规加载器和高阶技巧加载器(或优化器)是实现更高效资源加载和提升性能的关键技术。常规加载器通常是一些基础的加载机制,而高阶技巧加载器则是更高级的优化方法,能够精细化地控制资源的加载时机和顺序,提升页面的加载性能和用户体验。常规加载器(基础加载器)懒加载(Lazy......
  • 【fdisk 操作磁盘,新建分区】
    文章目录:fdisk操作磁盘,新建分区:(以我板子内部的EMMC设备为例)查看有无磁盘设备:已知磁盘路径为/dev/mmcblk0,使用fdisk操作磁盘:输入m查看分区命令:使用命令进行分区操作:查看生成的分区:查看确认分区生成,进行格式化处理:挂载并查看:编写shell脚本一键操作:fdisk......
  • 第13天:Web应用&源码泄漏&开源闭源&指纹识别&GIT&SVN&DS&备份
    知识点:1、业务资产-应用类型分类2、web单域名获取-接口查询3、web子域名获取-解析枚举4、web架构资产-平台指纹识别1、开源-CMS指纹识别源码获取方式、2、闭源-习惯&配置&特性等获取方式3、闭源-托管资产平台资源搜索监控使用工具:潮汐指纹识别识别到cms然后去网上搜......
  • 【PostgreSQL备份恢复二】物理备份与恢复
    PostgreSQL备份恢复物理备份与恢复之前的文章中我们有介绍过,PostgreSQL的的逻辑备份,物理备份的冷备,今天我们介绍一下基于pg_basebackup的热备与恢复。文章目录PostgreSQL备份恢复物理备份与恢复一、pg_basebackup简介二、在数据库服务器上使用pg_basebackup进......
  • Windows 安装Oracle19C
    一、安装与卸载1.1软件下载官网地址:https://www.oracle.com下滑找到并选择对应版本。1.2解压更具需求选择自己需要存放的路径新建文件夹“Oracle19c”,然后把安装包解压到该路径。1.3安装oracle1.3.1打开解压路径下的setup应用程序:1.3.2选择默认创建并配置单实例......