http://database.sarang.net/?inc=read&aid=24110&criteria=oracle&subcrit=qna&id=&limit=20&keyword=&page=7



Tom Kyte 글 답변중에 좋은 팁이 있어 글을 올립니다.

무한로우 생성 쿼리 입니다.

Oracle 9i 일 경우
SQL>select * from
        (select level from dual connect by level <= 10);

Oracle 10g 일 경우
SQL>select level from dual connect by level <= 10

원하는 rows 만큼 level <= ? 숫자를 넣어주세요.

이 쿼리는 상당히 유용합니다. 즉 예전에 copy_t 테이블로 사용하던

달력테이블이던지, 테이블을 가공할때 편합니다.

다음 url 클릭하시면은 어떤 예제일때 좋은지 제가 답변한 글입니다.

http://database.sarang.net/?inc=read&aid=24110&criteria=oracle&subcrit=qna&id=&limit=20&keyword=&page=7


- http://angel.sarang.net 정보균 -
Posted by [czar]
,

http://doylestownpa.us/webadvisor/tomcat5_log_rotation.html
Tomcat 5.0.x /4.1.x log rotation solutions

Tomcat has several log files in the logs directory that are auto-rotated on a daily basis, but that are not purged.  The exception to the rotation is the "catalina.out" file, which does not auto-rotate and can get quite large.  One solution on a unix server is to use "piped" logs that automatically rotate their name.

First, you will need the spk.log.rotate script, which should be placed in the Tomcat "logs" directory.  Be sure to 

chmod 755 spk.log.rotate

the script to make it executable, and make sure the path to perl on line 1 of the script is correct for your server.  This perl script will write each line to the properly named log file by checking the time and adjusting the file name accordingly. 

The bin/catalina.sh startup script for Tomcat 5.0.x (or 4.1.x) will need to be edited in two places.  In the two locations where the script says

>> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

it should be changes to these two lines (no space after the \ on first line):

2>&1 | "$CATALINA_BASE"/logs/spk.log.rotate \
"$CATALINA_BASE"/logs/catalina.out_log.%Y-%M-%D.txt &

That should change the catalina.out file into "logs" that rotate and appear similar to the other log files in that directory.  After restarting the server, you can delete the old catalina.out file.  There is a place in the startup script where it does an initial "touch" on the catalina.out file which is left unchanged, the next time the server is restarted an empty file will be created.  Just by executing the command "ls -al catalina.out" in the logs directory you will be able to tell the last time the server was started.

 Tomcat 5.0.x/4.1.x log Purge

The unix "find" utility is sometimes used to delete files of a certain age, but the syntax varies among the various flavors of *nix, and it can be difficult to delete files over a certain age.  Instead, a perl script is often used to handle the purging of old files.

First, you will need the spk.log.purge script, which should be placed in the Tomcat "logs" directory.  Be sure to 

chmod 755 spk.log.purge

the script to make it executable, and make sure the path to perl on line 1 of the script is correct for your server.  This perl script will delete files over a certain age if they have a certain pattern in their name.

From within the logs directory, you can run the script to purge files or simply display what would be purged.  To see all the files in the directory that are older than 1 day that end in ".txt", you could enter the command:

./spk.log.purge "." 1 ".txt$" test

The pattern ".txt$" is a regular expression that perl will use to see if the file name is eligible for deletion.  All files ending in ".txt" match that pattern.  Since we want to delete files with "_log.2" in the name, perhaps that is a better pattern to look for.  You can even get fancy, and have a pattern like "(_log.2)(.)*(.txt$)", which means it has to have "_log.2" in the name and have ".txt" at the end.

To purge all log files over 60 days old, from within the logs directory you could use this command: 

./spk.log.purge "." 60 "(_log.2)(.)*(.txt$)"

From cron as user root (or the user you run tomcat under), you could have an entry that does a cd to the logs directory and then executes the command every day at 1:05 am, such as: 

5 1 * * * cd /usr/local/jakarta-tomcat-5.0.28/logs; \
      ./spk.log.purge "." 60 "(_log.2)(.)*(.txt$)" >/dev/null 2>&1

