Oracle 데이터베이스와 어플리케이션 연동 - 윈디하나의 솔라나라
|
root@wl ~ # unzip basic-11.2.0.2.0-solaris-x64.zip root@wl ~ # unzip jdbc-11.2.0.2.0-solaris-x64.zip root@wl ~ # unzip sdk-11.2.0.2.0-solaris-x64.zip root@wl ~ # unzip sqlplus-11.2.0.2.0-solaris-x64.zip root@wl ~ # mv instantclient_11_2 /usr/local/instantclient root@wl ~ # vi /usr/local/instantclient/tnsnames.ora TNS_ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) root@wl ~ # vi /etc/profile # for Oracle Instant Client if [ -d /usr/local/instantclient ] then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/instantclient; export LD_LIBRARY_PATH PATH=$PATH:/usr/local/instantclient; export PATH; NLS_LANG=Korean_Korea.AL32UTF8; export NLS_LANG TNS_ADMIN=/usr/local/instantclient; export TNS_ADMIN; SQLPATH=/usr/local/instantclient; export SQLPATH; fi root@wl ~ # sqlplus 사용자아이디/사용자패스워드@//호스트주소:포트/DB이름 root@wl ~ # sqlplus 사용자아이디/사용자패스워드@TNS_ORCL* 오라클 인스턴트 클라이언트는 라이브러리 파일 크기가 크기 때문에, 가상 메모리를 많이 소모한다.
SQL> connect / as sysdba SQL> execute dbms_connection_pool.configure_pool(null, minsize=>10, maxsize=>100, inactivity_timeout=>300, max_think_time=>600); SQL> execute dbms_connection_pool.start_pool; SQL> select * from DBA_CPOOL_INFO;데이터베이스에서 DRCP 종료
SQL> execute dbms_connection_pool.stop_pool;tnsnames.ora 파일 수정(필요하다면)
TNS_ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521)) (CONNECT_DATA = (SERVER = POOLED) (SERVICE_NAME = orcl) ) )접속방법
root@wl ~ # sqlplus 사용자아이디/사용자패스워드@//호스트주소:포트/DB이름:POOLED root@wl ~ # sqlplus 사용자아이디/사용자패스워드@TNS_ORCL
SQL> select * from DBA_CPOOL_INFO; SQL> select * from V$CPOOL_STATS; SQL> select * from V$CPOOL_CC_INFO; SQL> select * from V$CPOOL_CC_STATS;
root@wl ~/php-5.3.3 # . ~oracle/.profile root@wl ~/php-5.3.3 # ./configure \ ... --with-oci8 \ --enable-sigchild
root@wl ~/php-5.3.3 # ./configure \ ... --with-oci8=instantclient,/usr/local/instantclient \ --enable-sigchild
$conn = oci_pconnect("아이디", "패스워드", "TNS_ORCL"); // TNS설정에 'SERVER = POOLED'이 있어야 함 $conn = oci_pconnect("아이디", "패스워드", "호스트주소:포트/서비스이름:POOLED");php.ini에 다음을 추가해야 한다.
root@wl /usr/local/php/lib # vi php.ini oci8.connection_class = "SOLANARA_APP"
SQL> execute dbms_service.modify_service(SERVICE_NAME => 'orcl', AQ_HA_NOTIFICATIONS => TRUE);php.ini에 다음을 추가한다.
root@wl /usr/local/php/lib # vi php.ini oci8.events = On
RSS ATOM XHTML 5 CSS3 |
Copyright © 2004-2024 Jo HoSeok. All rights reserved. |