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

oracle³£ÓÃÓï¾ä

1.²éѯ±í¿Õ¼äµÄʹÓÃÇé¿ö£¬ÒÔMΪµ¥Î»
select f.tablespace_name,a.total,u.used,f.free,round((u.used/a.total)*100) "% used",  
round((f.free/a.total)*100) "% Free"   
from  
(select tablespace_name, sum(bytes/(1024*1024)) total   
       from dba_data_files group by tablespace_name) a,  
(select tablespace_name, round(sum(bytes/(1024*1024))) used   
       from dba_extents group by tablespace_name) u,  
(select tablespace_name, round(sum(bytes/(1024*1024))) free   
       from dba_free_space group by tablespace_name) f  
WHERE a.tablespace_name = f.tablespace_name  
and a.tablespace_name = u.tablespace_name;
2.²éѯн¨Óû§
select username
  from dba_users
where username not in
      ('TEXT', 'RMAN_USER', 'TEST', 'SCOTT', 'TSMSYS', 'MDDATA', 'DIP',
        'DBSNMP', 'SYSMAN', 'MDSYS', 'ORDSYS', 'EXFSYS', 'DMSYS', 'WMSYS',
        'CTXSYS', 'ANONYMOUS', 'XDB', 'ORDPLUGINS', 'SI_INFORMTN_SCHEMA',
        'OLAPSYS', 'MGMT_VIEW', 'SYS', 'SYSTEM', 'OUTLN');
3¡¢²éѯÄÇЩÓû§£¬²Ù×ÝÁËÄÇЩ±íÔì³ÉÁËËø»ú
SELECT  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,all_objects o
WHERE l.sid = s.sid
AND l.id1 = o.object_id(+)
AND s.username is NOT Null
ÆäÖÐ TM  Ϊ±íËø¶¨  TX ΪÐÐËø¶¨
4¡¢¿´Ëø×èÈûµÄ·½·¨ÊÇ
SELECT (select username from v$session WHERE sid=a.sid) blocker,
      a.sid,
      'is blocking',
      (select username from v$session WHERE sid=b.s


Ïà¹ØÎĵµ£º

oracle ±í¿Õ¼ä²Ù×÷

oracle±í¿Õ¼ä²Ù×÷Ïê½â
  1
  2
  3×÷Õߣº   À´Ô´£º    ¸üÐÂÈÕÆÚ£º2006-01-04 
  5
  6 
  7½¨Á¢±í¿Õ¼ä
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

¡¾×ª¡¿ORACLEÖÐLikeÓëInstrÐÔÄÜ´ó±ÈÆ´

ORACLEÖÐLikeÓëInstrÐÔÄÜ´ó±ÈÆ´
×÷Õߣºµ¤³¼ | ¡¾×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂԭʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷¡¿
µØÖ·£ºhttp://rdc.taobao.com/blog/dba/html/246_like_instr_performance.html
t±íÖн«½üÓÐ1100ÍòÊý¾Ý£¬ºÜ¶àʱºò£¬ÎÒÃÇÒª½øÐÐ×Ö·û´®Æ¥Å䣬ÔÚSQLÓï¾äÖУ¬ÎÒÃÇͨ³£Ê¹ÓÃlikeÀ´´ïµ½ÎÒÃÇËÑË÷µÄÄ¿±ê¡£µ«¾­¹ýʵ¼Ê ......

LinuxÏÂOracle9i RMAN±¸·Ý¼°»Ö¸´²½Öè½éÉÜ

1¡¢×ª»»·þÎñÆ÷¹éµµÄ£Ê½£¬Èç¹ûÒÑÊǹ鵵ģʽ¿ÉÌø¹ý´Ë²½£º
  ¡¡%sqlplus /nolog (Æô¶¯sqlplus)
¡¡¡¡SQL> conn / as sysdba (ÒÔDBAÉí·ÝÁ¬½ÓÊý¾Ý¿â)
¡¡¡¡SQL> shutdown immediate; (¼´Ê±¹Ø±ÕÊý¾Ý¿â)
¡¡¡¡SQL> startup mount (Æô¶¯ÊµÀý²¢¼ÓÔØÊý¾Ý¿â£¬µ«²»´ò¿ª)
¡¡¡¡SQL> alter database archivelog; (¸ü¸ÄÊ ......

oracle sql ÇóÖÖ²Ëʱ¼ä

-- create by zh
-- n ÊÇ×÷ÎïµÄʱ¼ä,x ÊÇÏ£ÍûÔÚ¼¸µã³ÉÊì,·µ»Ø²¥ÖÖµÄʱ¼ä
with t as
(
select 64 n,9 x from dual union all
select 64 n,13 x from dual union all
select 64 n,17 x from dual union all
select 64 n,20 x from dual
)
select '³ÉÊìʱ¼ä:'     || lpad(to_char(n),4,' ' ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