2014. 9. 26. 15:52

admin-console

애플릿 기반 콘솔은 HTML 기반 jmx-console과 동일한 기능을 제공하지만 이 기능을 사용하려면 웹 브라우저에 JRE(Java Runtime Environment) 가 설치되어야 함, HTML 기반 jmx-console 보다 무겁고 응답 속도가 느린 단점이 있지만

애플릿의 기능을 활용하여 정보를 차트형태로 볼 수 있는 기능을 제공하며 해당 값의 모니터링 및 스냅샵 기능 추가로 제공

 

jboss6 -> admin-console

http://localhost:8080/admin-console

 

ID, PW 변경방법

경로 : /jboss-6.1.0.Final/server/default/conf/props

파일 : jmx-console-users.properties

'JBoss' 카테고리의 다른 글

JBoss 기본 로깅 레벨 변경  (0) 2015.01.06
web<->was session balancing check  (0) 2014.08.28
JBOSS 바인딩 IP 정의  (0) 2014.08.26
Posted by 아도니우스
2014. 9. 26. 09:47

1. 확장 파일 시스템(extended file system)

  ■ ext

  리눅스 초기에 사용되던 파일 시스템이며 호환성이 없다. ext2의 원형이다.
 

  ■ ext2

  ext3가 개발되기 이전까지 가장 많이 사용된 파일 시스템으로 리눅스 파일 시스템 대부분의 기능을 제공하는 파일 시스템이다. 특히 ext2는 뛰어난 안정성과 속도로 가장 유명한 파일 시스템으로 자리 잡았고 ext3 또한 ext2에 기반을 두어 개발되었다. 또한 쉽게 호환되며 업그레이드도 쉽게 설계되어 있다.[각주:2]

 

  ■ ext3

  ext2 파일시스템에 저널링(Journaling)[각주:3]을 지원하도록 확장된 파일시스템이다. 현재 리눅스 가장 많이 사용 됨

 

  ■ ext4

  xt3 파일시스템을 확장한 파일시스템으로 Extent라는 기능을 제공하여, 파일에 디스크 할당 시 물리적으로 연속적인 블록을 할당할 수 있도록 하여, 파일 접근 속도 향상 및 단편화[각주:5]를 줄이도록 설계된 파일시스템이다.[각주:6]

  ■ 파일의 확장자는 필요 없으며 파일의 특성을 알리기 위해 확장자 사용가능 (*.c, *.java)

  ■ '.' 으로 시작하는 파일은 숨겨진 파일 ('ls -a' 명령으로 보임)

  ■ '.'은 현재 디렉토리, '..' 는 부모 디렉토리

  ■ 파일 시스템의 크기는 최대 2Tib ~ 16 TiB (변동 가능)

 

 ※ 참고사이트 : http://smile-cat.tistory.com/8

'Linux' 카테고리의 다른 글

basename, dirname  (0) 2014.09.30
리눅스 부팅모드  (0) 2014.09.26
find 명령어  (0) 2014.09.24
리눅스 패스워드 기한 변경  (0) 2014.09.18
SED  (0) 2014.09.16
Posted by 아도니우스
2014. 9. 24. 18:33
1. RDA for weblogic
-----------------------
RDA is shipped with Oracle Fusion Middleware 11g. You will find it in two places
  • MW_HOME/ORACLE_SOA/rda
  • MW_HOME/oracle_common/rda

RDA has two phases, setup and run. Setup needs to done one time, In which RDA will ask several Questions.
It will store those answers in setup.cfg file in the same directory from where you are running rda.
Once setup is done, subsequent runs will use the information in setup.cfg

KM note 1352181.1 describes all questions asked for the SOA module.

Running RDA for weblogic Server:
Go to your domain home/bin directory and set:
. ./setDomainEnv.sh

Go to MW_HOME/oracle_common/rda
Here first time you need to run:

Use the following RDA command for setup - no security filter:
Unix:
rda.sh -S -p WebLogicServer

MS Windows:
rda.cmd -S -p WebLogicServer

 

2. RDA Health Check : ./rda.sh -HCV

Posted by 아도니우스
2014. 9. 24. 11:09

# find [시작점] [옵션] [형식] -print

시작점 : 해당 디렉토리를 기준으로 해당 디렉토리 하위의 모든 파일 검색

-print 는 default로 적용 되어 있어 안써줘도 무방함.

 

find / -name app* -print

find / -size +102400k -print

find / -mtime -10 -print

 => mtime(modification time=수정시간), 최근 10일이내 변경된 파일만 검색

find / -atime -10 -print

 => atime(access time=접근시간), 최근 10일이내 접근한 파일 검색

 

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

find . -mtime +7 -type f  -exec rm{} \;

find . -mtime +7 -type f | wc -l

find . -mtime -20 -print

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

 

# find 명령어 TIP

find / -name *.log -exec rm {}\;

 => log 라는 이름이 들어간 파일을 찾아서 삭제

find / -mtime +10 -exec rm {} \;

 => 10일 이전에 변경 된 파일을 찾아서 삭제 (ex. 다수 log 삭제 시 유용)

ex) find . -mtime +10 -type f -exec rm {} \;

 => 수정한 지 10일 이상된 파일 삭제

'Linux' 카테고리의 다른 글

리눅스 부팅모드  (0) 2014.09.26
ext 특징(extended file system)  (0) 2014.09.26
리눅스 패스워드 기한 변경  (0) 2014.09.18
SED  (0) 2014.09.16
vncserver  (0) 2014.09.11
Posted by 아도니우스
2014. 9. 22. 15:54

Can you throw some WLST script for Moving the messages from one JMS queue to other?

Hi,

In place of cmo.deleteMessages, please use the blow syntax to move the messaging from one queue to another:

