'ORACLE'에 해당되는 글 73건

  1. 2017.06.20 오라클 데이터베이스 12c R2에서 사용자가 ORA-28040 에러로 DB접속이 되지 않을 경우
  2. 2017.03.31 데이터베이스/GI PSU, SPU(CPU), 번들 패치(Bundle Patches) 그리고 패치셋에 대한 패치 번호 일람 (Doc ID 1921876.1)
  3. 2017.03.29 오라클에서 double underscore 파라미터란 ?
  4. 2017.03.10 shutdown immediate 후 Hang 일 경우 종료 방법
  5. 2016.12.07 오라클 SE와 SE ONE 버전 확인 방법
  6. 2016.11.15 'PLAN_TABLE' is old version
  7. 2016.10.20 SQL*Plus에서 스크립트 오류 발생시 작업 중단 후 종료 방법
  8. 2016.08.23 SQL Plan Baseline을 이용한 SQL Plan 변경 2
  9. 2016.08.18 Stored Outline을 이용한 SQL Plan 변경
  10. 2016.08.18 SQL Profile을 이용한 SQL Plan 변경
  11. 2016.06.13 오라클 실시간 모니터링 툴 간략 소개 3
  12. 2016.04.26 SpaceManager를 이용한 데이터 파일 정보 확인
  13. 2016.03.17 DBA_FREE_SPACE 뷰 조회 시 응답 시간이 느린 경우
  14. 2016.03.04 Active Session History Viewer를 이용한 SQL Plan 상세 보기 데모
  15. 2016.02.26 Oracle ASH(Active Session History)를 이용한 성능 분석 데모
  16. 2016.02.19 각 인스턴스의 간단한 상태 뷰어(Dashboard)
  17. 2016.02.04 오라클 DBMS 모니터링 툴을 만들어보자! 2
  18. 2015.03.17 오라클 11.2.0.4.0 에서 export dump 중 OLAP not enabled 에러 발생 시
  19. 2014.10.13 RMAN-06059, ORA-19625 - RMAN 백업 시 archive log 경로가 변경 되었을 경우
  20. 2014.08.13 Redo log 장애 - 1개의 member가 삭제되는 장애가 발생하는 경우
  21. 2014.08.12 Redo Log Group과 Member 관리
  22. 2014.08.12 LogMiner를 이용한 redo 로그 분석
  23. 2014.08.12 Supplemental logging
  24. 2014.08.11 High, Normal, Extgernal Redundancy 비교
  25. 2013.07.31 Transportable Tablespaces - TTS
  26. 2012.01.10 Oracle 10g - SGA 사이즈 변경시 SGA 전체 메모리 크기보다 클 경우 spfile 복구
  27. 2010.11.12 Oracle 11g dbconsole이 시작되지 않을 때 - 다음 오류로 인해 Enterpirse Manager 구성을 실패했습니다.
  28. 2010.07.19 WHERE 1=1
  29. 2010.06.08 도메인(Domain)
  30. 2010.05.19 Procedure & Fuction 삭제
ORACLE2017. 6. 20. 11:33

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


ERROR:

ORA-28040: No matching authentication protocol


# sqlnet.ora 파일에 아래와 같이 한줄 추가

SQLNET.ALLOWED_LOGON_VERSION = 9


Posted by Tiwaz
ORACLE2017. 3. 31. 15:22

Doc ID 1556954.1

데이터베이스/GI PSU, SPU(CPU), 번들 패치(Bundle Patches) 그리고 패치셋에 대한 패치 번호 일람 (Doc ID 1921876.1)

Posted by Tiwaz
ORACLE2017. 3. 29. 10:22

오라클 9i 이상부터는 spfile이 새로 추가되었고 사용을 권장하고 있습니다.

또한 바이너리 파일이고 사용자가 직접 수정하면 파일이 깨진다는 사실을 오라클을 배운사람들이라면 누구나 잘 알거라고 생각됩니다.

spfile이나 pfile에 대한 정보는 이미 잘 설명된 곳이 있으니 다른 곳을 참조바랍니다.


오라클 파라미터는 일반 파라미터와 밑줄이 하나 있는 Hidden 파라미터가 존재합니다.

그런데 SPFILE로 부터 만들어진 pfile에서 밑줄이 두개있는 파라미터를 보신적이 있으신가요 ?


...
PERF.__shared_io_pool_size=0
PERF.__shared_pool_size=620756992
PERF.__streams_pool_size=0
*._optim_peek_user_binds=TRUE
*.audit_file_dest='/app/oracle/admin/PERF/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
... 

위와 같은 __XXXX 가 두개 있는 파라미터는 AMM(Automatic Memory Management)와 ASMM(Automatic Shared Memory Management)를 사용할 경우 SGA와 PGA의 할당된 현재 사이즈입니다.

SPFILE을 참조하여 기동 될 경우 자동적으로 할당된 값입니다.


Posted by Tiwaz
ORACLE2017. 3. 10. 10:03

일반적으로 메뉴얼이나 서적에서는 shutdown immediate을 할 경우 모든 세션의 트랜잭션을 정리하고 종료되는 것으로 알고 있을 것입니다. 하지만 항상 예외는 있겠죠?

실제 운영 중인 서버에서 Cold Backup 과정 중 shutdown 이 안되는 상황이 발생하여 찾아보니 3가지 원인이 있는 것을 확인하였습니다.

shutdown 후 alert log를 확인하면 아래 에러를 출력하고 인스턴스가 종료되지 않는 것을 확인할 수 있습니다.

SHUTDOWN: Active sessions prevent database close operation


3가지 원인에 대한 이유와 처리 방법이 소개된 원문과 링크를 참조하시기 바랍니다.


Many times Oracle DBA's are faced with a situation where shutting down the instance with shutdown immediate seems to take infinite time and gives a impression that the session is hung. In most of the cases this is not a hang. Hang can be defined as a scenario when few sessions/processes are waiting on some action and in turn blocking other session/processes to complete their tasks. Now the original sessions could be waiting because of resource issues or Oracle Bugs.

Shutdown immediate can take long time to complete (appear to be hung) because of three reasons:

1. Uncommitted transactions are being rolled back.

2. SMON is cleaning temp segments or performing delayed block cleanouts.

3. Processes still continue to be connected to the database and do not terminate.

1. Uncommitted transactions are being rolled back:

This is the case when the message 'Waiting for smon to disable tx recovery' is posted in the alert log after we issue shutdown immediate.

There are two reasons for this:
- A large query was running at the time of shutdown immediate.
-A large transaction was running at the time of shutdown immediate.

For large queries:

SQL > select count(*) from v$session_longops where time_remaining>0;

If it returns a value > 0 then we can do a shutdown abort and then startup restrict and then again shutdown immediate.

For large transactions:

SQL > select sum(used_ublk) from v$transaction;

If it returns a large value then we have to wait for a long time for shutdowm to get completed.
If the large transaction is aborted and then shutdown is issued then we have to query v$fast_start_transactions and v$fast_start_server, we will not see anything in v$transaction at this time.

At this particular moment transaction recovery is going on and the count(*) will keep on decreasing:

SQL > select count(*) from v$fast_start_transaction;

Decreasing count will show that recovery is going on and when the recovery is completed the database will be shutdown.

But it is not desirable under some circumstances such as, when we have very short maintance window and we need to perform a shutdown immediate to do some work, in those cases we can use the following event and set in the init.ora file TEMPERORARLY To disable transaction recovery:

event="10513 trace name context forever, level 2"

and bounce the instance and issue shutdown immediate to get complete without transaction recovery.SMON will not do a transaction recovery untill this event is set in the init.ora file so it is necessary to remove this event whenever you get a chance to shutdown the database again, this time shutdown immediate can even take 3-5 hours(Just remove this event from pfile).

2. SMON is cleaning temp segments or performing delayed block cleanouts:

During a SHUTDOWN IMMEDIATE and SHUTDOWN NORMAL, SMON cleans up extents which are no longer needed and marking them as freed. It means that count from uet$ will decrease and count in fet$ will increase.

