In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces how to use SET NEWNAME FOR in the database, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
SET NEWNAME FOR must be followed by SWITCH DATAFILE ALL or SWITCH TEMPFILE ALL
RUN {
SET NEWNAME FOR DATAFILE 1 to'/ oracle/ora11g/oradata/system01.dbf'
SET NEWNAME FOR DATAFILE 2 to'/ oracle/ora11g/oradata/sysaux01.dbf'
SET NEWNAME FOR DATAFILE 3 to'/ oracle/ora11g/oradata/undotbs01.dbf'
SET NEWNAME FOR DATAFILE 4 to'/ oracle/ora11g/oradata/users01.dbf'
SET NEWNAME FOR DATAFILE 5 to'/ oracle/ora11g/oradata/undotbs02.dbf'
SET NEWNAME FOR DATAFILE 6 to'/ oracle/ora11g/oradata/test01.dbf'
SET NEWNAME FOR TEMPFILE 1 to'/ oracle/ora11g/oradata/temp01.dbf'
RESTORE DATABASE
SWITCH DATAFILE ALL
SWITCH TEMPFILE ALL
}
Run {
Set newname for datafile'/ MM/DataYY.dbf' to'/ NN/DataYY.dbf'
Set newname for tempfile'/ MM/TempYY.dbf' to'/ NN/TempYY.dbf'
Restore database
Switch datafile all
Switch tempfile all
}
MM is the original path, NN is the new path
When only converting DATAFILE is as follows
Run {
Set newname for datafile'/ MM/DataYY.dbf' to'/ NN/DataYY.dbf'
Restore database
Switch datafile all
}
The function of switch datafile all and switch tempfile all is to change the path of the data file in the control file.
If you need to restore a data file to a new location, then use the RMAN SET NEWNAME command within a RUN command to specify the new file name. Afterward, use a SWITCH DATAFILE ALL command, which is equivalent to using the SQL statement ALTER DATABASE RENAME FILE, to update the control file to reflect the new names for all data files for which a SET NEWNAME has been issued in the RUN command.
Thank you for reading this article carefully. I hope the article "how to use SET NEWNAME FOR in the database" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.