<¼³Ä¡ ¼º°ø>Oracle 9.x ¿¡¼­ InterMedia Text ¿É¼Ç ¼³Á¤
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2003-08-21 12:20:36
 

target=_blank>http://www.jspmaster.com/servlet/JMBoard?tablename=lecture_jsp

°ü·Ã¼­Àû: ½Ç½À¿¹Á¦¸¦ ÅëÇÑ Intermedia Text Admin

¾Æ·¡ÀÇ ÀÚ·á´Â Çѱ¹ Oracle¿¡¼­ ¹ÞÀº°ÍÀ» Åä´ë·Î º»ÀÎÀÌ ¼öÁ¤ º¸¿ÏÇÑ°Í ÀÔ´Ï´Ù. º»ÀÎÀÇ °æ¿ì¿¡´Â ¾Æ·¡ÀÇ InterMedia Text¸¦ À§ÇØ º°µµ·Î TableSpace¸¦ ¼³Ä¡ÇÏ¿´½À´Ï´Ù.(Oracle9.2.0.1¿¡¼­ Á¤»óÀûÀ¸·Î ¼öÇàµÈ °á°úÀÓ)

InterMedia Text´Â Oracle9iÀÇ Universal Installer¿¡ ÀÇÇØ ÀÚµ¿À¸·Î ¼³Ä¡µÇ±â´Â ÇÏÁö¸¸ ¿©·¯ °¡Áö ÀÌÀ¯·Î ManualÇÏ°Ô ´Ù½Ã ¼³Ä¡ÇÒ ¼ö ÀÖ´Ù. Installer¿¡ ÀÇÇØ ÀÚµ¿À¸·Î ¼³Ä¡µÈ °æ¿ì¿¡, InterMedia Text¸¦ °ü¸®ÇÏ´Â À¯ÀúÀÎ ctxsys user´Â default·Î system tablespace·Î »ý¼ºµÇ´Â µ¥, manualÇÑ ¼³Ä¡ °úÁ¤À» ÅëÇؼ­ ´Ù¸¥ tablespace¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.

InterMedia Text´Â Oracle9iÀÇ External Procedure±â´ÉÀ» ÀÌ¿ëÇÏ¿© µ¥ÀÌÅͺ£À̽º Ä¿³Î°ú Á¢¸ñµÇ¾ú´Ù. ±×·¡¼­ InterMedia Text¸¦ Àß ½ÇÇàÇϱâ À§Çؼ­´Â Net8 configurationÀ» ¼³Á¤ÇØ¾ß ÇÑ´Ù.

* InterMedia Text ÃʱâÈ­ ¹æ¹ý

1. ±âÁ¸ÀÇ ctxsys user¸¦ dropÇÑ´Ù.
$ cd $ORACLE_HOME/ctx/admin
$ sqlplus ctxsys/ctxsys @dr0drop.sql
$ sqlplus sys/sys_password @dr0dsys.sql

2. »õ·Î ctxsys user¸¦ »ý¼ºÇÑ´Ù.
Oracle8i ÀÌÀü¿¡´Â °ü¸®ÀÚ À¯Àú¸¦ ctxsys ¿Ü¿¡ À¯Àú°¡ ¿øÇÏ´Â À̸§À¸·Î »ý¼ºÀÌ °¡´ÉÇßÁö¸¸, Oracle8iºÎÅÍ´Â ctxsys user·Î¸¸ °¡´ÉÇÏ´Ù. ÀÌ script µÚ¿¡ ¿À´Â ù¹ø° ÀÔ·Â °ªÀº ctxsys userÀÇ passwordÀÌ°í, µÎ¹ø°´Â ctxsys userÀÇ default tablespace, ¼¼¹ø°´Â temporary tablespaceÀÌ´Ù. ctxsys userÀÇ default tablespaceÀÇ Å©±â´Â ¿øÈ°ÇÑ ¼öÇàÀ» À§ÇØ ¾à 30MÀÌ»óÀ» ±ÇÀåÇÑ´Ù.

