Manual archiving of daily tablespaces is performed in the following steps:It is recommended to archive single DTS via web interface or using the iw_space_manager utility. The order of archiving daily tablespaces manually in the database is described below. | Предупреждение |
|---|
| In this method of archiving, data stored in the Data Storage are not archived. |
Selecting daily tablespaces and data files To get a list of disconnected tablespaces, you must run the following query to the database under the account of the database schema owner. The queries are built according to the archiving policy of your company. For example, to select the daily TS storing the objects which were intercepted more than 100 days ago, run the following query: | Блок кода |
|---|
| SELECT t.tbs_id, t.tbs_name, t.part_date |
WHERE t.part_date<trunc(SYSDATE) - 100 + 23 / 24 AND t.status IN (0, 3) |
| Предупреждение |
|---|
| It is strongly recommended to run the following sample query in this section in order to retrieve the list of files. This is due to the fact that the file list if generated by any other ways may be incomplete. |
In this case, the following query is created to select data files: | Блок кода |
|---|
| SELECT f.file_name |
WHERE f.tablespace_name in |
WHERE t.part_date<trunc(SYSDATE) - 100 + 23 / 24 AND t.status IN (0, 3) |
where t.status IN (0, 3) indicates that the tablespaces with the ReadWrite (status code 0) and ReadOnly (status code 3) statuses are selected for archiving. Disconnecting Daily Tablespaces from the Database | Предупреждение |
|---|
| It is strongly recommended not to disable daily TS when the IWTM_ADD_PARTS, IWTM_DELETE_TABLESPACES and IWTM_ARCHIVE_TABLESPACES jobs are running as it may cause the data loss. |
Call the procedure on behalf of the owner of the database schema, call the procedure:
IWTM.pkg_part.archive_tablespace(N); |
where N is a value of tbs_id attribute of the target TS from the tbs_list table. After running this script status of daily TS will change to Offline. - Repeat the procedure call for each daily TS you want to disable.
Moving Datafiles Transfer the data files belonging to the disabled daily TS to the other data carrier. To get a list of data files for all disconnected tablespaces, use the following script: | Блок кода |
|---|
| select tbs_name from tbs_list where NOTE = 'Tablespace is offline' |
where tbs_name is a name of a tablespace. tbs_list is a name of a table.
Data files are stored in the catalogue: | Блок кода |
|---|
| select value from setting where setting = 'archive_path'. |
|