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

Oracle ³£ÓÃSQL


1¡¢²é¿´±í¿Õ¼äµÄÃû³Æ¼°´óС
select t.tablespace_name, round(sum(bytes/(1024*1024)),0) ts_size
from dba_tablespaces t, dba_data_files d
where t.tablespace_name = d.tablespace_name
group by t.tablespace_name;
2¡¢²é¿´±í¿Õ¼äÎïÀíÎļþµÄÃû³Æ¼°´óС
select tablespace_name, file_id, file_name,
round(bytes/(1024*1024),0) total_space
from dba_data_files
order by tablespace_name;
3¡¢²é¿´»Ø¹ö¶ÎÃû³Æ¼°´óС
select segment_name, tablespace_name, r.status,
(initial_extent/1024) InitialExtent,(next_extent/1024) NextExtent,
max_extents, v.curext CurExtent
from dba_rollback_segs r, v$rollstat v
Where r.segment_id = v.usn(+)
order by segment_name ;
4¡¢²é¿´¿ØÖÆÎļþ
select name from v$controlfile;
5¡¢²é¿´ÈÕÖ¾Îļþ
select member from v$logfile;
6¡¢²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_name;
SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
(B.BYTES*100)/A.BYTES "% USED",(C.BYTES*100)/A.BYTES "% FREE"
from SYS.SM$TS_AVAIL A,SYS.SM$TS_USED B,SYS.SM$TS_FREE C
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND A.TABLESPACE_NAME=C.TABLESPACE_NAME;
7¡¢²é¿´Êý¾Ý¿â¿â¶ÔÏó
select owner, object_type, status, count(*) count# from all_objects group by owner, object_type, status;
8¡¢²é¿´Êý¾Ý¿âµÄ°æ±¾
Select version from Product_component_version
Where SUBSTR(PRODUCT,1,6)='Oracle';
9¡¢²é¿´Êý¾Ý¿âµÄ´´½¨ÈÕÆں͹鵵·½Ê½
Select Created, Log_Mode, Log_Mode from V$Database;
10¡¢²¶×½ÔËÐкܾõÄSQL
column username format a12
column opname format a16
column progress format a8
select username,sid,opname,
round(sofar*100 / totalwork,0) || '%' as progress,
time_remaining,sql_text
from v$session_longops , v$sql
where time_remaining <> 0
and sql_address = address
and sql_hash_value = hash_value
/
11¡£²é¿´Êý¾Ý±íµÄ²ÎÊýÐÅÏ¢
SELECT partition_name, high_value, high_value_length, tablespace_name,
pct_free, pct_used, ini_trans, max_trans, initial_extent,
next_extent, min_extent, max_


Ïà¹ØÎĵµ£º

oracle¸´Ï°£¨Ò»£© Ö®OracleÌåϵ½á¹¹

      ѧϰOracle DBAÒ²°ë¸ö¶àѧÆÚÁË£¬½ñÌìÃÍÈ»²Å·¢ÏÖ£¬Ô­À´ÎÒµÄÊ黹ÊǺÜеģ¬ÉϿβÙ×÷ʱºòÒ²Ö»ÊÇÖªµÀ´ó¸ÅÔõô×ö£¬µ«ÊÇÒªÕæµÄÈ«²¿×Ô¼º×ö£¬¶ø²»È¥·­Ê黹ÊÇÓÐÒ»¶¨µÄÄѶȵģ¬ËùÒÔÄØ£¬½ñÌ쿪ʼ½«DBA´ÓÍ·¸´Ï°Ò»±é£¬Í¬Ê±ÔÙ²Ù×÷Ò»±é¡£
      µÚÒ»Õ£¬Ñ§µÄÊÇOracleµÄÌåϵ½á¹¹£ ......

½â¶ÁORACLEÊý¾Ý¿âµÄͳһÃüÃûÓë±àÂë¹æ·¶

1¡¢±àдĿµÄ
ʹÓÃͳһµÄÃüÃûºÍ±àÂë¹æ·¶£¬Ê¹Êý¾Ý¿âÃüÃû¼°±àÂë·ç¸ñ±ê×¼»¯£¬ÒÔ±ãÓÚÔĶÁ¡¢Àí½âºÍ¼Ì³Ð¡£
2¡¢ÊÊÓ÷¶Î§
±¾¹æ·¶ÊÊÓÃÓÚ¹«Ë¾·¶Î§ÄÚËùÓÐÒÔORACLE×÷Ϊºǫ́Êý¾Ý¿âµÄÓ¦ÓÃϵͳºÍÏîÄ¿¿ª·¢¹¤×÷¡£
3¡¢¶ÔÏóÃüÃû¹æ·¶
3.1 Êý¾Ý¿âºÍSID
Êý¾Ý¿âÃû¶¨ÒåΪϵͳÃû+Ä£¿éÃû
¡ï È«¾ÖÊý¾Ý¿âÃûºÍÀý³ÌSID ÃûÒªÇóÒ»ÖÂ
¡ï ÒòSID ......

oracle·Ö×麯ÊýÖ®ROLLUP

 
1.³õʼ»¯ÊµÑ黵¾³
1£©´´½¨²âÊÔ±ígroup_test
sec@ora10g> create table group_test (group_id int, job varchar2(10), name varchar2(10), salary int);
¡¡
Table created.
¡¡
2£©³õʼ»¯Êý¾Ý
insert into group_test values (10,'Coding',    'Bruce',1000);
insert into group_test val ......

ORACLE¶Ô×ÖĸºÍÊý×Ö»ìºÏµÄÊý¾ÝÅÅÐò

Ö÷ÒªÊÇͨ¹ýreplaceºÍtranslateÀ´ÊµÏÖ
SQL> create view v_tt
2 as
3 select ename||' '||deptno as data
4 from emp;
View created.
SQL> select * from v_tt;
DATA
---------------------------------------------------
SMITH 20
ALLEN 30
WARD 30
JONES 20
MARTIN 30
BLAKE 30
CLARK 10
......

oracle¸´Ï°£¨Èý£© Ö®OracleÊý¾Ý×ÖµäºÍ¿ØÖÆÎļþ

      ½ñÌ츴ϰOracleµÄÊý¾Ý×ÖµäºÍ¿ØÖÆÎļþ¡£
Ò»¡¢Êý¾Ý×Öµä
      Êý¾Ý×ÖµäÊÇÓÉOracle·þÎñÆ÷´´½¨ºÍά»¤µÄÒ»×éÖ»¶ÁµÄϵͳ±í£¬Êý¾Ý×Öµä·ÖΪÁ½´óÀࣺһÀàΪ»ù±í£¬Ò»ÀàΪÊý¾Ý×ÖµäÊÓͼ¡£ÄÇôÊý¾Ý×ÖµäÖÐÓÖ´æÓÐÄÄЩÐÅÏ¢ÄØ£¿
1¡¢Êý¾Ý¿âµÄÂß¼­½á¹¹ºÍÎïÀí½á¹¹
2¡¢ËùÓÐÊý¾Ý¿â¶Ô ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