To verify that the temporary segments are decreasing have an active session available in SQL during the SHUTDOWN IMMEDIATE. Run query to ensure the database is not hanging, but is actually perform extent cleanup:

SQL> select count(block#) from fet$;
COUNT(BLOCK)
----------
115

SQL> select count(block#) from uet$;
COUNT(BLOCK)
----------
713

After some time, issue the query again and check the results:

SQL> select count(block#) from fet$;
COUNT(BLOCK)
----------
210

SQL > select count(block#) from uet$;
COUNT(BLOCK)
----------
512

If you do not have sufficient time to wait for this cleanup then you can set the following event and bounce the database and reissue shutdown immediate to skip this cleanup:

event="10061 trace name context forever, level 10"

It allows you to prevent SMON from cleaning up temporary segments. Again it is not recommended to set this event event forever. Whenever you have large downtime remove this event and allow SMON to do its work.

3. Processes still continue to be connected to the database and do not terminate:

After issuing shutdown immediate, If we see entries in alert log file as:

Tue Jan  8 12:00:27 2008
Active call for process 10071 user 'oracle' program 'oracle@server.domain.abc (J001)'
SHUTDOWN: waiting for active calls to complete.
Tue Jan  8 12:00:57 2008

SHUTDOWN: Active sessions prevent database close operation

It shows that there are some active calls at program 'oracle@server.domain.abc (J001)' which pmon is not able to clear up.This message is due to the fact that database is waiting for pmon to clean up processes, but pmon is unable to clean them. The client connections to the server are causing the shutdown immediate or normal to hang. Do the following in this case:

1. Before shutdown immediate, shutdown the listener:

$ lsnrctl stop

2. Now check if there are any connection present at the database as:

$ ps -eaf | grep LOCAL

It will give you the OSPIDs of the client connected to database.

3 Manually kill them as:

# Kill -9 <OSPID>

4. Issue shutdown immediate now.

Do not forget to bring up the listener after startup 🙂

In addition to this you can set 10046 event in the session used to shutdown the instance. This will help to tell the event on which session is waiting

SQL>alter session set events '10046 trace name context forever, level 12'

SQL>Shutdown immediate;

Look for the trace file in user_dump_dest location. Also look at the alert.log for any other messages. They might be helpful in case the shutdown is experiencing hang situation.

참조 링크 : http://askdba.org/weblog/2008/05/shutdown-immediate-hang-2/

Posted by Tiwaz
ORACLE2016. 12. 7. 17:56

오라클 SE와 SE ONE 버전 확인 방법에 대한 질문을 받았습니다.

그래서 몇가지 확인 방법을 정리합니다.

1. EE vs SE

SQL> SELECT * FROM PRODUCT_COMPONENT_VERSION;

엔터프라이즈와 스텐다드 버전에 대해서 명확하게 확인 가능.


2. 접속

prompt# sqlplus /nolog

SQL> select * from v$version ;

접속된 서버의 버전 정보에 나온다고는 하나 SE와 SE ONE에 대해서는 확인 불가. 


3. Cluster 유무

RAC 지원 기능이 활성화되어 있느냐 안되어 있느냐에 따라 확인 가능하다고 하나 true/false로만 판단되어 확인 불가.

혹시나 하여 dba_feature_usage_statistics의 RAC 항목에서도 true/false로만 표현됨.


4. 설치 로그 확인

$ORACLE_BASE/oraInventory/logs/installActions<timestamp>.log 

SE와 SE ONE에 대하여 확실하게 확인 가능함. 하지만 사용자가 로그를 지웠을 경우 확인 불가.




Posted by Tiwaz
ORACLE2016. 11. 15. 17:48

DBMS_XPLAN로 실행 계획을 볼때 PLAN_TABLE is old version이라고 나올 경우 해결법


Note
-----
   - 'PLAN_TABLE' is old version

25 rows selected.


SQL> drop table plan_table;
Table dropped.


SQL> @?/rdbms/admin/utlxplan.sql
Table created.

Posted by Tiwaz
ORACLE2016. 10. 20. 18:00

스크립트 시작 부분에 설정함.


# 오류 발생 시 SQL*Plus를 종료함.(오류 발생 전 변경 내역 commit )

SQL> whenever sqlerror exit sql.sqlcode


# 오류 발생 시 SQL*Plus를 종료함.(오류 발생 전 변경 내역 rollback)

SQL> whenever sqlerror exit rollback sql.sqlcode



Posted by Tiwaz
ORACLE2016. 8. 23. 15:17

앞서 SQL Plan 변경을 위해 SQL Profile, Stored Profile을 잠깐 소개 및 자동화 시킨 부분을 포스트하였습니다.

이번에는 ORACLE 11g에서 새로운 기능으로 제공하는 SPM(SQL Plan Management)을 이용하여 실행계획을 변경하고 고정하는 방법을 소개하려고 합니다.

SPM은 실행계획을 자동으로 관리하고 새로운 실행 계획이 Capture되더라도 검증하여 더 나은 실행 계획을 사용할 수 있도록 해주며 사용자에 의해 Auto와 Manual로 관리할 수 있습니다.


SQL Plan Capture는 optimizer_capture_sql_plan_basline 파라미터(default: false)를 이용하여 자동으로 수집 가능하며 SQL Tuning Set 또는 Cusor Cache로 부터 Capture하는 방식을 제공합니다.


SPM을 이용하여 실행 계획을 변경하는 방법을 요약하면 다음과 같습니다.

1. DBMS_SPM 패키지 설치 확인

2. 권한 및 파라미터 설정 정보 확인

3. 성능이 좋지 않은 SQL의 Plan Baseline 생성

4. Cursor Cache로 부터 성능이 개선된 Plan Baseline 생성

5. 성능이 좋지 않은 SQL의 Baseline을 DISABLE으로 변경

6. 변경된 실행 계획으로 SQL이 실행되는지 확인  



위 과정대로 SQL 실행 계획을 자동화한 프로그램으로 한번 바꿔 보도록하겠습니다.

1. DBMS_SPM 패키지 설치 확인

select owner,object_name, object_type
  from dba_objects
 where object_name = 'DBMS_SPM' ;

- 설치
SQL> @ $ORACLE_HOME/rdbms/admin/dbmsspm.sql 



2. 권한 및 파라미터 설정 정보 확인

select grantee,privilege,admin_option
  from dba_sys_privs
 where grantee = &grantee
   and privilege in ('ADMINISTER SQL MANAGEMENT OBJECT');

- 권한 설정
SQL> grant ADMINISTER SQL MANAGEMENT OBJECT to &grantee;


- 파라미터 확인
select name,
       value,
       isdefault
  from v$parameter
 where name in ('optimizer_capture_sql_plan_baselines',
               'optimizer_use_sql_plan_baselines') ; 



3. 성능이 좋지 않은 SQL의 Plan Baseline 생성

비효율 SQL을 선택 후 우클릭을 하면 아래와 같은 실행 스크립트가 만들어 지며, SQL*Plus에서 실행하여 SQL 실행 계획이 Capture가 되도록 합니다.

정상적으로 Capture가 이루어지면 DBA_SQL_PLAN_BASELINES 딕셔너리에서 Capture된 SQL들을 확인 할 수 있습니다.


4. Cursor Cache로 부터 성능이 개선된 Plan Baseline 생성

dbms_spm.load_plans_from_cursor_cache 를 이용하여 기존에 생성된 비효율 적인 SQL Plan Baseline의 SQL_HANDLE에 성능이 개선된 SQL 실행 계획을 생성 및 추가 합니다.

동일한 SQL_HANDLE로 새로운 SQL Plan Baseline이 생성되는 것을 확인 할 수 있습니다.



5. 성능이 좋지 않은 SQL의 Baseline을 DISABLE으로 변경

성능이 개선된 SQL Plan Baseline을 사용하기 위해 비효율 SQL의 Plan Baseline을 DISABLE로 변경합니다.



6. 변경된 실행 계획으로 SQL이 실행되는지 확인 

동일한 SQL_HANDLE로 SQL Plan Baseline이 등록되면 다음과 같이 실행 가능한 Baseline의 정보를 확인 할 수 있습니다.

실제 Plan hash value : 828281118로 실행 계획을 사용하는지 확인 해보겠습니다.

Note에서 성능이 개선된 SQL Plan Baseline을 사용하는 것을 확인할 수 있습니다.



Posted by Tiwaz
ORACLE2016. 8. 18. 18:07


앞서 SQL Plan 변경을 위해 SQL Profile을 잠깐 소개 및 자동화 시킨 부분을 포스트 하였었습니다.

이번 포스트는 SQL 실행계획 변경 방법 중 하나인 Stored Outline을 이용하여 실행계획을 변경하고 고정하는 방법을 소개하려고 합니다.

Stored Outline은 Plan Stability(안정화)를 위하여 9i부터 제공되었으며 11g에서 Deprecated 되었습니다.

그리고 Stored Outline의 자세한 개요나 설명 보다는 사용자가 쉽게 사용할 수 있는 자동화에 기준을 맞춰 작성된 점 참조하시기 바랍니다.


Stored Outline을 이용하여 실행 계획을 변경하는 방법을 요약하면 다음과 같습니다.

1. DBMS_OUTLN 패키지 설치 확인

2. 권한 확인

3. 성능이 좋지 않은 SQL의 Outline 생성

4. 성능이 개선된 SQL의 Outline 생성

5. 성능이 개선된 Outline을 성능이 좋지 않은 SQL의 Outline으로 변경

6. 변경된 실행 계획으로 SQL이 실행되는지 확인 


위 과정대로 SQL 실행 계획을 자동화한 프로그램으로 한번 바꿔 보도록하겠습니다. .

1. DBMS_OUTLN 패키지 설치 확인

select owner,object_name, object_type
  from dba_objects
 where object_name = 'DBMS_OUTLN' ;

- 설치
SQL> @ $ORACLE_HOME/rdbms/admin/dbmsol.sql 


2. 권한 확인

select grantee,privilege,admin_option
  from dba_sys_privs
 where grantee = &grantee
   and privilege in ('CREATE ANY OUTLINE');


 select grantee,granted_role,admin_option
  from dba_role_privs
 where grantee = &grantee
   and granted_role in ('EXECUTE_CATALOG_ROLE') ;


- 권한 설정

SQL> grant create any outline to &grantee;
SQL> grant execute_catalog_role to &grantee;

SQL> grant create any outline, alter any outline, drop any outline to &grantee;
SQL> grant execute on outln_pkg to &grantee;
SQL> grant delete, update, insert, select on outln.ol$hints to &grantee;
SQL> grant delete, update, insert, select on outln.ol$nodes to &grantee;
SQL> grant delete, update, insert, select on outln.ol$ to &grantee;


※ Stored Outline 생성 방법
Stored Outline을 생성은 크게 세가지가 있습니다.
- create_stored_outlines 파라미터 설정
- CREATE OUTLINE SQL Statement
- DBMS_OUTLN.CREATE OUTLINE 


3. 성능이 좋지 않은 SQL의 HASH_VALUE 확인 및 Outline 생성

1) Stored Outline을 만들기 위한 비효율 SQL 확인

2) 만들어진 Stored Outline의 Outline 정보 확인


4. 성능이 개선된 SQL의 HASH_VALUE 확인 및 Outline 생성

1) Stored Outline을 만들기 위해 성능이 개선된 SQL 확인

2) 만들어진 Stored Outline의 Outline 정보 확인


