|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
# J( ^9 A% c4 ~3 E, d1 P% I
oralce 查询TC数据库一些技巧
, c: ^; L: T# |C:\Users\Administrator>set oralce_sid=tc10;
! }7 p9 d" r6 ^. e/ ?8 {设置oracle实例( ]& v1 V; k* L+ }
C:\Users\Administrator>sqplus/nolog; O$ E3 z! _( E- B$ ~, z7 E2 z
'sqplus' is not recognized as an internal or external command,
4 g# p9 W- j1 x; i: Z" D4 joperable program or batch file.5 L( N" h6 G- w
C:\Users\Administrator>sqlplus/nolog
$ Z- g+ l% M$ ?; L' sSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 11 01:00:03 2014
6 k2 s; m6 @2 eCopyright (c) 1982, 2010, Oracle. All rights reserved.1 D' `- J/ a6 L
SQL> conn /as sysdba;
_) a! \$ Z) X. n" T% E' z6 i( n5 ^使用sysdba直接连接数据库! d6 U, Y, ^% c; _+ _* L
Connected.
4 Z, R0 A" J; G! e2 n7 x1 X$ d) JSQL> select owner from dba_all_tables where table_name like '%PITEM%';
7 O2 q" h( H) D5 G查找出所有的dba表,找到tc的PITEM的这个表的owner
' l( z% ], T" T- d1 m Q) K, |" ]6 AOWNER
5 ^. T" Y& e( ~8 P0 e& ]+ g------------------------------5 e( o8 X( X$ H; L' t
TC_ADMINISTRATOR4 l$ ~7 Q; R+ P3 |+ a0 d3 [- w
TC_ADMINISTRATOR6 M2 t" m0 @5 V% F! N( F
TC_ADMINISTRATOR
* X$ P% }: h2 |. H$ sTC_ADMINISTRATOR* } q( J. q( c$ A% k! y
TC_ADMINISTRATOR
5 f6 I& `3 J, hTC_ADMINISTRATOR6 x% L, r+ h+ E' i1 h0 H! C
TC_ADMINISTRATOR* y! q# q2 j q3 Q* M' d* o7 ]
TC_ADMINISTRATOR
5 k( ]7 z: e5 v/ I2 V) YTC_ADMINISTRATOR& u+ S# \6 h( O+ V6 T$ o
9 rows selected.$ D3 Q: K+ w9 @6 n! E5 Z1 V
SQL> select pitem_id from TC_ADMINISTRATOR.PITEM where rownum<10;) F T7 b9 E3 g' E8 Z
通过添加owner可以直接查询PITEM表) P$ N0 r1 _9 `- U# }
PITEM_ID
9 f7 ?+ t% x; M3 r8 I e) E--------------------------------------------------------------------------------5 C* x# Y* Z% J# j. x& n
000001
4 R7 Q5 F5 t2 H' u; ~) i0 t000002$ Z# k/ q; k. k X6 C9 _
000003
3 Z4 a7 P" o% G2 i000004
; `' U6 m, a# J1 Q' y000005
9 g, C& s6 I% }" {; i000006" |0 W9 @/ s1 b
000007
7 B# @; F) o1 V( r000008
. \6 p& z% A# l: ^/ z000009
0 w% ?4 Z1 u2 C7 w5 \, Q) L* ~! I) w9 rows selected.
! a$ }: `0 K' Y! g# T, H为了方便,切换使用owner帐号登录,这样就可以直接查找了
) ]) Y) s$ p2 J& K N, g3 \SQL> conn
$ l. B) u6 s: d) O. ~9 w1 EEnter user-name: TC_ADMINISTRATOR
: f6 O+ A! n" c4 w! a% N8 kEnter password:! G# t- z/ X e3 Q' {7 e
Connected.
& g8 m8 w5 R' m# c- _SQL> select puid from PBOUNDINGBOX where rownum<10;
! @. p$ W/ h. B5 T+ ^PUID5 f8 ]2 U* V6 v* N! _% T
---------------
" d5 L% L$ H* D3 ^8 `3 J" wR7aJs_c24VSRuB
$ V( q: q! M& E, v$ w5 HxKWJfazn4VSRuB
5 d" ~; l, G/ MyUZJs_c24VSRuB3 ?0 T/ [' ^; K/ K/ W" U
设置linesize可以调整显示1 H l- @* U. i$ n* J+ ]
SQL> set linesize 2000
/ v( F: `+ y4 I5 p3 J, |6 ]( qSQL> select * from PBOUNDINGBOX where rownum<10;
$ R( e0 ]5 |# N8 c! zPUID PX_MIN PY_MIN PZ_MIN PX_MAX PY_MAX PZ_MAX RPARENTU RPARENTC* U8 d4 R4 _/ A# d2 x8 V
--------------- ---------- ---------- ---------- ---------- ---------- ---------- --------------- ----------
! g1 D# J* k1 {# FR7aJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 R7UJs_c24VSRuB 59
$ q6 M4 L7 b4 RyUZJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 yUTJs_c24VSRuB 599 a+ k- H. K! ?, {
xKWJfazn4VSRuB 0 0 0 .1 .1 .1 xKQJfazn4VSRuB 59
$ n; P5 r9 G" Z( e/ O! o$ `& t; P- i: f, X7 I% R% u3 m
|
|