素数,它除了能表示为它自己和1的乘积以外,不能表示为任何其它两个整数的乘积删除重复行。
一个数,如果除了1和它本身还有别的约数,这样的数叫做合数
因为rowid不同,且唯一
delete from a a where a.rowid!=(select max(rowid) from a b where
a.bm=b.bm and a.mc=b.mc)
创建序列
create sequence seq_a minvalue 1000 maxvalue 99999999 start with 1000 increment by 1 nocache;
查询序列
select seq_a.nextval from dual;
为每张表生成对应的序列
--创建存储过程
create or replace procedure p_createseq(tablename in varchar2)
is
strsql varchar2(500);
begin
strsql:='create sequence seq_'||tablename||' minvalue 1000 maxvalue 99999999 start with 1000 increment by 1 nocache';
execute immediate strsql;
end p_createseq;
drop table 表名;
数据库误删除表之后恢复:( 绝对ok,我就做过这样的事情,汗 )不过要记得删除了哪些表名。flashback table 表名 to before drop;
2.查询得到当前数据库中锁,以及解锁:
查锁
SELECT /*+ rule */ s.username,
decode(l.type,'TM','TABLE LOCK',
'TX','ROW LOCK',
NULL) LOCK_LEVEL,
o.owner,o.object_name,o.object_type,
s.sid,s.serial#,s.terminal,s.machine,s.program,s.osuser
FROM v$session s,v$lock l,dba_objects o
WHERE l.sid = s.sid
AND l.id1 = o.object_id(+)
AND s.username is NOT NULL;
解锁 alter system kill session 'sid,serial';
如果解不了。直接倒os下kill进程kill -9 spid
ORA-28000:账户被锁定
因为密码输入错误多次用户自动被锁定.
解决办法:alter user user_name account unlock;
http://www.iteye.com/topic/648858
一个数,如果除了1和它本身还有别的约数,这样的数叫做合数
因为rowid不同,且唯一
delete from a a where a.rowid!=(select max(rowid) from a b where
a.bm=b.bm and a.mc=b.mc)
创建序列
create sequence seq_a minvalue 1000 maxvalue 99999999 start with 1000 increment by 1 nocache;
查询序列
select seq_a.nextval from dual;
为每张表生成对应的序列
--创建存储过程
create or replace procedure p_createseq(tablename in varchar2)
is
strsql varchar2(500);
begin
strsql:='create sequence seq_'||tablename||' minvalue 1000 maxvalue 99999999 start with 1000 increment by 1 nocache';
execute immediate strsql;
end p_createseq;
drop table 表名;
数据库误删除表之后恢复:( 绝对ok,我就做过这样的事情,汗 )不过要记得删除了哪些表名。flashback table 表名 to before drop;
2.查询得到当前数据库中锁,以及解锁:
查锁
SELECT /*+ rule */ s.username,
decode(l.type,'TM','TABLE LOCK',
'TX','ROW LOCK',
NULL) LOCK_LEVEL,
o.owner,o.object_name,o.object_type,
s.sid,s.serial#,s.terminal,s.machine,s.program,s.osuser
FROM v$session s,v$lock l,dba_objects o
WHERE l.sid = s.sid
AND l.id1 = o.object_id(+)
AND s.username is NOT NULL;
解锁 alter system kill session 'sid,serial';
如果解不了。直接倒os下kill进程kill -9 spid
ORA-28000:账户被锁定
因为密码输入错误多次用户自动被锁定.
解决办法:alter user user_name account unlock;
http://www.iteye.com/topic/648858