5. 성능이 개선된 Outline을 성능이 좋지 않은 SQL의 Outline으로 변경

성능이 개선된 SQL의 Outline name을 From name으로, 비효율 SQL의 Outline name을 To Name으로 한 후 CONVERT를 하여 성능이 개선된 SQL의 Outline 정보를 비효율 SQL의 Outline으로 변경함.


6. 변경된 실행 계획으로 SQL이 실행되는지 확인

stored outlie을 사용하기 위해서는 use_stored_outlines 파라미터를 설정해줘야합니다.

Syntax : alter session set use_stored_outlines=CATEGORY;

SQL> alter session set use_stored_outlines=LMNET_CAT_20160818173936; 

Hash Join이 Nested Loop Join으로 변경되었고 테이블에 대해 각각 index scan 하고 있으며 정상적으로 Stored Outline 이 동작한다면 Note에 use_stored_outlines 파라미터에 지정한 Catalog의 Outline name을 확인할 수 있습니다.

그리고 DBA_OUTLINES 딕셔너리의 USED 컬럼의 값이 UNUSED에서 USED로 바뀌는 것을 확인할 수 있습니다.






Posted by Tiwaz
ORACLE2016. 8. 18. 11:40

Oracle Database를 운영 중인 DBA분들은 가끔 잘 실행되던 SQL이 비효율적은 실행계획으로 성능이 저하되는 것을 보았을 것입니다.

저도 몇번 경험을 해보았지만 해결 방법은 SQL을 변경하여 AP 서버에 변경된 SQL을 적용하고 WAS를 재시작한 후 변경된 SQL로 실행되는지 확인하는 이런 과정을 거쳐야 합니다. 서비스 시간 중에 이 작업을 하려면 서비스가 중단되어야하는 문제가 있습니다.또는 무식한 방법?이지만 shared_pool을 flush 시키다 보면 원래의 실행 계획으로 언젠가 바뀔 순 있습니다. 하지만 전체 SQL을 다시 parsing하고 shared_pool에 reload 하는 부하가 어마어마하니 권장하지는 않습니다.

이런 이유로 ORACLE은 SQL 문장을 수정하지 않고 SQL Plan을 변경하는 방법을 여러가지 제공하고 있습니다.

그 중 하나인 SQL Profile은 SQL Tuning이 목적으로 제공되며 10g 이상 버전 부터 사용할 수 있습니다.

SQL Profile에 대한 소개는 검색을 통해서 쉽게 찾아 볼 수 있으며 더 자세하게 설명할 자신이 없어 링크로 공유합니다.

http://www.dbguide.net/knowledge.db?cmd=view&boardUid=184184&boardConfigUid=21

https://dioncho.wordpress.com/2009/02/03/how-to-tune-sql-statement-without-changing-text-plan-baseline-version/



SQL Profile을 이용하여 실행 계획을 변경하는 것을 자동화 시켜보았습니다.


SQL Profile을 실행 계획을 변경하기 위한 단계는 다음과 같습니다.

1. DBMS_SQLTUNE 패키지 설치 확인

2. 권한 확인

3. 성능이 좋지 않은 SQL의 SQL_ID와 SQL_FULLTEXT 확인

4. 성능이 개선된 SQL의 SQL ID 확인

5. DBMS_SQLTUNE 패키지의 Hidden Procedure인 import_sql_profile을 이용하여 실행 계획 정보(OUTLINE) 변경.

6. 변경된 실행 계획으로 SQL이 실행되는지 확인


※ OUTLINE

ORACLE Optimizer는 사용자가 실행한 SQL을 Parsing 할 때 Query Transformer->Estimator->Plan Generator라는 과정을 거치며 최적의 실행 계획을 만듭니다.

이때 만들어진 실행계획을 수행하기 위해 적용되는 Hint의 모음이 Outline입니다.

확인은 10053 Trace의 가장 마지막 부분이나 DBMS_XPLAIN 패키지를 이용하여 확인 할 수 있습니다. 


1. DBMS_SQLTUNE 패키지 설치 확인

select owner,object_name, object_type
  from dba_objects
 where object_name = 'DBMS_SQLTUNE' ;

- 설치
SQL> @ ?/rdbms/admin/dbmssqlt.sql

 


2. 권한 확인

