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

What if there is a space in the set newname file name when Oracle RMAN is restored?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces the Oracle RMAN restore when the set newname file name has a space error report how to do, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.

When doing data recovery, there are occasional cases where data files need to be relocated, in which case you can use the SET NEWNAME command in RMAN.

Before Oracle 11g, RMAN only supported SET NEWNAME FOR DATAFILE, and the SET NEWNAME FOR TEMPFILE/SET NEWNAME FOR TABLESPACE/SET NEWNAME FOR DATABASE command was added to Oracle 11g.

The priority is as follows:

1.SET NEWNAME FOR DATAFILE and SET NEWNAME FOR TEMPFILE

2.SET NEWNAME FOR TABLESPACE

3.SET NEWNAME FOR DATABASE

Find a problem

Today encountered a very strange phenomenon, look at a file in the ORACLE database, obviously this file exists, but the use of ls-lrt view shows that the file does not exist. I wonder! Later, it is found that after the terminal enters the file name and uses the tab key, it is found that there are actually spaces (invisible characters) after the file.

The screenshot below shows:

[oracle@ehvlnx02 ~] $ls-lrt / u01/oradata/SCM2/system01.dbfls: / u01/oradata/SCM2/system01.dbf: No such file or directory [oracle@ehvlnx02 ~] $cd / u01/oradata/SCM2/ [oracle@ehvlnx02 SCM2] $ls-lrt total 5238456Kui rwmuri r-1 oracle oinstall 48504832 Nov 8 19:24 users01.dbf-rw-r- 1 oracle oinstall 209715712 Nov 8 19:24 redo06.log-rw-r- 1 oracle oinstall 209715712 Nov 8 19:24 redo05.log-rw-r- 1 oracle oinstall 209715712 Nov 8 19:24 redo04.log-rw-r- 1 oracle oinstall 209715712 Nov 8 19:24 redo02_1.log-rw-r- 1 oracle oinstall 367009792 Nov 8 19:24 ppc_x01.dbf-rw-r- 1 oracle oinstall 786440192 Nov 8 20:04 sysaux01.dbf-rw-r- 1 oracle oinstall 2553290752 Nov 8 20:09 undotbs01.dbf -rw-r- 1 oracle oinstall 545267712 Nov 8 20:09 system01.dbf-rw-r- 1 oracle oinstall 209715712 Nov 8 20:14 redo01_1.log-rw-r- 1 oracle oinstall 9781248 Nov 8 20:17 control01.ctl [oracle@ehvlnx02 SCM2] $ls system01.dbf\ system01.dbf [oracle@ehvlnx02 SCM2] $ls system01.dbf*system01.dbf [oracle@ehvlnx02 SCM2] $clip_image001

Solution method

So why do these database data file names have more spaces? As a result of this UAT server, I did RMAN restore a few hours ago, and found that when I came to specify the path and file name after set newname for datafile, there are a large number of spaces between double quotation marks (using UE column mode to prepare the restore command), for the first time, it seems that when using set newname in the future, the new file name should be careful not to appear spaces. Otherwise, this will happen.

Run {sql'alter session set nls_date_format= "yyyy-mm-dd hh34:mi:ss"; set until time '2017-11-08 03Set newname for datafile 1 to "/ u01/oradata/SCM2/system01.dbf"; set newname for datafile 2 to "/ u01/oradata/SCM2/undotbs01.dbf"; set newname for datafile 3 to "/ u04/oradata/SCM2/undotbs02.dbf"; set newname for datafile 4 to "/ u01/oradata/SCM2/sysaux01.dbf" Set newname for datafile 5 to "/ u01/oradata/SCM2/users01.dbf";... restore database;switch datafile all; recover database } Thank you for reading this article carefully. I hope the article "what to do if there is a space in the set newname file name during Oracle RMAN restore" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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