Skip to content

Commit

Permalink
Merge pull request #82 from allipatev/corrupt-data-required-priv
Browse files Browse the repository at this point in the history
DB privs to run scripts in "Identifying and Removing Corrupt Data" article.
  • Loading branch information
allipatev authored Mar 19, 2024
2 parents d250534 + f51300c commit 79cdb9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Database-Features/removing-corrupt-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ set verbose on;
@/tmp/check_all_columns.sql;
```

To execute the file, run `exaplus -u <username> -p <passwd> -c <connection string> -f corrupt_data_check.sql`.
To execute the file, run `exaplus -u <username> -p <passwd> -c <connection string> -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.
Expand Down Expand Up @@ -77,7 +77,7 @@ set verbose on;
@/tmp/enforce_indexes.sql;
```

To execute the file, run `exaplus -u <username> -p <passwd> -c <connection string> -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 <username> -p <passwd> -c <connection string> -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.

Expand All @@ -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).*
*We appreciate your input! Share your knowledge by contributing to the Knowledge Base directly in [GitHub](https://github.com/exasol/public-knowledgebase).*

0 comments on commit 79cdb9c

Please sign in to comment.