Oracle Procedure Êý×é²ÎÊýµÄÓ¦ÓÃ
Òò¹¤×÷ÐèÒª£¬Êý¾Ý¿âÓÉPostgreSQL תΪOracle 10g¡£ÓÉÓÚ֮ǰµÄÂß¼¼¸ºõ¶¼·Ö²¼ÓÚ´æ´¢¹ý³Ì£¬ËùÒÔ¶à´úÂëµÄÐÞ¸ÄÏà¶ÔÀ´Ëµ½ÏС¡£
Òò¶ÔOracle Êý×é²ÎÊýµÄת»»»¨ÁËЩʱ¼ä£¬ËùÒԼǼÏÂÀ´£¬·ÖÏíһϡ£ÑÔ¹éÕý´«£º
Èç¹ûÈë²ÎΪ×Ö·û´®Êý×é¡¢ÕûÐÎÊý×é»òÕßGUIDÊý×éµÈµÈ£¬²¢ÇÒ°ÑËü×÷Ϊһ¸ö²éѯÌõ¼þ£¬ÓÐÁ½ÖÖ·½·¨¿ÉÒÔ×öµ½¡£ÎÒ²ÉÓÃÁËpackage£¬ºóÃ潫½éÉÜÔÒò¡£
·½·¨Ò»£º
ÔÚ´æ´¢¹ý³ÌÖÐʹÓÃfor£¬ÏàÐÅ´ó¼Ò¶Ô´ËÓ¦¸Ã²»Ä°Éú¡£ÉÏÀý×Ó:
create or replace package sbp_disablesyncpreset
as
type string_array is table of raw(16) index by binary_integer;
procedure disablesyncpreset(sync_computers in string_array, active_presets in string_array);
end sbp_disablesyncpreset;
Commit;
create or replace package body sbp_disablesyncpreset
as
procedure disablesyncpreset(sync_computers in string_array, active_presets in string_array)
as
begin
FOR i IN sync_computers.FIRST .. sync_computers.LAST
LOOP
UPDATE sparesync_last_sync SET preset_active='0'
WHERE
((destination_guid=sync_computers(i)) OR (src_guid=sync_computers(i))) AND (NOT preset_id=active_presets(i));
END LOOP;
end disablesyncpreset;
end sbp_disablesyncpreset;
Commit;
·½·¨¶þ£ºÊ¹ÓÃ×Ô¼º¶¨ÒåµÄÈ«¾ÖÊý×éÀàÐÍ£¬ÉÏÀý×Ó£º
create or replace package sbp_disablesyncpreset
as
type string_array is table of raw(16) index by binary_integer; //¶¨ÒåÊý×éÀàÐÍ£¬ÓëÈë²ÎÒ»ÖÂ
procedure disablesyncpreset(sync_computers in string_array);//´æÖü¹ý³ÌÃû³Æ
end sbp_disablesyncpreset;
Commit;
//Ö÷Ì岿·Ö
create or replace package body sbp_disablesyncpreset
as
procedure disablesyncpreset(sync_computers in string_array)
as
computerguids spu_nested_type20 := spu_nested_type20(); //×Ô¼º¶¨ÒåµÄÈ«¾ÖÊý×éÀàÐÍ
begin
FOR i IN computerid.first..computerid.last loop
computerguids.extend;
computerguids(i) := computerid(i);
end loop;
UPDATE sparesync_last_sync SET preset_active='0'
WHERE
destination_guid in (select column_value from table(Cast(computerguids as spu_nested_type20)))
OR src_gui
Ïà¹ØÎĵµ£º
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¡ ......
(1)µÇ½µ½mysql
C:\Documents and Settings\Administrator>mysql -h localhost -u root -p
Enter password: *****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 69
Server version: 5.0.51a-community-nt MySQL Community Edition (GPL)
Type 'help;' or '\h' fo ......
oracle³£ÓþµäSQL²éѯ
³£ÓÃ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¡¢²é¿´±í¿Õ¼äÎïÀíÎļþµÄÃû³Æ ......
17:00:59 SQL> desc dbms_random;
Element Type
---------- ---------
SEED PROCEDURE
VALUE FUNCTION
NORMAL FUNCTION
STRING FUNCT ......