Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The process of using RMAN to restore a database

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "the process of using RMAN to restore database". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the process of using RMAN to restore database".

Since you need to build a test environment, take out a complete one from last weekend for recovery, and first back up the important tables that exist on the test library:

Exp banping/bangping@ERPTEST file=f:\ 20090905.dmp tables= (msgtaskdef,rptcol,rptdata)

Then COPY all the backup film files and control files:

Rcp p5b1:/orabak/ctl_file/c-2400249746-20090828-02 / orabak

Rcp p5b1rixamoto orabakque archchop * / orabak

The file owner gives Oracle:

P5b2@/orabak#chown oracle.dba *

Then start the database to the nomount state, enter the Rman environment, and control the restore file:

$rman target /

RMAN > restore controlfile from'/ orabak/ cmur2400249746-20090828-02'

Boot to mount state:

RMAN > sql 'alter database mount'

Rename the location of the data file based on the environment of the test library:

Run {

Allocate channel c1 device type disk

Allocate channel c2 device type disk

Set newname for datafile'/ dev/rdb_system' to'/ u02Universe oradata placcade erpdev2andrdbroomsystem`

Set newname for datafile'/ dev/rdb_undotbs1' to'/ u02Universe oradata eryerpdev2andrdbqundotb1'

Set newname for datafile'/ dev/rdb_sysaux' to'/ u02Universe oradata Placement erpdev2andrdbroomsysaux'

Set newname for datafile'/ dev/rdb_undotbs2' to'/ u02Universe oradata Erpdev2andrdbqundotbs2'

Set newname for datafile'/ dev/rdb_users' to'/ u02Universe oradata _

Set newname for datafile'/ dev/rdb_erp' to'/ u02Universe oradata eryerpdev2andrdbroomerp'

Set newname for datafile'/ dev/rdb_erp_index' to'/ u02Universe oradata eryerpdev2andrdbroomerpindex`

Set newname for datafile'/ dev/rdb_erp_xm' to'/ u02max oradataUniverse erpdev2andrdbaccounerpandxm'

Set newname for datafile'/ dev/rdb_erp_ht' to'/ u02max oradata eryerpdev2andrdbroomerppromoht'

Set newname for datafile'/ dev/rdb_erp_wl' to'/ u02max oradataUniverse erpdev2andrdbpromoerpandrowl'

Set newname for datafile'/ dev/rdb_erp_cw' to'/ u02Universe oradataUniverse erpdev2andrdbaccounererpandcw'

Set newname for datafile'/ dev/rdb_erp_zj' to'/ u02Universe oradataUniverse erpdev2andrdbroomerppromozj'

Set newname for datafile'/ dev/rdb_erp_sp' to'/ u02Universe oradataUniplex erpdev2andrdbroomerphands sp'

Set newname for datafile'/ dev/rdb_cndwl' to'/ u02max oradataUniverse erpdev2andrdbquncndwl'

Set newname for datafile'/ dev/rdb_xdwl' to'/ u02Universe oradata eryerpdev2andrdbqunxdwl'

Set newname for datafile'/ dev/rdb_sysaux2' to'/ u02Universe oradata eryerpdev2andrdbaccounsysaux2'

Set newname for datafile'/ dev/rdb_erp2' to'/ u02 max oradata Erpdev2max rdbpromoerp2'

Set newname for datafile'/ dev/rdb_erp_ht2' to'/ u02Universe oradata eryerpdev2andrdbaccounererppromoht2'

Restore database

Switch datafile all

}

Then perform the recover operation:

RMAN > recover database

At this point, the database reported an error:

Oracle Error:

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01152: file 1 was not restored from a sufficiently old backup

ORA-01110: data file 1:'/ u02max oradata Erpdev2max rdbroomsystem`

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-03002: failure of recover command at 09/04/2009 14:31:39

RMAN-06053: unable to perform media recovery because of missing log

RMAN-06025: no backup of log thread 2 seq 106090 lowscn 10440022578 found to restore

RMAN-06025: no backup of log thread 2 seq 106089 lowscn 10440021828 found to restore

RMAN-06025: no backup of log thread 2 seq 106088 lowscn 10440020848 found to restore

RMAN-06025: no backup of log thread 2 seq 106087 lowscn 10440018779 found to restore

RMAN-06025: no backup of log thread 2 seq 106086 lowscn 10440007985 found to restore

RMAN-06025: no backup of log thread 2 seq 106085 lowscn 10439981571 found to restore

RMAN-06025: no backup of log thread 2 seq 106084 lowscn 10439980750 found to restore

RMAN-06025: no backup of log thread 1 seq 99356 lowscn 10440022588 found to restore

RMAN-06025: no backup of log thread 1 seq 99355 lowscn 10440021839 found to restore

RMAN-06025: no backup of log thread 1 seq 99354 lowscn 10440020856 found to restore

RMAN-06025: no backup of log thread 1 seq 99353 lowscn 10440018824 found to restore

RMAN-06025: no backup of log thread 1 seq 99352 lowscn 10440008036 found to restore

RMAN-06025: no backup of log thread 1 seq 99351 lowscn 10439981670 found to restore

RMAN-06025: no backup of log thread 1 seq 99350 lowscn 10439980746 found to restore

It seems that some backup films are incomplete, so get the complete backup films and put them in the / orabak/arch directory and register to the control file first:

RMAN > catalog start with'/ orabak/arch'

Searching for all files that match the pattern / orabak/arch

List of Files Unknown to the Database

