[Translated from MOS] rename the file alias for each file. ID and file. incarnation number

Source: Internet
Author: User
Rename the file alias for each file. ID and file. incarnation number

Reference Original:
Rename alias of datafile as per file. ID and file. incarnation number (Doc ID 1494661.1)

Applicable:
Oracle Database-Enterprise Edition-version 11.2.0.0 and later
Information in this document applies to any platform.

Objectives:
For each database name, remove the data file alias and move them to the correct directory.

Method:
1. Check the alias of the current file from the control file.

2. Verify the alias and OMF file name from asmcmd

3. perform a full backup of the database

4. Make the tablespace offline. If the tablespace has only one datafile

5. Run the set new filename command using RMAN.

Restore tablespace IKP;
Switch datafile all
Recover tablespace

6. Check whether the control file has replaced the alias with a new name. Use the rmalias command to remove an alias from asmcmd

As an optional method, you can use the sqlplus command to rename datafile


Symptoms:

ASM file and alias

Transmit tablespace, and several tablespaces are appended to RAC databases with ASM.
In ASM, the actual file appears to be in the wrong path, which is located in the <diskgroup_name>/ASM/directory.
Instead of under the original path <diskgroup_name>/<database_sid>/datafile
You need to move the file to the correct path in ASM, such as <diskgroup_name>/<database_sid>/datafile/path


Changes:

When you use various methods (asmcmd CP or dbms_file_transfer) to copy datafile at the ASM level,

Assume that you use the asmcmd CP command to copy o1_mf_dcs_83w90ymg _. DBF from the file system to ASM.

Asmcmd> CP/tmp/o1_mf_dcs_83w90ymg _. DBF + Data/orasv3/datafile/o1_mf_dcs_83w90ymg _. DBF

Asmcmd> pwd
+ Data/ASM/datafile

Asmcmd> ls-
+ Data/orasv3/datafile/o1_mf_dcs_83w90ymg _. DBF => ow.wf_dcs_83w90ymg _. dbf.350.792589015

The database show the datafile to be:
+ Data/orasv3/datafile/o1_mf_dcs_83w90ymg _. DBF

Cause:

In the preceding example,
Asmcmd> ls-
+ Data/orasv3/datafile/o1_mf_dcs_83w90ymg _. DBF => ow.wf_dcs_83w90ymg _. dbf.350.792589015


+ Data/orasv3/datafile/o1_mf_dcs_83w90ymg _. DBF ---------- this is alias
O1_wf_dcs_83w90ymg _. dbf.350.792589015 ---------------- original file

Whenever you create a dataifle through dbca or RMAN restore, these datafiles will be created in the correct directory --- diskgroup name/database name/datafile

However, when files are copied using the asmcmd CP method, these files are unknown to ASM and an identity is assigned to these files. ASM gives a file_id and incarnation_number

In other words, this is an alias created when you choose to store data files (target,
Then, datafile is actually stored in + Data/ASM/datafile, such as diskgroup name/ASM/datafile/filename. file_id.incarnation_number.

In the same disk group, we only have alias. In the same disk group, we cannot move dataiile.

If you want to move the database in another disk group,
Please refer to how to move ASM database files from one diskgroup to another? (Docid 330103.1)
This is mentioned in the following connection: In http://docs.oracle.com/cd/B28359_01/server.111/b31107/asmfiles.htm#i1023283


Each file created in ASM obtains a system-generated filename, that is, fully qualified filename.
The fully qualified filename represents a full path name in the ASM file system.

An example of a fully qualified filename is:
+ Dgroup2/sample/controlfile/current.256.541956473

You can use fully qualified filename to reference (read or retrieve) An ASM file.
You can use other short file name formats, such as Alias ASM filename. the alias ASM filename is described as "alias ASM filenames" to reference an ASM file.

Based on the file creation request, ASM generates fully qualified filename. The fully qualified filename cannot be specified for a file creation request.
 
As an alternative, use a simpler syntax to specify a file, such as an alias (alias) or a disk group name.
 
Then, ASM creates a file, places the file in the correct ASM path according to the file type, and assigns a fully qualified filename
 
If alias is specified in the file creation request, ASM can also create alias so that the alias can reference fully qualified filename
 
The ASM file creation request can be a single file creation request or multiple file creation requests.
 
You can use the following query to find the alias (enter the keyword). This query needs to be executed in the ASM instance.
Here, we use 'test' as the keyword.
 
 
 
SQL> select F. file_number, A. Name, ('+' | G. Name | '.' | f. file_number | '.' | f.
2 incarnation) asm_filename, F. Type
3 from V $ asm_diskgroup g, V $ asm_file F, V $ asm_alias
4 where G. group_number = f. group_number
5 and G. group_number = A. group_number
6 and F. file_number = A. file_number
7 and A. name like '% test %'
8 order by F. file_number;

File_number name asm_filename type
------------------------------------------------------------------------------------------------
267 test. CTL + data1.267.790251625 controlfile
291 test.291.784665795 + data.291.784665795 datafile
291 test + data.291.784665795 datafile
296 test. dbf.296.790030721 + data.296.790030721 datafile
296 test. DBF + data.296.790030721 datafile

 
 

Asmcmd> pwd
+ Data/data/datafile

Asmcmd> ls-lt

Type redund striped time sys name
N test => + Data/ASM/datafile/test.291.784665795 >>>>>>>>>>>>>>
N test. DBF => + Data/ASM/datafile/test. dbf.296.790030721 >>>>>>>>
Datafile unprot coarse Aug 22 10:00:00 y big1.20..791388381
Datafile unprot coarse Aug 22 10:00:00 y big2.313.791388437
Datafile unprot coarse Aug 22 10:00:00 y sysaux.257.779883619
Datafile unprot coarse Aug 22 10:00:00 y system.256.779883617
Datafile unprot coarse Aug 22 10:00:00 y undotbs1.258.779883619
Datafile unprot coarse Aug 22 10:00:00 y undotbs2.261.779883897
Datafile unprot coarse Aug 22 10:00:00 y users.259.779883619

Asmcmd>




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.