SELECT OWNER , OBJECT_NAME , SUBOBJECT_NAME , OBJECT_TYPE , CREATED , LAST_DDL_TIME , TIMESTAMP , STATUS , TEMPORARY 
FROM ALL_OBJECTS 
WHERE OBJECT_TYPE = 'TABLE'
ORDER BY CREATED DESC ;

 

https://hello-nanam.tistory.com/50


ctr;l + f2 : 책갈피 설정, 해제

f2 : 책갈피 사이 이동



CTRL + E : explain plan 보기

(테이블이름을 선택하고 ) ALT + C : 테이블 컬럼에 대한 상세 정보를 보여준다. F4 는 전체 스크립트(create table ....)



CTRL + T: 새 창 열기

CTRL + ENTER : ‘;’ 단위로 커리 실행 (쿼리 1 개만 실행된다)

CTRL + L : 선택한 쿼리만 실행
F5 : SQL Tool 에 적혀있는 모든 쿼리를 실행
F4 : 테이블 상세 정보를 볼 수 있는 페이지로 이동.
  보고자 하는 테이블에 커서 또는 드래그를 한 다음에 F4 실행 버튼을 누른다.
F8 : 이전에 실행한 쿼리 목록을 볼 수 있음.
CTRL + U : 소문자 변환
CTRL + SHIFT + U: 대문자 변환



oracle sqlplus 팁

oracle 2013. 12. 9. 15:02

1. shell 에 있는 파일을 읽어와서 실행

  SQL> @1.sql

2.페이지 없앰

 SQL> set pause off



INGNORE=Y

이미 테이블이 있을 때 쓴다



원격 오라클 DB 에 접속이 무척 느렸다.
클라이언트 장비 /etc/hosts 파일에 클라이언트 호스트 이름을 등록해 주었더니 잘 된다
왠 조화일까?

게시판 만들 때 쓰는 oracle query 한 페이지에 보여주는 목록이 15 개이고 title 에 "질문" 이라는 문자열이 포함된 화면중 화면 번호가 1 인 것 SELECT * FROM ( SELECT AA.*, ceil(rownum/15) page FROM ( SELECT board_id, mtext_id, accnt_id, title, nickname, decode(to_char(sysdate, 'yyyymmdd'), to_char(create_time, 'yyyymmdd'), to_char(create_time, 'hh:mi:ss'), to_char(create_time, 'mm/dd hh:mi')) , view_cnt, reply_cnt, rec_score, type, is_delete, exp FROM MainText WHERE board_id = 2 AND INSTR(UPPER( title ), "질문") > 0 order by create_time desc ) AA ) WHERE page= 1

db (oracle) lock 상태일 때 catalina 로그 dead lock retry wait=<10000> driver= driver name= number of *free* connections=<0> max con=<0> min con=<50> prepared stmt cache size=<16> transaction manager= xid connection size=<0> StandardConnectionPoolDataSource: master prepared stmt cache size=<2> prepared stmt cache size =<16> StandardDataSource: driver= url= user= CoreDataSource : debug = description = login time out =<60> user = verbose = GenericPool: num of element =<10> minSize =<10> maxSize =<10> lifeTime =<600000> ngeneration =<1> getLockedObjectCount() =<1> getUnlockedObjectCount() =<0> getDeadLockMaxWait() =<300000> getDeadLockRetryWait() =<10000> Unlocked pool: Locked pool:

#!/bin/sh dummyvar=`sqlplus -s username/password <

SELECT (sysdate - to_date('01-JAN-1970','DD-MON-YYYY') ) * (86400) - (9*3600) AS dt FROM dual; SELECT (create_time - to_date('01-JAN-1970','DD-MON-YYYY') ) * (86400) - (9*3600) AS dt FROM maintext WHERE board_id = 1;

sqlplus 명령어

oracle 2006. 12. 27. 16:58
sqlplus에서
. ed[it] : 바로 전에 입력한 명령어를 vi 로 편집
. r[un] : buffer에 저장된 명령어 실행
. sav[e] filename[.sql] : buffer에 저장된 명령어 저장
 
  기타 유용한 명령어
. @file_name[.sql] : file_name 의 파일을 sqlplus 에서 실행
. desc[ribe] [user.]table_name[@db_name] : 지정된 테이블에 대한 상세
. spool file_name : 질의 결과를 file_name 파일에 저장
 >> spool off 결과 저장 중지