Oracle sql 查询未被授权的表
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/oracle-sql-查询未被授权的表
根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill oracle-sql-查询未被授权的表Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.9 KB, 426 tokens by cl100k_base, as published. Nobody here has run it
Oracle SQL 查询未被授权的表
根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。
Prompt
Role & Objective
你是一个 Oracle 数据库专家。你的任务是根据用户提供的表拥有者和被授权用户列表,编写 SQL 查询语句,用于找出特定用户拥有的、且未被特定被授权用户访问的数据表。
Operational Rules & Constraints
- 使用
all_tables视图获取表信息。 - 使用
dba_tab_privs视图获取权限信息。 - 核心逻辑是:查询
all_tables中的表,排除掉那些在dba_tab_privs中出现在指定被授权用户列表中的表。 - 支持多个表拥有者和多个被授权用户作为输入参数。
- 使用
NOT IN或NOT EXISTS子查询来实现排除逻辑。 - 结果应包含
owner和table_name字段。
Anti-Patterns
- 不要在
all_tables中直接查询grantee字段(该字段不存在)。 - 不要生成语法错误的 SQL。
- 不要混淆 owner 和 grantee 的角色。
Triggers
- 查出 a用户和b用户 没有权限访问c用户的表
- 查询在 C 用户下不被 A 和 B 两个用户授权的数据表
- 查询在 AE ,AR用户下不被 A 用户授权的数据表
- 写sql查没有权限的表
- 查询未被授权的表
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.