Oracle/기타2013. 4. 1. 16:53

 

 

DB암호화 이전에 암호화에 대한 성능 영향을 측정하는 것인 정말 쉬운일이 아니다.

 

가장 많이 사용하는 플러그인 방식에 촛점을 맞추어 생각해 보자.

플러그인 방식은 잘 알려진 바와 같이 DB서버에 암/복호화 라이브러리를 설치하고, 뷰와 내부 저장 함수를 사용하여 라이브러리를 연결한다. 또한 Instead of 트리거를 사용하여, Insert, Update SQL을 뷰 대신 원래의 테이블에 대해 수행하도록 변환한다.

 

이런 일련의 과정은 DB에 매우 심대한 영향을 주고, 특히 성능에 많은 영향을 미친다. 초기 많은 DB암호화 실패 사례가 나왔던 것도 결국 이런 영향이 얼마나 큰지 알지 못하고 무턱대고 암호화를 하다가 빚은 참사가 아닐는지.

 

DB암호화를 고려할 때, 가장 먼저 드는 생각이 “암호화 후에 성능이 얼마나 감소할 것인가?” 하는 의문이다.

 

필자도 이런 문제로 한참 고민을 한 적이 있었는데, 어떤 계기로 모 공공기관의 DB암호화 영향도 분석이라는 과제를 수행할 기회가 있었다.

 

주로 성능 관점에서 DB암호화 시의 영향도를 예측하는 작업이었는데, 현재 수행되는 SQL에 대한 정보를 DBMS에서 수집한 후에, SQL을 파싱(Parsing)하여 암호화 시에 영향받는 SQL을 분리하면 그에 대한 예측이 가능하지 않을까 하는 막연한 생각으로 출발하였다.

 

오라클 DBMS의 경우에는 V$SQL 등의 테이블에 해당 인스턴스에서 수행한 SQL에 대한 통계 정보를 저장하고 있는데, SQL 수행횟수, SQL로 처리한 로우 수, CPU Time 총합, Elapsed Time 총합 등이 그에 해당한다.

 

우선 이런 정보를 일정한 주기로 수집하였다. 해당 정보는 오라클의 메모리가 부족해지지 않는 한 메모리 내에 유지되므로 하루의 몇 회 정도만 수집을 해도 거의 빠짐없이 V$ 테이블의 정보를 수집할 수 있다. 특정 시점에서만 수행되는 SQL이 있을 수 있어서, 1 개월 정도 계속하여 SQL을 수집하였다.

 

이렇게 수집한 SQL을 파싱하여, SQL이 사용하는 테이블, 컬럼 정보를 추출하였고, 이를 기준으로 해당 SQL이 암호화 대상 테이블/컬럼을 사용하는지 여부를 판정할 수 있었다. 이렇게 분류를 해 보면, 어떤 테이블에 관련된 SQL이 몇 종이나 되며, 해당 테이블을 사용하는 SQL이 전체 CPU 사용량의 몇 %에 해당하는 지 등의 다양한 정보를 얻어낼 수 있다.

 

또한 암호화 대상 테이블이 실제로 사용되는 테이블인지, 아니면 한때 필요에 의해서 만들었으나 지금은 아무도 사용하고 있지 않은 테이블인지(물론 연말에 한번 사용하거나, 국정감사를 대비해서 만들어 놓은 테이블일 수도 있다) 등을 분류하여, 임시 성격의 테이블은 제거하는 등의 판단을 내리는 데도 활용할 수 있다.

 

이런 정보가 생성이 되면 각 테이블별로, 이런 추측이 가능하다.

“만약 A라는 테이블의 B라는 칼럼이 암호화 대상인 경우에, 해당 칼럼을 사용하는 SQL은 암호화 후에 일정한 비율로 영향을 받을 것이다”

 

여기서 우리가 알아내야 하는 것은 비율을 결정하는 요소인데, 플러그인 방식에서는 해당 SQL에서 암/복호화 함수가 얼마나 불려지는가가 핵심이다. 즉 어떤 SQL이 100개의 주민번호를 읽어오는 것이라면 100번의 복호화 함수가 호출되므로, 암호화 이전과 차이는 100번의 복호화 함수 수행시간이 된다. 물론 이런 비교는, 암호화 전후에 실행계획상의 변화가 없다는 전제를 기초로 한다.

 

