Renaming a table

    General command format:

    View a description of the command to rename a table:

      Renaming tables - 图2

      When including multiple rename operations in a single tools rename call, they’re executed in the specified order, but within a single transaction. This lets you rotate the table under load without data loss: the first operation is renaming the working table to the backup one and the second is renaming the new table to the working one.

      Examples

      • Renaming a single table:

      • Renaming multiple tables within a single transaction:

        1. ydb tools rename \
        2. --item source=new-project/second_table,destination=new-project/seasons \
        3. --item source=new-project/third_table,destination=new-project/series
      • Moving tables to a different directory:

        Renaming tables - 图5

      • Replacing a table

        1. ydb tools rename \