服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > 数据库技术 > Oracle技术 > Oracle开发 > 查看文档

oracle用户密码含有特殊字符应当如何处理 (1)

【赛迪网-it技术报道】在设置oracle密码时,我们经常会将密码设置的特别复杂(一般由字母、数字和特殊符号组成),值得注意的是,在有特殊符号时,修改密码或着导入导出数据时会遇到很多不必要的麻烦,本文中将会对此情况进行详细的解释和说明:

注:本文中,将以特殊符号“/”为例。

linux环境下,使用oracle数据库10g

修改密码

[oracle@olivenan oracle]$ sqlplus '/as sysdba'

sql*plus: release 10.2.0.1.0 - production on wed may 17 14:33:32 2006

copyright (c) 1982, 2005, oracle. all rights reserved.

connected to:

oracle database 10g enterprise edition release 10.2.0.1.0 - production

with the partitioning, olap and data mining options

sql> alter user test identified by aa/aa;

alter user test identified by aa/aa

*

error at line 1:

ora-00922: missing or invalid option

在此使用""

sql> alter user test identified by "aa/aa";

user altered.

sql>

[oracle@olivenan oracle]$ exp test/aa/aa file=test.dmp buffer=65536

export: release 10.2.0.1.0 - production on wed may 17 14:32:10 2006

copyright (c) 1982, 2005, oracle. all rights reserved.

exp-00004: invalid username or password

username:

此处应该进行转义使用 " "处理密码,使用 ' '处理用户名和密码

[oracle@olivenan oracle]$ exp 'test/"aa/aa"' file=test.dmp buffer=65536

export: release 10.2.0.1.0 - production on wed may 17 14:32:52 2006

copyright (c) 1982, 2005, oracle. all rights reserved.

connected to: oracle database 10g enterprise edition release 10.2.0.1.0 - production

with the partitioning, olap and data mining options

export done in we8iso8859p1 character set and al16utf16 nchar character set

about to export specified users ...

. exporting pre-schema procedural objects and actions

...............

导出成功。

windows xp下,数据库为oracle9i

c:\documents and settings\w>sqlplus /nolog

sql*plus: release 9.2.0.1.0 - production on wed may 17 14:56:34 2006

copyright (c) 1982, 2002, oracle corporation. all rights reserved.

sql> connect sys/olivenan as sysdba

connected.

sql> alter user test identified by aa/aa;

alter user test identified by aa/aa

*

error at line 1:

ora-00922: missing or invalid option

此处使用""

sql> alter user test identified by "aa/aa";

user altered.

sql>

microsoft windows xp [版本 5.1.2600]

(c) 版权所有 1985-2001 microsoft corp.

c:\documents and settings\w>exp test/aa/aa file=aa.dmp buffer=65536

export: release 9.2.0.1.0 - production on wed may 17 14:58:50 2006

copyright (c) 1982, 2002, oracle corporation. all rights reserved.

exp-00004: invalid username or password

username:

password:

exp-00056: oracle error 1017 encountered

ora-01017: invalid username/password; logon denied

username: ^z^z

exp-00030: unexpected end-of-file encountered while reading input

exp-00000: export terminated unsuccessfully

在此处将使用""" """来处理用户密码

c:\documents and settings\w>exp test/"""aa/aa""" file=aa.dmp buffer=65536

export: release 9.2.0.1.0 - production on wed may 17 14:59:10 2006

copyright (c) 1982, 2002, oracle corporation. all rights reserved.

connected to: oracle9i enterprise edition release 9.2.0.1.0 - production

with the partitioning, olap and oracle data mining options

jserver release 9.2.0.1.0 - production

export done in we8iso8859p1 character set and al16utf16 nchar character set

server uses zhs16gbk character set (possible charset conversion)

about to export specified users ...

. exporting pre-schema procedural objects and actions

. exporting foreign function library names for user test

. exporting public type synonyms

. exporting private type synonyms

. exporting object type definitions for user test

about to export test's objects ...

. exporting database links

. exporting sequence numbers

........

至此,导出成功。

扫描关注微信公众号