$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be enterprise-4, enterprise-5, redhat-3, redhat-4,

redhat-5, redhat-5.1, SuSE-9, SuSE-10, UnitedLinux-1.0, asianux-1 or asianux-2
                                      Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-11-05_04-52-10PM.
 
Please wait ...[oracle@jptyooravmd2 agent]$ Exception in thread "main"

java.lang.UnsatisfiedLinkError: /tmp/OraInstall2009-11-05_04-52-
 
10PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file:

No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at sun.security.action.LoadLibraryAction.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
        at sun.awt.DebugHelper.<clinit>(Unknown Source)
        at java.awt.Component.<clinit>(Unknown Source)
        at oracle.sysman.emgc.oneclick.OneClickWizard.getGuiDefaults(OneClickWizard.java:239)
        at oracle.sysman.emgc.oneclick.OneClickWizard.<init>(OneClickWizard.java:205)
        at oracle.sysman.emgc.oneclick.OneClick.<init>(OneClick.java:236)
        at oracle.sysman.emgc.oneclick.OneClickInstaller.<init>(OneClickInstaller.java:116)
        at oracle.sysman.emgc.oneclick.OneClickInstaller.process(OneClickInstaller.java:268)
        at oracle.sysman.emgc.oneclick.OneStartup.startup(OneStartup.java:383)
        at oracle.sysman.emgc.oneclick.OneArgs.main(OneArgs.java:700)
        at oracle.sysman.emgc.oneclick.OneStartup.main(OneStartup.java:391)

에러나면


이것은 OUI를 기동하기 위해 필요한 몇몇 package가 install이 되지 않았기 때문에

발생한 것으로, 다음과 같이 해당 RPM을 install하면 문제는 해결된다.

 


패키지설치

rpm -Uvh libXp-1.0.0-8.1.el5.i386.rpm

rpm -Uvh libXau-1.0.1-3.1.i386.rpm

 

반드시 필요한 package는 libXp 하나뿐이지만,
libXau와 의존관계가 있기 때문에 libXau도 함께 install해주었다.

여기서 주의할 점이 있는데, 운영체제의 bit수와 관계없이 32bit의 libXp가 필요하다는 것이다.



출처: http://boeok.tistory.com/entry/Runinstaller-시-자바-에러?category=564566 [Secret]

Posted by Any DB
,

ORA-01455 : 열 변환시 정수 데이터 유형이 오버플로우 되었습니다.

이번 작업에서는 데이터가 한 건도 없는 테이블을 EXPORT할때 발생하였습니다.

 

ALTER SYSTEM SET DEFERRED_SEGMENT_CREATION=FALSE;

ALTER TABLE <empty table name> ALLOCATE EXTENT;



출처: http://boeok.tistory.com/category/Oracle/Trouble Shooting [Secret]

Posted by Any DB
,

리소스를 많이 차지 하는 sql찾기 
1) 총 메모리 사용량이 많은 SQL (상위 N개)
SELECT BUFFER_GETS,DISK_READS,EXECUTIONS,SQL_TEXT
FROM (SELECT BUFFER_GETS,DISK_READS,EXECUTIONS,SQL_TEXT
      FROM V$SQLAREA
      ORDER BY BUFFER_GETS DESC  )
WHERE ROWNUM <= :p_rank

2) 평균 메모리 사용량이 많은 SQL (상위 N개)
SELECT BUFFER_GETS,DISK_READS,
       EXECUTIONS,trunc(BUFFER_PER_EXEC) BUFFER_PER_EXEC, address, SQL_TEXT
FROM ( SELECT BUFFER_GETS,DISK_READS, EXECUTIONS,address,
   BUFFER_GETS/DECODE(EXECUTIONS,0,1,EXECUTIONS) BUFFER_PER_EXEC,
   SQL_TEXT
       FROM   V$SQLAREA
       ORDER BY BUFFER_GETS/DECODE(EXECUTIONS,0,1,EXECUTIONS) DESC )
WHERE ROWNUM <=  50


3) 메모리, 디스크 사용량이 일정 기준치를 넘은 SQL
SELECT BUFFER_GETS,DISK_READS,
       EXECUTIONS,BUFFER_GETS/EXECUTIONS,SQL_TEXT
FROM   V$SQLAREA
WHERE  BUFFER_GETS >  :p_val1
OR     DISK_READS > :p_val2
OR     EXECUTIONS > :p_val3

from en-core

白面書生
 