select grantee,privilege,admin_option
  from dba_sys_privs
 where grantee = &owner
   and PRIVILEGE in ('ADMINISTER ANY SQL TUNING SET',
               'CREATE ANY SQL PROFILE',
               'DROP ANY SQL PROFILE',
               'ALTER ANY SQL PROFILE') ;

- 권한 설정
SQL> grant administer any sql tuning set to &owner ;
SQL> grant create any sql profile to &owner ;
SQL> grant drop any sql profile to &owner ;
SQL> grant alter any sql profile to &owner ; 


3. 성능이 좋지 않은 SQL의 SQL_ID와 SQL_FULLTEXT 확인

- 비효율 SQL_ID의 실행 계획


4. 성능이 개선된 SQL의 SQL ID 확인
-성능이 개선된 SQL의 실행계획

5. DBMS_SQLTUNE 패키지의 Hidden Procedure인 import_sql_profile을 이용하여 실행 계획 정보(OUTLINE) 변경.

1) 성능이 개선된 SQL을 더블 클릭하여 From SQL_ID로 설정.

2) 비효율적인 SQL을 더블 클릭하여 To SQL_ID로 설정.

3) From(튜닝 SQL) -> To(비효율 SQL)가 지정된 것을 확인 하고 Convert 버튼 클릭.

4) 정상적으로 변경이 되면 DBA_SQL_PROFILES에 변경 내역을 조회할 수 있음. 


6. 변경된 실행 계획으로 SQL이 실행되는지 확인
- Note에 생성된 SQL Profile의 Name이 사용되고 있는 것을 확인 할 수 있음.

- hash join과 full table scan으로 수행되던 비효율 SQL이 Outline을 적용한 후 Nested Loop join과 index scan으로 실행 계획이 변경되어 실행됨


다운로드 : https://sites.google.com/site/lmnetfordbms/


Posted by Tiwaz
ORACLE2016. 6. 13. 18:08

JavaFX 기반의 오라클 성능 모니터링 툴입니다.

아직 이름을 짓지 않아 오라클 성능 모니터링으로 진행하고 있는 프로젝트입니다.


지원 기능은 다음과 같습니다.

- 최대 6개 인스턴스의 실시간 모니터링 지원 및 상태 뷰어 제공. 

- Wait Event 기반의 성능 분석 지원

- Lock Session 조회 및 Lock Tree 뷰어 지원

- Undo Segment와 Temp Segment 사용 정보 제공

- Sort 시 Temp Segments 사용량 및 세션 정보 제공

- 실시간 Load Profile

- Ash Viewer

- Top SQL

- Top WaitEvents

- 테이블스페이스, 데이터파일, ASM 정보 조회 기능 제공

- SQL Plan Viewer

- 파라미터 조회 및 저장 기능

- Health Check 레포트 파일 작성

- 스케쥴러를 이용한 일일 성능 진단 보고서 작성 및 메일 전송 기능


영상은 지금까지 완료된 기능을 간략하게 보여주고 있습니다.

테스트는 주로 VMware 와 로컬의 DBMS 를 swingbench로 부하를 준후 모니터링 하는 방식으로 진행하였습니다.






Posted by Tiwaz
ORACLE2016. 4. 26. 09:57

Space Manager를 이용하여 Tablespace, Datafile, ASM Disk의 사용량 정보를 한눈에 볼수 있도록 만들었습니다.

이 화면을 만들면서 dba_free_space에서 recyclebin 조회로 성능이 지연되는 것도 한가지 더 배울수 있었네요.




Posted by Tiwaz
ORACLE2016. 3. 17. 14:25

성능 모니터링 툴의 테이블스페이스 사용량을 보여주는 기능 구현 후 테스트를 진행하다 발견한 현상입니다. 모니터링 툴에는 모래시계가 돌며 전체 프로그램은 느려지며 결과는 안나오고.... 

구현이 잘 못 되었는지 다시 보아도 이상은 없었습니다.

그래서 열심히 검색을 해보니 쿼리기반의 SQL 편집 툴에서도 종종 발생한다고 하여 더 자세히 알아보니 10g 부터 추가된 휴지통 기능이 원인을 제공하고 있었습니다.


테이블스페이스의 여유 공간을 알아보기 위해 DBA_FREE_SPACE를 조회하였는데 응답시간이 느려지면서 모니터링 툴까지 영향을 받고 있었습니다.


메타링크 확인 결과 원인은 2가지로

1. 10g 부터 추가된 휴지통 기능으로 DBA_FREE_SPACE뷰에서 삭제된(버려진) 테이블들의 크기를 조회하기 위해 sys.recyclebin$과 JOIN하는 부분 때문입니다.


SQL> select text from dba_views where view_name='DBA_FREE_SPACE';

TEXT

--------------------------------------------------------------------------------

select ts.name, fi.file#, f.block#,

       f.length * ts.blocksize, f.length, f.file#

from sys.ts$ ts, sys.fet$ f, sys.file$ fi

where ts.ts# = f.ts#

  and f.ts# = fi.ts#

  and f.file# = fi.relfile#

  and ts.bitmapped = 0

union all

select /*+ ordered use_nl(f) use_nl(fi) */

       ts.name, fi.file#, f.ktfbfebno,

       f.ktfbfeblks * ts.blocksize, f.ktfbfeblks, f.ktfbfefno

from sys.ts$ ts, sys.x$ktfbfe f, sys.file$ fi

where ts.ts# = f.ktfbfetsn

  and f.ktfbfetsn = fi.ts#

  and f.ktfbfefno = fi.relfile#

  and ts.bitmapped <> 0 and ts.online$ in (1,4) and ts.contents$ = 0

union all

select /*+ ordered use_nl(u) use_nl(fi) */

       ts.name, fi.file#, u.ktfbuebno,

       u.ktfbueblks * ts.blocksize, u.ktfbueblks, u.ktfbuefno

from sys.recyclebin$ rb, sys.ts$ ts, sys.x$ktfbue u, sys.file$ fi

where ts.ts# = rb.ts#

  and rb.ts# = fi.ts#

  and rb.file# = fi.relfile#

  and u.ktfbuesegtsn = rb.ts#

  and u.ktfbuesegfno = rb.file#

  and u.ktfbuesegbno = rb.block#

  and ts.bitmapped <> 0 and ts.online$ in (1,4) and ts.contents$ = 0

union all

select ts.name, fi.file#, u.block#,

       u.length * ts.blocksize, u.length, u.file#

from sys.ts$ ts, sys.uet$ u, sys.file$ fi, sys.recyclebin$ rb

where ts.ts# = u.ts#

  and u.ts# = fi.ts#

  and u.segfile# = fi.relfile#

  and u.ts# = rb.ts#

  and u.segfile# = rb.file#

  and u.segblock# = rb.block#

  and ts.bitmapped = 0


2. sys.recyclebin$에 삭제된 데이터가 있을 경우.

제 테스트 환경(12.1.0.2.0)에서는 단 2건의 데이터가 있었지만 10초 이상 응답시간이 없었습니다. 



해결 방법은 휴지통을 비우거나 휴지통 기능을 사용 안하는 방법이 있습니다.

1. 휴지통 비우는 방법

사용 방법

SQL> purge recyclebin;


또는 SYSDBA로 전체 휴지통을 비우는 방법이 있습니다.

SQL> purge dba_recyclebin;


2. 휴지통 기능을 사용 안하는 방법(Default : recyclebin = ON)

세션 레벨 : 

SQL> ALTER SESSION SET recyclebin = OFF;

시스템 레벨 : 

SQL> ALTER SYSTEM SET recyclebin = OFF;




참조 : Queries on DBA_FREE_SPACE are Slow (Doc ID 271169.1)

       10g Recyclebin Features and How to Disable it (Doc ID 265253.1)



Posted by Tiwaz
ORACLE2016. 3. 4. 14:19

앞전에 올렸던 ASH Viewer와 연계되어 있던 Plan Viewer의 기능을 대폭 향상하여 Plan Viewer에 대한 데모영상 다시 올립니다.

