SID¿Í DBNAME ¹Ù²Ù±â
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2008-01-10 13:26:14
 

SID¿Í DBNAME ¹Ù²Ù±â


=====================
SID ¹× DBNAME º¯°æ(1)
=====================

7.3 ÀÌ»ó DBNAMEÀ» º¯°æÇÏ´Â ¹æ¹ýÀ» Á¤¸®ÇÑ°ÍÀ̸ç ORA7¿¡¼­ OLA7À¸·Î º¯°æÇÏ´Â °æ¿ì¸¦ °¡Á¤ÇÔ

1. Spool datafiles, redo-log files, control files

svrmgr> spool datafile.lst
svrmgr> select * from dba_data_files;
svrmgr> select * from v$logfile;
svrmgr> select * from v$controlfile;
svrmgr> spool off

2. Shutdown database normal

3. Backup database

¸ðµç control files, log files, datafiles¸¦ backupÇÑ´Ù.

4. Moving datafiles and redo-log files

svrmgr> startup mount

¸ðµç datafile°ú redo-log fileµé Áß,  ORACLE_SIDºÎºÐÀ» º¯°æÇÏ°íÀÚ ÇÏ´Â file¿¡ ´ëÇÏ¿©, mv ¶Ç´Â cp¸¦ ½ÇÇàÇÑ´Ù. Áï,

mkdir /home1/oradata/OLA7
mv /home1/oradata/ORA7/redoORA701.log  /home1/oradata/OLA7/redoOLA701.log

¿Í °°ÀÌ OS»ó¿¡¼­ º¯°æÇÑ ÈÄ ¾Æ·¡¿Í °°ÀÌ DB»ó¿¡¼­ º¯°æÀ» ¹Ý¿µ½ÃÅ°¸é µÈ´Ù.

svrmgr> alter database rename file ¡®¡¯
                                to ¡®¡¯;

svrmgr> alter database open;

5. Backup controlfile

svrmgr> alter database backup controlfile to trace;

±×·¯¸é, configORA7.ora¿¡ ÀÖ´Â user_dump_dest¿¡ ÁöÁ¤µÈ directory¿¡ ora_27264.trc¿Í °°Àº À̸§À¸·Î fileÀÌ »ý¼ºµÈ´Ù.

6. Shutdown database normal

7. initORA7.ora¸¦ initOLA7.ora·Î copyÇÑ´Ù.
mkdir /home1/app/oracle/admin/OLA7/pfile

cp /home1/app/oracle/admin/ORA7/pfile/initORA7.ora
  /home1/app/oracle/admin/OLA7/pfile/initOLA7.ora

ln -s /home1/app/oracle/admin/OLA7/pfile/initOLA7.ora
  /home1/app/oracle/product/7.3.2/dbs/initOLA7.ora

8. initOLA7.ora¸¦ ÆíÁýÇÑ´Ù.

ifile = /home1/app/oracle/admin/ORA7/pfile/configORA7.ora¸¦
ifile = /home1/app/oracle/admin/OLA7/pfile/configOLA7.ora·Î °íÄ¡°í,

mts_service= ORA7À» mts_service = OLA7À¸·Î °íÄ£´Ù.

±× ¿Ü¿¡ SID¸¦ »ç¿ëÇÏ´Â °÷ÀÌ ÀÖÀ¸¸é, memo¸¦ ÇسõÀº ÈÄ º¯°æÇÑ´Ù.

9. configORA7.ora¸¦ configOLA7.ora·Î copyÇÑ´Ù.

cp /home1/app/oracle/admin/ORA7/pfile/configORA7.ora
  /home1/app/oracle/admin/OLA7/pfile/configOLA7.ora

ln -s /home1/app/oracle/admin/OLA7/pfile/configOLA7.ora
  /home1/app/oracle/product/7.3.2/dbs/configOLA7.ora

10. configOLA7.ora¸¦ ÆíÁýÇÑ´Ù.

dbname = ORA7À» dbname = OLA7À¸·Î °íÄ£´Ù.

control_files ¿Í dump_destÀÇ pathÁß ORA7À¸·Î µÇ¾îÀÖ´Â ºÎºÐÀ» OLA7À¸·Î °íÄ£´Ù.


=====================
SID ¹× DBNAME º¯°æ(2)
=====================

11. ÇØ´ç dump destination directory¸¦ createÇÑ´Ù.

mkdir /home1/app/oracle/admin/OLA7/bdump
mkdir /home1/app/oracle/admin/OLA7/udump
mkdir /home1/app/oracle/admin/OLA7/cdump
mkdir /home1/app/oracle/admin/OLA7/create


