Distributed Configuration Management Reference Guide
10g (9.0.4) Part No. B12052-01 |
|
This chapter describes DCM archiving capabilities, and explains how to restore saved configurations from archives.
This chapter covers the following topics:
The dcmctl
utility provides commands (listed in Table 2-6, "Archive Commands") that enable you to create an archive of the configuration of an Oracle Application Server instance or cluster, and then apply the archived configuration to the same instance or cluster, or to a different instance or cluster. The archiving feature makes it easy to save configurations before making changes to the system, or to save and restore a particular configuration for specific purposes, such as operating one configuration during the day and another at night.
Note: ThesaveInstance and restoreInstance commands are deprecated; the archiving feature contains all of the functionality provided by saveInstance and restoreInstance .
|
The Oracle Universal Installer invokes the archiving function at the end of installation, so the initial configuration of Distributed Configuration Management is archived. The name of this archive is:
When an archive is created, the configuration and application deployment information associated with the archived object (the Oracle Application Server instance or cluster) is stored in the repository. This archived image can then be applied to any compatible instance or cluster in the repository, or exported to a file to be applied to an instance or cluster in another repository. The compatibility of an archive with an instance or cluster is similar to the compatibility of instances to be clustered.
Applying archives to instances and clusters is subject to these compatibility rules:
The source of the archive must have the same installed components configured as the destination. If the destination is a cluster, the archive cannot contain any non-clusterable objects.
Information specific to an instance, such as host name, can only be applied back to the instance from which it came.
The configuration from one instance or cluster may be applied directly to another instance or cluster. That is, the apply functionality can take, as a source, an archive of an instance or a cluster.
You can export an archive from the repository to a file, and then import the file back to the same repository or to a different repository. You can change the name of the archive and associated comments during the import. The original archive name and comments are the defaults.
You can also export from a repository to a file, and import from a file to a repository. The import and export functionality allows an archive to be moved from one repository to another. Archives can be moved from:
A Database repository to another Database repository
A File based repository to another File based repository
A Database repository to a File based repository
A File based repository to a Database repository
The exported archive file is in a .jar format. Two entries in the jar file encapsulate a description of the archive: Export_Information
and Archive_Information
. These entries can be extracted from the export file and viewed as text. The other entries in the export file contain the configuration information, one entry per component instance. Example 4-1, Example 4-2, and Example 4-3 provide sample archive files.
Caution: Do not edit the archive files. If you do, the archive may not function as it should. |
Example 4-1 Expanded Export file
Archive_Information Export_Information Default_Information HTTP Server home Component1 Component2
Example 4-2 Export_Information File
Export_Information: Version: 9.0.4.0.0 Comments: ÒUser comments about the exportÓ Farm: dbmachine.1234.5678 Create Time: Mon Sep 30 12:42:10 PDT 2002
Example 4-3 Archive_Information File
Archive_Information: Name: archive1 Source: cluster1 Version: 9.0.4.0.0 Configured Component Types: [Apache, J2EE] Comments: ÒUser comments about the archiveÓ Create Time: 2002-09-26 16:46:40.0 Clusterable:true
Using automatic archiving, an archive is created automatically when you perform any operation listed in Table 4-1. The automatic archives coexist with archives created with the createArchive
command, and are made distinct by their system-generated name. Example 4-6 shows an example of an automatic archive name for archive 2 in the example.
Table 4-1 Automatic Archive Operations
Add an instance to a cluster |
Change a cluster’s attributes |
Change an instance’s attributes |
Configure Oracle Application Server Single Sign-On with configuration tool |
Create a new OC4J instance |
Deploy a J2EE application |
Dump or clear instrumentation timers |
Issue the updateConfig command |
Join a cluster |
Perform a configuration change with System Management Interface |
Remove an OC4J instance |
You can specify the number of automatic archive versions you want to save, or disable automatic archiving with the set command, using the -arch
option and an integer, as shown in Example 4-4 and Example 4-5.
Example 4-4 Setting Automatic Archiving to Save 10 Versions
dcmctl set -arch 10
Example 4-5 Turning Automatic Archiving Off
dcmctl set -arch 0
Automatic archives have system-generated names that resemble those shown in archive 2 in Example 4-6. Automatic archive names all begin with dcm.autoarchive
. Appended to this is the IP address of the computer, an identifier for the DCM operation that triggered the archive, and a user ID that is unique to the computer. This ensures that the automatic archive name is unique across the farm. When an instance is a member of a cluster, the Source: identifier is shown as: "cluster:
cluster name
".
Example 4-6 Automatic Archive Names (listArchives Command Output)
dcmctl> listarchives 1 Name: InstalledImage_10gM21.example.com Source: instance: 10gM21.example.com Version: 9.0.4.0.0 Comments: This is an archive of the initial installed configuration for this instance. Created: 2003-11-12 14:08:34.162 Clusterable: true 2 Name: dcm.autoarchive_222.222.3.12.999f1921.f8d70c4e79.-7fff Source: instance: 10gM21.example.com Version: 9.0.4.0.0 Comments: Automatic archival prior to hand-editing of configuration files OC4J OHS opmn jazn Created: 2003-11-13 13:45:49.259 Clusterable: true
You should save the DCM configuration regularly. You may find it useful to create "before" and "after" snapshots of a configuration when extensive configuration changes are performed.
Issue one of the following commands (depending on the configuration):
dcmctl createarchive -arch
archive_name
-cl
cluster_name
or
dcmctl createarchive -arch
archive_name
-i
instance_name
(Optional) Export the archive to the file system with this command:
dcmctl exportarchive -arch
archive_name
-f
file_name
Note: Archives are stored in the repository. If you do not export an archive to the file system, and the repository is destroyed, archives saved there are lost. Exporting the archive to a file system provides an extra measure of safety. |
If, by accident, an instance is destroyed or a repository contains errors, you can restore the configuration from an exported archive with the import command:
dcmctl importarchive -arch
archive_name
-f
file_name
You can restore an archive to the DCM repository with one of the following commands:
dcmctl applyarchiveto -arch
archive_name
-cl
cluster_name
dcmctl applyarchiveto -arch
archive_name
-i
instance_name