BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡

±Û¾´ÀÌ: °³¶óŬ OracleÀÇ ±¸Á¶ÀÌÇØ Á¶È¸¼ö: 19410



1 OracleÀÇ ±¸Á¶ÀÌÇØ
¢ÃOracleÀÇ Install ÈÄ OracleÀº hard disk »ó¿¡ ¾î¶»°Ô Á¸ÀçÇϸç, OracleÀ» °¡µ¿½ÃÅ°¸é ¾î¶°ÇÑ Process°¡ ±âµ¿µÇ
´Â°¡ µî. Oracle¿î¿µ¿¡ ÇÊ¿äÇÑ ±âº»È¯°æ ¹× ±¸Á¶¸¦ ÀÌÇØÇÏ´Â °ÍÀº OracleÀ» ÀÌÇØ Çϴµ¥ ¸¹Àº µµ¿òÀ» ÁÝ´Ï´Ù.
1.1 Oracle »ç¿ë½Ã ÀÌ¿ëµÇ´Â O.S UserÀÇ »ý¼º
¢ÃOracleÀÇ ¼³Ä¡½Ã¿¡´Â ¸ÕÀú OracleÀ» Install½Ã ÀÌ¿ëÇÒ O.S User¿Í ÀÌ UserÀÇ GroupÀ» ¸ÕÀú ¸¸µì´Ï´Ù.(ÀϹÝÀû
À¸·Î Userid´Â Oracle ¶Ç´Â Oracle7, GroupÀº dba·Î ÇÕ´Ï´Ù.)

1)»õ·Î¿î User id´Â OSÀÇ super user¸¦ ÀÌ¿ëÇؼ­ ¸¸µé°Ô µË´Ï´Ù.
¡ßSuperUser¸¦ ÀÌ¿ëÇؼ­ »õ·Î¿î User¸¦ »ý¼ºÇÏ´Â ¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù.

¨ç/etc/passwd file¿¡ »õ·Î¿î user id¸¦ µî·ÏÇÕ´Ï´Ù.
oracle: *: 202: 21: ENGLISH ORACLE V7.0 for MIS...: /extra2/eora: /bin/sh
A B C D E F G
A´Â OS¿¡ loginÇÒ user id ÀÔ´Ï´Ù.
B´Â user idÀÇ password ÀÔ´Ï´Ù.
C´Â user idÀÇ user number·Î¼­ °íÀ¯ÇÑ °ªÀ» °®°í ÀÖ½À´Ï´Ù.
D´Â group number ÀÔ´Ï´Ù.
E´Â ÀÌ user id¿¡ °ü·ÃµÈ comment ÀÔ´Ï´Ù.
F´Â ÀÌ user idÀÇ Home directory ÀÔ´Ï´Ù.
G´Â ÀÌ user id°¡ »ç¿ëÇÏ´Â shell ÀÔ´Ï´Ù.
¨è/etc/group file¿¡ »õ·Î¿î Group¸¦ µî·ÏÇÕ´Ï´Ù.
dba: :21: eora
A´Â Group¸íÀÔ´Ï´Ù.
B´Â Group number·Î¼­ À§ÀÇ ¨ç¹ø Ç׸ñÀÇ D¹ø Ç׸ñ¿¡ ÁÖ´Â °ª°ú °°½À´Ï´Ù.
C´Â dba¶ó´Â Group¿¡ ¼ÓÇÏ´Â user id¸¦ Á¤ÀÇÇÏ´Â °÷ÀÔ´Ï´Ù.
¡ÚGroup¿¡ µî·ÏµÈ user´Â OracleÀÇ dba ±â´ÉÀ» ¼öÇàÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀ» °¡Áö°Ô µË´Ï´Ù.
±×·¯¹Ç·Î OracleÀ» ÀÌ¿ëÇÒ ÀÏ¹Ý user´Â GroupÀ» dba ¼ÓÇÏÁö ¾Êµµ·Ï ÇÏ´Â °ÍÀÌ ÁÁ½À´Ï´Ù.
¨é »õ·Î¿î userÀÇ shell
¡á ShellÀ̶õ »ç¿ëÀÚ°¡ ÀÔ·ÂµÈ ¸í·É¾î¸¦ OS ¿Í ¿¬°áÇÏ¿© ÁÖ°í Çؼ®ÇÏ´Â programÀÔ´Ï´Ù.
¡á Unix¿¡´Â borne shell, C shellµîÀÌ ÀÖÀ¸¸é ÀÚ½ÅÀÌ ¾î¶² shellÀ» »ç¿ëÇÏ°í Àִ°¡¸¦ È®ÀÎÇÏ´Â ¹æ¹ýÀº
login ÈÄ prompt¸¦ È®ÀÎÇØ º¸¸é µË´Ï´Ù.
prompt°¡ $À̸é borne shell, %À̸é C shellÀ» »ç¿ëÇÏ°í ÀÖ´Â °ÍÀÔ´Ï´Ù.
¡á OracleÀ» ¼³Ä¡(install)ÇÏ°í ¿î¿µÇϴµ¥´Â borne shell, C shell ¸ðµÎ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
1.2 »ç¿ë½Ã ÀÌ¿ëµÇ´Â »ç¿ëÀÚ È¯°æÁ¤ÀÇ
¢ÃUnix systemÀ» »ç¿ëÇϱâ À§ÇÏ¿©´Â ¹Ýµå½Ã loginÀ̶õ °úÁ¤À» °ÅÃÄ¾ß ÇÕ´Ï´Ù.
loginÀ» ÇÏ´Â ½ÃÁ¡¿¡ loginÀ» ÇÒ ÇØ´ç userÀÇ system»ç¿ëȯ°æÀÌ Á¤Àǵ˴ϴÙ.
»ç¿ëȯ°æÀº ÇÊ¿äÇÑ Á¤º¸°¡ ƯÁ¤ file ¿¡ º¸°üµÇ¾î ÀÖ´Ù°¡ systemÀÇ login½Ã ½ÇÇàµÇ¾î ÇØ´ç user°¡ ÇÊ¿äÇÑ È¯°æ
À» Á¤ÀÇÇØ ÁÖ°Ô µÇ´Â °ÍÀÔ´Ï´Ù.
¢Ã»ç¿ëȯ°æ¿¡ °üÇÑ Á¤º¸°¡ ÀúÀåµÇ¾î ÀÖ´Â fileÀº ¾î¶² shellÀ» »ç¿ëÇÏ´À³Ä¿¡ µû¶ó À̸§ÀÌ ´Þ¶ó¸ç ÀÌ fileÀ» ¹Ýµå½Ã
loginÇÏ´Â userÀÇ home_directory ¹Ø¿¡ ÀÖ¾î¾ß ÇÕ´Ï´Ù.
¢ÃBorne shellÀ» »ç¿ë½Ã¿¡´Â .profileÀ̶ó´Â °÷¿¡ »ç¿ëȯ°æÀÌ Á¤ÀǵǸç C shellÀ» »ç¿ë½Ã¿¡´Â .cshrc¶Ç´Â .login¿¡
Á¤Àǵ˴ϴÙ.
¡ß´ÙÀ½Àº OracleÀ» »ç¿ëÇÏ´Â userÀÎ °æ¿ì¿¡ Oracle°ú °ü·ÃµÈ »ç¿ëȯ°æÀÇ Á¤ÀÇÀÔ´Ï´Ù.
prompt»óÅ¿¡¼­ env¶ó´Â command¸¦ Ä¡¸é ÇöÀç user¿¡°Ô Á¤ÀǵǾî Àִ ȯ°æº¯¼ö°¡ ³ªÅ¸³³´Ï´Ù.
HOME = /users/tjseo
LOGNAME = tjseo
MAIL = /usr/mail/tjseo
MENU5PATH = /extra2/eora/forms30/admin/resource
ORACLE_HOME = /extra2/eora
ORACLE_TERM = vt100
NLS_LANG = American_America.KO16KSC5601
ORACLE_SID = eora
ORATERMPATH = /extra2/forms30/admin/resource
PATH=:/usr/bin:/extra2/eora/bin:.:/usr/bin/x11:/usr/local:/usr/lib/cobol/bin:/usr/lib/c/obol/coblib
SHELL = /bin/sh
TERM = vt220
¡ß À§ÀÇ È¯°æº¯¼ö Áß ¹ØÁ٠ģ ºÎºÐÀÌ OracleÀ» ÀÌ¿ëÇϱâ À§ÇØ Á¤ÀÇµÈ º¯¼öÀÔ´Ï´Ù.
MENU5PATH, ORATERMPATH´Â From30À̳ª Menu50 product¸¦ ¼³Ä¡ÇÏÁö ¾ÊÀ¸¸é Á¤ÀǵÇÁö ¾ÊÀ¸¸ç,
NLS_LANGÀº ¼³Ä¡½Ã Á¤ÀÇÇÑ character set°ú µ¿ÀÏÇÏ°Ô Á¤ÀǵǾî¾ß ÇÕ´Ï´Ù.
¡ßOracle°ü·Ã ȯ°æº¯¼öÀÇ Àǹ̴ ´ÙÀ½°ú °°½À´Ï´Ù.
ORACLE_SID : ÀÌ´Â ORACLE DATABASEÀÇ ±¸ºÐÀڷμ­ UniqueÇÑ °ªÀ» °¡Á®¾ß ÇÕ´Ï´Ù.
ORACLE_HOME : ORACLE SYSTEMÀÌ µé¾îÀÖ´Â directory¸¦ ÀǹÌÇÕ´Ï´Ù.
NLS_LANG : ORACLE¿¡¼­ ÀÌ¿ëÇÒ Language type(character set)À» ÀǹÌÇÕ´Ï´Ù.
ORATERM : from»ç¿ë½Ã ÀÌ¿ëÇÒ Terminal typeÀÇ resource fileÀÌ ÀÖ´Â directory¸¦ ÀǹÌÇÕ´Ï´Ù.
MENU5PATH : MENU¿¡¼­ ÀÌ¿ëÇÒ Terminal typeÀÇ resource fileÀÌ ÀÖ´Â directory¸¦ ÀǹÌÇÕ´Ï´Ù.
¡ßOracleÀ» ¼³Ä¡½Ã ÀÌ¿ëÇÒ ownerÀÇ »ç¿ëȯ°æÀ» ÀÌ¹Ì À§¿Í °°ÀÌ Á¤ÀǵǾî ÀÖÁö¸¸ ÀÏ¹Ý OS User°¡ OracleÀ» »ç¿ë
Çϱâ À§Çؼ­´Â À§¿¡ Á¤ÀÇµÈ OracleÀ» À§ÇÑ È¯°æº¯¼ö°¡ °¢ OS UserÀÇ Home_directory¹Ø¿¡ .profile À̳ª .cshrc¶Ç
´Â .login¿¡ Á¤ÀǵǾî¾ß ÇÕ´Ï´Ù.
1.3 ¼³Ä¡½Ã ÀÌ¿ëµÈ °¡ ¾Æ´Ñ ´Ù¸¥ ÀÇ »ç¿ë¹æ¹ý
OracleÀ» install ÇÒ ¶§ ÀÌ¿ëÇÑ user°¡ ¾Æ´Ñ ÀÏ¹Ý user°¡ OracleÀ» »ç¿ëÇÏ·Á¸é ¾ÕÀÇ 1.2¿¡¼­ ¾ð±ÞµÈ »ç¿ëÀÚ È¯
°æº¯¼ö¸¦ ÀÏ¹Ý user¿¡°Ôµµ settingÇÏ¿©¾ß ÇÕ´Ï´Ù.
ȯ°æº¯¼ö¸¦settingÇÏ´Â ¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù.
(¿©±âÀÇ ¿¹Á¦´Â borne_shell »ç¿ë½Ã ȯ°æº¯¼ö setting ¹æ¹ýÀÓ)
ÀÏ¹Ý userÀÇ Home directory¿¡ ÀÖ´Â .profile¿¡ ¾Æ·¡¿¡ ÀÖ´Â ³»¿ëÀ» Ãß°¡ÇÏ¸é µË´Ï´Ù.
ORACLE_SID = eora: export ORACLE_SID
ORACLE_HOME = /extra2/eora: export ORACLE_HOME
NLS_LANG = America_America.KO16KSC5601:export NLS_LANG
ORACLE_TERM = vt100:export ORACLE_TERM
PATH = $PATH:$ORACLE_HOME/bin:export PATH
ORATERMPATH = $ORACLE_HOME/forms30/admin/resource export ORATERMPATH
MENU5PATH = $ORACLE_HOME/forms30/admin/resource export MENU5PATH
À§ÀÇ ParameterµéÀº Oracle ¼³Ä¡ ÈÄ settingÇÑ °ª Áï, Oracle owner¿¡ Á¤ÀǵǾî ÀÖ´Â °Í°ú °°Àº °ªÀ¸·Î ¼³Á¤
µÇ¾î¾ß ÇÕ´Ï´Ù.
C shellÀ» »ç¿ëÇÏ´Â °æ¿ì¿¡´Â .cshrc¶Ç´Â .login¿¡ Á¤ÀÇÇÏ¿©¾ß ÇÕ´Ï´Ù.
( C shellÀ» »ç¿ë½Ã¿¡´Â borne-shell°ú Á¤ÀÇ ¹æ¹ýÀÌ ´Ù¸§)
1.4 Oracle ±âµ¿½Ã »ì¾Æ³ª´Â Process ÇöȲ
¢Ã OracleÀ» sqldba¿¡¼­ ±âµ¿½ÃÄÑ(startup) Á¤»óÀûÀ¸·Î ±âµ¿µÇ¸é DataÀÇ read. write¸¦ À§ÇØ ¿©·¯ °³ÀÇ
background process°¡ »ì¾Æ³³´Ï´Ù.
1.4.1 ±âµ¿µÇ´Â Process