4) 디스크 사용량 많은 SQL
SELECT BUFFER_GETS,DISK_READS,
       EXECUTIONS,trunc(BUFFER_PER_EXEC) BUFFER_PER_EXEC, address, SQL_TEXT
FROM ( SELECT BUFFER_GETS,DISK_READS, EXECUTIONS,address,
   BUFFER_GETS/DECODE(EXECUTIONS,0,1,EXECUTIONS) BUFFER_PER_EXEC,
   SQL_TEXT
       FROM   V$SQLAREA
       ORDER BY disk_reads DESC )
WHERE ROWNUM <=  50

-- address 에 해당하는 sql찾기
select *
from v$sqltext
where address = 'B443F724'
order by piece;

from zerobug

 



출처: http://boeok.tistory.com/category/Oracle/Tunning [Secret]

Posted by Any DB
,

-- 성능 개선 대상 sql list 추출 스크립트  (튜닝의시작 튜닝방법론에서..)


-- IO/CPU TOP SQL 관련 성능 개선 대상선정
select rownum cnt,
         t1.*
from (
         select t1.parsing_schema_name,
                  t1.module,
                  t1.sql_id,
                  t1.hash_value,
                  t1.substr_sqltext,
                  t1.executions,
                  t1.buffer_gets,
                  t1.disk_reads,
                  t1.rows_processed,
                  t1.lio,
                  t1.elapsed_sec,
                  t1.cpu_sec,
                  round(t1.cpu_time/t1.cpu_time_total*100,1) ratio_cpu,
                  round(t1.elapsed_time/elapsed_time_total*100,1) ratio_elapsed
        from (
                 select parsing_schema_name,
                          module,
                          sql_id,
                          hash_value,
                          substr(sql_text,1,100) substr_sqltext,
                          executions,
                          buffer_gets,
                          disk_reads,
                          rows_processed,
                          cpu_time,
                          elapsed_time,
                          round(buffer_gets/decode(executions,0,1,executions),1) lio,
                          round(elapsed_time/decode(executions,0,1,executions)/1000000,1) elapsed_sec,
                          round(cpu_time/decode(executions,0,1,executions)/1000000,1) cpu_sec,
                          sum(cpu_time) over() cpu_time_total,
                          sum(elapsed_time) over() elapsed_time_total
                  from v$sqlarea s
                  ) t1
        where t1.executions >0
        and    t1.parsing_schema_name not in ('SYS','SYSTEM','SYSMAN')
        order by ratio_cpu DESC       
        ) t1
where rownum <=100

-- DBA_HIST_SQLSTAT  활용 스크립트
select sql_id,
         schema_name,
         module,
         ela_ratio,
         ela_tot,
         cpu_ratio,
         cpu_tot,
         exec_ratio,
         exec_tot,
         lio_ratio,
         lio_tot,
         pio_ratio,
         pio_tot,
         rows_ratio,
         rows_tot
from (
         select sql_id,
                  parsing_schema_name schema_name,
                  nvl(substr(b.module,1,15),'-') module,
                  round(ratio_to_report(sum(b.elapsed_time_delta)) over()*100,1) as ela_ratio,
                  round(sum(b.elapsed_time_delta)/1000000,0) as ela_tot,
                  round(ratio_to_report(sum(b.cpu_time_delta))over()*100,1) as cpu_ratio,
                  round(sum(b.cpu_time_delta)/1000000,0) as cpu_tot,
                  round(ratio_to_report(sum(b.executions_delta))over()*100,1) as exec_ratio,
                  sum(b.executions_delta) as exec_tot,
                  round(ratio_to_report(sum(b.buffer_gets_delta))over()*100,1) as lio_ratio,
                  sum(b.buffer_gets_delta) as lio_tot,
                  round(ratio_to_report(sum(b.disk_reads_delta))over()*100,1) as pio_ratio,
                  sum(b.disk_reads_delta) as pio_tot,
                  round(ratio_to_report(sum(b.rows_processed_delta))over()*100,1) as rows_ratio,
                  sum(b.rows_processed_delta)as rows_tot
         from dba_hist_snapshot a,
                 dba_hist_sqlstat b
         where a.instance_number=1
         and     a.begin_interval_time >= to_date(:b1,'YYYY-MM-DD')
         and     a.end_interval_time <= to_date(:b2, 'YYYY-MM-DD') +0.99999
         and     a.dbid=b.dbid
         and     b.parsing_schema_name not in ('SYS','SYSTEM','SYSMAN')
         and     a.instance_number = b.instance_number
         and     a.snap_id=b.snap_id
         group by b.sql_id,
                      b.parsing_schema_name,
                      b.module
         order by cpu_ratio desc
         )
