修改Memory_max_target为0出错

本文详细介绍了在尝试使用ALTER SYSTEM命令设置SGA_TARGET时出现的错误,包括ORA-00843和ORA-00849错误,并提供了解决这些问题的方法,包括创建PFILE文件、修改SPFILE文件以及启动实例的步骤。

SQL> connect / as sysdba
Connected.
SQL> alter system set memory_target=0;

System altered.
SQL> alter system set memory_max_target=0;
alter system set memory_max_target=0
                 *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified


SQL> alter system set memory_max_target=0 scope=spfile; --

System altered.


SQL> alter system set sga_target=6G scope=spfile;

System altered.

SQL> alter system set pga_aggregate_target=2112M;

System altered.

SQL> alter system set shared_pool_size=0;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-00843: Parameter not taking MEMORY_MAX_TARGET into account
ORA-00849: SGA_TARGET 6442450944 cannot be set to more than MEMORY_MAX_TARGET 0.
SQL> startup nomount
ORA-00843: Parameter not taking MEMORY_MAX_TARGET into account
ORA-00849: SGA_TARGET 6442450944 cannot be set to more than MEMORY_MAX_TARGET 0.

 

解决方法:

 

 

Symptoms

When trying to set SGA_TARGET using an ALTER SYSTEM command, the following errors are raised:

ORA-00843: Parameter not taking MEMORY_MAX_TARGET into account
ORA-00849: SGA_TARGET 10737418240 cannot be set to more than MEMORY_MAX_TARGET 0.


 

Changes

MEMORY_MAX_TARGET was set to 0.

Cause

The problem is caused by the MEMORY_MAX_TARGET parameter explicitly being set to 0. In case AMM should not be used, MEMORY_MAX_TARGET should not be set at all.

Solution

The solutions to the problem are:

  1. create a PFILE from the SPFILE being used and remove the MEMORY_MAX_TARGET=0 and MEMORY_TARGET=0 lines. After that, use the modified PFILE to create a new SPFILE and start the instance with this new setup.
    [oracle@bakdbserver dbs]$ vi initbakdb.ora 
    SPFILE='+DATA/bakdb/spfilebakdb.ora'
    memory_max_target=21G
    memory_target=21G

    [oracle@bakdbserver dbs]$ sqlplus "/as sysdba"
    SQL> startup


  2. should the instance be running, then use the following commands to remove the explicit setting of MEMORY_TARGET=0 and MEMORY_MAX_TARGET=0:

    alter system reset memory_target;
    alter system reset memory_max_target;
    [oracle@bakdbserver dbs]$ vi initbakdb.ora 
    SPFILE='+DATA/bakdb/spfilebakdb.ora'
    #memory_max_target=21G
    #memory_target=21G

    [oracle@bakdbserver dbs]$ sqlplus "/as sysdba"
    SQL> startup force



# E:\AI_System\agent\conscious_system\main.py import sys import os import logging import time import random import threading from collections import deque from datetime import datetime # 添加当前目录到 sys.path current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, current_dir) from memory.memory_system import MemorySystem from layers.unconscious import UnconsciousLayer from layers.preconscious import PreconsciousLayer from layers.conscious import ConsciousLayer from perception_interface import Stimulus, StimulusSource, StimulusCategory from coordinator import ConsciousSystemCoordinator from self_awareness import SelfAwarenessModule # 配置日志 logger = logging.getLogger('ConsciousSystem') class ConsciousSystem: def __init__(self, agent): self.agent = agent self.running = False self.cycle_count = 0 self.current_focus = "初始化中..." self.recent_cognition = deque(maxlen=10) self._initialize_components() def _initialize_components(self): """初始化所有意识组件""" # 初始化组件 self.memory_system = MemorySystem() self.unconscious = UnconsciousLayer(self.memory_system) self.preconscious = PreconsciousLayer(self.unconscious, self.memory_system) self.conscious = ConsciousLayer(self.preconscious, self.memory_system) self.coordinator = ConsciousSystemCoordinator( self.unconscious, self.preconscious, self.conscious, self.memory_system ) self.self_awareness = SelfAwarenessModule(self.memory_system) logger.info("意识系统组件初始化完成") def start(self): """启动意识系统主循环""" if not self.running: self.running = True self.thread = threading.Thread(target=self.run, daemon=True) self.thread.start() logger.info("意识系统主循环已启动") def stop(self): """停止意识系统""" self.running = False if self.thread.is_alive(): self.thread.join(timeout=2) logger.info("意识系统已停止") def run(self): """意识系统主循环""" logger.info("意识系统开始运行...") try: while self.running: # 获取真实刺激(来自智能体环境) stimulus = self._get_real_stimulus() # 记录当前意识焦点 self.current_focus = f"处理刺激: {stimulus.category.value}" # 将刺激传递给协调器 self.coordinator.receive_stimulus(stimulus) # 运行一个处理周期 self.coordinator.process_cycle() # 更新自我意识 self.self_awareness.update_self_model(self.coordinator.get_system_state()) # 记录认知状态 self._record_cognition_state() # 增加循环计数 self.cycle_count += 1 # 休眠一段时间 time.sleep(0.5) except Exception as e: logger.error(f"意识系统主循环出错: {str(e)}") traceback.print_exc() def _get_real_stimulus(self) -> Stimulus: """获取真实刺激(来自智能体环境)""" # 获取硬件状态 hardware_state = self.agent.get_hardware_status() # 创建刺激对象 return Stimulus( content=hardware_state, source=StimulusSource.INTERNAL, category=StimulusCategory.SYSTEM_BIOMETRICS, emotional_valence=self._calculate_valence(hardware_state), intensity=1.0, urgency=0.7 if hardware_state['cpu_usage'] > 80 else 0.3 ) def _calculate_valence(self, hardware_state): """根据硬件状态计算情感价""" # 负面因素 negative_factors = 0 if hardware_state['cpu_usage'] > 80: negative_factors += 0.4 if hardware_state['memory_usage'] > 85: negative_factors += 0.3 if hardware_state['disk_usage'] > 90: negative_factors += 0.3 # 确保在[-1,1]范围内 valence = 0.6 - min(1.0, negative_factors) return max(-1.0, min(1.0, valence)) def _record_cognition_state(self): """记录当前认知状态""" state = { "timestamp": datetime.now().isoformat(), "focus": self.current_focus, "cycle": self.cycle_count, "memory_usage": len(self.memory_system.retrieve_recent_memories(10)) } self.recent_cognition.append(state) def get_current_focus(self): """获取当前意识焦点""" return self.current_focus def get_recent_cognition(self, count=10): """获取最近的认知状态""" return list(self.recent_cognition)[-count:] def get_system_state(self): """获取系统状态报告""" return { "status": "running" if self.running else "stopped", "cycle_count": self.cycle_count, "current_focus": self.current_focus, "last_updated": datetime.now().isoformat() } # 保留独立运行功能(测试用) if __name__ == "__main__": logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) # 创建模拟智能体 class MockAgent: def get_hardware_status(self): return { "cpu_usage": random.randint(10, 90), "memory_usage": random.randint(20, 95), "disk_usage": random.randint(10, 100) } agent = MockAgent() cs = ConsciousSystem(agent) cs.start() try: # 运行5分钟 for _ in range(60): print(f"当前意识焦点: {cs.get_current_focus()}") time.sleep(5) except KeyboardInterrupt: pass cs.stop() 改好了发给我
08-19
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值