¡á ÀϹÝÀûÀ¸·Î, Á¤»óÀ¸·Î OracleÀÌ ±âµ¿µÇ¸é dbwr. lgwr. smon. pmon. arch. reco. d000. s000 processµéÀÌ
background·Î runningµË´Ï´Ù.
¡á arch. reco process´Â Ưº°È÷ ÀÌ processµéÀº run µÇ°Ô ÇÑ °æ¿ì¿¡¸¸ ³ªÅ¸³³´Ï´Ù. arch´Â OracleÀ» archive log
modeÀ¸·Î ¿î¿µ½Ã runµÇ¸ç reco process´Â ºÐ»ê database optionÀÌ ¼³Ä¡µÇ¾î ÀÖ´Â °æ¿ì¿¡ runµË´Ï´Ù.
¡á ½ÇÁ¦·Î background¸¦ run µÇ´Â »óȲÀ» º¸¸é ´ÙÀ½°ú °°½À´Ï´Ù.
(ps -ef : grep ora¶ó°í Çϸé ÇöÀç OracleÀÇ background process¸¦ È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
ex) ps -ef 1 grep ora
¢«process¸íÀº ora_process¸í + Oracle_sid (Oracle ȯ°æº¯¼ö ÂüÁ¶)¶ó´Â À̸§À¸·Î ±¸¼ºµÇ¾î ÀÖ½À´Ï´Ù.
¡ß °¢ processÀÇ ¿ªÇÒÀº ´ÙÀ½°ú °°½À´Ï´Ù.
dbwr : ¼öÁ¤µÈ data blockÀ» database¿¡ writeÇÏ´Â ¿ªÇÒÀ» ÇÕ´Ï´Ù.
lgwr : redo log entry¶ó´Â Á¤º¸¸¦ Oracle system redo log file¿¡ writeÇÕ´Ï´Ù.
smon : DatabaseÀÇ recovery¸¦ ¼öÇàÇÕ´Ï´Ù.
pmon : User processÀÇ recovery¸¦ ¼öÇàÇÕ´Ï´Ù.
arch : archive log·Î ¿î¿µ½Ã redo log file¸¦ archivingÇÏ´Â ¿ªÇÒÀ» ¼öÇàÇÕ´Ï´Ù.
reco : ºÐ»êȯ°æ¿¡¼­ transactionÀÇ recovery¸¦ ´ã´çÇÕ´Ï´Ù.
dooo : MTS·Î ¿î¿µ½Ã ÀÌ¿ëµÇ´Â dispatcher processÀÔ´Ï´Ù.
sooo : MTS·Î ¿î¿µ½Ã ÀÌ¿ëµÇ´Â shared server processÀÔ´Ï´Ù.
Oracle 0 11523 1 0 Aug 28 ? 0:40 ora_smon_eora
Oracle 0 11542 1 0 Aug 28 ? 11:51 ora_arch_eora
Oracle 0 11529 1 0 Aug 28 ? 0:01 ora_reco_eora
Oracle 0 11499 1 0 Aug 28 ? 0:06 ora_pmon_eora
Oracle 0 11502 1 0 Aug 28 ? 0:52 ora_dbw_eora
Oracle 0 11536 1 0 Aug 28 ? 17:29 ora_d000_eora
Oracle 0 11507 1 0 Aug 28 ? 0:35 ora_lgwr_eora
Oracle 0 789 11499 0 10:32:26 ? 6:04 ora_s000_eora
1.5 OracleÀÇ Directory ±¸Á¶
¢ÃOracleÀÌ ¼³Ä¡µÇ°í ³ª¸é ORACLE_HOME(1.2ÀÇ È¯°æº¯¼ö ÂüÁ¶)¾Æ·¡¿¡ Oracle RDBMS¹× °¢ Product¸¦ À§
ÇÑ sub directory°¡ ¸¸µé¾îÁý´Ï´Ù.
1.5.1 Oracle RDBMS¸¦ À§ÇÑ Directory
¡á bin. dbs. orainst. lib. rdbms. guicommon. ocommon. tk2¿Í °°Àº directory°¡ ¸¸µé¾îÁý´Ï´Ù.
ÀÌÁß¿¡¼­ binÀº Oracle¿¡¼­ ÀÌ¿ëÇÒ ½ÇÇà fileÀÌ ÀÖ´Â °÷À̸ç, dbs´Â Oracle systemÀÇ ¿î¿ë½Ã ÇÊ¿äÇÑ system
fileÀÌ ÀÖ´Â °÷ÀÔ´Ï´Ù.
1.5.2 Oracle Product¸¦ À§ÇÑ Directory
¡á cdes. cgen20. dict50. procob. forms30. menu5. network. oraterm. plsql. proc. sqlplus sqlreport. report.
tcp. tcppaµîÀÇ directory°¡ »ý±é´Ï´Ù.
¡á cdes, cgen20, dict50Àº Oracle case tool °ü·Ã directoryÀÔ´Ï´Ù.
¡á forms30, menu5, oratermÀº forms/menu¿ë directoryÀÔ´Ï´Ù.
¡á plsql, sqlplus´Â sql °ü·Ã directory ÀÔ´Ï´Ù.
¡á sqlreport, report´Â reportwriter °ü·Ã directoryÀÔ´Ï´Ù.
¡á tcp, network, tcppa´Â sqlnet °ü·Ã directory ÀÔ´Ï´Ù.
¢«¼³Ä¡ ÈÄ oracleÀÇ Á¦Ç°±¸¸Å¿¡ µû¶ó À§¿¡ ¼³¸íÇÑ directory Áß ORACLE_HOME ¾Æ·¡¿¡ ¾ø´Â directory°¡
ÀÖÀ» ¼ö ÀÖ½À´Ï´Ù.
2.OracleÀÇ ±âµ¿ ¹× Á¤Áö¹æ¹ý

¢Ã OracleÀÇ ±âµ¿À̶ó´Â °ÍÀº ÀÏ¹Ý userµéÀÌ Oracle »ç¿ëÇÒ ¼ö ÀÖ´Â »óÅ·Π¸¸µé¾î ÁÖ´Â °ÍÀ» ÀǹÌÇϸç ÀϹÝ
ÀûÀ¸·Î Oracle¸¦ »ì¸°´Ù°í Ç¥ÇöÇÕ´Ï´Ù.
¢Ã OracleÀÇ Á¤Áö¶ó´Â °ÍÀº Oracle »ç¿ëÇÒ ¼ö ¾ø´Â »óÅ·Π¸¸µå´Â °ÍÀ» ÀǹÌÇϸç ÀϹÝÀûÀ¸·Î Oracle
À» Á×Àδٰí Ç¥ÇöÇÕ´Ï´Ù.
2.1 Oracle DBÀÇ ±âµ¿ ¹× Á¤Áö¹æ¹ý
1)µ¥ÀÌŸº£À̽ºÀÇ ±âµ¿
¡Ü µ¥ÀÌŸº£À̽º³»ÀÇ Á¤º¸¸¦ ó¸®Çϰųª ÀÛ¾÷ÇÏ·Á¸é ´ÙÀ½ÀÇ ÀýÂ÷¸¦ ÅëÇØ ±âµ¿½Ãŵ´Ï´Ù.
$ sqldba lmode=y
SQL *DBA: Release 7.0.15.4.0 - Production on Thu Feb 9 23:39:59 1995
Copyright (c) Oracle Corporation 1979.1992. All rights reserved.
ORACLE7 Server Release 7.0.15.4.0 - Production
With the procedural and distributed options
PL/SQL Release 2.0.17.1.0 - Production
SQLDBA>connect internal /*µ¥ÀÌŸº£À̽º¿¡ Á¢¼ÓÇÑ´Ù */
Connected.
SQLDBA>startup. /*µ¥ÀÌŸº£À̽º¸¦ ±âµ¿½ÃŲ´Ù */
ORACLE instance started.
Database mounted.
Database opened
Total System Global Area 3532184 bytes
Fixed Size 39136 bytes
Variable Size 2460856 bytes
Database Buffers 1024000 bytes
Redo Buffers 8192 bytes
SQLDBA>exit /* SQL*DBA¸¦ Á¾·áÇÑ´Ù */
¡Ü À§ÀÇ È­¸é°ú °°ÀÌ ³ªÅ¸³ª¸é OracleÀº Á¤»óÀûÀ¸·Î ±âµ¿µÈ °ÍÀÔ´Ï´Ù.
2) Á¦ÇÑµÈ user¸¦ À§ÇÑ µ¥ÀÌŸº£À̽ºÀÇ ±âµ¿
¡Ü DBÀÇ ±¸Á¶¸¦ ¹Ù²Ù°Å³ª dataÀÇ export¶Ç´Â import½Ã µî¿¡ ÀÌ¿ëÇÒ ¼ö ÀÖÀ¸¸ç,DB¸¦ ¿î¿µÀÚ¸¸ÀÌ »ç¿ëÇÒ ÇÊ¿ä°¡
ÀÖ´Â °æ¿ì¿¡ »ç¿ëÇÏ°Ô µË´Ï´Ù.
¡Ü À§ÀÇ 1)°ú °°ÀÌ startupÀ» ÇÏ¸é ¸ðµç userµéÀÌ Oracle¿¡ ¹Ù·Î connectÇÏ¿© »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ±×·¸Áö¸¸ DB
±¸Á¶¸¦ ¹Ù²Ù°Å³ª dataÀÇ export¶Ç´Â importµî°ú °°Àº ÀÛ¾÷À» ÇÒ ¶§, ÀÏ¹Ý userµéÀÌ »ç¿ëÀ» ¸øÇÏ°Ô ÇÏ°í ÀÛ¾÷À» ÇÒ
ÇÊ¿ä°¡ ÀÖÀ» °æ¿ì¿¡´Â ´ÙÀ½°ú °°ÀÌ restricted optionÀ» ÀÌ¿ëÇÕ´Ï´Ù. ¶ÇÇÑ restricted optionÀ¸·Î startupµÇ¹Ç·Î
DBA±ÇÇÑÀ» °®´Â user¸¸ÀÌ connectÇÏ¿© Oracle DB¸¦ ÀÌ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
$ sqldba lmode=y
SQL*DBA: Release 7.9.15.4.0 - Production on Thu Feb 9 23:39:59 1995
Copyright (c) Oracle Corporation 1979. 1992. All rights reserved.
ORACLE7 Server Release 7.0.15.4.0 - Production
With the procedural and distributed options
PL/SQL Release 2.0.17.1.0 - Production
SQLDBA>connect internal /*µ¥ÀÌŸº£À̽º¿¡ Á¢¼ÓÇÑ´Ù */
Connected.
SQLDBA>startup restrict /*µ¥ÀÌŸº£À̽º¸¦ ±âµ¿½ÃŲ´Ù */
ORACLE instance started.
Database mounted.
Database opened
Total System Global Area 3532184 bytes
Fixed Size 39136 bytes
Variable Size 2460856 bytes
Database Buffers 1024000 bytes
Redo Buffers 8192 bytes
SQLDBA>exit /* SQL*DBA¸¦ Á¾·áÇÑ´Ù */
3) µ¥ÀÌŸº£À̽ºÀÇ Á¤Áö
¡Ü ±â°è¸¦ ²ô°Å³ª, µ¥ÀÌŸº£À̽ºÀÇ ¹é¾÷À» ÇÏ´Â °æ¿ì ¸ÕÀú ¿À¶óŬÀ» Á¤Áö ½Ãŵ´Ï´Ù.
$ sqldba lmode=y
SQL*DBA: Release 7.0.16.4.0 - Production on Thu Fed 9 23:39:59 1995
Copyright (c) Oracle Corporation 1979, 1992. All rights reserved.
ORACLE7 Server Release 7.0.15.4.0-Production
With the procedural and distributed options
PL/SQL Release 2.0.17.1.0-Production
SQLDBA>connect internal /*µ¥ÀÌŸº£À̽º¿¡ Á¢¼ÓÇÑ´Ù */
Connected.
SQLDBA>shutdown /*µ¥ÀÌŸº£À̽º¿¡ Á¤Áö½ÃŲ´Ù*/
Database closed.
Database dismounted.
ORACLE instance shut down.
SQLDBA>exit
À§¿Í °°Àº È­¸éÀÌ ³ªÅ¸³ª¸é oracleÀº Á¤»óÀûÀ¸·Î shutdownµÈ °ÍÀÔ´Ï´Ù.
4) µ¥ÀÌŸº£À̽ºÀÇ °­Á¦ Á¾·á
¡Ü OracleÀ» »ç¿ëÇÏ´Â Áß¿¡ ¾î¶°ÇÑ ºñ»ó»óŸ¦ ¸Â°ÔµÇ¸é OracleÀ» °­Á¦·Î Á¾·áÇÒ ÇÊ¿ä°¡ ÀÖ½À´Ï´Ù.
¡Ü Á¤»óÀûÀ¸·Î OracleÀ» Á¾·áÇÏ·Á°í ÇÏ¸é ´Ù¸¥ user°¡ Oracle¿¡ connectÇÏ¿© »ç¿ëÁßÀ̸é ÀÌ user°¡ OracleÀ»
disconnectÇÒ ¶§±îÁö shutdownÀÌ µÇÁö ¾Ê½À´Ï´Ù.
Áï, »ç¿ëÇÏ´Â user°¡ ¸ðµÎ ºüÁ®³ª¿Í¾ßÁö¸¸ÀÌ OracleÀ» shutdownÇÒ ¼ö ÀÖ½À´Ï´Ù.
¡Ü ´Ù¸¥ user°¡ OracleÀ» »ç¿ëÁßÀÓ¿¡µµ ºÒ±¸ÇÏ°í OracleÀ» shutdownÇÏ°íÀÚ ÇÏ¸é ¾Æ·¡¿Í °°ÀÌ shutdown
immediate¸¦ ÀÌ¿ëÇÕ´Ï´Ù.
$ sqldba lmode=y
SQL*DBA: Release 7.0.15.4.0-Production on Thu Fed 9 23:39:59 1995
Copyright (c) Oracle Corporation 1979, 1992.All rights reserved.
ORACLE7 Server Release 7.0.15.4.0-Production
With the procedural and distributed options
PL/SQL Release 2.0.17.1.0-Production
SQLDBA>connect internal /*µ¥ÀÌŸº£À̽º¿¡ Á¢¼ÓÇÑ´Ù*/
Connected.
SQLDBA>shutdown immediate /*µ¥ÀÌŸº£À̽ºÀÇ °­Á¦ Á¾·á½ÃŲ´Ù*/
Database closed.
Database dismounted.
ORACLE instance shut down.
SQLDBA> exit
¡ß À§¿Í °°Àº È­¸éÀÌ ³ªÅ¸³ª¸é OracleÀº Á¤»óÀûÀ¸·Î shutdownµÈ °ÍÀÔ´Ï´Ù.
¡Ü À§ÀÇ shutdown immediate´Â commitµÇÁö ¾ÊÀº transactionÀ» rollbackÇÏ°í connectµÇ¾î ÀÖ´Â user¸¦
disconnectÇÏ´Â ÀÏÀ» ¼öÇà ÈÄ OracleÀ» shutdown½ÃÅ°°Ô µË´Ï´Ù.
¡Ü ¿À·§µ¿¾È commit µÇÁö ¾ÊÀº transactionÀÌ ÀÖ´Ù¸é shutdown immediate´Â shutdownÇϴµ¥ ¸¹Àº ½Ã°£ÀÌ °É¸®
±âµµ ÇÕ´Ï´Ù.
¡Ù À§ÀÇ shutdown immediate¸¦ ¼öÇàÀÌ ½Ã°£ÀÌ ¸¹ÀÌ °É¸®°Å³ª ºü¸¥ ½Ã°£ ³»¿¡ shutdownÀ» ÇÒ ÇÊ¿ä°¡ ÀÖ´Ù¸é,
À§ÀÇ shutdown immediate´ë½Å shutdown abort¸¦ ÇÕ´Ï´Ù.
´Ü, shutdown abort´Â commit µÇÁö ¾ÊÀº transactionÀ» rollbackÇÏÁö ¾Ê°í ¹Ù·Î instance(background process)
¸¦ Á¤Áö½ÃÅ°¹Ç·Î °¡´ÉÇÏ¸é »ç¿ëÇÏÁö ¾Ê´Â °ÍÀÌ ÁÁ½À´Ï´Ù.
2.2 SQL*NetÀÇ ±âµ¿ ¹× Á¤Áö¹æ¹ý
PC»óÀÇ ¿À¶óŬ ÇÁ·Î±×·¥À» ÅëÇØ µ¥ÀÌŸº£À̽º¸¦ ¾×¼¼½ºÇÏ·Á¸é SQL*NetÀ» ±âµ¿½ÃÄÑ¾ß ÇÕ´Ï´Ù.
1)SQL*NetÀÇ ±âµ¿¹æ¹ý
$ tcpctl start
tcpctl : log file is /extra2/eora/tcp/log/orasrv.log
tcpctl : SID mapping file is/etc/oratab
tcpctl : server will be run under eora
tcpctl : logging mode is on
orasrv: Release1.2.7.7.1 - Production on Fri Feb 10 09:41:18 1995
Copyright (c) Oracle Corporation 1979, 1992. All rights reserved.
Starting server on port 1525.
tcpct1 : server has been started
2)SQL*NetÀÇ ±âµ¿»óÅ ȮÀÎ
$ tcpctl status /*µ¥ÀÌŸº£À̽º¿¡ Á¢¼ÓÇÑ´Ù*/
tcput1 : Status summary follows /*±âµ¿µÈ »óÅ´Ù*/
Server os rimmomg :
Started : 10-FEB-95 09:41:19
Total connections : 0
Total rejections : 0
Active subprocesses : 0
ORACLE SIDs : ORAMIS, EORA, ORAY
Default SID : (null)
Logging mode is ENABLED.
DBA logins are DISABLED.
OPS$ logins are ENABLED.
OPS$ROOT logins are DISABLED
Orasrv is detached from the terminal.
Break mode = OUT OF BAND.
Debug level = 1
NO timeout (on orasrv handshaking).
Length of listem queue = 10
Orasrv logfile = /extra2/eora/tcp/log/orasrv.log
Orasrv mapfile = /etc/oratab
3) SQL*NetÀÇ Á¤Áö
$ tcpctl stop
tcputl: checking user permission...
tcputl: server has been stopped
3. Oracle »ç¿ëÀÚÀÇ °ü¸®¹æ¹ý
¢Ã Oracle »ç¿ëÀÚ¶õ OS¿¡¼­ login ÈÄ Oracle¿¡ µé¾îÀÖ´Â Á¤º¸¸¦ Àаųª ¼öÁ¤Çϱâ À§ÇØ ÀÌ¿ëÇÏ´Â user¸¦ ÀǹÌÇÕ
´Ï´Ù. ÀÌ´Â OracleÀÇ Á¤º¸¸¦ Àаųª ¼öÁ¤Çϱâ À§Çؼ­´Â ¸ÕÀú OracleÀ» ÀÌ¿ëÇÒ ¼ö ÀÖ´Â OS user id¿Í oracle
userid µÎ °¡Áö¸¦ ¾Ë¾Æ¾ß ÇÑ´Ù´Â °ÍÀ» ÀǹÌÇÕ´Ï´Ù.
3.1 »õ·Î¿î »ç¿ëÀÚÀÇ »ý¼º ¹× ±ÇÇÑ ºÎ¿©
1)»õ·Î¿î »ç¿ëÀÚ »ý¼º
¡Ü ¿À¶óŬ À¯Àú¸íÀ» scott1, Æнº¿öµå¸¦ tiger1À¸·Î »ç¿ëÀÚ¸¦ µî·ÏÇÒ °æ¿ì ´ÙÀ½°ú °°ÀÌ ÇÕ´Ï´Ù.