where rownum <=10;        
        
-- full table 관련 성능 개선 대상 선정

select rownum cnt,
         t1.*
from (                       
         select t1.parsing_schema_name,
                  t1.module,
                  t1.sql_id,
                  t1.hash_value,
                  t1.substr_sqltext,
                  t1.executions,
                  t1.buffer_gets,
                  t1.disk_reads,
                  t1.rows_processed,
                  t1.lio,
                  t1.elapsed_sec,
                  t1.cpu_sec,
                  round(t1.cpu_time/t1.cpu_time_total*100,1) ratio_cpu,
                  round(t1.elapsed_time/elapsed_time_total*100,1) ratio_elapsed
        from (
                 select s.parsing_schema_name,
                          s.module,
                          s.sql_id,
                          s.hash_value,
                          s.address,
                          substr(s.sql_text,1,100) substr_sqltext,
                          s.executions,
                          s.buffer_gets,
                          s.disk_reads,
                          s.rows_processed,
                          s.cpu_time,
                          s.elapsed_time,
                          round(s.buffer_gets/decode(s.executions,0,1,executions),1) lio,
                          round(s.elapsed_time/decode(s.executions,0,1,executions)/1000000,1) elapsed_sec,
                          round(s.cpu_time/decode(s.executions,0,1,executions)/1000000,1) cpu_sec,
                          sum(s.cpu_time) over() cpu_time_total,
                          sum(s.elapsed_time) over() elapsed_time_total
               from v$sqlarea s
               ) t1,
               (
                select distinct hash_value,
                         address
                from v$sql_plan
                where operation = 'TABLE ACESS'
                and options = 'FULL'
                ) x
        where t1.executions > 0
        and x.hash_value = t1.hash_value
        and x.address = t1.address
        and t1.parsing_schema_name not in ('SYS','SYSTEM','SYSMAN')
        order by ratio_cpu DESC
        ) t1
where ROWNUM <=10       


-- Literal SQL 관련 성능개선 대상선정

select rownum rno,
         t1.*
from (
        select max(substr_sqltext) sql_text,
                 max(parsing_schema_name) parsing_schema_name,
                 max(module) module,
                 max(s.sql_id) sql_id,
                 count(s.exact_matching_signature) literal_sql_cnt,
                 round(sum(buffer_gets)/sum(s.executions),2) buffer_avg,
                 round(sum(elapsed_time)/sum(s.executions),2) elapsed_avg,
                 round(sum(rows_processed)/sum(s.executions),2) rows_processed,
                 sum(s.executions) executions,
                 round(sum(cpu_time)/max(cpu_time_total)*100,2) ratio_cpu,
                 round(sum(elapsed_time)/max(elapsed_time_total)*100,2) elapsed_cpu,
                 count(distinct s.plan_hash_value) plan_cnt
        from (                
                 select s.parsing_schema_name,
                          s.module,
                          s.sql_id,
                          s.hash_value,
                          s.plan_hash_value,
                          s.address,
                          substr(s.sql_text,1,100) substr_sqltext,
                          s.executions,
                          s.buffer_gets,
                          s.disk_reads,
                          s.rows_processed,
                          s.cpu_time,
                          s.elapsed_time,
                          s.force_matching_signature,
                          s.exact_matching_signature,
                          round(s.buffer_gets/decode(s.executions,0,1,executions),1) lio,
                          round(s.elapsed_time/decode(s.executions,0,1,executions)/1000000,1) elapsed_sec,
                          round(s.cpu_time/decode(s.executions,0,1,executions)/1000000,1) cpu_sec,
                          sum(s.cpu_time) over() cpu_time_total,
                          sum(s.elapsed_time) over() elapsed_time_total
                from v$sqlarea s
                ) s
         where s.executions > 0
         and s.force_matching_signature <> exact_matching_signature
         and s.parsing_schema_name not in ('SYS','SYSTEM','SYSMAN')
         group by s.force_matching_signature
         having count(s.exact_matching_signature) >=2
         order by ratio_cpu DESC
         ) t1
where rownum <=10                                                                          

 

-- 배치프로그램 관련 성능 개선 대상선정
-- 인라인뷰 o 부분에 배치 프로그램명을 입력하면 해당 프로그램에서 수행하는 모든 sql에 대한 i/o 발생량,  추출 row수, 응답시간, 수행횟수 등의 정보가 추출된다. 이 정보들을 가지고 수행시간이 오래 소요되는 부분의 sql을 추출하여 개선하면 된다.