$ sqlplus sys/sys_password @dr0csys.sql ctxsys context temp

3. Default object »ý¼º
º»ÀÎÀÇ °æ¿ì¿¡´Â Windows2000ÀÇ °æ¿ì°¡ ÇØ´ç µÇ¾ú½¿.
[pre]
* on HP

HPÀÇ °æ¿ì libctxx8.so °¡ ¾Æ´Ï°í libctxx8.sl ·Î ÁöÁ¤ÇØ¾ß ÇÑ´Ù.

* on NT

sqlplus ¸¦ ctxsys user·Î Á¢¼ÓÇÑ ÈÄ ´ÙÀ½°ú °°ÀÌ ½ÇÇàÇÑ´Ù.

@dr0inst.sql oracle_home\\bin\\oractxx8.dll --> Àý´ë°æ·Î·Î ±â¼ú

* ±×¿Ü

$ sqlplus ctxsys/ctxsys @dr0inst.sql

/opt/oracle/product/9.2.0/ctx/lib/libctxx9.so
-------------------------------------------------
À§¿Í °°ÀÌ $ORACLE_HOME/ctx/lib/libctxx9.so¿¡ ÇØ´çÇÏ´Â Àý´ë path¸¦
ÁöÁ¤ÇØ¾ß ÇÑ´Ù.

$ sqlplus ctxsys/ctxsys @defaults/drdefko.sql

drdefko.sql fileÀº default·Î ÇÑ±Û lexer¸¦ »ý¼ºÇϱâ À§Çؼ­ ½ÇÇàÇÑ´Ù.


* Net*8 ¼³Á¤¹æ¹ý
º»ÀÎÀÇ °æ¿ì óÀ½¿¡´Â Oracle ¿µ¹® ManualÀ» º¸°í ÇÏ¿´À¸³ª
¹®Á¦°¡ ÀÖ¾úÀ¸¸ç,,,
Net8 ¼³Á¤ÀÇ °æ¿ì¿£ ¾Æ·¡ÀÇ°Í´ë·Î µû¶ó Çϴ°ÍÀÌ ÁÁÀ»µí ½Í½À´Ï´Ù.


InterMedia Text¸¦ »ç¿ëÇϱâ À§Çؼ­´Â Net8ÀÌ ¼³Á¤µÇ¾î ÀÖ¾î¾ß Çϸç,
À̸¦ À§Çؼ­ listener.ora¿Í tnsnames.ora fileÀÇ ³»¿ëÀ» ¼öÁ¤ÇØ¾ß ÇÑ´Ù.

1. IPC listener address¼³Á¤
listener.ora file¿¡ External procedure¸¦ À§ÇÑ listener¸¦ ¼³Á¤ÇÑ´Ù.

- ¼³Á¤ ¾ÈµÈ °æ¿ì

LISTENER =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL=tcp)(HOST=Krhp1)(PORT=1521)
)
)

- ¼³Á¤ ÇÑ °æ¿ì

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=IPC)(KEY=EXTPROC0))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=tcp)(HOST=Krhp1)(PORT=1521))
)
)
)

EXTPROC0ÀÇ ¸¶Áö¸· °ªÀº zeroÀ̸ç ÀÌ´Â default°ªÀÌ´Ù. ¸¸ÀÏ ¼­¹ö¿¡
¿©·¯ °³ÀÇ database°¡ ¼³Ä¡µÇ¾î ÀÖ´Ù¸é ipcÀÇ key°ªÀ» ´Ù¸£°Ô ÁÖ¾î¾ß ÇÑ´Ù.

2. SID(System Identifier)¼³Á¤
External procedureÀÇ »ç¿ëÀ» À§ÇÑ SID¼³Á¤À» À§ÇØ listener.ora fileÀÇ
SID_LIST_LISTENERÀ» ¼öÁ¤ÇÑ´Ù.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC
....
....
(SID_DESC =
(SID_NAME=PLSExtProc)
(ORACLE_HOME=/hom1/app/oracle/product/8.1.5)
(PROGRAM=extproc)
)
)

