Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· OpenAIAi2 WildChat-4.8M (AI2)

dbatabmodifications 如果是分区表,会查除多个分区的dml行数,能不能只查总的

  1. User

    dba_tab_modifications 如果是分区表,会查除多个分区的dml行数,能不能只查总的

  2. Assistant

    是的,dba_tab_modifications视图可以查看在一个表中DDL和DML操作的行数。对于分区表,你可以通过dba_tab_modifications来查看每个分区的DML行数,但如果你只想查看总的DML行数,你可以将分区汇总起来。

    以下是一个示例查询,它将分区表的DML行数求和并显示总的行数:

    SELECT SUM(inserts) AS total_inserts,
           SUM(updates) AS total_updates,
           SUM(deletes) AS total_deletes
    FROM dba_tab_modifications
    WHERE table_name = 'your_table_name'
      AND partition_name IS NOT NULL;
    

    请注意,这里我们将partition_name列过滤为NOT NULL,以便将分区的行数排除在外,只计算总的行数。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.