-- 특정 program 내에서 수행된 sql 추출 스크립트

select o.object_name,
         s.parsing_schema_name as schema,
         s.module,
         s.sql_id,
         s.hash_value,
         substr(s.sql_text,1,100) as sqltext,
         s.executions,
         s.buffer_gets,
         s.disk_reads,
         round(s.rows_processed/s.executions,1) as "Rows",
         round(s.buffer_gets/s.executions,1) lio,
         round(s.elapsed_time/s.executions/1000000,1) elapsed_sec,
         round(s.cpu_time/s.executions/1000000,1) as cpu_sec,
         round(s.elapsed_time/1000000, 1) as elapsed_time
from ( select object_id, object_name
          from dba_objects
          where object_name = :Procedure_Name) o,
          v$sqlarea s
where o.object_id=s.program_id
order by 14 desc                  
        

-- 1. 배치 프로그램명으로 OBJECT_ID 추출하기
SELECT OBJECT_NAME, OBJECT_ID
FROM DBA_OBJECTS
WHERE OBJECT_NAME IN ('PLSQL_BATH_1','PLSQL_BATCH2'); --배치 프로그램명 입력


-- 2. DBA_OBJECTS에서 추출된 OBJECT_ID 값으로 V$SQLAREA의 PROGRAM_ID와 연결

col substr_text for a30
col module for a15

select substr(sql_text,1,30) substr_text, module, program_id
from v$sqlarea
where program_id in ();

-- 3.sql내역확인

select t1.module, t1.substr_sqltext, t1.executions, t1.buffer_gets
from (
         select parsing_schema_name Schema,
                  module,
                  sql_id,
                  hash_value,
                  substr(sql_text,1,37) substr_sqltext,
                  executions,
                  buffer_gets,
                  disk_reads,
                  rows_processed,
                  round(buffer_gets/executions,1) lio,
                  round(elapsed_time/executions/1000000,1) elapsed_sec,
                  round(cpu_time/executions/1000000,1) cpu_sec
        from v$sqlarea s
        where s.program_id in ( select object_id
                                            from dba_objects
                                            where object_name in (''))
       order by 7 desc
       )t1
where rownum <=10;

 

 

-- 최근가장 많이 수행 된 sql과 수행점유율(수행횟수) ash
select sql_id,
         count(*),
         count(*)*100/sum(count(*)) over() ratio
from v$active_session_history
where sample_time >= to_date(:from_time,'yyyymmdd hh24miss')
and sample_time < to_date(:to_time,'yyyymmdd hh24miss')
group by sql_id
order by count(*) desc;


-- 특정 session이 가장 많이 수행 한 sql과 수행 점유율(수행횟수)

select sql_id,
         count(*),
         count(*)*100/sum(count(*)) over() ratio
from v$active_session_history
where sample_time >= to_date(:from_time,'yyyymmdd hh24miss')
and sample_time < to_date(:to_time,'yyyymmdd hh24miss')
and sessiond_id = :b1
group by sql_id
order by count(*) desc;


-- 특정 구간 이벤트 별 대기 시간
select nvl(a.event,'ON CPU') as event,
         count(*) as total_wait_time
from v$active_session_history a
where sample_time >= to_date(:from_time,'yyyymmdd hh24miss')
and sample_time < to_date(:to_time,'yyyymmdd hh24miss')
group by a.event
order by total_wait_time DESC;

 

-- 특정 구간 cpu점유율 순 - top sql
select ash.sql_id,
         sum(decode(ash.session_state,'ON CPU',1,0)) "CPU",
         sum(decode(ash.session_state,'WAITING',1,0)) -
         sum(decode(ash.session_state,'WAITING', decode(en.wait_class,'USER I/O',1,0),0)) "Wait",
         sum(decode(ash.session_state,'WAITING', decode(en.wait_class,'USER I/O',1,0),0)) "IO",
         sum(decode(ash.session_state,'ON CPU',1,1)) "TOTAL"
from v$active_session_history ash,
        v$event_name en
where sql_id IS NOT NULL
and en.event#=ash.event#
and ash.sample_time >= to_date(:from_time,'yyyymmdd hh24miss')
and ash.sample_time < to_date(:to_time,'yyyymmdd hh24miss')
group by sql_id
order by sum(decode(session_state,'ON CPU',1,1)) desc;