기존 Plan Viewer의 경우 단순 Tree 형의 Plan만 보여주었지만 이번엔 튜닝을 고려하여 다양한 정보를 볼 수 있도록~

지인께서 고생을 하여주셨습니다.

그래서 Plan Viewer를 이용한 실행계획과 Predicate 정보 등 확인 가능하며, SQL의 시간대별 수행 횟수 및 자원 사용현황 까지~ 한눈에 최대한 볼수 있게 수정되었습니다.

* 실제 운영 서버가 아닌 환경에서 녹화되어 정보가 미흡하지만, 양해 바랍니다~




Posted by Tiwaz
ORACLE2016. 2. 26. 17:42

오라클 AWR의 ASH 기능을 이용한 성능 분석 데모입니다.

개인PC의 DB다 보니 부하가 많이 발생하거나 하지 않아 수집된 데이터 량이 적네요.

시간대별 각 wait_class에 대한 부하를 확인한 후 특정 시간을 설정하면 세션별 SQL 추적을 할 수 있습니다.

각 SQL이 특정 시간 범위에서 차지하는 비율을 확인할 수 있으며 어떤 SQL인지 확인하여 실행계획 확인 후 튜닝을 할 수 있습니다.

(PLAN 뷰어는 아직 개발 중이여서 보여지는 부분이 적지만 추후 다시 올리도록 하겠습니다.)

AWR 보관 주기에 해당하는 날짜를 선택할 경우 선택된 날짜의 ASH 정보 확인을 할 수 있습니다.



Posted by Tiwaz
ORACLE2016. 2. 19. 14:47

로컬PC에 설치된 Virtualbox를 이용하여 6개의 DBMS를 시작한 후 CPU 사용량 및 세션 상태를 확인하는 테스트입니다.

임계치에 따라 신호등과 유사하게 동작하도록 구현되어 있으며 DBMS 장애시 3개의 점멸등이 동시에 켜지게 되어 있습니다.

(테스트에 사용된 로컬PC가 저사양으로 속도는 조금 느립니다.)



## 테스트 서버 사양

▶ 장애 발생 유발 DB

OS : RedHat 6.5 (64bit)

RAM : 1024m

DB : 10g / SID : PERF10

1차 장애 : 유저 프로세스 KILL

2차 장애 : 리스너 & 유저 프로세스 KILL


▶ 일시적 부하 DB

OS : RedHat 6.5 (64bit)

RAM : 1024m

DB : 11g / SID : PERF


▶ 기타 모니터링 대상 DB

OS : CentOS 7 (64bit)

RAM : 1024m

DB : 12c / SID : cdb1, pdb1


OS : Windwos 10 (64bit)

RAM : 8196m

DB : 12c / SID : corcl, orcl

Posted by Tiwaz
ORACLE2016. 2. 4. 18:14


DBA라면 기본적으로 해야하는 일인 실시간 모니터링!

관리하고 있는 DBMS가 어떤 상태인지, 어떤 SQL이 문제가 있는지 또는 발생할 수 있을지 알아보려면 여러가지 툴과 SQL들이 필요합니다.

하지만 상용 툴이 아닌 이상 많은 시간을 투자하여 자기만의 스크립트를 만들고 업무 시 상황에 맞는 스크립트를 찾아 쓰고 하는 불편한 점이 있었습니다.

개인적인 경험으로 익숙해지면 툴 보다 편리하고 빠르다는 장점은 있지만, 고객사를 지원하는 엔지니어성 업무에서는 스크립트 파일들을 생성 또는 업로드하는 이러한 작업이 수월하지는 않았습니다.(괜히 눈치 보이고...ㅠㅠ)

그래서 직접 만들어 볼까? 하는 마음에 하나 만들어 보게 되었습니다.

DBA만 해보신 지인과 개발 부터 시작하여 DBA로 전직한 제가 함께 일할 기회가 생겨서 짬짬히 만든  오라클 모니터링 툴입니다.

이름은 Lune(가칭)이며 타이틀은 Oracle Monitoring Tools로 개발이 되었습니다~

1차 데모 영상은 테스트 삼아 녹화하여 잘 보이진 않지만, 추후 고화질로 다시 올리도록 하겠습니다.

그리고 1차 데모 버전의 경우 UI가 이쁘지 않다는 주위분들의 의견이 있어 아예 새로운 UI로 다시 개발을 하였습니다. 그러니 이번 영상은 참조만 .... _(__)_



Posted by Tiwaz
ORACLE2015. 3. 17. 10:15

오라클 11.2.0.4.0 버전에서 export dump 수행 시 아래와 같은 에러가 발생할 경우 조치 방법


1. 에러

>>> DBMS_AW_EXP: SYS.AW$EXPRESS: OLAP not enabled

>>> DBMS_AW_EXP: SYS.AW$AWMD: OLAP not enabled

>>> DBMS_AW_EXP: SYS.AW$AWCREATE: OLAP not enabled

>>> DBMS_AW_EXP: SYS.AW$AWCREATE10G: OLAP not enabled

>>> DBMS_AW_EXP: SYS.AW$AWXML: OLAP not enabled

>>> DBMS_AW_EXP: SYS.AW$AWREPORT: OLAP not enabled


2. 삭제 방법

SQL> DROP PUBLIC SYNONYM OLAPFACTVIEW; 

SQL> DROP PUBLIC SYNONYM OLAPDIMVIEW;

SQL> DROP PUBLIC SYNONYM DBMS_ODM;

SQL> DELETE FROM SYS.EXPPKGACT$ WHERE PACKAGE = 'DBMS_AW_EXP'  AND SCHEMA= 'SYS';

SQL> COMMIT;


Posted by Tiwaz
ORACLE2014. 10. 13. 16:23

오라클의 fast recovery area를 disable 하고 archive log 모드에서 기본 경로가 아닌 다른 directory에 archive log를 저장할 경우 RMAN을 이용한 백업 시 archive log 파일을 못찾는 에러가 발생함.


1. 에러 예제

RMAN> backup archivelog all ;

Starting backup at 14-OCT-14
current log archived
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 10/14/2014 01:12:43
RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
ORA-19625: error identifying file /u01/oracle/product/flash_recovery_area/INNIDB/archivelog/2014_10_01/o1_mf_1_21_b2qyqgpg_.arc
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3


2. 해결 방법

RMAN> change archivelog all crosscheck ;


** 주의

위와 같은 방법으로 설정을 한다면 백업 시 backupset이 저장되는 디렉토리는 $ORACLE_HOME/dbs에 저장

Posted by Tiwaz
ORACLE2014. 8. 13. 13:48

Redo log 장애 - 1개의 member가 삭제되는 장애가 발생하는 경우


# 처리 순서

1. redo log file 상태 확인

set line 200

col group# for 999

col mb for 999

col member for a45

col seq# for 999

col status for a8

col arc for a5


select a.group#,a.member,b.bytes/1024/1024 MB, b.sequence# "SEQ#",b.status, b.archived "ARC"

from v$logfile a, v$log b

where a.group# = b.group#

order by 1,2

/



2. alert log에서 에러 확인

ORA-00313: open failed for members of log group 1 of thread 1

ORA-00312: online log 1 thread 1: '/dbms/oracle/product/oradata/SOLEXTDEV/redo01_a.log'

ORA-27037: unable to obtain file status

Linux-x86_64 Error: 2: No such file or directory



3. 에러가 발생한 redo log file memeber 삭제

alter database drop logfile member '/dbms/oracle/product/oradata/SOLEXTDEV/redo01_a.log' ;



4. 신규 redo log file memeber 추가

alter database add logfile member '/dbms/oracle/product/oradata/SOLEXTDEV/redo01_a.log' to group 1 ;



5. redo log file 상태 확인

select a.group#,a.member,b.bytes/1024/1024 MB, b.sequence# "SEQ#",b.status, b.archived "ARC"

from v$logfile a, v$log b

where a.group# = b.group#