Although it is often legal to use the \ continuation character in crontab files, it did not work on my Linux system (using the Matt Dillon dcron 2.3.3 engine.)  I ended up just putting it all on one line (without the \ char), and it then worked properly.  (If you want Matt Dillon's cron to support "\" chars, you can see my solution here.)





#!/usr/bin/perl
# (be sure to set this to your perl path and 'chmod +x' this script.)

# spk.log.rotate script for piped logging
#
# Copyright 2004 Steven P. Kneizys
#
# sample usage for piping from program "program":
#
#  ... program | spk.log.rotate /path/to/logs/%Y-%M-%D-logname_log
#

$logname_template = $ARGV[0];
$file = "";

while(<STDIN>) {
  $line = $_;
  $time = time;
  if (($file eq '') || ($time gt (60 + $last_time))) {
    chomp($mydate=`date +%Y-%m-%d`);
    $last_time = $time;
    (@date)=split(/-/,$mydate);
    $temp = $logname_template;
    $temp =~ s/%Y/$date[0]/gi;
    $temp =~ s/%M/$date[1]/gi;
    $temp =~ s/%D/$date[2]/gi;
  }
  if ($file ne $temp) {
    if ($file ne '') {close MYFILE;}
    $file = $temp;
    open MYFILE,">>$file";
    select((select(MYFILE), $| = 1)[0]); # autoflush
  }
  print MYFILE $line;
}
if ($file ne '') {close MYFILE;}


Posted by [czar]
,
지금 있는 현장에서 톰캣을 근 2년만에 다루게 되었다.
예전에는 톰캣로그를 날짜별로 남기려고 몇가지 작업을 했지만 톰캣 6.0에서는 날짜별로 저장되기에.. 그런가보다 했는데...
catalina.out파일에 로그가 계속 누적되는 것이다. 헐~

일단. 톰캣로그를 날짜별로 남기는 녀석이 누구인가 알아보니. tomcat6.0 conf디렉토리에 있는 logging.proerties파일에 정의된 *..org.apache.juli.FileHandler클래스들이다. 이 녀석들은 콘솔출력과 별개로 날짜별로 로그파일을 생성한다. 즉, 콘솔출력을 catalina.out으로 저장하는 부분만 막으면 문제는 해결된다.

      org.apache.catalina.startup.Bootstrap "$@" start >> /dev/null 2>&1 &
#      org.apache.catalina.startup.Bootstrap "$@" start \
#      >> "$CATALINA_BASE"/logs/catalina.out 2>&1 &

위와 같이 catalina.sh를 바꾸어주면 된다. 이런곳이 2군데 있다.


http://jaeda.egloos.com/1940588
Posted by [czar]
,
The Unicode Character Code Charts
http://www.unicode.org/charts/

한글코드 : \uAC00-\uD7AF
한글자모 : \u1100-\u11FF
한글반각전각 : \uFF00-\uFFEF
Posted by [czar]
,
분류 유니코드 값 이름 형식화된 이름(Format name)
공백 문자 \u0009 Tab <TAB>
  \u000B Vertical Tab <VT>
  \u000C Form Feed <FF>
  \u0020 Space <SP>
줄 끝 문자 \u000A Line Feed <LF>
  \u000D Carriage Return <CR>
그 외 유니코드 이스케이프 시퀀스 \u0008 Backspace <BS>
  \u0009 Horizontal Tab <HT>
  \u0022 Double Quote "
  \u0027 Single Quote '
  \u005C Backslash \
Posted by [czar]
,

싸이트

카테고리 없음 2009. 1. 7. 08:45
Posted by [czar]
,

KDiff3

WinMerge

Posted by [czar]
,
2008/11/24 10:11
posted by nona*
해가 갈수록 기억력은 감퇴하고..
메모하는 것조차 잊기도 하는 일이 발생하기도 합니다.




JEUS 4.2 의 관리자 비밀번호를 알아내는 방법입니다.
비밀번호가 Base64 인코딩 되어
C:\TmaxSoft\JEUS4.2\config\XXX\file-realm.xml 에 저장됩니다.

    <user>
        <user-name>administrator</user-name>
        <password>MTExMQ==</password>
        <role-name>system</role-name>
    </user>



인코딩/디코딩 클래스는 다음을 사용합니다.

jeus.security.Base64Coder (아마 5버전대 부터는 jeus.security.admin 패키지 안에 들어가는것 같습니다.)


C:\>java -classpath "C:\TmaxSoft\JEUS4.2\lib\system\jeus.jar" jeus.security.Base64Coder encode 1111
[encode] --> [ZW5jb2Rl] --> [encode]
[1111] --> [MTExMQ==] --> [1111]


위는 1111을 인코딩하여 file-realm.xml의 해당 부분을 대체 해 주었습니다.
잘 되네요..


java -classpath "C:\TmaxSoft\JEUS4.2\lib\system\jeus.jar" jeus.security.Base64Coder decode MTExMQ==

위 명령으로 디코딩하면 결과가 애매한 듯 합니다.
Posted by [czar]
,

webtoB는 웹 서버이다. JEUS는 웹 컨테이너이다.


webtoB standard edition에는 JEUS의 웹 컨테이너 엔진이 얹혀져서 나간다. 물론 많은 양의 데이터를 핸들링하기에는 적합하지 않다. 그렇게 하고 싶다면 JEUS를 같이 써서 해야한다. JEUS에서는 자체 웹서버를 포함하고 있다. 물론 내장된 웹서버는 webtoB이다. 물론 많은 동시 접속자 수를 핸들링하고 싶지만 내장된 웹서버로는 힘들다. 그건 그냥 개발 테스트용 웹서버로 보면 된다.

큰 사이트의 경우에는 2개를 연동해서 써야만 한다.

webtob와 제우스는 설치는 압축을 푼다음 install.sh를 실행시키면 된다.( unix기준 ) 설치 과정은 매뉴얼 참조하면된다.


각각의 제품은 XML을 이용하고 있다. 그리고 WebtoB는 이렇게 만들어진 XML문서를 컴파일 해야한다.
wscfl -i filename.m

으로 컴파일 해주면 wsconfig라는 파일이 생기고 webtob는 구동될 때 이 파일을 가지고 해당 정보를 로드한다. 물론 처음 구동시만 읽어들이기 때문에 변경시에는 웹서버를 다시 start시켜야 한다. 구동 명령은 wsboot이며 중지 명령은 wsdown이다. 이것은 해당 $webtob/bin디렉토리에 있다.
JEUS는 따로이 컴파일 할 것은 없으나 읽어들이는 XML파일들이 있다. 주로 많이 바뀌는 것이 WEBMain.xml이다.


JEUS 구동 명령어를 한번에 입력하는 것이다.

start : jeusp -xml -Uadministrator -Ppassword
down : jeusadmin hostname jeusexit -Uadministrator -Ppassword


아래의 내용은 WebtoB와 JEUS를 연동하는 환경 설정 파일( *.m, WEBMain.xml )의 내용이다.


1. WebtoB
=========================================
*DOMAIN
webtob
 
*NODE
nitgenaix    WEBTOBDIR="/users/hite95/webtob",         <== WebtoB가 설치된 디렉토리
               SHMKEY = 54000,
               DOCROOT="/users/hite95/webtob/docs",      <== WebtoB의 document root
               PORT = "8080",                            <== WebtoB의 접속포트(브라우저가 접속할)
               HTH = 1,
               LOGGING = "log1",
               ERRORLOG = "log2",
               ServiceOrder="ext,uri",  <== (추가) ext(확장자), uri(경로) 순서로 분기 우선순위
                JSVPORT = 9900          <== JEUS 와 연동할 포트(WEBMain.xml에 있는 포트와 동일)
 
*SVRGROUP
htmlg           NODENAME = "nitgenaix", SvrTYPE = HTML
cgig            NODENAME = "nitgenaix", SVRTYPE = CGI
ssig            NODENAME = "nitgenaix", SVRTYPE = SSI
jsvg            NODENAME = "nitgenaix", SVRTYPE = JSV    <== JEUS 와 연동하기 위한 서버그룹
 
*SERVER
html            SVGNAME = htmlg, MinProc = 2, MaxProc = 10
cgi             SVGNAME = cgig, MinProc = 4, MaxProc = 10
ssi             SVGNAME = ssig, MinProc = 2, MaxProc = 10
MyGroup         SVGNAME = jsvg, MinProc = 25, MaxProc = 30   <== JEUS 와 연동할 서버 프로세스(이름은 WEBMain.xml의 registration-id, 갯수는 min/max 와 동일)
 
*URI
uri1            Uri = "/cgi-bin/",   Svrtype = CGI
uri2            Uri = "/examples/", Svrtype = JSV       <== 위에서 ServiceOrder가 "ext,uri"인 경우는 설정할 필요 없음.
 
*ALIAS
alias1          URI = "/cgi-bin/", REalPath = "/users/hite95/webtob/cgi-bin/"
 
*LOGGING
log1            Format = "DEFAULT", FileName = "/users/hite95/webtob/log/access.log"
log2            Format = "ERROR", FileName = "/users/hite95/webtob/log/error.log"
 
*EXT
htm             MimeType = "text/html", SvrType = HTML
jsp             MimeType = "application/jsp", SvrType = JSV, SVRNAME = MyGroup

================================================================


* wscfl -i <환경설정파일> 로 환경설정 파일을 새로 컴파일 해 주셔야 합니다.
 
 
2. JEUS에서 WEBMain.xml 편집
================================================================
...
        <webserver-connection>
            <http-listener>                               <==== 이것은 JEUS 내장 간이 웹서버 설정입니다.
                <listener-id>http1</listener-id>
                <port>8088</port>                              <==== http://ip:8088/로 접속하면 됩니다.
                <output-buffer-size>8192</output-buffer-size>
                <thread-pool>
                    <min>25</min>
                    <max>30</max>
                    <step>2</step>
                    <max-idle-time>1000</max-idle-time>
                </thread-pool>
            </http-listener>
            <webtob-listener>            <=== WebtoB와의 연동을 위해서 추가해야 하는 부분입니다.
                <listener-id>webtob1</listener-id>
                <port>9900</port>        <=== WebtoB의 JSVPORT 와 동일해야 합니다.
                <webtob-address>127.0.0.1</webtob-address>     <=== WebtoB의 IP 입니다.
                <registration-id>MyGroup</registration-id>     <=== WebtoB의 SERVER 명과 동일
                <thread-pool>
                    <min>25</min>
                    <max>30</max>
                </thread-pool>
            </webtob-listener>
        </webserver-connection>
...
================================================================
 
 
이와같이 설정하면 됩니다.

[출처] webtoB Vs JEUS|작성자 뽁태

Posted by [czar]
,
### 설치/시동/테스팅/종료 ###

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

1. 필요 프로그램

- j2sdk1.4.1_07 (http://java.sun.com)       # j2sdk1.4.1_07 이하 버젼 권장 (1.4.2버젼대에서는 문제발생할 수 있음)

- jeus42.exe (http://www.tmax.co.kr)

- webtob_3.1.6(build3).exe (http://www.tmax.co.kr)

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

2. j2sdk1.4.1_07 설치

- path 맨 앞에 C:/jdk1.4.1_07/bin 설정

- classpath에 . 설정

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

3. JEUS42 설치

- JEUS42.exe를 실행 

  (windows2003 서버의 경우 installing... uninstall부분에서 정지시는 windows2000호환성모드로 다시 실행)

- http://www.tmax.co.kr의 download링크를 클릭 (회원가입필요)

  JEUS license를 신청 -> 이메일을 통해 license부여받음 (90일 사용가능)

  부여받은 license파일을 제우스홈license에 복사 (덮어쓰기)

- 설치 후 다음 세개의 파일을 자신의 환경에 맞게 편집

  1) 제우스홈config노드명JEUSMain.xml 

  2) 제우스홈webhomeservlet_homewebappsexamplesweb-infweb.xml
  3) 제우스홈config노드명노드명_servlet_engine1WEBMain.xml

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

4. webtob3.1.6 설치

- webtob_3.1.6(build3).exe 실행하여 설치 

  (windows2003에서 installing... uninstall부분에서 정지시는 windows2000호환성모드로 다시 실행)

- http://www.tmax.co.kr의 download링크를 클릭 (회원가입필요)

  WEBTOB license를 신청 -> 이메일을 통해 license.dat부여 (90일 사용가능)

  부여받은 license.dat파일을 c:webtoblicense에 복사 (덮어쓰기)

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

5. PATH 설정 후 리부팅 : 자신의 환경에 맞게 설정하고 시스템을 리부팅

  (Program Files처럼 공백을 포함한 디렉토리를 가진 경로는 맨뒤로...)

ex) PATH=C:J2SDK1.4.1_07bin;C:webtobbin;C:WINDOWSsystem32;C:WINDOWS;C:WINDOW
SSystem32Wbem;C:webtobbin;C:Jeus42libetcantbin;C:Jeus42bin;C:Jeus42libsystem

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

