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

How to restore Oracle 12cR1 rac to stand-alone file system testing

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article introduces how to restore Oracle 12cR1 rac to the stand-alone file system test, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Give a simple example of restoring from 12cR1 RAC to a stand-alone file system.

1. Modification of parameter file

SQL > create pfile='/home/oracle/init.ora' from spfile

Dump the pfile through the above command to modify the parameters.

2. Restore the backed-up control files on a single machine

RMAN > restore controlfile from'/ recovert_area/tmp/controlfile_db_p5sb7rbl_1_1.bak

3. Restore the database

Place the backup set in the recovery_area/bak/ directory and execute the following command:

RMAN > catalog start with'/ recovery_area/bak/'

The path of the data file and temporary file here needs to be changed. Because it is restored to the file system, the example script here does not give the final name of the data file, so it is for reference only:

Select 'set newname for tempfile' | | file# | |'to'/ ora12c/oradata/cdb/'';' from v$tempfile where con_id=1

Select 'set newname for tempfile' | | file# | |'to'/ ora12c/oradata/seed/'';' from v$tempfile where con_id=2

Select 'set newname for tempfile' | | file# | |'to'/ ora12c/oradata/pdb/pdb1/'';' from v$tempfile where con_id=3

Select 'set newname for datafile' | | file# | |'to'/ ora12c/oradata/cdb/'';' from v$datafile where con_id=1

Select 'set newname for datafile' | | file# | |'to'/ ora12c/oradata/seed/'';' from v$datafile where con_id=2

Select 'set newname for datafile' | | file# | |'to'/ ora12c/oradata/pdb/pdb1/'';' from v$datafile where con_id=3

The restore script is given below for reference.

Run

{

Set newname for datafile 1 to'/ ora12c/oradata/cdb/system01.dbf'

Set newname for datafile 3 to'/ ora12c/oradata/cdb/sysaux01.dbf'

Set newname for datafile 4 to'/ ora12c/oradata/cdb/undotbs01.dbf'

Set newname for datafile 6 to'/ ora12c/oradata/cdb/users01.dbf'

Set newname for datafile 8 to'/ ora12c/oradata/cdb/undotbs02.dbf'

Set newname for datafile 9 to'/ ora12c/oradata/cdb/undotbs03.dbf'

Set newname for datafile 5 to'/ ora12c/oradata/seed/system01.dbf'

Set newname for datafile 7 to'/ ora12c/oradata/seed/sysaux01.dbf'

Set newname for datafile 10 to'/ ora12c/oradata/pdb/pdb1/clsprm_system.dbf'

Set newname for datafile 11 to'/ ora12c/oradata/pdb/pdb1/clsprm_sysaux.dbf'

Set newname for datafile 12 to'/ ora12c/oradata/pdb/pdb1/clsprm_users01.dbf'

Set newname for datafile 14 to'/ ora12c/oradata/pdb/pdb1/test2_01.dbf'

Set newname for datafile 16 to'/ ora12c/oradata/pdb/pdb1/test021.dbf'

Set newname for tempfile 1 to'/ ora12c/oradata/cdb/temp01.dbf'

Set newname for tempfile 2 to'/ ora12c/oradata/seed/temp01.dbf'

Set newname for tempfile 3 to'/ ora12c/oradata/pdb/pdb1/temp01.dbf'

Restore database

Switch datafile all

Switch tempfile all

}

4. Restore the database

It's not fully recovered here.

RMAN > list backup of database

Omit the part.

File LV Type Ckp SCN Ckp Time Name

1 Full 40189418 06-AUG-17 / ora12c/oradata/cdb/system01.dbf

3 Full 40189418 06-AUG-17 / ora12c/oradata/cdb/sysaux01.dbf

4 Full 40189418 06-AUG-17 / ora12c/oradata/cdb/undotbs01.dbf

6 Full 40189418 06-AUG-17 / ora12c/oradata/cdb/users01.dbf

Omit the part.

"from the above section, you can see that the Ckp SCN is 40189418,

RMAN > list backup of archivelog all

Omit the part.

Thrd Seq Low SCN Low Time Next SCN Next Time

-

1 664 40186320 06-AUG-17 40188631 06-AUG-17

1 665 40188631 06-AUG-17 40190128 06-AUG-17

2 634 40186323 06-AUG-17 40188634 06-AUG-17

2 635 40188634 06-AUG-17 40190122 06-AUG-17

3 582 40186334 06-AUG-17 40188628 06-AUG-17

3 583 40188628 06-AUG-17 40190125 06-AUG-17

Omit the part.

"through the analysis of archived Low SCN, Next SCN and Ckp SCN, it is confirmed that the recovery to scn number is 40190122.

The recovery script is given below for your reference.

Run {

Set archivelog destination to'/ recovery_area/tmp/'

Recover database until scn 40190122

}

5. Open the database

RMAN > alter database open resetlogs

If it cannot be opened, media recovery is required, and you can continue to append archive logs for recovery.

6. Delete redundant log groups and undo tablespaces

(1) Clean up log groups

SELECT b.member, a.group#,thread#, a.status

FROM v$log a, v$logfile b

WHERE a.group# = b.group#

ORDER BY a.thread#,b.group#

MEMBER GROUP# THREAD# STATUS

+ CDB/cdb/redo01.log 1 1 CURRENT

+ CDB/cdb/redo02.log 2 1 UNUSED

+ CDB/cdb/redo03.log 3 2 INACTIVE

+ CDB/cdb/redo04.log 4 2 UNUSED

+ CDB/cdb/redo05.log 5 3 INACTIVE

+ CDB/cdb/redo06.log 6 3 UNUSED

Delete group 3, 4, 5, 6 here.

SQL > alter database disable thread 2

Database altered.

SQL > alter database disable thread 3

Database altered.

SQL > alter database drop logfile group 3

Database altered.

SQL > alter database drop logfile group 4

Database altered.

SQL > alter database drop logfile group 5

Database altered.

SQL > alter database drop logfile group 6

Database altered.

(2) Clean up the unod tablespace

SQL > select name from v$tablespace where name like 'UNDO%'

NAME

-

UNDOTBS1

UNDOTBS2

UNDOTBS3

Confirm the undo to be retained through the show parameter undo_tablespace command, where the UNDOTBS2 and UNDOTBS3 tablespaces are deleted

SQL > drop tablespace UNDOTBS2 including contents and datafiles

Tablespace dropped.

SQL > drop tablespace UNDOTBS3 including contents and datafiles

Tablespace dropped.

On how to restore Oracle 12cR1 rac to the stand-alone file system test is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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