Oracleɾ³ý´ó±í²¢»ØÊÕ¿Õ¼äµÄ¹ý³Ì
½üÈÕÔÚ²éѯijÏîÈÕÖ¾µÄʱºò£¬·¢ÏÖ²éѯ·Ç³£»ºÂý£¬¸ù¾ÝÒÔÍùµÄ¾ÑéÕâÊÇÓÉÓÚij¸öÈÕÖ¾±í¹ý´óÒýÆðµÄ£¬ÎªÁ˼ӿì²éѯ£¬¾ö¶¨½«´ó²¿·ÖµÄÀúÊ·Êý¾ÝǨÒƵ½ÁíÍâÒ»¸ö±íÖУ¬±¾ÎÄÖ÷Òª¼Ç¼ɾ³ýÕâ¸ö´ó±íµÄ¹ý³Ì£¬¾Í½â¾öÎÊÌâ¶øÑÔ»¹Óкܶ෽·¨£¬µ«ÊDZ¾ÎIJàÖصãÔÚÓÚÈçºÎ´¦Àí´óÊý¾ÝÁ¿É¾³ýµÄ²Ù×÷£¬¼°ÆäÉƺó¹¤×÷¡£
Ê×ÏÈ¿´¿´ÎÒÃÇÒª×öÊý¾ÝǨÒƵıíËùÕ¼µÄ¿Õ¼ä£º
SQL> select segment_name , bytes/1048576 MB
2 from user_segments
3 order by bytes
4 /
SEGMENT_NAME MB
-------------------------------------------------- ----------
TAB_NODE_PARAM .375
SYS_LOB0000053047C00004$$ .4375
PK_TAB_FLOW_HIS 1
PK_TAB_NODE_HIS 2
TAB_TASK_HIS 2
TAB_FLOW_HIS 4
TAB_NODE_HIS 17
PK_TAB_APPEXCHANGE_LOG 152
TAB_APPEXCHANGE_LOG 768¿´¿´ÀúÊ·Êý¾Ý´ó¸ÅËùÕ¼µÄ¿Õ¼ä±ÈÀý£º
SQL> select count(*) from tab_appexchange_log
2 where receive_time >= to_date('2009-01-01','yyyy-mm-dd')
3 union all
4 select count(*) from tab_appexchange_log
5 where receive_time < to_date('2009-01-01','yyyy-mm-dd')
SQL> /
COUNT(*)
----------
1584298
4037710´Ó½á¹ûÀ´¿´£¬µÄÈ·´æÔںܶàÀúÊ·Êý¾Ý£¬ÎÒÃǽ« 2009 Äê֮ǰµÄÊý¾ÝǨÒƵ½±ðµÄ±íÖС£
SQL> create table tab_appexchange_log_20090101
2 as
3 select * from tab_appexchange_log
4 where receive_time < to_date('2009-01-01','yyyy-mm-dd')
SQL> /
Table created.
SQL> select count(*) from tab_appexchange_log_20090101
2 /
COUNT(*)
----------
4037710Êý¾ÝÒѾǨÒÆÒ»·Ýµ½ÐµıíÀïÃæÁË£¬¿ÉÒÔɾ³ýÔ±íÖеľÉÊý¾ÝÁË¡£
SQL> delete tab_appexchange_log where receive_time < to_date('2009-01-01','yyyy-mm-dd')
2 /
delete tab_appexchange_log where receive_time < to_date('2009-01-01','yyyy-mm-dd')
*
ERROR at line 1:
ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS2'ÕâÀï³öÏÖÁËÒ»¸ö ORA-30036µÄ´íÎ󣬴ó¸ÅÒâ˼ÊÇundo±í¿Õ¼ä²»×㣬¿´À´ÊÇҪɾ³ýµÄÊý¾ÝÌ«¶àÁË£¬ÓÚÊÇ¿¼ÂÇ»¯ÕûΪÁ㣬ɾһµã£¬commitһϡ£
SQL> delete tab_appexchange_log where receive_time < to_date('2007-01-01','yyyy-mm-d
Ïà¹ØÎĵµ£º
MYSQL/MSSQL/ORACLEÊý¾Ý¿â½Å±¾´úÂë ÊÕ²Ø
/******************************************************************************/
/*
Ö÷Á÷Êý¾Ý¿âMYSQL/MSSQL/ORACLE²âÊÔÊý¾Ý¿â½Å±¾´úÂë
½Å±¾ÈÎÎñ:½¨Á¢4¸ö±í,Ìí¼ÓÖ÷¼ü,Íâ¼ü£¬²åÈëÊý¾Ý,½¨Á¢ÊÓͼ
ÔËÐл·¾³1:microsoft sqlserver 2000 ²éѯ·ÖÎöÆ÷
ÔËÐл·¾³2:mysql5.0 p ......
1¡¢
Á¬½ÓÊý¾Ý¿â
connect uuu/ooo
connect
sys/ok as sysdba
2¡¢
´´½¨±í¿Õ¼ä
create tablespace stu(±í¿Õ¼äÃû
) datafile
‘
e:\stu.dbf
’
size 100m autoextend on next 5m maxsize 500m;
3¡¢& ......
ÔÚoracleÖУ¬ÎÒÃÇʹÓÃin·½·¨²éѯ¼Ç¼µÄʱºò£¬Èç¹ûinºóÃæµÄ²ÎÊý¸öÊý³¬¹ý1000¸ö£¬ÄÇô»á·¢Éú´íÎó£¬ÏÂÃæµÄÕâ¸ö·½·¨¾ÍÊǽâ¾öÕâ¸öÎÊÌâµÄ£¬Ëü½«ÎÒÃǵÄÉÏǧ¸ö²ÎÊý·Ö³É¼¸×飬±£Ö¤Ã¿×éµÄ²ÎÊý¸öÊý²»³¬¹ý1000
/**
* Éú³É·ûºÏÌõ¼þµÄsqlÓï¾ä,½â¾öinÎÊÌâ
* @param sqlParam£ºÎÒÃÇÐèÒª´¦ÀíµÄ²ÎÊýµÄ×Ö·û´®¸ñʽ£¬ÀýÈ ......
²é¿´»ØÊÕÕ¾Öбí
select object_name,original_name,partition_name,type,ts_name,createtime,droptime from recyclebin;
»Ö¸´±í
SQL
>flashback table test_drop to before drop;»ò
SQL
>flashback table "BIN$b+XkkO1RS5K10uKo9BfmuA==$0" to befor ......
Oracle ±íɾ³ý´óÁ¿Êý¾Ýºó£¬¼´Ê¹±íÖÐÖ»Óм¸ÐмǼ£¬µ«ÓÃselect count(*) from table À´²éѯ·¢¾õ¶¼²»»áÂíÉϳöÀ´£¬ÔÒòÊǸñíµÄ¿Õ¼ä´óÁË£¬²éѯÆðÀ´ºÜÂý¡£½â¾öµÄ·½·¨ÊǰѸñíËùÕ¼Óõıí¿Õ¼äËõС£¬»òÕß˵Êͷűí¿Õ¼ä¡£
alter table XXXX move; ÕâÑù´¦Àíºó¾ÍÊÍ·ÅÁ˱í¿Õ¼äÁË¡£µ«ÊÇÊͷűí¿Õ¼äºó£¬±íµÄÐкÅrowid»á·¢Éú±ä»¯£¬¶ø»ùÓÚ ......