order by 1,2




오라클 백업과 복구(서진수 저) 중에서 ...


Posted by Tiwaz
ORACLE2014. 8. 12. 18:15

# 참조 : http://docs.oracle.com/cd/B28359_01/server.111/b28310/onlineredo003.htm


# 신규 redo log group 생성(default)

ALTER DATABASE ADD LOGFILE ('/oracle/dbs/log1c.rdo', '/oracle/dbs/log2c.rdo') SIZE 4M ;


# 신규 redo log group 생성(group number 지정)

ALTER DATABASE ADD LOGFILE GROUP 10 ('/oracle/dbs/log1c.rdo', '/oracle/dbs/log2c.rdo') SIZE 4M ;


# redo log member 추가

ALTER DATABASE ADD LOGFILE MEMBER '/oracle/dbs/log2b.rdo' TO GROUP 2;


# redo log 파일로 member  추가

ALTER DATABASE ADD LOGFILE MEMBER '/oracle/dbs/log2c.rdo' TO ('/oracle/dbs/log2a.rdo', '/oracle/dbs/log2b.rdo') ; 



Posted by Tiwaz
ORACLE2014. 8. 12. 17:38

# LogMiner로 데이터베이스에서 발생한 변경 내역을 트랜잭션별, 사용자별, 발생 시간대별로 추적할 수 있음.(8i이후 부터 사용가능 하며 9i 이상부터 DDL을 지원함.)


# 실습 예제(Flat File에 저장하는 방법)

1. Redo log file 상태 확인

set line 200

col group# for 99

col mb for 999

col member for a45

col seq# for 999

col status for a8

col arc for a5


select a.group#,a.member,b.bytes/1024/1024 MB, b.sequence# "SEQ#",b.status, b.archived "ARC"

from v$logfile a, v$log b

where a.group# = b.group#

order by 1,2

/



2. supplemental_log_data_min 설정 확인(YES)

select supplemental_log_data_min from v$database ;



3. utl_file_dir 파라미터 값 확인 및 변경

--경로 확인

show parameter utl_file_dir ;


--원하는 경로로 변경

alter system set utl_file_dir='/data/logmnr' scope=spfile ;



4. DB재시작



5. 딕셔너리 생성

--원하는 파일명과 경로 적용

exec dbms_logmnr_d.build(dictionary_filename=>'dict03.dat',-

dictionary_location=>'/data/logmnr') ;



6. 분석할 로그파일 추가

-- 1 : 신규등록, 2 : 파일삭제, 3 : 추가 등록


-- 신규등록 예제(redo log 파일 중 current 상태인 로그 등록)

exec dbms_logmnr.add_logfile('/dbms/oracle/product/oradata/SOLEXTDEV/redo03.log',1) ;


-- 추가등록 예제

exec dbms_logmnr.add_logfile('/dbms/oracle/product/oradata/SOLEXTDEV/redo01.log',3) ;

exec dbms_logmnr.add_logfile('/dbms/oracle/product/oradata/SOLEXTDEV/redo02.log',3) ;

exec dbms_logmnr.add_logfile('/data/arch2/2_1_855409270.arc',3) ;

exec dbms_logmnr.add_logfile('/data/arch2/1_1_855409270.arc',3) ;

exec dbms_logmnr.add_logfile('/data/arch2/6_1_855409270.arc',3) ;

exec dbms_logmnr.add_logfile('/data/arch2/7_1_855409270.arc',3) ;

exec dbms_logmnr.add_logfile('/data/arch2/8_1_855409270.arc',3) ;

exec dbms_logmnr.add_logfile('/data/arch2/9_1_855409270.arc',3) ;

exec dbms_logmnr.add_logfile('/data/arch2/10_1_855409270.arc',3) ;


-- 삭제 예제

exec dbms_logmnr.add_logfile('/dbms/oracle/product/oradata/SOLEXTDEV/redo03.log',2) ;

exec dbms_logmnr.add_logfile('/dbms/oracle/product/oradata/SOLEXTDEV/redo01.log',2) ;

exec dbms_logmnr.add_logfile('/dbms/oracle/product/oradata/SOLEXTDEV/redo02.log',2) ;

exec dbms_logmnr.add_logfile('/data/arch2/2_1_855409270.arc',2) ;

exec dbms_logmnr.add_logfile('/data/arch2/1_1_855409270.arc',2) ;

exec dbms_logmnr.add_logfile('/data/arch2/6_1_855409270.arc',2) ;

exec dbms_logmnr.add_logfile('/data/arch2/7_1_855409270.arc',2) ;

exec dbms_logmnr.add_logfile('/data/arch2/8_1_855409270.arc',2) ;

exec dbms_logmnr.add_logfile('/data/arch2/9_1_855409270.arc',2) ;

exec dbms_logmnr.add_logfile('/data/arch2/10_1_855409270.arc',2) ;



7. 등록 상태 확인

set linesize 200

col db_name for a15

col filename for a50

select db_name, filename from v$logmnr_logs ;



8. LogMiner를 이용한 분석 시작(TEMP 테이블스페이스 공간이 넉넉해야함.)

exec dbms_logmnr.start_logmnr(dictfilename=>'/data/logmnr/dict03.dat',-

options=>dbms_logmnr.ddl_dict_tracking+dbms_logmnr.committed_data_only) ;



9. 결과 조회

col username for a10

col opration for a10

col sql_redo for a50

select timestamp,username, operation, sql_redo

from v$logmnr_contents

where seg_name='TEST1' ;



Posted by Tiwaz
ORACLE2014. 8. 12. 14:17

Supplemental logging이란 데이터에 DML이 발생할 경우 redo log에 추가적인 내용을 기록하여 복구에 도움이 되고자 할 때 설정해야 하는 기능.


# 약식 설정 및 확인

# 확인

select supplemental_log_data_min from v$database ;


# Database Level Supplemental log ENABLE

alter database add supplemental log data ;


# Database Level Supplemental log DISABLE

alter database drop supplemental log data ;


# Table Level Supplemental log ENABLE

alter table scott.emp add supplemental log data (all) columns ;


# Table Level Supplemental log DISABLE

alter table scott.emp drop supplemental log data (all) columns ;



# 상세 설정 옵션 및 확인

# 확인

select supplemental_log_data_min, supplemental_log_data_pk, supplemental_log_data_ui, supplemental_log_data_fk, supplemental_log_data_all from v$database ;


# 설정 옵션

-all columns 

-primary key columns

-unique columns

-foreign key columns


# ENABLE

alter database add supplemental log data (all|primary key|unique|foreign key) columns ;


# DISABLE

alter database drop supplemental log data (all|primary key|unique|foreign key) columns ;



Posted by Tiwaz
ORACLE2014. 8. 11. 10:58

오라클 RAC 설치 중 GRID 설치 시 ASM 디스크를 선택해야 하는 옵션에서

High, Normal, External Redundancy를 선택해야할 때 왜 선택을 해야하는지에 대해 정리가 잘 되있어서 퍼옴...


원문 링크 : https://blogs.oracle.com/ODA/entry/asm_normal_redundancy_versus_high


ASM Normal Redundancy versus High Redundancy on Oracle Database Appliance

The availability of normal redundancy configuration option for Automatic Storage Management (ASM) on Oracle Database Appliance starting with OAK version 2.4 allows for additional usable space on Oracle Database Appliance (about 6 TB with Normal Redundancy versus about 4 TB with High Redundancy). This is great news for many customers. Some environments, such as test and development systems, may benefit significantly as a result of this new option. However, the availability of Normal Redundancy option obviously should not be taken to mean that choosing Normal Redundancy may the best approach for all database environments. High redundancy would still provide a better and more resilient option (and may be a preferred choice) for mission critical production systems. It is therefore an option and not the default configuration choice. Many customers may choose to use Normal Redundancy for test, development, and other non-critical environments and High Redundancy for production and other important systems.

In general, ASM supports three types of redundancy (mirroring*) options.

