1.使用下面这个sql语句,可以获得我们非常常用的一些短小精悍的视图,这些视图通常是最常用的用户级别数据库对象SELECT * FROM dict WHERE table_name NOT LIKE '%$%' AND table_name NOT LIKE '%/_%' ESCAPE '/' AND LENGTH (table_name) < 10ORDER BY 1;2.演示操作执行结果sys@ora10g> SELECT * 2 FROM dict 3 WHERE table_name NOT LIKE '%$%' 4 AND table_name NOT LIKE '%/_%' ESCAPE '/' 5 AND LENGTH (table_name) < 10 6 ORDER BY 1;TABLE_NAME COMMENTS----------- ---------------------------------CAT Synonym for USER_CATALOGCLU Synonym for USER_CLUSTERSCOLS Synonym for USER_TAB_COLUMNSDICT Synonym for DICTIONARYDUALIND Synonym for USER_INDEXESOBJ Synonym for USER_OBJECTSSEQ Synonym for USER_SEQUENCESSYN Synonym for USER_SYNONYMSTABS Synonym for USER_TABLES10 rows selected.3.结果非常的令人振奋,都是非常熟悉,非常亲切的视图!下面是CAT输出效果scott@ora10g> desc cat; Name Null? Type ------------ -------- ------------------------- TABLE_NAME NOT NULL VARCHAR2(30) TABLE_TYPE VARCHAR2(11)scott@ora10g> select * from cat;TABLE_NAME TABLE_TYPE----------- -----------DEPT TABLEEMP TABLEBONUS TABLESALGRADE TABLE4.类似的还有TAB视图,他是sys用户下的视图,授权给public的一个同名scott@ora10g> desc tab; Name Null? Type ------------ -------- ---------------- TNAME NOT NULL VARCHAR2(30) TABTYPE VARCHAR2(7) CLUSTERID NUMBERscott@ora10g> select * from tab;TNAME TABTYPE CLUSTERID------------ ------- ----------DEPT TABLEEMP TABLEBONUS TABLESALGRADE TABLE5.小结熟练使用这些“小”视图,可以极大的提高操作数据库的效率。不过这些“小”数据字典是由局限性的,请兴趣的朋友可以进一步探索一下这些数据库对象的出处。-- The End --
原文出处:http://space.itpub.net/?uid-519536-action-viewspace-itemid-571454