$ sqldba lmode=y
SQL*DBA: Release 7.0.15.4.0-Production on Thu Feb 9 23:39:59 1995
Copyright(c) Oracle Corporation 1979, 1992. All rights reserved.
ORACLE7 Server Release 7.0.15.4.0 - Production
With the procedural and distributed options
PL/SQL Release 2.0.17.1.0 - Production
SQLDBA>connect internal
Connected.
SQLDBA>
SQLDBA>create user scott1 identified by tiger1
2> default tablespace users
3> temporary tablespace temp;
4> QUOTA 100M ON USERS;
Statement processed.
SQLDBA>
¡Ü »õ·Î¿î user »ý¼º½Ã Á¤ÀÇÇÑ default tablespace´Â ¾ÕÀ¸·Î ÀÌ user°¡ ¸¸µå´Â tableÀº USERS ¶ó´Â tablespace¿¡
¸¸µé¾îÁö´Â °ÍÀ» ÀǹÌÇϸç, À̸¦ Á¤ÀÇÇÏÁö ¾ÊÀ¸¸é system tablespace¿¡ tableÀ» ¸¸µé°Ô µË´Ï´Ù.
¡Ü Temporary tablespace´Â ÀÌ user°¡ sortµîÀÌ ÀÛ¾÷½Ã ÀÌ¿ëµÇ´Â temporary ¿µ¿ªÀ¸·Î temp tablespace¸¦ ÀÌ¿ë
ÇÏ´Â °ÍÀ» ÀǹÌÇÕ´Ï´Ù.
¡Ü QUOTA¶ó´Â optionÀº scott1À̶ó´Â user°¡ USERS¶ó´Â tablespace¿¡ 100M¸¸ »ç¿ëÇ϶ó´Â °ÍÀ» ÀǹÌÇϸç, ÀÌ
optionÀ» »ç¿ëÇÏÁö ¾ÊÀ¸¸é ÀÌ user id·Î´Â tableÀ» ¾îµð¿¡¼­µµ ¸¸µé¼ö ¾ø°Ô µÇ¸ç, Á¦ÇÑ ¾øÀÌ »ç¿ëÇÏ°íÀÚ ÇÒ ¶§´Â
unlimited·Î ÇØÁÝ´Ï´Ù.
2)»õ·Î¿î »ç¿ëÀÚÀÇ ±ÇÇÑ ºÎ¿©
¡Ü »õ·Î »ý¼ºµÈ À¯Àú¿¡°Ô ±ÇÇÑÀ» ºÎ¿©ÇÏ¿©, µ¥ÀÌŸº£À̽º¿¡ ´ëÇÑ ÀÛ¾÷À» ÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù.
SQLDBA> grant connect, resource to scott1;
Statement processed.
SQLDBA>

¢º ¿©±â¿¡¼­ ºÎ¿©ÇÑconnect, resource¶ó´Â °ÍÀº ´ÙÀ½°ú °°Àº ±ÇÇÑÀ» °®°Ô µË´Ï´Ù.
connect : Alter session. Create cluster, Create database link,
Create session, Create synonym, Create table, Create view
¢º User¿¡¼­ ºÎ¿©ÇÒ ±ÇÇÑÀº À§¿¡¼­ ¼³¸íÇÑ connect ¿Ü¿¡µµ resource, DBAµîÀÌ ÀÖÀ¸¸ç À̿ܵµ ADMIN
ÀÌ ÇÊ¿äÇÑ ±ÇÇÑÀ» ¸¸µé¾î À̸¦ user¿¡°Ô ºÎ¿© ÇÒ ¼ö ÀÖ½À´Ï´Ù.
resource : Connect ±ÇÇÑ ¿Ü¿¡ Create procedure, Create trigger
1)¹ø Ç׸ñ¿¡¼­ »õ·Î¿î user»ý¼º½Ã ÁØ QUOTA optionÀ» ¹«Á¦ÇÑÀ¸·Î ÇÏ°í ½ÍÀº °æ¿ì Áï, »õ·Î¿î user°¡ ¾î¶²
tablespace¿¡³ª sizeÀÇ Á¦ÇÑ ¾øÀÌ tableÀ» ¸¸µé°íÀÚ ÇÏ´Â °æ¿ì¿¡´Â unlimited tablespace¶ó´Â ±ÇÇÑÀ» scott1¿¡°Ô ÁÖ
¾î¾ß ÇÕ´Ï´Ù.
SQLDBA>grant unlimited tablespace scott1;
3.2 ±âÁ¸»ç¿ëÀÚ°¡ °®°í ÀÖ´Â ±ÇÇÑÀÇ Á¦°Å
¢Ã ÀÏ¹Ý user¿¡°Ô ³Ê¹« ¸¹Àº ±ÇÇÑÀ» ºÎ¿©ÇÑ °æ¿ì¿¡´Â ±ÇÇÑÀ» »èÁ¦ÇÏ°Ô µË´Ï´Ù. À̶§ ±ÇÇÑÀ» »èÁ¦ÇÏ´Â °ÍÀ»
revoke¶ó´Â command¸¦ ÀÌ¿ëÇÕ´Ï´Ù.
¢Ã ¸¸¾à scott1¿¡°Ô connect, resource µÎ ±ÇÇÑÀÌ ÁÖ¾îÁ® ÀÖ´Ù¸é resource±ÇÇÑÀ» Á¦°ÅÇÏ´Â °ÍÀº ¾Æ·¡¿Í °°½À
´Ï´Ù.
SQLDBA> connect internal
connected
SQLDBA> revoke resource from scott1
statement processed
4. DatabaseÀÇ ±¸Á¶ ¹× ±âº» ÀÌ¿ë ¹æ¹ý

4.1 Database ±¸Á¶
4.1.1 DatabaseÀÇ ±âº»±¸Á¶
¡Ü data¸¦ ÀÔ·ÂÇϰųª ¼öÁ¤½Ã¿¡ Oracle¿¡¼­´Â ÀÌ dataµéÀ» ¾îµð¿¡ º¸°üÇÏ´Â °¡¶ó´Â °ÍÀº database¸¦ ÀÌÇØÇϴµ¥
¸Å¿ì Áß¿äÇÑ ¿ä¼ÒÀÔ´Ï´Ù.
¡Ü Oracle¿¡¼­´Â dataÀÇ ½Å±Ô ÀÔ·ÂÀ̳ª ¼öÁ¤½Ã data°¡ ÀúÀåµÇ´Â ÀúÀå °ø°£ÀÇ °¡Àå ÀÛÀº ´ÜÀ§´Â segmentÀ̸ç ÀÌ
segment°¡ Çϳª ÀÌ»ó ¸ð¿© ÇϳªÀÇ tablespace°¡ µÇ¸ç ¶ÇÇÑ Çϳª ÀÌ»óÀÇ tablespace°¡ ¸ð¿© database¸¦ ÀÌ·ç°Ô µË
´Ï´Ù.
Áï, À̸¦ ½±°Ô Ç®¾î¼­ ¼³¸íÇϸé Çϳª ÀÌ»óÀÇ ¹æÀÌ ¸ð¿© ÁýÀ» ÀÌ·ç°Ô µÇ°í ¿©·¯ °³ÀÇ ÁýÀÌ ¸ð¿© µ¿³×°¡ µÇ´Â °Í
À̶ó°í ÇÒ ¼ö ÀÖ½À´Ï´Ù.
¿©±â¿¡¼­ ¹æÀº segmentÀ̸ç ÁýÀº tablespace, µ¿³×´Â database¸¦ ÀǹÌÇÕ´Ï´Ù.
¢º À̸¦ »ó¼¼È÷ »ìÆ캸¸é ´ÙÀ½°ú °°½À´Ï´Ù.

