ORA-00847: MEMORY_TARGET/MEMORY_MAX_TARGET and LOCK_SGA cannot be set together

文档解释

ORA-00847: MEMORY_TARGET/MEMORY_MAX_TARGET and LOCK_SGA cannot be set together

Cause: MEMORY_TARGET/MEMORY_MAX_TARGET was set to a non-zero value and LOCK_SGA was also set

Action: Do not set MEMORY_TARGET or MEMORY_MAX_TARGET if LOCK_SGA is set to TRUE.

ORA-00847错误代表您试图同时将MEMORY_TARGET/MEMORY_MAX_TARGET参数和LOCK_SGA设置为真。

官方解释

ORA-00847:“MEMORY_TARGET/MEMORY_MAX_TARGET和LOCK_SGA不能同时设置”

此错误指示MEMORY_TARGET/MEMORY_MAX_TARGET参数和LOCK_SGA参数不能同时设置True,因为使用Automatic Shared Memory Management (ASMM)可以自动管理SGA中的内存,自动跟踪已使用的和可用的内存。如果两个参数同时设置为True,可能会导致系统内存使用方面的冲突。

常见案例

ORA-00847错误通常会在您试图同时将MEMORY_TARGET/MEMORY_MAX_TARGET参数和LOCK_SGA设置为真时发生。

正常处理方法及步骤

第一步:您可以使用以下语句查看当前SGA共享内存锁定参数的值:

SELECT name, value

FROM gv$parameter

WHERE name = ‘lock_sga’;

第二步:禁用锁定SGA参数(设置为false):

ALTER SYSTEM SET ‘lock_sga’ = FALSE SCOPE=BOTH;

第三步:使用以下语句查看当前MEMORY_TARGET/MEMORY_MAX_TARGET参数的值:

SELECT name, value

FROM gv$parameter

WHERE name IN (‘memory_target’, ‘memory_max_target’);

第四步:设置MEMORY_TARGET/MEMORY_MAX_TARGET参数(启用Automatic Shared Memory Management):

ALTER SYSTEM SET ‘memory_target’ = SCOPE=BOTH;

ALTER SYSTEM SET ‘memory_max_target’ = SCOPE=BOTH;

你可能感兴趣的