|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
4 R6 Z2 ?5 s8 [8 E- w3 i9 g) }oralce 查询TC数据库一些技巧
4 v/ ~& S% ~4 _! [0 Y) t6 M0 rC:\Users\Administrator>set oralce_sid=tc10;
: X3 _+ i4 [4 M4 Z设置oracle实例
7 q. u7 I! t( {& E, T8 g3 w6 c3 SC:\Users\Administrator>sqplus/nolog4 @) q6 y: l+ v* V6 P3 c$ v
'sqplus' is not recognized as an internal or external command,
0 g4 |. o# r; [6 {' m# A5 e$ aoperable program or batch file.
7 n) D% a4 q' }! fC:\Users\Administrator>sqlplus/nolog
3 f% b5 A1 u- kSQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 11 01:00:03 20144 l' k. y% n2 k- y4 @9 r
Copyright (c) 1982, 2010, Oracle. All rights reserved.
% }7 Z5 m, u# @7 U- D* z% }, HSQL> conn /as sysdba;
& P" S: m( E& v& K! _4 ?" h' ]使用sysdba直接连接数据库
; i" ?$ R a3 w8 aConnected.7 N+ m4 `) ^, X/ z8 I
SQL> select owner from dba_all_tables where table_name like '%PITEM%';+ I! f/ f9 }( F( J9 o2 n+ J! z
查找出所有的dba表,找到tc的PITEM的这个表的owner! ?$ Y6 U( Y, S0 l8 r
OWNER
& ^" U: }& s1 C( M* ]0 r9 Q$ J8 K------------------------------5 x. t4 ? q% T
TC_ADMINISTRATOR# I* W/ V3 o+ B
TC_ADMINISTRATOR
/ J6 \' D+ X! R, Q. XTC_ADMINISTRATOR; o2 J0 @" N; p7 J
TC_ADMINISTRATOR% u) q( v4 O9 A0 S/ y
TC_ADMINISTRATOR# p$ p1 D! t! N$ J
TC_ADMINISTRATOR
: m" i/ r2 G9 e( D, B) kTC_ADMINISTRATOR, {* n( H- N) [% ]
TC_ADMINISTRATOR
$ O3 a. q( i% E: g DTC_ADMINISTRATOR. W! q9 W9 l$ i; z3 l1 [' Y
9 rows selected.+ q$ {$ t M: t, N( f
SQL> select pitem_id from TC_ADMINISTRATOR.PITEM where rownum<10;
, m9 t4 X8 ?# |# B通过添加owner可以直接查询PITEM表 s$ P& ^5 |& R* t
PITEM_ID
& m1 Q. J8 ?$ o* S$ K--------------------------------------------------------------------------------
0 u& h; X6 n2 _+ |9 Q" l6 K- m0 U000001
/ t) F/ \8 S% m$ Y5 i& _000002
' Q9 C+ _* L5 c! Q3 Q8 ~000003/ z# a+ P. ?* c
0000047 R5 W$ N8 r& \5 T! V
000005
4 U/ j2 Y7 R# G( C9 A000006$ U* w) q; b3 m M
000007
3 ^9 ]: k5 B# |8 s) s000008! k' s2 n) k! F5 t
000009' F7 X* R& t9 I- f) @% U
9 rows selected.# z; H( o- @7 F. I$ ]% D
为了方便,切换使用owner帐号登录,这样就可以直接查找了5 H; Q2 F9 F" ?! M. n4 E) u' P
SQL> conn. f$ c: S" |5 i' @' P% K
Enter user-name: TC_ADMINISTRATOR, T8 {$ i4 E* L3 Y) }! T
Enter password:! ~+ g. M/ t4 e5 o* t
Connected.
/ B3 u! `' f! S- ?$ X( ^) OSQL> select puid from PBOUNDINGBOX where rownum<10;
0 |4 {& _4 k( u. G* MPUID
0 u/ m$ J' a* I" ]: d---------------+ E: N' u4 M0 F1 _1 | Q8 j. U
R7aJs_c24VSRuB4 v% H) }* t3 {9 z
xKWJfazn4VSRuB! ]6 N% A, F+ y1 h3 x, K5 P" X8 {
yUZJs_c24VSRuB
8 j/ O1 }+ g8 T; n设置linesize可以调整显示
/ C# [' b c8 M/ eSQL> set linesize 2000/ x. }3 p3 S! q7 }# S
SQL> select * from PBOUNDINGBOX where rownum<10;
x7 S% F( C9 G+ C) I0 o# ^* z* VPUID PX_MIN PY_MIN PZ_MIN PX_MAX PY_MAX PZ_MAX RPARENTU RPARENTC; ^/ |+ P! F, s8 I9 @' u. |
--------------- ---------- ---------- ---------- ---------- ---------- ---------- --------------- ----------
9 }: T+ N8 n! A% s) _7 J& N1 ^5 z* sR7aJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 R7UJs_c24VSRuB 59
1 h7 {) x/ p0 ?( l- vyUZJs_c24VSRuB -.08328 -.08708333 -.07975309 .194439264 .087083333 .260555556 yUTJs_c24VSRuB 599 b7 A x& U4 t6 o" ?9 d& _8 r) G
xKWJfazn4VSRuB 0 0 0 .1 .1 .1 xKQJfazn4VSRuB 59
* U/ G. \+ k5 P* s' H' T5 x7 \& N6 y& F) z/ v" {/ s$ O) `/ E' a
|
|