1.Segment

segment¶ó´Â °ÍÀº À̸§À» °®°í ÀÖ´Â ÀúÀå °ø°£ÀÇ ÃÖ¼Ò ´ÜÀ§ÀÔ´Ï´Ù.
ÀϹÝÀûÀ¸·Î ÀúÈñµéÀÌ ºÎ¸£´Â table, index, rollbackÀº segmentÀÇ Á¾·áÀÔ´Ï´Ù.
¿©±â¿¡¼­ ¼³¸íÇÑ segment(table, index, rollback)´Â OS»óÀÇ file system¿¡¼­´Â ±× ½Çü¸¦ È®ÀÎÇÒ ¼ö´Â ¾ø°í,
Oracle ³»ºÎ¿¡¼­ °®°í ÀÖ´Â data dictionary¸¦ ÀÌ¿ëÇØ È®ÀÎ ÇÒ ¼ö ÀÖ½À´Ï´Ù.
2. Tablespace
¡á tablespace´Â segment°¡ µé¾îÀÖ´Â °ø°£À» ÁöĪÇÏ´Â °ÍÀÔ´Ï´Ù.
¡á tablespace´Â ³í¸®ÀûÀÎ °ø°£À¸·Î file system»ó¿¡ Á¸ÀçÇÏ´Â °ÍÀ¸·Î data fileµé·Î ±¸¼ºµË´Ï´Ù.
file system»ó¿¡ ¹°¸®ÀûÀÎ disk °ø°£ Áï, data fileÀ» È®º¸ÇÏ¿© ÀÌ °ø°£ ³»¿¡ Çϳª ÀÌ»óÀÇ segment¸¦ µÎ°ÔµÇ
´Â °ÍÀÔ´Ï´Ù.
¡á ¹°¸®ÀûÀÎ disk °ø°£ÀÎ data fileÀº Çϳª ÀÌ»óÀÌ ¸ð¿© tablespace¸¦ ÀÌ·ç°Ô µË´Ï´Ù.
Áï, tablespaceÇϳª°¡ ¿©·¯ °³ÀÇ data file·Î ±¸¼ºµÉ ¼ö ÀÖ´Ù´Â °ÍÀÔ´Ï´Ù.
(ex: TSPÀ̶ó´Â tablespace°¡ 10M size·Î '/Oracle/DB/tsp.dbt'¶ó´Â data file¸íÀ¸·Î Á¸Àç ÇÕ´Ï´Ù.
À̶§ user°¡ ¿©·¯ °³ÀÇ segment¸¦ ÀÌ tablespace¿¡ ¸¸µé¾î data¸¦ ÀúÀåÇÏ´Ù°¡ ÀÌ tablespace°¡ ºÎÁ·Çϸé error
°¡ ³³´Ï´Ù.
À̶§ tspÀ̶ó´Â tablespace¿¡ size°¡ 10MÀÎ '/Oracle/DB/tsp1.dbf'¶ó´Â data fileÀ» Ãß°¡ ÇÏ¿© »ç¿ëÇÒ ¼ö ÀÖ½À´Ï
´Ù.)
±×·¯¸é tsp¶ó´Â tablespace´Â '/Oracle/DB/tsp.dbf'¿Í /Oracle/DB/tsp.dbf' µÎ°³ÀÇ data file·Î ±¸¼ºµÇ°Ô µË´Ï
´Ù.
¡á Unix¿¡¼­´Â ÀϹÝÀûÀ¸·Î data fileÀÇ È®ÀåÀÚ´Â .dbf·Î ÇÕ´Ï´Ù.
3. Database
database´Â ¿©·¯ °³ÀÇ tablespace°¡ ¸ð¿© ÇϳªÀÇ DB¸¦ ÀÌ·ç°Ô µË´Ï´Ù.
À§¿¡ ¼³¸íÇÑ database ±¸Á¶¿¡¼­ tablespace¸¦ ÀÌ·ç´Â data file¸¸ ½ÇÁ¦¸¦ È®ÀÎ µÉ ¼ö ÀÖÀ¸¸ç ³ª¸ÓÁö´Â Oracle ³»
ºÎ¿¡¼­ °ü·ÃµÈ Á¤º¸¸¦ °®°í ÀÖ½À´Ï´Ù.

ÇϳªÀÇ database¸¦ ÀÌ·ç´Â tablespace°¡ ¸î °³À̸ç(Áï, tablespace´Â disk»ó¿¡ physical ÇÏ°Ô Á¸ÀçÇÏÁö¸¸,
database¿Í segment´Â logical ÇÏ°Ô Á¸ÀçÇÏ´Â °ÍÀÔ´Ï´Ù.) tablespace¸¦ ÀÌ·ç°í ÀÖ´Â data fileÀº ¾î¶² °ÍÀÌ Àִ°¡
¸¦ ¾Ë ¼ö ÀÖ´Â °ÍÀº Oracle ³»ºÎ¿¡´Â V$ datafileÀ» È®ÀÎÇÏ¿© º¸¸é µË´Ï´Ù.
SQL>select * from V$ datafile;
FILE# STATUS CHECKPOINT_CHANGE# BYTES NAME
1 SYSTEM 6134707 5242880 /extra2/eora/dbs/sysora714.dbf
2 ONLINE 6134707 4194304 /extra2/eora/dbs/rbs4ora714.dbf
3 ONLINE 6134707 563200 /extra2/eora/dbs/temp4ora714.dbf
FILE# STATUS CHECKPOINT_CHANGE# BYTES NAME
4 SYSTEM 6134707 15728640 /extra2/eora/dbs/tool4ora714.dbf
2 ONLINE 6134707 10485760 /extra2/eora/dbs/usr4ora714.dbf
3 ONLINE 6134707 5242880 /extra2/eora/dbs/jinf.dbf
6 rows selected.
4.1.2 Database¿¡ ÀÖ´Â ObjectÀÇ ÀÌÇØ
¡Ü Oracle database¿¡´Â ¿©·¯ °¡ÁöÀÇ object°¡ ÀÖÀ¸¸ç ÀÌÁß ´ëÇ¥ÀûÀÎ objectÀÎ table, view, synonym, index,
sequence¿¡ ´ëÇØ »ìÆ캾½Ã´Ù.
Å×À̺í(TABLE)
±âÁ¸ÀÇ ÆÄÀϽýºÅÛ¿¡¼­ Å×ÀÌŸ¸¦ ÀúÀåÇÏ´Â °÷Àº ÆÄÀÏÀÌÁö¸¸ µ¥ÀÌÅͺ£À̽º¿¡¼­´Â Å×À̺íÀ̶ó´Â µ¥ÀÌŸº£À̽º
±¸Á¶¿¡ µ¥ÀÌŸ¸¦ ÀúÀåÇÏ°Ô µË´Ï´Ù.
¸ðµç Å×À̺íÀº À̸§À¸·Î(¿¹,EMP) ±¸ºÐµÇ¸ç µ¥ÀÌŸ´Â Çà(row)À̳ª ¿­(column)´ÜÀ§·Î ÀúÀåµË´Ï´Ù.
ÇϳªÀÇ ¿­(column)Àº À̸§(¿¹,EMPNO, ENAME, JOB),µ¥ÀÌŸ ŸÀÔ(CHAR, NUMBER, DATE), ±æÀÌ·Î ±¸¼ºµÇ
¸ç ¿­(column)µéÀÇ ¸ðÀÓÀÌ ÇϳªÀÇ Çà(row)À» ±¸¼ºÇÕ´Ï´Ù.
µ¥ÀÌŸÀÇ Á¤È®¼ºÀ» º¸ÀåÇϱâ À§Çؼ­ Å×À̺íÀ» »ý¼ºÇÒ ¶§ °¢°¢ÀÇ ¿­(column)¿¡ Á¦¾à»çÇ×À» ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï
´Ù. ÆÄÀϽýºÅÛ¿¡¼­Ã³·³ NUMBER µ¥ÀÌŸ ŸÀÔ¿¡ CHARACTER ÇüÅÂÀÇ data°¡ µé¾î°¥ ¼ö ¾ø´Â°Í ÀÌ¿Ü¿¡µµ
NULL°ªÃ¼Å©,ÀÏÁ¤ÇÑ °ª¸¸ µé¾î°¡µµ·Ï ÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
/* EMP Å×À̺íÀÇ ¿¹ */
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7329 SMITH CLERK 7902 17-DEC-88 800.00 300.00 20
7499 ALLEN SALEMAN 7698 20-FEB-88 1.600.00 300.00 30
7521 WARD SALEMAN 7698 22-FEB-88 1.250.00 500.00 30
7521 JONES MANAGER 7839 02-APR-88 2.975.00 20
À妽º (INDEX)
Å×ÀÌºí³»ÀÇ µ¥ÀÌŸ¸¦ Á¶È¸ÇÏ°íÀÚ ÇÒ ¶§ ¼ÓµµÀÇ Çâ»óÀ» À§Çؼ­ Á¶°ÇÀ» ÁÖ°íÀÚ ÇÏ´Â ¿­À» ¼ø¼­ÀûÀ¸·Î Á¤·ÄÀ»
ÇÏ¿© ½Ç µ¥ÀÌŸ°¡ ÀÖ´Â °÷ÀÇ ÁÖ¼Ò¸¦ ¿¬°á½ÃÄÑ 鍽Àº µ¥ÀÌŸº£À̽º ±¸Á¶¸¦ À妽º¶ó°í ÇÕ´Ï´Ù. ´ë·®ÀÇ µ¥ÀÌŸ¿¡¼­
ÇϳªÀÇ ÇàÀ» ã°íÀÚ ÇÒ ¶§´Â ±²ÀåÈ÷ ºü¸¥ ¼Óµµ¸¦ º¸ÀåÇÏÁö¸¸ µ¥ÀÌŸ¸¦ Å×À̺í·Î »ðÀÔÀ» ÇÒ ¶§´Â µ¥ÀÌŸÀÇ »ðÀÔ
°ú µ¿½Ã¿¡ À妽º¸¦ ÀçÁ¤·Ä ÇؾßÇÕ´Ï´Ù.

ºä (VIEW)

ºä´Â ±âº»ÀÌ µÇ´Â table¾È¿¡ ÀúÀåµÇ¾î ÀÖ´Â data¸¦ ´ÙÀ½°ú °°Àº ÀÌÀ¯¿¡¼­ ¿­(column)ÀÇ À̸§, ¿­ÀÇ °¹¼ö, Çà
ÀÇ °¹¼ö ¶Ç´Â º¸´Â »ç¿ëÀÚ¿¡ µû¶ó¼­ ´Ù¸¥ ÇüÅ·Πº¸°Ô ÇϹǷΠ½ÇÁ¦·Î data¸¦ ÀúÀåÇÏ´Â ±¸Á¶´Â ¾Æ´Õ´Ï´Ù.

