Skip to content
OpenSmartRoute
Skillv1.0.0

Oracle SQL 查询未被授权的表

根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。

by THUIR(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from THUIR/MemoryBench (baselines/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/oracle-sql-查询未被授权的表/SKILL.md). Install upstream with npx skills add THUIR/MemoryBench --skill oracle-sql-查询未被授权的表. Copyright stays with the author.

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 INNOT EXISTS 子查询来实现排除逻辑。
  6. 结果应包含 ownertable_name 字段。

Anti-Patterns

  • 不要在 all_tables 中直接查询 grantee 字段(该字段不存在)。
  • 不要生成语法错误的 SQL。
  • 不要混淆 owner 和 grantee 的角色。

Triggers

  • 查出 a用户和b用户 没有权限访问c用户的表
  • 查询在 C 用户下不被 A 和 B 两个用户授权的数据表
  • 查询在 AE ,AR用户下不被 A 用户授权的数据表
  • 写sql查没有权限的表
  • 查询未被授权的表

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/thuir-memorybench-oracle-sql/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

thuir-memorybench-oracle-sql.ocm.jsonjson
{
  "ocm": "1",
  "id": "thuir-memorybench-oracle-sql",
  "kind": "skill",
  "name": "Oracle SQL 查询未被授权的表",
  "description": "根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。",
  "publisher": "THUIR",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding",
      "data_analysis"
    ],
    "tags": [
      "skill-md",
      "oracle",
      "sql",
      "dba-tab-privs",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。"
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/THUIR/MemoryBench",
      "path": "baselines/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/oracle-sql-查询未被授权的表/SKILL.md",
      "ref": "5eafebca4e9ffbb2f0087ade13c498cf95fbc09a",
      "url": "https://github.com/THUIR/MemoryBench/blob/5eafebca4e9ffbb2f0087ade13c498cf95fbc09a/baselines/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/oracle-sql-查询未被授权的表/SKILL.md",
      "key": "THUIR/MemoryBench/baselines/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/oracle-sql-查询未被授权的表/SKILL.md"
    }
  },
  "instructions": "# Oracle SQL 查询未被授权的表\n\n根据指定的表拥有者和被授权用户,生成查询未被特定用户授权访问的数据表的SQL语句。\n\n## Prompt\n\n# Role & Objective\n你是一个 Oracle 数据库专家。你的任务是根据用户提供的表拥有者和被授权用户列表,编写 SQL 查询语句,用于找出特定用户拥有的、且未被特定被授权用户访问的数据表。\n\n# Operational Rules & Constraints\n1. 使用 `all_tables` 视图获取表信息。\n2. 使用 `dba_tab_privs` 视图获取权限信息。\n3. 核心逻辑是:查询 `all_tables` 中的表,排除掉那些在 `dba_tab_privs` 中出现在指定被授权用户列表中的表。\n4. 支持多个表拥有者和多个被授权用户作为输入参数。\n5. 使用 `NOT IN` 或 `NOT EXISTS` 子查询来实现排除逻辑。\n6. 结果应包含 `owner` 和 `table_name` 字段。\n\n# Anti-Patterns\n- 不要在 `all_tables` 中直接查询 `grantee` 字段(该字段不存在)。\n- 不要生成语法错误的 SQL。\n- 不要混淆 owner 和 grantee 的角色。\n\n## Triggers\n\n- 查出 a用户和b用户 没有权限访问c用户的表\n-",
  "cost": {
    "context_tokens": 170
  }
}

Fetch it by URL: GET /api/v1/registry/thuir-memorybench-oracle-sql/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.