High Redundancy - In this configuration, for each primary extent, there are two mirrored extents. For Oracle Database Appliance this means, during normal operations there would be three extents (one primary and two secondary) containing the same data, thus providing “high” level of protection. Since ASM distributes the partnering extents in a way that prevents all extents to be unable due to a component failure in the IO path, this configuration can sustain at least two simultaneous disk failures on Oracle Database Appliance (which should be rare but is possible).

Normal Redundancy - In this configuration, for each primary extent, there is one mirrored (secondary) extent. This configuration protects against at least one disk failure. Note that in the event a disk fails in this configuration, although there is typically no outage or data loss, the system operates in a vulnerable state, should a second disk fail while the old failed disk replacement has not completed. Many Oracle Database Appliance customers thus prefer the High Redundancy configuration to mitigate the lack of additional protection during this time.

External Redundancy - In this configuration there are only primary extents and no mirrored extents. This option is typically used in traditional non-appliance environments when the storage sub-system may have existing redundancy such as hardware mirroring or other types of third-party mirroring in place. Oracle Database Appliance does not support External Redundancy.

*ASM redundancy is different from traditional disk mirroring in that ASM mirroring is a logical-physical approach than a pure physical approach. ASM does not mirror entire disks. It mirrors logical storage entities called ‘extents’ that are allocated on physical disks. Thus, all “mirrored” extents of a set of primary extents on a given disk do not need to be on a single mirrored disk but they could be distributed across multiple disks. This approach to mirroring provides significant benefits and flexibility. ASM uses intelligent, Oracle Database Appliance architecture aware, extent placement algorithms to maximize system availability in the event of disk failure(s).


Posted by Tiwaz
ORACLE2013. 7. 31. 21:28

1. Transportable Tablespace ?

v 다른 DATABASE의 테이블스페이스들을 복사하여 사용하는 기능으로 Oracle 8i부터 제공
v datafileOS level에서 복사하여 이관하는 방식으로  동일한 데이터에 대해 import/export 또는 unload/load 보다

   빠른 성능을 보장함.

v 서로 다른 플랫폼 간의 데이터 이동을 지원하므로 데이터 배포 작업을 한층 쉽고 빠르게 수행할 수 있음.
v Oracle 9i 이전 버전의 경우 동일한 block 크기이거나 DB내 기본 block 크기와 동일해야만 가능했으나

    Oracle 9i 이후 부터는 block 크기가 다르더라도 가능함.(, 테스트가 필요함)

v Oracle 10g부터 서로 다른 플랫폼간에 Tablespace 전송이 가능.(Solraris -> HP-UX)




2. Transportable Tablespace을 사용하는 경우

v 데이터웨어하우징 테이블 내의 파티션 테이블을 export/import 할 때
v Cross-Domains(CDs) 상의 구조화된 데이터를 Publising 할 때
v 여러 Database에 있는 여러 개의 Read-Only Tablespace를 복사하고자 할 때
v 오래된 데이터를 Archiving 하고자 할 때
v Tablespace Point-in-time-recovery를 수행 할 때

    TSPITR : RMAN을 이용하여 하나 또는 다수의 Tablespace를 빠르게 복구하는 방법.

v 다양한 RDBMS 버전과 OS플랫폼 사이에서 데이터베이스를 이전하고자 할 때.



3. Transportable Tablespaces를 사용할 때 사전 유의 사항.

 v SYSTEM, SYSAUX, TEMP Tablespace의 경우 이전 불가.

v 제약 및 제한사항 확인.

   Source DatabaseTarget Database가 호환이 되는지.(Platform, CharacterSet, XML Type의 테이블 스페이스 등.)

v 손상 버그(corruption bug)와 일반적인 이슈 확인.

   Source DatabaseTarget Database 버전에 따라 몇 가지 버그 발생.

v Source Database에서 유효하지 않은 객체 해결.

   ExportINVALIDObject가 없어야하며, SYS소유의 INVALID Object로 인해 Export를 실패할 수 있음.

v Export 하고자 하는 TTS Tablespace들이 자신을 포함하는지 확인.

   Export하고자 하는 TablespaceObject들이 다른 Tablespace를 참조하면 안됨. DBMS_TTS.TRANSPORT_SET_CHECK 패키지 이용

v Row 없이 전체 구조 Export 하기.(META정보)
v Import 전에 Target Databaseusername이 있는지 확인.

   사용자가 없을 경우 신규로 생성 또는 기존 user가 기본 Tablespace를 사용할 경우 임시 Tablespace로 변경.

v Tablespace 플러그인 후 전체 구조(META정보)Import하기.
v 운영 데이터이므로 연습 후 수행, Source Database 일정 기간 유지 클린(Clean up) 유의.



Posted by Tiwaz
ORACLE2012. 1. 10. 21:14
sga_max_size와 sga_target 사이즈 변경 작업을 하고 오라클을 재구동 하였다.
SGA의 전체 사이즈보다 두 값의 초과 하여 서버 구동이 되지 않았다.

이유는 shared_pool_size와 java_pool_size가 SGA 전체 메모리 크기보다 클 경우라고 한다.

SQL> startup
ORA-00821: Specified value of sga_target 16M is too small, needs to be at least 128M
SQL> startup
ORA-00093: _shared_pool_reserved_min_alloc must be between 4000 and 0
연속으로 에러가 발생한다.

해결 방법은 spfile을 pfile로 생성하여 sga_target의 크기를 수정 후 다시 spfile로 생성하면 된다.

SQL> create pfile from spfile;
vi를 이용하여 init<SID>.ora 파일 수정
SQL> startup pfile="init<SID>.ora"
DB 구동이 정상적으로 되면 pfile을 spfile로 생성
SQL> create spfile from pfile
만약 
ERROR at line 1:
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file
'/u01/app/oracle/product/10.2.0/db_1/dbs/init<SID>.ora'
파일을 못찾았을 경우 DBMS 최초 설치시 $ORACLE_BASE/admin/<SID>/pfile/init.ora.xxxx 파일을 dbs폴더에 생성 해준다.


나의 경우 pfile 생성시 spfile의 바이너리가 깨져 아래의 에러가 발생하였다.
그래서 아래와 같이 $ORACLE_BASE/admin/<SID>/init.ora.xxx 파일을 이용하여 startup을 할 수 있었다.

SQL> show parameter pfile
ORA-00600: internal error code, arguments: [kspgip1], [101], [930], [1],
[sql92_security], [], [], []


SQL> shutdown immediate;
ORA-00600: internal error code, arguments: [kspgip1], [101], [508], [1], [_max_arch_lns_wait], [], [], []

SQL> startup
ORA-00821: Specified value of sga_target 16M is too small, needs to be at least 128M
SQL> startup pfile="initTIWAZ.ora"
ORACLE instance started.

Total System Global Area  603979776 bytes
Fixed Size                  1218220 bytes
Variable Size             184551764 bytes
Database Buffers          402653184 bytes
Redo Buffers               15556608 bytes
Database mounted.
Database opened.

Posted by Tiwaz
ORACLE2010. 11. 12. 15:02


win XP SP2 에서 Oracle 11g 설치를 처음으로 해봤다.
설치 완료 후 서비스 관리자 항목을 보던중 아래와 같은 오류 메세지를 뿌리며 서비스가 구동이 되지 않더라...

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
다음 오류로 인해 Enterpirse Manager 구성을 실패했습니다.
Database Control을 시작하는 중 오류가 발생했습니다.
자세한 내용은 C:\oracle\administrator\cfgtoollogs\dbca\orcl\emConfig.log에 있는 로그 파일을 참조하십시오.
나중에 C:\oracle\Administrator\product\11.1.0\db_1\bin\emca스크립트를 수동으로 실행하여 Enterprise Manager로 이 데이터베이스 구성을 재시도 할 수 있습니다.

