| 修改时间 31-JUL-2011 类型 HOWTO 状态 PUBLISHED | |||
In this Document
Goal
Solution
ASM Instance:
Database instance:
Applies to:
Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.1.0.6 - Release: 10.1 to 11.1Information in this document applies to any platform.
Goal
ASM files can be renamed like any other files in a standard filesystem. For ASM, rename is peformed through some type of statements (ADD ALIAS, RENAME ALIAS, ADD DIRECTORY) to manipulate filenames, alias, and directories.Renaming datafiles is sometimes needed when database file names still contains old database name after a database on ASM is renamed (for example with nid). Then, it is required to change ASM datafile names accordingly with new database name. RMAN backup copy doesn't work in this case as file still remains in the same diskgroup.
Solution
Please see the steps below for such a rename:ASM Instance:
1- Create directory names within diskgroup.
alter diskgroup dg1 add directory '+/';
alter diskgroup dg1 add directory '+/‘;
alter diskgroup dg1 add directory '+
Example:
old datafile name: +DG1/ee1020/datafile/books.256.652915493
new datafile name: +DG1/DD1020/datafile/books.dbf
alter diskgroup dg1 add directory '+DG1/DD1020';
alter diskgroup dg1 add directory '+DG1/DD1020/datafile';
2- Create an alias for the target datafile name with new path and filename
alter diskgroup dg1 add alias
''
for
'';
Example:
alter diskgroup dg1 add alias '+DG1/DD1020/datafile/books.dbf'
for '+DG1/ee1020/datafile/books.256.652915493';
'
for
'
Example:
alter diskgroup dg1 add alias '+DG1/DD1020/datafile/books.dbf'
for '+DG1/ee1020/datafile/books.256.652915493';
Database instance:
3- Startup database in mount mode and rename the datafile. To use this clause for a datafile or tempfile, the database needs to be in mount mode. The database can also be open, but the datafile or tempfile being renamed must be offline.startup mount
alter database rename file ''
to '';
Example:
alter database rename file '+DG1/ee1020/datafile/books.256.652915493'
to '+DG1/DD1020/datafile/books.dbf';
alter database rename file '
to '
Example:
alter database rename file '+DG1/ee1020/datafile/books.256.652915493'
to '+DG1/DD1020/datafile/books.dbf';
Note: "Rename Alias" on system-created filenames fails with ORA-15177. There is no way to rename a system generated ASM filename. Once a user-created-alias is added in the diskgroup, then you can use "rename alias" to rename the filename within ASM.
Example:
alter diskgroup dg1
rename alias '+DG1/DD1020/datafile/books.dbf'
to '+DG1/DD1020/datafile/books2.dbf';
alter diskgroup dg1
rename alias '+DG1/DD1020/datafile/books.dbf'
to '+DG1/DD1020/datafile/books2.dbf';
产品
| ||
相关的
返回页首