Oracle9.2 For Gentoo
1.1. Creating Oracle User Accounts ¶# groupadd dba # group of users to be granted with SYSDBA system privilege # groupadd oinstall # group owner of Oracle files # useradd -g oinstall -G dba -d /usr/oracle oracle # passwd oracle 1.2. Downgrade binutils ¶# emerge -pv binutils These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild U ] sys-devel/binutils-2.14.90.0.8-r1 [2.14.90.0.7-r4] -bootstrap -build +nls 10,777 kB Total size of downloads: 10,777 kB # emerge /usr/portage/sys-devel/binutils/binutils-2.13.90.0.18-r1.ebuild # INSTALL ÈÄ¿¡ ¿ø·¡´ë·Î upgrade ÇÑ´Ù(# emerge -u binutils) 1.3. Ä¿³Î ÆĶó¹ÌÅÍ ¼³Á¤ ¶# cat /proc/sys/kernel/shmmax =>33554432 # echo `expr 1024 \* 1024 \* 1024` > /proc/sys/kernel/shmmax # cat /proc/sys/kernel/shmmax # vi /etc/sysctl.conf (¿µ±¸ÀûÀ¸·Î ¼³Á¤) kernel.shmmax=1073741824 1.4. ´Ù¿î ¹ÞÀº ÆÄÀÏ ¾ÐÃà Ç®±â ¶# gunzip lnx_920_disk1.cpio.gz # cpio -idmv < lnx_920_disk1.cpio # disk2,3 µµ µ¿ÀÏÇÏ°Ô ÀÛ¾÷ÇÑ´Ù. 1.5. TomcatÀÇ Port No º¯°æÇϱ⠶TomcatÀÌ ¼³Ä¡°¡ µÇ¾î ÀÖ°í Port No¸¦ 8080À¸·Î »ç¿ëÇÏ°í ÀÖ´Ù¸é Port No ¸¦ º¯°æÇØ ÁÖ¾î¾ß µÈ´Ù.
# vi /opt/tomcat/conf/server.xml <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --> <!-- change port number for oracle http server 8080->8088 by santana --> <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="8088" minProcessors="5" maxProcessors="75" enableLookups="true" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" 1.6. My .bash_profile For Oracle User ¶export ORACLE_SID=ARIRANG export ORACLE_BASE=/usr/oracle/db export ORACLE_HOME=/usr/oracle/db export ORACLE_TERM=xterm export TNS_ADMIN=/usr/oracle/db/network/admin export NLS_LANG=American_America.KO16KSC5601 export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data export ORACLE_OWNER=oracle export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/ucblib:/usr/X11/lib:/usr/local/lib export PATH=/bin:/usr/bin:/usr/sbin:$ORACLE_HOME/bin:/usr/X11/bin:/usr/local/bin:/usr/X11R6/bin:$ORACLE_HOME/dba #export DISPLAY=:0.0 export LANG=C export EDITOR=vi export TMPDIR=/tmp export TMP=/tmp export TEMP=/tmp #export JAVA_HOME=/usr/java/jdk1.3.1_02 export JAVA_HOME=/opt/blackdown-jdk-1.4.1 export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib alias ll='ls -la' alias lx='ls -alxF' alias oh='cd $ORACLE_HOME' set -o vi #PS1='($ORAPRD):/\W $ ' PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]' cd db/ 1.7. ¼³Ä¡ ½ÃÀÛ ¶0. ¼³Ä¡Àü µð½ºÅ©ÀÇ °ø°£
oracle@arirang oracle $ df -h Filesystem Size Used Avail Use% Mounted on /dev/hda2 28G 2.2G 24G 9% / /dev/hda1 99M 9.4M 85M 10% /boot /dev/hda5 19G 159M 18G 1% /var /dev/hda6 64G 4.8G 56G 8% /data 1. runInstaller ¸¦ ½ÇÇàÇÑ´Ù.
$ /data/Disk1/runInstaller & $ Initializing Java Virtual Machine from /tmp/OraInstall2004-04-11_10-10-22PM/jre/bin/java. Please wait... /tmp/OraInstall2004-04-11_10-10-22PM/jre/bin/i386/native_threads/java: error while loading shared libraries: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory [1]+ Done ./runInstaller - »ó±â¿Í °°Àº ¿¡·¯ ¹ß»ý½Ã ¾Æ·¡ÀÇ ÆÐÅ°Áö¸¦ ¼³Ä¡ÇØ¾ß ÇÑ´Ù.
# emerge -pv lib-compat These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild N ] sys-libs/lib-compat-1.3 3,076 kB Total size of downloads: 3,076 kB # emerge lib-compat 2. ´Ù½Ã ÇÑ ¹ø runInstaller ¸¦ ½ÇÇàÇÑ´Ù.
$ Initializing Java Virtual Machine from /tmp/OraInstall2004-04-11_10-20-11PM/jre/bin/java. Please wait... Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] Font specified in font.properties not found [--symbol-medium-r-normal--*-%d-*-*-p-*-adobe-fontspecific] [1]+ Done ./runInstaller - »ó±â¿Í °°Àº ¿¡·¯°¡ ³ª¸é¼ ȸéÀÇ ÆùÆ®°¡ ±ú¾îÁ® º¸ÀÎ´Ù¸é ¾Æ·¡¿Í °°ÀÌ ÇÑ´Ù.
/data/ftp_data/comp/Linux/oracle/Disk1/stage/Components/oracle.swd.jre/1.3.1.0.0/1/DataFiles/Expanded/jre/linux/lib
¿¡ ÀÖ´Â font.properties ¸¦ ¼öÁ¤ÇÑ´Ù.(¶Ç´Â font.properties.ko ÆÄÀÏÀ» ¸¸µé¾î ÁØ´Ù)
- °¡Àå È®½ÇÇÑ ¹æ¹ýÀº ±×³É ¿µ¹®À¸·Î ÀνºÅçÇÏ´Â °ÍÀÌ´Ù.
$ unset LANG $ unset LC_ALL 3. Next ¹öÆ°À» ´©¸¥´Ù.
4. OK ¹öÆ°À» ´©¸¥´Ù.
5. Unix Group Name¿¡ oinstall ÀÔ·Â ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
.
6. root ·Î /tmp/orainstRoot.sh ¸¦ ½ÇÇàÇÑ ÈÄ Contiune ¹öÆ°À» ´©¸¥´Ù.
# /tmp/orainstRoot.sh Creating Oracle Inventory pointer file (/etc/oraInst.loc) Changing groupname of /usr/oracle/db/oraInventory to oinstall 7. Next ¹öÆ°À» ´©¸¥´Ù.
8. Product Languages ¹öÆ°À» ´©¸¥´Ù.
9. Korean À» Ãß°¡ÇÑ ÈÄ OK ¹öÆ°À» ´©¸¥´Ù.
10. Oracle9i Database 9.2.0.1.0À» ¼±Åà ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
11. Enterprise Edition (1.74GB)À» ¼±Åà ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
12. General Purposef ¸¦ ¼±Åà ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
13. Global Database Name°ú SID¸¦ ÀÔ·Â ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
14. Database Performace¸¦ À§ÇØ Database FileÀÇ À§Ä¡´Â ´Ù¸¥ Disk·Î ÇÏ´Â °ÍÀÌ ÁÁ´Ù.
±×·¯³ª ´Ù¸¥ Disk°¡ ¾ø´Ù¸é Next ¹öÆ°À» ´©¸¥´Ù.
15. Next ¹öÆ°À» ´©¸¥´Ù.
16. Install ¹öÆ°À» ´©¸¥´Ù.
17. ¼³Ä¡°¡ ½ÃÀ۵ȴÙ.
18. ¼³Ä¡Áß ¾Æ·¡¿Í °°Àº ¿¡·¯°¡ ³ª¸é ´ÙÀ½°ú °°ÀÌ Ã³¸®ÇÑ ÈÄ Retry ¹öÆ°À» ´©¸¥´Ù.
$ vi $ORACLE_HOME/ctx/lib/env_ctx.mk¸¦ ¿¾î¼ 1365¶óÀÎÁ¤µµ¿¡ ÀÖ´Â INSO_LINK¿¡ $(LDLIBFLAG)dl ¸¦ Ãß°¡ÇÕ´Ï´Ù. INSO_LINK = -L$(CTXLIB) $(LDLIBFLAG)m $(LDLIBFLAG)sc_ca $(LDLIBFLAG)dl $(LDLIBFLAG)sc_fa $(LDLIBFLAG)sc_ex $(LDLIBFLAG)sc_da $(LDLIBFLAG)sc_ut $(LDLIBFLAG)sc_ch $(LDLIBFLAG)sc_fi $(LLIBCTXHX) $(LDLIBFLAG)c -Wl,-rpath,$(CTXHOME)lib $(CORELIBS) $(COMPEOBJS) 19. ¾Æ·¡¿Í °°Àº ¸Þ½ÃÁö°¡ ³ª¿À¸é root·Î /usr/oracle/db/root.sh¸¦ ½ÇÇàÇÑ ÈÄ OK¹öÆ°À» ´©¸¥´Ù .
# /usr/oracle/db/root.sh Running Oracle9 root.sh script... \nThe following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /usr/oracle/db Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... \nCreating /etc/oratab file... Adding entry to /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. ½ÇÇàÈÄ¿¡´Â /usr/local/bin¿¡ coraenv,dbhome,oraenv 3°³ÀÇ ÆÄÀÏÀÌ »ý¼ºµÈ´Ù.
20. Oracle Database Configuration Assistant ¼³Ä¡¿¡ ½ÇÆÐÇÏ¿´´Ù. (ÀÏ´Ü SKIP)
$ vi $ORACLE_HOME/bin/dbca ¸¶Áö¸· ºÎºÐÀ» ¾Æ·¡¿Í °°ÀÌ ¼öÁ¤ÇÑ´Ù. #if [ -f /etc/rac_on ]; then # Run DBCA $JRE_DIR/bin/jre -native -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS #else # Run DBCA #$JRE_DIR/bin/jre -DORACLE_HOME=$OH -DJDBC_PROTOCOL=thin -mx64m -classpath $CLASSPATH oracle.sysman.assistants.dbca.Dbca $ARGUMENTS #fi 21. ¼³Ä¡°¡ ³¡³µ´Ù. Exit ¹öÆ°À» ´©¸¥´Ù.
22. 20¹ø¿¡¼ ±×³É ½ºÅµÇßÀ» °æ¿ì¿¡´Â $ORACLE_HOME/bin/dbca dbca¸¦ ½ÇÇàÇÑ´Ù.
$ dbca & 23. Next ¹öÆ°À» ´©¸¥´Ù.
24. Create a database¸¦ ¼±Åà ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
25. General Purpose¸¦ ¼±Åà ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
26. Global Database Name°ú SID¸¦ ÀÔ·Â ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
27. Dedicated Server Mode¸¦ ¼±Åà ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
28. ArchiveÅÇ¿¡¼ Archive Log Mode·Î ¼±ÅÃÇÏ°í Archive°¡ ÀúÀåµÉ Àå¼Ò¸¦ ÁöÁ¤ÇÏ°í ÀÌ ¿Ü¿¡
¸Þ¸ð¸®³ª ij¸¯ÅͼÂÀ̳ª DB SizingÀ» Àû´çÈ÷ Á¶Á¤ÇÑ ÈÄ Next ¹öÆ°À» ´©¸¥´Ù.
29. Next ¹öÆ°À» ´©¸¥´Ù.
30. Create Database¸¦ ¼±Åà ÈÄ Finish ¹öÆ°À» ´©¸¥´Ù.
31. Summary ¸¦ º¸¿©ÁØ´Ù. OK ¹öÆ°À» ´©¸¥´Ù.
33. SYS¿Í SYSTEM À¯ÀúÀÇ Æнº¿öµé¸¦ ÀÔ·Â ÈÄ Exit ¹öÆ°À» ´©¸¥´Ù.
34. ¼³Ä¡°¡ ¿Ï·áµÇ¾ú´Ù. sqlplus·Î Á¢¼ÓÇÏ¿© È®ÀÎÇÏ¿© º¸ÀÚ.
Á¢¼ÓÀü ¹Ýµå½Ã µÞºÎºÐÀÇ tnsnames.ora ¿Í listener.ora ÆÄÀÏÀ» ÂüÁ¶ÇÏ¿© 2°³ÀÇ ÆÄÀÏÀÇ ¼³Á¤À» È®ÀÎÇÑ´Ù.
$ sqlplus /nolog SQL*Plus: Release 9.2.0.1.0 - Production on Sun Apr 18 16:30:44 2004 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. SQL> connect / as sysdba Connected. SQL> SQL> SQL> SQL> startup ORA-01081: cannot start already-running ORACLE - shut it down first SQL> select sysdate from dual; SYSDATE --------- 18-APR-04 35. °¡Àå ¸¹Àº ¿¹Á¦·Î ¾²ÀÌ´Â EMP, DEPT Å×ÀÌºí ¿¹Á¦¸¦ ¸¸µé¾î º»´Ù.
$ cd $ORALCE_HOME/sqlplus/demo $ sqlplus /nolog SQL> @demobld.sql Building demonstration tables. Please wait. Demonstration table build is complete. SQL> select * from emp; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ---------- -------------------- ------------------ ---------- --------- ---------- ---------- ---------- 7369 SMITH CLERK 7902 17-DEC-80 800 20 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 7566 JONES MANAGER 7839 02-APR-81 2975 20 7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 7698 BLAKE MANAGER 7839 01-MAY-81 2850 30 7782 CLARK MANAGER 7839 09-JUN-81 2450 10 7788 SCOTT ANALYST 7566 09-DEC-82 3000 20 7839 KING PRESIDENT 17-NOV-81 5000 10 7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30 7876 ADAMS CLERK 7788 12-JAN-83 1100 20 EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ---------- -------------------- ------------------ ---------- --------- ---------- ---------- ---------- 7900 JAMES CLERK 7698 03-DEC-81 950 30 7902 FORD ANALYST 7566 03-DEC-81 3000 20 7934 MILLER CLERK 7782 23-JAN-82 1300 10 14 rows selected. 36. ¼³Ä¡ ÈÄ µð½ºÅ© °ø°£
$ df -h Filesystem Size Used Avail Use% Mounted on /dev/hda2 28G 7.2G 19G 28% / /dev/hda1 99M 9.4M 85M 10% /boot /dev/hda5 19G 187M 18G 2% /var /dev/hda6 64G 4.8G 56G 8% /data 1.8. My tnsnames.ora ¶# TNSNAMES.ORA Network Configuration File: /usr/oracle/db/network/admin/tnsnames.ora # Generated by Oracle configuration tools. ARIRANG = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ARIRANG) ) ) INST1_HTTP = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = MODOSE) (PRESENTATION = http://HRService) ) ) EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) ) 1.9. My listener.ora ¶# LISTENER.ORA Network Configuration File: /usr/oracle/db/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521)) ) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /usr/oracle/db) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = ARIRANG) (ORACLE_HOME = /usr/oracle/db) (SID_NAME = ARIRANG) ) ) |
To criticize the incompetent is easy; it is more difficult to criticize the competent. |