在设置Oracle密码时,我们经常会将密码设置的特别复杂(一般由字母、数字和特殊符号组成),值得注意的是,在有特殊符号时,修改密码或着导入导出数据时会遇到很多不必要的麻烦,本文中将会对此情况进行详细的解释和说明: ( J1 B0 Z' G# [+ ~
注:本文中,将以特殊符号“/”为例。
: F" \# E$ v# a( gLinux环境下,使用Oracle数据库10g % O6 f: p# a( j9 N! b V$ W1 k1 l
修改密码 5 |% f' t* t5 ?0 |2 b% ^% @" O
[oracle@olivenan oracle]$ sqlplus '/as sysdba'
7 Z6 A/ [# `2 l; R: C2 ^6 X, E- d3 {2 l7 C
SQL*Plus: Release 10.2.0.1.0 - Production on Wed May 17 14:33:32 2006
, H6 E) z1 K, V6 @6 E \& p2 o$ N9 [+ e. N V% p$ R$ [% @+ x
Copyright (c) 1982, 2005, Oracle. All rights reserved. 1 P3 u X. `( P
9 P% U1 ~) r. x2 l& s! q+ g% N( q7 T/ W4 x3 V. k
Connected to:
$ H! `8 [! C7 `9 z9 r5 O/ y9 n# uOracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production % y* s9 I7 b4 n" R# G/ J6 p2 B% Z( w
With the Partitioning, OLAP and Data Mining options . M( ^$ Y( Q+ g2 _
/ s7 b& j5 }4 Z4 q- B( LSQL> alter user test identified by aa/aa;
6 G& M( O9 J7 c' S/ x; |: {9 j* F- k1 i# z8 T9 |
alter user test identified by aa/aa
6 p5 y: b8 w" B, t*
9 g$ q; L) c! fERROR at line 1:
2 t5 T; ?( e: B, a4 ?) `ORA-00922: missing or invalid option 0 _+ p1 d! p1 ~
9 W' s4 p- ~( k) Q' j4 G0 L
在此使用"" ' r- t# X% Z8 [' s$ L' r
SQL> alter user test identified by "aa/aa";
8 s' @9 \$ x; U$ U# w7 `& d; s9 E$ b8 \' m0 B% \, e. a
User altered.
Q/ a( Y1 i! K& R- L' d8 B. e7 L; W3 Q7 q, q
SQL>
* ~ W. @' S6 s/ H [- w
* Y) q, v+ `0 h Y+ _2 i) V
8 _9 u* I1 ^, M/ r[oracle@olivenan oracle]$ exp test/aa/aa file=test.dmp buffer=65536 - X4 t8 i; w# m0 [4 H. L
3 x: q# C) B' l k* k \Export: Release 10.2.0.1.0 - Production on Wed May 17 14:32:10 2006 % `4 A G. t# Q& r X. S$ G/ v9 v
2 {0 `( V/ Q& o8 X$ \/ o
Copyright (c) 1982, 2005, Oracle. All rights reserved.
8 N B( b0 {% v4 O" ]& }) ]* e+ K" Z$ l7 a+ [' o- k& C% Q
& F( |, |# R# m/ Y4 J; i% A, gEXP-00004: invalid username or password & ]. ]% i) ^5 c2 Y4 _5 i
Username: / J" O4 L# \5 R
; u+ \, W @3 p+ w6 v3 X, j5 g
此处应该进行转义使用 " "处理密码,使用 ' '处理用户名和密码
3 @" Y$ r, q3 J2 u2 ]
( p3 }$ S, n3 S( Q g[oracle@olivenan oracle]$ exp 'test/"aa/aa"' file=test.dmp buffer=65536
" A. K9 I, f7 {+ c( |( H7 w' l, _5 }
Export: Release 10.2.0.1.0 - Production on Wed May 17 14:32:52 2006
/ d2 I6 M5 G! J' O6 z; r6 L$ ^1 w8 l6 s7 P' Z; g
Copyright (c) 1982, 2005, Oracle. All rights reserved.
3 z# [) J5 x. c5 s% q
) a4 L. {% A N: M
$ u, g2 v+ ~7 yConnected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
! ~3 O+ n: E m) l6 x: hWith the Partitioning, OLAP and Data Mining options
, h+ a w1 V0 J$ u% |$ w# j0 j. HExport done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set ) Y1 I6 T# c2 O. _ E0 h0 @2 d2 c: {
& T: N2 V0 D, U6 u. D& z' V( `
About to export specified users ...
/ O5 l& X% j* h' F8 N. exporting pre-schema procedural objects and actions
) J1 c: Y# W: W( p* t3 o: y
4 |0 l+ p& m3 W2 u...............
/ t, L/ q* ~: u8 W导出成功。 Windows Xp下,数据库为Oracle9i 9 m1 }2 V( G& K6 Q) G8 j3 c
1 E/ ~: Q( N, S* H) M, N
% h) l+ Q8 l" J% ?( L. ^6 V; `; {, ^" r
C:\Documents and Settings\w>sqlplus /nolog
1 i2 M# M' N6 s1 [( _* e, h* C4 I- h
SQL*Plus: Release 9.2.0.1.0 - Production on Wed May 17 14:56:34 2006
0 b- |* M0 p. q; c2 u- R& e+ D1 w% X9 Y
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
3 {0 M7 Z0 X; d' n6 D: Y2 E P/ A# T g u
SQL> connect sys/olivenan as sysdba 5 j" g2 e. H: ^% U+ G
Connected. ( R3 {$ ?3 M; ^+ ]9 `1 w& k
SQL> alter user test identified by aa/aa;
- r4 m/ H& G! M1 z2 `: [+ R5 n; D. j; ealter user test identified by aa/aa , p. e3 x+ a5 h; F' Z' o
* |