쉬워 보이는 이 논리에 어려운 점이 숨어 있는데, 각 SQL별로 암호화 대상 칼럼을 얼마나 가져오는지 알 수 있어야 한다는 것이다. 이 부분은 현재도 해결하지 못한 과제인데, 해당 프로젝트를 수행하는 시점에서는 시간 관계상 모델을 매우 단순화하여 영향도를 측정하였다.

 

여러 번의 DB암호화 프로젝트를 거쳐 암호화 영향도 분석의 효용성을 인식하게 되었는데,

 1)   암호화를 할 때 주의해야 할 테이블(핵심 테이블) 선정

 2)   많이 사용되고 CPU 점유율이 높은 SQL(핵심 SQL) 식별

 3)   추출된 SQL 중 암호화 대상 SQL만 분류하여, 효율적인 기능 및 성능 시험 수행

하는데 활용하고 있다. 더불어 정확한 값은 아닐지라도 암호화 후에 CPU 관점에서 얼마나 영향을 받는지를 계산하여, 플러그인 방식의 암호화를 적용하는 것이 가능한지 여부에 대한 판단을 내리는데 기초자료로 사용한다.

 

DB암호화를 고려한다면, 이런 방식의 영향도 분석을 꼭 해볼 것을 권하고 싶다.

 

 

출처 : http://www.dbguide.net/knowledge.db?cmd=specialist_view&boardUid=170383&boardConfigUid=93&boardStep=&categoryUid=

Posted by 자수성가한 부자
Oracle/RAC2013. 2. 7. 12:52

 

 

Symantec logo

Oracle log files

 To check the Oracle log file

  • For Oracle 10g Release 1, access:

    $CRS_HOME/crs/log

  • For Oracle 10g Release 2, access:

    $CRS_HOME/log/hostname/crsd

    where hostname is the string returned by the hostname command.

The log file in this directory contains the logs pertaining to the CRS resources such as the virtual IP, Listener, and database instances. The file indicates some configuration errors or Oracle problems, since CRS does not directly interact with any of the Veritas components.

 To check for crs core dumps

Access:

$CRS_HOME/crs/init

Core dumps for the crsd.bin daemon are written here. Use this file for further debugging.

 To check the Oracle css log file

  • For Oracle 10g Release 1, access:

    $CRS_HOME/css/log

  • For Oracle 10g Release 2, access:

    $CRS_HOME/log/hostname/cssd

    where hostname is the string returned by the hostname command.

The log files in this directory indicate actions such as reconfigurations, missed checkins, connects, and disconnects from the client CSS listener. If there are membership issues, they will show up here. If there are communication issues over the private networks, they are logged here. The ocssd process interacts with vcsmm for cluster membership.

 To check for ocssd core dumps

Access:

$CRS_HOME/css/init

Core dumps from the ocssd and the pid for the css daemon whose death is treated as fatal are located here. If there are abnormal restarts for css the core files are found here.

 

출처 : https://sort.symantec.com/public/documents/sf/5.0/solaris/html/sf_rac_install/sfrac_troubleshoot7.html


'Oracle > RAC' 카테고리의 다른 글

RAC 노드간 parallel process 제어  (0) 2015.08.18
CSS 파라미터  (1) 2013.08.12
CRS 소프트웨어 버전 확인  (0) 2011.09.08
RAC의 권장 구성  (0) 2011.05.24
RAC 설치시 자동으로 올라오는 이유  (0) 2011.03.10
Posted by 자수성가한 부자
Oracle/OGG2013. 2. 5. 10:42

 - ADG
   Disaster : 천재지변, 장애상황
   일반적 오라클의 기능
  
   아키텍쳐
    : Active DB의 리두 로그를 Standby DB로 적용
      Standby는 read only모드로 사용 가능
      redo log의 전송 방식
       - sync : 데이터 무손실(maximum protection)
                standby DB에 redolog가 기록된 것을 확인 받음.
                MSP : block 단위로 적용하는 프로세스
                LSP : SQL의 재수행을 하여 적용하는 프로세스
       - async : maximum performance
                 네트워크 장애와 같은 문제 발생시 standby 뿐 아니라
                 active DB에도 안좋은 영향을 미칠 수 있음.
      네트워크 대역폭 제한으로 인한 문제 발생시
       => compression으로 전송데이터량 줄임. 

 

 

 - OGG
   이 기종 간에 사용 가능
   Zero downtime migration
   Capture process : transaction log capture
   trail file
   pump process : standby 로 전송
  
   trail file
   replicat : 반영

   양방향으로 data sync가 맞춰질 수 있다.
   업무 부하의 분산 가능
   간단한 ETL 작업을 위한 function 제공

   DATA filtering 가능(특정 테이블 제외, 유저의 변경, 특정테이블만 적용 등)
   ADG와는 다르게 일부데이터만 sync 가능.
  
   암호화 (blowfish)
  
   veridata : 데이터 정합성 체크 옵션. 변경된 내용만 확인 가능하고 변경된 부분을 수정은 불가

   OGG 구매시 ADG 사용 가능

