1. 查詢表的結構oop
select * from user_tab_columns where Table_Name='用戶表';
select * from all_tab_columns where Table_Name='用戶表';
select * from dba_tab_columns where Table_Name='用戶表';it
2. 獲取表io
select table_name from user_tables; //當前用戶的表
select table_name from all_tables; //全部用戶的表
select table_name from dba_tables; //包括系統表
select table_name from dba_tables where owner='用戶名'table
3. 查詢當前庫中以Unit開頭的表的全部列select
select table_name,COLUMN_Name
from user_tab_columns
where table_name in
(select table_name from user_tables where table_name like 'Unit%')exception
4.批量重命名im
begin
for c in (select table_name tn from user_tables where table_name <> upper(table_name)) loop
begin
execute immediate 'alter table "'||c.tn||'" rename to '||c.tn;
exception
when others then
dbms_output.put_line(c.tn||'已存在');
end;
end loop;
end;命名