urlencode

기타 2009. 6. 24. 15:48
Javascript로 URLEncode 하기

 javascript:void(alert(encodeURIComponent('a+b')));


http://cass-hacks.com/articles/discussion/js_url_encode_decode/




http://www.w3schools.com/tags/ref_urlencode.asp

URLs can only be sent over the Internet using the ASCII character-set.

Since URLs often contains characters outside the ASCII set, the URL has to be converted. URL encoding converts the URL into a valid ASCII format.

URL encoding replaces unsafe ASCII characters with "%" followed by two hexadecimal digits corresponding to the character values in the ISO-8859-1 character-set.

URLs cannot contain spaces. URL encoding normally replaces a space with a + sign.


URL Encoding Reference

ASCII Character URL-encoding
space %20
! %21
" %22
# %23
$ %24
% %25
& %26
' %27
( %28
) %29
* %2A
+ %2B
, %2C
- %2D
. %2E
/ %2F
0 %30
1 %31
2 %32
3 %33
4 %34
5 %35
6 %36
7 %37
8 %38
9 %39
: %3A
; %3B
< %3C
= %3D
> %3E
? %3F
@ %40
A %41
B %42
C %43
D %44
E %45
F %46
G %47
H %48
I %49
J %4A
K %4B
L %4C
M %4D
N %4E
O %4F
P %50
Q %51
R %52
S %53
T %54
U %55
V %56
W %57
X %58
Y %59
Z %5A
[ %5B
\ %5C
] %5D
^ %5E
_ %5F
` %60
a %61
b %62
c %63
d %64
e %65
f %66
g %67
h %68
i %69
j %6A
k %6B
l %6C
m %6D
n %6E
o %6F
p %70
q %71
r %72
s %73
t %74
u %75
v %76
w %77
x %78
y %79
z %7A
{ %7B
| %7C
} %7D
~ %7E
  %7F
%80
  %81
%82
ƒ %83
%84
%85
%86
%87
ˆ %88
%89
Š %8A
%8B
Π%8C
  %8D
Ž %8E
  %8F
  %90
%91
%92
%93
%94
%95
%96
%97
˜ %98
%99
š %9A
%9B
œ %9C
  %9D
ž %9E
Ÿ %9F
  %A0
¡ %A1
¢ %A2
£ %A3
  %A4
¥ %A5
| %A6
§ %A7
¨ %A8
© %A9
ª %AA
« %AB
¬ %AC
¯ %AD
® %AE
¯ %AF
° %B0
± %B1
² %B2
³ %B3
´ %B4
µ %B5
%B6
· %B7
¸ %B8
¹ %B9
º %BA
» %BB
¼ %BC
½ %BD
¾ %BE
¿ %BF
À %C0
Á %C1
 %C2
à %C3
Ä %C4
Å %C5
Æ %C6
Ç %C7
È %C8
É %C9
Ê %CA
Ë %CB
Ì %CC
Í %CD
Î %CE
Ï %CF
Ð %D0
Ñ %D1
Ò %D2
Ó %D3
Ô %D4
Õ %D5
Ö %D6
  %D7
Ø %D8
Ù %D9
Ú %DA
Û %DB
Ü %DC
Ý %DD
Þ %DE
ß %DF
à %E0
á %E1
â %E2
ã %E3
ä %E4
å %E5
æ %E6
ç %E7
è %E8
é %E9
ê %EA
ë %EB
ì %EC
í %ED
î %EE
ï %EF
ð %F0
ñ %F1
ò %F2
ó %F3
ô %F4
õ %F5
ö %F6
÷ %F7
ø %F8
ù %F9
ú %FA
û %FB
ü %FC
ý %FD
þ %FE
ÿ %FF


URL Encoding Reference

The ASCII device control characters %00-%1f were originally designed to control hardware devices. Control characters have nothing to do inside a URL.

ASCII Character Description URL-encoding
NUL null character %00
SOH start of header %01
STX start of text %02
ETX end of text %03
EOT end of transmission %04
ENQ enquiry %05
ACK acknowledge %06
BEL bell (ring) %07
BS backspace %08
HT horizontal tab %09
LF line feed %0A
VT vertical tab %0B
FF form feed %0C
CR carriage return %0D
SO shift out %0E
SI shift in %0F
DLE data link escape %10
DC1 device control 1 %11
DC2 device control 2 %12
DC3 device control 3 %13
DC4 device control 4 %14
NAK negative acknowledge %15
SYN synchronize %16
ETB end transmission block %17
CAN cancel %18
EM end of medium %19
SUB substitute %1A
ESC escape %1B
FS file separator %1C
GS group separator %1D
RS record separator %1E
US unit separator %1F

Posted by 天下太平
,

http://birtworld.blogspot.com/2008/11/birt-connection-pooling-continued-again.html

The Eclipse Business Intelligence and Reporting Tools project is an open-source project focused on the development and delivery of framework tools for reporting and business intelligence within the Eclipse platform.

Wednesday, November 05, 2008

BIRT Connection Pooling Continued Again

With the release of BIRT 2.3.1 connection pooling options have been extended.
In a prior post, I built an example that showed how to implement connection pooling using the driverBridge extension point. While this method is useful, with BIRT 2.3.1 there is a much easier method for passing BIRT an already created connection object.

You can now supply a connection by adding the connection object to BIRT’s application context object. The key for this object is OdaJDBCDriverPassInConnection. So to pass in the connection while using the Report Engine API, use code similar to:



IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("Reports/passinconnection.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("output/resample/passinconnobj.html");
options.setOutputFormat("HTML");
task.setRenderOption(options);
task.getAppContext().put("OdaJDBCDriverPassInConnection", this.getConnection());
task.run();
task.close();


This assumes you already have the report engine started. The getConnection method in this example simply creates a java.sql.Connection to my database. You will need to create your own function. Also keep in mind that the BIRT JDBC plugin will close the connection when it has finished with it, so if you plan on using the object in multiple tasks, you will need to reopen it. There is a bug to allow the closing of the connection to be optional -Bugzilla Entry. This application context setting should be applied at the task level.

If you wish to set it in the Example Viewer’s application context take a look at this wiki entry.

These are the ways that a connection can now be manipulated in BIRT:
1-Property binding
2-JNDI
3-Script data set
4-DataSource.beforeOpen() event.
5–driverBridge extension
6-Application Context Ojbect (described here)

Another setting the JDBC plugin now provides is OdaJDBCDriverClassPath, which allows setting the classpath for locating drivers. This prevents the user from having to put JDBC drivers in the drivers directory of the JDBC plugin. This should be set on the EngineConfig object and not on the task object.


config = new EngineConfig( );
config.setBIRTHome("C:\\birt\\birt-runtime-2_3_1\\birt-runtime-2_3_1\\ReportEngine");
config.getAppContext().put("OdaJDBCDriverClassPath", "c:/birt/mysql/mysql-connector-java-5.0.4-bin.jar");
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );

8 comments:

Anonymous said...

Hi Jason!
I have to implement connection pooling for a rerport similar to following http://wiki.eclipse.org/Java_-_Execute_Modified_Report_%28BIRT%29
I used your code segment in my ReportRunner class as follows,

...............................
DealerLevelDetails.setupDataSourceAndConnection();
ServletContext sc = req.getSession().getServletContext();
this.birtReportEngine = BirtEngine.getBirtEngine(sc);

//setup image directory
HTMLRenderContext renderContext = new HTMLRenderContext();
renderContext.setBaseImageURL(req.getContextPath() + "/images");
renderContext.setImageDirectory(sc.getRealPath("/images"));
// create ReportDesignHandle object and render the report using IRunAndRenderTask task
String path = sc.getRealPath("/");
BuildDynamicReport buildDynamicReport = new BuildDynamicReport(distributor, transActionType, region, fromDate, toDate, path, locale);
ReportDesignHandle designHandle = buildDynamicReport.createDynamicTable();
IReportRunnable design = birtReportEngine.openReportDesign(designHandle);
IRunAndRenderTask task = birtReportEngine.createRunAndRenderTask(design);
HashMap contextMap = new HashMap();
contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext);
// using a exiting connection used to create temporary cache tables.
HTMLRenderOption options = new HTMLRenderOption();
// Set the output to servlet output stream
options.setOutputStream(resp.getOutputStream());
options.setOutputFormat("html");
task.setAppContext(contextMap);
task.setRenderOption(options);
// DealerLevelDetails.getConnection() returns an existing connection task.getAppContext().put("OdaJDBCDriverPassInConnection",DealerLevelDetails.getConnection());
task.run();
task.close();

...................

Now report is not running and It gives error messgages like ... DataSource for ds is null . My ReportRunner class still using a buildDataSource() method as follows.

public void buildDataSource( ElementFactory designFactory, ReportDesignHandle designHandle ) throws SemanticException
{

OdaDataSourceHandle dsHandle = designFactory.newOdaDataSource(
"Data Source", "org.eclipse.birt.report.data.oda.jdbc" );
dsHandle.setProperty( "odaDriverClass",
"org.eclipse.birt.report.data.oda.sampledb.Driver" );
dsHandle.setProperty( "odaURL", "jdbc:classicmodels:sampledb" );
dsHandle.setProperty( "odaUser", "ClassicModels" );
dsHandle.setProperty( "odaPassword", "" );

designHandle.getDataSources( ).add( dsHandle );

}
...................
What I want to know is , Is it possible to reusue Connection object in a Report similar to
http://wiki.eclipse.org/Java_-_Execute_Modified_Report_%28BIRT%29
Thanks
-Jestan

Jason Weathersby said...

Jestan,

The error you are stating sounds like you are not setting the datasource propery of the data set that you have dynamically added. BTW that is really not connection pooling as you are adding a datasource to the report definition, which will get opened when the report is executed.

Jason

Anonymous said...

Hi Jason !
thanks for your reply. Actually my problem is , I am having a ReportRunner class like http://wiki.eclipse.org/Java_-_Execute_Modified_Report_%28B
and I have to modify the it to enable connection pooling, and I have done some changes in
task.getAppContext().put("OdaJDBCDriverPassInConnection",connection) ; But now I am having some problem in following code.
is there a way to modify following code to enable connection pooling..

........................................
void buildDataSource() throws Exception {
OdaDataSourceHandle dsHandle = designFactory.newOdaDataSource("Data Source", "org.eclipse.birt.report.data.oda.jdbc");
if(BirtPorpertyLoader.topTransferReportDS.equals("dataguard")){
dsHandle.setProperty("odaDriverClass", BirtPorpertyLoader.dataguardDriverClass);
dsHandle.setProperty("odaURL", BirtPorpertyLoader.dataguardConnectionUrl);
dsHandle.setProperty("odaUser", BirtPorpertyLoader.dataguardConnUsername);
dsHandle.setProperty("odaPassword", BirtPorpertyLoader.dataguardConnPassword);
}
else if(BirtPorpertyLoader.topTransferReportDS.equals("live")){
dsHandle.setProperty("odaDriverClass", BirtPorpertyLoader.liveDriverClass);
dsHandle.setProperty("odaURL", BirtPorpertyLoader.liveConnectionUrl);
dsHandle.setProperty("odaUser", BirtPorpertyLoader.liveConnUsername);
dsHandle.setProperty("odaPassword", BirtPorpertyLoader.liveConnPassword);
}
else {
throw new Exception("TopupTransfer report's respective datasource configuration is wrong. 'live' and 'dataguard' are the possible values.");
}
designHandle.getDataSources().add(dsHandle);

}

...............................

...............................
private void buildFooterDataSet(String dataSetName, String transType) throws SemanticException {

OdaDataSetHandle dsHandle = designFactory.newOdaDataSet(dataSetName,
"org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet");

dsHandle.setDataSource("Data Source");
String tableName = "";
if (transType.equals(BuildDynamicReport.RECHARGE_KEY)) {
tableName = this.rechargeDealerLevelDetails.cacheTableName;
}
else if (transType.equals(BuildDynamicReport.TRANSFER_KEY)) {
tableName = this.transferDealerLevelDetails.cacheTableName;
}

StringBuffer buf = new StringBuffer();

buf.append(" SELECT CREDIT_AMOUNT AS DENOM , COUNT(CREDIT_AMOUNT) AS DENOM_COUNT , (CREDIT_AMOUNT * COUNT(CREDIT_AMOUNT)) AS TOTAL_AMOUNT");
buf.append(" FROM "+tableName +" CONNECT BY PRIOR MSISDN = PARENT_MSISDN START WITH MSISDN = '"+this.distributor+"' GROUP BY CREDIT_AMOUNT ORDER BY CREDIT_AMOUNT ");

dsHandle.setQueryText(buf.toString());

designHandle.getDataSets().add(dsHandle);
}



..................................

I have to run the above query using an existing connection object. To do that how i can modify above two methods. Can you give some hints !
Thank you.

-Jestan

Jason Weathersby said...

What error are you getting?
Are you sure this
task.getAppContext().put("OdaJDBCDriverPassInConnection",connection) ;

connection object is valid?

Nirojan said...

Hi Jason!
The connection object is valid. BWT can you tell me , how I can modify following lines to use existing connection object to build the DataSet to run the query...

OdaDataSetHandle dsHandle = designFactory.newOdaDataSet(dataSetName,
"org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet");

dsHandle.setDataSource("Data Source");

Thank you.

-Jestan

Jason Weathersby said...

Jestan,

If you modify the report using the DE API and then run the report with the task.getAppContext().put("OdaJDBCDriverPassInConnection",connection); This should use the connection you supply. This will be the case as long as you add a JDBC connection.

Jason

Anonymous said...

Hi Jason!
I have solved the "Data source null" problem by using one of your earlier blog.
http://birtworld.blogspot.com/2005/12/using-supplied-connection-with-birt.html
It works perfectly and was a real lifesaver for me. Thanks a lot.

Jestan

Cummins Replacement Parts said...

Great tutorial! Very informative in how well worded and descriptive you were! You know they say that if one knows how to describe what they want really well, then life is just as good as how you describe it :)
Its great for people who feel like time is running against them and then land on your blog and feel like a whole burden was just lifted off of their shoulder.. I admire and respect people who take
time to make it easier for others.. Thanks a bunch! :)

Posted by 天下太平
,

http://blog.daum.net/rksung/11?srchid=BR1http%3A%2F%2Fblog.daum.net%2Frksung%2F11

오라클에서 BIN$로 시작하는 테이블 삭제

디비에서 테이블을 drop으로 삭제 했을때 테이블이 없어지긴 했는데 BIN$어쩌고 하고 나오는 테이블이 대신 생겼다.
이걸 지우는 방법!!
SQL> purge recyclebin;
이거 한번 하고 나면 Bin$으로 시작하는 테이블이 모드 삭제된다.
추가로 오라클 purge에 대해 알아보았다.
오라클이 10g에서 새롭게 추가된 '휴지통'이라는 기능
테이블을 drop 하더라도 언제던지 복원할 수 있게 하고자 하는 것이므로,
윈도우의 휴지통과 같다고 보면 된다.
* 휴지통에 들은 테이블을 조회
SQL>show recyclebin;
*휴지통의 모든 내용이 비워진다.
SQL>purge recyclebin;
*삭제된 테이블을 되살리고 싶다면
SQL>flashback table 테이블명 to before drop;
만약, 특정 테이블을 휴지통에 남기지 않고 모두 삭제하려면..
SQL>drop table 테이블명 purge;
purge문 없이 그냥 drop 한 후에는
SQL> purge table 테이블명..
결국 bin$는 휴지통에 있는 쓰레기 파일인셈이다..
그것을 purge recyclebin; 을 통해 휴지통 비우기를 하면 없어지는 것이다.@!
Posted by 天下太平
,

ORA-04031

DB 2009. 4. 8. 09:46
http://jayclipse.egloos.com/947237

ORA-04031
이 에러의 원인은 크게 3가지로 나뉘어 진다.

1. 다수의 사용자로 인한 SharedPoolSize부족문제

2. 구동중인 App에 비해 현저히 부족한 SharedPool사용으로 인한 문제

3. 덩치 큰 SQL 구동을 위한 연속된 SharedPool할당 불가로 인한 문제

이중 1,2는 같은 맥락에서 접근할 수 있으므로 크게 2가지라고 볼 수도 있다.

이 문제는 OTN 에서 꽤나 유명한 에러로서 아래와 TechBulletin에는 아래와 같이 언급되어 있다.

No. 10095

ORA-4031 조치 방법 과 DBMS_SHARED_POOL STORED PROCEDURE 사용법
==============================================================

Purpose
-------

다음과 같은 작업 수행 시 Oracle 이 Shared pool 에서 연속적인 메모리 부분을 찾지 못해 ORA-4031 에러를 발생시키는 것을 볼 수 있다.

. PL/SQL Routine
. Procedure 수행 시
. Compile 시
. Forms Generate 또는 Running 시
. Object 생성하기 위해 Installer 사용 시

본 자료에서는 이러한 에러에 대한 대처 방안을 설명 하고자 한다.

Problem Description
-------------------

Error 발생의 주된 원인은 Shared Pool의 사용 가능한 Memory 가 시간이 흐름에 따라 작은 조각으로 분할되어 진다는 것이다. 그래서 큰 부분의
Memory 를 할당하려 한다면 Shared Memory가 부족하다는 ORA-4031 Error가 발생한다. 즉, 전체적으로는 많은 양의 사용 가능한 Space가 있다 하더라도
충분한 양의 연속적인 공간이 없으면 이 Error가 발생한다.

1. Shared Pool과 관련된 인스턴스 파라미터
다음 3가지 파라미터는 본 자료를 이해 하는데 매우 중요하다.

* SHARED_POOL_SIZE - Shared Pool 의 크기를 지정 한다. 정수를 사용하며 "K" 나 "M" 을 덧붙일 수 있다.

* SHARED_POOL_RESERVED_SIZE - 공유 풀 메모리에 대한 대량의 연속 공간 요청에 대비해서 예약하는 영역의 크기를 지정한다. 이 영역을 사용하기
위해서는 SHARED_POOL_RESERVED_MIN_ALLOC 보다 큰 영역 할당 요청이어야 한다. 일반적으로 SHARED_POOL_SIZE 의 10% 정도를 지정한다.

* SHARED_POOL_RESERVED_MIN_ALLOC - 예약 메모리 영역의 할당을 통제한다.
이 값보다 큰 메모리 값이 할당 요청되었을 때 공유 풀의 free list 에 합한 메모리 공간이 없으면 예약된 메모리 공간의 리스트에서 메모리를 할당해 준다.
이 값은 8i부터는 내부적으로만 사용된다.

Workaround
-----------
Re-start the instance

Solution Description:
---------------------
이 Error 해결방안을 살펴 보면 다음과 같다.

1. 혹시 알려진 제품 문제에 해당 되지 않는지 확인 한다.

* BUG 1397603: ORA-4031 / SGA memory leak of PERMANENT memory occurs for buffer handles. (Workaround: _db_handles_cached=0, Fixed: 8172,901 )
* BUG 1640583: ORA-4031 due to leak / cache buffer chain contentionfrom AND-EQUAL access. (Fixed: 8171,901 )
* BUG 1318267: INSERT AS SELECT statements may not be shared when they should be if TIMED_STATISTICS. It can lead to ORA-4031. (Workaround: _SQLEXEC_PROGRESSION_COST=0, Fixed: 8171, 8200)
* BUG 1193003: Cursors may not be shared in 8.1 when they should be (Fixed: 8162, 8170, 901)


2. Object를 Shared Pool에 맞추어 Fragmentation을 줄인다.
(Dbms_Shared_Pool Procedure 이용)

다음은 크기가 크고 빈번히 access되는 package들임.

standard packages
dbms_standard
diutil
diana
dbms_sys_sql
dbms_sql
dbms_utility
dbms_describe
pidl
dbms_output
dbms_job


3. Shared Pool 을 효율적으로 사용하도록 Application Program을 조절한다.


4. 메모리 할당을 조정한다.

우선 다음 쿼리로 library cache 문제인지 shared pool reserved space 문제인지 진단한다.

SELECT free_space, avg_free_size, used_space, avg_used_size, request_failures, last_failure_size FROM v$shared_pool_reserved;

만일 REQUEST_FAILURES is > 0 and LAST_FAILURE_SIZE is > SHARED_POOL_RESERVED_MIN_ALLOC
이면 ORA-4031 은 Shared Pool 의 연속 공간 부족의 결과이다.

해결책: SHARED_POOL_RESERVED_MIN_ALLOC 값을 증가 시켜서 shared pool reserved space 에 올라가는 오브젝트의 수를 줄인다. 그리고
SHARED_POOL_RESERVED_SIZE 와 SHARED_POOL_SIZE 를 충분히 확보해 준다.

만일 REQUEST_FAILURES is > 0 and LAST_FAILURE_SIZE is < SHARED_POOL_RESERVED_MIN_ALLOC
이거나
REQUEST_FAILURES is 0 and LAST_FAILURE_SIZE is < SHARED_POOL_RESERVED_MIN_ALLOC
이면 ORA-4031 은 library cache 내의 연속된 공간 부족의 결과 이다.

해결책: SHARED_POOL_RESERVED_MIN_ALLOC 을 줄여서 shared pool reserved space 를 보다 쉽게 사용할 수 있도록 해준다. 그리고 가능하면 SHARED_POOL_SIZE 를 증가시킨다.


5. DBMS_SHARED_POOL STORED PROCEDURE 사용법

이 stored package는 dbmspool.sql을 포함하며 7.0.13 이상 version에서 사용가능하다. 이는 다음과 같이 3가지 부분으로 나누어 진다.

Procedure sizes(minsize number):-> Shared_Pool_size 안에서 정해진 Size 보다 큰 Object를 보여준다.

Procedure keep(name varchar2, flag char Default 'P'):
-> Object (Only Package)를 Shared Pool 에 유지한다. 또한 일단 Keep한 Object는 LRU Algorithm에 영향을 받지 않으며 "Alter System Flush Shared_Pool" Command 에 의해 Package 의 Compiled
Version 이 Shared Pool에서 Clear되지 않는다.

Procedure unkeep(name varchar2):-> keep() 의 반대 기능이다

이 Procedure들과 사용법에 대해 보다 더 자세한 정보를 위해서는 $ORACLE_HOME/rdbms/admin/dbmspool.sql script 또는 오라클 레퍼런스 매뉴얼을 참조하기 바람.


Reference Documents
-------------------
Diagnosing and Resolving Error ORA-04031.

위의 내용과 관련하여 SharedPoolSize 조절 방법은 아래와 같다.

이미 공지의 사실이지만 서두로 언급하면 Oracle은 Background Process와 SGA영역으로 구분된다.

그중 SGA는 SharedPool과 RedoLogBuffer, BufferCache로 이루어져 있다.

이중 SharedPool은 SQL Area와 Data Structure로 이루어져 있다.

SharedPool Size를 산정하는 방법은 아래와 같다.

계산 공식        

Session당 최대메모리사용량(Max Session Memory) * 동시 접속하는 User의 수 
+  Shared SQL 영역으로 사용되는 메모리양         
+  Shared PLSQL을 위해 사용하는 메모리 영역          
+  최소 30%의 여유 공간 

계산 예제         

  (1) 적당한 user session에 대한 session id를 찾는다.        
         
        SQLDBA>  select sid from v$process p, v$session s          
             where p.addr=s.paddr and s.username='SCOTT';         

              SID         
           ----------         
               29         
        1 rows selected.         

  (2) 이 session id에 대한 maximum session memory를 찾는다.        
         
        SQLDBA> select value from v$sesstat s, v$statname n          
            where s.statistic# = n.statistic#          
            and n.name = 'session uga memory max' and sid=29;         

           VALUE              
           -----------         
            273877                 
        1 rows selected.         
         
  (3) Total shared SQL area를 구한다.        
         
        SQLDBA>  select sum(sharable_mem) from v$sqlarea;         

        SUM(SHARAB         
        ---------------------         
               8936625         
        1 row selected.         
         
  (4) PLSQL sharable memory area를 구한다.         
         
        SQLDBA>  select sum(sharable_mem) from v$db_object_cache;         

        SUM(SHARAB         
        ------------------         
            4823537         
        1 row selected.         
         
         
  (5) Shared pool size를 계산한다.         
                 
             274K shared memory  *  400 users         
        +      9M Shared SQL Area              
        +      5M PLSQL Sharable Memory          
        +      60M Free Space (30%)              

        =    184M Shared Pool            
                 
          
   이 예제에서는 Shared pool의 size는 184M가 적당하다고 할 수 있다. 이때 Free Space(60M) 계산 방법은 전제 184 M 에 대한 30 % 정도의 추정치 이다.        
         
Shared Memory부족 (ORA-4031)에 대한 대처

 다음과 같은 방법으로 에러를 피해 갈 수 있다.- "Sys.dbms_shared_pool.keep" procedure사용.        

[참고] 위 package를 사용하려면 ?/rdbms/admin/dbmspool.sql,prvtpool.sql를 수행시켜 package를 create시킨 후 사용한다.        
    (자세한 사항은 bulletin 10095,Oracle7 Server Tuning 4장12를 참조한다.)         
         

ORACLE_HOME/dbs/initSID.ora에 보시면 Processes=???값과 sessions=?????라는
값에 좌우가 되는데 시스템에서 허락되는
User별 process값이 있고 이 범위내에서 허용이 된다.
SQL> show parameter process;

NAME TYPE VALUE
------------------------------------ ------- ------------------------------
aq_tm_processes integer 0
db_writer_processes integer 1
job_queue_processes integer 0
log_archive_max_processes integer 1
processes integer 300
SQL> show parameter session;

NAME TYPE VALUE
------------------------------------ ------- ------------------------------
java_max_sessionspace_size integer 0
java_soft_sessionspace_limit integer 0
license_max_sessions integer 0
license_sessions_warning integer 0
mts_sessions integer 330
session_cached_cursors integer 0
session_max_open_files integer 10
sessions integer 335
SQL>
Posted by 天下太平
,
from http://coffeenix.net/doc/misc/locale.html

로케일(Locale)에 관하여...

  1. 로케일(Locale)의 의미
  2.  세계 여러 나라들은 각자 다른 문화(언어, 날짜, 시간 등)을 갖고 있다. 프로그램의
    국제화(Internationalization, 줄여서 i18n)는 사용자로 하여금 프로그램 수행시
    로케일이란 것에 의해 입맛에 맞는 환경을 선택할 수 있도록 만든 것을 말한다.
    예를 들어 어떤 프로그램의 메시지가 여러가지 언어로 주어져 있는 경우 이중에
    어떤 언어의 것을 출력할 것인가를 사용자가 결정할 수 있는 것이다. 그것을 
    가능하게 해 주는 수단이 바로 로케일이다. 이것은 단순히 메시지 뿐만이 아니고
    숫자표현법, 날짜 또는 시간표현법 등 여러가지에 사용될 수 있다. 그것 각각을
    우리는 카테고리(category)라고 부른다. 카테고리에는 LC_COLLATE, LC_CTYPE,
    LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME 가 있다.
    

  3. 로케일 설정방법
  4.  로케일을 지원하는 프로그램의 실행 방식을 선택하기 위해서는 환경 변수 설정을
    이용한다. (카테고리 각각에 해당하는 환경변수는 카테고리 이름과 동일하다.)
    로케일 환경 변수에 관한 정보는 locale이란 명령으로 간단히 얻을 수 있다.
    % locale
    LANG=ko_KR.eucKR
    LC_CTYPE="ko_KR.eucKR"
    LC_NUMERIC="ko_KR.eucKR"
    LC_TIME="ko_KR.eucKR"
    LC_COLLATE="ko_KR.eucKR"
    LC_MONETARY="ko_KR.eucKR"
    LC_MESSAGES="ko_KR.eucKR"
    LC_ALL=
     위에서 ko_KR.eucKR은 로케일 값(locale name)이다. 일반적인 로케일 값의 형식은
    ll[_CC[.EEEE]][@dddd] 이다. ll은 언어(language)를 지정하는 소문자 두 글자 ISO
    639 language code, CC는 지역(territory)를 지정하는 대문자 두 글자 ISO 3166
    country code, EEEE는 코드셋(codeset)을 지정하는 문자셋(character set) 또는
    인코딩(encoding), dddd는 방언 등의 변종을 구별하기 위한 것(modifier)이다. []로
    표시된 내용은 안 쓸수도 있음을 의미한다. 예를 들면 en_US는 미국 영어권, en_CA는
    영어권 카나다, de_DE는 독일의 독일어, fr_FR는 프랑스의 프랑스어를 의미한다.
     아무 로케일도 설정하지 않았을 때 glibc에서의 기본 로케일은 C 또는 POSIX
    (glibc에서는 C 로케일의 alias) 로케일이다. 
    % locale -a
    라는 명령을 이용하면 이외에 사용 가능한 로케일의 이름들을 알 수 있다.
     다음은 여러가지 환경변수의 역할(카테고리의 경우에는 동시에 카테고리의 역할)에
    관한 설명이다.
    
      LANG : 모든 카테고리에 대한 로케일 설정을 위한 환경변수이다. 하지만 LC_*
    환경변수보다 우선 순위가 낮다. LC_ALL이 설정이 안 되어 있고 LC_* 값들이 설정이
    따로 설정이 않된 경우 LANG을 변화시키면 LC_ALL을 제외한 로케일 카테고리들의
    값이 변경되지만 LC_ALL이 설정 되어 있는 경우 LANG의 변화는 로케일 카테고리들의
    값에 영향을 주지 않는다.
      LC_CTYPE : 문자 분류(알파벳, 숫자, 한글 또는 소문자, 대문자 등등), 변환,
    대소문자 비교을 위한 로케일 설정을 의미한다. 이것은 예를 들어 fgetwc(), is*(),
    isw*(), mblen(), mbtowc(), wcstombs() 등의 함수에 영향을 줄 수 있다.
      LC_COLLATE : 스트링(string)의 정렬 순서(sort order 또는 collation)를 위한
    로케일 설정을 위해 사용된다. 이것은 예를 들어 strcoll(), wcscoll(), strxfrm()
    등의 함수에 영향을 줄 수 있다.
      LC_MESSAGES : 메시지 표현을 위한 로케일 설정. 메시지의 국제화를 위한
    catopen(), gettext() 등의 함수에 영향을 줄 수 있다.
      LC_NUMERIC : 금액이 아닌 숫자 표현(천단위, 소수점, 숫자 그룹핑 등)을 위한
    로케일 설정. 예를 들어 strtod(), atof().
      LC_MONETARY : 금액 표현(천단위 구분 문자, 소수점 문자, 금액 표시 문자, 그 
    위치 등)을 위한 로케일 설정. 예를 들어 strfmon().
      LC_TIME : 시간과 날짜의 표현(년, 월, 일에 대한 명칭 등)을 위한 로케일 설정
    예를 들어 strftime(), strptime().
      LC_ALL : 모든 카테고리에 대한 로케일 설정을 위한 환경변수이다. 위의 LC_* 및
    LANG의 어떤 것보다 우선 순위가 높다. 그리고 LC_ALL을 설정하면 다른 로케일
    카테고리의 값들이 LC_ALL의 값의 변경되고 LC_ALL설정을 없애면 다른 로케일
    카테고리의 값들은 이전값을 유지한다.
      LANGUAGE : 로케일의 다중 설정을 위해 gettext에서 사용되는 GNU extension 
    환경변수로 LC_ALL보다도 우선순위가 높다. 로케일들은 구분문자 : 을 이용하여
    우선순위가 높은 순대로 나열된다. 예를 들어 LANGUAGE=en_US:ko_KR
      LINGUAS : gettext를 사용하는 프로그램 설치시 지정한 언어들의 메시지만을
    설치하기 위한 환경변수. 구분 문자는 스페이스이다. 예를 들어 LINGUAS="ko ja"
    

  5. 로케일을 지원하기 위한 방법 및 작동 원리
  6.  로케일을 제대로 지원하는 프로그램을 작성하기 위해서는 setlocale()함수를
    이용하여 로케일을 설정하고 확인하여야 한다. setlocale()함수는 헤더 파일
    locale.h 에 정의되어 있으며 그 프로토타입은 다음과 같다.
     char *setlocale (int category, const char *locale);
    이 함수의 역할은 카테고리 category에 대해 로케일 locale을 설정하고 (물론, 사용
    가능한 로케일인 경우), 설정된 로케일값을 리턴하는 것이다.
     locale 부분에 ""을 넣은 다음과 같은 예는
     setlocale (LC_ALL, "");
    적당한 환경변수를 참조하여 로케일을 설정하고 그 값을 리턴한다. 환경변수를
    참조하는 우선순위는 위에서 설명한대로 LC_ALL, 그외 카테고리, LANG변수 순이고,
    변수값을 알아내면 locale.alias(예를 들어, /usr/share/locale/)를 참조한 후
    뒤에서부터 @ . _ 을 단위로 순서대로 잘라가며 사용가능한 로케일을 찾아낸다.
     인수 locale 부분에 NULL을 넣은 다음예는 
     locale = setlocale (LC_ALL, NULL);
    로케일 값을 변경시키지 않고 단지 카테고리에 관한 현재 로케일값을 알아내고자 
    하기 위해 그 리턴값을 사용하는 예이다.
     다음은 함수 setlocale()을 사용하여 임시로 로케일로 변경하는 예이다. (glibc
    manual에 있는 예)
    
         #include <stddef.h>
         #include <locale.h>
         #include <stdlib.h>
         #include <string.h>
         
         void
         with_other_locale (char *new_locale,
                            void (*subroutine) (int),
                            int argument)
         {
           char *old_locale, *saved_locale;
         
           /* 현재 로케일명을 알아낸다. */
           old_locale = setlocale (LC_ALL, NULL);
         
           /* setlocale()의 재호출 의해 변경될 것을 대비해 로케일 이름을 미리 복사해 둔다. */
           saved_locale = strdup (old_locale);
           if (saved_locale == NULL)
             fatal ("Out of memory");
         
           /* 로케일을 변경하고 subroutine을 수행한다. */
           setlocale (LC_ALL, new_locale);
           (*subroutine) (argument);
         
           /* 원래의 로케일로 복귀한다. */
           setlocale (LC_ALL, saved_locale);
           free (saved_locale);
         }
    
     다음은 로케일을 이용하여 날짜/시간을 출력하는 프로그램의 예이다.
    	#include <stdio.h>
    	#include <locale.h>
    	#include <time.h>
    
    	int main(void)
    	{
    		time_t now;
    		struct tm *l_time;
    		char string[256];
    
    		/* 환경변수로부터 시간 관련 로케일을 결정한다. */
    		setlocale(LC_TIME, "");
    
    		/* calendar 시간을 now라는 변수에 저장. 
    		 * 그 값은 1970년 1월 1일 이후부터 지금까지의 초단위 시간 */
    		now = time((time_t *)NULL);
    
    		/* calendar 시간의 다른 유용한 형태를 l_time변수에 저장 */
    		l_time = localtime(&now);
    
    		/* 우리가 원하는 포맷의 시간 포맷을 string이라는 변수에 저장 */
    		strftime(string, sizeof string, "%c", l_time);
    
    		/* 출력 */
    	 	printf("%s\n", string);
    
    		return 0;
    	}
     다음은 위의 파일을 time_test.c라고 저장하고 컴파일하여 c쉘에서 시험하는 
    예이다.
    % gcc -o time_test time_test.c
    % setenv LANG ko_KR.eucKR
    % ./time_test
    2000년 01월 12일 수요일 오후 10시 26분 56초
    % setenv LANG C
    % ./time_test
    Wed Jan 12 22:27:22 2000
    


<주 페이지로> <한단계 위로>
Copyright 2000.8 by HyunChul Kim

최근 수정일: 12/08/00


Posted by 天下太平
,
Posted by 天下太平
,

Inside the Java Virtual Machine
by Bill Venners
http://www.artima.com/insidejvm/ed2/index.html



Posted by 天下太平
,

[LINK] TCP/IP 관련 URL

Network 2008. 12. 19. 01:24
Posted by 天下太平
,
만약 java.lang.UnsatisfiedLinkError 오류가 난다면
Library Path를 체크해보자.

JVM이 시작될 때
AIX는 LIBPATH
Solaris는 LD_LIBRARY_PATH
HP-UX는 SHLIB_PATH
의 값이 java.library.path 에 할당된다.
Posted by 天下太平
,

[LINK] Java Enterprise

Java 2008. 8. 26. 04:08
Posted by 天下太平
,
오류 메시지: 계정 제한 때문에 로그온할 수 없습니다.본 문서의 정보는 다음의 제품에 적용됩니다.:

Microsoft Windows XP Professional
Microsoft Windows XP 64비트 버전
-------------------------------------------------------------------------

현상

원격 데스크톱 도구를 사용하여 Windows XP 기반 컴퓨터에 연결하려고 하면 아래의 오류 메시지가 나타날 수도 있습니다. 계정 제한 때문에 로그온할 수 없습니다.

원인

연결하는 데 사용한 계정에 암호가 없으면 이러한 문제가 발생할 수 있습니다. 암호가 없는 계정을 사용할 때는 원격 데스크톱 연결을 설정할 수 없습니다.

해결 방법

원격 데스크톱 연결을 설정할 수 있도록 이 문제를 해결하려면 해당 컴퓨터의 콘솔에서 로그온한 다음 해당 사용자 계정에 대해 암호를 설정하십시오.

상 태

이것은 의도적으로 설계된 동작입니다.

추가 정보

정책을 사용하여 빈 암호 제한을 해제할 수 있습니다. 이 정책을 찾아서 변경하려면 다음과 같이 하십시오. 시작을 누르고, 실행을 누르고, gpedit.msc를 입력한 다음 확인을 눌러 그룹 정책 편집기를 시작합니다. 컴퓨터 구성Windows 설정보안 설정로컬 정책보안 옵션계정: 콘솔 로그온 시 로컬 계정에서 빈 암호 사용 제한을 엽니다.

콘솔 로그온 시 로컬 계정에서 빈 암호 사용 제한을 두 번 누릅니다.
사용 안함을 누른 다음 확인을 누릅니다.
그룹 정책 편집기를 종료합니다.
참고: 기본적으로 이 정책은 사용함으로 설정되어 있습니다.


출처: http://lhs0806.wowdns.com/tt/lhs/535
Posted by 天下太平
,

시작!

Log 2008. 6. 19. 00:12
2008년 6월 정신없이 바쁘던 어느날
우연을 가장한 필연처럼 티스토리에 들어왔습니다

지친 하루를 행구는 시간
은은한 미소가 켜켜이 쌓이는 공간이 되기를.
Posted by 天下太平
,