oracle 解锁用户以及重新设置用户密码
在安装完Oracle 10g之后,想打开sql*plus来学习,然后按照书上的步骤用scott用户来连接数据库,可输了好几次都提示一个错误。
error: the account is locked
然后上网查了一下之后发现这个用户被锁定了,至于它为什么被锁定,可能是下面几个原因。
1.尝试多次登录未成功.(可能密码不正确)
2.此用户被管理员手工锁定.
3.用户密码到期.未按时修改密码.等等...
这个用户肯定是登陆不了了,然后我用system这个用户登录,可是登了半天都没有进去,又去网上查,网上面大都是关于 oracle 9i的用户和密码,后来我记得在安装的时候就提示输入了,用那个试了一下就连接上了,所以在oracle 10g的system这个用户的密码不是默认的,而是安装的时候自己设定的。
拿system登录进去之后,执行下面的命令:
SQL> alter user scott account unlock;
用户已更改。
这样就完成解锁的操作。接下来,你还可以重新给scott这个用户设定密码
修改scott的登录密码
SQL> alter user scott identified by pan;
用户已更改。
ok了,你再拿scott 和 pan来登录就可以了!
SQL> conn scott/pan
已连接。
新装完Oracle 10g后,用system/password可以正常登录,而使用scott/tiger用户却不能登录:
conn scott/tiger error:Oracle 10g the account is locked Oracle 10g the password has expired
原因:默认Oracle 10g的scott不能登陆。被禁用了。
解决方法:
首先确认已经安装oracle 数据库和客户端
.在客户端DOS下执行如下语句:
注意提示符号
c:\sqlplus /nolog sqlp\ conn sys/system@oracle10 as sysdba // sys为当前的oracle 用户 system 为该用户密码 oracle10 为SID # alter user soctt account lock; // 把 scott用户锁定 # alter user scott account unlock; //把scott用户解锁 # alter user scott identified by scott //修改scott用户密码为 scott,scott用户默认密码为 tiger
1 Dos下输入C:\sqlplus /nolog
2 以DBA的身份登录
conn sys/password as sysdba;
3 解锁
alter user scott account unlock;
4 弹出一个修改密码的对话框,修改密码
conn scott/tiger SQL> conn sys/sys as sysdba; Connected. SQL> alter user scott account unlock; User altered. SQL> commit; Commit complete
相关文档:
什么是合并多行字符串(连接字符串)呢,例如:
SQL> desc test;
Name Type Nullable Default Comments
------- ------------ -------- ------- --------
COUNTRY VARCHAR2(20) Y &nb ......
写存储过程时,用到拆分字符串,第一个传入参数为带分割符的字符串,第二个为分隔符的个数,下面是单提出来的分割字符串方法,
create or replace procedure split( ......
1. 取A表的数据,更新B表字段
update m_build b
set b.district_id=(
select d.district_id
from
bjhouse.d_district d
where
b.build_name_jq=d.district_name)
where exists
(select 1
from ......
// 执行跳过,跳过的结果在
execute dbms_logstdby.skip(stmt => 'DML',schema_name => '%', object_name => '%');
stmt的取值可以是:
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10802/d_lsbydb.htm#997290
// 跳过的内容记载在下面
select * from dba_logstdby_skip
......
转:http://hi.baidu.com/mcj0127/blog/item/111a900777db06c87b89473c.html
SELECT FOR UPDATE 相关的知识
一个邮件发送的应用会每过一定的时间片去数据库中取未发的邮件然后发送邮件,成功后将数据库中邮件标识未发改为已发。
这个应用部署在websphere上,websphere采用是垂直克隆,有4个server,当4个server都开启的 ......