Posted by 자수성가한 부자
Oracle/Admin2013. 1. 16. 17:58

 

SQL*Loader의 성능을 향상시키는 여러가지 방법들

 

1. Data를 load하는 방식에 따라 성능을 증가시키는 방법이 다름
  1) 기본경로(conventional)

     ROWS=n를 사용하고 bind array를 크게 지정하라.
     (ROWS=n은 n개마다 commit을 하라고 명시하는 것.
      bind array는 bindsize 파라미터에 정의)


  2) 직접경로(direct path) : direct=true 옵션을 지정
      unrecoverable 옵션을 지정하면 더욱더 성능을 높여줌 : redo data를 남기지 않음


  3) 병렬직접경로(parallel direct path)
     direct=true와 parallel=true를 지정할 것.

 

2. data load 전에 index 삭제

 

3. replace 대신에 truncate사용할 것(if 기존 데이터를 삭제한다면)

 

4. 구분자(, | .)대신에 고정폭 데이터를 사용하라.

 

5. 11g 파라미터 변경
   STATISTICS_LEVEL = BASIC 이면 timed_statistics=false;
   STATISTICS_LEVEL = TYPICAL, ALL 이면 timed_statistics=true;

 

 

참고 :

http://databaser.net/moniwiki/wiki.php/SQLLoader%EC%82%AC%EC%9A%A9%EB%B0%A9%EB%B2%95

http://satya-dba.blogspot.kr/2009/06/sqlloader.html : 파라미터 정의(히든 포함)

Posted by 자수성가한 부자
Oracle/용어정리2013. 1. 4. 09:56

 

 

 

Sequential Access Method file
어떤 연관된 내용들끼리 모아서 저장해 놓은 방식이 아니라,
데이터가 생성되는 순서대로 이어붙여 저장하는 방식

 

참고사이트 :
http://fendee.egloos.com/2234349

'Oracle > 용어정리' 카테고리의 다른 글

TPS 란?  (1) 2011.02.02
BCP (Business Continuity Planning)  (0) 2010.12.26
클러스터링 팩터(Clustering Factor)  (0) 2010.02.22
정규화란?  (1) 2010.02.04
옵티마이져(Optimizer)란?  (0) 2010.02.04
Posted by 자수성가한 부자
Oracle/Admin2012. 9. 24. 19:53

 

Q :

     유저 단위로 export를 받았습니다. 그러나 이 유저의 오브젝트들은 테이블스페이스가 제각각입니다. 이 dump파일을 한테이블 스페이스로 import 할 수 있습니까?

 

A :

    예, 할 수 있습니다.

  

 

## 테스트


1. 테스트용 테이블스페이스 생성
col tablespace_name for a50
col file_name for a50
set lines 200

select tablespace_name, file_name from dba_data_files;

TABLESPACE_NAME        FILE_NAME
-------------------------------------------------- --------------------------------------------------
SYSTEM         /u01/app/oracle/oradata/test/system01.dbf
UNDOTBS1        /u01/app/oracle/oradata/test/undotbs01.dbf
SYSAUX         /u01/app/oracle/oradata/test/sysaux01.dbf
USERS         /u01/app/oracle/oradata/test/users01.dbf


SQL> create tablespace test datafile '/u01/app/oracle/oradata/test/test01.dbf' size 100m;

Tablespace created.

SQL> create tablespace test2 datafile '/u01/app/oracle/oradata/test/test2_01.dbf' size 100m;

Tablespace created.

 

2. 유저 생성후 default tablespace를 지정(test 테이블스페이스)

SQL> create user test identified by test
  2  default tablespace test;

User created.

SQL> grant resource, connect to test;

Grant succeeded


