This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# screenrc | |
# コマンド | |
escape ^x^x | |
# changes the directory for hardcopy. | |
#hardcopydir 'screen/hardcopy' | |
hardcopydir '~/work/tsuka' | |
hardcopy_append on | |
# 起動時メッセージ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- テーブルスペース利用率 | |
!BIND SET TBSNAME='%' -- テーブルスペース名称 | |
SELECT | |
TABLESPACE_NAME , | |
TO_CHAR( NVL(TOTAL_BYTES / 1024 / 1024, 0) , '999,999,999' ) AS "SIZE(MB)" , | |
TO_CHAR( NVL( (TOTAL_BYTES - FREE_TOTAL_BYTES) / 1024 / 1024 , 0 ) , '999,999,999' ) AS "USED(MB)" , | |
TO_CHAR( NVL(FREE_TOTAL_BYTES / 1024 / 1024, 0) , '999,999,999' ) AS "FREE(MB)" , | |
ROUND( NVL( (TOTAL_BYTES - FREE_TOTAL_BYTES) / TOTAL_BYTES * 100 , 100 ) , 2 ) AS "RATE(%)" | |
FROM | |
( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Show all tables | |
> SELECT TABLE_NAME FROM TABS | |
-- List fields from a table | |
> SELECT * | |
FROM user_tab_cols | |
WHERE table_name = 'table_name' | |
-- List some fields fields from a table | |
> SELECT column_name, data_type, FROM user_tab_cols WHERE table_name = 'table_name' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
/** | |
* ProcessBroker pb = new ProcessBroker("ps -ef | grep java".split(" ")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find text in files | |
find | xargs grep 'text to find' -l | |
# Find and exec command | |
find -name '*.bak' -exec rm {} \; | |
# Find only dirs | |
find -type d | |
# Find only files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- n行の空の仮想表を生成 | |
SELECT | |
ROWNUM AS RN | |
FROM | |
DUAL CONNECT BY LEVEL <= 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 確認 | |
SELECT * FROM V$PQ_SESSTAT | |
WHERE STATISTIC LIKE '%Parallelized'; | |
-- パラレルクエリ有効化 | |
ALTER SESSION ENABLE PARALLEL DML; | |
-- パラレルクエリ | |
SELECT/*+ PARALLEL ( A, 2 ) */ * FROM DUAL A; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ./ -type f -maxdepth 1 | xargs -i mv {} {}_YYYYMMDD | |
#1. findコマンドで現在のディレクトリ以下 ( ./ ) にあるファイル ( -type f ) の一覧を取得。(ただし、サブディレクトリは除く ( -maxdepth 1 ) | |
#2. 上の結果をパイプでつないで、xargsコマンドで “mv {} {}_YYYYMMDD” に渡す。(xargs の-iオプションで{}の部分がファイル名に変換しつつ実行されます) | |
#上をちょっと応用するとこんなこともできます。 | |
find ./ -type f -maxdepth 1 | grep _YYYYMMDD | sed 's/\.end//' | xargs -i mv {}.end {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 可変長引数のサンプル | |
#import <stdarg.h> | |
@interface ExampleVaList : NSObject | |
- (void) doSomething:(NSString *) arg, ... NS_REQUIRES_NIL_TERMINATION; | |
@end | |
@implementation ExampleVaList | |
- (void) doSomething:(NSString *) arg, ... { | |
va_list valgList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**---- 最適化目標 ----**/ | |
-- 全体最適 | |
SELECT /*+ ALL_ROWS */ FROM DUAL; | |
-- 最初のn行に対して最適化 | |
SELECT /*+ FIRST_ROWS (1) */ FROM DUAL; | |
/**---- アクセスパス ----**/ | |
-- テーブル全体を走査 | |
SELECT /*+ FULL(A) */ FROM DUAL A; |
OlderNewer