[ORACLE] 한달쿼리

Posted 2009/06/27 13:40 by 애플자라
SELECT TO_DATE('20090101','YYYYMMDD')+ROWNUM-1
FROM EMPLOYEES
WHERE ROWNUM < 33
크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : Oracle, YYYYMMDD

[ORACLE] ORA-28000: the account is locked 오류시

Posted 2009/06/27 11:13 by 애플자라
sqlplus hr/hr

-- ORA-28000: the account is locked 오류시
-- 30일동안(Default) 해당 계정으로 로그인을 하지 않았을 경우 lock 걸림
--

sqlplus "/ as sysdba"  로 접속 

-- lock 걸린 User 찾기
SELECT username, account_status, to_char(lock_date,'yy/mm/dd hh24:mi') lock_date, profile
  FROM dba_users;
 
-- Lock 풀기 (유저가 system 일 경우)
ALTER USER SYSTEM account unlock; 

-- 패스워드 변경
ALTER USER SYSTEM IDENTIFIED BY manager;

sqlplus hr/hr
conn hr/hr

C:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN(실행계획)

@utlxplan.sql
desc plan_table
set autotrace traceonly explan
select * from employees;

크리에이티브 커먼즈 라이선스
Creative Commons License

rm시 물어볼때

Posted 2009/06/25 16:32 by 애플자라
unalias rm or \rm
크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : Linux, RM, unalias

[ORACLE] /*+ INDEX */ 를 통한 셀렉트

Posted 2009/06/13 15:53 by 애플자라
  SELECT  /*+ index(a pk_${LIST_TABLE}) */ 
    ERROR_CODE AS CURRENT_CODE
  FROM ${LIST_TABLE} a
  WHERE POST_ID='${POST_ID}'
  AND  MEMBER_ID='${M_ID}'

SELECT /*+ INDEX DESC (A.IDX) */ 
FROM TAB1 A
WHERE 부서번호 = 'B1'

인덱스로 인한 부하를 줄여줌
크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : Index, Oracle

[ORACLE] 대랑 Delete 작업시..Direct Loading

Posted 2009/06/13 11:43 by 애플자라
Delete -> Insert

1. commit;

alter session enable parallel dml;

alter session set sort_area_size = 1000000;

 

2. create table temp_table

storage(initial 50m) -- 충분한 extent 할당으로 동적 exent 할당 예방

tablespace another_disk_ts -- 서로 다른 디스크에 저장하여 I/O 분산

nologging -- log양을 최소화시킴

as

select * from the_table

where 1=2; -- table 정의만 생성

 

3. insert /*+ parallel(temp_table, 4) */ -- 병렬 direct path loading

into temp_table

nologging

select * from the_table

where 삭제되지 않는 row만;

 

4. truncate table the_table reuse storage; -- 저장공간은 그대로 두고 row만 삭제

 

5. insert /*+ parallel(the_table, 4) */

into the_table

nologging

select * from temp_table;

 

 

위 방법은 3가지 원리를 이용한 것입니다.

1. delete보다 insert가 훨씬 적은양의 rollback 및 redolog 양을 발생시킴.

2. delete보다 truncate가 훨씬 빠름.

3. parallel direct path loading 및 nologging을 이용한 속도향상

 

delete되는 양이 많다면 위 방법이 효과가 있을 것입니다.

parallel operation은 CPU 가 많고 메모리도 충분할 때 효과가 있습니다.

[출처] 대랑 Delete 작업시..|작성자 난나



크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : delete, Direct loading, Oracle

[ORACLE] Direct loading(오라클퍼포먼스튜닝)

Posted 2009/06/13 10:49 by 애플자라
대용량 Insert시 집에가고싶을때..

Insert into or Insert into ... Select ...(X)

insert /*+ append */ into emp nologging select * from emp;  (O)
insert /*+ PARALLEL(emp, 4) */ into emp nologging select * from emp;  (O)

장점
1. Memory 안씀
2. HWM Bumpup 안씀
3. Undo 안씀
Undo에는 각 user들의  transaction의 내용들이 기록(블록 위치)
4. Log ahead 안씀(옵션)
5. 1분당 2GB처리

크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : APPEND, Direct loading, Oracle


무선 인터넷을  IP오퍼레이터  이용 해서 여러곳에서 인터넷을 즐기는 유져들에 게
권장..                                   

기존 프로파일을  *.REG 형식으로 저장하는 방법입니다..참고하세요.. 

1.시작->실행->regedit
2.레지스트리 편집기에서 [HKEY_USERS] - [.DEFUALT] - [Software]- [IPOperator] - 백업하려는 프로파일 마우스 오른쪽 버튼 - 내보내기 하실경우( 설정 파일이름.REG) 로저장 됩니다.

