Oracle查看表的内容以及字段
--查看表以及表注释
select a.TABLE_NAME,b.comments from user_tables a,user_tab_comments b where a.TABLE_NAME = b.table_name
--查看表的字段的注释
select c.column_name,c.comments from user_col_comments c where c.Table_Name = 'TABLE_NAME'
删除重复记录
--删除一张表的重复记录(ID是自增唯一主键,重复记录:其他字段都是一样)rowid
Delete from t where id not in (Select min(id) from t Group by name,age);
查看表的操作记录
/*SELECT 被修改表字段,VERSIONS_STARTTIME,VERSIONS_ENDTIME,VERSIONS_OPERATION FROM 表 VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE WHERE VERSIONS_STARTTIME IS NOT NULL ORDER BY VERSIONS_STARTTIME DESC;
查询该表指定时间内修改前的记录:*/
select * from SYS_PARAM AS OF TIMESTAMP TO_TIMESTAMP('20181029 17:00:00','yyyymmdd hh24:mi:ss');
查看视图
--查看当前用户下所有得视图
select * from user_views
查看函数内容
--查询函数的内容
select text from user_source where name='FUNNAME';
查看oracle版本
--查看oracle的版本信息
select * from v$version