日志第三天:oracle 命令大全
上一篇 / 下一篇 2013-06-28 10:31:05 / 个人分类:perl
测试笔记
- 笔记:
然后看老板下达的学习市场任务。51Testing软件测试网5M |0uEL1r5zGM
最后进行perl学习。
Z$O(W$n:\5vn-vvm0
Pg:w RB(w y#}5S `0复制一份oracle 系统命令大全
X/BW"QO0
oracle系统表查询
oracle系统表查询
j'jrSa)Kc {ia051Testing软件测试网(g({}J"J+X b,@oracle查询用户下的所有表
/z3jGi V6b6|Y0select* from all_tab_comments -- 查询所有用户的表,视图等
2I&@ L@Z5u0select* from user_tab_comments
ZL)kK fR7i0select* from all_col_comments --查询所有用户的表的列名和注释.51Testing软件测试网(nJ"a] dD.Y-s|7P
select* from user_col_comments -- 查询本用户的表的列名和注释51Testing软件测试网F#x0r g1Jez/F
select* from all_tab_columns --查询所有用户的表的列名等信息(详细但是没有备注).
z8]4Se@0SA@
Z0select* from user_tab_columns --查询本用户的表的列名等信息(详细但是没有备注).51Testing软件测试网#cf]$f{-x Z
j KDe*bH0--一般使用1:
J#? t$_R#rg*y0selectt.table_name,t.comments from user_tab_comments t51Testing软件测试网5Pc/L4p?R D z&\
!VR%f&^U2}0--一般使用2:
x'IF+Lx}0selectr1, r2, r3, r5
mL f;_loJ0@0from (selecta.table_name r1, a.column_name r2, a.comments r351Testing软件测试网~Q,sn'wC$W}T
3BCxeP2N)y&f6H^0where r4 = r1
oracle系统表 查询
51Testing软件测试网da&~/k*i!t f:p1、用户: 51Testing软件测试网*ZGuS+r(X
select username from dba_users;
?1Q;so1E
}0 改口令
n$|~
`:vVS-k3f0 alter user spgroup identified by spgtest;
(BV
uo:R0 2、表空间: 51Testing软件测试网f.m{:x4h*_c&D
select * from dba_data_files; 51Testing软件测试网d3r'}"N)FI {Lg4\WNp
select * from dba_tablespaces;//表空间 51Testing软件测试网b8AvHKoe
XnjG.sr0 select tablespace_name,sum(bytes), sum(blocks)
c4l3aZj.j0 from dba_free_space group by tablespace_name;//空闲表空间 51Testing软件测试网*mM7u-G c|
51Testing软件测试网b,t9Lgq2h
select * from dba_data_files
;L%G2w
_\*ei&k0 where tablespace_name='RBS';//表空间对应的数据文件
`
z2z9~}IqB051Testing软件测试网7Wgh6G*b$~
select * from dba_segments
"e5L1d~;f-p}0 where tablespace_name='INDEXS'; 51Testing软件测试网Y#F@*l#s/O+m
3、数据库对象: 51Testing软件测试网*k6t"Y0GR8P4Vz"j(`fI
select * from dba_objects;
2N4uV5{&X;Hr0 CLUSTER、DATABASE LINK、FUNCTION、INDEX、LIBRARY、PACKAGE、PACKAGE BODY、 51Testing软件测试网[Za,F)qxR
E{j
PROCEDURE、SEQUENCE、SYNONYM、TABLE、TRIGGER、TYPE、UNDEFINED、VIEW。 51Testing软件测试网 b4iGS&J)R8MW2z3l
4、表:
,z8\ZFZ#f0 select * from dba_tables; 51Testing软件测试网
GlA1}B&i2n3f
analyze my_table compute statistics;->dba_tables后6列 51Testing软件测试网`Wcz!P-] `N6U
select extent_id,bytes from dba_extents
(Z
L.?7{)P9l0 where segment_name='CUSTOMERS' and segment_type='TABLE' 51Testing软件测试网Fu-l |I
order by extent_id;//表使用的extent的信息。segment_type='ROLLBACK'查看回滚段的空间分配信息 51Testing软件测试网 fol+E
o]r
列信息:
FYup6Vl:P!B0 select distinct table_name 51Testing软件测试网jg}7d:jYn&Q:r
from user_tab_columns
h[1?4nyJH0 where column_name='SO_TYPE_ID';
!U G#D ]
j i6b0 5、索引:
'C|A`|2GJ0 select * from dba_indexes;//索引,包括主键索引 51Testing软件测试网?L-mv:}
select * from dba_ind_columns;//索引列
uzN }T^,V!R0 select i.index_name,i.uniqueness,c.column_name
@ ej/mod0 from user_indexes i,user_ind_columns c 51Testing软件测试网(M@&EL7~p
i8Ns
where i.index_name=c.index_name