为什么Oracle在导入后锁定了我的架构的统计信息?

时间:2022-07-20 06:50:25

My problem is that I have a schema where the statistics of all tables are locked.

我的问题是我有一个架构,其中所有表的统计信息都被锁定。

I found on the Internet that I can unlock using the DBMS_STATS.UNLOCK_TABLE_STATS (SCHEMA_NAME) procedure.

我在Internet上发现我可以使用DBMS_STATS.UNLOCK_TABLE_STATS(SCHEMA_NAME)过程解锁。

What I need to know is the how Oracle determines when the statistics are going to be locked and when not, to avoiding these kind of situations.

我需要知道的是Oracle如何确定何时锁定统计信息以及何时不确定这些情况。

1 个解决方案

#1


From the documentation for the original import command:

从原始导入命令的文档:

If ROWS=n, then statistics for all imported tables will be locked after the import operation is finished.

如果ROWS = n,则导入操作完成后将锁定所有导入表的统计信息。

And for data pump import:

对于数据泵导入:

Be aware that if you specify CONTENT=METADATA_ONLY, then any index or table statistics imported from the dump file are locked after the import operation is complete.

请注意,如果指定CONTENT = METADATA_ONLY,则在导入操作完成后,将锁定从转储文件导入的任何索引或表统计信息。

If you don't want the data then as an alternative to unlocking the statistics on all the imported objects you could leave CONTENT as ALL, and apply a query filter to the export instead to exclude all rows, e.g. QUERY=("WHERE 0=1").

如果您不希望数据作为解锁所有导入对象的统计信息的替代方法,则可以将CONTENT保留为ALL,并将查询过滤器应用于导出,而不是排除所有行,例如QUERY =(“WHERE 0 = 1”)。

#1


From the documentation for the original import command:

从原始导入命令的文档:

If ROWS=n, then statistics for all imported tables will be locked after the import operation is finished.

如果ROWS = n,则导入操作完成后将锁定所有导入表的统计信息。

And for data pump import:

对于数据泵导入:

Be aware that if you specify CONTENT=METADATA_ONLY, then any index or table statistics imported from the dump file are locked after the import operation is complete.

请注意,如果指定CONTENT = METADATA_ONLY,则在导入操作完成后,将锁定从转储文件导入的任何索引或表统计信息。

If you don't want the data then as an alternative to unlocking the statistics on all the imported objects you could leave CONTENT as ALL, and apply a query filter to the export instead to exclude all rows, e.g. QUERY=("WHERE 0=1").

如果您不希望数据作为解锁所有导入对象的统计信息的替代方法,则可以将CONTENT保留为ALL,并将查询过滤器应用于导出,而不是排除所有行,例如QUERY =(“WHERE 0 = 1”)。