6. WEBTOB 환경설정

  1) 웹투비홈configsample.m을 카피해서 http.m을 생성

  2) wscfl -i http.m을 커맨드창에서 실행 (webtob 환경설정)

  정상결과 예)

        Current configuration:
                Number of client handler(HTH) = 1
                Supported maximum user per node = 975
                Supported maximum user per handler = 975
        CFL is done successfully for node(노드명(노드명))

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

7. 시동

1) webtob를 실행

- webtob 실행 :  wsboot

2) JEUS를 실행

- 우선 command창을 두개 띄웁니다.(제우스, 제우스관리자)

- 제우스창에 "jeus + 엔터"

- 제우스관리자창에 "jeusadmin 노드명 -U유져명 -P제우스패스워드 ->boot

- 제우스창에 에러(Exception)가 없다면 실행 성공!!!

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

8. 테스팅

- JEUS기본포트는 8088, webtob기본포트는 8080

- JSP 기본경로

제우스홈webhomeservlet_homewebappsexamples
           http://127.0.0.1/examples/

- Servlet 기본경로

제우스홈webhomeservlet_homewebappsexamplesWEB-INFclasses
    http://127.0.0.1/examples/

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

9. 종료

1) JEUS종료

- 제우스관리자창에 down -> jeusexit

2) WEBTOB종료

- 웹투비창에 wsdown -i 
Posted by [czar]
,