From c938247475f662ec1c24a97a7deee1c135ce71f3 Mon Sep 17 00:00:00 2001 From: allipatev <58830344+allipatev@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:28:58 +0100 Subject: [PATCH 1/3] DB privs to run scripts in "Identifying and Removing Corrupt Data" article. --- Database-Features/removing-corrupt-data.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Database-Features/removing-corrupt-data.md b/Database-Features/removing-corrupt-data.md index 20819b6..d5f7728 100644 --- a/Database-Features/removing-corrupt-data.md +++ b/Database-Features/removing-corrupt-data.md @@ -45,7 +45,7 @@ set verbose on; @/tmp/check_all_columns.sql; ``` -To execute the file, run `exaplus -u -p -c -f corrupt_data_check.sql`. +To execute the file, run `exaplus -u -p -c -f corrupt_data_check.sql`. Database user requires SELECT ANY DICTIONARY system privilege for executing this script, see [Details on Rights Management](https://docs.exasol.com/db/latest/database_concepts/privileges/details_rights_management.htm). The script will run through the entire script and store the output into /tmp/check_all_column.log. Once it's finished, do the following: 1. Investigate `/tmp/check_all_column.log` and find any queries which return an error message. The table which causes an error message contains corrupt data and should be dropped. @@ -77,7 +77,7 @@ set verbose on; @/tmp/enforce_indexes.sql; ``` -To execute the file, run `exaplus -u -p -c -f recreate_indexes.sql`. You can view `/tmp/index_logs.log` or auditing in the database to ensure that all queries executed successfully. +To execute the file, run `exaplus -u -p -c -f recreate_indexes.sql`. Database user requires privileges to create and drop indices to run this script. DBA role would be sufficient, see [Roles](https://docs.exasol.com/db/latest/database_concepts/database_users_roles.htm#Roles). You can view `/tmp/index_logs.log` or auditing in the database to ensure that all queries executed successfully. Note - the database will automatically create indexes as needed, but the initial queries may run longer while they are creating indexes. For this reason, we recommend to re-create the indexes immediately after they are dropped. @@ -87,4 +87,4 @@ Note - the database will automatically create indexes as needed, but the initial If all of the data is easily restorable from different sources and there is no valid remote backup present, the fastest option may be to save the Metadata (DDL of all objects) of the database, delete the database, create a new database, restore the metadata, and reload all of the data. Exasol provides a [script](https://raw.githubusercontent.com/exasol/exa-toolbox/master/utilities/create_db_ddl.sql) to save the metadata of the entire database. In this script, all schemas, tables, views, scripts, functions, users, roles, permissions, and connections are created. However, any user or connection passwords are lost and must be reset afterwards. For more information, see [Create DDL for the entire database](create-ddl-for-the-entire-database.md). -*We appreciate your input! Share your knowledge by contributing to the Knowledge Base directly in [GitHub](https://github.com/exasol/public-knowledgebase).* \ No newline at end of file +*We appreciate your input! Share your knowledge by contributing to the Knowledge Base directly in [GitHub](https://github.com/exasol/public-knowledgebase).* From d34eaf5c363ba28e016f34319480f4819f83ab2d Mon Sep 17 00:00:00 2001 From: allipatev <58830344+allipatev@users.noreply.github.com> Date: Thu, 11 Jan 2024 11:08:18 +0100 Subject: [PATCH 2/3] DB privs to run scripts in "Identifying and Removing Corrupt Data" article. --- Database-Features/removing-corrupt-data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database-Features/removing-corrupt-data.md b/Database-Features/removing-corrupt-data.md index d5f7728..2373245 100644 --- a/Database-Features/removing-corrupt-data.md +++ b/Database-Features/removing-corrupt-data.md @@ -45,7 +45,7 @@ set verbose on; @/tmp/check_all_columns.sql; ``` -To execute the file, run `exaplus -u -p -c -f corrupt_data_check.sql`. Database user requires SELECT ANY DICTIONARY system privilege for executing this script, see [Details on Rights Management](https://docs.exasol.com/db/latest/database_concepts/privileges/details_rights_management.htm). +To execute the file, run `exaplus -u -p -c -f corrupt_data_check.sql`. DBA role would be sufficient for DB user to execute this script, see [Roles](https://docs.exasol.com/db/latest/database_concepts/database_users_roles.htm#Roles). The script will run through the entire script and store the output into /tmp/check_all_column.log. Once it's finished, do the following: 1. Investigate `/tmp/check_all_column.log` and find any queries which return an error message. The table which causes an error message contains corrupt data and should be dropped. @@ -77,7 +77,7 @@ set verbose on; @/tmp/enforce_indexes.sql; ``` -To execute the file, run `exaplus -u -p -c -f recreate_indexes.sql`. Database user requires privileges to create and drop indices to run this script. DBA role would be sufficient, see [Roles](https://docs.exasol.com/db/latest/database_concepts/database_users_roles.htm#Roles). You can view `/tmp/index_logs.log` or auditing in the database to ensure that all queries executed successfully. +To execute the file, run `exaplus -u -p -c -f recreate_indexes.sql`. DBA role would be sufficient for DB user to execute this script, see [Roles](https://docs.exasol.com/db/latest/database_concepts/database_users_roles.htm#Roles). You can view `/tmp/index_logs.log` or auditing in the database to ensure that all queries executed successfully. Note - the database will automatically create indexes as needed, but the initial queries may run longer while they are creating indexes. For this reason, we recommend to re-create the indexes immediately after they are dropped. From f51300cd58ba8c856f43d1944bad4473833b9191 Mon Sep 17 00:00:00 2001 From: allipatev <58830344+allipatev@users.noreply.github.com> Date: Wed, 13 Mar 2024 17:39:27 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Nico Conforti <33521165+nconforti93@users.noreply.github.com> --- Database-Features/removing-corrupt-data.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Database-Features/removing-corrupt-data.md b/Database-Features/removing-corrupt-data.md index 2373245..21f88d5 100644 --- a/Database-Features/removing-corrupt-data.md +++ b/Database-Features/removing-corrupt-data.md @@ -45,7 +45,7 @@ set verbose on; @/tmp/check_all_columns.sql; ``` -To execute the file, run `exaplus -u -p -c -f corrupt_data_check.sql`. DBA role would be sufficient for DB user to execute this script, see [Roles](https://docs.exasol.com/db/latest/database_concepts/database_users_roles.htm#Roles). +To execute the file, run `exaplus -u -p -c -f corrupt_data_check.sql`. The user running this script requires the DBA role, see [Roles](https://docs.exasol.com/db/latest/database_concepts/database_users_roles.htm#Roles) for more information. The script will run through the entire script and store the output into /tmp/check_all_column.log. Once it's finished, do the following: 1. Investigate `/tmp/check_all_column.log` and find any queries which return an error message. The table which causes an error message contains corrupt data and should be dropped. @@ -77,7 +77,7 @@ set verbose on; @/tmp/enforce_indexes.sql; ``` -To execute the file, run `exaplus -u -p -c -f recreate_indexes.sql`. DBA role would be sufficient for DB user to execute this script, see [Roles](https://docs.exasol.com/db/latest/database_concepts/database_users_roles.htm#Roles). You can view `/tmp/index_logs.log` or auditing in the database to ensure that all queries executed successfully. +To execute the file, run `exaplus -u -p -c -f recreate_indexes.sql`. The user running this script requires the DBA role, see [Roles](https://docs.exasol.com/db/latest/database_concepts/database_users_roles.htm#Roles) for more information. You can view `/tmp/index_logs.log` or auditing in the database to ensure that all queries executed successfully. Note - the database will automatically create indexes as needed, but the initial queries may run longer while they are creating indexes. For this reason, we recommend to re-create the indexes immediately after they are dropped.