新装完Oracle10g后,用system/password可以正常登录,而使用scott/tiger用户却不能登录:
) N/ x. {, c+ O8 e: V. } conn scott/tiger& g2 F3 ?0 t* l
error:oracle10g the account is locked0 X% O l' s; q5 G2 _* m
oracle10g the password has expired1 X z& c; h% v) }4 S, w- _
原因:默认Oracle10g的scott不能登陆。被禁用了。
" _1 J; d6 [1 a/ l) F: k 解决方法:
: i5 j5 \) S7 d4 p4 O 首先确认已经安装oracle 数据库和客户端; E7 L. z% H) ~. v( C
.在客户端DOS下执行如下语句:
( R# E4 N5 s0 C 注意提示符号
2 m/ K1 |/ ^* {% X. l' V0 S; ^- T c:\sqlplus /nolog7 g" j* G3 Q4 f3 @" A
sqlp\ conn sys/system@oracle10 as sysdba // sys为当前的oracle 用户 system 为该用户密码 oracle10 为SID. R, I9 B" g- L
# alter user soctt account lock; // 把 scott用户锁定7 G# ]+ |# a* m# ?1 z9 I
# alter user scott account unlock; //把scott用户解锁
% s' l. a& ^% W # alter user scott identified by scott //修改scott用户密码为 scott,scott用户默认密码为 tiger3 D3 J! E- b: h5 l6 K/ e0 B2 q
1 Dos下输入C:\sqlplus /nolog
& |" _$ r# ?& M6 u0 d 2 以DBA的身份登录
; J. H# J" ^+ j conn sys/password as sysdba;
0 S& ~3 Z# K, a, z9 z# I 3 解锁
& _/ r) l1 m* M* n9 v5 z% s0 S alter user scott account unlock;
# R) M9 f& E) e1 K. R1 C 4 弹出一个修改密码的对话框,修改密码: v: J( T8 T' O _" h! z/ j
conn scott/tiger$ v$ v2 C. [$ M4 A
SQL> conn sys/sys as sysdba;
, q/ X a) p; j" t3 i# o& R8 V) m Connected.5 W) r0 z; U( t! O# `+ a- K- L
SQL> alter user scott account unlock;. ^- y6 m( K! M) e0 W. ?' I
User altered.& `1 p" ]/ a) K/ |
SQL> commit;
) B3 K6 p/ j# Q% @+ g Commit complete. Q0 f# z8 N& j! v6 X
SQL> conn scott/tiger//请输入新密码,并确认后OK
# Y5 Z# X. J! d6 L Password changed
. h, ^+ H) Q2 \# D4 T Connected. |