Oracle DBAÊÖ¼ÇÖ®¡°V$SQLÊÓͼÏÔʾ½á¹ûÒì³£µÄÕï¶Ï¡±
±¾ÎĽÚÑ¡×Ô¡¶Oracle DBAÊּǗ—Êý¾Ý¿âÕï¶Ï°¸ÀýÓëÐÔÄÜÓÅ»¯Êµ¼ù¡·µÚ2Õ“YangtingkunµÄDBA¹¤×÷Êּǔ £¨×÷ÕߣºÑîÍ¢çû£©
V$SQLÊÓͼÏÔʾ½á¹ûÒì³£µÄÕï¶Ï
ÓÐÒ»´ÎÅöµ½Ò»¸öºÜÆæ¹ÖµÄÎÊÌ⣬ÔÚ¼ì²é»á»°ËùÖ´ÐеÄSQLʱ£¬·¢ÏÖV$SQLÊÓͼÖÐSQL_TEXTÁÐÖеÄÊý¾ÝÊDz»Õý³£µÄ¡£
ÓÉÓÚV$SQLÊǶ¯Ì¬ÐÔÄÜÊÓͼ£¬ÀïÃæ±£´æµÄÊǵ±Ç°¹²Ïí³ØÖмÓÔصÄSQLÓï¾ä£¬ËùÒÔÈç¹ûÕâ¸öSQL²»ÊÇÖ´ÐкÜƵ·±µÄ»°£¬ÄÇôËüºÜ¿ÉÄܻᱻÌæ»»³ö¹²Ïí³Ø¡£»òÕßÊý¾Ý¿âÒâÍâÖØÆô£¬Ò²»áµ¼ÖÂÕâ¸öSQL³¹µ×¶ªÊ§¡£ÄÇôÊ×ÒªÈÎÎñ¾ÍÊDZ£ÁôÏÖ³¡£¬Ò»µ©´íÎ󲻿ÉÔÙÏÖ£¬ÄÇôËùÓеÄÎÊÌâ¾Í¶¼ÎÞ´Ó²éÆðÁË¡£
½«ÏÔʾÒì³£µÄV$SQL¼Ç¼±¸·Ýµ½ÁËBAK_V$SQL±íÖУ¬Ê×ÏÈ¿´Ò»ÏÂÒì³£µÄSQLÓï¾ä£º
SQL> SELECT SQL_TEXT from BAK_V$SQL;
SQL_TEXT
----------------------------------------------------------------------------------------
info.CONTRACT_ITEM_ID,info.BUYER_ORG_ID a
elδ³Ðŵ'DISCOUNT_STEP is null or INC.NUM_STEP is null then
to_char(INC.DISCOUNT_STEP * 100,'0.0') || '%'Û¿ÛÂ?' ||
'δ CASH.CASH is null and CASH.CASH_THIRTY is null then
'ÏÖ¿î:' || to_char(CASH.CASH * 100,'0.0'
'30ÈÕ½á¿î:'SH_THIRTY is not null then
case whend end as CASH_DISCOUNT,0,'0.0') || '%;'
en info.modify_date > inc.modify_date and info.modify_date > cash.modify_date then info.mo
ÏÔÈ»Õâ¸öSQLÓï¾äÊDz»Õý³£µÄ£¬Óï¾äÖÐÉõÖÁÁ¬select¡¢insert¡¢update¡¢deleteÃüÁ²»°üÀ¨¡£µ«ÊÇÕâ¸öSQLÓÖ²»ÍêÈ«ÊÇÂÒÂ룬´ÓÏÔʾµÄ²¿·Ö¿´£¬´ó²¿·ÖÊÇÓÐÒ»¶¨Âß¼ÔÚÀïÃæµÄ¡£
¹Û²ìÕâ¸öSQL£¬µÚÒ»¸Ð¾õÏñÊÇV$SQLÊÓͼÖÐÏÔʾÁ˲¿·ÖSQL£¬¶øûÓдÓSQLÓï¾äµÄ¿ªÍ·²¿·Ö¿ªÊ¼ÏÔʾ¡£¶øÇÒ¼´Ê¹ÊDz¿·ÖSQL£¬Ò²²»ÊÇÁ¬ÐøÏÔʾµÄ£¬ÒòΪÁ¬ÐøµÄÁ½Ðв¢²»Á¬¹á¡£
Ê×ÏÈÏëµ½µÄ¾ÍÊÇOracleµÄBug£¬ÒòΪ³ýÁËÕâÒ»µã£¬ÔÝʱûÓÐÏëµ½ÆäËûµÄÔÒòÀ´½âÊÍÕâ¸öÏÖÏó¡£ÄÇôÈç¹ûȷʵÊÇÓÉÓÚBug£¬µ¼ÖÂV$SQLÏÔʾ²»ÍêÕû£¬ÄÇôÍêÕûµÄSQLÓÖÊÇÊ
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
extent--×îС¿Õ¼ä·ÖÅ䵥λ --tablespace management
block --×îСi/oµ¥Î» --segment management
create tablespace james
datafile '/export/home/oracle/oradata/james.dbf'
size 100M ¡¡¡¡¡¡¡¡¡¡¡¡--³õʼµÄÎļþ´óС¡¡
autoextend On¡¡¡¡¡¡¡¡ --×Ô¶¯Ôö³¤
next 10M¡ ......
401. V$PQ_TQSTAT
°üº¬²¢ÐÐÖ´ÐвÙ×÷ÉϵÄͳ¼ÆÁ¿.°ïÖúÔÚÒ»¸ö²éѯÖвⶨ²»Æ½ºâµÄÎÊÌâ.
402. V$PROCESS
°üº¬¹ØÓÚµ±Ç°»î¶¯½ø³ÌµÄÐÅÏ¢.
403. V$PROXY_ARCHIVEDLOG
°üº¬¹éµµÈÕÖ¾±¸·ÝÎļþµÄÃèÊöÐÅÏ¢,ÕâЩ±¸·ÝÎļþ´øÓÐÒ»¸ö³ÆΪPROXY¸±±¾µÄÐÂÌØÕ÷.
404. V$PROXY_DATAFILE
°üº¬Êý¾ÝÎļþºÍ¿ØÖÆÎļþ±¸·ÝµÄÃèÊöÐÅÏ¢,ÕâЩ±¸·ÝÎļþ´ ......
Ò»¡¢»ù´¡
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE database-name
2¡¢ËµÃ÷£ºÉ¾³ýÊý¾Ý¿â
drop database dbname
3¡¢ËµÃ÷£º±¸·Ýsql server
--- ´´½¨ ±¸·ÝÊý¾ÝµÄ device
USE master
EXEC sp_addumpdevice 'disk', 'testBack', 'c:mssql7backupMyNwind_1.dat'
--- ¿ªÊ¼ ±¸·Ý
BACKUP DATABASE pubs TO testBack ......
create or replace procedure c
(
v_deptno in emp.deptno%type,
v_max out emp.sal%type
)
as
begin
select max(sal+nvl(comm,0)) into v_max from emp where deptno=v_deptno;
end;
create or replace procedure cc
(
v_empno in emp.empno%type,
v_sal out emp.sal%type,
v_comm out emp.comm% ......