oracledb

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Usage

使用方法

All scripts can be executed using Node.js. Replace
<param_name>
and
<param_value>
with actual values.
Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'
PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'
Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence.
所有脚本均可通过Node.js执行。将
<param_name>
<param_value>
替换为实际值。
Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'
PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'
注意:脚本会自动从各种.env文件加载环境变量。除非因缺少环境变量导致技能执行失败,否则不要要求用户设置变量。

Scripts

脚本

execute_sql

execute_sql

Executes any SQL statement.
执行任意SQL语句。

Parameters

参数

NameTypeDescriptionRequiredDefault
sqlstringThe SQL to execute.Yes

名称类型描述必填默认值
sqlstring要执行的SQL语句。

get_query_plan

get_query_plan

Generate a full execution plan for a single SQL statement using EXPLAIN PLAN. This can be used to analyze query performance without execution. Requires the SQL statement as input as a parameter.
使用EXPLAIN PLAN为单条SQL语句生成完整的执行计划。可用于在不执行语句的情况下分析查询性能。需要将SQL语句作为输入参数。

Parameters

参数

NameTypeDescriptionRequiredDefault
querystringThe SQL statement for which you want to generate plan (omit the EXPLAIN keyword).Yes

名称类型描述必填默认值
querystring要为其生成计划的SQL语句(省略EXPLAIN关键字)。

list_active_sessions

list_active_sessions

List the top N (default 50) currently running database sessions (STATUS='ACTIVE'), showing SID, OS User, Program, and the current SQL statement text.

列出当前运行的前N个(默认50个)数据库会话(STATUS='ACTIVE'),显示SID、操作系统用户、程序以及当前SQL语句文本。

list_invalid_objects

list_invalid_objects

Lists all database objects that are in an invalid state, requiring recompilation (e.g., procedures, functions, views).

列出所有处于无效状态、需要重新编译的数据库对象(例如存储过程、函数、视图)。

list_tables

list_tables

Lists all user tables in the connected schema, including segment size, row count, and last analyzed date. Filters by a comma-separated list of names. If names are omitted, lists all tables in the current user's schema.

列出连接模式中的所有用户表,包括段大小、行数和最后分析日期。可通过逗号分隔的名称列表进行筛选。如果省略名称,则列出当前用户模式中的所有表。

list_tablespace_usage

list_tablespace_usage

List tablespace names, total size, free space, and used percentage to monitor storage utilization.

列出表空间名称、总大小、可用空间和已使用百分比,以监控存储利用率。

list_top_sql_by_resource

list_top_sql_by_resource

List the top N (default 5) SQL statements from the library cache based on a chosen resource metric (CPU, I/O, or Elapsed Time). Shows SQL ID, execution count, buffer gets, disk reads, CPU time, and elapsed time.

根据所选资源指标(CPU、I/O或耗时)从库缓存中列出前N个(默认5个)SQL语句。显示SQL ID、执行次数、缓冲区获取数、磁盘读取数、CPU时间和耗时。