a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 104|回复: 1

[其他] Oracle认证:Oracle用户密码含有特殊字符的处理办法

[复制链接]
发表于 2012-8-4 13:41:06 | 显示全部楼层 |阅读模式
在设置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
*
回复

使用道具 举报

 楼主| 发表于 2012-8-4 13:41:07 | 显示全部楼层

Oracle认证:Oracle用户密码含有特殊字符的处理办法

ERROR at line 1:
2 B( u7 L2 z/ T5 v- f1 d+ r6 F8 d% sORA-00922: missing or invalid option
& Z  v+ q$ }+ C& o; _, {0 t8 x; N3 B/ q- |0 E! Z
此处使用""
5 v" w6 E; P% P6 W& X2 t. Z7 DSQL> alter user test identified by "aa/aa"; " k1 g) I  j' v5 y

9 w3 J' T4 Q  ^0 ~3 t2 z) q; r' L6 A0 VUser altered. ( {. d& V' t; D2 c# T2 v3 P
, h# ^" j4 m7 A' P$ i
SQL> : `  @+ M8 a# F& I

6 T- g+ f0 Z8 yMicrosoft Windows XP [版本 5.1.2600] 0 A# ~8 o- @! m3 u6 C8 v* g
(C) 版权所有 1985-2001 Microsoft Corp. - s/ t( p. b" H3 G( c% T
: V+ }5 m& x* ~! J$ p/ R/ }8 A- ]. X
C:\Documents and Settings\w>exp test/aa/aa file=aa.dmp buffer=65536
4 u9 ?0 p9 }- ~' K: M
( x* d/ R1 H. t9 L1 O! G( ?6 r, rExport: Release 9.2.0.1.0 - Production on Wed May 17 14:58:50 2006
4 R1 _3 Y* O2 F* Q
1 {- Z, @' S+ kCopyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
7 x! m) K. x9 ]; t) [  U! S1 e
/ F( x2 K4 t& G6 V
EXP-00004: invalid username or password
7 x! i1 U+ o9 @2 EUsername: - k& P- q4 s$ _+ E; j0 N
Password: ( v1 `) g# n) l: v! [3 W6 q
EXP-00056: ORACLE error 1017 encountered
( P: a0 i6 D8 _9 \- MORA-01017: invalid username/password; logon denied
) H1 ?& ?% t8 |4 ?Username: ^Z^Z 4 o! O0 m5 O( N! f  q8 P6 k
5 Y% A/ b8 z! C5 a3 [- S
EXP-00030: Unexpected End-Of-File encountered while reading input - |7 a! d* l' c1 P$ l
EXP-00000: Export terminated unsuccessfully $ s* u5 _! t/ {
1 _. o  B- S& B
在此处将使用""" """来处理用户密码 8 W9 s+ q9 H7 O( K

' x4 \  ^$ H" @  sC:\Documents and Settings\w>exp test/"""aa/aa""" file=aa.dmp buffer=65536
: g! \+ t. L9 d0 O! Y5 q% a4 Y  B) F7 F# J1 c) q4 p: K
Export: Release 9.2.0.1.0 - Production on Wed May 17 14:59:10 2006 8 \3 I7 u0 u" U4 F6 i3 j
0 N9 K+ t( D4 p6 S- k) x+ T
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. 6 j' o% M2 F. ~3 m$ m

' J1 E7 \& r. T- e( O5 \0 [- H) G* F7 G2 k( ]
Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production # a* e! G8 Z5 D+ ]
With the Partitioning, OLAP and Oracle Data Mining options
- P" J) O" A* a9 H5 G, y9 aJServer Release 9.2.0.1.0 - Production ; {( f' l1 `( X, ~  {
Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
5 G! Z4 H5 [+ `" q9 D  r$ Kserver uses ZHS16GBK character set (possible charset conversion) ( T5 J- o- ]  x) D5 f
! [. f' L/ r8 F$ P5 |
About to export specified users ... & e6 t; k/ k# I+ e9 C4 O
. exporting pre-schema procedural objects and actions
, o; s; p1 l0 I& [( a# x# ~. exporting foreign function library names for user test / r$ N: l: G. x! x: I* u: Y
. exporting PUBLIC type synonyms ( i3 T( v! H, s4 \; O7 |0 f; C$ x+ P! K
. exporting private type synonyms
; y; T& F8 ]" e8 a8 s; e: m* [. exporting object type definitions for user test
2 F. o" M1 N& T$ ]! p9 Y4 j4 WAbout to export test's objects ... 9 i* z; M' G# n7 z* q, F) m' z' G3 |6 o: ?
. exporting database links 5 Z- t. g' j2 ^/ n* M: B; i8 e
. exporting sequence numbers ........
" i7 n0 [3 ^3 j" A至此,导出成功。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-5 00:52 , Processed in 0.182341 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表