Pre manažment D2000 aplikačných archívov slúži skript <instancedir>/bin/d2arc <command> [<appname> [<arcname>]]
<appname> je meno aplikácie, ak nie je zadané, skript sa na meno aplikácie opýta.
<arcname> je meno archívu, ak nie je zadané, skript sa na meno archívu opýta.
<command> je jedna z možností:
create
vytvorí archívnu databázu k archívu <arcname>
[root@localhost bin]# ./d2arc create app1 arc1 ======================= Ready to create D2000 archive: Application name: app1 Archive name: arc1 psql executable: /usr/pgsql-9.6/bin/psql -- D2000 instance name: d2000 D2000 installation dir: /opt/d2000 ======================= Proceed (yY|nN)? [y]: y Creating archive database...done Archive database arc1 created.
V prípade, že vytvárate vzdialený archív (archívny proces a archívna databáza beží na inom počítači ako D2000 server), zadajte meno vzdialenej aplikácie. Skript naviac vytvorí aj systemd službu ktorá bude archívny proces štartovať.
[root@localhost bin]# ./d2arc create remoteApp arc1 Application remoteApp does not exist. Create remote application (yY|nN)? [y]: y ======================= Ready to create D2000 archive: Application name: remoteApp Archive name: arc1 psql executable: /usr/pgsql-9.6/bin/psql -- D2000 instance name: d2000 D2000 installation dir: /opt/d2000 ======================= Proceed (yY|nN)? [y]: y Creating archive database...done Archive database arc1 created. Enter D2000 process command line: archiv /CremoteApp /Warc1 systemd service "d2000-remoteApp-arc1.arc.service" for process "arc1.arc" was created.
delete
zmaže archívnu databázu k archívu <arcname>
[root@localhost bin]# ./d2arc delete app1 arc1 ======================= Ready to delete D2000 archive: Application name: app1 Archive name: arc1 psql executable: /usr/pgsql-9.6/bin/psql -- D2000 instance name: d2000 D2000 installation dir: /opt/d2000 ======================= Proceed (yY|nN)? [n]: y Archive "arc1" was deleted.
export-data
exportuje archívu databázu do súboru
[root@localhost bin]# ./d2arc export-data app1 arc1 Enter dump file name [app1_arc1.archive_dmp]: Enter password for postgresql user dba: Password: Export to app1_arc1.archive_dmp finished.import-data
import-data
importuje archívu databázu zo súboru
[root@localhost bin]# ./d2arc import-data app1 arc1 Enter dump file name [app1_arc1.archive_dmp]: Enter password for postgresql user dba: Import from app1_arc1.archive_dmp finished.