3. 설정된 파일을 적용 하는 방법은..더블클릭만 하시면 끝 입니다.

크리에이티브 커먼즈 라이선스
Creative Commons License

[Eclipse] JAR Class Finder

Posted 2009/05/14 14:22 by 애플자라

JAR Class Finder는 원하는 클래스 파일이 어느 JAR 파일에 포함되어 있는지를 검색해주는 툴로서, IBM alphaWorks에서 만든 Eclipse/WSAD 플러그인입니다. 개인적으로 오래전부터 매우 유용하게 사용하고 있는 플러그인입니다. 단점은 플러그인이기때문에 당연히 Eclipse나 WSAD를 띄운 상태에서만 사용할 수 있다는 것입니다.

Getting JarClassFinder to work in Rational Application Developer v7.x

 Technote (troubleshooting)
 
Problem(Abstract)
As packaged, JarClassFinder cannot be used with Rational Application Developer (RAD) version 7.x
 
Symptom
 
Cause
This is due to a difference in the Eclipse plug-in architecture between RAD 6.x (Eclipse 3.0.2) and RAD 7.x (Eclipse 3.2.1)
 
Resolving the problem
Here is an updated JarClassFinder for RAD7.
  1. Copy this jar file ( com.ibm.hursley.jarclassfinder_2.1.0.jar ) to your
    <RAD-INSTALL-DIR>\plugins\ directory.
    <RAD-INSTALL-DIR> is where Eclipse.exe exists.This is NOT the SDP70Shared folder.
  2. Delete any old jarclassfinder directories you might have copied to that directory in the past.
  3. Start a command-line prompt, navigate to the <RAD-INSTALL-DIR> directory, where "eclipse.exe" is located.
  4. Start RAD with the "-clean" parameter : eclipse.exe -clean

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

Alternatively, use the JarClassFinder. 2.0.1 version available at
http://alphaworks.ibm.com/tech/jarclassfinder/download
  1. Extract the contents of the JarClassFinder.zip.
    You will see 2 unzipped directories -- "license" and "plugins".
  2. Copy the com.ibm.wpst.hursley.jarclassfinder_2.0.3 folder in the unzipped "plugins" directory to your
    <RAD-INSTALL-DIR>\plugins\ directory.
    <RAD-INSTALL-DIR> is where Eclipse.exe exists.This is NOT the SDP70Shared folder.
  3. Start a command-line prompt, navigate to the <RAD-INSTALL-DIR> directory, where "eclipse.exe" is located.
  4. Start RAD with the "-clean" parameter : eclipse.exe -clean

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

After RAD starts, you should be able to find the button for the JarClassFinder on the Toolbar:





If you do not see the JarClassFinder icon on the Toolbar, go to
Window > Show View > Other ... > Other (expand) > Jar Class Finder View:

크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : eclipse, Finder, jar

[Eclipse] EditorList Plug-in

Posted 2009/05/14 11:23 by 애플자라
About
The EditorList Plug-in provides a view that displays Eclipse's editors in a list for improved editor management.
The current version of the EditorList Plug-in is 1.0.7, released Aug. 4, 2005.
Get the EditorList Plug-in
SourceForge Project
Download the plug-in and participate in the project development
Install/Update site Install the EditorList Plug-in from within Eclipse using the EditorList Install/Update site:
http://editorlist.sourceforge.net/site
HOWTO
1. If you download the EditorList plug-in zip from the SourceForge project, install it by unzipping the contents of the archive to the "plugins" folder in your Eclipse install directory.
2. Open the EditorList view by clicking Window->Show View->Other...->Basic->EditorList
Screenshots
EditorList
Plain EditorList
Context menu
EditorList context menu
Decorators
EditorList with decorators enabled

크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : eclipse, EditorList

[ORACLE] NVL함수 & DECODE함수

Posted 2009/05/13 10:37 by 애플자라

오라클 함수

1. NVL함수
    NVL(value,1) 
     -> value가 null 일경우 1을 반환
                     그렇지 않을경우 value값을 반환
2.NVL2 함수  
NVL2(expr1, expr2, expr3) 함수는
   expr1이 null이 아니면 expr2를 반환하고,
   expr1이 null이면 expr3을 반환한다.

ex) select nvl2('','Corea','Korea') from dual;


3. DECODE 함수
   DECODE(value,null,"값1","값2")
   - > value값이 null일경우 "값1"을 반환
                       그렇지 않을 경우 "값2"반환
   DECODE함수의 1번인자와 2번인자를 비교하여 참일 경우 3번 인자, 거짓일 경우 4번 인자를 반환한다. 
크리에이티브 커먼즈 라이선스
Creative Commons License

Tag : DECODE, NVL, Oracle

« PREV : 1 : 2 : 3 : 4 : 5 : ... 31 : NEXT »