In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to restore the mistakenly deleted oracle data files under linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Scenario description: the data file is deleted at the operating system level (/ oracle/oradata/ora10g/system1.dbf), and the database does not crash, still in the open state.
Principle: in the Linux operating system, if a file is deleted from the operating system level, the process that opened the file before still holds the corresponding file handle, the file it points to can still read and write, and the file descriptor of the file can be obtained from the / proc directory. If you close the database, the handle is lost.
The recovery steps are as follows:
1. Check the process PID of dbwr
$ps-ef | grep dbw0 | grep-v grep
2bot dbwr opens the handle to all data files.
Can be found in the proc directory, the directory name is the process PID,fd represents the file descriptor
As shown in the figure:
[root@localhost fd] # ls-l
Total 0
Lrwx- 1 oracle dba 64 Jan 3 18:35 23-> / oracle/oradata/ora10g/example01.dbf
Lrwx- 1 oracle dba 64 Jan 3 18:35 24-> / oracle/oradata/ora10g/test01.dbf
Lrwx- 1 oracle dba 64 Jan 3 18 Jan 3525-> / oracle/oradata/ora10g/app1.dbf (deleted)
Lrwx- 1 oracle dba 64 Jan 3 18:35 26-> / oracle/oradata/ora10g/perfstat.dbf
Lrwx- 1 oracle dba 64 Jan 3 18:35 27-> / oracle/oradata/ora10g/test02.dbf
Lrwx- 1 oracle dba 64 Jan 3 18:35 28-> / oracle/oradata/ora10g/temp01.dbf
Lrwx- 1 oracle dba 64 Jan 3 18:35 29-> / oracle/oradata/ora10g/temp02.dbf
The red part means that the app1 file has been deleted.
3. Copy the handle directly to the location of the original data file
Host cp / proc/3591/fd/25/oracle/oradata/ora10g/system1.dbf
4, restore the file
Alter database datafile 7 offline
Recover datafile 7
Alter database datafile 7 online
This is the end of the content of "how to restore the data file of mistakenly deleted oracle under linux". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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
101.201.208.37 EBENEBFACACACACACACACACACACACACA\ x00 "-"
© 2024 shulou.com SLNews company. All rights reserved.