-- 특정 구간 cpu 점유율 순 top session
select ash.session_id,
         ash.session_serial#,
         ash.user_id,
         ash.program,
         sum(decode(ash.session_state, 'ON CPU',1,0)) "CPU",
         sum(decode(ash.session_state, 'WAITING',1,0)) -
         sum(decode(ash.session_state,'WAITING', decode(en.wait_class,'USER I/O',1,0),0)) "WAITING",
         sum(decode(ash.session_state, 'WAITING', decode(en.wait_class,'USER I/O',1,0),0)) "IO",
         sum(decode(session_state, 'ON CPU',1,1)) "TOTAL"
from v$active_session_history ash,
       v$event_name en
where en.event# = ash.event#
and ash.sample_time >= to_date(:from_time,'yyyymmdd hh24miss')
and ash.sample_time < to_date(:to_time,'yyyymmdd hh24miss')
group by session_id,
             user_id,
             session_serial#,
             program
order by sum(decode(session_state,'ON CPU',1,1)) DESC;



출처: http://boeok.tistory.com/category/Oracle/Tunning [Secret]

'CONSULTING SERVICE > Performance Tuning Service ' 카테고리의 다른 글

RAC Lock Monitoring  (0) 2018.04.23
리소스를 많이 차지 하는 sql찾기  (0) 2018.04.23
Posted by Any DB
,

1. listener.ora  (default location = $ORACLE_HOME/network/admin)

 

 LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = linux-single)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

 

SID_LIST_LISTENER=

 (SID_LIST =

  (SID_DESC =

     (ORACLE_HOME=/oracle/app/oracle/product/11.2.0)

    (SID_NAME=LINUXORCL)

  )

)

ADR_BASE_LISTENER = /oracle/app/oracle

 

 

 - LISTENER : 리스너 이름이며 다른 이름으로 설정 가능. SID_LIST_리스너명 항목에서 리스너명과 동일

 - ADDRESS_LIST : ADDRESS들의 모임이며 여러 개의 ADDRESS를 동시에 설정 가능

 - ADDRESS : 데이터베이스 서버의 주소이며 프로토콜, 서버명 및 사용포트로 구성된다.

 - SID_LIST_LISTENER : 리스너가 서비스하는 데이터베이스 정보를 설정하며 SID_LIST_리스너명으로 설정

 - SID_LIST : 해당 리스너 프로세스가 하나 이상의 데이터베이스를 서비스 할 경우에 해당 부분에 여러개의  

                   SID_DESC를 등록한다.

 - GLOBAL_DBNAME : 전역 데이터베이스 이름을 지정하며 생략 가능하다.

 - ORACLE_HOME : 오라클 홈 디렉토리의 위치를 지정한다.

 - SID_NAME : 리스너의 접속을 허용하는 데이터베이스의 SID 명을 지정한다.

 

리스너 파라메터

 - LOG_DIRECTORY_리스너명 : 로그 파일이 저장될 경로 이름을 설정

 - LOG_FILE_리스너명 : 로그가 기록될 파일명 설정

 - LOGGING_리스너명 : 로그 기능의 활성화 여부 설정 (ON 또는 OFF)

 - PASSWORD_리스너명 : 리스너를 중단시킬 경우 필요한 비밀번호를 설정

 

 

 [LINUXORCL]linux-single:/oracle> lsnrctl status   <---리스너 상태체크

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 02-AUG-2013 00:19:39

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linux-single)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused

리스너 시작

[LINUXORCL]linux-single:/oracle> lsnrctl start    <-- 리스너 시작

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 02-AUG-2013 00:22:02

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Starting /oracle/app/oracle/product/11.2.0/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /oracle/app/oracle/product/11.2.0/network/admin/listener.ora
Log messages written to /oracle/app/oracle/diag/tnslsnr/linux-single/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux-single)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linux-single)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                02-AUG-2013 00:22:04
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/linux-single/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux-single)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

리스너 상태체크

[LINUXORCL]linux-single:/oracle> lsnrctl status   <-- 리스너 상태체크

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 02-AUG-2013 00:22:26

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linux-single)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                02-AUG-2013 00:22:04
Uptime                    0 days 0 hr. 0 min. 24 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/diag/tnslsnr/linux-single/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux-single)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "LINUXORCL" has 1 instance(s).
  Instance "LINUXORCL", status READY, has 1 handler(s) for this service... 사용준비완료
Service "LINUXORCLXDB" has 1 instance(s).
  Instance "LINUXORCL", status READY, has 1 handler(s) for this service...
The command completed successfully

 

 

