호스트 네임 정보 확인
$> /bin/hostname
|
OS Version 정보 확인
$> cat /proc/version
or
$> cat /etc/*-release | uniq
|
CPU 정보 및 코어 수 확인
$> cat /proc/cpuinfo $> grep "model name" /proc/cpuinfo | sort -u $> grep "physical id" /proc/cpuinfo | sort -u | wc -l | awk '{print "Physical CPU Count: " $1}'
$> grep -c processor /proc/cpuinfo | awk '{print "Total Core Count: " $1}'
|
Memory 정보 확인
$> cat /proc/meminfo | grep Mem
|
DISK 정보 확인
$> /bin/df -h
|
커널 파라미터 정보확인
$> grep kernel /etc/sysctl.conf | grep -v "#"
|
환경변수 정보 확인
$> cat ~/.profile or cat ~/.bash_profile
|
gcc-c++ 설치
[root@CHEROKY ~]# yum install gcc-c++
|
compile option
invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
|
sctp설치
# yum install lksctp-tools
# yum install lksctp-tools-devel
|
strace
strace gsqlnet nocs nocs --dsn=SUNDB
|
TERM
unset TERM
export TERM=xterm-color
|
Linux 정보 확인
$ uname -a
$ getconf LONG_BIT
$ cat /etc/issue
$ lscpu
$ free -m
$ df -h
$ echo $LANG
|
HPUX 정보확인
$ uname -a
$ getconf LONG_BIT
$ cat /etc/issue
$ machinfo
$ mpsched -s
$ df
$ echo $LANG
|
uptime (1분, 5분, 15분 동안 동작중인 프로세스 갯수의 평균값)
$ uptime
..., load average: 2.42, 2.42, 2.05
|
검색
하위 디렉토리 포함하여 검색어를 검색할때
find . -type -f -print | xargs grep "string"
하위 디렉토이 포함하여 string이란 문자열을 포함한 파일 검색
find . -type -f | xzrgs grep "string"
|
Windows복구
sfc /scannow
|
nmon logging
nmon -ft -s 1 -c 9999
http://jmkjb.tistory.com/entry/NMONAnalyser
prstat -L -p [pid]
|
gmaster clear
ps -ef | grep "gmaster" | grep $LOGNAME | grep -v grep | kill -9 `awk '{print $2}'`
ipcs -m | grep $LOGNAME | grep 0x0008 | awk '{print "ipcrm -m " $2}' | sh -v
|
dd
time dd if=/dev/zero of=./test_file bs=8192 count=262144
|
find
grep -i -n -R "LEN_AL"
find . -name 'CTimerManager.*' -print
find -name "*.sql" -exec grep -i "DROP TABLESPACE" {} \;
|
alter system
alter system plan_chche = off deffered;
alter system trace_optimizer = off deffered;
alter system set hint_error = on deferred ;
alter system set trace_optimizer = on deferred;
select * from x$sql_system_stat_exec_stmt;
select table_name from x$tables ;
ALTER SESSION SET HINT_ERROR = ON;
|
drop tablespace
DROP TABLESPACE tspace1 INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS;
|
LOCK WAIT
gSQL> select * from x$lock_wait;
GRANTED_TRANSACTION_SLOT_ID REQUEST_TRANSACTION_SLOT_ID
--------------------------- ---------------------------
42 27
42 51
// x$transaction 에서 해당 GRANTED_TRANSACTION_SLOT_ID 를 찾는다.
gSQL> select * from x$transaction where slot_id = 42;
ID SLOT_ID STATE ISOLATION_LEVEL VIEW_SCN COMMIT_SCN TCN BEGIN_TIME
---------------- ------- ------ --------------- -------- ---------- --- --------------------------
00129050004B002A 42 ACTIVE READ COMMITTED 17328680 -1 1 2012-09-17 13:58:19.135871
1 row selected.
// TRANSACTION ID HEXA값인 00129050004B002A 을 DECIMAL로 변경한다.
(새로운 버전은 DECIMAL로 출력됨)
// x$sm_sess_env 에서 DECIMAL값의 TRNAS-ID를 찾는다.
// TRANS_ID 값이 해당 session의 ID 임.
gSQL> select * from x$sm_sess_env where NAME = 'TRANS_ID' and value = 5225222857490474;
NAME ID VALUE
-------- -- ----------------
TRANS_ID 41 5225222857490474
1 row selected.
gSQL> alter system disconnect session 41;
gSQL> alter system kill session 41;
gSQL> commit;
gSQL> select * from x$lock_wait;
no rows selected.
gSQL>
gSQL>
|
session 찾기
select * from x$transaction;
select * from x$sm_sess_env where trans_id = 82
select * from x$session where id = 82
|
AGABLE_SCN
SELECT C.VALUE, B.* ,A.*
FROM X$SM_SESS_ENV A,
X$SESSION B,
X$SM_SYSTEM_INFO C
WHERE 1=1
AND C.NAME = 'AGABLE_SCN'
AND C.VALUE = A.VALUE
AND A.ID = B.ID;
|
undo full
select * from x$session;
select * from x$transaction;
select * from x$sm_sess_env;
select * from x$sm_system_info;
pstack
select * from x$sm_sess_env where name = 'MIN_STMT_VIEW_SCN';
select * from x$sm_system_info;
select * from x$sm_sess_env where name = 'MIN_STMT_VIEW_SCN' and value <= 23068680 ;
|
disconnect session
select * from x$session;
select 'alter system disconnect session ', id, ',', SERIAL, ';' from x$session where user_id <> 0 and status <> 'ACTIVE';
select session_id() from dual;
select 'alter system kill session ', id, ',', SERIAL, ';' from x$session where user_id <> 0 and status = 'KILLED';
select 'alter system kill session ', id, ',', SERIAL, ';' from x$session where user_id <> 0 and status = 'KILLED' and WATCH='LEAVE';
alter system disconnect session 9; <- session 강제 종료
alter system kill session 9; <- killed 상태 일경우 (에러 안나면 restart 안해도 됨)
|
CALL_PARSE
select * from x$session;
select * from x$sql_sess_env where name = 'CALL_PARSE';
|
csv
SET PAGESIZE 0
SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 1000
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET MARKUP HTML OFF SPOOL OFF
SET COLSEP ','
spool TBSV_FUTOPT_ACNT_AGG_DD
spool off
|
valgrind
valgrind --tool=memcheck --leak-check=yes <pgname>
|
db 상태조회
select * from x$kn_proc_env;
select * from x$session;
select * from x$transaction;
select * from x$lock_wait;
select * from x$sm_system_info;
select * from x$sm_sess_env;
select * from x$sm_system_info;
select * from x$transaction;
select * from x$sm_sess_env;
select * from x$segment where tbs_id=1;
select * from x$sm_sess_stat;
select * from x$sql_sess_env;
select * from x$sql_proc_env;
select * from x$exe_proc_env;
select * from x$exe_sess_env;
select * from x$exe_system_info;
select * from x$ss_sess_stat;
select * from x$sm_proc_env;
|
set property
alter session set block_read_count=20;
|
drop_caches
# delete cache
$> echo 3 > /proc/sys/vm/drop_caches
# restore
$> echo 0 > /proc/sys/vm/drop_caches
|
market-oversight
#!/bin/sh
svn co https://110.3.15.12/svn/market-oversight/trunk@126553 .
svn co https://110.3.15.12/svn/market-oversight/ market-oversight
svn up trunk
svn co svn://110.3.15.12/svn/market-oversight/ .
|
table freeness
select * from D$MEMORY_SEGMENT_BITMAP('TABLE,T1') where freeness = 'FR';
|
add file load 검증
select * from d$tablespace_extent('MEM_UNDO_TBS') where datafile_id = 0;
select * from d$tablespace_extent('MEM_DATA_TBS') where datafile_id = 0;
|
Insufficient resource (CLIENT_MAX_COUNT, PROCESS_MAX_COUNT) 갯수와 동일 해야함.
select * from x$kn_proc_env where state = 'UNUSED';
select * from x$kn_proc_env where state = 'USED';
|
timestamp field
transaction_timestamp : 같은 transaction에서는 같은 시각
statement_timestamp : 같은 statement 에서 같은시각
row_timestamp : with timezone (필드타입이 timestamp with timezone 이어야 함 )
row_localtimestamp : without timezoe
|
truncate table 권한
grant drop any table on database to username;
|
scp
scp username@100.100.100.11:/home/sunje/sundb/product/sundb-ser* .
|
log group
gSQL> select * from x$log_group;
GROUP_ID STATE FILE_SEQ_NO FILE_SIZE PREV_LSN SWITCHING_SBSN MEMBER_COUNT
-------- -------- ----------- --------- -------- -------------- ------------
0 INACTIVE 57 104857600 19408520 451641 1
3 INACTIVE 58 104857600 19439255 656440 1
1 CURRENT 59 104857600 19837497 42064 1
2 INACTIVE 56 104857600 19148273 246849 1
4 rows selected.
|
ctags
ctags -R .
^ + ]
^ + t
|