36 Using Information Provisioning
This chapter describes how to use information provisioning. This chapter includes an example that creates a tablespace repository, examples that transfer tablespaces between databases, and an example that uses a file group repository to store different versions of files.
The following topics describe using information provisioning:
See Also:
36.1 Using a Tablespace Repository
The following procedures in the DBMS_STREAMS_TABLESPACE_ADM
package can create a tablespace repository, add versioned tablespace sets to a tablespace repository, and copy versioned tablespace sets from a tablespace repository:
-
ATTACH_TABLESPACES
: This procedure copies a version of a tablespace set from a tablespace repository and attaches the tablespaces to a database. -
CLONE_TABLESPACES
: This procedure adds a new version of a tablespace set to a tablespace repository by copying the tablespace set from a database. The tablespaces in the tablespace set remain part of the database from which they were copied. -
DETACH_TABLESPACES
: This procedure adds a new version of a tablespace set to a tablespace repository by moving the tablespace set from a database to the repository. The tablespaces in the tablespace set are dropped from the database from which they were copied.
This section illustrates how to use a tablespace repository with an example scenario. In the scenario, the goal is to run quarterly reports on the sales tablespaces (sales_tbs1
and sales_tbs2
). Sales are recorded in these tablespaces in the inst1.example.com
database. The example clones the tablespaces quarterly and stores a new version of the tablespaces in the tablespace repository. The tablespace repository also resides in the inst1.example.com
database. When a specific version of the tablespace set is required to run reports at a reporting database, it is copied from the tablespace repository and attached to the reporting database.
In this example scenario, the following databases are the reporting databases:
-
The reporting database
inst2.example.com
shares a file system with theinst1.example.com
database. Also, the reports that are run oninst2.example.com
might make changes to the tablespace. Therefore, the tablespaces are made read/write atinst2.example.com
, and, when the reports are complete, a new version of the tablespace files is stored in a separate directory from the original version of the tablespace files. -
The reporting system
inst3.example.com
does not share a file system with theinst1.example.com
database. The reports that are run oninst3.example.com
do not make any changes to the tablespace. Therefore, the tablespaces remain read-only atinst3.example.com
, and, when the reports are complete, the original version of the tablespace files remains in a single directory.
The following sections describe how to create and populate the tablespace repository and how to use the tablespace repository to run reports at the other databases:
-
Using a Tablespace Repository for Remote Reporting with a Shared File System
-
Using a Tablespace Repository for Remote Reporting without a Shared File System
These examples must be run by an administrative user with the necessary privileges to run the procedures listed previously.
See Also:
Oracle Database PL/SQL Packages and Types Reference for more information about these procedures and the privileges required to run them
36.1.1 Creating and Populating a Tablespace Repository
This example creates a tablespaces repository and adds a new version of a tablespace set to the repository after each quarter. The tablespace set consists of the sales tablespaces for a business: sales_tbs1
and sales_tbs2
.
Figure 36-1 provides an overview of the tablespace repository created in this example:
The following table shows the tablespace set versions created in this example, their directory objects, and the corresponding file system directory for each directory object.
Version | Directory Object | Corresponding File System Directory |
---|---|---|
|
|
|
|
|
|
This example makes the following assumptions:
-
The
inst1.example.com
database exists. -
The
sales_tbs1
andsales_tbs2
tablespaces exist in theinst1.example.com
database.
The following steps create and populate a tablespace repository:
36.1.2 Using a Tablespace Repository for Remote Reporting with a Shared File System
This example runs reports at inst2.example.com
on specific versions of the sales tablespaces stored in a tablespace repository at inst1.example.com
. These two databases share a file system, and the reports that are run on inst2.example.com
might make changes to the tablespace. Therefore, the tablespaces are made read/write at inst2.example.com
. When the reports are complete, a new version of the tablespace files is stored in a separate directory from the original version of the tablespace files.
Figure 36-2 provides an overview of how tablespaces in a tablespace repository are attached to a different database in this example:
Figure 36-2 Attaching Tablespaces with a Shared File System
![Description of Figure 36-2 follows Description of Figure 36-2 follows](img/strms054.gif)
Description of "Figure 36-2 Attaching Tablespaces with a Shared File System"
Figure 36-3 provides an overview of how tablespaces are detached and placed in a tablespace repository in this example:
Figure 36-3 Detaching Tablespaces with a Shared File System
![Description of Figure 36-3 follows Description of Figure 36-3 follows](img/strms055.gif)
Description of "Figure 36-3 Detaching Tablespaces with a Shared File System"
The following table shows the tablespace set versions in the tablespace repository when this example is complete. It shows the directory object for each version and the corresponding file system directory for each directory object. The versions that are new are created in this example. The versions that existed before this example were created in "Creating and Populating a Tablespace Repository".
Version | Directory Object | Corresponding File System Directory | New? |
---|---|---|---|
|
|
|
No |
|
|
|
Yes |
|
|
|
No |
|
|
|
Yes |
This example makes the following assumptions:
-
The
inst1.example.com
andinst2.example.com
databases exist. -
The
inst1.example.com
andinst2.example.com
databases can access a shared file system. -
Networking is configured between the databases so that these databases can communicate with each other.
-
A tablespace repository that contains a version of the sales tablespaces (
sales_tbs1
andsales_tbs2
) for various quarters exists in theinst1.example.com
database. This tablespace repository was created and populated in the example "Creating and Populating a Tablespace Repository".
Complete the following steps:
36.1.3 Using a Tablespace Repository for Remote Reporting without a Shared File System
This example runs reports at inst3.example.com
on specific versions of the sales tablespaces stored in a tablespace repository at inst1.example.com
. These two databases do not share a file system, and the reports that are run on inst3.example.com
do not make any changes to the tablespace. Therefore, the tablespaces remain read-only at inst3.example.com
, and, when the reports are complete, there is no need for a new version of the tablespace files in the tablespace repository on inst1.example.com
.
Figure 36-4 provides an overview of how tablespaces in a tablespace repository are attached to a different database in this example:
Figure 36-4 Attaching Tablespaces without a Shared File System
![Description of Figure 36-4 follows Description of Figure 36-4 follows](img/strms056.gif)
Description of "Figure 36-4 Attaching Tablespaces without a Shared File System"
The following table shows the directory objects used in this example. It shows the existing directory objects that are associated with tablespace repository versions on the inst1.example.com
database, and it shows the new directory objects created on the inst3.example.com
database in this example. The directory objects that existed before this example were created in "Creating and Populating a Tablespace Repository".
Directory Object | Database | Version | Corresponding File System Directory | New? |
---|---|---|---|---|
|
|
|
|
No |
|
|
|
|
No |
|
|
Not associated with a tablespace repository version |
|
Yes |
|
|
Not associated with a tablespace repository version |
|
Yes |
This example makes the following assumptions:
-
The
inst1.example.com
andinst3.example.com
databases exist. -
The
inst1.example.com
andinst3.example.com
databases do not share a file system. -
Networking is configured between the databases so that they can communicate with each other.
-
The sales tablespaces (
sales_tbs1
andsales_tbs2
) exist in theinst1.example.com
database.
Complete the following steps:
36.2 Using a File Group Repository
The DBMS_FILE_GROUP
package can create a file group repository, add versioned file groups to the repository, and copy versioned file groups from the repository. This section illustrates how to use a file group repository with a scenario that stores reports in the repository.
In this scenario, a business sells books and music over the internet. The business runs weekly reports on the sales data in the inst1.example.com
database and stores these reports in two HTML files on a computer file system. The book_sales.htm
file contains the report for book sales, and the music_sales.htm
file contains the report for music sales. The business wants to store these weekly reports in a file group repository at the inst2.example.com
remote database. Every week, the two reports are generated on the inst1.example.com
database, transferred to the computer system running the inst2.example.com
database, and added to the repository as a file group version. The file group repository stores all of the file group versions that contain the reports for each week.
Figure 36-5 provides an overview of the file group repository created in this example:
The benefits of the file group repository are that it stores metadata about each file group version in the data dictionary and provides a standard interface for managing the file group versions. For example, when the business must view a specific sales report, it can query the data dictionary in the inst2.example.com
database to determine the location of the report on the computer file system.
The following table shows the directory objects created in this example. It shows the directory object created on the inst1.example.com
database to store new reports, and it shows the directory objects that are associated with file group repository versions on the inst2.example.com
database.
Directory Object | Database | Version | Corresponding File System Directory |
---|---|---|---|
|
|
Not associated with a file group repository version |
|
|
|
|
|
|
|
|
|
This example makes the following assumptions:
-
The
inst1.example.com
andinst2.example.com
databases exist. -
The
inst1.example.com
andinst2.example.com
databases do not share a file system. -
Networking is configured between the databases so that they can communicate with each other.
-
The
inst1.example.com
database runs reports on the books and music sales data in the database and stores the reports as HTML files on the computer file system.
The following steps configure and populate a file group repository at a remote database:
The file group repository now contains two versions of the file group that contains the sales report files. Repeat steps 12-17 to add new versions of the file group to the repository.
See Also:
-
Oracle Database PL/SQL Packages and Types Reference for more information about the
DBMS_FILE_GROUP
package