|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
; F. }0 |* `/ I% {; Woralce 查询TC数据库一些技巧
g1 I. L2 k9 hC:\Users\Administrator>set oralce_sid=tc10;5 z4 e$ B5 X- h- u4 g: ^+ l
设置oracle实例 v- T2 G+ n0 e- b4 z/ N
C:\Users\Administrator>sqplus/nolog
- L- t6 S4 ?* Q; c- s'sqplus' is not recognized as an internal or external command,- E5 f* G9 [0 ?6 _& N
operable program or batch file.3 b( i. L" h' d/ Y; i! l! }8 c
C:\Users\Administrator>sqlplus/nolog
4 f/ K! w$ x) c3 ^( X, NSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 11 01:00:03 2014
: S; I5 x9 s$ `Copyright (c) 1982, 2010, Oracle. All rights reserved.
: p9 P* ~* R. B KSQL> conn /as sysdba;7 N" w' w- n! a6 b7 K
使用sysdba直接连接数据库( g$ ?9 [% S6 i
Connected.
7 g, B: g" `4 u+ c0 ySQL> select owner from dba_all_tables where table_name like '%PITEM%';
3 [' d: {- ~. b% z查找出所有的dba表,找到tc的PITEM的这个表的owner
2 a2 @. ~% n4 r8 j9 WOWNER) B7 x( {6 `+ q5 ?5 `1 ?8 J5 @- y2 b
------------------------------
@- k0 `+ g' ]6 u5 }$ u1 s* oTC_ADMINISTRATOR
6 A) U" K/ H( [4 y" d6 D* HTC_ADMINISTRATOR" d8 y8 \2 t* Y Y8 U
TC_ADMINISTRATOR3 `/ b9 v0 m( I2 s$ p$ y5 s
TC_ADMINISTRATOR
( w, h: |4 ]& U8 {/ @( RTC_ADMINISTRATOR
3 N) y1 P: o& [, G) L9 R% sTC_ADMINISTRATOR
5 R5 Y4 d, W( XTC_ADMINISTRATOR/ `/ q2 H, b s
TC_ADMINISTRATOR% o2 O# G" Y+ n1 M- \
TC_ADMINISTRATOR
0 j. l+ P' ]7 O/ U D: ^9 rows selected.0 |& z' W2 C$ x9 T
SQL> select pitem_id from TC_ADMINISTRATOR.PITEM where rownum<10;- V) ]* _9 n T% A+ {5 j$ s: S7 E" g
通过添加owner可以直接查询PITEM表
# g& _! t& l, s ~5 q3 uPITEM_ID
) l1 D) W+ B' x( N- D; O& Q--------------------------------------------------------------------------------
! C/ W/ A$ b( t/ P2 ^4 k7 j# \000001
# s8 k7 F. f3 r+ t2 S000002
- I$ m$ }+ H e0000030 b2 a. P" Y, x R# s
000004* R: z" N* \2 p, G8 M# ]1 O* ~. u
000005
' l3 S- |, m/ z! l8 E% T6 r7 s000006: T: L) y% g8 {9 `. b
000007. t, U) p) x# o* U! g, K
000008
5 {! g9 G: I8 K000009
5 ~: Q9 Z' Y/ }' y! J2 T8 @! g2 l: P9 rows selected.
( g5 [) \2 X! I O4 Q4 A为了方便,切换使用owner帐号登录,这样就可以直接查找了
- h" k( J0 R- BSQL> conn8 L7 x* B4 ^9 {. G
Enter user-name: TC_ADMINISTRATOR
6 q. O7 M. N5 Q" b: iEnter password:3 s* U$ @- a$ @
Connected.+ O" G# ?0 P+ J7 D% L! y4 e M @
SQL> select puid from PBOUNDINGBOX where rownum<10;, R* s# J, z5 N7 ~3 k2 D
PUID
8 w x% T( b0 J3 u---------------, d4 `& a2 D. N' R! f' a3 f
R7aJs_c24VSRuB3 k e' p3 _. n; C
xKWJfazn4VSRuB
5 X8 L6 d; x6 ]# l$ J! Y3 |. FyUZJs_c24VSRuB8 {- c, ]4 m' p i7 k" o
设置linesize可以调整显示
2 r8 T" O }, R" P" x: g+ mSQL> set linesize 2000
4 [$ G9 c: A: r# x( K, W) uSQL> select * from PBOUNDINGBOX where rownum<10;* D6 m( J& \1 f' m" Q4 j6 X' d: y
PUID PX_MIN PY_MIN PZ_MIN PX_MAX PY_MAX PZ_MAX RPARENTU RPARENTC$ K" |7 n6 q7 Q+ V* F
--------------- ---------- ---------- ---------- ---------- ---------- ---------- --------------- ----------
0 t' b7 K# J" T/ AR7aJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 R7UJs_c24VSRuB 59
* `- }* |6 L. ~6 SyUZJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 yUTJs_c24VSRuB 59. |1 }. ]3 [5 D' Y- H1 ]
xKWJfazn4VSRuB 0 0 0 .1 .1 .1 xKQJfazn4VSRuB 59' A2 o9 M# f$ c5 s0 D3 f1 M+ P
+ C' r9 [ Z' p, r( A" q
|
|