OceanBase AI 数据大会
OceanBase
文档社区云控制台
登录免费试用
中国站 – 简体中文International – English日本 – 日本語
OceanBase
文档社区
免费试用

数据库

  • OceanBase 分布式数据库
  • OceanBase 集中式数据库

AI 数据平台

  • OceanLake AI 数据平台概览
  • OceanBase AI 数据库
  • OceanBase DataPilot
  • OceanBase Agentbase

配套工具

  • OAgent 运维智能体
  • OMA 迁移评估工具
  • OMS 数据迁移工具
  • OCP 运维管理工具
  • ODC 开发者工具
  • OAS 自治服务工具

资源

  • 文档
  • 社区
  • 软件下载
  • 认证与培训
  • 支持与服务

数据库百科

  • 数据库专题
  • 分布式数据库
  • 国产数据库
  • OLTP 数据库
  • OLAP 数据库
  • HTAP 数据库
  • 数据库
  • 向量数据库
  • 向量检索

关于我们

  • 关于 OceanBase
  • 公司新闻
  • 官方博客
  • 信任中心
  • 联系我们
  • 加入我们
电子营业执照京公网安备11010802047223号京ICP备20024574号-1合字B1.B2-20250395安全响应协议OceanBase 版权所有 ©
文档反馈
  1. 文档中心
  2. OceanBase 数据库
  3. 分布式版
  4. V4.6.0
  5. 参考指南
  6. 配置项和系统变量
  7. 系统变量
  8. Global 系统变量
  9. ob_enable_plan_cache
分布式版-V4.6.0
  • What's New
  • 简介
  • 快速上手
  • 应用开发
  • 部署
  • 升级
  • 数据迁移
  • 管理数据库
  • AP
  • AI
  • 生态集成
  • 实践教程
  • 参考指南
    • 系统原理
    • 系统管理
    • 数据库对象管理
    • 数据库设计规范和约束
    • SQL 参考
    • PL 参考
    • 系统视图
    • 配置项和系统变量
      • 配置项和系统变量概述
      • V3.x 与 V4.x 配置项和系统变量变更
      • 配置项
      • 系统变量
        • 系统变量总览
        • Global 系统变量
          • ap_query_cost_threshold
          • ap_query_route_policy
          • ap_query_replica_fallback
          • activate_all_roles_on_login
          • auto_increment_cache_size
          • auto_increment_increment
          • auto_increment_offset
          • autocommit
          • automatic_sp_privileges
          • binlog_row_image
          • block_encryption_mode
          • character_set_client
          • character_set_connection
          • cardinality_estimation_model
          • character_set_database
          • character_set_filesystem
          • character_set_results
          • character_set_server
          • character_set_system
          • collation_connection
          • collation_database
          • collation_server
          • connect_timeout
          • cte_max_recursion_depth
          • cursor_sharing
          • datadir
          • default_authentication_plugin
          • default_password_lifetime
          • default_storage_engine
          • div_precision_increment
          • error_on_overlap_time
          • event_scheduler
          • explicit_defaults_for_timestamp
          • ENABLE_OPTIMIZER_ROWGOAL
          • foreign_key_checks
          • group_concat_max_len
          • identity
          • init_connect
          • innodb_stats_persistent
          • innodb_strict_mode
          • interactive_timeout
          • license
          • lc_time_names
          • log_row_value_options
          • long_query_time
          • lower_case_table_names
          • max_allowed_packet
          • max_connections
          • max_sp_recursion_depth
          • max_user_connections
          • mview_refresh_dop
          • net_buffer_length
          • net_read_timeout
          • net_write_timeout
          • nls_calendar
          • nls_characterset
          • nls_comp
          • nls_currency
          • nls_date_format
          • nls_date_language
          • nls_dual_currency
          • nls_iso_currency
          • nls_length_semantics
          • nls_nchar_characterset
          • nls_nchar_conv_excp
          • nls_numeric_characters
          • nls_sort
          • nls_territory
          • nls_timestamp_format
          • nls_timestamp_tz_format
          • ob_bnl_join_cache_size
          • ob_compatibility_mode
          • ob_compatibility_control
          • ob_compatibility_version
          • ob_create_table_strict_mode
          • ob_default_lob_inrow_threshold
          • ob_default_replica_num
          • ob_early_lock_release
          • ob_enable_ps_parameter_anonymous_block
          • ob_enable_pl_async_commit
          • ob_enable_aggregation_pushdown
          • ob_enable_blk_nestedloop_join
          • ob_enable_hash_group_by
          • ob_enable_index_direct_select
          • ob_enable_jit
          • ob_enable_pl_cache
          • ob_enable_plan_cache
          • ob_enable_sql_audit
          • ob_enable_transformation
          • ob_enable_transmission_checksum
          • ob_enable_truncate_flashback
          • ob_global_debug_sync
          • ob_log_level
          • ob_max_read_stale_time
          • ob_pl_block_timeout
          • ob_plan_cache_evict_high_percentage
          • ob_plan_cache_evict_low_percentage
          • ob_plan_cache_percentage
          • ob_proxy_global_variables_version
          • ob_query_timeout
          • ob_read_consistency
          • ob_reserved_meta_memory_percentage
          • ob_route_policy
          • ob_sql_audit_percentage
          • ob_sql_work_area_percentage
          • ob_table_access_policy
          • ob_tcp_invited_nodes
          • ob_temp_tablespace_size_percentage
          • ob_timestamp_service
          • ob_trx_idle_timeout
          • ob_trx_lock_timeout
          • ob_trx_timeout
          • optimizer_capture_sql_plan_baselines
          • ob_security_version
          • optimizer_dynamic_sampling
          • optimizer_features_enable
          • optimizer_use_sql_plan_baselines
          • parallel_degree_limit
          • parallel_degree_policy
          • parallel_max_servers
          • parallel_min_scan_time_threshold
          • parallel_servers_target
          • performance_schema
          • plugin_dir
          • plsql_ccflags
          • pid_file
          • query_cache_size
          • plsql_optimize_level
          • plsql_can_transform_sql_to_assign
          • port
          • query_cache_type
          • query_rewrite_enabled
          • query_rewrite_integrity
          • read_only
          • recyclebin
          • regexp_stack_limit
          • regexp_time_limit
          • resource_manager_plan
          • socket
          • runtime_bloom_filter_max_size
          • runtime_filter_max_in_num
          • runtime_filter_type
          • runtime_filter_wait_time_ms
          • secure_file_priv
          • server_uuid
          • sql_auto_is_null
          • sql_mode
          • sql_quote_show_create
          • sql_safe_updates
          • sql_select_limit
          • sql_throttle_current_priority
          • sql_throttle_network
          • sql_throttle_priority
          • sql_throttle_rt
          • sql_transpiler
          • sql_warnings
          • system_time_zone
          • time_zone
          • transaction_isolation
          • transaction_read_only
          • tx_isolation
          • tx_read_only
          • validate_password_check_user_name
          • validate_password_length
          • validate_password_mixed_case_count
          • validate_password_number_count
          • validate_password_policy
          • validate_password_special_char_count
          • version
          • version_comment
          • wait_timeout
        • Session 系统变量
    • 错误码
    • 性能调优
    • 数据库代理
    • 驱动
    • 平台产品
    • 组件 & 工具
    • 数据库插件
  • 常见问题
  • 版本发布记录
  • 术语
  1. 文档中心
  2. OceanBase 数据库
  3. 分布式版
  4. V4.6.0
  5. 参考指南
  6. 配置项和系统变量
  7. 系统变量
  8. Global 系统变量
  9. ob_enable_plan_cache