-----------------------------------------------------------------------------------------
데이터베이스 구성 파일은 C:\oracle\Administrator에 설치되었으며 설치 시 선택한 다른 구성 요소는 C:\oracle\Administrator\product\11.1.0\db_1에 설치되었습니다. 실수로 이들 구성 파일을 삭제하지 않도록 주의하십시오.

설치 프로그램에서 "Oracle Windows 인터페이스" 구성 요소 그룹에 제품을 설치했습니다. Microsoft Visual Studio에서 Oracle Database를 사용하여 완벽한 개발 작업을 수행할 수 있도록 지원하기 위해 Oracle은 Oracle Technology Network에서 "Oracle Developer Tools for Visual Studio .NET"의 최신 버전을 다운로드하여 설치할 것을 권장합니다.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

문제를 해결 해보고자 구글링을 하다가 찾은 자료 -

문제시 자삭 하겠지만... 참조 경로는 아래와 같다.
http://pavandba.wordpress.com/2010/05/18/em-dbconsole-not-started-and-giving-net-helpmsg-3547/

내용인 즉 Oracle 10g 기준으로 em을 재구성 하는 내용 ;;;

원본 파일이라 수정은 차후 정리하여 새로 작성 하겠음...



1) i checked the status of dbconsole as follows

C:\Documents and Settings\oracms>emctl status dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
https://cmsp-database.klpcph.local:5500/em/console/aboutApplication
Oracle Enterprise Manager 10g is not running.
——————————————————————
Logs are generated in directory N:\oracle\product\10.2.0\db/cmsp-database.klpcph.local_KLPPROD01/sys
man/log

2) then i tried starting dbconsole and got following error

C:\Documents and Settings\oracms>emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
https://cmsp-database.klpcph.local:5500/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control …The OracleDBConsoleKLPPROD01 service is s
tarting…………………………………………………………………………………
……………………………………………………………………………………….
……………………
The OracleDBConsoleKLPPROD01 service could not be started.

A service specific error occurred: 1.

More help is available by typing NET HELPMSG 3547.

3) then i tried to find out what this message is

C:\Documents and Settings\oracms>NET HELPMSG 3547

A service specific error occurred: ***.
EXPLANATION

A service-specific error occurred.

ACTION

Refer to the Help or documentation for that service to determine the problem.

as you can see we cannot understand what is the exact problem here…

4) sometimes this problem may occur because SYSMAN and DBSNMP users got locked. so i checked their account status

C:\Documents and Settings\oracms>sqlplus “/ as sysdba”

SQL*Plus: Release 10.2.0.4.0 – Production on Tue May 18 08:26:24 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Release 10.2.0.4.0 – 64bit Production

SQL> select username,account_status from dba_users;

USERNAME                       ACCOUNT_STATUS
—————————— ——————————–
MGMT_VIEW                      OPEN
SYS                            OPEN
SYSTEM                         OPEN
DBSNMP                         OPEN
SYSMAN                         OPEN

so from above, its clear that both the user accounts are open

5) then i checked if agent is running or not

C:\Documents and Settings\oracms>emctl status agent
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
—————————————————————
Agent is Not Running

6) because agent is not running, i tried to start it

C:\Documents and Settings\oracms>emctl start agent
Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0
Copyright (c) 1996, 2007 Oracle Corporation.  All rights reserved.
The service name is invalid.

More help is available by typing NET HELPMSG 2185.

as mentioned i tried to check what this message is…

C:\Documents and Settings\oracms>NET HELPMSG 2185

The service name is invalid.
EXPLANATION

You tried to start a service that is not configured on this system.

ACTION

Check the spelling of the service name or check the configuration information for the service using
the Services option from Server Manager.

7) restarting the server could be a solution, but we cannot do that if it is a production database. so i recreated repository
Do remember, recreating enterprise manager repository will not have any impact on database functionality

before recreating, take out the info like
Database hostname
Database SID
Listener port number
password for SYS user
password for DBSNMP user
password for SYSMAN user
also, it is important that DBSNMP and SYSMAN user’s account should be opened

use the following command to recreate repository

C:\Documents and Settings\oracms>emca -config dbcontrol db -repos recreate

STARTED EMCA at May 18, 2010 8:28:24 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: KLPSTAGE01
Database Control is already configured for the database KLPSTAGE01
You have chosen to configure Database Control for managing the database KLPSTAGE01
This will remove the existing configuration and the default settings and perform a fresh configurati
on
Do you wish to continue? [yes(Y)/no(N)]: y
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
—————————————————————–

You have specified the following settings

Database ORACLE_HOME ……………. N:\oracle\product\10.2.0\db

Database hostname ……………. klpdbscph601.klpcph.local
Listener port number ……………. 1521
Database SID ……………. KLPSTAGE01
Email address for notifications ……………
Outgoing Mail (SMTP) server for notifications ……………

—————————————————————–
Do you wish to continue? [yes(Y)/no(N)]: y

this successfully created repository and started my dbconsole

'ORACLE' 카테고리의 다른 글

Transportable Tablespaces - TTS  (0) 2013.07.31
Oracle 10g - SGA 사이즈 변경시 SGA 전체 메모리 크기보다 클 경우 spfile 복구  (0) 2012.01.10
WHERE 1=1  (0) 2010.07.19
도메인(Domain)  (0) 2010.06.08
Procedure & Fuction 삭제  (0) 2010.05.19
Posted by Tiwaz
ORACLE2010. 7. 19. 00:35
1=1 은 참인 조건을 나타냅니다.
쿼리를 작성함에 있어
where 문이 처음 사용하느냐 아니면 and문을 추가 할것이냐에 따라
고민않고 일단 where 문만 쓰고.. and문을 추가해서 작성할때;;
대략 요약하면 이렇습니다- 허접하지만 쓸만한기능;;

예)
SELECT *
FROM emp
WHERE  1 = 1
-----추가 조건------
AND n1 =  조건
AND n2 =  조건
... n
Posted by Tiwaz
ORACLE2010. 6. 8. 09:33

참조- 모름; 문제시 삭제 처리하겠습니다-_-

도메인(Domain)


한 애트리뷰트에 나타나는 값들은 하나의 도메인으로부터 유도된다. 도메인(domain)은 한 애트리뷰트에 나타날 수 있는 값들의 집합이다. 각 애트리뷰트의 도메인의 값들은 원자값(도메인 제약조건)이다. 도메인은 프로그래밍 언어의 데이터 타입과 유사하다. 동일한 도메인이 여러 애트리뷰트에서 사용될 수 있다. 관계 데이터 모델에서 복합 애트리뷰트나 다치 애트리뷰트는 허용되지 않는다. 이런 특성을 제1정규형이라 부른다.

도메인의 장점은 한 스키마의 여러 애트리뷰트에서 사용되는 어떤 도메인의 데이터타입을 쉽게 변경할 수 있다는 것이다. 도메인을 정의한 곳에서 도메인 정의를 변경하면 도메인 정의를 사용하는 모든 곳에서 일관되게 적용된다. 도메인 정의에 디폴트값을 지정할 수 있다.

          CREATE DOMAIN DEPTNAME CHAR(10) DEFAULT '개발';

도메인이 더 이상 필요하지 않으면 DROP DOMAIN문을 사용하여 도메인을 제거할 수 있다.

          DROP DOMAIN DEPTNAME RESTRICT;
 
RESTRICT절을 명시하여 도메인을 제거하려 할 때 이 도메인 정의가 애트리뷰트정의에서 참조되고 있으면 도메인 제거가 거절된다.

Posted by Tiwaz
ORACLE2010. 5. 19. 23:41
- 프로시저 삭제
SQL> DROP PROCEDURE 프로시저명

- 함수 삭제
SQL> DROP FUNCTION 함수명

'ORACLE' 카테고리의 다른 글

WHERE 1=1  (0) 2010.07.19
도메인(Domain)  (0) 2010.06.08
Oracle 자료형태  (0) 2010.03.26
Column 추가  (0) 2010.02.24
파일 시스템의 데이터 종속/중복 문제점  (0) 2010.02.15
Posted by Tiwaz