|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
% K! i' }( w. U ]; O
oralce 查询TC数据库一些技巧 B4 O* Y, F# a4 }& l7 K
C:\Users\Administrator>set oralce_sid=tc10;
5 U) P0 h+ I# b. b( U: l% l$ i设置oracle实例
+ E. l- X" w" Z2 ^( [% B8 EC:\Users\Administrator>sqplus/nolog4 C* F' }' G* |
'sqplus' is not recognized as an internal or external command,
: O, ]" u% X- l6 p3 Hoperable program or batch file.9 t3 p' _+ Z- Y& j% ^; v! b# |
C:\Users\Administrator>sqlplus/nolog
# W' o8 S) Z$ |8 G" t! y, R6 ~SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 11 01:00:03 2014
$ Q+ |/ y1 |, E" @Copyright (c) 1982, 2010, Oracle. All rights reserved.
1 R! P7 T0 T# v4 Q+ o* S$ tSQL> conn /as sysdba;5 {7 e* h# M# v4 e& K7 a* R5 o+ J5 E
使用sysdba直接连接数据库1 k: z0 F! J9 \6 E
Connected.
8 R* z. T0 i6 ]& oSQL> select owner from dba_all_tables where table_name like '%PITEM%';
/ B1 m! k+ b' L" ^* O4 w查找出所有的dba表,找到tc的PITEM的这个表的owner# b% Q$ k3 m6 ]6 Z8 H! ~$ N4 _
OWNER
4 A4 Q; L0 |9 I0 \! `! f------------------------------
6 T6 n, c) y/ R; ZTC_ADMINISTRATOR
# m- t- R. x& A( YTC_ADMINISTRATOR- Q9 M; S( Y0 R+ Z
TC_ADMINISTRATOR6 f# V/ ^- n- F0 N& N
TC_ADMINISTRATOR
" w6 T8 c6 b/ n4 R. w- X5 Q2 b5 \TC_ADMINISTRATOR7 l; W* f( @2 z
TC_ADMINISTRATOR
' C, \$ z# a9 C3 ^) ZTC_ADMINISTRATOR! d. B7 m- y$ b8 D. i8 ?7 J& g/ j
TC_ADMINISTRATOR
8 H ?# k3 M, Y ]. Z1 KTC_ADMINISTRATOR
: j4 q% _, @" f }7 U9 rows selected.
4 ^6 I3 G$ K8 Y" | }SQL> select pitem_id from TC_ADMINISTRATOR.PITEM where rownum<10;
4 _4 Z2 H! Y: d通过添加owner可以直接查询PITEM表
4 l( Q8 {3 {( S9 ^/ tPITEM_ID
t: Z4 x( H; c) J3 `4 \--------------------------------------------------------------------------------6 g K; ?9 z1 m$ Q' Q
000001
4 ]% }* { i# u* F3 Q1 }5 \) v, [0000024 {$ V& K8 [9 x% d9 `% Q
000003
& A2 }$ r. h( M) u6 @, X7 j* i$ e000004' ^1 e1 R# E% o- e! _7 P) F
000005" F/ p; w, h" I6 x& i' G) | J
000006
5 Q3 [+ \/ S' A% ^, x; E000007
3 i8 ?6 A* ^7 f) @9 m000008
0 H% [* ~$ k7 i% l7 m000009
% ^5 S ^7 W& X$ f% i9 rows selected.0 D7 [% U) r2 C# t
为了方便,切换使用owner帐号登录,这样就可以直接查找了4 ^! u% B/ v' g4 w5 b( _* H" |! v' w
SQL> conn7 s+ S: I, w( z8 z5 s
Enter user-name: TC_ADMINISTRATOR
! ^3 P X/ d: l' l5 ^% I' B6 PEnter password:5 [' }; @9 p5 Q3 H; s
Connected.8 \( N& x4 c: @; U, G0 j
SQL> select puid from PBOUNDINGBOX where rownum<10;
3 t0 Z4 M8 @4 g& E% v$ U: CPUID
& S9 z: e( Q# P5 i+ l( H. {, ~---------------
( u+ s6 R" v7 A8 K" D: ^R7aJs_c24VSRuB+ `$ J; s3 q) V4 f- S* o
xKWJfazn4VSRuB& p* [' z$ T9 M6 |6 E4 t' N
yUZJs_c24VSRuB& b9 W, q7 ]' V, z! p+ m
设置linesize可以调整显示
' c( \- P6 _: y0 C$ o2 |SQL> set linesize 2000
, y# y8 ?6 E7 s: O) x+ _SQL> select * from PBOUNDINGBOX where rownum<10;
& W1 n0 s6 J) r ]9 y J& RPUID PX_MIN PY_MIN PZ_MIN PX_MAX PY_MAX PZ_MAX RPARENTU RPARENTC
( M3 H# X1 ~% ` b2 S--------------- ---------- ---------- ---------- ---------- ---------- ---------- --------------- ----------
# {+ ~/ Q! D0 L4 L- Z0 q, m% ZR7aJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 R7UJs_c24VSRuB 59; q' S2 c; O9 [& I. t" t
yUZJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 yUTJs_c24VSRuB 59
: O0 {; f1 L, Q$ i& r5 M1 K6 lxKWJfazn4VSRuB 0 0 0 .1 .1 .1 xKQJfazn4VSRuB 59( H# s5 Z/ O0 ?/ \+ p1 Z
, F, C1 M- f* R, w9 M
|
|