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

Delete the data file of offline status in oracle

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

Share

Shulou(Shulou.com)06/01 Report--

Oracle is in archive mode:

I started to want to delete a data file in a tablespace separately.

First, query the information about the data file you want to delete:

Select * from v$datafile

Alter database datafile'/ data/gps03.dbf' offline

After changing the offline state, you can see the file that needs to be restored in v$recover_file.

Select * from v$recover_file

You can query the file# number of the file. Then check the select * from vault datafile; determine the location of the file.

3. After leaving the data file in offline, delete the data file:

Alter tablespace MCC01 drop'/ data/gps03.dbf'

Prompt to delete offline data files in local table space.

So I'm having this data file online.

Alter database datafile'/ data/gps03.dbf' online

The results also suggest that:

0RA-01113: file 8 requires media recovery.

ORA-01110: data file 8:'/ data/gps03.dbf'

So I executed:

Recover datafile 8; (note that this statement cannot be executed in plsql, otherwise it prompts an invalid sql statement)

After execution: prompt

Complete the media recovery.

4. Query v$recover_file again and find that there are no files to recover. In querying v$datafile, it is found that the status of this file is no longer in RECOVER state, but has become offline. Put it online again.

Alter database datafile 8 online

After executing the above statement, check the status of the data file in v$datafile and change it to online state.

5. Delete the data file again.

Alter tablespace MCC01 drop datafile 8

Delete the data file and finish here.

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