Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.
Комментарий: Published by Scroll Versions from space TMAG and version 6.10

...

Sv translation
languageen

Manual archiving of daily tablespaces is performed in the following steps:

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
FROM tbs_list t
WHERE t.part_date < current_date - 100 + 23 / 24 AND t.status IN (0, 3);

Предупреждение
titleWarning!

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.

Daily TS are located in separate catalogues.

To get names of these catalogues, run the following command:

#su - postgres -c 'psql postgres iwtm'

postgres=# \db

               List of tablespaces

    Name    |  Owner   |        Location

tbs_name | tbs_id | tbs_type | part_date  | pg_tablespace_location | pg_size_pretty | status |        note       
----------+--------+----------+------------+------------------------+----------------+--------+--------------------

 iwtm       | iwtm     | /u01/iwtm_main/iwtm

 iwtm_421   | iwtm     | /u01/iwtm_data/iwtm_421

 iwtm_423   | iwtm     | /u01/iwtm_data/iwtm_423

 iwtm_424   | iwtm     | /u01/iwtm_data/iwtm_424

 iwtm_425   | iwtm     | /u01/iwtm_data/iwtm_425

 iwtm_426   | iwtm     | /u01/iwtm_data/iwtm_426

 iwtm_427   | iwtm     | /u01/iwtm_data/iwtm_427

 iwtm_428   | iwtm     | /u01/iwtm_data/iwtm_428

 iwtm_429   | iwtm     | /u01/iwtm_data/iwtm_429

 iwtm_430   | iwtm     | /u01/iwtm_data/iwtm_430

 iwtm_431   | iwtm     | /u01/iwtm_data/iwtm_431

 iwtm_432   | iwtm     | /u01/iwtm_data/iwtm_432

 iwtm_433   | iwtm     | /u01/iwtm_data/iwtm_433

 iwtm_434   | iwtm     | /u01/iwtm_data/iwtm_434

 iwtm_435   | iwtm     | /u01/iwtm_data/iwtm_435

 iwtm_436   | iwtm     | /u01/iwtm_data/iwtm_436

 iwtm_437   | iwtm     | /u01/iwtm_data/iwtm_437

 iwtm_438   | iwtm     | /u01/iwtm_data/iwtm_438

 iwtm_439   | iwtm     | /u01/iwtm_data/iwtm_439

 iwtm_440   | iwtm     | /u01/iwtm_data/iwtm_440

 iwtm_441   | iwtm     | /u01/iwtm_data/iwtm_441

 iwtm_442   | iwtm     | /u01/iwtm_data/iwtm_442

 iwtm_443   | iwtm     | /u01/iwtm_data/iwtm_443

 iwtm_444   | iwtm     | /u01/iwtm_data/iwtm_444

 iwtm_445   | iwtm     | /u01/iwtm_data/iwtm_445

 iwtm_446   | iwtm     | /u01/iwtm_data/iwtm_446

 pg_default | postgres |

 pg_global  | postgres |

(28 rows)

Where Name corresponds to values from sample select tbs_name, tbs_id from iwtm.tbs_list

 iwtm_2   |      2 |        1 | 2017-03-30 | /u02/pgdata/iwtm_2     | 692 kB         |      0 | Partitions created
 iwtm_3   |      3 |        2 | 2017-03-30 | /u02/pgdata/iwtm_3     | 692 kB         |      0 | Partitions created
 iwtm_4   |      4 |        0 | 2017-03-31 | /u02/pgdata/iwtm_4     | 25 MB          |      0 | Partitions created
 iwtm_5   |      5 |        1 | 2017-03-31 | /u02/pgdata/iwtm_5     | 692 kB         |      0 | Partitions created
 iwtm_6   |      6 |        2 | 2017-03-31 | /u02/pgdata/iwtm_6     | 692 kB         |      0 | Partitions created
 iwtm_7   |      7 |        0 | 2017-04-01 | /u02/pgdata/iwtm_7     | 692 kB         |      0 | Partitions created
 iwtm_8   |      8 |        1 | 2017-04-01 | /u02/pgdata/iwtm_8     | 692 kB         |      0 | Partitions created
 iwtm_9   |      9 |        2 | 2017-04-01 | /u02/pgdata/iwtm_9     | 692 kB         |      0 | Partitions created

 

Предупреждение
titleWarning!

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.


Disconnecting Daily Tablespaces from the Database

Предупреждение
titleWarning!

It is strongly recommended not to disable daily TS when the <SchemaOwner>_iwtm_add_parts, <SchemaOwner>_iwtm_delete_tablespaces,<SchemaOwner>_iwtm_archive_tablespaces jobs are running as it may cause the data loss.

  1. Call the procedure on behalf of the owner of the database schema, call the procedure:
    select 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.
  2. 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 carrierstorage device.

To get a list of data files for all disconnected tablespaces, use the following script:

select value from setting where setting = 'archive_path';