cmo.moveMesages("JMSMessageID LIKE \' ID:\", target)

Let me know if it works.

Best Regards,

'Weblogic' 카테고리의 다른 글

apache http server benchmarking tool  (0) 2014.10.02
jms queue Import && Export  (0) 2014.09.29
DELETE MESSAGES FROM JMS QUEUE USING WLST  (0) 2014.09.22
JVM Heap Size and Garbage Collection  (0) 2014.09.19
weblogic 12c  (0) 2014.08.27
Posted by 아도니우스
2014. 9. 22. 15:06

Connect to the server using WLST by entering the command java weblogic.WLST Enter the command connect()

Enter the username, password, and the admin server url you want to connect to.

 

Chagne the location to serverRuntime by entering the command serverRuntime().

Traverse to the below location:

-cd('JMSRuntime')

-cd('AdminServer.jms')

-cd('JMSServers')

-cd('FEJMSServer')

-cd('Destinations')

-cd('FRModule!FRQ')

-ls()

 

It shows all the attributes and fuctions of Queue.

wls:/lab_domain/serverRuntimes/JMSRuntime/AdminServer.jms/JMSServers/FMWServer/Destinations/FRModule!FRQ>ls()

wls:/aiaDomain/domainRuntime/ServerRuntimes/aiaSvr21/JMSRuntime/aiaSvr#1.jms/KTOSSJMSServer#1/Destinations/KTOSSJMSModule!KTOSSJMSServer#1@ProcessProvisioningOrderWIFISOHOReqJmsQueue

wls:/lab_domain/serverRuntime/JMSRuntime/AdminServer.jms/JMSServers/FEJMSServer/Destinations/FRModule!FRQ> ls()
dr– DurableSubscribers

-r– BytesCurrentCount 11
-r– BytesHighCount 11
-r– BytesPendingCount 0
-r– BytesReceivedCount 0
-r– BytesThresholdTime 0
-r– ConsumersCurrentCount 0
-r– ConsumersHighCount 0
-r– ConsumersTotalCount 0
-r– ConsumptionPaused false
-r– ConsumptionPausedState Consumption-Enabled
-r– DestinationInfo

-r– DestinationType Queue
-r– DurableSubscribers null
-r– InsertionPaused false
-r– InsertionPausedState Insertion-Enabled
-r– MessagesCurrentCount 3
-r– MessagesDeletedCurrentCount 0
-r– MessagesHighCount 3
-r– MessagesMovedCurrentCount 0
-r– MessagesPendingCount 0
-r– MessagesReceivedCount 0
-r– MessagesThresholdTime 0
-r– Name FRModule!FRQ
-r– Paused false
-r– ProductionPaused false
-r– ProductionPausedState Production-Enabled
-r– State advertised_in_cluster_jndi
-r– Type JMSDestinationRuntime

-r-x closeCursor Void : String(cursorHandle)
-r-x deleteMessages Integer : String(selector)
-r-x getCursorEndPosition Long : String(cursorHandle)
-r-x getCursorSize Long : String(cursorHandle)
-r-x getCursorStartPosition Long : String(cursorHandle)
-r-x getItems javax.management.openmbean.CompositeData[] : String(cursorHandle),Long(start),Integer(count)
-r-x getMessage javax.management.openmbean.CompositeData : String(cursorHandle),Long(messageHandle)
-r-x getMessage javax.management.openmbean.CompositeData : String(cursorHandle),String(messageID)
-r-x getMessage javax.management.openmbean.CompositeData : String(messageID)
-r-x getMessages String : String(selector),Integer(timeout)
-r-x getMessages String : String(selector),Integer(timeout),Integer(state)
-r-x getNext javax.management.openmbean.CompositeData[] : String(cursorHandle),Integer(count)
-r-x getPrevious javax.management.openmbean.CompositeData[] : String(cursorHandle),Integer(count)
-r-x importMessages Void : javax.management.openmbean.CompositeData[],Boolean(replaceOnly)
-r-x moveMessages Integer : String(java.lang.String),javax.management.openmbean.CompositeData,Integer(java.lang.Inte
ger)
-r-x moveMessages Integer : String(selector),javax.management.openmbean.CompositeData
-r-x pause Void :
-r-x pauseConsumption Void :
-r-x pauseInsertion Void :
-r-x pauseProduction Void :
-r-x preDeregister Void :
-r-x resume Void :
-r-x resumeConsumption Void :
-r-x resumeInsertion Void :
-r-x resumeProduction Void :
-r-x sort Long : String(cursorHandle),Long(start),String[](fields),Boolean[](ascending)

For deleting messages, type the below command:

wls:/lab_domain/serverRuntime/JMSRuntime/AdminServer.jms/JMSServers/FEJMSServer/Destinations/FRModule!FRQ> cmo.deleteMessages(“JMSMessageID IN(‘ID:<840637.1277114817339.0>’)”)

cmo.deleteMessages(" ") {This command delete all messaged in queue and will return the number of messages deleted.}
Results will be:
1
It will delete a message having id ID:<840637.1277114817339.0>

 

※ 참고사이트 : http://vivek-samples.blogspot.kr/2013_02_26_archive.html

'Weblogic' 카테고리의 다른 글

jms queue Import && Export  (0) 2014.09.29
"Delete Messages From JMS Queue Using WLST:  (0) 2014.09.22
JVM Heap Size and Garbage Collection  (0) 2014.09.19
weblogic 12c  (0) 2014.08.27
pythons programming  (0) 2014.08.25
Posted by 아도니우스
2014. 9. 21. 20:30

1.1. 테이블과 인덱스의 분리형

1.1.1. 분리형 테이블의 구조

  • 테이블과 인덱스가 별도로 분리되어 있는 구조로 관계형 데이터베이스의 가장 일반적인 데이터 저장형식 
    분리형 테이블의 구조

1.1.png

 

  • 자료가 입력되면 DBMS는 FREE LIST에서 DB의 여러 블록중 저장가능한 블록을 확인후 저장 
    저장시 블록내  이어진 공간이 없다면 전체 블록의 로우 위치를 재배치(Condensing)후 저장(반드시 한조각이되어야함)
    'FREE SPACE'는 이미 들어가 있는 로우들의 길이에 변화가 생겼을대 사용하는 여유 공간(UPDATE등) - pctfree로 지정 

1.2.png

  • 테이블스페이스(Tablespace) 
    데이터가 저장되는 논리적인 저장공간 
    물리적인 데이터 파일(Datafile)로 구성
  • 세그먼트(Segment) 
    테이블스페이스를 용도별로 나눔(데이터 오브젝트(Object)) 
    파티션(Partition)이 발생한 테이블이나 인덱스는 각각의 파티션이 단위오브젝트가 됨 
    파티션된 테이블의 각 파티션이 서로 다른 테이블스페이스에 존재하는 경우는 여러 테이블스페이스에 걸쳐 저장 
    개별 파티션이나 파티션되지 않는 테이블들은 반드시 하나의 테이블스페이스에 존재
  • ROWID
    '오브젝트번호+데이터파일번호(테이블스페이스당 일련번호)+블록번호+슬롯번호'로 구성 
    인덱스에 존재( 테이블에 존재하지 않음) 
    * ROWID의 오브젝트 번호와 데이터파일 번호를 통해물리적인 저장위치를 찾아서 거기에 있는 블록번호를 찾아가면 슬롯
    * 블록내에서 로우의 위치가 이동하더라고 rowid는 결코 변하는 않음(슬롯은 로우(자료)의 위치를 가지고있음) 
    로우가 한조각으로 저장될수있는 위치로 이동했을때 해당 슬롯에 있는 위치 값은 새로운 위치값으로 변경
  • Oracle Physical Rowid 
    000000  + FFF +  BBBBBB +  RRR 
    (Data obect(6) + Relative file(3) + Block(6) + Row(3)): 16자리 (저장시 10자리) 
    Data Object number: DATABASE SEGMENT 식별정보 
    Relative File number: Tablespace에 성대적 Datafile 번호 
    Bolck Number : Row 를 포함하는 Data Bolck 번호 
    Row number: Block 에서 row 의 Slot
  • SQL Server 의 Rid 
    8바이트 = Page Address(4)+File ID(2) + slot number(2)
  • 응축(Condensing)작업 
    이동이 계속적으로 발생하면 결국에는 사용할 수 없는 수많은 작은 조각(Fragmentation)들이 발생 
    이어진 조각이 없어 저장이 불가능하게 될때 자동으로 블록의 로우들을 재구성작업 
    만약 여유공간(FREESPACE(PCTFREE값)) 이 너무 적게 지정되었다면 지나치게 빈번한 응축자업이 발생하여 부하의 원인이 될수있음 
    수정이 빈번하게 발생할 가능성이 높다면 다수 충분하게 여유공간(PCTFREE) 를 지정해주는 것이 유리
  • 로우의 이주(Migration) 
    로우의 블록이동 발생시 기존 ROWID에 새로운 ROWID를 넣어 ROWID를 찾을수 있게함 
    인덱스의 ROWID를 변경시키지 않는 대신에 액세스를 할때 여러 블록을 읽어야 하는 오버헤드발생 
    이주현상은 로우나 테이블을 삭제하고 테이블을 재생성 해야만 치유( delete and insert ) 
    체인(chain) 
    여러 블록에 걸쳐 데이타가 존재한다는 점에서 이주와 유사 
    어떤로우의 길이가 한블록의 크기를 넘을때 필요한 공간만큼 블록을 연결해서 저장하는것 
    일반적으로 블록 내에 존재하는 로우는 가변길이로 존재

1.1.2. 클러스터링 팩터(Clustering Factor)

 

클러스터링 팩터(Clustering Factor)

1.3.png

 

  • 인덱스의 컬럼값으로 정렬되어 있는 인덱스 로우의 순서와 테이블에 저장되어있는 데이터 로우가 얼마나 비슷한 순서로 저장되어 있느냐에 대한 정도를 나타내는 것 
    INDEX1: 5ROW를 불러오는데 2블럭을 읽었음 - 클러스터링 팩터가 좋음 
    INDEX2: 3ROW를 불러오는데 3블럭을 읽었음 - INDEX1에 비해 클러스터링 팩터가 나쁨 
    분리형 테이블의 구조의 최대의 특징인 데이터의 값에 전혀 무관하게 '임의의 위치' 에 저장할 경우 
    데이터 작업을 할 경우  최소한 한개 이상의 블록은 엑세스 할수 밖에 없음 (로우를 액세스하지만 실제 DBMS는 블록을 액세스 후 로우를 찾음)
  • 인덱스는 인덱스 컬럼과 ROWID 로 정렬 
    ROWID로 정렬되었다는것은 물리적인 데이터파일의 블록으로 정렬되고, 거기에서 다시 슬롯번호로 정렬되었다는 것을 뜻
    클러스터링 팩터가 좋은 인덱스로 액세스하면 많은 로우를 액세스 하더라도 보다 적은 블록을 액세스하게 되어 효율적임
  • 클러스터링 팩터를 높이는 방법 
    원하는 형태로 저장(저장 시 과도한 비용을 발생할수 있음) 
    주기적 테이블을 재생성 
    저장할 컬럼 순서를 전략차원에서 판단하여 결정


1.1.3. 분리형 테이블의 액세스 영향 요소

 

가) 넓은 범위의 액세스 처리에 대한 대처방안

  • 먼저 가장 중요한 액세스 형태를 선정 
    컬럼이 가진 처리범위에 대한 문제를 해결할 수있는 방법을 찾아야 함
  • 특정한 모양으로 저장 
    특정 액세스 형태에서만 효율을 얻을수 있을뿐 
    데이터 등록시의 부하 부담을 무시할수없다면 특정 위치에 저장을 하는 것은 다시 한번 검토
  • 지속적으로 증가하는 데이터 
    관리적인 측면의 부담이 크다면 파티션을 적용 
    인덱스를 전략적으로 구성하고 SQL의 실행계획을 최적화

