|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
$ Z' O6 b ~, e
oralce 查询TC数据库一些技巧
- v9 o# p8 ]; \: P4 i+ K8 e1 NC:\Users\Administrator>set oralce_sid=tc10;
& G0 J; c. U8 S# {( d设置oracle实例, w' t! }% U- A& s Q7 @
C:\Users\Administrator>sqplus/nolog7 M# ?( k$ K0 {, y4 \/ {
'sqplus' is not recognized as an internal or external command,, B1 Q. f p% L, c) M/ f
operable program or batch file.
4 M* J8 b4 u, l7 A7 [: i! nC:\Users\Administrator>sqlplus/nolog+ E5 O) o! c# A" s. P
SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 11 01:00:03 2014: m f; w7 V5 N P8 v- Q8 O+ t& B
Copyright (c) 1982, 2010, Oracle. All rights reserved.8 p5 K: M$ t4 i
SQL> conn /as sysdba;
& q6 d' ]! Z' o6 S; z0 |使用sysdba直接连接数据库
% S N2 B3 q( b4 ZConnected.
0 j- K, z! q4 K6 d% ~* @SQL> select owner from dba_all_tables where table_name like '%PITEM%';' k8 M4 ~& _" X) T' J4 z1 J
查找出所有的dba表,找到tc的PITEM的这个表的owner% A; }) m0 ^9 u
OWNER
7 a& f& e, t" c0 I$ J0 |7 a' _% G------------------------------
5 A$ O, b; r( x2 G# t. kTC_ADMINISTRATOR0 h* S) c+ {" w4 ~1 F" J$ t( b# _
TC_ADMINISTRATOR6 Q7 R$ Z! B# K- Q+ _7 Z2 M/ J
TC_ADMINISTRATOR
: u1 V6 G0 N" bTC_ADMINISTRATOR
$ O- c2 m$ r4 j G% b& tTC_ADMINISTRATOR
0 j6 Z4 |) \" E4 b5 r/ G5 b( HTC_ADMINISTRATOR
. a- O* R4 L$ C0 v ?3 L9 B4 KTC_ADMINISTRATOR0 j. ^6 z5 C1 N$ e' n. t V# Y' D
TC_ADMINISTRATOR& V: }- d! D7 T
TC_ADMINISTRATOR% f y# n& n/ C i7 }
9 rows selected.) ?& c$ [1 e8 T
SQL> select pitem_id from TC_ADMINISTRATOR.PITEM where rownum<10;
& w4 x3 N1 `4 r通过添加owner可以直接查询PITEM表* t/ ~; P. z4 l" O
PITEM_ID
5 y+ H; ?2 u: `0 i--------------------------------------------------------------------------------4 |2 E1 O2 y! a4 C, M( j
0000013 h; Q+ t& h8 |. h0 ]
000002
$ d. E$ }" [7 S000003- [6 w0 E, u: y# T3 b: @7 }$ Q
000004
$ ]9 u( o( ?, j' K# A+ O# U000005
8 I' W$ l8 i- M0 N+ D! G4 ?000006
z; J4 C; c- {, O3 [" Q% M000007
2 G& C ~( a+ J8 }000008, K- |( ^3 c4 V! W+ f
0000099 J% a+ g% l {' H) R& k, z
9 rows selected.
" _& w' ^) H* V) V5 r# _5 ]为了方便,切换使用owner帐号登录,这样就可以直接查找了; E( L: q9 S/ s
SQL> conn
) J; c7 P+ ^' c+ H1 oEnter user-name: TC_ADMINISTRATOR% |4 o5 o' m7 f. l( o4 {
Enter password:; I, A2 G) t7 E, b: t- x/ v
Connected.; n; i3 ]% t. t: {8 p' t+ l! I1 W: v
SQL> select puid from PBOUNDINGBOX where rownum<10;
& y# e X7 u+ Q3 S! M$ ^1 G& ]PUID. L, c0 j {- b! S8 z) u
---------------. b: ]" w. ^; r. F' ^
R7aJs_c24VSRuB
1 ]$ [/ ~& ~) E: r& bxKWJfazn4VSRuB
; Q: {1 M! T' b# `yUZJs_c24VSRuB) D8 F& H2 p% a8 F
设置linesize可以调整显示6 k$ z8 [0 q9 w6 A) D* s0 w" e
SQL> set linesize 2000$ M. P7 o4 X8 [2 H1 A- M" N
SQL> select * from PBOUNDINGBOX where rownum<10;- X2 r; d. k/ {5 B- c1 p
PUID PX_MIN PY_MIN PZ_MIN PX_MAX PY_MAX PZ_MAX RPARENTU RPARENTC
& x& U; b- Z5 t) h3 }! M$ m--------------- ---------- ---------- ---------- ---------- ---------- ---------- --------------- ----------
- s8 N+ K5 I) r0 D/ E" k2 RR7aJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 R7UJs_c24VSRuB 59- y: | G6 M8 [- u
yUZJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 yUTJs_c24VSRuB 59. n% T3 [6 s' L2 I+ ?6 o ^2 o
xKWJfazn4VSRuB 0 0 0 .1 .1 .1 xKQJfazn4VSRuB 59
1 s* v: j, w0 J. E! ]7 }- G8 A4 f; N! P+ `
|
|