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
Ïà¹ØÎĵµ£º
extent--×îС¿Õ¼ä·ÖÅ䵥λ --tablespace management
block --×îСi/oµ¥Î» --segment management
create tablespace james
datafile '/export/home/oracle/oradata/james.dbf'
size 100M ¡¡¡¡¡¡¡¡¡¡¡¡--³õʼµÄÎļþ´óС¡¡
autoextend On¡¡¡¡¡¡¡¡ --×Ô¶¯Ôö³¤
next 10M¡ ......
Basic Steps for Manual Online Reorganization Commands and procedures used:
1.DBMS_REDEFINITION.CAN_REDEF_TABLE
2.CREATE TABLE …
3.DBMS_REDEFINITION.START_REDEF_TABLE
4.DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS and DBMS_REDEFINITION.CONS_ORIG_PAGRAMS
SELECT object_name,base_table_name, ......
[¾«»ª] ORACLEµÄ¼¸ÖÖÆô¶¯·½Ê½
http://www.chinaunix.net ×÷Õß:wuwenlong ·¢±íÓÚ£º2003-07-27 16:58:57
¡¾·¢±íÆÀÂÛ¡¿ ¡¾²é¿´ÔÎÄ¡¿ ¡¾OracleÌÖÂÛÇø¡¿¡¾¹Ø±Õ¡¿
1¡¢startup nomount
·Ç°²×°Æô¶¯£¬ÕâÖÖ·½Ê½Æô¶¯Ï¿ÉÖ´ÐУºÖؽ¨¿ØÖÆÎļþ¡¢Öؽ¨Êý¾Ý¿â
¶ÁÈ¡ ......