如何通過查詢獲取表空間中包含某特定字符的所有表名稱?資料庫為oracle,謝謝!
uj5u.com熱心網友回復:
dba_tablesuj5u.com熱心網友回復:
補充下:如果你的表還包括磁區表,最好加上dba_tab_partitions和dba_tab_subpartitions
uj5u.com熱心網友回復:
select * from dba_tables where tablename like and tablespce_name=uj5u.com熱心網友回復:
我是想查找到表中包含特定字串的所有表的表名稱,不是表名稱中包含特定字符咯,請指導下 謝謝!uj5u.com熱心網友回復:
每一行都是動態sql。回圈執行輸出。select max(str1) ||
max(ext_str) ||
replace(replace(to_char(wm_concat(str2) ), ',', ''), '$*||', ',') ||
')'
from (
select ' select max(''' || t1.OWNER || '.' || t1.TABLE_NAME || ''') from ' || t1.OWNER || '.' || t1.TABLE_NAME || ' where 1 = 1 and exists(' str1,
' or instr(' || t1.COLUMN_NAME || ', ' || '$*|| ''字串''' || ') > 0' str2,
' select 1 from ' || t1.OWNER || '.' || t1.TABLE_NAME || ' where 1 = 2 ' ext_str,
t1.OWNER || '.' || t1.TABLE_NAME part_str
from all_tab_columns t1
where t1.OWNER = upper('user_name')
--and t1.TABLE_NAME = upper('table_name')
) t1
group by part_str
;
uj5u.com熱心網友回復:
沒看懂這是什么需求 。uj5u.com熱心網友回復:
你想查詢哪些表,哪些欄位存盤了某個特定的值?uj5u.com熱心網友回復:
獲取表空間中包含某特定字符的所有表名稱: 請舉出一個具體的例子出來,要不然大家都只能猜測。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/63588.html
標籤:開發
