Oracle® Database Backup and Recovery Reference 10g Release 2 (10.2) Part Number B14194-03 |
|
|
PDF · Mobi · ePub |
fileNameConversionSpec::=
A subclause that specifies one or more patterns to be used in generating new database file names based on old ones. Used with BACKUP , CONVERT and DUPLICATE as one way of generating output file names.
The rules for these patterns and how they affect file naming are the same as those for the initialization parameter DB_FILE_NAME_CONVERT
. In parentheses, provide an even number of string patterns.
When a new filename is generated based on an old one, the original filename is compared to the first member of each pair of string patterns. The first time a pattern is found which is a substring of the original filename, the new filename is generated by substituting the second member of the pair for the substring that matched.
Set the string_pattern
to a value such as:
DB_FILE_NAME_CONVERT = ('string1' , 'string2' , 'string3' , 'string4' ...)
where:
string1
is a pattern matching the orignal filename
string2
is the pattern replacing string1
in the generated filename
string3
is a pattern matching the orignal filename
string4
is the pattern replacing string3
in the generated filename
You can use as many pairs of primary and standby replacement strings as required.
For example, when making image copy backups of tablespaces users
(with datafiles in directory /disk1/dbs/users
) and tools
(with datafiles in /disk1/dbs/tools/
), to direct the converted datafiles to /newdisk/users
and /newdisk/tools
respectively, use the DB_FILE_NAME_CONVERT
pattern shown here:
BACKUP AS COPY TABLESPACE users, tools DB_FILE_NAME_CONVERT = ('disk1/dbs','newdisk');
For each datafile to be converted where 'disk1/dbs
' is a substring of the filename, the new filename is created by replacing 'disk1/dbs
' with 'newdisk
'. For example, the converted datafile corresponding to /disk1/dbs/users/users01.dbf
is stored in /newdisk/users/users01.dbf
, the converted datafile corresponding to /disk1/dbs/tools/tools01.dbf
is stored in /newdisk/tools/tools.dbf
, and so on.
Be aware of the following details:
The pattern does not have to match at the beginning of the filename. In the previous example, the match of the pattern to the original filename began at the second character. The command
BACKUP AS COPY TABLESPACE users DB_FILE_NAME_CONVERT = ('dbs','newdbs');
would direct the image copies to /disk1/newdbs/users
and /disk1/newdbs/tools
.
For the CONVERT TABLESPACE, CONVERT DATABASE, and BACKUP AS COPY commands, if the source files for these operations are Oracle Managed Files, then fileNameConversionSpec
cannot be used to convert the source filenames into new output filenames. For Oracle Managed Files, either in Automated Storage Management (ASM) or in ordinary filesystem storage, the database must be allowed to generate the filenames for the output files.
For example, an OMF filename for a datafile in non-ASM storage might be of the form:
/private/boston/datafile/01_mf_system_ab12554_.dbf
An OMF filename from ASM storage might be of the form:
+DISK/boston/datafile/system.256.4543080
Only the database can generate and manage specific OMF filenames, and substituting the name of a different disk group or a different OMF location into an OMF filename generally does not produce a valid filename in the new destination. To convert OMF filenames for storage in another OMF location, use an alternative such as a FORMAT clause with these commands to specify the new output location and allow the database to manage the specific output filenames.
Syntax Element | Description |
---|---|
'string_pattern' |
Specifies the pattern, consisting of the pairs of strings used to convert the filenames.. |
Using DB_FILE_NAME_CONVERT with Multiple String Patterns: Example This example shows the use of DB_FILE_NAME_CONVERT
with BACKUP AS COPY
to create image copies of the users
and tools
tablespaces from the previous discussion, directing users
to /newdisk1
and tools
to /newdisk2
:
BACKUP AS COPY DEVICE TYPE DISK DB_FILE_NAME_CONVERT=('/disk1/dbs/users','/newdisk1', '/disk1/dbs/tools','/newdisk2') TABLESPACE tools, users;