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µÄ¼Æ»®¡£
ѧϰORACLEµÄÄ¿µÄ£¬Ò»·½ÃæÊÇÌá¸ß×Ô¼ºµÄ¼¼ÊõÄÜÁ¦£¬¹¤×÷ÉϾ³£¿ÉÒÔÓõõ½£¨ËäÈ»²»ÊÇרÃÅDBAµÄ¹¤×÷£¬µ«ÊǾ³£ÐèҪʹÓÃÊý¾Ý¿â×÷Ϊ±¨±íͳ¼Æ·ÖÎöµÄ¹¤¾ß£©£»ÁíÒ»·½Ã棬ҲÊÇÎªÌø²Û×öºÃ¼¼ÊõÄÜÁ¦µÄ´¢±¸£¬ÏÖÔڵŤ×÷ÒѾ¿ìÈ ......
oracle´Ó9i¿ªÊ¼Ö§³ÖÒ»ÖÖеÄÊý¾ÝÀàÐÍ---- xmltype£¬ÓÃÓÚ´æ´¢ºÍ¹ÜÀíxmlÊý¾Ý£¬²¢ÌṩÁ˺ܶàµÄfunctions£¬ÓÃÀ´Ö±½Ó¶ÁÈ¡xmlÎĵµºÍ¹ÜÀí½Úµã¡£ÏÂÃæ½«½éÉÜxmltypeµÄһЩ»ù±¾Ê¹Óá£
1.½¨Á¢º¬ÓÐxmltypeÊý¾ÝÀàÐ͵ıí
create table abc (id number,xmldoc sys.xmltype);
ÉùÃ÷xmltypeÐÍ×Ö¶ÎÓÃ:sys.xmltype
2.Ïò´øÓÐxmltypeÀàÐ͵ıí ......
£¨Ò»£©Ê²Ã´½ÐÓû§£¨user£©£º
A user is a name defined in the database that can connect to and access objects.
Óû§ÊÇÓÃÁ¬½ÓÊý¾Ý¿âºÍ·ÃÎÊÊý¾Ý¿â¶ÔÏóµÄ¡££¨Óû§ÊÇÓÃÀ´Á¬½ÓÊý¾Ý¿â·ÃÎÊÊý¾Ý¿â£©¡£
£¨¶þ£©Ê²Ã´½Ðģʽ(schema)£º
A schema is a collection of database objects (used by a user.).
Schema objects are th ......
ADDM (Automatic Database Diagnostic Monitor) implements the Oracle performance method and analyzes statistics to provide automatic diagnosis of major performance problems. Because ADDM can significantly shorten the time required to improve the performance of a system, it is one of the most used perf ......