¡Ü ÇÊ¿äÇÑ Çà°ú ¿­¸¸À» »ç¿ëÀÚ¿¡°Ô º¸¿©ÁÖ°íÀÚ ÇÒ ¶§ (security)
¡Ü º¹ÀâÇÑ Á¶°ÇÀ» ¸Å¹ø ÁÖÁö ¾Ê°íÀÚ ÇÒ ¶§ (convenience)
¡Ü ¿­ÀÇ À̸§À» Å×ÀÌºí¿¡ ¿µÇâÀ» ÁÖÁö ¾Ê°í ¹Ù²Ù°íÀÚ ÇÒ ¶§ (perspective)
¡Ü ÃßÈÄ¿¡ Å×À̺íÀÇ ¿­ÀÌ Ãß°¡µÇ¾îµµ ÇÁ·Î±×·¥ º¯°æÀ» ÇÏÁö ¾Ê±â À§ÇØ
µ¿ÀǾî (SYNONYM)
Å×À̺íÀ» Æí¸®ÇÏ°Ô ´Ù¸¥ À̸§À¸·Î ÂüÁ¶¸¦ ÇÏ°íÀÚ ÇÒ ¶§ »ý¼ºÇÕ´Ï´Ù.
EMP¶ó´Â Å×À̺íÀ» "»ç¿ø"¶ó´Â À̸§À¸·Î µ¿ÀǾ ¸¸µé¾î¼­ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
½ÃÄö½º (SEQUENCE)
»ç¿øÀÇ ID, ºÎ¼­ÀÇ ¹øȣó·³ ¼øÂ÷ÀûÀ¸·Î Áõ°¡Çϰųª °¨¼ÒÇÏ´Â ¹øÈ£¸¦ ºÎ¿©Çϱâ À§ÇØ »ý¼ºÇÏ´Â µ¥ÀÌŸº£À̽º ±¸Á¶
ÀÔ´Ï´Ù.
¡Ü ¿©±â¿¡¼­ ¼³¸íÇÑ objectÁß tablespace³»¿¡ ¿µ¿ªÀ» Â÷ÁöÇÏ´Â table°ú index´Â segmentÀ̳ª view,
synonym, sequence´Â data¸¦ ÀúÀåÇÏ´Â °ÍÀÌ ¾Æ´Ñ object À̹ǷΠsegment°¡ ¾Æ´Õ´Ï´Ù.
4.2 µ¥ÀÌŸÀÇ °Ë»ö ¹× º¯°æ ¹æ¹ý
¢Ã µ¥ÀÌŸ¸¦ Á¶ÀÛÇÏ´Â ¸í·É¾î´Â SQL*Plus¶ó´Â TOOLÀ» ÀÌ¿ëÇؼ­ ÀÛ¾÷À» Çϸç SQL(Standard Query Language)
¾ð¾î¸¦ »ç¿ëÇÕ´Ï´Ù. SQL¾ð¾î´Â °¢°¢ÀÌ ÇϳªÀÇ ÇÁ·Î±×·¥¿¡ ÇØ´çÇÒ Á¤µµ·Î °­·ÂÇÑ ±â´ÉÀ» °¡Áö°í ÀÖ½À´Ï´Ù.
Å©°Ô 4°¡Áö Á¾·ù·Î ³ª´­ ¼ö ÀÖ½À´Ï´Ù.
±¸ÃàµÇ¾î ÀÖ´Â µ¥ÀÌŸÀÇ °Ë»ö - SELECT
µ¥ÀÌŸÀÇ »ðÀÔ, »èÁ¦, º¯°æ - INSERT, DELETE, UPDATE
µ¥ÀÌŸº£À̽º ±¸Á¶ Á¤ÀÇ, º¯°æ, »èÁ¦ - CREATE, DROP, ALTER
±ÇÇÑÀÇ À̾ç, öȸ - GRANT, REVOKE
1) sqlplusÀÇ ±âµ¿°ú Á¤Áö ¹× ±âº»Á¶ÀÛ ¹æ¹ý
¡Ü PC¿¡¼­ µ¥ÀÌŸº£À̽º°¡ ¼³Ä¡µÇ¾î ÀÖ´Â ÄÄÇ»ÅÍ(¼­¹ö)·Î loginÀ» ÇÕ´Ï´Ù.
(Á¦°øÇÏ´Â S/W µû¶ó¼­ ¸í·É¾î°¡ Â÷ÀÌ°¡ ÀÖÀ½ - »ý·«)
¡Ü ¼­¹ö ÄÄÇ»ÅÍÀÇ ÇÁ·ÒÇÁÆ® »ó¿¡¼­ ´ÙÀ½°ú °°ÀÌ ÀÔ·ÂÇÕ´Ï´Ù. ºÎ¿©¹ÞÀº »ç¿ëÀÚ¸í°ú Æнº¿öµå¸¦ °¢°¢ ÀÔ·ÂÇÕ´Ï´Ù.
$ sqlplus »ç¿ëÀÚ¸í/Æнº¿öµå
SQL*Plus : Release 3.1.3.2.1 - Production on Thu Feb 9 20:07:42 1995
Copyright (c) Oracle Corporation 1979, 1992. All rights reserved.
Connected to :
ORACLE7 Server Release 7.0.15.4.0 - Production
With the procedural and distributed options
PL/SQL Release 2.0.17.1.0 - Production
SQL> /*SQL ¸í·É¾î¸¦ ¼öÇàÇÒ ¼ö ÀÖ´Â »óÅ */
¡Ü sqlplusÀÇ Á¾·á
SQL>EXIT
¡Ü sqlplus¿¡¼­ ¸í·É¾îÀÇ ¹®¹ý ¹× Å×À̺íÀÇ ±¸Á¶¸¦ º¸´Â ¹æ¹ý
SQL>HELP /* SQL ¸í·É¾î¿¡ ´ëÇÑ µµ¿òÁ¤º¸¸¦ ÀÌ¿ëÇÏ´Â */
/* ¹æ¹ýÀ» º»´Ù */
¶Ç´Â
SQL> HELP SELECT /*SELECT ¸í·É¿¡ ´ëÇÑ µµ¿òÁ¤º¸¸¦ º»´Ù */
SQL>DESC emp /* EMP Å×À̺íÀÇ ±¸Á¶¸¦ º»´Ù. */
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
¡Ü Á¸ÀçÇÏ´Â Å×À̺íÀÇ À̸§À» º¸´Â ¹æ¹ý
SQL>SELECT *FROM tab;
TNAME TABTYPE CLUSTERID
BONUS TABLE
CUSTOMER TABLE
DEPT TABLE
EMP TABLE
ITEM TABLE
ORD TABLE
PRICE TABLE
SALGRADE TABLE
¡Ü µ¥ÀÌŸÀÇ Ãâ·ÂÀ» È­¸é°ú µ¿½Ã¿¡ È­ÀÏ·Î ¹Þ´Â ¹æ¹ý
SQL> SPOOL filename /*È­¸é Ãâ·ÂÀ» ±â·ÏÇÒ OS file */
SQL> SELECT * FORM tab;
SQL> spool off /*È­¸é Ãâ·ÂÀÇ file ±â·ÏÀ» ÁßÁö */
/* OS ¸í·É¾î·Î fileÀÇ ³»¿ëÀ» º»´Ù*/
¡Ü ¹Ù·Î Àü¿¡ ¼öÇàÇß´ø ¹®ÀÚ¸¦ Àç ¼öÇàÇÏ´Â ¹æ¹ý
SQL> / (¶Ç´Â RUN)
¡Ü ¹Ù·Î Àü¿¡ ¼öÇàÇß´ø ¹®ÀåÀ» È­ÀÏ¿¡ ÀúÀåÇÏ´Â ¹æ¹ý°ú È­Àϳ»ÀÇ ¹®ÀåÀ» ¹Ù·Î ¼öÇàÇÏ´Â ¹æ¹ý
SQL> SELECT*FROM tab;
TNAME TABTYPE CLUSTERID
BONUS TABLE
CUSTOMER TABLE
DEPT TABLE
SQL> save filename /* Àü¿¡ ¼öÇàÇÑ ¹®ÀåÀ» file¿¡ ÀúÀå*/
Created file filename
SQL> start filename /* file³»ÀÇ ¹®ÀåÀ» ¼öÇà */
TNAME TABTYPE CLUSTERID
BONUS TABLE
CUSTOMER TABLE
DEPT TABLE
2)µ¥ÀÌŸÀÇ °Ë»ö (SELECT)
¡Ü ¹®¹ý ) SELECT ¿­¸í, ¿­¸í,....
FROM Å×À̺í¸í,....
* WHERE Á¶°Ç
* ORDER Á¤·ÄÇÒ ¿­
/* * Ç¥½Ã´Â »ý·«°¡´ÉÇÑ ¹®±¸À̸ç ÇÑ ¹®ÀÚ´Â ¿©·¯ ÁÙ·Î ±¸ºÐµÇ¾î */
/* ÀÛ¼ºµÉ ¼ö ÀÖÀ¸¸ç ¹®ÀÚÀÇ ³¡Àº ";"·Î Ç¥½ÃÇÑ´Ù. */
¡Ü Å×À̺íÀÇ ¸ðµç µ¥ÀÌŸ Á¶È¸
SQL>DESC dept /*Á¶È¸ÇÒ Å×ÀÌºí±¸Á¶¸¦ ¹Ì¸® º»´Ù */
Name Null? Type
DEPTNO NUMBER(2)
DNAME VARCHAR2(14)
LOC VARCHAR2(13)
SQL>SELECT * FROM dep; /*Å×À̺í À̸§À» À߸ø ÁöÁ¤ÇÑ °æ¿ì */
select * from dep
*
ERROR at line 1:
OEA-00942 : table or view does not exist
SQL> SELECT * FROM dept; /*ÇÊ¿äÇÑ ¿­¸¸ º¸°í ½ÍÀ» ¶§ ´ë½Å ÀϸíÀ» »ç¿ëÇÑ´Ù ¿¹,deptno, dname, loc
*/
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL>SELECT dname, loc FROM dept /* ƯÁ¤ Çุ º¸°í ½ÍÀ» ¶§*/
2 WHERE deptno = 10;
DNAME LOC
ACCOUNTING NEW YORK
SQL>SELECT dname, loc FROM dept /*ƯÁ¤ ¿­·Î Á¤·ÄÀ» ÇÒ ¶§ */
2 ORDER BY dname ASC: /* ¿À¸§Â÷¼ø ASC */
/* ³»¸²Â÷¼ø DESC */
DNAME LOC
ACCOUNTING NEW YORK
OPERATIONS BOSTON
RESEARCH DALLAS
SALES CHICAGO.
3)µ¥ÀÌŸÀÇ º¯°æ
¡Ü ¹®¹ý ) UPDATEÅ×À̺í¸í
SET ¿­¸í = °ª, ¿­¸í = °ª,...
¡Ü WHERE Á¶°Ç
¡Ü Å×À̺íÀÇ ¸ðµç µ¥ÀÌŸ º¯°æ /*ÀýÀ» ÁÖÁö ¾ÊÀ¸¸é ¸ðµç ÇàÀ» º¯°æÇϹǷΠÁÖÀÇÇÑ´Ù*/
SQL>UPDATE dept SET dname = 'KT' ;
DEPTNO DNAME LOC
10 KT NEW YORK
20 KT DALLAS
30 KT CHICAGO
40 KT BOSTON
¡Ü Å×À̺íÀÇ Æ¯Á¤ µ¥ÀÌŸ º¯°æ
SQL> UPDATE dept SET dname = 'KT'
2 WHERE deptno = 10;
1 row updated.
SQL> SELECT * FROM dept;
DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
¡Ü Å×À̺íÀÇ µ¥ÀÌŸ º¯°æÀ» È®Á¤ÇÏ´Â ¹æ¹ý
SQL> commit;
¶Ç´Â
SQL> EXIT /* sqlplus¸¦ Á¾·áÇϸé ÀÚµ¿ commit µÈ´Ù. */
4)µ¥ÀÌŸÀÇ »èÁ¦
¹®¹ý ) DELETE FROM Å×À̺í
WHERE Á¶°Ç
Å×À̺íÀÇ ¸ðµç µ¥ÀÌŸ »èÁ¦ /* WHERE ÀýÀ» ÁÖÁö ¾ÊÀ¸¸é ¸ðµç ÇàÀ» »èÁ¦ÇϹǷΠÁÖÀÇÇÑ´Ù */
SQL> DELETE FROM dept;
4 rows deleted.
SQL>SELECT * FROM dept;
no rows selected
Å×À̺íÀÇ Æ¯Á¤ Çà »èÁ¦
SQL> DELETE FROM dept WHERE deptno = 10;
1 row deleted.
SQL> SELECT * FROM dept;
DEPTNO DNAME LOC
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
5)µ¥ÀÌŸÀÇ »ðÀÔ

¡Ü ¹®¹ý ) INSERT INTOÅ×À̺í
*(¿­¸ç, ¿­¸í, ...)
VALUES (¿­¸í, ¿­¸í, ...)
¡Ü Å×À̺íÀÇ ¸ðµç ¿­¿¡ °ªÀ» »ðÀÔÇÒ ¶§
SQL> INSERT INTO dept
2 VALUES (50, 'ORACLE', 'YOIDO');
1 row inserted.
SQL> SELECT * FROM dept;

DEPTNO DNAME LOC
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 ORACLE YOIDO
5 rows selected.
¡Ü Å×À̺íÀÇ Æ¯Á¤ ¿­¿¡ °ªÀ» »ðÀÔÇÒ ¶§
SQL> INSERT INTO dept
2 (deptno, dname) values
3 ('KT' , 'KOREA');
1 row deleted.
SQL> SELECT * FROM dept;
DEPTNO DNAME LOC
10 ACCOUNTING n
20 RESEARCH n
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 ORACLE YOIDO
KT KOREA
6 rows selected.
5. ÀÚÁÖ ÀÌ¿ëÇÏ´Â Data Dictionary Á¤º¸
¢Ã Oracle¿¡ °ü·ÃµÈ user, table, tablespaceµî ¸¹Àº Á¤º¸µéÀÌ data dictionary¿¡ º¸°ü µÇ¾î ÀÖ½À´Ï´Ù.
¢Ã Oracle database¸¦ °ü¸®ÇÏ´Â »ç¶÷Àº(DBA)ÀÌ·¯ÇÑ Á¤º¸¸¦ Àß È°¿ëÇÒ ÁÙ ¾Ë¾Æ¾ß È¿À²ÀûÀÎ database¸¦ ¿î¿µÇÒ ¼ö
ÀÖ½À´Ï´Ù.
¢Ã ÀÌ·¯ÇÑ Á¤º¸µéÀº OracleÀÇ data dictionary¸¦ Á¶È¸ÇÒ ¼ö ÀÖ´Â view¸¦ ÀÌ¿ëÇÏ¿© Á¶È¸ÇÏ°Ô µË´Ï´Ù.
ÀϹÝÀûÀ¸·Î DB °ü¸®ÀÚ°¡ ÀÌ¿ëÇÏ´Â data dictionary°ü·Ã view´Â DBA·Î ½ÃÀÛÇÕ´Ï´Ù.
¢Ã ¶ÇÇÑ DBA·Î ½ÃÀ۵Ǵ view¸¦ »ç¿ëÇϱâ À§Çؼ­´Â Oracle¿¡ connect½Ã DBA privilege¸¦ °®°í ÀÖ´Â user¿©¾ß
ÇÕ´Ï´Ù.
connect or resourceÀÇ ±ÇÇѸ¸À» °®°í ÀÖ´Â user´Â DBA·Î ½ÃÀ۵Ǵ view¸¦ ÀÌ¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.
5.1 User º¸À¯ÇöȲ
SQL> select username, default_tablespace, temporary_tablespace 2* from dba_users;
USERNAME DEFAULT_TABLESP TEMPORARY_TABLESPACE
SYS SYSTEM TEMP
SYSTEM TOOLS TEMP
SCOTT USERS TEMP
ORA USERS TEMP
JIN JINTB TEMP
STJ USERS SYSTEM

6 rows selected.

