Oracle中查找用户表和用户表字段等
Oracle中查找用户表和用户表字段等
1、查找用户表
- select table_name,num_rows from all_tables where OWNER='TIGER' AND TABLE_NAME like '%MASTER'
- order by num_rows desc
- select * from user_tab_columns
- where DATA_TYPE='CHAR' and DATA_LENGTH=119
- and Table_name=upper('TYIMBLMASTER')
- select count(*) from sys_data
- where trxref in (select trxref from sys_data group by trxref having count(trxref) > 1)
- --或
- select sum(n) from (select trxref,count(trxref) as n from sys_datas group by trxref having count(trxref) > 1)
- select count(trxref) from (select trxref,count(trxref) as n from sys_data group by trxref having count(trxref) > 1)
- select count(*) from sys_data
- where trxref in (select trxref from sys_datas group by trxref having count(trxref) > 1)
- and rowid not in (select min(rowid) from sys_data group by trxref having count(trxref)>1)
- delete from sys_data
- where trxref in (select trxref from sys_data group by trxref having count(trxref) > 1)
- and rowid not in (select min(rowid) from sys_data
评论暂时关闭