나) 클러스터링 팩터 향상전략

  • 분리형 구조는 아무렇게나 저장해도 괞찮다는 의미이지만 반대로  의도적으로 우리에게 유리한 형태로 저장하는 것도 가능하다는 뜻
  • 테이블을 재생성 
    주기적으로 재생성하여 이미 저장되어있는 데이터의 응집도를 높여 주는것 
    체인을 감소시키고 블록 내 데이터의 저장율을 높여 불필요한 I/O를 줄이기 위해 사용 
    가지 깊이(BRANCH DEPTH)가 정리되는 효과
  • 테이블에 데이터를 저장할 때 관련된 인덱스를 모두 제거하거나 비활성
  • 인덱스를 생성한 채로 대량의 데이터를 저장하면 테이블의 저장 속도가 크게 저하될 뿐만 아니라 인덱스에 많은 분할이 발생하여 인덱스 저장 밀도가 매우 나빠짐
  • 테이블을 생성하는 구문에 기본키 제약조건을 지정해 두었다면 테이블을 생성하면서 기본키가 같이 생성되어 버려 비효율(인덱스 저장밀도가 나빠짐)

 

기타

각 DBMS별, 버젼별 옵션등 다양 - 9I이후 ASSM  도입 (PCTUSED,FREELIST를 명시적으로 지정하지 않고 자동관리 ) 
DBMS별 테이블 생성시 옵션들이 다양하며 그 옵션은 테이블의 용도(업무형태)에 따라 다양하게 구성될수 있다.

