Oracle常用系统表查询
-- get all dictionary for oracle db
select * from dict;
--select * from dictionary;
-- get all columns for dictionarys
select * from dict_columns;
-- get the default name-space for current user
select username,default_tablespace from user_users;
-- get roles for current user
select * from user_role_privs;
-- get system privilage and table privilage for current user
select * from user_sys_privs;
select * from user_tab_privs;
-- get all tables for current user
select * from user_tables;
-- get all tables whoes name includes log
select object_name,object_id from user_objects where instr(object_name,'LOG')>0
-- get the create date for a table
select object_name,created from user_objects where object_name=upper('&table_name');
-- get the size for the given table
select sum(bytes)/(1024*1024) as "size(M)" from user_segments where segment_name=upper('&table_name');
-- get tables in ram
select table_name,cache from user_tables where instr(cache,'Y')>0
-- get index couter and types
select index_name,index_type,table_name from user_indexes order by table_name
-- get the columns indexed by the given index
select * from user_ind_columns where index_name=upper('&index_name')
-- get the size for the given index
select sum(bytes)/(1024*1024) as "size(M)" from user_segments where segment_name=upper('&index_name')
-- get the last number for all sequence
select * from user_sequences
-- get all views
select view_name from user_views
-- get the sql to defined the given view
select view_name,text_length from user_views;
set long 417;
select text from user_views where view_name=upper('&view_name');
-- get all synonyms
select * from user_synonyms
-- get constraints for given table
select constraint_name, constraint_type,search_condition, r_constraint_name from
user_constraints where table_name = upper('&table_name');
select c.constraint_name,c.constraint_type,cc.column_name
from us
相关文档:
Oracle JDeveloper 10g Release Download
Oracle JDeveloper 10g (version 9.0.5.1, build 1605) for Windows NT/2000/X, Linux, Solaris, and HP-UX.
http://download.oracle.com/otn/java/jdeveloper/905/jdev9051.zip
http://download-east.oracle.com/otn/java/jdeveloper/905/jdev9051.zip
http://download-west ......
--日期转换毫秒
SELECT TO_NUMBER(TO_DATE('2005-03-29 12:30:45', 'YYYY-MM-DD HH24:MI:SS') -
TO_DATE('1970-01-01 8:0:0', 'YYYY-MM-DD HH24:MI:SS')) * 24 * 60 * 60 * 1000
from DUAL;
--毫秒转换日期
SELECT TO_CHAR(1112070645000 / (1000 * 60 * 60 * 24) +
TO_ ......
RedHat Linux安装Oracle10g(图文详解 教程)
http://winie.javaeye.com/blog/405120
关键字: redhat linux安装oracle10g(图文详解 教程)
另,本人有Word电子文档格式,如需要,请联系本人:asima127@gmail.com
1
安装RedHat Enterprise Linux 3 ......
搞oracle都会经常碰到rowid,本文是笔者根据网上各位的文章,加上自己学习中的体会,总结而成。
一.rowid简介
rowid就是唯一标志记录物理位置的一个id,在oracle 8版本以前,rowid由file#+block#+row#组成,占用6个bytes的空间,10 bit 的 file# ......
我列出我全部的做法:
table a 有id1, str1, str2, str3
开始的pk是id1, str1, str2
希望改成id1, str1, str3
--问题
小弟先有如下问题:
一个表原来的PK是 id1+str1+str2 列
先修改成id1+str1+str3列
而这三列现在当前数据库的数据有重复的情况, 小弟现在用sql:
ALTER table a a ......