3. Service Name Description¼³Á¤
tnsnames.ora file¿¡ service nameÀ» ´ÙÀ½°ú °°ÀÌ Ãß°¡ÇÑ´Ù.

extproc_connection_data =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=IPC)(KEY=EXTPROC0))
)
(CONNECT_DATA =
(SID=PLSExtProc)
(PRESENTATION =RO)
)
)

4. Listener ¼³Á¤ÀÇ È®ÀÎ

$ lsnrctl serv

LSNRCTL for Solaris: Version 8.1.5.0.0 - Production on 04-OCT-99
16:35:24

(c) Copyright 1998 Oracle Corporation. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
Services Summary...
PLSExtProc has 1 service handler(s)
DEDICATED SERVER established:0 refused:0
LOCAL SERVER
ORA815 has 1 service handler(s)
DEDICATED SERVER established:0 refused:0
LOCAL SERVER
The command completed successfully


* »ç¿ë¹æ¹ý

1. InterMedia Text »ç¿ëÀÚ »ý¼º

$ sqlplus system/manager
SQL> create user ctxdemo identified by ctxdemo
default tablespace users
temporary tablespace temp;
SQL> grant connect, resouce, ctxapp to ctxdemo;

2. InterMedia TextÀÇ À妽º »ý¼º°ú »ç¿ë

** À妽º ¸®ºôµå¸¦ À§ÇÑ ¿É¼Ç
$ ctxsrv -user ctxsys/ctxsys -log ctx.log &

ÀÌ context server process´Â Çϳª¸¸ ½ÇÇà½ÃÅ°±â º¸´Ù´Â context optionÀ» »ç¿ëÇÏ°Ô µÇ´Â user¼ö¸¸Å­ ¶ç¿ì´Â °ÍÀÌ performance¿¡ ÁÁ´Ù.

¶Ç´Â ctxctlÀ» ¼öÇà½ÃŲ ÈÄ start n (¿©±â¿¡¼­ nÀº context serverÀÇ °¹¼ö)À¸·Î ½ÇÇàÇÏ¿©µµ µÈ´Ù.


SQL> create table documents
( docu_id number primary key, text varchar2(1000) );
SQL> insert into documents values(1,\'DB¸¶ÄÉÆà °í°´¸¸Á· À̲ö´Ù\');
SQL> insert into documents values(2,\'¸®´ª½º½ÃÀå Æǵµº¯È­ Á¶Áü\');
SQL> commit;
SQL> create index docu_text on documents(text)
indextype is ctxsys.context;

-> index»ý¼º½Ã¿¡ ORA-28575 ERROR°¡ ¹ß»ýÇϸé Net8 ¼³Á¤ÀÇ ¹®Á¦ÀÌ´Ù.
-> º»ÀÎÀÇ °æ¿ì À§À¸ ¤Ó½ºÅÛÁß DLLÀÇ °æ·Î¸¦ À߸øÀû¾îÁÖ¾î
DLLÀ» LoadÇÒ¼ö ¾ø´Ù´Â »ç·Ê°¡ ÀÖ¾úÀ¸¸ç, ¶ÇÇÑ Net8¼³Á¤¿¡
¹®Á¦°¡ ÀÖ¾î À߸øµÇ´Â °æ¿ìµµ ÀÖ¾ú½À´Ï´Ù(Oracle ¿µ¹® ManaualÀ» º¸°í ÇßÀ»¶§)


SQL> select * from documents where contains(text,\'º¯È­\') > 0;

DOCU_ID TEXT
--------- -----------------------------------
2 ¸®´ª½º½ÃÀå Æǵµº¯È­ Á¶Áü

SQL> select * from documents where contains(text,\'DB\') > 0

DOCU_ID TEXT
--------- -----------------------------------
1 DB¸¶ÄÉÆà °í°´¸¸Á· À̲ö´Ù


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