2. tnsnames.ora 설정 (location = $ORACLE_HOME/network/admin)

 

 LINUXORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 122.99.166.149)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = LINUXORCL)
    )
  )

 

 

- LINUXORCL : 서비스이름

- DESCRIPTION : 접속하고자 하는 대상 데이터베이스 정보

- ADDRESS : 접속하고자 하는 데이터베이스 서버의 리스너를 호출하기 위한 주소정보

- CONNECT_DATA : SERVICE_NAME 옵션을 이용하여 접속할 리스너 프로세스가 사용하는 서비스 이름을 지정

                          하거나 또는 SID옵션을 이용하여 데이터베이스의 SID명을 지정

 

 

 tnsping test

C:\Users\Boeok>tnsping LINUXORCL

TNS Ping Utility for 32-bit Windows: Version 11.2.0.3.0 - Production on 01-8월 -
2013 16:02:49

Copyright (c) 1997, 2011, Oracle.  All rights reserved.

사용된 매개변수 파일:
F:\app\Boeok\product\11.2.0\client_1\network\admin\sqlnet.ora


별칭 분석을 위해 TNSNAMES 어댑터 사용
(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 122.99.166.149
)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = LINUXORCL)))에 접속하려고 시도
하는 중
확인(30밀리초)  <-- 해당 서버와의 응답시간

C:\Users\Boeok>

 

sqlplus 접속시도


C:\Users\Boeok>sqlplus test/test@LINUXORCL

SQL*Plus: Release 11.2.0.3.0 Production on 목 8월 1 16:05:03 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


다음에 접속됨:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> 클라이어트에서 서버로 접속된 상황

 

 

3. SQLNET.ORA

 

클라이언트와 데이터베이스 서버 양쪽에 존재하는 파일로 오라클 넷을 옵션 설정등을 저장하는 파일.

즉. 오라클 서버로 어떻게 접속할 것인지를 설정하는 파일

 

 SQLNET.AUTHENTICATION_SERVICES= (NTS | none)

클라이언트가 오라클 서버로 접속할 때 오라클이 어떠한 인증 서비스를 사용할 것인가

none : sys 계정으로 로그인할때 비밀번호를 입력해야만 들어 갈수 있게 설정

sqlplus "/as sysdba" 가 안먹힘

 

 NAMES.DIRECTORY_PATH= (TNSNAMES | ONAMES | HOSTNAME)

클라이언트가 디비 접속 시 사용하는 STRING NAME ALIAS를 무엇을 통해 확인할지를 결정하는 것

 

TNSNAME : 로컬네임서버를 확인하겠다는 의미, (TNSNAME.ORA파일 확인)

 

ONAMES : 오라클 네임서버를 확인하겠다는 의미이며 추가적으로 NETWORK ADDRESS를 설정해줘야 함.

 

HOSTNAME : 호스트네임서버를 확인하겠다는 의미이며 TNSNAME.ORA파일은 필요없이 DNS나 WINDOWS의 경우 HOST파일(C:\WINDOWS\SYSTEM32\DRIVERS\ETC)에 등로되어 있으면 된다

주의사항 --> 공백이 절대 존재해선 안된다

NAMES.DIRECTORY_PATH=(TNSNAMES, HOSTNAME) X

NAMES.DIRECTORY_PATH=(TNSNAMES,HOSTNAME) O

 

만약 공백 존재시 다음과 같은 에러가 발생할수 있다.

ORA-12170 : TNS: Connect timeout occured

ORA-12560 : TNS: protocol adapter error

 

tcp.validnode_checking = yes

 

tcp.invited_nodes = (IP1, IP2, IPn)     <- 정의된 IP만 접근 나머지는 모두 접근 거부

tcp.excluded_nodes=(IP1, IP2, IPn)   <- 정의된 IP만 접근거부, 나머지는 모두 접근 가능

sqlnet.expire_time = 10     <-- 세션을 정리하는 시간  10분에 한번씩 신호를 보내서 새션을 정리하는 옵션

 

 

 

Point : 클라이언트와 서버의 접속이 안될때 확인해야할 방법중 가장 우선은 방화벽이 설정되어 있는지 아닌지를 확인해야한다 os에서 방화벽을 실행시켜두면 리스너와 클라이어인트설정이 잘되어도 접속이 되지 않는다.

그 다음으로는 위에서 보여준것과 같이 listener, tnsname, sqlnet.ora에 공백이 존재해서도 안된다.



출처: http://boeok.tistory.com/category/Oracle/Admin?page=2 [Secret]

Posted by Any DB
,