¡Ü À§ÀÇ DEFAULT_TABLESPACE¿Í TEMPORARY_TABLESPACE´Â create user½Ã Á¤ÀÇÇØ ÁØ tablespace
ÀÌ¸ç ¸¸¾à Á¤ÀÇÇÏÁö ¾ÊÀ¸¸é default_tablespace¿Í temporary_tablespace´Â system tablespace°¡ defaultÀÔ´Ï´Ù.
¡Ü À̸¦ ÅëÇؼ­ ÇöÀç Oracle¿¡ µî·ÏµÇ¾î ÀÖ´Â user¿¡ °üÇÑ Á¤º¸¸¦ ¾òÀ» ¼ö ÀÖ½À´Ï´Ù.
5.2 Userº° Object º¸À¯ÇöȲ
SQL> select object_name, object_type from dba_objects where
owner = 'SCOTT'
OBJECT_NAME OBJECT_TYP
EBONUS TABLE
DEPT TABLE
DUMMY TABLE
EMP TABLE
EMPDESG SYNONYM
IAPXTB TABLE
SALGRADE TABLE
SQL_TXT TABLE
SQL_TXT_IDX1 INDEX
TEST1 TABLE
TEST10_ID INDEX
TEST11 TABLE
DESG.WORLD DATABASE LINK
13 rows selected.
¡Ü userº°·Î °®°í ÀÖ´Â object (table, index ..) °ü·ÃÁ¤º¸¸¦ º¸´Â °ÍÀ¸·Î, ¾î¶² user°¡ ¾î¶² object¸¦ °®°í ÀÖ´Â
°¡´Â ¸Å¿ì Áß¿äÇÕ´Ï´Ù.
¡Ü object°ü·Ã Á¤º¸´Â dba_object¶ó´Â view¸¦ ÀÌ¿ëÇϸç ÇÊ¿ä½Ã¿¡´Â ƯÁ¤ owner ¶Ç´Â ƯÁ¤ object¿¡ °ü·ÃµÈ Á¤
º¸¸¦ ÃßÃâÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
ÀÌ´Â À§¿¡ ÀÖ´Â SQL¹®À» È°¿ëÇÔÀ¸·Î 󸮰¡ °¡´ÉÇÕ´Ï´Ù.
5.3 DatabaseÀÇ Datafile º¸À¯ÇöȲ
SQL> select file_name, tablespace_name, bytes from dba_data_files
FILE_NAME TABLESPACE_NAME BYTES
/extra2/eora/dbs/syseora.dbf SYSTEM 5242880
/extra2/eora/dbs/rbseora.dbf RBS 4194304
/extra2/eora/dbs/tempeora.dbf TEMP 5763200
/extra2/eora/dbs/tooleora.dbf TOOLS 15728640
/extra2/eora/dbs/usreora.dbf USERS 1048576-A
/extra2/eora/dbs/usr1eora.dbf USERS 1572640-A
¡Ü À§¿¡¼­´Â datafileÀÇ physicalÇÑ path¿Í datafile¸íÀÌ ÀÖÀ¸¸ç datafile¿¡ ¿¬°èµÈ tablespace¸í°ú datafileÀÇ
size¿¡ °üÇÑ Á¤º¸¸¦ Á¦°øÇÕ´Ï´Ù.
¡Ü À§¿¡¼­ A·Î markµÈ users¶ó´Â tablespace´Â µÎ°³ÀÇ datafileÀÌ ¸ð¿© ÇϳªÀÇ tablespace¸¦ ÀÌ·ç´Â °æ¿ì¸¦ ÀÇ
¹ÌÇÕ´Ï´Ù.
Áï, users¶ó´Â tablespace´Â "/extra2/eora/dbs/usreora.dbf" ¿Í "/extra2/eora/dbs/usr1eora.dbf" µÎ°³ÀÇ file·Î
±¸¼ºµÇ¾úÀ½À» ¾Ë·ÁÁÝ´Ï´Ù.
5.4 Tablespace º° ¿©À¯°ø°£ÀÇ ·®
SQL> select tablespace_name, sum(bytes), max(bytes) from dba_free_space
2 group by tablespace_name;
TABLESPACE_NAME SUM(BYTES) MAX(BYTES)
JINTB 1021952 1021952
RBS 3127296 3127296
SYSTEM 1650688 1650688
TEMP 561152 561152
TOOLS 13719552 13719552
USERS 933888 933888
6 rows selected.
¡Ü ÇöÀç »ç¿ëÁßÀÎ °¢ tablespaceÀÇ ¿©À¯°ø°£(freespace)ÀÌ ¾î´À Á¤µµ ÀÖ´ÂÁö¸¦ ¾Æ´Â °ÍÀº ¸Å¿ì Áß¿äÇÕ´Ï´Ù.
¡Ü ´Ù·®ÀÇ data°¡ insert µÉ °æ¿ì tablespace¿¡ ÃæºÐÇÑ ¿©À¯°ø°£ÀÌ ¾ø´Ù¸é ÀÛ¾÷ Áß error°¡ ¹ß»ýÇÏ°Ô µË´Ï´Ù. ¸¸
¾à, ¿©À¯°ø°£ÀÌ ÃæºÐÇÑÁö ¾Ê´Ù´Â Á¤º¸¸¦ ¾Ë°í ÀÖ´Ù¸é ´Ù·®ÀÇ insertÀÛ¾÷ Àü¿¡ tablespaceÀÇ ¿©À¯°ø°£À» ¹Ì¸® È®º¸
ÇÏ¿© ÀÛ¾÷ÇÔÀ¸·Î½á ½Ã°£°ú ³ë·ÂÀ» ÁÙ¿© º¸´Ù È¿°úÀûÀÎ DB ¿î¿µÀÌ °¡´ÉÇϱ⠶§¹®ÀÔ´Ï´Ù.
¡Ü À§¿¡¼­ Á¶È¸ÇÑ freespaceÀÇ ÇÕ(sum)Àº ÇϳªÀÇtablespace³»¿¡ ºÐ»êµÇ¾î ÀÖ´Â ¿©À¯°ø°£À» ¸ðµÎ ÇÕÇÑ °ªÀ̸ç
°¡Àå Å« °ª(max)Àº ºÐ»êµÇ¾î ÀÖ´Â ¿©À¯°ø°£ Áß °¡Àå Å«°ø°£ÀÇ size¸¦ ÀǹÌÇÕ´Ï´Ù.
==> ÀÌ¿Ü¿¡µµ DB°ü¸®ÀÚ¿¡°Ô À¯¿ëÇÑ data dictionaryÁ¤º¸¸¦ ¸¹ÀÌ ÀÖÀ¸¸ç ÇÊ¿ä½Ã¿¡ ¾î¶² view¸¦ ÀÌ¿ëÇØ Á¶È¸¸¦
Çϸç, ÇÊ¿äÇÑ Á¤º¸¸¦ ÃßÃâÇÏ°í À̸¦ ÅëÇÑ DBÀÇ À¯Áö °ü¸® ´É·ÂÀ» Å°¿ö ³ª°¡´Â °ÍÀº ¸Å¿ì Áß¿äÇÕ´Ï´Ù.
6. Backup
¢Ã Database¸¦ ÀÌ¿ë½Ã ¾î¶² ¹æ¹ýÀ¸·Î data¸¦ ÀúÀåÇÏ°í ¼öÁ¤ÇÒ °ÍÀΰ¡¶ó´Â °ÍÀº ¹«Ã´ Áß¿äÇÕ´Ï´Ù.
¶ÇÇÑ, ÀúÀåµÇ¾î ÀÖ´Â data¸¦ ¾î¶»°Ô À¯Áö, º¸°üÇÏ¿©¾ß ÇÒ °ÍÀΰ¡µµ ¸Å¿ì Áß¿äÇÕ´Ï´Ù.
¢Ã ÀúÀåµÇ¾î ÀÖ´Â dataÀÇ º¸°üÇÏ´Â ¹æ¹ýÀ» backupÀ̶ó Çϸç ÀÌ´Â DB °ü¸®ÀÚ(DBA)°¡ ´ã´çÇØ¾ß ÇÒ Áß¿äÇÑ ¿ªÇÒ
ÀÔ´Ï´Ù.
¢Ã ¿©±â¿¡¼­´Â Oracle¿¡¼­ Á¦°øÇÏ´Â 3°¡ÁöÀÇ backupÀ» ¼Ò°³ÇÕ´Ï´Ù.

6.1 OS ¸í·É¾î¿¡ ÀÇÇÑ Backup
¿À¶óŬ °ü·Ã fileµéÀ» OS ¸í·É¾î¸¦ ÀÌ¿ëÇؼ­ tape³ª º°µµÀÇ OS µð·ºÅ丮¿¡ º¹»çÇÕ´Ï´Ù.
6.1.1 Oracle °ü·Ã file
¿À¶óŬ µ¥ÀÌŸº£À̽º¸¦ ±¸¼ºÇÏ´Â file¿¡´Â ´ÙÀ½°ú °°Àº °ÍµéÀÌ ÀÖ½À´Ï´Ù.
data file »ç¿ëÀÚ¿Í ½Ã½ºÅÛ Á¤º¸¸¦ ÀúÀåÇÏ´Â file
redo log file Á¤º¸¿¡ ´ëÇÑ º¯°æ history¸¦ ÀúÀåÇÏ´Â file
control file µ¥ÀÌŸº£À̽º file ¸ñ·Ï ¹× ¿î¿µÁ¤º¸¸¦ ÀúÀåÇÏ´Â file
parameter file µ¥ÀÌŸº£À̽º ¿î¿µº¯¼ö °ªµéÀ» ÀúÀåÇÏ´Â file
ÇöÀç »ý¼ºµÇ¾î ÀÖ´Â ¿À¶óŬ fileµéÀº ´ÙÀ½°ú °°ÀÌ È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.
(ÀÏ´Ü ¹®Á¦°¡ ¹ß»ýÇÑ °æ¿ì È®ÀÎÇÏÁö ¸øÇÒ ¼ö ÀÖÀ¸¹Ç·Î Æò¼Ò¿¡ È®ÀÎÇÒ ÇÊ¿ä°¡ ÀÖÀ¸¸ç, Á¤ÇØÁø µð·ºÅ丮¿¡¸¸
fileÀ» »ý¼º, À¯ÁöÇÏ¸é °ü¸®ÇϱⰡ ½±½À´Ï´Ù.)