= =

File Name: / orabak/arch/CNDERPDB_arch_20090829_696171285_15256_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696171311_15258_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696171617_15257_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696171922_15259_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696172209_15260_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696172385_15261_1

Do you really want to catalog the above files (enter YES or NO)? Y

Cataloging files...

Cataloging done

List of Cataloged Files

=

File Name: / orabak/arch/CNDERPDB_arch_20090829_696171285_15256_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696171311_15258_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696171617_15257_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696171922_15259_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696172209_15260_1

File Name: / orabak/arch/CNDERPDB_arch_20090829_696172385_15261_1

Restart the recover operation:

RMAN > recover database

Starting recover at 07-SEP-09

Using channel ORA_DISK_1

Starting media recovery

Archive log thread 1 sequence 99417 is already on disk as file / u02/ora_arch/1_99417_640266118.dbf

Unable to find archive log

Archive log thread=2 sequence=106154

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-03002: failure of recover command at 09/07/2009 08:59:16

RMAN-06054: media recovery requesting unknown log: thread 2 seq 106154 lowscn 10444622603

You can't find the backup film you need, and after a few attempts, you'll find that you'll keep looking like this:

Unable to find archive log

Archive log thread=1 sequence=99470

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-03002: failure of recover command at 09/07/2009 09:29:02

RMAN-06054: media recovery requesting unknown log: thread 1 seq 99470 lowscn 10444784948

For testing purposes, specify SCN recovery:

RMAN > run {

2 > set until scn 10444783788

3 > recover database

4 >}

Executing command: SET until clause

Starting recover at 07-SEP-09

Using channel ORA_DISK_1

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-03002: failure of recover command at 09/07/2009 09:38:44

RMAN-06556: datafile 1 must be restored from backup older than scn 10444783788

The SCN found through list backup of archivelog all is unexpectedly wrong. Continue to take the backup film back and restore it to SCN No. 10444784948, which was just said to be missing:

RMAN > run {

2 > set until scn 10444784948

3 > recover database

4 >}

Executing command: SET until clause

Starting recover at 07-SEP-09

Using channel ORA_DISK_1

Starting media recovery

Archive log thread 2 sequence 106205 is already on disk as file / u02/ora_arch/2_106205_640266118.dbf

Channel ORA_DISK_1: starting archive log restore to default destination

Channel ORA_DISK_1: restoring archive log

Archive log thread=1 sequence=99470

Channel ORA_DISK_1: reading from backup piece / orabak/arch/CNDERPDB_arch_20090830_696257683_15267_1

Channel ORA_DISK_1: restored backup piece 1

Piece handle=/orabak/arch/CNDERPDB_arch_20090830_696257683_15267_1 tag=TAG20090830T130014

Channel ORA_DISK_1: restore complete, elapsed time: 00:00:03

Archive log filename=/u02/ora_arch/1_99470_640266118.dbf thread=1 sequence=99470

Archive log filename=/u02/ora_arch/2_106205_640266118.dbf thread=2 sequence=106205

Media recovery complete, elapsed time: 00:00:03

Finished recover at 07-SEP-09

An error was reported after trying to open it:

RMAN > alter database open

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-03002: failure of alter db command at 09/07/2009 09:57:10

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

RMAN > alter database open resetlogs

RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row

RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows

ORACLE error from target database:

ORA-19921: maximum number of 64 rows exceeded

RMAN-00571: =

RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =

RMAN-00571: =

RMAN-03002: failure of alter db command at 09/07/2009 09:57:20

ORA-00344: unable to re-create online log'/ dev/rdb_redo1_11'

ORA-27040: file create error, unable to create file

IBM AIX RISC System/6000 Error: 13: Permission denied

According to the backed up files, first create a series of redo files in the test library:

SQL > alter database rename file'/ dev/rdb_redo1_11' to'/ u02 oradata

Database altered.

Create temporary tablespace files that can delete unnecessary:

SQL > select name from v$tempfile

NAME

/ dev/rdb_erp_temp

/ dev/rdb_erp_temp2

/ dev/rdb_erp_temp3

SQL > alter database rename file'/ dev/rdb_erp_temp' to'/ u02max oradata _

Database altered.

SQL > select name from v$tempfile

NAME

/ u02/oradata/erpdev2/rdb_erp_temp

/ dev/rdb_erp_temp2

/ dev/rdb_erp_temp3

SQL > alter database tempfile'/ dev/rdb_erp_temp2' drop including datafiles

Database altered.

SQL > alter database tempfile'/ dev/rdb_erp_temp3' drop including datafiles

Database altered.

SQL > select name from v$tempfile

NAME

/ u02/oradata/erpdev2/rdb_erp_temp

Since it is not fully recovered, open it with resetlogs:

SQL > alter database open

Alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL > alter database open resetlogs

Database altered.

View the archive mode:

SQL > archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination / u02/ora_arch/

Oldest online log sequence 0

Next log sequence to archive 1

Current log sequence 1

Close the archive:

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL > startup mount

ORACLE instance started.

Total System Global Area 603979776 bytes

Fixed Size 2074704 bytes

Variable Size 318769072 bytes

Database Buffers 276824064 bytes

Redo Buffers 6311936 bytes

Database mounted.

SQL > alter database noarchivelog

Database altered.

SQL > alter database open

Database altered.

Thank you for your reading, the above is the content of "the process of using RMAN to restore the database". After the study of this article, I believe you have a deeper understanding of the process of using RMAN to restore the database, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report