author£ºskate
time£º2010-05-31
ÎÒÃÇÔÚʹÓÃwindowsµÄʱºò£¬¶¼ÖªµÀÒª¶¨ÆÚÕûÀí´ÅÅÌËéƬ£¬ÒòΪ´ÅÅÌËéƬ»áÓ°ÏìÐÔÄÜ£¬¸ø¹ÜÀíÉÏ´øÀ´¶îÍâµÄ
¸ºµ£¡£ÄÇoracle¸üÊÇÈç´Ë£¬µ±Ëæ×ÅÊý¾ÝÔö¼Ó£¬oracle´¦Àíº£Á¿Êý¾Ý±¾Éí¾ÍÒѾºÜ·ÑÁ¦ÁË°¡£¬Èç¹ûÔÙÓдóÁ¿
µÄËéƬ£¬ÄǾÍÊÇÑ©ÉϼÓ˪°¡¡£ËùÒÔËéƬҪÒýÆðdbaµÄ¸ß¶ÈÖØÊÓ£¬¾¡Ôç·¢ÏÖ¾¡Ôç´¦Àí¡£
ËéƬÊÇÔõô²úÉúµÄÄØ£¿
¼òµ¥Àí½â¾ÍÊÇÓÉÓÚ¸üкÍɾ³ý²úÉúһЩËéСµÄ²»Äܱ»ÔÙ´ÎʹÓõĿռ䣬¸ù¾ÝÿÖÖ²»Í¬µÄËéƬËûÃǵIJúÉúÒ²ÊÇÓÐÇø±ðµÄ
block-levelµÄËéƬ£¬¶øblockÓÖ·ÖΪdata blockºÍindex block£¬ÔÚdata blockÖдæ·ÅµÄÊÇrowÊý¾Ý£¬ÔÚindex block
Öдæ·ÅµÄÊÇË÷Òý¼üÖµÊý¾Ý£¬ËùÒÔ°´ÉÏÃæËù˵£¬block-levelËéƬÓÐϸ·ÖΪrow-levelËéƬºÍIndex Leaf Block-levelËéƬ¡£
oracleµÄÿһ¸ö¶ÔÏó¶¼ÊÇ´æ´¢ÔÚsegmentÖУ¬¶øoracleµÄ×îС·ÖÅ䵥λÊÇextents£¨Çø£©£¬ÔÚÊý¾Ý¸üÐÂɾ³ýÖÐÒ²»á²úÉúËéƬ
ÕâÒ»¼¶±ðµÄËéƬ¾ÍÊÇsegmentËéƬ¡£segmentÓÖ´æÔÚdatafileÖУ¬¶øtablespaceÓÖÊÇ°üº¬datafileµÄÂß¼¸ÅÄî¡£ËùÒÔÕâÒ»²ã
ÊÇtablespace-levelËéƬ£»tablespaceÊÇÔÚdiskÉÏ´æ´¢£¬ËùÒÔÕâÒ»²ã¾ÍÊÇdisk-levelËéƬ¡£
¼òµ¥Í¼Ê¾ÈçÏÂ
disk-level fragmention
tablespace-level fragme ......
Èç¹ûweb·½Ê½µÄem£¬isqlplus·ÃÎʲ»ÁË¡£
1. ¼ì²éÖ÷»úÃû/IP¡¢¶Ë¿ÚÊÇ·ñÕýÈ·
°²×°Ê±µÄÖ÷»úÃû/IP¡¢¶Ë¿Ú¼Ç¼ÔÚ$ORACLE_HOME/install/portlist.ini ÎļþÖС£
ȱʡÊÇ£º
Ò»°ãÓû§
http://ip:5560/isqlplus
DBAÓû§
http://ip:5560/isqlplus/dba
EM Database
Control
http://ip:1158/em/
2. ¿´em, isqlplus·þÎñÊÇ·ñÆðÆô¶¯£¬×´Ì¬ÊÇ·ñÕý³£
µ±È»Oracle°²×°Ê±£¬ÒªÑ¡Ôñ°²×°ÁË“Oracle Enterprise ManagerÅäÖÃÊý¾Ý¿â”
ÆäËüÎÊÌ⣺
3. »»ÁËipÐèÒªÖؽ¨em£¬ÒÔÏÂÊÇemµÄÏà¹ØÃüÁî:
´´½¨Ò»¸öEM×ÊÁÏ¿â
emca -repos create
Öؽ¨Ò»¸öEM×ÊÁÏ¿â
emca -repos recreate
ɾ³ýÒ»¸öEM×ÊÁÏ¿â
emca -repos drop
ÅäÖÃÊý¾Ý¿âµÄ Database Control
emca -config dbcontrol db
ɾ³ýÊý¾Ý¿âµÄ Database ControlÅäÖÃ
emca -deconfig dbcontrol db
ÖØÐÂÅäÖÃdb controlµÄ¶Ë¿Ú£¬Ä¬È϶˿ÚÔÚ1158
emca -reconfig ......
Ê×ÏÈдºÃ½¨¿â½Å±¾c.sql
¡¡¡¡
¡¡¡¡create database mydb
¡¡¡¡controlfile reuse
¡¡¡¡maxinstances 1
¡¡¡¡maxloghistory 1
¡¡¡¡maxlogfiles 5
¡¡¡¡maxlogmembers 5
¡¡¡¡maxdatafiles 100
¡¡¡¡datafile '$ORACLE_HOME/oradata/system01.dbf'size 325M reuse
¡¡¡¡autoextend on next 10240K maxsize unlimited
¡¡¡¡undo tablespace D_DUTSCR
¡¡¡¡datafile '/$ORACLE_HOME/oradata/undo01.dbf' SIZE 40M reuse
¡¡¡¡character set AL32UTF8
¡¡¡¡national character set UTF8
¡¡¡¡logfile
¡¡¡¡'$ORACLE_HOME/oradata/redo01.log' size 100M reuse,
¡¡¡¡'$ORACLE_HOME/oradata/redo02.log' size 100M reuse,
¡¡¡¡'$ORACLE_HOME/oradata/redo03.log' size 100M reuse,
¡¡¡¡'$ORACLE_HOME/oradata/redo04.log' size 100M reuse
¡¡¡¡default temporary tablespace TEMP
¡¡¡¡tempfile
¡¡¡¡'$ORACLE_HOME/oradata/temp01.dbf' size 50M reuse
¡¡¡¡extent management local uniform size 1M;
¡¡¡¡
¡¡¡¡--------------------------------------------
¡¡¡¡
¡¡¡¡½¨Á¢Êý¾Ý×ÖµäµÄÎļþÊÇ£º
¡¡¡¡
¡¡¡¡$ORACLE_HOME/rdbms/admin/catalog.sql
¡¡¡¡
¡¡¡¡$ORACLE_HOME/ ......
Oracle10GµÄEM²ÉÓÃÁËweb·½Ê½£¬²¢ÇÒ·Ö³ÉÁË2¸ö²úÆ·£¬database controlºÍgrid control¡£ÕâÀïÖ÷Òª½éÉÜÈçºÎ´´½¨µ¥Êý¾ÝµÄdbcontrol¡£Grid controlÐèÒªÏÂÔص¥¶ÀµÄ¹âÅÌ°²×°¡£
ÔÚÓÃDBCA½¨¿âµÄʱºò£¬¿ÉÒÔÑ¡ÔñÊÇ·ñÆôÓÃdbcontrol£¬ÆôÓõĻ°ÐèÒªÔÚ
Êý¾Ý¿â
Öн¨Á¢Ò»¸ösysmanµÄschema£¬ÓÃÓÚ±£´æEMµÄһЩÊý¾Ý£¬Õâ¸ö¾ÍÊÇEMµÄ×ÊÁÏ¿â(repository)¡£
ʹÓÃÃüÁîÐй¤¾ßemca
¿ÉÒÔ´´½¨£¬Ð޸ģ¬Öؽ¨»òÕßɾ³ýdbcontrol
µÄÅäÖá£
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle
Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
ÓÉÓÚÒªÔÚÊý¾Ý¿âÖн¨EM×ÊÁϿ⣬Êý¾Ý¿âºÍ¼àÌý¶¼±ØÐëÒѾÆô¶¯²¢Õý³£¹¤×÷¡£
´´½¨EM×ÊÁÏ¿â
C:/>emca -repos create
EMCA ¿ªÊ¼ÓÚ 2006-11-2 22:32:43
EM Configuration Assistant 10.2.0.1.0 Õýʽ°æ
°æȨËùÓÐ (c) 2003, 2005, Oracle¡£±£ÁôËùÓÐȨÀû¡£
ÊäÈëÒÔÏÂÐÅÏ¢:
Êý¾Ý¿â SID: ning
¼àÌý³ÌÐò¶Ë¿ ......
---------------------------------------------------------------------------
---- ±¾ÎÄΪandkylee¸öÈËÔ´´£¬ÇëÔÚ×ðÖØ×÷ÕßÀͶ¯³É¹ûµÄÇ°ÌáϽøÐÐתÔØ£»
---- תÔØÎñ±Ø×¢Ã÷Ôʼ³ö´¦
:
http://blog.csdn.net/andkylee
--- 2010-05-31 22:56:43
---- ¹Ø¼ü×Ö£º oracle ·ÖÒ³ rownum
----------------------------------------------------------------------------
ÔÚoracleÖÐÏÔʾ·ÖÒ³ºÜ¼òµ¥£¬ ÀûÓÃÁ½´Îrownum¾ÍʵÏÖÁË¡£
ÏÂÃæµÄÓï¾äÓÃÀ´·µ»ØDBA_OBJECTS±íÖÐÀàÐÍΪTABLEµÄËùÓмǼÖеĵÚ100ÐÐÖÁµÚ200ÐС£
select * from
( select rownum rnm, a.* from ( select OBJECT_NAME from DBA_OBJECTS where object_type='TABLE' ) a
where rownum <= 200 )
where rnm > 100
Ö´Ðнá¹ûΪ£º
SQL> select * from
2 ( select rownum rnm, a.* from ( select OBJECT_NAME from DBA_OBJECTS where object_type='TABLE' ) a
3 where rownum <= 200 )
4 where rnm > 100
5 ;
RNM OBJECT_NAME
---------- --------------------------------------------------------------------------------------------------- ......
http://hi.baidu.com/lu_xinzhong/blog/item/4ff92b1725dec505c83d6d09.html
»Ø¹ö±í¿Õ¼ä´óС
-- ´´½¨Ò»¸öеÄС¿Õ¼äµÄUNDO TABLESPACE
Create UNDO TABLESPACE UNDOTBS2 DATAFILE '/u01/app/oracle/oradata/orcl/UNDOTBS02.DBF' SIZE 100M REUSE AUTOEXTEND ON;
-- ÉèÖÃеıí¿Õ¼äΪϵͳUNDO_TABLESPACE
Alter SYSTEM SET UNDO_TABLESPACE=UNDOTBS2;
-- Drop ¾ÉµÄ±í¿Õ¼ä
Drop TABLESPACE UNDOTBS1 INCLUDING CONTENTS AND DATAFILES; (Íê³Éºóɾ³ý±í¿Õ¼äºÍÊý¾Ý/u01/app/oracle/oradata/orcl/UNDOTBS01.DBF)
Select * from DBA_TABLESPACES;
È»ºó½øÐгöϲÙ×÷£º
-- ´´½¨Ò»¸öеÄС¿Õ¼äµÄUNDO TABLESPACE
Create UNDO TABLESPACE UNDOTBS1 DATAFILE '/u01/app/oracle/oradata/orcl/UNDOTBS01.DBF' SIZE 100M REUSE AUTOEXTEND ON;
-- ÉèÖÃеıí¿Õ¼äΪϵͳUNDO_TABLESPACE
Alter SYSTEM SET UNDO_TABLESPACE=UNDOTBS1;
-- Drop ¾ÉµÄ±í¿Õ¼ä
Drop TABLESPACE UNDOTBS2 INCLUDING CONTENTS AND DATAFILES;
--²é¿´ËùÓбí¿Õ¼äµÄÇé¿ö
Select * from DBA_TABLESPACES;
Íê³Éºóɾ³ý/u01/app/oracle/oradata/orcl/UNDOTBS02.DBF¡£
Èç¹ûÁÙʱ±í¿Õ¼äºÜ´ó´¦ÀíµÄ·½·¨ÀàËÆ¡£ ......
http://hi.baidu.com/lu_xinzhong/blog/item/4ff92b1725dec505c83d6d09.html
»Ø¹ö±í¿Õ¼ä´óС
-- ´´½¨Ò»¸öеÄС¿Õ¼äµÄUNDO TABLESPACE
Create UNDO TABLESPACE UNDOTBS2 DATAFILE '/u01/app/oracle/oradata/orcl/UNDOTBS02.DBF' SIZE 100M REUSE AUTOEXTEND ON;
-- ÉèÖÃеıí¿Õ¼äΪϵͳUNDO_TABLESPACE
Alter SYSTEM SET UNDO_TABLESPACE=UNDOTBS2;
-- Drop ¾ÉµÄ±í¿Õ¼ä
Drop TABLESPACE UNDOTBS1 INCLUDING CONTENTS AND DATAFILES; (Íê³Éºóɾ³ý±í¿Õ¼äºÍÊý¾Ý/u01/app/oracle/oradata/orcl/UNDOTBS01.DBF)
Select * from DBA_TABLESPACES;
È»ºó½øÐгöϲÙ×÷£º
-- ´´½¨Ò»¸öеÄС¿Õ¼äµÄUNDO TABLESPACE
Create UNDO TABLESPACE UNDOTBS1 DATAFILE '/u01/app/oracle/oradata/orcl/UNDOTBS01.DBF' SIZE 100M REUSE AUTOEXTEND ON;
-- ÉèÖÃеıí¿Õ¼äΪϵͳUNDO_TABLESPACE
Alter SYSTEM SET UNDO_TABLESPACE=UNDOTBS1;
-- Drop ¾ÉµÄ±í¿Õ¼ä
Drop TABLESPACE UNDOTBS2 INCLUDING CONTENTS AND DATAFILES;
--²é¿´ËùÓбí¿Õ¼äµÄÇé¿ö
Select * from DBA_TABLESPACES;
Íê³Éºóɾ³ý/u01/app/oracle/oradata/orcl/UNDOTBS02.DBF¡£
Èç¹ûÁÙʱ±í¿Õ¼äºÜ´ó´¦ÀíµÄ·½·¨ÀàËÆ¡£ ......
×ܼǼÊý:3994; ×ÜÒ³Êý:666; ÿҳ6 Ìõ;
Ê×Ò³ ÉÏÒ»Ò³ [1] [2] [3] 4
[5] [6] [7] [8] [9] [10] ÏÂÒ»Ò³ βҳ