C 獲取oracle中某個使用者的所有表

2021-08-02 00:07:54 字數 499 閱讀 7198

列出屬於某個使用者的所有表:

select table_name from user_tables;

列出屬於當前使用者可以訪問的所有表:

select table_name from all_tables;

列出所有表(當前使用者必須是管理員):

select table_name from dba_tables;

列出某個表的所有字段:

select   column_name  from user_cons_columns where table_name ='表名'

查詢屬於某個表的主鍵

select   column_name  from user_cons_columns where table_name = '***x'(表名要大寫)

向table中一次插入多行資料:

insert into tablename1 select * from tablename2

Oracle中刪除某個使用者下的所有表

一般的方法 先使用sql查詢 select delete from table name from user tables order by table name 將查詢結果複製一下,在sql命令視窗裡再執行一次就刪除了所有的表。select drop table table name from c...

oracle刪除某個使用者所有表

1 select drop table table name from all tables where owner 要刪除的使用者名稱 注意要大寫 2 刪除所有表 以使用者test為例 for example declare cursor cur1 is select table name fro...

oracle 刪除某個使用者下的所有物件

先存放好dropobj.sql 檔案 然後登入需要刪除的使用者 刪除前最好備份一下 備份是在cmd中進行的 c users panfu exp file d expall.dmp log expall.logfull y export release 10.2.0.1.0 production on...