3. test 유저로 접속후 테이블 생성 / 인덱스 생성 / 데이터 입력
SQL> conn test/test
Connected.
SQL> create table test_table (col1 varchar2(10), col2 number);

Table created.

SQL> insert into test_table values ('tests',2);

1 row created.


SQL> insert into test_table values ('eeee',3);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test_table;

COL1      COL2
-------------------- ----------
tests         2
eeee         3


# index 생성 : 유저 default로 생성
SQL> create index test_index on test_table(col1);

Index created

# index 생성 : 테이블스페이스 test2로 지정
SQL> create index test_index2 on test_table(col1,col2)
  2  tablespace test2;

Index created.


# table 생성 : 테이블스페이스 test2로 지정
SQL> create table test_table2 (col1 number, col2 varchar2(10))
  2  tablespace test2;      

Table created.

SQL> insert into test_table2 values (1,'test');

1 row created.

SQL> commit;


4. export(test 유저)
[oracle@test ~]$ exp test/test file=exp.dmp log=exp.log

Export: Release 10.2.0.4.0 - Production on 월 9월 24 19:37:48 2012

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in KO16MSWIN949 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P1 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user TEST
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user TEST
About to export TEST's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export TEST's tables via Conventional Path ...
. . exporting table                     TEST_TABLE          2 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
. . exporting table                    TEST_TABLE2          1 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully with warnings.


5. 유저 삭제(오브젝트도 같이)
SQL> drop user test cascade;       

User dropped.


6. 테이블스페이스 삭제 : test2

SQL>  drop tablespace test2 including contents and datafiles;      

Tablespace dropped.

 

7. 유저 생성(import할 유저)
SQL> create user test identified by test
  2  default tablespace test;

User created.

SQL> grant resource, connect to test;

Grant succeeded.


8. import

[oracle@test ~]$ imp test/test file=exp.dmp log=imp.log

Import: Release 10.2.0.4.0 - Production on 월 9월 24 19:40:55 2012

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V10.02.01 via conventional path
import done in KO16MSWIN949 character set and AL16UTF16 NCHAR character set
import server uses WE8ISO8859P1 character set (possible charset conversion)
. importing TEST's objects into TEST
. . importing table                   "TEST_TABLE"          2 rows imported
. . importing table                  "TEST_TABLE2"          1 rows imported
Import terminated successfully without warnings.


8. 데이터 확인
  : 기존에 생성된 테이블과 인덱스 모두 유저의 default tablespace에 생성된다.
SQL> select table_name, tablespace_name from user_tables;

TABLE_NAME           TABLESPACE_NAME
------------------------------------------------------------ --------------------------------------------------
TEST_TABLE           TEST
TEST_TABLE2           TEST

SQL> select * from test_table;

COL1      COL2
-------------------- ----------
tests         2
eeee         3

SQL> select * from test_tables2;
select * from test_tables2
              *
ERROR at line 1:
ORA-00942: table or view does not exist


SQL> select * from test_table2;

      COL1 COL2
---------- --------------------
  1 test


SQL> select table_name from user_tables;

TABLE_NAME
------------------------------------------------------------
TEST_TABLE
TEST_TABLE2

SQL> select * from test_table;

COL1      COL2
-------------------- ----------
tests         2
eeee         3


SQL> select * from test_table2;

      COL1 COL2
---------- --------------------
  1 test


INDEX_NAME        TABLESPACE_NAME
-------------------------------------------------- --------------------------------------------------
TEST_INDEX        TEST
TEST_INDEX2        TEST

Posted by 자수성가한 부자
Oracle/Admin2012. 9. 18. 17:49

 

 

11g에서는 Diagnostic Pack 과 Tuning Pack의 사용 가능한지 불가능한지를 파라미터를 통해 설정해 놓았다.

 

# 파라미터 조회

SELECT name, value FROM v$parameter WHERE name = 'control_management_pack_access';

 

3개의 값을 설정할 수가 있는데,

NONE : 두 pack 모두 사용할 수 없음

DIAGNOSTIC : diagnostic pack 만 사용할 수 있음.
DIAGNOSTIC+TUNING : 두 pack 모두 사용할 수 있고, default 값임


 

각 패키지에 해당하는 기능들

 

Oracle Diagnostic Pack
 - AWR
 - ADDM
 - ASH
 - Performance Tuning
 - Event notifications
 - Event history and metric history
 - Blackouts
 - Dynamic metric baselines
 - Monitoring templates
 - Memory-access based performance montoring

 

