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

Rac ORA-001157 data file mistakenly creates local disk shared storage ASM cannot identify/lock data file

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Mistakenly create the data file on the local disk instead of shared storage

Cause of error:

Data files that are not in shared storage and cannot be accessed by other instances

Ideas and solutions:

Move local data files to shared storage.

Steps

1. Offline tablespace or data file

two。 Copy data file

3. Rename data file

4. Restore data files (tablespaces are not used)

5. Online tablespaces or data files

Replication scheme

1. RMAN copy datafile

2. Dbms_file_transfer.copy_file

3. ASMCMD cp

Detailed steps:

One:

Alter tablespace ts1 offline

Rman > copy datafile 'local directory / source data file' to 'shared directory / target file name;-- the target file name itself

Alter database rename file 'local directory / source data file' to 'shared directory / destination file name'

Alter tablespace ts1 online

Two:

Create directory source_dir as' local directory /'

Create directory dest_dir as' shared directory /'

Alter tablespace ts1 offline

Begin

Dbms_file_transfer.copy_file ('SOURCE_DIR',' source data file name', 'DEST_DIR',' target file name')

End

-- you can confirm whether the copy is correct and successful through the asmcmd command line

/ *

Grid > asmcmd

Asmcmd > cd shared directory

Asmcmd > ls target file name

, /

Alter database rename file 'local directory / source data file name' to 'shared directory / destination file name'

Alter tablespace ts1 online

Three:-- to operate data files, it can only be feasible for tablespaces to add data files, and there is an error in creating tablespaces (the following is changed to tablespaces)

Alter database datafile 'local directory / source data file' offline

Root > mv source data file / home/grid/

Root > chown grid:asmadmin source data file-/ home/grid/ directory operation

Grid > asmcmd

Asmcmd > cd shared directory

Asmcmd > cp / home/grid/ source data file destination file name

Asmcmd > ls

Alter database rename file 'local directory / source data file' to 'shared directory / destination file name'

Alter database recover datafile 'shared directory / destination file name'

Alter database datafile 'shared directory / target file name' online

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