Get the App
SLTechnology News&Howtos  ›  Database  › 

What if the rac environment adds data files to the file system by mistake?

Shulou Source: shulou.com Published: 2022-05-31 14:55:57 10月28日 Update

This article is about how to add data files to the file system by mistake in the rac environment. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Change the data file offline or offline drop

Alter database datafile'/ home/oracle/andy.dbf' offline drop

View the status of the data file

Select file_name,status from dba_data_files

+ DATA/andy.dbf RECOVER

The offline drop data file is in recover state and normal state. The data will no longer be written to the data file in recover state, but the exppd and rman backup in this state will report an error.

Solution:

First, delete directly

Alter database datafile 'xxx' offline drop

Delete file$ where FILE#=7

Move the data file that added the error to the disk group

1 、 [root@racdb1 grid] # mv andy.dbf / home/grid/

2 、 [root@racdb1 grid] # chown grid.asmadmin andy.dbf

[root@racdb1 grid] # su-grid

[grid@racdb1 ~] $asmcmd

ASMCMD > cd data/racdb/datafile/

ASMCMD > ls

ASMCMD > cp / home/grid/andy.dbf. /

Copying / home/grid/andy.dbf-> + data/racdb/datafile/andy.dbf

ASMCMD > ls

SQL > alter database rename file'/ home/oracle/andy.dbf' to'+ data/racdb/datafile/andy.dbf'

Verify the status of the data file

SQL > select name,status from v$datafile

If it is still in recover state, it needs to be restored.

SQL > recover datafile 5

Media recovery complete.

SQL > alter database datafile 5 online

SQL > select name,status from v$datafile

+ DATA/andy.dbf online

Thank you for reading! This is the end of the article on "how to add data files to the file system by mistake in the rac environment". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Data file status how to do environment system content more article good practical method backup article look knowledge disk or error will be reported Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Shulou Information Linux MySQL