易截截图软件、单文件、免安装、纯绿色、仅160KB

详解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用户默


相关文档:

Oracle中多表查询再按时间倒序

我在工作中在Oracle中多表查询再按时间倒序时,用order by 表名.datatime desc 总是实现不了。
不过最后问杨鹃最后和我说可以把我们查询的总个sql语句做为一个表来排序:
select rownum,aa.* from (....  order by 表名.datatime desc ) aa ......

oracle中type的使用

create or replace type mytype IS TABLE OF varchar2(20);
declare type1 mytype :=mytype('1','2','3','4');
i number:=1;
var_str varchar(20):='liaomin';
begin
type1.EXTEND;
type1(type1.COUNT):=var_str;
loop
  dbms_output.put_line(type1(i));
  i:=i+1;
  exit when i=type1.count+1; ......

【转】 Oracle group by及其若干相关函数的一些说明

Oracle group by及其若干相关函数的一些说明
http://blog.csdn.net/roland_wg/archive/2009/07/03/4319323.aspx
Oracle的group by除了基本用法以外,还有3种扩展用法,分别是rollup、cube、grouping sets。
假设有一个表test,有A、B、C、D、E5列。
1) 如果使用group by rollup(A,B,C),首先会对(A、B、C)进行GROUP BY ......

oracle中的视图


create table a(
id number primary key,
name varchar2(20)
);
create table b(
id number,
name varchar2(20),
aid number references a(id)
);
insert into a values(1,'1');
insert into b values(1,'aaa',1);
如果 create view vi_new as select * from a
在视图vi_new 上做任何 dml操作都会修改 对应的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号