|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
. D; w* }% Y/ Z5 f- D
oralce 查询TC数据库一些技巧; [" s; w! z& [+ L
C:\Users\Administrator>set oralce_sid=tc10;
; V k. W. i0 ^6 x1 v设置oracle实例: J" N) s& `+ r( `
C:\Users\Administrator>sqplus/nolog7 u4 h3 N& T4 T! }( W7 N( ~4 c* s# t
'sqplus' is not recognized as an internal or external command,0 r: j$ ~& V+ a3 t8 Z: S
operable program or batch file.2 p9 O, X( t" N$ p# X
C:\Users\Administrator>sqlplus/nolog P5 K: K8 D( X! W. A: C: ^
SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 11 01:00:03 2014
, ?- I7 |! D: H* _8 F! c: ]3 O- VCopyright (c) 1982, 2010, Oracle. All rights reserved.% @& H. H2 U. K) d, i
SQL> conn /as sysdba;
3 o9 }7 s/ x) j/ X) |# O% `使用sysdba直接连接数据库
: S$ B/ h+ t4 z# lConnected.7 u; k% e s: O) u, K2 y2 t& t- {
SQL> select owner from dba_all_tables where table_name like '%PITEM%';8 N8 q3 K3 i2 p) r4 m8 N
查找出所有的dba表,找到tc的PITEM的这个表的owner
- C& N$ \# `" mOWNER; o1 X7 X5 p: |- E
------------------------------
, E: ^6 @5 \) F" B/ e5 a1 ETC_ADMINISTRATOR
, ^. i% u7 p# R6 A/ [! gTC_ADMINISTRATOR9 M- W: Z# z& D3 \1 k$ y7 o2 s8 P" b
TC_ADMINISTRATOR
9 o+ B6 D _# I0 g& ?! F) Q: [TC_ADMINISTRATOR5 w0 t& Y( f6 @ Z, T
TC_ADMINISTRATOR
0 a( m! P; ~! f% _; yTC_ADMINISTRATOR
! ?3 {' H, p7 C% S" |; xTC_ADMINISTRATOR
" w1 W; {$ i( M- HTC_ADMINISTRATOR
0 I( W7 |& f/ ^/ uTC_ADMINISTRATOR
+ `; }9 d4 K/ M9 e+ @) L, @9 rows selected.
' H) u4 F" n, M2 XSQL> select pitem_id from TC_ADMINISTRATOR.PITEM where rownum<10;, J: N( j9 L! ]
通过添加owner可以直接查询PITEM表
& T9 l! z- G/ N- |PITEM_ID
# B) ]: {2 L. B" r0 c! g% @" N r- Q--------------------------------------------------------------------------------
0 {0 f9 v: F! T6 U000001
0 Q$ C0 }+ H% E- v8 u X0000026 w, w- q, h+ ]' ^& Z+ j
0000032 O+ ~" d4 u/ a! Y; j
000004
' o, _0 |- z! Y" M000005
& G; T1 ^" i. r0 g# p000006* m" `8 U2 {3 c F! C1 W. ]
000007
. E% s$ m9 r; [: j( X000008
' b! D: l' {7 s$ b& G0000091 R" Y: n. C( d
9 rows selected.
+ R$ ]. D: @, P7 y4 N为了方便,切换使用owner帐号登录,这样就可以直接查找了( L. q2 Z3 W# s; E' K. u4 h
SQL> conn
9 T1 y" t( O2 ^( ~( Y+ H3 wEnter user-name: TC_ADMINISTRATOR
' |, K m) |' \: g$ \, w& z2 [Enter password:
: S& D: Q0 |& N- ?, cConnected.
/ f$ R& z, H! ~; d JSQL> select puid from PBOUNDINGBOX where rownum<10;
" f4 L4 G5 X( p: \0 _PUID
! T' L' A1 K9 Y$ `0 s---------------: V, K# Y& D+ s9 n% B g: d
R7aJs_c24VSRuB0 S, |6 ?4 Y# d/ ?4 o
xKWJfazn4VSRuB+ z9 {6 L7 e2 ~5 v
yUZJs_c24VSRuB- J( q+ K" n. y
设置linesize可以调整显示7 I0 q/ u+ |4 N
SQL> set linesize 2000
: t* G! X* K- z, ISQL> select * from PBOUNDINGBOX where rownum<10;1 y: d/ d& l4 [! f
PUID PX_MIN PY_MIN PZ_MIN PX_MAX PY_MAX PZ_MAX RPARENTU RPARENTC
0 q" n: T+ c2 H--------------- ---------- ---------- ---------- ---------- ---------- ---------- --------------- ----------1 k2 X8 q: k7 r5 H7 L5 G" x
R7aJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 R7UJs_c24VSRuB 59! N X+ D& ^; d8 F+ B$ H0 b. f
yUZJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 yUTJs_c24VSRuB 59
6 R% f: b$ ~# Z4 v& IxKWJfazn4VSRuB 0 0 0 .1 .1 .1 xKQJfazn4VSRuB 594 a, o; L. v7 m+ S
5 V/ a/ ^) T* Y8 ?' S |
|