Posted by 아도니우스
2014. 9. 19. 19:05

...

'Database' 카테고리의 다른 글

Oracle Event Tour  (0) 2014.10.10
AWR Report  (0) 2014.09.29
Oracle SQL 블록 구조  (0) 2014.09.17
Oracle Function(산술, 문자열, 날짜, 날짜 포맷)  (0) 2014.09.13
GRANT, REVOKE  (0) 2014.09.11
Posted by 아도니우스
2014. 9. 19. 11:48

JVM Heap Size and Garbage Collection

 

You might encounter the following errors when you run out of hip space
java.lang.OutOfMemoryError <<no stack trace available>>
java.lang.OutOfMemoryError <<no stack trace available>>
Exception in thread "main"
Garbage collection is the JVM's process of freeing up unused Java objects in the Java heap. The Java heap is where the objects of a Java program live. It is a repository for live objects, dead objects, and free memory. When an object can no longer be reached from any pointer in the running program, it is considered "garbage" and ready for collection.
The JVM heap size determines how often and how long the VM spends collecting garbage. An acceptable rate for garbage collection is application-specific and should be adjusted after analyzing the actual time and frequency of garbage collections. If you set a large heap size, full garbage collection is slower, but it occurs less frequently. If you set your heap size in accordance with your memory needs, full garbage collection is faster, but occurs more frequently.
The goal of tuning your heap size is to minimize the time that your JVM spends doing garbage collection while maximizing the number of clients that WebLogic Server can handle at a given time. To ensure maximum performance during benchmarking, you might set high heap size values to ensure that garbage collection does not occur during the entire run of the benchmark.

 

 

Specifying Heap Size Values

You must specify Java heap size values each time you start an instance of WebLogic Server. This can be done either from the java command line or by modifying the default values in the startup scripts that are provided with the WebLogic distribution for starting WebLogic Server, as explained in Using WebLogic Startup Scripts to Set Heap Size.
For example, when you start a WebLogic Server instance from a java command line, you could specify the HotSpot VM heap size values as follows:
$ java -XX:NewSize=128m -XX:MaxNewSize=128m -XX:SurvivorRatio=8 -Xms512m -Xmx512m
 
Or startWebLogic.sh at the top
The default size for these values is measured in bytes. Append the letter `k' or `K' to the value to indicate kilobytes, `m' or `M' to indicate megabytes, and `g' or `G' to indicate gigabytes. The example above allocates 128 megabytes of memory to the New generation and maximum New generation heap sizes, and 512 megabytes of memory to the minimum and maximum heap sizes for the WebLogic Server instance running in the JVM.

 


Java Heap Size Options

You achieve best performance by individually tuning each application. However, configuring the Java HotSpot VM heap size options listed in the table below when starting WebLogic Server increases performance for most applications.
These options may differ depending on your architecture and operating system. See your vendor's documentation for platform-specific JVM tuning options.
Automatically Logging Low Memory Conditions
WebLogic Server enables you to automatically log low memory conditions observed by the server. WebLogic Server detects low memory by sampling the available free memory a set number of times during a time interval. At the end of each interval, an average of the free memory is recorded and compared to the average obtained at the next interval. If the average drops by a user-configured amount after any sample interval, the server logs a low memory warning message in the log file and sets the server health state to "warning."
If the average free memory ever drops below 5 percent of the initial free memory recorded immediately after you start the server, WebLogic Server logs a message to the log file.
You configure each aspect of the low memory detection process using the Administration Console:
  1. Start the Administration Server if it is not already running.
  1. Access the Administration Console for the domain.
  1. Expand the Servers node in the navigation tree to display the servers configured in your domain.
  1. Click the name of the server instance that you want to configure. Note that you configure low memory detection on a per-server basis.
  1. Select the Configuration —> Tuning tab in the right pane.
  1. On the Advanced Options bar, click Show to display additional attributes.
  1. Modify the following Memory Option attributes as necessary to tune low memory detection for the selected server instance:
    • Low Memory GCThreshold: Enter a percentage value (0-99 percent) to represent the threshold after which WebLogic Server logs a low memory warning and changes the health state to "warning." By default, Memory GCThreshold is set to 5 percent. This means that by default the server logs a low memory warning after the average free memory reaches 5 percent of the initial free memory measured at the server's boot time.
    • Low Memory Sample Size: Enter the number of times the server samples free memory during a fixed time period. By default, the server samples free memory 10 times each interval to acquire the average free memory. Using a higher sample size can increase the accuracy of the reading.
    • Low Memory Time Interval: Enter the time, in seconds, that define the interval over which the server determines average free memory values. By default WebLogic Server obtains an average free memory value every 3600 seconds.
  1. Click Apply to apply your changes.
  1. Reboot the server to use the new low memory detection attributes.