Tuning Pack
 - SQL Access Advisor
 - SQL Tuning Advisor
 - Automatic SQL Tuning
 - SQL Tuning Sets
 - SQL Monitoring
 - Reorganize objects

 

원문 : http://docs.oracle.com/cd/E11882_01/server.112/e25513/initparams038.htm#REFRN10296

Posted by 자수성가한 부자
Oracle/Admin2012. 9. 18. 16:34

 

 

 

Q : 현재 데이터파일의 갯수가 db_files의 설정 되어있는 값과 같다.

     이 상황에서 리두로그의 그룹과 멤버를 추가하려고 합니다.

     가능한지요?

 

A :  가능합니다.

      redo 로그는 db_files의 갯수와 무관합니다.

 

테스트

 

# db_files의 갯수 확인

SQL> show parameter db_files;

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
db_files        integer  7

 

# 현재 datafile들의 갯수 확인

SQL> select count(*) from dba_data_files;

  COUNT(*)
----------
  7

 

# 리두로그 현황

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/redo01.log
/u01/app/oracle/oradata/orcl/redo02.log
/u01/app/oracle/oradata/orcl/redo03.log

 

SQL> alter database add logfile '/u01/app/oracle/oradata/orcl/redo04.log' size 50M;

데이타베이스가 변경되었습니다

 


SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/redo01.log
/u01/app/oracle/oradata/orcl/redo02.log
/u01/app/oracle/oradata/orcl/redo03.log
/u01/app/oracle/oradata/orcl/redo04.log

 

=> 잘 추가되었다.

 

테이블스페이스 추가를 해볼까?

 

SQL> create tablespace test1 datafile '/u01/app/oracle/oradata/orcl/test1_01.dbf' size 10m;
create tablespace test1 datafile '/u01/app/oracle/oradata/orcl/test1_01.dbf' size 10m
*
1행에 오류:
ORA-00059: 최대 DB_FILES 수를 초과했습니다

 

=> 추가 안됨

 

'Oracle > Admin' 카테고리의 다른 글

유저 단위 export시 테이블스페이스 관련  (0) 2012.09.24
11g Diagnostic Pack / Tuning Pack  (0) 2012.09.18
session_cached_cursors  (0) 2012.09.18
SPM (SQL Plan Management) 에 baseline 자동 등록  (0) 2011.10.31
compress 옵션  (1) 2011.10.06
Posted by 자수성가한 부자
Oracle/Admin2012. 9. 18. 16:05

 

 

Q : session_cached_cursors 파라미터는 운영중에 변경이 가능할까?

 

A : 운영중에 변경이 안된다.

 

SQL> ed
file afiedt.buf(이)가 기록되었습니다

  1  select name, value, issys_modifiable
  2  from v$parameter
  3* where name = 'session_cached_cursors'
SQL> /

NAME
--------------------------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
ISSYS_MOD
---------
session_cached_cursors
50
FALSE

 

SQL> alter system set session_cached_cursors=100;
alter system set session_cached_cursors=100
                 *
1행에 오류:
ORA-02096: 지정된 초기화 매개변수는 이 옵션으로 수정가능하지 않습니다

Posted by 자수성가한 부자
Oracle/기타2012. 8. 10. 14:12

 

테스트용 vmware 이미지를 만들다가 아래와 같은 에러가 났다.

다음번 설치시에 참고하면 좋을 듯.

 

When you execute runInstaller from the Oracle 9iR2 (9.2.0) CD, you will get the following error message:

Error occurred during initialization of VM
Unable to load native library: /tmp/OraInstall2003-10-25_03-14-57PM/jre/lib/i386/libjava.so:
    symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

To resolve the __libc_wait symbol issue, download the p3006854_9204 patch p3006854_9204_LINUX.zip from http://metalink.oracle.com. See bug 3006854 for more information.

To apply the patch, run

su - root # unzip p3006854_9204_LINUX.zip Archive: p3006854_9204_LINUX.zip creating: 3006854/ inflating: 3006854/rhel3_pre_install.sh inflating: 3006854/README.txt # cd 3006854 # sh rhel3_pre_install.sh Applying patch... Patch successfully applied

 

 

출처 : http://www.puschitz.com/InstallingOracle9i.shtml

Posted by 자수성가한 부자