This chapter describes the language used in dataset files. A dataset file is a text file that describes the data that Oracle Secure Backup should back up.
This chapter contains the following topics:
See Also:
The sample dataset files located in the samples subdirectory of the Oracle Secure Backup home
The Oracle Secure Backup dataset language provides a simple, text-based means to define file-system data to back up. The language has the following characteristics:
Comments can appear anywhere following a pound sign (#).
Dataset statements use the following syntax:
statement-name [ statement-argument ]
The statement-name
placeholder represents a dataset statement. These statements are described in "Dataset Statements".
Some statements can begin a nested block. Statements within the block apply only to the statement that began the block. Nested block statements have the following form:
statement-name [ statement-argument ] { statement-name [ statement-argument ] ... }
An escape character, which is represented by a backslash (\
), can appear anywhere to remove the special meaning of the character following it.
Blank lines are ignored.
Example 5-1 is a sample dataset file that describes a backup of directories on brhost2.
# # A sample dataset file # exclude name *.backup # never back up directories or files exclude name *~ # matching *.backup and *~ include host brhost2 { # back up host brhost2 include path /usr1/home { # back up /usr1/home on brhost2, exclude path peter # skip subdirectory peter (relative path) exclude path /usr1/home/dinesh # also skip subdir dinesh (absolute path) } include path /usr2/home # also back up /usr2/home, including } # all subdirectories
This section presents examples of dataset files.
This section contains the following topics:
Example 5-2 shows a complex dataset file that describes four host systems to be backed up. It specifies that all files in the /home
, /usr
, and /usr2
directories and all files in subdirectories within these directories are to be backed up.
All files in the /usr/tmp
directory are excluded from the dataset. Files that have the name core and files that have names ending in .bak
, regardless of where they reside, are also excluded from the dataset.
A dataset file can logically include the contents of another dataset file. The include
dataset
statement lets you include by reference the contents of another dataset file.
Consider the sample dataset file called common-exclusions.ds
shown in Example 5-3.
Example 5-3 common-exclusions.ds
exclude name core exclude name *~ exclude name *.tmp exclude name *.temp
A dataset file can use these exclusions with the statement shown in Example 5-4.
To apply these exclusions to one path but not to another, specify the include
dataset
directive within braces as shown in Example 5-5.
You can use braces with an include rule to define the scope of a backup. In Example 5-6, Oracle Secure Backup backs up paths /usr1
and /usr2
on all servers and backs up /usr3
and /usr4
on brhost3
only. Note that the order in which the rules appear within the braces has no affect on the rules.
Example 5-6 Using Braces to Limit Scope
# Common trees backed up on all servers: include path /usr1 include path /usr2 # Servers to back up; on brhost3, we also back up usr3 & usr4, too: include host brhost1 include host brhost2 include host brhost3 { include path /usr3 include path /usr4 }
You can use additional braces to further refine the scope of rules. Example 5-7 alters Example 5-6 to exclude files ending with .junk from /usr4
on brhost3
only.
Example 5-7 Refining the Scope of a Set of Rules
# Common trees backed up on all servers: include path /usr1 include path /usr2 # Servers to back up; on brhost3, back up /usr3 and /usr4, but exclude *.junk # files in /usr4 only: include host brhost1 include host brhost2 include host brhost3 { include path /usr3 include path /usr4 { exclude name *.junk } }
If you specify a wildcard pattern in an exclude
path
or exclude
name
statement, then Oracle Secure Backup release 10.4 attempts to match the pattern while respecting path separators. If you specify pattern src/*.pl
, for example, then Oracle Secure Backup would exclude src/a.pl
but not src/tmp/b.pl
.
The exclusion statement wildcard pattern matching in previous releases of Oracle Secure Backup did not respect path separators. If you specified the same src/*.pl
pattern, for example, then Oracle Secure Backup would exclude both src/a.pl
and src/tmp/b.pl
.
If you have upgraded to Oracle Secure Backup release 10.4 from an earlier Oracle Secure Backup release, then you can continue using your existing exclude
path
and exclude
name
statements. Some files and directories that were excluded from backups in the earlier Oracle Secure Backup release are now not excluded. This causes your backup files to be somewhat larger, but all data still backed up.
A dataset description can contain the following types of statements:
See Also:
"Dataset File Examples" for examples of description files that use these statements.Use the after
backup
statement to direct Oracle Secure Backup to run a computer executable or interpreted program after completing a backup. By using the before backup statement, you can also run the same or a different program before the backup begins. These statements are useful, for example, when you want to shut down and restart a database server or inform users that a backup has started or completed.
By default, Oracle Secure Backup stops the backup job and considers it failed if the specified executable does not exist or fails, that is, returns a nonzero exit code.
after backup [ optional ] pathname
The pathname
placeholder represents the name of the program to be run on a client host. For backups using a Network Data Management Protocol (NDMP) data service, Oracle Secure Backup runs the program on the administrative server.
The optional
keyword specifies that Oracle Secure Backup should ignore the status returned from the invoked program and also the inability to invoke this program.
Example 5-8 after backup Statement
This example directs Oracle Secure Backup to pass the argument /usr2 is being saved
to program /etc/local/nfy
on host brhost2
after backing up directory /usr2
.
include host fserver { include path /usr2 after backup "/etc/local/nfy '/usr2 backup complete'" }
Oracle Secure Backup automatically appends the following arguments to any that you specify:
The token after
The name of the client
The name of the directory or file being backed up
The exit status of the backup operation (a numeric value documented in the file OSB_HOME/samples/obexit.h
.)
Thus, in this example Oracle Secure Backup runs the nfy
program on brhost2
as if you entered:
/usr/local/nfy '/usr2 backup complete' after brhost2 /usr2 exit-code
Use the before backup
statement to direct Oracle Secure Backup to run a computer executable or interpreted program before beginning a backup. This statement is parallel to the after backup statement.
By default, Oracle Secure Backup does not begin the backup job and considers it failed if the specified executable does not exist or fails, that is, returns a nonzero exit code.
The pathname
placeholder represents the name of the program to be run on a client host. For backups using a Network Data Management Protocol (NDMP) data service, Oracle Secure Backup runs the program on the administrative server.
before backup [ optional ] pathname
The optional
keyword specifies that Oracle Secure Backup should ignore the status returned from the invoked program and also the inability to invoke this program.
Example 5-9 before backup Statement
This example directs Oracle Secure Backup to pass the argument /usr2 is being saved
to program /etc/local/nfy
on host brhost2
before backing up directory /usr2
.
include host brhost2 { include path /usr2 before backup "/etc/local/nfy '/usr2 is being saved'" }
Oracle Secure Backup automatically appends the following arguments to any that you specify:
The token before
The name of the client
The name of the directory or file being backed up
Thus, in this example Oracle Secure Backup runs the nfy
program on brhost2
as if you entered:
/usr/local/nfy '/usr2 is being saved' before brhost2 /usr2
Use the cross all mountpoints
statement to cross local and remote mount points. A local mount point mounts a local file system; a remote mount point is a local mount of a file system accessed over the network. By default, a file-system backup does not cross mount points.
Suppose /home/usr1/loc_data
mounts a local file system, while /home/usr1/rem_data
is an Network File System (NFS) mount point for a file system on a network host. You can use cross all mountpoints
to specify that a backup of /home/usr1
includes all files in this directory, whether local or mounted.
Example 5-10 Global Host Inclusion
This example crosses all local and remote mount points on hosts brhost1
and brhost2
.
cross all mountpoints include host brhost1 { include path /home/usr1 } include host brhost2 { include path /home/usr2 }
Use the cross local mountpoints
statement to cross local (but not remote) mount points.
Suppose /home/usr1/loc_data
mounts a local file system while /home/usr1/rem_data
is a Network File System (NFS) mount point for a file system on a network host. You can use cross local mountpoints
to specify that a backup of /home/usr1
includes files in /home/usr1/loc_data
but not /home/usr1/rem_data
.
Example 5-13 Global Host Inclusion
This example crosses only local mount points in the file systems for hosts brhost1
and brhost2
.
cross local mountpoints include host brhost1 { include path /home/usr1 } include host brhost2 { include path /home/usr2 }
Example 5-14 Global Path Inclusion
This example crosses local mount points in the /home/usr1
path on host brhost1
, but does not cross mount points in the /home/usr2
path on brhost2
.
include host brhost1 { cross local mountpoints include path /home/usr1 } include host brhost2 { include path /home/usr2 }
Use the cross remote mountpoints
statement to cross remote (but not local) mount points.
Suppose /home/usr1/loc_data
is a mount point for a local file system, while /home/usr1/rem_data
is a Network File System (NFS) mount point for a file system on a network host. You can use cross remote mountpoints
to specify that a backup of /home/usr1
includes files in /home/usr1/rem_data
but not /home/usr1/loc_data
.
Example 5-16 Global Host Inclusion
This example crosses only remote mount points in the file systems on hosts brhost1
and brhost2
.
cross remote mountpoints include host brhost1 { include path /home/usr1 } include host brhost2 { include path /home/usr2 }
Use the exclude
dir
statement to identify a directory or set of directories to exclude from a backup. It differs from exclude
name
in that it does not exclude files matching the specified pattern.
Specifies the directory or set of directories to be excluded. The pattern
placeholder must not include any path separators. It supports Oracle Secure Backup-style wildcard syntax expression-based pattern matching.
Use the exclude
file
statement to identify file-system objects to exclude from backup by file name, without regard for the directory location of the file. It differs from exclude
name
in that it does not exclude directories matching the specified pattern.
Specifies the file or set of files to be excluded. The pattern
placeholder must not include any path separators. It supports Oracle Secure Backup-style wildcard syntax expression-based pattern matching.
Use the exclude
name
statement to identify file-system objects to exclude from backup either by the right-most matching component name in the path, which is called the leafname, or by a matching relative path or pattern.
See Also:
"Backward Compatibility"Oracle Secure Backup compares the component name of each file-system object with the specified leafname
. If they match, then Oracle Secure Backup does not back up the file-system object. If it is a directory, then Oracle Secure Backup does not back up the directory contents.
Oracle Secure Backup interprets leafname
as a Oracle Secure Backup-style wildcard expression if it contains any of the unescaped special characters *
, ?
, [
, or ]
. If leafname
contains these characters, then Oracle Secure Backup performs a wildcard comparison rather than a string comparison to determine whether the names match.
Oracle Secure Backup compares the component name of each file-system object with the specified relative_pathname
relative to the current included path. If they match, then Oracle Secure Backup does not back up the file-system object. If relative_pathname
references a directory, then Oracle Secure Backup does not back up the directory contents.
Oracle Secure Backup interprets relative_pathname
as a Oracle Secure Backup-style wildcard expression if it contains any of the unescaped special characters *
, ?
, [
, or ]
. If relative_pathname
contains these characters, then Oracle Secure Backup performs a wildcard comparison rather than a string comparison to determine whether the names match.
Example 5-19 exclude name Statement
Assume a directory tree containing the following files and directories:
/src /src/abc /src/abc/a.pl /src/tmp /src/tmp/g.pl /src/tmp/src/d.plaf /src/tmp/src/a.pldir /src/tmp/src/a.pldir/a.pl /src/tmp/src/a.pldir/s.tmp /src/tmp/src/a.pl /src/a.pl /src/b.pl
You create a dataset with the following contents:
exclude name d exclude name *.tmp
The dataset statements exclude files or directories named d
and files whose names end in .tmp
. For the assumed directory tree, the following items would be excluded from backup operations:
/src/tmp/src/d.plaf /src/tmp/src/a.pldir/s.tmp
Use the exclude oracle database files
statement to exclude all Oracle database-related files that would ordinarily be backed up by Recovery Manager (RMAN) or files whose backup is not recommended. Oracle Secure Backup excludes the files regardless of whether the files being excluded are part of an existing RMAN backup strategy.
Oracle Secure Backup excludes the following types of files:
Data files (production files and image copies of those files)
Control files
Redo logs, both online and archived
Flashback logs
Change tracking file
Backup pieces
Tempfiles
Note:
You use the Oracle Enterprise Manager job scheduler to schedule a database backup through RMAN and the Oracle Secure Backup job scheduler to schedule a file-system backup. Thus, to back up an Oracle database host with Oracle Secure Backup, you must set up two schedules in Enterprise Manager and Oracle Secure Backup. Use theexclude oracle files
statement in the Oracle Secure Backup schedule so that the Oracle database-related files are not backed up twice.Use the exclude
path
statement to identify the path name or wildcard pattern of file-system objects to exclude from the backup.
See Also:
"Backward Compatibility"Specifies a path or pattern matching subdirectories or files in subdirectories relative to the root of the file system. Absolute paths on Windows platforms begin with drive-letter
:\, and on UNIX with /.
Specifies a path or pattern matching subdirectories or files in subdirectories relative to the current include path
.
Example 5-21 exclude path Statement
Assume the following set of directories and files to be backed up on host osblin1
:
/src /src/abc /src/abc/a.tmp /src/tmp /src/tmp/g.pl /src/tmp/src/d.tmp1 /src/tmp/src/a.tmprary /src/tmp/src/a.pldir/a.tmp /src/tmp/src/d.tmp-out /src/tmp/src/a. /src/a.pl /src/b.pl /misc /misc/yesterday.tmp /misc/tmpsql.out
The following dataset specifies a backup of the /
directory on osblin1
, but skips files in /src/tmp
and files with the extension .tmp
at any level of the /src
directory.
include host osblin1 { include path / { exclude path src/tmp exclude path recursive *.tmp } }
Use the include
catalog
statement to direct Oracle Secure Backup to back up all data on the administrative server required to restore the Oracle Secure Backup catalog. This directive is expanded internally by the dataset parser to a list of all required files and databases.
This directive can be included in other datasets. But it cannot be used within an include host bloc, because by definition it only applies to the administrative server host.
You can add extra files and paths on the administrative server host to the files backed up by include
catalog
by listing include path, exclude path and exclude name directives within block delimiters beneath the include
catalog
directive. No other directives are permitted within the include
catalog
block.
A catalog backup is always created as a full backup and never as an incremental backup. Restoring from incremental backups is difficult without the contents of the catalog, so creating catalog backups as full backups is more reliable.
In a catalog recovery situation, the wallet containing encryption keys might not be available. Therefore, the expanded catalog directive and its children are handled in a separate job by the scheduler, which runs with storage encryption policies disabled.
You can still use transient passphrase encryption to protect this backup, because transient passphrase encryption does not depend upon the wallet.
If you use include
path
directives to add extra files with sensitive contents to the catalog backup, then consider using transient passphrase encryption to protect the backup containing these files.
Include all data required for a future catalog recovery.
Specify include path directives to add to the data backed up for catalog backups. Use exclude path and exclude name directives to subtract from the data backed up for catalog backups.
Use the include
dataset
statement to direct Oracle Secure Backup to read another dataset file and logically substitute its contents for the include
dataset
statement. This statement is analogous to include statements found in most programming languages.
include dataset dataset_file_name
The dataset_file_name
placeholder represents the name of a dataset file or directory. If you supply the name of a dataset directory, then Oracle Secure Backup includes each member of the directory.
Use the include host
statement to identify the name of a client host to back up. An include host
statement can be located anywhere in the dataset file.
A usable dataset file must have at least one host statement either within the dataset file or within an included dataset file.
The include host
statements takes either of the following forms.
include host hostname {statements_that_apply_to_hostname}
The hostname
placeholder represents the name of a client you defined earlier with the Oracle Secure Backup Web tool interface or the mkhost
or renhost
commands.
Use the include
path
statement to identify the name of a file-system object to back up.
Backup paths cannot exceed the maximum path length of the file system being backed up, and in any case they cannot exceed 260 characters on Windows systems or 1024 characters on other operating systems.
Path names on both Windows and Linux/UNIX can include the standard wildcard characters *
, ?
, [
, and ]
. If you have path names that include any of these wildcard characters, then you must precede each such character with a backslash (\
) character to prevent special interpretation of these characters.
To reduce the risk of unauthorized access to obfuscated wallets, Oracle Secure Backup, by default, does not back up obfuscated wallets. However, you can back up the obfuscated wallet by explicitly listing its file name with the complete path in the include path statement of your dataset. Example 5-30, "Dataset File for backing up Obfuscated Wallets in Unencrypted Backups" describes how to include an obfuscated wallet in your dataset. The obfuscated wallet is also backed up if it is included in an Oracle Secure Backup encrypted backup.
During an Oracle Secure Backup encrypted backup, the obfuscated wallet is backed up if the dataset includes the directory that contains the cwallet.sso
file. For example, an encrypted backup of the dataset that contains the following include path
statement backs up the contents of the wallet directory along with the obfuscated wallet that is contained in this directory:
include path /usr/local/apps/wallet
include path absolute-pathname
The absolute-pathname
placeholder represents the path name of the file-system object to back up, starting at the file-system root. Surround path names containing spaces within single or double quotes.
Example 5-25 include path Statement on Windows
This example shows an include path
statement on a Windows system. The path contains spaces, so it is surrounded by double quotes.
include path "C:\Documents and Settings"
Example 5-26 include path Statement on Linux/UNIX
For Linux or UNIX systems, the include path
statements do not include tape drive designators or quotation marks. This example shows an include
path
statement on a Linux or UNIX system.
include path /space { # include the local root directory exclude name core # but no core files (for UNIX) exclude name *~ # and no emacs backup files } include path /etc
Example 5-27 include host Statements
You can nest an include path
statement within an include host
statement. Consider the dataset statements shown in this example.
Oracle Secure Backup interprets each include
path
statement in the dataset file to apply to each include
host
statement. Thus, Oracle Secure Backup backs up the /home
and /project
directories on each host, brhost2
and brhost3
.
include host brhost2 include host brhost3 include path /home include path /project
Example 5-28 Dataset File with include host and include path Statements
This example backs up /home
on host brhost2
and /project
on host brhost3
. The statements in this example are equivalent to the statements in Example 5-29.
include host brhost2 { include path /home include path /project } include host brhost3 { include path /home include path /project }
Example 5-29 Dataset File with include host and include path Statements
The statements in this example are equivalent to the statements in Example 5-28.
include host brhost2 { include path /home } include host brhost3 { include path /project }
Only include multiple hosts or paths in a dataset file if you always back them up. The Oracle Secure Backup scheduler and on-demand backup functions use dataset file names, not path names, to define each backup job.
Example 5-30 Dataset File for backing up Obfuscated Wallets in Unencrypted Backups
This example shows a dataset that is used to include an obfuscated wallet as part of an unencrypted backup. The obfuscated wallet cwallet.sso
is stored in the /usr/local/apps/wallet
directory. The following dataset includes the obfuscated wallet along with the contents of the /usr/local/apps/wallet
directory.
include host brhost2 { include path /usr/local/apps/wallet include path /usr/local/apps/wallet/cwallet.sso }
Although cwallet.sso
is part of the /usr/local/apps/wallet
folder, it will be included in an unencrypted backup only if it is explicitly listed using an include path statement.
Note:
Wildcard characters cannot be used to include the obfuscated wallet in your backup. For example, you cannot use the following statement to add the obfuscated wallet to a dataset:include path /usr/local/apps/wallet/cwallet.*