Manually Requesting Garbage Collection

Make sure that full garbage collection is necessary before manually selecting it on a server. When you perform garbage collection, the JVM often examines every living object in the heap.
To use the Administration Console to request garbage collection on a specific server instance:
  1. On the Administration Console, expand the server instance node for the server whose memory usage you want to view. A dialog box in the right pane shows the tabs associated with this instance.
  1. Select the Monitoring —> Performance tab.
  1. Check the Memory Usage graph for high usage. Note that the Memory Usage graph displays information only for a server that is currently running.
  1. Click the Force garbage collection button to request garbage collection. The Force garbage collection button calls the JVM's System.gc() method to perform garbage collection. Note, however, that the JVM implementation itself decides whether or not the request actually triggers garbage collection.

'Weblogic' 카테고리의 다른 글

"Delete Messages From JMS Queue Using WLST:  (0) 2014.09.22
DELETE MESSAGES FROM JMS QUEUE USING WLST  (0) 2014.09.22
weblogic 12c  (0) 2014.08.27
pythons programming  (0) 2014.08.25
JVM Monitoring with WLST  (0) 2014.08.20
Posted by 아도니우스
2014. 9. 19. 09:31

Oracle SOA Suite 11g, Resequence messages in Mediator

 

“A Resequencer is used to rearrange a stream of related but out-of-sequence messages back into order. It sequences the incoming messages that arrive in a random order and then send them to the target services in an orderly manner. The sequencing is done based on the sequencing strategy selected.”
For the resequencer to work we need to have 2 values in the source payload. The first one is a sequenceID, and the next one is a groupdID. The sequenceID will be used as identifier for the message itself. The groupID will be used to group the messages in which the resequencer will rearrange the messages based on the sequenceID. Different groups will have seperate processing, so they won’t have any influence on each other.
The mediator supplies us 3 types of resequencers :
  • Standard Resequencer
  • FIFO Resequencer
  • BestEffort Resequencer

 

 

Let’s test the first one.
For this i created the next composite

In here i just map the input of the process 1on1 to the File adapter, which will store the input of the process on filesystem.
Interface of the composite
01 <?xml version="1.0" encoding="UTF-8"?>
02 <schema attributeFormDefault="unqualified"
03 elementFormDefault="qualified"
06 <element name="process">
07 <complexType>
08 <sequence>
09 <element name="empID" type="string"/>
10 <element name="empType" type="string"/>
11 <element name="empName" type="string"/>
12 </sequence>
13 </complexType>
14 </element>
15 <element name="processResponse">
16 <complexType>
17 <sequence>
18 <element name="result" type="string"/>
19 </sequence>
20 </complexType>
21 </element>
22 </schema>

 

Configuration of the sequencer

Doubeclick the mediator component in the composite.

For the Resequence Level we can select ‘operations’ or ‘component’.
For Mediator components which only have 1 operation it doesn’t matter which one we select. For a Mediator component which consists of more then 1 operation and selecting the ‘component’ option means resequencing is applied to all operations in it. For this test we selected the ‘component’ option and used the ‘Standard’ mode.
Now we have several options to configurate the resequencer.
  • Group – xpath expression to the field in the payload which the resequencer will use to group our incoming messages
  • ID – xpath expression to the field which will uniquely identify our message
  • Start – Start value of the ID in the incoming message
  • Increment – Value which will be used for the increment of the id field in the upcoming messages
  • Timeout – Time to wait before a following expected message arrives at the Mediator component
And that’s it what is needed for the configuration of the ‘Standard’ resequencer.

 


Test

To test this scenario i will use the following 3 messages.
1 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3 <ns1:process>
4 <ns1:empID>1</ns1:empID>
5 <ns1:empType>IT</ns1:empType>
6 <ns1:empName>Eric</ns1:empName>
7 </ns1:process>
8 </soap:Body>
9 </soap:Envelope>
1 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3 <ns1:process>
4 <ns1:empID>2</ns1:empID>
5 <ns1:empType>IT</ns1:empType>
6 <ns1:empName>John</ns1:empName>
7 </ns1:process>
8 </soap:Body>
9 </soap:Envelope>
1 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3 <ns1:process>
4 <ns1:empID>3</ns1:empID>
5 <ns1:empType>IT</ns1:empType>
6 <ns1:empName>Theo</ns1:empName>
7 </ns1:process>
8 </soap:Body>
9 </soap:Envelope>
Go to the console > soa_domain > SOA > soa-infra > > and Test it.
If we trigger the process 3 times with the payloads as we describes and in the same sequence, the instances will all complete and write the files to filesystem in the same sequence.

