没有表的ORACLE DB user_constraints [英] ORACLE DB user_constraints without tables

查看:128
本文介绍了没有表的ORACLE DB user_constraints的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个没有表的Oracle模式(我删除了它们).但是,当我查看user_constraints表时

I have an Oracle schema with no tables (I dropped them). When I look at the user_constraints table, however

    SELECT * FROM user_constraints;

我看到许多行.如何删除这些约束?

I see a number of rows. How is it possible to delete these constraints?

    DELETE FROM user_constraints WHERE owner='owner';

没有用,它给了我一个权限不足"的错误.

did not work, it gave me an "insufficient privileges" error.

    SELECT owner, constraint_name, constraint_type, table_name, r_owner, r_constraint_name  FROM user_constraints;

    OWNER                          CONSTRAINT_NAME                CONSTRAINT_TYPE TABLE_NAME                     R_OWNER                        R_CONSTRAINT_NAME            
    ORA_AI_1_9                     BIN$z2XwnFUHEHrgQ4sGOR4Qeg==$0 P               BIN$z2XwnFUJEHrgQ4sGOR4Qeg==$0                                                               

    ORA_AI_1_9                     BIN$z1NhC6g4oErgQ4sGOR6gSg==$0 P               BIN$z1NhC6g6oErgQ4sGOR6gSg==$0                                                               

    ORA_AI_1_9                     BIN$z1anK5OEEHrgQ4sGOR4Qeg==$0 P               BIN$z1anK5OGEHrgQ4sGOR4Qeg==$0                                                               

    ORA_AI_1_9                     BIN$z1NhC6hhoErgQ4sGOR6gSg==$0 P               BIN$z1NhC6hjoErgQ4sGOR6gSg==$0            

推荐答案

那么你在10/11g体重,也许还有雷吗?

so are you on 10/11g and have the recylebin perhaps?

SQL> select count(*) from user_tables;

  COUNT(*)
----------
         0

SQL> select count(*) from user_constraints;

  COUNT(*)
----------
         0

SQL> create table foo(id number primary key);

Table created.

SQL> ALTER SESSION SET recyclebin = ON;

Session altered.

SQL> select count(*) from user_tables;

  COUNT(*)
----------
         1

SQL> select count(*) from user_constraints;

  COUNT(*)
----------
         1

SQL> drop table foo;

Table dropped.

SQL> select count(*) from user_constraints;

  COUNT(*)
----------
         1

SQL> select count(*) from user_tables;

  COUNT(*)
----------
         0

SQL>

您可以清除Reclebin来解决这个问题.

you can purge the reclebin to fix this.

SQL> purge recyclebin;

Recyclebin purged.

SQL> select count(*) from user_constraints;

  COUNT(*)
----------
         0

这篇关于没有表的ORACLE DB user_constraints的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