data file
SQLDBA> select file_name
2> from dba_data_files;
FILE_NAME
-----------------------------------------------------
/rdbms/Oracle7/dbs/systORA7.dbf
/rdbms/Oracle7/dbs/rbsORA7.dbf
/rdbms/Oracle7/dbs/temORA7.dbf
/rdbms/Oracle7/dbs/usrORA7.dbf
/rdbms/userDB/INSADB.dbf ---------A
control file
SQLDBA> select value
2> from v$parameter
3> where name = 'control_files';
VALUE
-----------------------------------------------------
/rdbms/Oracle7/dbs/ctrl10RA7.ct1
/rdbms/Oracle7/dbs/ctrl20RA7.ct1
/rdbms/Oracle7/dbs/ctrl10RA7.ct1
1 rows selected.
parameter file
/rdbms/Oracle7/dbs/initORA7.ora
.1.2 Backup ÀýÂ÷
¡Ü 6.1.1¿¡¼­ È®ÀÎµÈ fileµéÀ» ´ÙÀ½°ú °°ÀÌ backupÇÕ´Ï´Ù.
SQLDBA> connect internal
Connected.
SQLDBA> shutdown normal /*¿À¶óŬÀ» Á¤Áö½ÃŲ´Ù. */
Database closed.
Database dismounted.
ORACLE instance shutdown
SQLDBA> host /*OS·Î Àá½Ã ºüÁ® ³ª°£´Ù. */
$tar -cvf /dev/rmt/0mextra2/eora/dbs/* /*tape¿¡ 6.1.1¿¡¼­ È®ÀÎ */
/extra2/userDB/INSADB.dbf /* µÈ fileÀ» ¸ðµÎ ¹Þ´Â´Ù.*/
A´Â ´Ù¸¥ directory¿¡ ÀÖÀ¸¹Ç·Î µû·Î Á¤ÀÇÇØ ÁÖ¾î¾ß ÇÑ´Ù.
$exit /* SQLDBA·Î µ¹¾Æ°£´Ù */
SQLDBA> startup
ORACLE instance started.
Database mounted.
Database opened.
Total System Global Area 1913196 bytes
Fixed Size 27764 bytes
Variable Size 1787128 bytes
Database Buffers 65536 bytes
Redo Buffers 32768 bytes
cf. º°µµÀÇ tar ¸í·ÉÀ¸·Î °¢°¢ÀÇ fileÀ» ÇϳªÀÇ tape¿¡ ¹Þ´Â °æ¿ì device À̸§(¿¹¸¦ µé¾î /dev/rmt/0 OS¸¶´Ù
´Ù¸£´Ù.)Àº norewind device¸¦ ÁöÁ¤ÇÕ´Ï´Ù.
¡Ü À§ÀÇ tar ¸í·É ´ë½Å¿¡ ´ÙÀ½°ú °°ÀÌ ÇÏ¿© º°µµÀÇ OS µð·ºÅ丮¿¡ º¹»çÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
$cp /rdbms/Oracle7/*.dbf <backup directory>
* OS ¸í·É¿¡ ÀÇÇÑ backupÀº ¹Ýµå½Ã OracleÀ» shut down ÈÄ ½Ç½ÃÇÏ¿©¾ß Çϸç Oracle home directory¹Ø¿¡ ÀÖ
´Â dbs directory ¸ðµÎ¿Í user°¡ ¸¸µç Oracle data fileÀ» ¸ðµÎ backupÇÏ¿©¾ß ÇÕ´Ï´Ù.
6.2 Oracle Utility¿¡ ÀÇÇÑ Backup

6.2.1 EXP¿¡ ÀÇÇÑ BACKUP
EXP À¯Æ¿¸®Æ¼·Î µ¥ÀÌŸº£À̽º³»ÀÇ ¸ðµç Á¤º¸¸¦ OS file·Î ¹Þ½À´Ï´Ù.

SQLDBA> connect internal
SQLDBA> startup
ORACLE instance started.
Database mounted.
Database opened.
Total System Global Area 1913196 bytes
Fixed Size 27764 bytes
Variable Size 1787128 bytes
Database Buffers 65536 bytes
Redo Buffers 32768 bytes
SQLDBA> host
$exp system/manager file=exp950224.dat full=y grants=y
/* DBÁ¤º¸¸¦ */
/* exp950224.dat */
/* file·Î ¹Þ´Â´Ù. */
Connected to : ORACLE7 Server Release 7.0.15.4.0 - Production
With the procedural and distributed options
PL/SQL Release 2.0.17.1.0 - Production
About to export the entire database ..
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. exporting stored procedures
About to export SYSTEM's tables ...
.exporting table PRODUCT_ACCESS 0 rows exported
.exporting table PRODUCT_PROFILE 0 rows exported
.exporting table SRW_CMD_NAMES 77 rows exported
.exporting table USER_PROFILE 0 rows exported
.......
About to export SCOTT's tables...
.exporting table BONUS 0 rows exported
.exporting table CUSTOMER 9 rows exported
.exporting table DEPT 4 rows exported
.exporting table DUMMY 1 rows exported
.exporting table EMP 5 rows exported
.exporting table IAPXTB 1 rows exported
.exporting table IMAGE 15 rows exported
.exporting table ITEM 64 rows exported
.exporting table ORD 21 rows exported
.exporting table PLAN_TABLE 2 rows exported
.exporting table PRICE 17 rows exported
.exporting table SALGRADE 5 rows exported
About to export JSCHOI's tables ...
.exporing table ATTEND_CHK4335 rows exported
.exporting table CLASS35 4rows exported
.exporting table CLASSROOM 8 rows exported
.exporting table COMPANY 1416 rows exported
.exporting table COUPON 6576 rows exported
.exporting table COURSE_MANUAL 46 rows exported
.exporting table DEPT 16 rows exported
......
Export terminated successfully without warning.
¡Ü export¸¦ ÀÌ¿ëÇÑ backupÀ» À§Çؼ­ ¼³¸íÇÑ Oracle databaseÀÇ ¸ðµç Á¤º¸¸¦ backup ¹Þ´Â °Í¿Ü¿¡µµ userº°·Î
backup¹Þ´Â °Í°ú ƯÁ¤ table¸¸ backupÀ» ¹Þ´Â ¹æ¹ýµµ ÀÖ½À´Ï´Ù.
(ÂüÁ¶ Oracle Utilities Guide Chapter 1,2 ÂüÁ¶)
¡Ü EXP¸¦ ÀÌ¿ëÇÑ backupÀº OS ¸í·É¾î¸¦ ÀÌ¿ëÇÏ´Â °æ¿ì¿Í´Â ´Þ¸® ¹Ýµå½Ã OracleÀÌ startupµÇ¾î ÀÖ´Â »óÅÂ
¿¡¼­ ÀÛ¾÷ÇÏ¿©¾ß ÇÕ´Ï´Ù.
6.3 Archive log¿¡ ÀÇÇÑ Backup
OS backupÀ̳ª EXP¿¡ ÀÇÇÑ backupÀ» ¹ÞÀº °æ¿ì¿¡ º¹±¸´Â backup¹ÞÀº ½ÃÁ¡À¸·Î¹Û¿¡ º¹±¸ÇÒ ¼ö ¾ø½À´Ï´Ù.
ÃÖ±Ù¿¡ Á¤º¸±îÁö À¯½ÇµÇÁö ¾ÊÀº »óÅ·Πº¹±¸ÇÏ·Á¸é ÁÖ±âÀûÀÎ OS backup°ú ÇÔ²² archive log¸ðµå·Î µ¥ÀÌŸº£ÀÌ
½º¸¦ ¿î¿µÇÏ¸é µË´Ï´Ù.
6.3.1 Archive log ¿î¿µ¹æ¹ý
1)parameter file (/$ Oracle_home/dbs/initORA7.ora)¿¡ ´ÙÀ½À» Ãß°¡ Á¤ÀÇÇÕ´Ï´Ù.
log_archive_start=true
log_archive_dest=/$ Oracle_home/archive/log
log_archive_format=%s.arc
cf. ÀÌ °æ¿ì ÀÏÁ¤·®ÀÇ Á¤º¸°¡ ½×À̸é /$ Oracle_home/archive (ÇöÀç Á¸ÀçÇÏ´Â ÀÓÀÇÀÇ µð·ºÅ丮·Î °¡¿ëÇÑ ¿µ¿ª
ÀÌ ÀÖÀ¸¸é µË´Ï´Ù.)
µð·ºÅ丮 ¹Ø¿¡ log_001.arc, log_002.arc, ...°°Àº archive log file »ý¼ºµÇ°Ô µË´Ï´Ù.
2)¿À¶óŬ µ¥ÀÌŸº£À̽º¸¦ archive log mode·Î º¯°æ ÈÄ ±âµ¿ÇÕ´Ï´Ù.
(±âµ¿Çϱâ Àü¿¡ ÇöÀç »óÅÂÀÇ ¿À¶óŬ fileµéÀ» 3.3.3°ú °°ÀÌ OS»ó¿¡¼­ backup ¹Þ½À´Ï´Ù.)
SQLDBA> shutdown
Connected
SQLDBA> startup mount
ORACLE instance started
Database mounted.
SQLDBA> alter database archivelog;
Statement processed.
SQLDBA> alter database open
statement processed.
3)ÇöÀç ÀÌ¹Ì parameter file¿¡ 1¹øÀÇ ³»¿ëÀÌ ÁöÁ¤µÇ¾î ÀÖ°í ´ÙÀ½ ¸í·ÉÀÇ °á°ú°¡ º¸À̸é archive log¸ðµå°¡ ±â
¿î¿µÁßÀÎ »óÅÂÀÔ´Ï´Ù.
SQLDBA> select log_mode
from V$database;
LOG_MODE
_________________
ARCHIVELOG
archive log mode·Î ¿î¿µ½Ã log_archive_dest µð·ºÅ丮 ¹Ø¿¡ archive fileÀº °è¼ÓÇؼ­ °¹¼ö°¡ Áõ°¡ÇϹǷΠÁÖ±â
ÀûÀ¸·Î backup¹Þ°í OS»ó¿¡¼­ »èÁ¦ÇÒ ÇÊ¿ä°¡ ÀÖ½À´Ï´Ù.
¸¸¾à fileÀÌ °è¼Ó ½×¿©¼­ disk»ó¿¡ ¿µ¿ªÀ» ¸ðµÎ »ç¿ëÇÑ °æ¿ì ¿À¶óŬÀÌ ´õ ÀÌ»ó °¡µ¿µÉ ¼ö ¾ø´Â »óűîÁö ¹ß»ý
ÇÒ ¼ö ÀÖ½À´Ï´Ù.
4) µû¶ó¼­ ÁÖ±âÀûÀÎ OS backupÀ» ÇÏ¿© º¸°üÇؾßÇÒ archive fileÀÇ ¼ö¸¦ ÁÙÀÌ´Â °ÍÀÌ ¹Ù¶÷Á÷Çϸç ÀÌ´Â ¶ÇÇÑ º¹
±¸¸¦ ÇÊ¿ä·Î ÇÏ´Â °æ¿ì¿¡ º¹±¸ ½Ã°£À» ´ÜÃàÇÒ ¼ö ÀÖ½À´Ï´Ù.

SQLDBA> shutdown
Database closed.
Database dismounted.
Oracle instance shut down.
SQLDBA> host
/*¿À¶óŬ °ü·Ã fileµéÀ» OS»ó¿¡¼­ backup ¹Þ´Â´Ù(3.1.1Àý ÂüÁ¶). */
/*backupÀÌ ³¡³ª¸é ÇöÀç log_archive_dest µð·ºÅ丮 ¹Ø¿¡ Á¸ÀçÇÏ´Â archive */
/*fileÀº ¸ðµÎ »èÁ¦ °¡´ÉÇÏ´Ù. */
$exit
SQLDBA> STARTUP
ORACLE instance started.
Database mounted.
Database opened.
Total System Global Area 913196 bytes
Fixed Size 27764 bytes
Variable Size 1787128 bytes
Database Buffers 65536 bytes
Redo Buffers 32768 bytes
*" Archive fileÀÌ »ó¿¡´Â Directory¸¦ ÁÖ±âÀûÀ¸·Î BackupÀ» ÇÏ¸ç ±× DirectoryÀÇ file systemÀÌ full µÇÁö ¾Ê°Ô
ÇÏ´Â °ÍÀÌ Áß¿äÇÕ´Ï´Ù."
7. Oracle Error ºÐ¼® ¹× Á¶Ä¡¹æ¹ý

¢Ã ¿î¿µ ȯ°æ ³»¿¡¼­ Á¢ÇÒ ¼ö ÀÖ´Â ¿©·¯ °¡ÁöÀÇ ¿¡·¯µéÀº Å©°Ô3°¡Áö·Î º¼ ¼ö ÀÖ½À´Ï´Ù. ù ¹ø°´Â ¿î¿µ½Ã½ºÅÛ
(O. S), µÎ ¹ø°´Â °³¹ßÅø(Powerbuilder..), ¸¶Áö¸·À¸·Î ¿À¶óŬ¿¡¼­ ¹ß»ýµÇ´Â ¿¡·¯ÀÔ´Ï´Ù.
¿À¶óŬÀº ÀÚüÀÇ ¿¡·¯»Ó¸¸ ¾Æ´Ï¶ó ¿î¿µ ½Ã½ºÅÛÀÌ ¹ß»ý½ÃŲ ¿¡·¯µéµµ »ç¿ëÀÚ¿¡°Ô Á¦°øÇÕ´Ï´Ù.
¿ì¼± »ç¿ëÀÚ´Â ÀÌ·¯ÇÑ °ÍÀ» ±¸ºÐÇÒ ¼ö ÀÖ¾î¾ß ÇÕ´Ï´Ù. ¿À¶óŬ¿¡¼­ ¹ß»ýµÉ ¼ö ÀÖ´Â ¿¡·¯µéÀ» µÎ °¡Áö ¿¹¸¦ µé¾î
¼­ ±â¼úÇÏ¸é ´ÙÀ½°ú °°½À´Ï´Ù.
7.1 OracleÀ» »ì¸± ¶§(startup) ¹ß»ýÇÏ´Â Error (ORA-1157)
¢Ã¿ì¼± ¿À¶óŬÀÇ STARTUP ´Ü°è¸¦ »ìÆ캸¸é

¢º ù ¹ø° ´Ü°è·Î instance¸¦ start½ÃÅ°¸ç, ¿©±â¼­´Â init ORACLE_SID.oraÈ­ÀÏÀÇ ÆĶó¹ÌÅ͸¦ ÂüÁ¶ÇÏ¿©
SGA(SYSTEM GLOBAL AREA)¸¦ ÇÒ´çÇÏ°í ¹é±×¶ó¿îµå ÇÁ·Î¼¼¼­¸¦ start ½Ãŵ´Ï´Ù.
¢º µÎ ¹ø° ´Ü°è·Î database mountÀ̸ç ÆĶó¹ÌÅÍ È­ÀÏ¿¡ ¸í½ÃµÈ control fileÀ» ¿ÀÇ ÇÕ´Ï´Ù.
control file·ÎºÎÅÍ database name°ú redo log fileÀÇ À̸§À» ÀнÀ´Ï´Ù.
¢º ¸¶Áö¸· ¼¼ ¹ø° ´Ü°è·Î control file³»ÀÇ Á¤º¸¸¦ ÀÌ¿ëÇÏ¿© ¸ðµç data fileÀ» ¿ÀÇ ÇÕ´Ï´Ù.
SQLDBA> CONNECT INTERNAL;
Connected.
ORACLE instance started.
Database mounted.
Database opened.
Total System Global Area 1913196 bytes
Fixed Size 27764 bytes
Variable Size 1787128 bytes
Database Buffers 65536 bytes
Redo Buffers 32768 bytes
¡Ü ÀÌ»ó°ú °°ÀÌ Á¤»óÀûÀÎ startupÀ» À§Çؼ± ¿î¿µ ½Ã½ºÅÛ ³»¿¡ Á¸ÀçÇÏ´Â control file°ú data fileÀÇ Á¤º¸°¡ ¸Â¾Æ
¾ß ÇÕ´Ï´Ù.
±×·±µ¥ ´©±º°¡°¡ data fileÀ» »èÁ¦ÇßÀ» ¶§.
startup½Ã data fileÀÌ control fileÁ¤º¸¿¡¼­´Â Á¸ÀçÇÏÁö¸¸ ½ÇÁ¦·Î O/S»ó¿¡¼­´Â Á¸ÀçÇÏÁö ¾ÊÀ¸¹Ç·Î database
open ´Ü°è¿¡¼­ »èÁ¦µÈ data fileÀ» openÇÒ ¼ö ¾øÀÌ ´ÙÀ½°ú °°Àº µ¥ÀÌŸ È­ÀÏ ¿ÀÇ¿¡ °ü·ÃµÈ ¿¡·¯°¡ ¹ß»ýµË´Ï´Ù.
SQLDBA> STARTUP;
ORACLE instance started.
Database mounted.
ORA-01157 : cannot identify data file 11 - file not found
ORA-01110 ; data file 11 : '/rdbms/oracle7/dbs/user2.dbf'
Attempting to dismount database .... Database dismounted
Attempting to shutdown instance .... ORACLE instance shut down
¡Ü database open ´Ü°è¿¡¼­ control fileÀº ORA-01157¿¡·¯¿¡¼­ ³ªÅ¸³­ 11¹ø µ¥ÀÌŸ È­ÀÏÀÌ Á¸ÀçÇÏ´Â °ÍÀ¸·Î ÀÎ
½ÄÇÏÁö¸¸ ½ÇÁ¦·Î O/S»óÀÇ µ¥ÀÌŸ È­ÀÏ(user2.dbf)ÀÌ »èÁ¦µÈ »óÅÂÀÔ´Ï´Ù.
¡Ü ÀÌ·¯ÇÑ °æ¿ì¿¡´Â µÎ °¡Áö Á¶Ä¡°¡ °¡´ÉÇÕ´Ï´Ù.
ù°,database startup½Ã startup mount ´Ü°è±îÁö ½ÇÇàÇÑ ÈÄ, ¹®Á¦ÀÇ µ¥ÀÌŸ È­ÀÏÀ» offline ½ÃŲ ´ÙÀ½
database¸¦ ¿ÀÇ ÇÕ´Ï´Ù.
´Ü,database°¡ Á¤»óÀûÀ¸·Î ¿ÀÇ µÇ¾îµµ ¹®Á¦°¡ ¹ß»ýÇÑ µ¥ÀÌŸ È­ÀÏÀ» Æ÷ÇÔÇÏ°í ÀÖ´Â tablespace¸¦ dropÇÏÁö
¾ÊÀ» °æ¿ì¿¡´Â database startup½Ã µ¥ÀÌŸ È­ÀÏÀÇ ¿ÀÇ ´Ü°è¿¡¼­ ¿¡·¯°¡ ¹ß»ýµÉ ¼ö ÀÖ½À´Ï´Ù.
¡á µ¥ÀÌŸ È­ÀÏÀÇ offline°útablespaceÀÇ drop¿¡ °ü·ÃµÈ ¸í·ÉÀº ´ÙÀ½°ú °°½À´Ï´Ù.
sqldba¸¦ command line mode·Î °¡µ¿½Ãŵ´Ï´Ù.
(1) SQLDBA> CONNECT INTERNAL;
Connected.
(2) SQLDBA> STARTUP MOUNT;
ORACLE instance started.
(3) SQLDBA> ALTER DATABASE
DATAFILE '/user1/oracle7/dbs/user2.dbf'
OFFLINE DROP;
Statement processed.
(4)SQLDBA>ALTER DATABASE OPEN;
Statement processed.
(5)SQLDBA> DROP TABLESPACE tablespace_name INCLUDING CONTENS;
Statement processed.

