|
1 | | - |
2 | 1 | # Copyright 2026 Google LLC |
3 | 2 | # |
4 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
|
14 | 13 | # limitations under the License. |
15 | 14 |
|
16 | 15 | sources: |
17 | | - oracle-source: |
18 | | - kind: "oracle" |
19 | | - connectionString: ${ORACLE_CONNECTION_STRING} |
20 | | - walletLocation: ${ORACLE_WALLET:} |
21 | | - user: ${ORACLE_USER} |
22 | | - password: ${ORACLE_PASSWORD} |
23 | | - useOCI: ${ORACLE_USE_OCI:false} |
| 16 | + oracle-source: |
| 17 | + kind: oracle |
| 18 | + user: ${ORACLE_USER} |
| 19 | + password: ${ORACLE_PASSWORD} |
| 20 | + |
| 21 | + # --- Choose one connection method --- |
| 22 | + # 1. Host, Port, and Service Name |
| 23 | + host: ${ORACLE_HOST:} |
| 24 | + port: ${ORACLE_PORT:0} |
| 25 | + serviceName: ${ORACLE_SERVICE_NAME:} |
| 26 | + # 2. TNS Alias |
| 27 | + tnsAlias: ${ORACLE_TNS_ALIAS:} |
| 28 | + tnsAdmin: ${ORACLE_TNS_ADMIN:} |
| 29 | + # 3. Direct Connection String |
| 30 | + connectionString: ${ORACLE_CONNECTION_STRING:} |
| 31 | + walletLocation: ${ORACLE_WALLET:} |
| 32 | + |
| 33 | + useOCI: ${ORACLE_USE_OCI:false} |
24 | 34 |
|
25 | 35 | tools: |
26 | | - |
27 | | - list_tables: |
28 | | - kind: oracle-sql |
29 | | - source: oracle-source |
30 | | - description: "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." |
31 | | - statement: SELECT table_name from user_tables; |
| 36 | + execute_sql: |
| 37 | + kind: oracle-execute-sql |
| 38 | + source: oracle-source |
| 39 | + description: Use this tool to execute SQL queries on the games rules table or any other table. |
| 40 | + |
| 41 | + list_tables: |
| 42 | + kind: oracle-sql |
| 43 | + source: oracle-source |
| 44 | + description: "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" |
| 45 | + statement: SELECT table_name from user_tables; |
| 46 | + |
| 47 | + list_active_sessions: |
| 48 | + kind: oracle-sql |
| 49 | + source: oracle-source |
| 50 | + description: "List the top N (default 50) currently running database sessions (STATUS='ACTIVE'), showing SID, OS User, Program, and the current SQL statement text." |
| 51 | + statement: SELECT |
| 52 | + s.sid, |
| 53 | + s.serial#, |
| 54 | + s.username, |
| 55 | + s.osuser, |
| 56 | + s.program, |
| 57 | + s.status, |
| 58 | + s.wait_class, |
| 59 | + s.event, |
| 60 | + sql.sql_text |
| 61 | + FROM |
| 62 | + v$session s, |
| 63 | + v$sql sql |
| 64 | + WHERE |
| 65 | + s.status = 'ACTIVE' |
| 66 | + AND s.sql_id = sql.sql_id (+) |
| 67 | + AND s.audsid != userenv('sessionid') -- Exclude current session |
| 68 | + ORDER BY s.last_call_et DESC |
| 69 | + FETCH FIRST COALESCE(10) ROWS ONLY; |
32 | 70 |
|
33 | | - list_active_sessions: |
34 | | - kind: oracle-sql |
35 | | - source: oracle-source |
36 | | - description: "List the top N (default 50) currently running database sessions (STATUS='ACTIVE'), showing SID, OS User, Program, and the current SQL statement text." |
37 | | - statement: SELECT |
38 | | - s.sid, |
39 | | - s.serial#, |
40 | | - s.username, |
41 | | - s.osuser, |
42 | | - s.program, |
43 | | - s.status, |
44 | | - s.wait_class, |
45 | | - s.event, |
46 | | - sql.sql_text |
47 | | - FROM |
48 | | - v$session s, |
49 | | - v$sql sql |
50 | | - WHERE |
51 | | - s.status = 'ACTIVE' |
52 | | - AND s.sql_id = sql.sql_id (+) |
53 | | - AND s.audsid != userenv('sessionid') -- Exclude current session |
54 | | - ORDER BY s.last_call_et DESC |
55 | | - FETCH FIRST COALESCE(10) ROWS ONLY; |
| 71 | + get_query_plan: |
| 72 | + kind: oracle-sql |
| 73 | + source: oracle-source |
| 74 | + description: "Generate a full execution plan for a single SQL statement. This can be used to analyze query performance without execution. Requires the SQL statement as input. following is an example EXPLAIN PLAN FOR {{&query}};" |
| 75 | + statement: SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY()); |
56 | 76 |
|
57 | | - get_query_plan: |
58 | | - kind: oracle-sql |
59 | | - source: oracle-source |
60 | | - description: "Generate a full execution plan for a single SQL statement. This can be used to analyze query performance without execution. Requires the SQL statement as input. following is an example EXPLAIN PLAN FOR {{&query}};" |
61 | | - statement: SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY()); |
| 77 | + list_top_sql_by_resource: |
| 78 | + kind: oracle-sql |
| 79 | + source: oracle-source |
| 80 | + description: "List the top N SQL statements from the library cache based on a chosen resource metric (CPU, I/O, or Elapsed Time), following is an example of the sql" |
| 81 | + statement: SELECT |
| 82 | + sql_id, |
| 83 | + executions, |
| 84 | + buffer_gets, |
| 85 | + disk_reads, |
| 86 | + cpu_time / 1000000 AS cpu_seconds, |
| 87 | + elapsed_time / 1000000 AS elapsed_seconds |
| 88 | + FROM |
| 89 | + v$sql |
| 90 | + FETCH FIRST 5 ROWS ONLY; |
62 | 91 |
|
63 | | - list_top_sql_by_resource: |
64 | | - kind: oracle-sql |
65 | | - source: oracle-source |
66 | | - description: "List the top N SQL statements from the library cache based on a chosen resource metric (CPU, I/O, or Elapsed Time), following is an example of the sql" |
67 | | - statement: SELECT |
68 | | - sql_id, |
69 | | - executions, |
70 | | - buffer_gets, |
71 | | - disk_reads, |
72 | | - cpu_time / 1000000 AS cpu_seconds, |
73 | | - elapsed_time / 1000000 AS elapsed_seconds |
74 | | - FROM |
75 | | - v$sql |
76 | | - FETCH FIRST 5 ROWS ONLY; |
77 | | - |
78 | | - list_tablespace_usage: |
79 | | - kind: oracle-sql |
80 | | - source: oracle-source |
81 | | - description: "List tablespace names, total size, free space, and used percentage to monitor storage utilization." |
82 | | - statement: SELECT |
83 | | - t.tablespace_name, |
84 | | - TO_CHAR(t.total_bytes / 1024 / 1024, '99,999.00') AS total_mb, |
85 | | - TO_CHAR(SUM(d.bytes) / 1024 / 1024, '99,999.00') AS free_mb, |
86 | | - TO_CHAR((t.total_bytes - SUM(d.bytes)) / t.total_bytes * 100, '99.00') AS used_pct |
87 | | - FROM |
88 | | - (SELECT tablespace_name, SUM(bytes) AS total_bytes FROM dba_data_files GROUP BY tablespace_name) t, |
89 | | - dba_free_space d |
90 | | - WHERE |
91 | | - t.tablespace_name = d.tablespace_name (+) |
92 | | - GROUP BY |
93 | | - t.tablespace_name, t.total_bytes |
94 | | - ORDER BY |
95 | | - used_pct DESC; |
| 92 | + list_tablespace_usage: |
| 93 | + kind: oracle-sql |
| 94 | + source: oracle-source |
| 95 | + description: "List tablespace names, total size, free space, and used percentage to monitor storage utilization." |
| 96 | + statement: SELECT |
| 97 | + t.tablespace_name, |
| 98 | + TO_CHAR(t.total_bytes / 1024 / 1024, '99,999.00') AS total_mb, |
| 99 | + TO_CHAR(SUM(d.bytes) / 1024 / 1024, '99,999.00') AS free_mb, |
| 100 | + TO_CHAR((t.total_bytes - SUM(d.bytes)) / t.total_bytes * 100, '99.00') AS used_pct |
| 101 | + FROM |
| 102 | + (SELECT tablespace_name, SUM(bytes) AS total_bytes FROM dba_data_files GROUP BY tablespace_name) t, |
| 103 | + dba_free_space d |
| 104 | + WHERE |
| 105 | + t.tablespace_name = d.tablespace_name (+) |
| 106 | + GROUP BY |
| 107 | + t.tablespace_name, t.total_bytes |
| 108 | + ORDER BY |
| 109 | + used_pct DESC; |
96 | 110 |
|
97 | | - list_invalid_objects: |
98 | | - kind: oracle-sql |
99 | | - source: oracle-source |
100 | | - description: "Lists all database objects that are in an invalid state, requiring recompilation (e.g., procedures, functions, views)." |
101 | | - statement: SELECT |
102 | | - owner, |
103 | | - object_type, |
104 | | - object_name, |
105 | | - status |
106 | | - FROM |
107 | | - dba_objects |
108 | | - WHERE |
109 | | - status = 'INVALID' |
110 | | - AND owner NOT IN ('SYS', 'SYSTEM') -- Exclude system schemas for clarity |
111 | | - ORDER BY |
112 | | - owner, object_type, object_name; |
| 111 | + list_invalid_objects: |
| 112 | + kind: oracle-sql |
| 113 | + source: oracle-source |
| 114 | + description: "Lists all database objects that are in an invalid state, requiring recompilation (e.g., procedures, functions, views)." |
| 115 | + statement: SELECT |
| 116 | + owner, |
| 117 | + object_type, |
| 118 | + object_name, |
| 119 | + status |
| 120 | + FROM |
| 121 | + dba_objects |
| 122 | + WHERE |
| 123 | + status = 'INVALID' |
| 124 | + AND owner NOT IN ('SYS', 'SYSTEM') -- Exclude system schemas for clarity |
| 125 | + ORDER BY |
| 126 | + owner, object_type, object_name; |
113 | 127 |
|
114 | 128 | toolsets: |
115 | | - oracle_database_tools: |
116 | | - - execute_sql |
117 | | - - list_tables |
118 | | - - list_active_sessions |
119 | | - - get_query_plan |
120 | | - - list_top_sql_by_resource |
121 | | - - list_tablespace_usage |
122 | | - - list_invalid_objects |
| 129 | + oracle_database_tools: |
| 130 | + - execute_sql |
| 131 | + - list_tables |
| 132 | + - list_active_sessions |
| 133 | + - get_query_plan |
| 134 | + - list_top_sql_by_resource |
| 135 | + - list_tablespace_usage |
| 136 | + - list_invalid_objects |
0 commit comments