ob_enable_plan_cache

更新时间:2026-05-31 11:01:44

github-fill编辑
编组分享

说明

该变量从 V1.4 版本开始引入。

功能描述

ob_enable_plan_cache 用于设置是否打开 Plan Cache。

权限要求

  • 查询变量

    • Global 级别

      sys 租户和所有用户租户均可以使用 SHOW VARIABLES 语句或视图 SYS.TENANT_VIRTUAL_GLOBAL_VARIABLE(Oracle 模式)及视图 information_schema.GLOBAL_VARIABLES(MySQL 模式)查看 Global 系统变量的值。

    • Session 级别

      sys 租户和所有用户租户均可以使用 SHOW VARIABLES 语句或视图 SYS.TENANT_VIRTUAL_SESSION_VARIABLE(Oracle 模式)及视图 information_schema.SESSION_VARIABLES(MySQL 模式)查看 Session 系统变量的值。

  • 修改变量

    • Global 生效

      • sys 租户可以直接修改 Global 系统变量的值。

      • MySQL 用户租户需要拥有 SUPER 或 ALTER SYSTEM 权限才能修改 Global 系统变量的值。

      • Oracle 用户租户需要拥有 ALTER SYSTEM 权限才能修改 Global 系统变量的值。

    • Session 生效

      sys 租户和所有用户租户均可以直接修改本租户的 Session 系统变量的值。

属性说明

属性 描述
参数类型 Bool
默认值 1
取值范围
  • 0:关闭
  • 1:打开
生效范围
  • Global
  • Session
是否可修改 是,支持通过 SET 语句修改。

配置示例

设置打开 Plan Cache 功能。

  • Session 生效

    obclient> SET ob_enable_plan_cache =1;
    
  • Global 生效

    obclient> SET GLOBAL ob_enable_plan_cache =1;
    
  • OceanBase企业版 180 天免费试用

    立即下载

  • 一图秒懂:向量索引选型决策流程与最佳实践

    点击 1 分钟选对索引

本文目录

功能描述权限要求属性说明配置示例
  • OceanBase企业版 180 天免费试用

    立即下载

  • 一图秒懂:向量索引选型决策流程与最佳实践

    点击 1 分钟选对索引

有帮助
无帮助
反馈