We used the ‘Standard’ mode and selected empID for sequence-value and emptType for group-value, and the sequence should start with 1 and will increment by 1.
Now switch the last 2 messages in the sequence and see what happens. Since we’re trying to process and already processed message again we will get the next errormessage
1 The selected operation execute could not be invoked.
2 An exception occured while invoking the webservice operation. Please see logs for more details.
3 oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: oracle.tip.mediator.infra.exception.MediatorException: ORAMED-03003:[Storing Resequencer Group Failed]Unable to store Resequencer Group." oracle.tip.mediator.common.persistence.MediatorResequencerMessage, mediator InstanceId=E07531315F8511DFBFBF3B164F19FDA3, componentDn=default/MyReSequence!1.0/Mediator1, operation=execute, groupId=IT, sequenceId=1, status=0"Possible Fix:Unable to store Resequencer Group. Check your Database connection or check data
So change all empType to ‘HR’ instead of ‘IT’.
For example
1 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3 <ns1:process>
4 <ns1:empID>1</ns1:empID>
5 <ns1:empType>HR</ns1:empType>
6 <ns1:empName>Eric</ns1:empName>
7 </ns1:process>
8 </soap:Body>
9 </soap:Envelope>
The sequence we’re now going to use is empID=1, empID=3, empID=2
After sending the second message (empID=3), you will notice the instance won’t complete. Because the resequencer expects an empID=2. In this case it will wait till this message arrives.
1 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
3 <ns1:process>
4 <ns1:empID>2</ns1:empID>
5 <ns1:empType>HR</ns1:empType>
6 <ns1:empName>Eric</ns1:empName>
7 </ns1:process>
8 </soap:Body>
9 </soap:Envelope>


Now use the last test message (empID=2) and see what happens.

Instance 30030 changes from Running to Completed. This is because it received the next message in the sequence (empID=2), and after that the instance 30030 (empID=3) could continue.
If we check the files on filesystem we also see (compair the datetime of the files) that the files are stored in the correct sequence.

 


Other Resequencers

Besides the ‘Standard’ resequencer wel also have the ‘FIFO’- and the ‘BestEffort’ resequencer.
See this document to decide what resequencer suits best for your case.

Oracle SOA Suite 11g and the new Partitions feature

