taler-auditor-dbinit.1.rst (3945B)
1 taler-auditor-dbinit(1) 2 ####################### 3 4 .. only:: html 5 6 Name 7 ==== 8 9 **taler-auditor-dbinit** - initialize Taler auditor database 10 11 12 Synopsis 13 ======== 14 15 **taler-auditor-dbinit** 16 [**--dry**] 17 [**-c** *FILENAME* | **--config=**\ \ *FILENAME*] 18 [**-g** | **--gc**] 19 [**-h** | **--help**] 20 [**-L** *LOGLEVEL* | **--loglevel=**\ \ *LOGLEVEL*] 21 [**-l** *FILENAME* | **--logfile=**\ \ *FILENAME*] 22 [**-R** | **--reset**] 23 [**-r** | **--restart**] 24 [**-v** | **--version**] 25 26 Description 27 =========== 28 29 **taler-exchange-dbinit** is a command-line tool to initialize the Taler 30 exchange database. It creates the necessary tables and indices for the 31 Taler exchange to operate. 32 33 Normal initialization skips stored-procedure files whose recorded contents 34 are current. Schema upgrades also refresh procedures. Databases initialized 35 before content tracking was introduced require one procedure refresh. 36 37 Normal initialization always executes ``versioning.sql`` under the migration 38 lock. This script upgrades the shared ``_v`` metadata schema transactionally 39 and records its revision in ``_v.versioning``. An already-current script 40 leaves schema objects and metadata unchanged. A script with an older target 41 revision preserves a newer installed revision. 42 43 Stop the services before upgrading the database. If an upgrade fails, rerun 44 **taler-auditor-dbinit** to complete it before restarting the services. 45 Services refuse to start while the final upgrade steps are unfinished. 46 47 Its options are as follows: 48 49 **--dry** 50 Inspect pending initialization and upgrade work without modifying the 51 database. Output contains one tab-separated line per action: kind, 52 component, SQL filename or finalization statement, and reason. A current 53 database produces no output. Diagnostics go to standard error. 54 55 Inspection includes versioning-schema upgrades, numbered migrations, 56 stored-procedure updates, and unfinished deferred table setup. Table setup 57 is reported as an operation, 58 including its partition argument; migration SQL is not executed to predict 59 individual table changes. 60 61 This option has no short form. It cannot be combined with reset or 62 maintenance actions. 63 64 Exit status is 0 when current, 2 when work is pending, and 1 on inspection 65 failure. An existing empty database can be inspected; a missing database 66 or failed connection is an error. The plan describes a snapshot and does 67 not guarantee that executing the SQL will succeed. 68 69 Dry inspection compares the target revision declared in ``versioning.sql`` 70 with ``_v.versioning`` without executing the script. A missing revision table 71 is treated as revision zero, including on existing databases. The script also 72 creates the stored-procedure hash registry when upgrading a legacy database. 73 74 Content hashes track files applied by these tools. They do not detect 75 manual edits to database procedures or changes made by older tools. 76 77 **-c** *FILENAME* \| **--config=**\ \ *FILENAME* 78 Use the configuration and other resources for the exchange to operate 79 from *FILENAME*. 80 81 **-g** \| **--gc** 82 Garbage collect database. Deletes all unnecessary data in the 83 database. 84 85 **-h** \| **--help** 86 Print short help on options. 87 88 **-L** *LOGLEVEL* \| **--loglevel=**\ \ *LOGLEVEL* 89 Specifies the log level to use. Accepted values are: ``DEBUG``, ``INFO``, 90 ``WARNING``, ``ERROR``. 91 92 **-l** *FILENAME* \| **--logfile=**\ \ *FILENAME* 93 Send logging output to *FILENAME*. 94 95 **-R** \| **--reset** 96 Drop tables. Dangerous, will delete all existing data in the database. 97 98 **-r** \| **--restart** 99 Restart all auditors from the beginning. Useful for 100 testing. 101 102 **-v** \| **--version** 103 Print version information. 104 105 See Also 106 ======== 107 108 taler-auditor-httpd(1), taler-auditor-dbconfig(1), taler-auditor.conf(5). 109 110 Bugs 111 ==== 112 113 Report bugs by using https://bugs.taler.net/ or by sending electronic 114 mail to <taler@gnu.org>.