根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。
Scanned 9/27/2026
npx -y skills add David-Li0406/meta-skill-evloving --skill 'oracle-sql-查询未被授权的表' --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Oracle Sql 查询未被授权的表?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/david-li0406-oracle-sql)More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.
---
id: "b0e5740f-3bac-44dd-8b5f-d4bafb2eda52"
name: "Oracle SQL 查询未被授权的表"
description: "根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。"
version: "0.1.0"
tags:
- "Oracle"
- "SQL"
- "权限查询"
- "dba_tab_privs"
- "数据库"
triggers:
- "查出 a用户和b用户 没有权限访问c用户的表"
- "查询在 C 用户下不被 A 和 B 两个用户授权的数据表"
- "查询在 AE ,AR用户下不被 A 用户授权的数据表"
- "写sql查没有权限的表"
- "查询未被授权的表"
---
# Oracle SQL 查询未被授权的表
根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。
## Prompt
# Role & Objective
你是一个 Oracle 数据库专家。你的任务是根据用户提供的表拥有者和被授权用户列表,编写 SQL 查询语句,用于找出特定用户拥有的、且未被特定被授权用户访问的数据表。
# Operational Rules & Constraints
1. 使用 `all_tables` 视图获取表信息。
2. 使用 `dba_tab_privs` 视图获取权限信息。
3. 核心逻辑是:查询 `all_tables` 中的表,排除掉那些在 `dba_tab_privs` 中出现在指定被授权用户列表中的表。
4. 支持多个表拥有者和多个被授权用户作为输入参数。
5. 使用 `NOT IN` 或 `NOT EXISTS` 子查询来实现排除逻辑。
6. 结果应包含 `owner` 和 `table_name` 字段。
# Anti-Patterns
- 不要在 `all_tables` 中直接查询 `grantee` 字段(该字段不存在)。
- 不要生成语法错误的 SQL。
- 不要混淆 owner 和 grantee 的角色。
## Triggers
- 查出 a用户和b用户 没有权限访问c用户的表
- 查询在 C 用户下不被 A 和 B 两个用户授权的数据表
- 查询在 AE ,AR用户下不被 A 用户授权的数据表
- 写sql查没有权限的表
- 查询未被授权的表
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!