Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Oracle DBAÈÕ³£sqlÁÐ±í¼°³£ÓÃÊÓͼ

²»´íµÄ×ÊÁÏ,ת¹ýÀ´,·½±ãÈÕºó²é¿´Ê¹ÓÃ!!!
--¼à¿ØË÷ÒýÊÇ·ñʹÓÃ
alter index &index_name monitoring usage;
alter index &index_name nomonitoring usage;
select * from v$object_usage where index_name =
&index_name;
--ÇóÊý¾ÝÎļþµÄI/O·Ö²¼
select
df.name,phyrds,phywrts,phyblkrd,phyblkwrt,singleblkrds,readtim,writetim
from v$filestat fs,v$dbfile df
where fs.file#=df.file# order by df.name;
--Çóij¸öÒþ²Ø²ÎÊýµÄÖµ
col ksppinm format a54
col ksppstvl format a54
select ksppinm, ksppstvl
from x$ksppi pi, x$ksppcv cv
where cv.indx=pi.indx and pi.ksppinm like '\_%' escape
'\' and pi.ksppinm like '%meer%';
--ÇóϵͳÖнϴóµÄlatch
select
name,sum(gets),sum(misses),sum(sleeps),sum(wait_time)
from v$latch_children
group by name having sum(gets) > 50 order by 2;
--Çó¹éµµÈÕÖ¾µÄÇл»ÆµÂÊ(Éú²úϵͳ¿ÉÄÜʱ¼ä»áºÜ³¤)
select
start_recid,start_time,end_recid,end_time,minutes from (select test.*,
rownum as rn
from (select b.recid
start_recid,to_char(b.first_time,'yyyy-mm-dd hh24:mi:ss') start_time,
a.recid end_recid,to_char(a.first_time,'yyyy-mm-dd
hh24:mi:ss') end_time,round(((a.first_time-b.first_time)*24)*60,2)
minutes
from v$log_history a,v$log_history b where
a.recid=b.recid+1 and b.first_time > sysdate - 1
order by a.first_time desc) test) y where y.rn < 30
--Çó»Ø¹ö¶ÎÕýÔÚ´¦ÀíµÄÊÂÎñ
select a.name,b.xacts,c.sid,c.serial#,d.sql_text
from v$rollname a,v$rollstat b,v$session c,v$sqltext
d,v$transaction e
where a.usn=b.usn and b.usn=e.xidusn and
c.taddr=e.addr
and c.sql_address=d.address and
c.sql_hash_value=d.hash_value order by a.name,c.sid,d.piece;
--Çó³öÎÞЧµÄ¶ÔÏó
select 'alter procedure '||object_name||' compile;'
from dba_objects
where status='INVALID' and wner='&' and
object_type in ('PACKAGE','PACKAGE BODY');
/
select owner,object_name,object_type,status from
dba_objects where status='INVALID';
--Çóprocess/sessionµÄ״̬
select p.pid,p.spid,s.program,s.sid,s.serial#
from v$process p,v$session s where s.paddr=p


Ïà¹ØÎĵµ£º

RedHat Linux°²×°Oracle10g(ͼÎÄÏê½â ½Ì³Ì)

RedHat Linux°²×°Oracle10g(ͼÎÄÏê½â ½Ì³Ì)
http://winie.javaeye.com/blog/405120
¹Ø¼ü×Ö: redhat linux°²×°oracle10g(ͼÎÄÏê½â ½Ì³Ì)

Áí£¬±¾ÈËÓÐWordµç×ÓÎĵµ¸ñʽ£¬ÈçÐèÒª£¬ÇëÁªÏµ±¾ÈË£ºasima127@gmail.com
  
1     
°²×°RedHat Enterprise Linux 3 ......

SQL ServerÖ÷¼ü×Ô¶¯Ôö³¤µÄÉèÖÃ

ÔÚSQL ServerÖУ¬Èç¹û°Ñ±íµÄÖ÷¼üÉèΪidentityÀàÐÍ£¬Êý¾Ý¿â¾Í»á×Ô¶¯ÎªÖ÷¼ü¸³Öµ¡£ÀýÈ磺
create table customers (
id int identity(1,1) primary key not null,
name varchar(15)
);
insert into customers(name) values("name1"),("name2");
select id from customers;

²éѯ½á¹ûΪ£º
id
---
1
2
ÓÉ´Ë¿ ......

ORACLEÌåϵ½á¹¹


Ò»¡¢             ÄÚ´æ½á¹¹
¹²Ïí³Ø£º·ÖΪ¿â¸ßËÙ»º´æºÍ×Öµä¸ßËÙ»º³åÇø
¿â¸ßËÙ»º´æ£¬ÓÃÓÚ´æ´¢¾­¹ýÓï·¨·ÖÎö²¢ÇÒÕýÈ·µÄSQLÓï¾ä£¬²¢Ëæʱ׼±¸Ö´ÐС£
×Öµä¸ßËÙ»º³åÇø£¬´æ´¢µÇ½µ½ORACLEµÄÓû§Ãû£¬¼°ÕâЩÓû§ÓÐÄÄЩÊý¾Ý¿â¶ÔÏóÒÔ¼°ÕâЩÊý¾Ý¿â¶ÔÏóµÄλÖá£
Êý¾Ý»º ......

Oracle µÄÊÓͼÓëË÷Òý


ÓбíA(×Ö¶ÎA1,A2)ºÍ±íB(×Ö¶ÎB1,B2).
×Ö¶ÎA2,B2É϶¼ÓÐË÷Òý.
A,B ±íÁª²é
sql1 Õâ¸ösql ·Ç³£¿ì 2ÃëµÄÑù×Ó
select * from A,B where A.A1=B.B1(+) and A2='Öµ1'
sql2 Õâ¸ösql Âýµ½ÈÃÈËÎÞ·¨ÈÌÊÜ
select * from A,B where A.A1=B.B1(+) and B2='Öµ1'
ÍâÁªÒÔºó ±íBÉϵÄË÷Òý²»Æð×÷ÓÃÁË.
Èç¹û»»³ÉÄÚÁª ËٶȺܿì.
sel ......

Oracle SQL PLUS µÇ¼ Æô¶¯ ¹Ø±Õ


Oracle SQL PLUS »ù±¾²Ù×÷1
怬
c:\>sqlplus "sys/test1234 as sysdba"  ÒÔsysdbaÉí·ÝµÇ¼
 
c:\>sqlplus/nolog   ÒÔnologÉí·ÝµÇ¼
sql> connect sys/test1234 as sysdba
Connected.
 
 
Æô¶¯ 
SQL>  startup    &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