(4)¹ø ´Ü°è¿¡¼­ Á¤»óÀûÀ¸·Î database°¡ ¿ÀÇÂµÈ ÈÄ control file·ÎºÎÅÍÀÇ µ¥ÀÌŸº£À̽º Á¤º¸¸¦ °®´Â data
dictionary tableÀÎ V$DATAFILEÀÇ ³»¿ë°ú µ¥ÀÌŸº£À̽º È­ÀÏ¿¡ °üÇÑ Á¤º¸¸¦ °¡Áö°í ÀÖ´Âdata dictionary view
ÀÎ DBA_DATA_FILESÀ» Á¶È¸ÇÏ¸é ¾Æ·¡¿Í °°Àº ³»¿ëÀ» È®ÀÎ ÇÒ ¼ö ÀÖ½À´Ï´Ù.

SQL>SELECT*FROM V$DATAFILE;
FILE# STATUS NAME
------- ----------- ---------------------
9 ONLINE /user1/Oracle7/dbs/tools.dbf
10 ONLINE /user1/Oracle7/dbs/user1.dbf
11 RECOVER /user1/Oracle7/dbs/user2.dbf
SQL> SELECT * FROM DBA_DATA_FILES;
FILE_NAME FILE_ID TABLESPACE_NAME STATUS
--------------------- ------- ------------------- -------
/rdbms/Oracle7/dbs/tools.dbf 9 TOOLS AVAILABLE
/rdbms/Oracle7/dbs/user1.db 10 TEST AVAILABLE
/rdbms/Oracle7/dbs/user2.dbf 11 TEST AVAILABLE
ÀÌ»ó°ú °°ÀÌ control file°ú data fileµîÀº ¸Å¿ì Á¶½É½º·´°Ô °ü¸®ÇÏ°í ¼ö½Ã·Î ¹é¾÷À» ¹Þ¾ÆµÎ´Â °ÍÀÌ ÃÖ¼±ÀÇ ¹æÃ¥
ÀÔ´Ï´Ù.
7.2 OracleÀ» »ç¿ë Áß ¹ß»ýÇÏ´Â Error
(ORA-1034, ORA-1574, ORA-1562)
1)ORACLE¿¡ Á¢¼Ó(connect)ÇÏ°íÀÚ ÇÒ ¶§ ORA-01034 error°¡ ¹ß»ý
¿À¶óŬÀÌ startupµÇÁö ¾ÊÀº »óÅ¿¡¼­ »ç¿ëÀ» ½ÃµµÇßÀ»¶§
$sqlplus scott/tiger
SQL*Plus : Release 3.1.3.2.1 - Production on Thu Feb 9 23:50:57 1995
Copyright (c) Oracle Corporation 11979,1992.All rights reserved.
ERROR : ORA-01034 : ORACLE not available
ORA-07429 : smsgsg : shmget( ) failed to get segment
88open UNIX Error : 2 : No such file or directory
Enter user-name:
À§¿Í °°Àº ¿¡·¯°¡ ¹ß»ýµË´Ï´Ù.
ÀÌ·¯ÇÑ °æ¿ì¿¡´Â DBA°¡ OracleÀ» startup ½ÃÅ°¸é µË´Ï´Ù.
2) ORA001547 error°¡ ¹ß»ý
µ¥ÀÌŸ ÀÔ·Â µîÀÇ ÀÛ¾÷½Ã ORA-01547 ¿¡·¯°¡ ¹ß»ýµÇ´Â °æ¿ì ORA-01547
(Failed to allocate extent of sizes% in tablespace 'name')ÀÇ ¿øÀÎÀº tables pace°¡ ¿¡·¯¿¡ ¸í½ÃµÈ Oracle
block ¼ö¸¸Å­ÀÇ ¿äûµÈ extent¸¦ ÇÒ´çÇÒ ÃæºÐÇÑ free space¸¦ °®°í ÀÖÁö ¸øÇÑ °æ¿ì¿¡ ¹ß»ýµË´Ï´Ù.
ÇöÀçÀÇ extent°¡ ½ÇÁ¦ µ¥ÀÌŸ È­ÀÏ¿¡ Á¸ÀçÇÏ´Â free space Áß¿¡¼­ ÇÒ´ç °¡´ÉÇÑ ¿¬¼ÓÀûÀÎ Oracle blockÀ» ¿ä±¸ÇÏ
±â ¶§¹®ÀÔ´Ï´Ù.
¼¼ºÎÀûÀ¸·Î´Â ´ÙÀ½°ú °°Àº »çÇ×ÀÌ ¹ß»ýµÉ ¶§ ÀϾ´Ï´Ù.
¡á µ¥ÀÌŸ insert³ª update½Ã data segment°¡ Â÷ÁöÇÏ°Ô µÉ ¿¬¼ÓÀûÀÎ Oracle ºí·°À» ÇÒ´ç¹ÞÁö ¸øÇÒ °æ¿ì¿¡ ¹ß»ý
ÇÕ´Ï´Ù.
¡á À妽º¸¦ »ý¼ºÇÒ °æ¿ì¿¡ ¹ß»ýÇÕ´Ï´Ù.

¡á rollback segment°¡ »ç¿ëÇÒ rollback segment ¶Ç´Â user tablespaceÀÇ ¿µ¿ªÀÌ ºÎÁ·ÇÏ¿© ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù.
¡á À妽º »ý¼º½Ã sort¿µ¿ªÀ¸·Î »ç¿ëµÇ´Â temporary tablespace³»ÀÇ spaceºÎÁ·À¸·Î ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù.
¡ÜÀÌ·¯ÇÑ °æ¿ì extent¿¡ °ü·ÃµÈ data dictionary viewÀÎ USER_TABLES, USER_EXTENTS,
USER_SEGMENTS¿Í DBA_FREE_SPACEµîÀ» Á¶È¸Çؼ­ °ü·Ã³»¿ëÀ» È®ÀÎÇØ¾ß ÇÕ´Ï´Ù.
3)ORA-1562<failed to extend rollback segment(id=%)>errorÀÇ Á¶Ä¡¹æ¹ý
¡Ü ORA-1562 error´Â dataÀÇ Ã³¸®(¼öÁ¤, ÀÔ·Â, »èÁ¦)½Ã before image¸¦ ´ë·®ÀÇ data¸¦ ÀÏ°ýó¸®(Batch) ÇüÅ·Î
ÀÛ¾÷½Ã ¸¹Àº ·®ÀÇ before image data°¡ rollback segment¿¡ ÀúÀåµÇ¹Ç·Î rollback segmentÀÇ max extent°ª¿¡ µµ
´ÞµÇ¾î ´õ ÀÌ»óÀÇ extent¸¦ ¹ß»ý½ÃÅ°Áö ¸øÇϹǷΠ¹ß»ýµÈ errorÀÔ´Ï´Ù.
(ÀϹÝÀûÀ¸·Î max extent´Â 121 ÀÔ´Ï´Ù.)
¡Ü ÇØ°á¹æ¹ý;
(1) "set transaction use rollback segment seg-id" ¸¦ ÀÌ¿ëÇÏ´Â ¹æ¹ý
¸ÕÀú ÇöÀç »ç¿ëÁßÀÎ rollback segmentÀÇ »óŸ¦ ¾Æ·¡¿Í °°ÀÌ ÆľÇÇÕ´Ï´Ù.
SQLDBA> select* from DBA-rollback-segs;
segment_name segment_id
¡Ü À§ÀÇ Á¤º¸·Î º¸¾Æ Àû´çÇÑ sizeÀÇ rollback segment°¡ ÀÖ´Ù¸é "set transaction use rollbacksegment
segment_name;"¸¦ ¸ÕÀú ¼öÇàÇÑ ÈÄ ´ë·®ÀÇ ÀÏ°ýó¸® ÀÛ¾÷ À» ´Ù½Ã ¼öÇàÇÕ´Ï´Ù.
(import Áß ora-1562 error°¡ ¹ß»ýÇÏ¿´´Ù¸é import¸¦ command line ¹ß»ýÀ¸·Î ¼öÇàÇϸç À̶§ commit=y
optionÀ» ÁÖµµ·Ï ÇÕ´Ï´Ù.)
(2) »õ·Î¿î Rollback SegmentÀÇ »ý¼º
¡Ü (1)¿¡¼­ »ìÆ캻 ÇöÀçÀÇ rollback segment Áß ´ë·®ÀÇ ÀÛ¾÷À» ¼öÇàÇÒ rollback segment°¡ ¾ø´Ù¸é »õ·Î¿î
rollback segment¸¦ ¸¸µé¾î¼­ À̸¦ ÀÌ¿ëÇÕ´Ï´Ù.
¡Ü »õ·Î¿î rollback segment¸¦ create ÇÒ ¶§´Â rollback segmentÀÇ initial size¿Í next size¸¦ ÃæºÐÈ÷ ÁÖµµ·Ï ÇÕ
´Ï´Ù. ¶ÇÇÑ »õ·Î¿î rollback segment´Â È®ÀåÀÌ °¡´ÉÇϵµ·Ï ÃæºÐÇÑ ¿©À¯ °ø°£À» °®°í ÀÖ´Â °÷¿¡ ¸¸µé¾î ÁÖ¾î¾ß
ÇÕ´Ï´Ù.
ex)
SQLDBA> create rollback segment RO5 storage (initial 1M next 1M)
¡Ü À§¿Í °°ÀÌ »õ·Î¿î rollback segment¸¦ »ý¼ºÇÑ ÈÄ À̸¦ onlineÈ­ÇÏ¿© 'set transaction use rollback segment
r05 '¸¦ ÀÌ¿ëÇÕ´Ï´Ù.
¡Ü »õ·Î ¸¸µé¾îÁø rollback segment¸¦ onlineÈ­ÇÏ´Â ¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù.
initOracle_sid.ora file¿¡¼­ rollback segment parameter¿¡ »õ·Î ¸¸µç rollback segment ÀÇ À̸§À» µî·ÏÇÏ°í
shutdownÈÄ ´Ù½Ã startupÇÏ¸é »õ·Î ¸¸µé¾îÁø rollback segment°¡ onlineÈ­µË´Ï´Ù.


°ü·Ã±Û : ¾øÀ½ ±Û¾´½Ã°£ : 2006/03/19 11:08 from 61.82.164.84

  oracle8i_°èÁ¤»ý¼º, ±ÇÇÑ Áֱ⠸ñ·Ïº¸±â »õ±Û ¾²±â Áö¿ì±â ÀÀ´ä±Û ¾²±â ±Û ¼öÁ¤ backup controfile º¹±¸ ½Ã³ª¸®¿À  
BACKRUSH  À¯´Ð½º¸í·É  ´ÙÀ½  ÀÚ·á½Ç  Ascii Table   ¿ø°ÝÁ¢¼Ó  ´Þ·Â,½Ã°£   ÇÁ·Î¼¼½º   ½©
ÁöÇÏö³ë¼±   RFC¹®¼­   SUN FAQ   SUN FAQ1   C¸Þ´º¾ó   PHP¸Þ´º¾ó   ³Ê±¸¸®   ¾Æ½ºÅ°¿ùµå ¾ÆÀÌÇǼ­Ä¡