12. ȯ°æ º¯¼ö º¯°æ (.profileÀ» ÆíÁý, ½ÇÇà)

ORACLE_SID=ORA7 ---> ORACLE_SID=OLA7
$ . ./.profile

13. controlfile »ý¼º script¸¦ ÆíÁý (¹×ÁÙÄ£ ºÎºÐÀÌ Ãß°¡Çϰųª º¯°æÇÑ ºÎºÐÀÓ)

STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "OLA7" RESETLOGS NOARCHIVELOG
  MAXLOGFILES 32
  MAXLOGMEMBERS 2
  MAXDATAFILES 30
  MAXINSTANCES 8
  MAXLOGHISTORY 800
LOGFILE
GROUP 1 '/home1/ora732/oradata/OLA7/redoOLA701.log'  SIZE 500K,
GROUP 2 '/home1/ora732/oradata/OLA7/redoOLA702.log'  SIZE 500K,
GROUP 3 '/home1/ora732/oradata/OLA7/redoOLA703.log'  SIZE 500K
DATAFILE
'/home1/ora732/oradata/OLA7/syst01OLA7.dbf',
'/home1/ora732/oradata/OLA7/rbs01OLA7.dbf',
'/home1/ora732/oradata/OLA7/temp01OLA7.dbf',
'/home1/ora732/oradata/OLA7/tools01.dbf',
'/home1/ora732/oradata/OLA7/user01OLA7.dbf',
'/home1/ora732/oradata/OLA7/syst02OLA7.dbf',
'/home1/ora732/oradata/OLA7/syst03OLA7.dbf',
'/home1/ora732/app/oracle/product/7.3.2/dbs/HFS.dbf',
'/home1/ora732/app/oracle/product/7.3.2/dbs/HFS2.dbf'
;
# Recovery is required if any of the datafiles are restored backups,
# or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
# Database can now be opened normally.
ALTER DATABASE OPEN RESETLOGS;

14. svrmgrl¿¡¼­ connect internalÇÑ ÈÄ À§ÀÇ script¸¦ ½ÇÇà

¸¸ÀÏ »õ·Î¿î control fileµéÀÌ ÀÌÀü °Í°ú °°Àº directory¿¡ ÀÖ´Ù¸é, renameÀ» ÇÑ ÈÄ
script¸¦ ½ÇÇàÇϵµ·Ï ÇÑ´Ù.

15. Recovery¸¦ ½Ç½ÃÇÑ ÈÄ openÇÑ´Ù.

À§ script°¡ µ¹¸é¼­ control file»ý¼º ÈÄ recovery°¡ ¼öÇàµÉ ¶§,
Specify log: [ for suggested | AUTO | FROM logsource | CANCEL ]
¶ó´Â message°¡ ³ª¿À¸é,
CANCLE
À» ÀÔ·ÂÇÑ´Ù.

16. ³ª¸ÓÁö fileµé¿¡¼­ ORACLE_SID¸¦ º¯°æ

$ORACLE_HOME/network/admin/listener.oraÀÇ SID¸¦ OLA7À¸·Î °íÄ£´Ù.
listener.ora¿¡ USE_CKPFILE_LISTENER=TRUE·Î µÇ¾îÀÖ´Â °æ¿ì´Â listener¸¦ ³»¸°
»óÅ¿¡¼­ listener.ckp¸¦ ÆíÁýÇÏ¿© SID¸¦ ORA7¿¡¼­ OLA7À¸·Î ¹Ù²Ù¾îÁØ ÈÄ ´Ù½Ã ±¸µ¿ÇÏ¸é µÈ´Ù.

$ORACLE_HOME/network/admin/tnsnames.oraÀÇ SID¸¦ OLA7À¸·Î °íÄ£´Ù.
3 tiersÀÎ °æ¿ì´Â tp userÀÇ ORACLE_SID¸¦ ¼öÁ¤ÇÑ´Ù.
2 tiersÀÎ °æ¿ì´Â clientÀÇ tnsnames.ora¿¡¼­ ORACLE_SID¸¦ ¼öÁ¤ÇÑ´Ù.
¿©·¯ ¼­¹ö¸¦ dblink·Î ¿¬°áÇÑ °æ¿ì °¢°¢ÀÇ tnsnames.ora¸¦ ¸ðµÎ ¼öÁ¤ÇÑ´Ù.

17. ½Ã½ºÅÛÀÌ Á¤»óÀûÀ¸·Î ¿î¿µµÇ´ÂÁö È®ÀÎÇÑ ÈÄ ºÒÇÊ¿äÇÑ directory/fileµéÀ» »èÁ¦ÇÑ´Ù.


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