'전체'에 해당되는 글 60건
- 2009/01/28 20090128 새해기념 바탕화면
- 2008/12/11 HTML table frame, rule
- 2008/11/11 Oracle 10g Simplified Shared Server Configuration
- 2008/10/10 File 클래스 핸들링
- 2008/09/29 예전에 SLRCLUB에 올렸던 사용기
- 2008/05/23 2007년 말부터 2008년 4월까지 사진정리
- 2008/03/15 20080315난지골프장
- 2008/03/12 200802결산
- 2008/03/12 200801결산
- 2008/03/12 2007년결산
=== FRAME ===
above : 바깥 테두리를(이하 생략) 위쪽만 표시
below : 아래쪽만 표시
border or box : 모두 표시
lhs : 왼쪽만 표시
rhs : 오른쪽만 표시
hsides : 세로선 ( 왼/오른쪽 ) 만 표시
vsides : 가로선 ( 위/아래 ) 만 표시
void : 테두리 표시 안함
ex )
<table border="1" frame="below" cellpadding="0" cellspacing="0">
=== RULES ===
all : 안쪽 테두리를 ( 이하 생략 ) 모두 표시
cols : 칸 구분선만 표시
rows : 줄 구분선만 표시
groups : 그룹요소들의 안쪽 테두리만 표시
none : 표시 안함
<table border="1" rules="all" cellpadding="0" cellspacing="0">
Oracle 10g Simplified Shared Server Configuration
In Oracle 10g, you no longer need to set as many initialization parameters for shared server environments. In fact, you only need to set one parameter if you are using TCP/IP as your communication protocol, and the rest of the settings are now managed internally.
Shared Server Initialization Parameters
The following initialization parameters in Oracle 10g control shared server operation:
shared_servers – This parameter specifies the initial number of shared servers to start and the minimum number of shared servers to keep. This is the only required parameter for using shared servers. Setting this to a non-zero value automatically specifies shared server.
max_shared_servers – This parameter specifies the maximum number of shared servers that can run simultaneously. Once shared server is initialized, the Oracle system will increase the number of shared servers up to this value as needed.
shared_server_sessions -- This parameter specifies the total number of shared server user sessions that can run simultaneously. Setting this parameter enables you to reserve user sessions for dedicated servers. For example, if the sessions parameter is set at 1000 and you set shared_server_sessions to 900, then 100 dedicated sessions are available, even if all 900 shared sessions are in use.
dispatchers – This parameter configures dispatcher processes in the shared server architecture. One dispatcher is always configured by default for the TCP/IP protocol, even if the parameter is not explicitly specified.
max_dispatchers – This parameter specifies the maximum number of dispatcher processes that can run simultaneously. According to the Oracle 10g manuals, this parameter can be ignored for now. It will only be useful in a future release when the number of dispatchers is auto-tuned, according to the number of concurrent connections.
circuits – This parameter specifies the total number of virtual circuits that are available for inbound and outbound network sessions.
Even though there are six initialization parameters, shared server is enabled by setting one parameter and is turned on if the shared_servers initialization parameter is set to a value greater than 0. This is all that is required. The other shared server initialization parameters do not need to be set. Because the shared server parameter requires at least one dispatcher to work, a dispatcher is brought up automatically even when no dispatcher has been configured.
Using SQL*Plus or OEM, the shared server features can be started dynamically by setting the shared_servers parameter to a nonzero value
Get the complete Oracle10g story:
The above text is an excerpt from "Oracle Database 10g New Features: Oracle10g Reference for Advanced Tuning and Administration", by Rampant TechPress. Written by top Oracle experts, this book has a complete online code deport with ready to use scripts.
The switch from dedicated server to shared server is easy. You begin by editing the init.ora file for your instance. You will need to either add in a line for dispatchers, or edit the existing line (When creating a database with DBCA on Windows, Oracle adds in a line even if you don't request dispatchers. So, be aware of the fact that you may just be changing that line).
At minimum, you will need:
dispatchers="(protocol=tcp)"
A more complete configuration would be:
dispatchers="(protocol=tcp)(dispatchers=2)(service=mydatabase)"
The (dispatchers=2) that you see tells oracle to spawn 2 dispatchers at startup.
Configuring dispatchers can get more elaborate. Unless you have experience and documentation for setting up a more advanced configuration, it is probably better to allow Oracle to give you default values for everything else. A complete list of possible dispatcher parameters is here:
dispatch_clause::= (PROTOCOL = protocol) | (ADDRESS = address) | (DESCRIPTION = description ) [options_clause] options_clause::= (DISPATCHERS = integer | SESSIONS = integer | CONNECTIONS = integer | TICKS = seconds | POOL = {1 | ON | YES | TRUE | BOTH | ({IN | OUT} = ticks) | 0 | OFF | NO | FALSE | ticks} | MULTIPLEX = {1 | ON | YES | TRUE | 0 | OFF | NO | FALSE | BOTH | IN | OUT} | LISTENER = tnsname | SERVICE = service | INDEX = integer ) There are some other parameters you will likely want to set as long as you are working on dispatchers. Here is an example: ########################################### # DISPATCHERS ########################################### dispatchers="(protocol=tcp)(dispatchers=2)(service=test)" ## shared servers on startup shared_servers=2 ## maximum shared server sessions shared_server_sessions=200 ## Maximum Shared Servers max_shared_servers=20 ## Maximum Dispatchers max_dispatchers=20Once you have changed your init.ora file and bounced your database, how can you tell if connections are going through dispatchers? There are a number of dynamic performance views that can tell you this, for example v$session, v$dispatcher, v$queue. To keep things easy, I just create my own view that gives me the data I like to see:
CREATE OR REPLACE FORCE VIEW SYSTEM.CURRENT_CONNECTIONS (SID, SERIAL#, USERNAME, OSUSER, STATUS, "SCNDS NOT ACTIVE", DISPATCHER) AS SELECT /* ©2004 by Edward Stoever, edward@database-expert.com */ s.SID, s.serial#, s.username, s.osuser, s.status, DECODE (s.username, NULL, 0, s.last_call_et) "SCNDS NOT ACTIVE", NVL (d.NAME, 'none') "DISPATCHER" FROM v$session s, v$dispatcher d WHERE s.paddr = d.paddr(+) ORDER BY status ASC, last_call_et ASC; CREATE PUBLIC SYNONYM CURRENT_CONNECTIONS FOR SYSTEM.CURRENT_CONNECTIONS; Sample output: select * from system.current_connections; SID SERIAL# USERNAME OSUSER STATUS SCNDS NOT ACTIVE DISPAT ------ ------- ------------ ------------ -------- ---------------- ------ 15 167 SYSTEM STOEVER ACTIVE 0 none 11 10 GENERAL GURJOBS_TEST ACTIVE 12535 none 1 1 @ ORACLE ACTIVE 0 none 2 1 @ ORACLE ACTIVE 0 none 3 1 @ ORACLE ACTIVE 0 none 4 1 @ ORACLE ACTIVE 0 none 5 1 @ ORACLE ACTIVE 0 none 6 1 @ ORACLE ACTIVE 0 none 7 1 @ ORACLE ACTIVE 0 none 8 1 @ ORACLE ACTIVE 0 none 18 176 WTAILOR jbautista INACTIVE 12 D000 16 191 WTAILOR jbautista INACTIVE 132 D001 10 212 WTAILOR jbautista INACTIVE 134 D001 13 119 WEB_USER SYSTEM INACTIVE 314 D000 14 20 SYSTEM vlugo INACTIVE 721 D001Now you can see who is connecting and how, either via a dispatcher or via a dedicated connection.
Does this mean that all connections from now on will be through a dispatcher? No. There are plenty of cases in which you will want or even require a connection that is dedicated. For example, to shutdown the database, a dedicated connection is required. Also, many processes are recource intensive and will perform better with a dedicated connection. To create a dedicated connection, you will need to edit the TNSNAMES.ORA file on the machine from which the connection originates. Here is an example:
### SHARED CONNECTION TO TEST DATABASE TEST_SHARED = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = alpha2)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = test) ) ) ### DEDICATED CONNECTION TO TEST DATABASE TEST_DEDICATED = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = alpha2)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = test) ) )Now, to connect via a dispatcher, try this:
SQLPLUS scott/tiger@test_sharedto connect via a dedicated server process, try this:
SQLPLUS scott/tiger@test_dedicated[출처] [펌] from dedicated to shared server|작성자 새내기
File 클래스
File클래스에는 일반 파일을 생성하는 기능을 제외한 이미 존재하는 파일에 대한 제어나 특수한 파일인 디렉토리를 생성하는 기능이 지원된다. 파일이라는 객체와 관련된 동작에 대한 메서드들은 모두 이 클래스에서 지원된다.
>>> File클래스 관련 예제 (파일이 있는지 없는지 확인)<<<
import java.io.*;
import java.util.*;
public class FileInfo{
public static void main(String args[]){
File f=new File("D:/StudyII/Java/Example/File",args[0]);
if(f.exists()) //파일이 존재하면
System.out.println("Existed!!");
else
System.out.println("Not Found!!");
}
}
◆ 결과
c:\Test>jva FileInfo 파일명
있으면 ?? 없으면 ??
>>> File클래스 관련 예제 (디렉토리 안의 파일 열기)<<<
import java.io.*;
import java.util.*;
public class FileInfo2{
public static void main(String args[]){
File f=new File(args[0]);
if(f.isDirectory()){
String list[]=f.list();
for(int i=0; i<list.length; i++)
System.out.println(list[i]);
}else
System.out.println("Not a Directory!!");
}
}
◆ 결과
c:\Test>java FileInfo2 Test
Test가 디렉토리라면 디렉토리 안의 파일 열거
Test가 디렉토리가 아니면 Not a Directory
>>> File클래스 관련 문제 (마지막 수정된 날짜 표시하기)<<<
import java.io.*;
import java.util.*;
public class FileTest1{
public static void main(String args[]){
File f=new File("D:/StudyII/Java/Example/File/Test");
File[] contents=f.listFiles();
System.out.println("File디렉토리에 들어있는 "+contents.length+"개의 항목");
for(int i=0; i<contents.length; i++){
System.out.println(contents[i]+"는"+new Date(contents[i].lastModified())+"에 수정된 "+
(contents[i].isDirectory()?"디렉토리이다.":"파일이다.")
);
}
}
}
>>> File클래스 관련 문제 <<<
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆ Lab1 : 구구단을 출력할 파일명과 단을 각각 인수로 입력받아 File클래스를 이용하여 파일을
생성하고 새로운 파일에 구구단이 아래와 같이 출력되는 소스를 작성한다.
---------------------------------------------------------------------------------------------------------
c:\Test>java FileTest2 2 2Dan.txt< 2Dan.txt >안에 2단 구구단 출력
---------------------------------------------------------------------------------------------------------
import java.io.*;
import java.util.*;
public class FileTest2{
public static void main(String args[]){
String dan=args[0];
try{
FileWriter bw=new FileWriter(args[1]);
for(int i=1; i<10; i++){
bw.write(dan+"*"+i+"="+(Integer.parseInt(dan)*i)+"\n");
}
bw.close();
}catch(IOException e){
System.out.println(e);
}
}
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆ Lab2 : 디렉토리명을 사용자로부터 입력받아 아래처럼 디렉토리를 생성하는 소스를 작성한다.
--------------------------------------------------------------------------------------------------------------------
import java.io.*;
class Test{
public static void main(String args[]) throws IOException{
System.out.println("디렉토리 생성하기!");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String directoryName=br.readLine();
File f=new File(directoryName);
if(f.mkdir()){
System.out.println("디렉토리 '"+directoryName+"' 생성됨!");
}else{
System.out.println("디렉토리 '"+directoryName+"' 생성되지 않음!");
}
}
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆ Lab3 : 아래와 같이 출력되도록 소스를 작성한다.
---------------------------------------------------------------------------------------------------------
c:\Test>java Test파일경로구분자 ==> ;
디렉토리구분자 ==> \
루트 디렉토리 ==> C:\
루트 디렉토리 ==> D:\
현재 디렉토리 ==> C:\\.
----------------------------------------------------------------------------------------------------------
import java.io.*;
public class Test{
public static void main(String args[]){
System.out.println("파일경로구분자 ==> "+File.pathSeparator);
System.out.println("디렉토리구분자 ==> "+File.separator);
File[] root=File.listRoots();
for(File f:root){
System.out.println("루트 디렉토리 ==> "+f);
}
System.out.println("현재 디렉토리 ==> "+new File(".").getAbsolutePath());
}
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆ Lab3 : 아래 실행결과처럼 Root File명(드라이버명)과 file명, 디렉토리명이 찍히도록 소스를 작성한다.
단, 디렉토리는 대괄호를 씌워서 구분짓는다. 모든 드라이버명 다 출력
---------------------------------------------------------------------------------------------------------
c:\Test>java ExListRootsA:\
C:\
abc.txt
[AromaWIPI]
boot.ini
----------------------------------------------------------------------------------------------------------
import java.io.*;
class ExListRoots{
public static void main(String args[]){
File[] rootFile=File.listRoots();
for(int i=0; i<rootFile.length; i++){
System.out.println(rootFile[i]);
if(rootFile[i].toString().startsWith("C:")){
File[] fileName=rootFile[i].listFiles();
for(int j=0; j<fileName.length; j++){
if(fileName[j].isFile())
System.out.println("\t"+fileName[j].getName());
else
System.out.println("\t["+fileName[j].getName()+"]");
}
}
}
}
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆ Lab4 : 파일의 확장명이 java인것 파일만 출력되도록 소스를 작성한다.
---------------------------------------------------------------------------------------------------------
import java.io.*;public class FileTest{
public static void main(String args[]) throws Exception{
File f=new File("c:\\");
String files[]=f.list();
for(int i=0 ; i<files.length ; i++){
if(files[i].endsWith(".java"))
System.out.println(files[i]);
}
}
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆ Lab5 : 파일이름에 “Li”를 포함하는 파일만 출력되도록 소스를 작성한다.
---------------------------------------------------------------------------------------------------------
import java.io.*;
public class FileTest{
public static void main(String args[]) throws Exception{
File f=new File("c:\\");
String files[]=f.list();
for(int i=0; i<files.length; i++){
if(files[i].indexOf("Li") != -1) //indexOf()가 -1이면 찾는 문자열이 없음
System.out.println(files[i]);
}
}
}
FilenameFilter
파일의 이름을 필터링할 수 있는 기능을 가진 인터페이스
만약 어떤 디렉토리의 파일들의 목록을 읽어서 확장자가 .java로 끝나는 파일들만 검색하고 싶다면 다음과 같이 해주어야 한다.
FilenameFilter인터페이스를 구현하는 클래스를 만들고 accept()를 만든다.
File객체의 list()를 이용해서 원하는 디렉토리의 해당 파일 목록을 구한다.
>>> FilenameFilter인터페이스 관련 예제 <<<
import java.io.*;
class MyFilter implements FilenameFilter{
public boolean accept(File dir, String fileName){
return fileName.endsWith(".java");
}
}
public class FilterEx{
public static void main(String args[]){
FilterEx fe=new FilterEx();
fe.test();
}
public void test(){
File dir=new File("c:\Test");
MyFilter filter=new MyFilter();
File[] files=dir.listFiles(filter);
for(int i=0; i<files.length; i++)
System.out.println("File Name : "+files[i].getName());
}
}
◆ 결과
c:\Test>java FileterEx
File Name : TbarApplet.java
>>> FilenameFilter인터페이스 관련 예제 <<<
import java.io.*;
class MyFilter implements FilenameFilter{
private String keyword;
private String fileExt;
public MyFilter(String keyword, String fileExt){
this.keyword=keyword;
this.fileExt=fileExt;
}
public boolean accept(File dir, String fileName){
if(fileExt.equals("all"))
fileExt="\\w*";
return fileName.matches("\\w*"+keyword+"\\w*."+fileExt);
}
}
public class FilterEx{
public static void main(String args[]){
FilterEx fe=new FilterEx();
fe.test();
}
public void test(){
File dir=new File("c:\Test");
MyFilter filter=new MyFilter("Test","java");
File[] files=dir.listFiles(filter);
for(int i=0; i<files.length; i++)
System.out.println("File Name : "+files[i].getName());
}
}
◆ 결과
c:\Test>java FileterEx
File Name : ArrayTest.java
File Name : EventTest.java [출처] File 클래스 , FilenameFilter인터페이스|작성자 강현아빠
| 개인별 등급표 | ||||||||||||||||||||
|
| 등급별 환산점수 | ||||||||||||
|
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ tot │
├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
│ 4 │ 3 │ 4 │ 5 │ 4 │ 3 │ 4 │ 4 │ 5 │ 36 │
┌───┼─┬─┼─┬─┼─┬─┼─┬─┼─┬─┼─┬─┼─┬─┼─┬─┼─┬─┼─┬─┤
│안흥섭│4 │ 1│4 │ │5 │ │7 │ │4 │ 1│6 │ │4 │ 1│5 │ │7 │ │46│ 3│
│이세용│6 │ │5 │ │5 │ │9 │ │6 │ │2 │ 3│5 │ │5 │ │5 │ 1│48│ 4│
│남진원│5 │ │4 │ │6 │ │9 │ │5 │ │6 │ │6 │ │4 │ 1│6 │ │51│ 1│
│김형승│7 │ │3 │ 1│6 │ │8 │ │4 │ 1│6 │ │4 │ 1│8 │ │8 │ │54│ 3│
├───┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┤
│김창태│7 │ │6 │ │8 │ │10│ │6 │ │5 │ │6 │ │5 │ │7 │ │60│ │
│심재훈│6 │ │4 │ 1│6 │ │10│ │7 │ │6 │ │8 │ │7 │ │8 │ │62│ 1│
│유은선│6 │ │4 │ 1│8 │ │10│ │8 │ │6 │ │8 │ │8 │ │10│ │68│ 1│
│홍 준│6 │ │6 │ │8 │ │10│ │8 │ │6 │ │8 │ │8 │ │10│ │70│ │
└───┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
조정후등급표
| 개인별 등급표 | ||||||||||||||||||||||||||||||
|
| 등급별 환산점수 | ||||||||||||||||||||||||
|
| P&T 컨설팅 Golf 동호회 결산 | |
| 수입 | 720,000 |
| 월회비 | 360,000 |
| 지원금 | 320,000 |
| 부가수입 | 40,000 |
| 지출 | 469,300 |
| 골프장이용료 | 45,000 |
| 연습장이용료 | 200,000 |
| 상품 | 159,300 |
| 식비 | 57,900 |
| 교통비 | 7,100 |
| 기타 | |
| 2008년 2월 결산 | 250,700 |
| 통장잔액 | 475,700 |
| 회비미납내역 | 안흥섭 : 40,000 |
| 유은선 : 20,000 | |
| 문승주 : 20,000 |
※ 상품의 금액은 3월 난지골프장 모임시 나눠줄 상품을 미리 구입하여 발생된 금액입니다.
※ 미납회비는 가급적 은행으로 입금하여주시기 바랍니다.
입금하실곳 : 김형승 우리은행 1002-035-123473
| P&T 컨설팅 Golf 동호회 결산 | |
| 수입 | 380,000 |
| 월회비 | 200,000 |
| 지원금 | 180,000 |
| 부가수입 | |
| 지출 | 220,000 |
| 골프장이용료 | |
| 연습장이용료 | 200,000 |
| 상품 | |
| 식비 | 20,000 |
| 교통비 | |
| 기타 | |
| 2008년 1월 결산 | 160,000 |
| 통장잔액 | 385,000 |
| P&T 컨설팅 Golf 동호회 결산 | |
| 수입 | 80,000 |
| 월회비 | 80,000 |
| 지원금 | |
| 부가수입 | |
| 지출 | 35,000 |
| 골프장이용료 | |
| 연습장이용료 | |
| 상품 | |
| 식비 | 20,000 |
| 교통비 | 15,000 |
| 기타 | |
| 2007년 8월 결산 | 45,000 |
| 통장잔액 | 45,000 |
| P&T 컨설팅 Golf 동호회 결산 | |
| 수입 | 260,000 |
| 월회비 | 260,000 |
| 지원금 | |
| 부가수입 | |
| 지출 | 83,000 |
| 골프장이용료 | |
| 연습장이용료 | |
| 상품 | |
| 식비 | 60,000 |
| 교통비 | 23,000 |
| 기타 | |
| 2007년 9월 결산 | 177,000 |
| 통장잔액 | 177,000 |
| P&T 컨설팅 Golf 동호회 결산 | |
| 수입 | 640,000 |
| 월회비 | 480,000 |
| 지원금 | 160,000 |
| 부가수입 | |
| 지출 | 690,000 |
| 골프장이용료 | 480,000 |
| 연습장이용료 | 24,000 |
| 상품 | 60,000 |
| 식비 | 88,000 |
| 교통비 | 38,000 |
| 기타 | |
| 2007년 10월 결산 | -50,000 |
| 통장잔액 | -50,000 |
| P&T 컨설팅 Golf 동호회 결산 | |
| 수입 | 860,000 |
| 월회비 | 560,000 |
| 지원금 | 300,000 |
| 부가수입 | |
| 지출 | 810,000 |
| 골프장이용료 | 480,000 |
| 연습장이용료 | 144,000 |
| 상품 | 60,000 |
| 식비 | 88,000 |
| 교통비 | 38,000 |
| 기타 | |
| 2007년 11월 결산 | 50,000 |
| 통장잔액 | 50,000 |
| P&T 컨설팅 Golf 동호회 결산 | |
| 수입 | 1,160,000 |
| 월회비 | 760,000 |
| 지원금 | 400,000 |
| 부가수입 | |
| 지출 | 935,000 |
| 골프장이용료 | 480,000 |
| 연습장이용료 | 244,000 |
| 상품 | 60,000 |
| 식비 | 113,000 |
| 교통비 | 38,000 |
| 기타 | |
| 2007년 12월 결산 | 225,000 |
| 통장잔액 | 225,000 |
| P&T 컨설팅 Golf 동호회 결산 | |
| 수입 | 1,160,000 |
| 월회비 | 760,000 |
| 지원금 | 400,000 |
| 부가수입 | |
| 지출 | 935,000 |
| 골프장이용료 | 480,000 |
| 연습장이용료 | 244,000 |
| 상품 | 60,000 |
| 식비 | 113,000 |
| 교통비 | 38,000 |
| 기타 | |
| 2007년 하반기 결산 | 225,000 |
| 통장잔액 | 225,000 |