In the old school Oracle SOA Suite we had the functionality to create different domains in the BPEL Console to group our applications.
This functionality was gone in the 11g SOA Suite, and because it still was a wanted feature, Oracle reintroduced it as feature in the new Oracle SOA 11g Patchset2.
Now it’s called ‘Partitions’.
So let’s see how to manage them.
Go to the Enterprise Manager (http://localhost:7001/em), Farm_ > SOA > soa-infra (soa_server1).
Right mouseclick on soa-infra > Manage Partitions. Create the new partition. (SOA Partition 별, Composite count 알 수 있음)


The new partition should be added to the list (beneath the default partition).
JDeveloper
In JDeveloper we will create a simple SOA Composit application.
Deploy the new application and now in the wizard of the deployment when we select a server it gives us a new selectbox to select the newly created partition. By default it will use the ‘default’ partition.

Deploy the application and let’s go back to the console.
Now we will see the new deployed application in the list of the ‘test_partition’ partition.

 

Using ant

ant-sca-mgmt.xml createPartition – Creates a partition in the SOA Infrastructure.
Location of the file :
1 <ORACL_MIDDLEWARE_HOME>/bin
ant -f ant-sca-mgmt.xml createPartition -Dhost=localhost -Dport=8001 -Duser=weblogic -Dpassword=weblogic -Dpartition=my_ant_partition
01 Buildfile: ant-sca-mgmt.xml
02 [echo] oracle.home = E:\oraclehome\11g\middleware\Oracle_SOA1\bin/..
03
04 createPartition:
05 [input] skipping input as property host has already been set.
06 [input] skipping input as property port has already been set.
07 [input] skipping input as property user has already been set.
08 [secure-input] skipping secure-input as property password has already been set.
09 [input] skipping input as property partition has already been set.
10 [echo] oracle.home = E:\oraclehome\11g\middleware\Oracle_SOA1\bin/..
11
12 folderMgrTask:
13 [java] calling FolderManager.initConnection(), m_host=localhost, m_port=8001, m_user=weblogic
15 [java] connection initiated
16 [java] folderMBean=oracle.soa.config:name=soa-infra,j2eeType=FolderLifecycleConfig,Application=soa-infra
17 [java] Partition (my_ant_partition) is successfully created.
18
19 BUILD SUCCESSFUL
And the partitions list in the console


Weblogic

  1. Managed Servers are on Admin state instead of Running state

During start up managed servers from admin console result in Admin State instead of Running State (see the screenshot below). This issue comes up usually when Weblogic is unable to connect to infrastructure database. Usually this is happening when the infrastructure database's listener is not down after reboot or server configuration change. In Windows make sure oracle services are up and the database EM console is accessible



XSD


Introduction
Those who deal with data transfer or document exchange within or across organizations with heterogeneous platforms will certainly accept and appreciate the need and power of XML. I am not going to delve into the merits of XML. I will, however, address a simple but powerful schema concept called XSD or XML Schema Definition.
  • What is XSD Schema?
  • What are the advantages of XSD Schema?
  • What is important in XSD Schema?
What Is a Schema?
A schema is a "Structure", and the actual document or data that is represented through the schema is called "Document Instance". Those who are familiar with relational databases can map a schema to a Table Structure and a Document Instance to a record in a Table. And those who are familiar with object-oriented technology can map a schema to a Class Definition and map a Document Instance to an Object Instance.
A structure of an XML document can be defined as follows:
  • Document Type Definition (DTDs)
  • XML Schema Definition (XSD)
  • XML Data Reduced (XDR) -proprietary to Microsoft Technology
We are specifically going to work with XML Schema Definitions (XSD).
What Is XSD?
XSD provides the syntax and defines a way in which elements and attributes can be represented in a XML document. It also advocates that the given XML document should be of a specific format and specific data type.
XSD is fully recommended by W3C consortium as a standard for defining an XML Document. To know more about latest information on XSD, please refer the W3C site (www.w3.org).
Advantages of XSD
So what is the benefit of this XSD Schema?
  • XSD Schema is an XML document so there is no real need to learn any new syntax, unlike DTDs.
  • XSD Schema supports Inheritance, where one schema can inherit from another schema. This is a great feature because it provides the opportunity for re-usability.
  • XSD schema provides the ability to define own data type from the existing data type.
  • XSD schema provides the ability to specify data types for both elements and attributes.
Case Study
ABC Corp. a fictitious software consultancy firm, which employs around 25 people, has been requested by its payroll company to submit employee information, which includes the Full Time and Part Time consultants, electronically in an XML format to expedite payroll processing.
The Payroll Company told ABC Corp. the following information will be needed for the Full Time and Part Time Employees.

Employee Information

SSN
Name
DateOfBirth
EmployeeType
Salary
Here is the actual XML document for the above information.

<?xml version="1.0" ?>
- <Employees xmlns="http://www.abccorp.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.abccorp.com/employee.xsd">
- <Employee>
<SSN>737333333</SSN>
<Name>ED HARRIS</Name>
<DateOfBirth>1960-01-01</DateOfBirth>
<EmployeeType>FULLTIME</EmployeeType>
<Salary>4000</Salary>
</Employee>
</Employees>

Here is the XML Schema for the above Employee Information

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:string>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:long"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Let's examine each line to understand the XSD Schema.
Schema Declaration
For an XSD Schema, the root element is <schema>. The XSD namespace declaration is provided with the <schema > to tell the XML parser that it is an XSD Schema.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

The namespace that references an XSD Schema is the W3C recommended version of XSD. The "xsd:" prefix is used to make sure we are dealing with XSD Schema, but any prefix can be given.
Element Declaration
"Element" is the important part of the schema because it specifies the kind of information. The following element declaration in our example is going to deal with Employee information.

<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">

An "element" declaration in XSD should have the following attributes.
name: This attribute specifies the name of an element. "Employee" in our example.
type: This attribute refers to Simple Type or Complex Type, which will be explained very soon in this article.
minoccurs: This attribute will specify how many elements at a Minimum will be allowed. The default is '0", which means it is an optional element.
Assume that minoccurs attribute carries a value of "1". This would mean the "Employee" element should be specified at least once in the XML document.
maxoccurs: This attribute will specify how many elements at a Maximum will be allowed in an XML document. Assume that maxoccurs attribute carries a value of "2". This would mean the "Employee" element should NOT be specified more than twice.
To summarize, let's say the minoccurs is "1" and maxoccurs is "2" for the "Employee" element. This means there should be atleast one instance of the "Employee" element in the XML document, but the total number of instances of "Employee" element shouldn't exceed two.
If you tried passing three instances of "Employee" element in the XML document, the XML parser will throw an error.
To allow the "Employee" element to be specified an unlimited number of times in an XML document, specify the "unbounded" value in the maxoccurs attribute.
The following example states that the "Employee" element can occur an unlimited number of times in an XML document.

<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">

Complex Type
An XSD Schema element can be of the following types:
  • Simple Type
  • Complex Type
In an XSD Schema, if an element contains one or more child elements or if an element contains attributes, then the element type should be "Complex Type"

<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:string>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>

The Employee element has SSN, Name, Date of Birth, Salary and Employee type, which are specified as child elements. As a result Employee Element must be defined as a Complex Type because there are one or more elements under Employee element.
xsd:sequence
The <xsd:sequence> specifies the order in which the elements need to appear in the XML document. This means the elements SSN, Name, DateOfBirth, EmployeeType and Salary should appear in the same order in the XML document. If the order is changed, then the XML parser will throw an error.
Simple Type
In an XSD Schema an element should be referred to as a Simple Type when you create a User Defined type from the given base data type.
Before going further into Simple Types, I would like to mention that XSD provides a wide variety of base data types that can be used in a schema. A complete description of the data types is beyond the scope of this article.
I would suggest reading at the following Web sites to learn more about data types.
  • http://www.w3.org
  • http://msdn.microsoft.com search for XSDs.
Some of the base data types, which we used in the "Employee" element examples, are:
  • xsd:string
  • xsd:int
  • xsd:date
Knowing that Simple Type Elements can specify User-defined data types in XML Schema, the real question is how do we know where to use a specific Simple Type?
Let's take a look at the schema again.

<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:string>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>

Assume the Payroll processing company wants the social security number of the employees formatted as "123-11-1233".
For this we will create a new data type called "ssnumber".
The following is the code to accomplish the above requirement.

<xsd:simpleType name="ssnumber">
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>

To start with, we should provide the name of the Simple Type, which is "ssnumber".
The restriction base specifies what is the base data type in which we derive the User Defined Data type, which is the "string" data type in the above example.
To restrict the social security number to 11 characters, we require the length value to be "11".
To ensure the social security number appears in the "123-11-1233" format, the pattern is specified in the following format.

<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>

To explain the pattern,
\d{3} specifies that there should be three characters in the start. Followed by two characters after the first "-" and finally followed by four characters after the second "-".
Incorporating Simple Types into Schema
Now that we know what Simple Type means, let us learn how to effectively incorporate Simple Type into an XSD Schema.
First of all, Simple Types can be global or local.
Let's first look at global usage of Simple Type Element "ssnumber".

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN= type ="xsd:ssnumber>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>


<xsd:simpleType name="ssnumber">
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>


</xsd:schema>

In the above example, the child element name "SSN" of parent element "Employee" is defined as user defined data type "ssnumber".
The Simple Type element "ssnumber" is declared outside the Employee element, which means if we have to define another element, say for ex. "Employer" inside the <xsd:schema>, then the "Employer" element can still make use of the "ssnumber" data type if it's needed.
Let's examine a different case where the Simple Type element "ssnumber" will be specific to Employee, and it is not going to be needed elsewhere at all. Then the following schema structure accomplishes this.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:string>


<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>


<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:string"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

In the above example, all restrictions such as max length, pattern and base data type are declared inline, and it immediately follows the SSN element.
Understanding Schema Flexibility
So far we have seen how to create a schema by:
a. Declaring and Using Complex Element Type
b. Declaring and Using Simple Element Type
c. Understanding Global scope and Local scope of a given element
I will now explain the flexibility XSD Schema can provide by extending our schema example.
Let's validate further by adding a "FullTime" or "PartTime" Employee Type element.
To provide the validation, we should create a Simple Element Type called "emptype".

<xsd:simpleType name="emptype">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="fulltime"/>
<xsd:enumeration value="parttime"/>
</xsd:restriction>
</xsd:simpleType>

The above schema will successfully create a Simple Type element with base type as "string" data type. The enumeration values are specified in enumeration attributes, which will basically restrict within two values. The enumeration attributes in an XSD Schema provides the ability to define an element in such a way that it should fall between the values given in the enumeration list.
Let us incorporate emptype Simple Type element in our main Employee schema.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:ssnumber>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>


<xsd:element name="EmployeeType" type="xsd:emptype"/>


<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="ssnumber">
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>


<xsd:simpleType name="emptype">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="fulltime"/>
<xsd:enumeration value="parttime"/>
</xsd:restriction>
</xsd:simpleType>


</xsd:schema>

In the above example, the child element name "EmployeeType" of parent element "Employee" is defined as user defined data type "emptype".
The Simple Type element "emptype" is declared outside the Employee element which is global to elements that fall under <xsd:schema>
So we have defined two simple element types: one is emptype, which basically restricts the value within two enumerated values "fulltime" or "parttime". And another is "ssnumber" which restricts the length of the value to 11 and it should be of "111-11-1111" pattern.
I highlighted the words "enumerated" "length" and "pattern" to emphasize that those words are referred to as Facets.
In XSD Schema, facets provide the flexibility to add restriction for a given base data type. In our examples above, the base data type specified is "string".
Similarly, facets are available for other data types like "int". A few facets available for "int" data type are Enumerated, Minexclusive, Mininclusive, and Pattern.
Let's consider a new requirement. The payroll company wants to process tax information, so they want the employee information which is listed above plus the employee's state and zip code information. All the information should be under the separate header "EmployeeTax".
The above requirement compels us to restructure the schema.
First we will break down the requirement to make it simple.
a. Payroll Company wants all the information listed under "Employee" element.
b. Payroll Company wants state and zip of the given Employee.
c. Payroll company wants (a) and (b) in a separate header "EmployeeTax"
Fortunately XSD Schema supports object-oriented principles like Inheritance hierarchy. This principle comes handy in our requirement.
The following structure can quite easily accomplish the above requirement.

<xsd:complexType name="EmployeeTax"
minOccurs="0"
maxOccurs="unbounded">


<xsd:complexContent>
<xsd:extension base="xsd:Employee">


<xsd:sequence>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zipcode" type="xsd:string"/>
</xsd:sequence>


</xsd:extension>
</xsd:complexContent>


</xsd:complexType>
</xsd:schema>

In the above code, we started with the name of the Complex Type, which is "EmployeeTax".
The following line is very important. It tells the XML Parser that some portion of EmployeeTax content is getting derived from another Complex Type.

<xsd:complexContent>

To refresh our memory, in simple element type definitions, we used restriction base, which mapped to base data types. In the same way, we need to specify the restriction base for the complex content. The restriction base for complex content should logically be another Complex Type. In our example it is "Employee".

<xsd:extension base="xsd:Employee">

Once the extension base has been defined, all the elements of the "Employee" element will automatically inherit to EmployeeTax Element.
As part of the business requirement, the state and zip code elements are specified which completes the total structure for EmployeeTax Element.
Referencing External Schema
This feature is very useful in situations where one schema has functionality that another schema wants to utilize.
Take a case where the payroll company for ABC Corp. needs some information about the Employers, such as EmployerID and PrimaryContact in a separate XML document.
Assume EmployerID format is the same as Employee SSN format. Since we have already defined the validation for Employee SSN, there exists a valid case for using the Employee schema.
The first step in using different schema is to "include" the schema.
To include the schema, make sure the target namespace is the same as your current working location.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.abccorp.com">
<xsd:include schemaLocation="employee.xsd"/>


<xsd:element name="Employer"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>


<xsd:element ref ="ssnumber"/>


<xsd:element name="PrimaryContact"
type="xsd:string"/>


</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Please note the include statement, which references the schema location. Make sure the employee.xsd file exists in the same target namespace location.
Once included, the "Employer" element references the ssnumber global element in the same manner as it had been declared within the document itself. Then an additional primary contact element, which is specific to "Employer" element, is defined after the ssnumber element reference.
Annotations
Comments have always been considered a good coding convention. XSD Schema provides a commenting feature through the <Annotation> element.
The <Annotation> element has 2 child elements.
  • <documentation>
  • <appInfo>
<documentation> element provides help on the source code in terms of its purpose and functionality.
<appinfo> element provides help to the end users about the application.
The following schema describes the usage of the Annotation element.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Employee"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SSN="xsd:ssnumber>


<xsd:annotation>
<xsd:documentation>
The SSN number identifies each employee of ABC CORP
</xsd:documentation>
<xsd:appInfo>
Employee Payroll Info
</xsd:appInfo>
</xsd:annotation>


<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="DateOfBirth" type="xsd:date"/>
<xsd:element name="EmployeeType" type="xsd:emptype"/>
<xsd:element name="Salary" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="ssnumber">
<xsd:restriction base="xsd:string">
<xsd:length value="11">
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="emptype">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="fulltime"/>
<xsd:enumeration value="parttime"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

Conclusion
I tried to cover a few interesting features of XSD Schema. But there is a whole lot of information about XSD schema in

※ 참고사이트 : http://anatech-oracle.blogspot.kr/

Posted by 아도니우스