angoca / log4db2

A logging utility like log4j for IBM Db2 SQL PL
https://angoca.github.io/log4db2/
BSD 2-Clause "Simplified" License
7 stars 2 forks source link

Excample of Create systoolspace in unistaller #209

Closed angoca closed 2 years ago

angoca commented 4 years ago

When executing the uninstaller and it fails, it says one should execute a command, but that command depends on the systoolspace.

$ db2 "CALL SYSPROC.ADMIN_DROP_SCHEMA('LOGGER_1B', NULL, 'ERRORSCHEMA', 'ERRORTABLE')"

SQL0443N Routine "ADMIN_DROP_SCHEMA" (specific name "*_DROP_SCHEMA") has returned an error SQLSTATE with diagnostic text "SYSTOOLSPACE tablespace does

angoca commented 4 years ago

The correct order is:

db2 create tablespace "SYSTOOLSPACE"

db2 DROP TABLE ERRORSCHEMA.ERRORTABLE

db2 "CALL SYSPROC.ADMIN_DROP_SCHEMA('LOGGER_1B', NULL, 'ERRORSCHEMA', 'ERRORTABLE')"

db2 "SELECT * FROM ERRORSCHEMA.ERRORTABLE"

db2 DROP TABLE ERRORSCHEMA.ERRORTABLE

db2 "CALL SYSPROC.ADMIN_DROP_SCHEMA('LOGDATA', NULL, 'ERRORSCHEMA', 'ERRORTABLE')"

db2 "SELECT * FROM ERRORSCHEMA.ERRORTABLE"

db2 "SELECT VARCHAR('db2 DROP PACKAGE LOGGER_1B.' || TRIM(NAME) || ';db2 DROP SCHEMA LOGGER_1B RESTRICT', 128) FROM SYSIBM.SYSPLAN WHERE CREATOR LIKE 'LOG%'"

angoca commented 2 years ago

This error exist with the Beta release, but it seems it was corrected at #https://github.com/angoca/log4db2/commit/d961d7887043703fbeb310ce39bd2eb0819e805e