2014. 9. 18. 21:43
1. Exponentiation

All that math can be done on a calculator, so why use Python? Because you can combine math with other data types (e.g. booleans) and commands to create useful programs. Calculators just stick to numbers.

Now let's work with exponents.

eight = 2 ** 3

In the above example, we create a new variable called eight and set it to 8, or the result of 2 to the power to 3 (2^3).

Notice that we use ** instead of * or the multiplication operator.

 

2. Bringing It All Together

Nice work! So far, you've learned about:

  • Variables, which store values for later use
  • Data types, such as numbers and booleans
  • Whitespace, which separates statements
  • Comments, which make your code easier to read
  • Arithmetic operations, including +, -, *, /, **, and %
Instructions

Let's put our knowledge to work.

  1. Write a single-line comment on line 1. It can be anything! (Make sure it starts with #)
  2. Set the variable monty equal to True.
  3. Set another variable python equal to 1.234.
  4. Set a third variable monty_python equal to python squared.
?
Stuck? Get a hint! Hint

You can use arithmetic operators directly on variables! Remember, python squared means python ** 2.

Note that the name of the variable monty_python has nothing to do with the name of the variables monty and python. We just decided to use these variable names because Python people love Monty Python's Flying Circus

'Python' 카테고리의 다른 글

Pythons #3 예외처리  (0) 2014.10.10
Posted by 아도니우스
2014. 9. 18. 15:43

1. 사전확인

   chage -l 계정

 

2. 계정 적용 및 확인

   chage -M90 계정

 

3. [root@localhost ~]# chage -d 2015/11/10 계정 => 날짜부터 패스워드 변경 연장


4. 사용자 계정이 passwd 변경후 다시 변경하려고 할때 변경이 안되는 이슈.

ex)test1 계정이 패스워드 기간이 만료되서 패스워드 변경후 다시 패스워드 변경 시도시 변경이 안됨.

원인 : /etc/login.defs 파일에서 PASS_MIN_DAYS 값에 의해 변경이 안됨.

[test2@localhost ~]$ passwd

Changing password for user test2.

Changing password for test2

(current) UNIX password:

You must wait longer to change your password

passwd: Authentication token manipulation error

 

#vi /etc/login.defs

 

# Password aging controls:

#

# PASS_MAX_DAYS Maximum number of days a password may be used.

# PASS_MIN_DAYS Minimum number of days allowed between password changes.

# PASS_MIN_LEN Minimum acceptable password length.

# PASS_WARN_AGE Number of days warning given before a password expires.

#

PASS_MAX_DAYS 90 => 패스워드를 변경하지 않고 동일한 패스워드를 지속적으로 사용할수 있는 최대일자.

PASS_MIN_DAYS 1 => 패스워드 변경없이 사용할수 있는 최소일자.

PASS_MIN_LEN 5 => 패스워드 최소 길이 지정

PASS_WARN_AGE 7 => 패스워드 사용일자가 종료되기 전 경고메시지 보내는 기간.

 

해결 :

[root@localhost ~]# chage -l test2

Last password change : Apr 14, 2014

Password expires : Jul 13, 2014

Password inactive : never

Account expires : never

Minimum number of days between password change : 1

Maximum number of days between password change : 90

Number of days of warning before password expires : 7

 

[root@localhost ~]# chage -m 0 test2 => PASS_MIN_DAYS 0으로 변경

 

[root@localhost ~]# chage -l test2

Last password change : Apr 14, 2014

Password expires : Jul 13, 2014

Password inactive : never

Account expires : never

Minimum number of days between password change : 0

Maximum number of days between password change : 90

Number of days of warning before password expires : 7

'Linux' 카테고리의 다른 글

ext 특징(extended file system)  (0) 2014.09.26
find 명령어  (0) 2014.09.24
SED  (0) 2014.09.16
vncserver  (0) 2014.09.11
SCSI, RAID  (0) 2014.08.30
Posted by 아도니우스
2014. 9. 17. 11:08

PL/SQL은 프로그램을 논리적인 블록으로 나누는 구조화 된 블록 언어 이다.

PL/SQL 블록은 선언부(선택적), 실행부(필수적), 예외 처리부(선택적)로 구성되어 있고, BEGINEND 키워드는 반드시 기술해 주어야 한다.

PL/SQL 블록에서 사용하는 변수는 블록에 대해 논리적으로 선언할 수 있고 사용할 수 있다.

    • DECLARE
    • - Optional
    • - Variables, cursors, user-defined exceptions
  • BEGIN
    • - Mandatory
    • - SQL Statements
    • - PL/SQL Statements
  • EXCEPTION
    • - Actions to perform when errors occur
  • END
    • - Mandatory

    프로시저(Procedure)란?

    특정 작업을 수행하는, 이름이 있는 PL/SQL BLOCK 이다.

    매개 변수를 받을 수 있고, 반복적으로 사용할 수 있는 BLOCK이다. 

    프로시저 문법

     CREATE OR REPLACE procedure name

       IN argument

       OUT argument

       IN OUT argument

    IS

      [변수의 선언]

    END;

    프로시저 작성 예제 

     SQL> CREATE OR REPLACE PROCEDURE update_sal

             /* IN Parameter */

            (v_empno IN NUMBER)

            IS

            BEGIN

                UPDATE emp

                SET sal = sal * 1.1

                WHERE empno = v_empno;

                COMMIT;

           END update_sal;

           /

    프로시저 실행 예제

     SQL> EXECUTE update_sal(7369);

     PL/SQL 처리가 정상적으로 완료되었습니다.


    PL/SQL 참고사이트 : http://jhbench.tistory.com/294 

    'Database' 카테고리의 다른 글

    AWR Report  (0) 2014.09.29
    Control file  (0) 2014.09.19
    Oracle Function(산술, 문자열, 날짜, 날짜 포맷)  (0) 2014.09.13
    GRANT, REVOKE  (0) 2014.09.11
    Partition 조회  (0) 2014.09.11
    Posted by 아도니우스
    2014. 9. 17. 09:29

    Oracle SOA 11g - Configure transaction timeout for BPEL.

    1. Setting the SyncMaxWaitTime :

    2. Setting the global transaction timeout at Weblogic Domain Level:

    3. Overriding the transaction timeout setting for BPEL EJB's

       1) Log into Oracle Weblogic Administration Console

       2) Click Deployments

       3) Expand soa-infra -> EJBs

       4) Click on the configuration tab for the timeout setting for each of EJB;s listed below and the change the time out values as required

       5) Click Save

       6) Restart Oracle Weblogic Server

     

    ※ 참고사이트 :  http://www.albinsblog.com/2011/11/oracle-soa-11g-configure-transaction_20.html

     

    Posted by 아도니우스
    2014. 9. 16. 21:29

    WAS_Status () {

    for DIR in ${Service_Name}; do

    Check=`sh /app/domains/${DIR}/bin/healthcheck.sh`

    DATA=`echo "$Check" | grep -c Started`

    if [ ${DATA} -eq 1 ]; then

    printf "${HOSTNAME}_${DIR}_Instance_Status : OK\n"

    else

    printf "${HOSTNAME}_${DIR}_Instance_Status : False\n"

    fi

    done

     

    DBconnect_Status () {

    for DIR in ${Service_Name}; do

    Check=`sh /app/domains/${DIR}/bin/healthcheck.sh`

    DATA=`echo "$Check" | grep -c false`

    if [ ${DATA} -eq - 0 ]; then

    printf "${HOSTNAME}_${DIR}_DB_Connection_Status : OK\n"

    else

    printf "${HOSTNAME}_${DIR}_DB_Connection_Status : False\n"

    fi

    done

    }

     

    sed -n '1, 3p' filename

    sed 's/찾는문자열/바꿀문자열/g/' filename,

    sed 's/[A-Z].//g' filename

        i) sed 명령으로 사과 단어를 모두 제거하는 방법 : sed -e '/s/사과//g' filename

       ii) 원본 파일 바로 변경 : sed -i -e 's/사과//g' filename

     

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

    #!/bin/bash

     

    SystemInfo_Network () {

    Hostname = `uname -n | awk '{print $1}'`

    CPU_Use = `top -n -1 | grep Cpu | awk '{print $2}' | sed 's/,//g' | sed 's/us//g'

    Mem_Total = `top -n -1 | grep Mem | sed 's/,/\n/g' | grep total | awk '{print $3|'

     

    printf "1) Hostname : ${Hostname}\n"

    echo "2) CPU_Info : ${CPU_Use}"

    }

     

    SystemInfo_Network

    'Linux' 카테고리의 다른 글

    find 명령어  (0) 2014.09.24
    리눅스 패스워드 기한 변경  (0) 2014.09.18
    vncserver  (0) 2014.09.11
    SCSI, RAID  (0) 2014.08.30
    netstat  (0) 2014.08.29
    Posted by 아도니우스
    2014. 9. 16. 17:58

     1. SOA WSDL Caching

     1. oracle.as.soainfra.config->Server:aiaSvr#1->SoaInfraConfig->soa-infra->Operations->validate

    2. oracle.as.soainfra.config->Server:aiaSvr#1->SoaInfraConfig->soa-infra->Attributes->UddiCacheLifetime

       -> There is Attribute "UddiCacheLifetime" defining the external WSDL cache time. By default, the value is set to 24hours and the minimum time of 300s could be set.

     

    참고사이트 : http://www.albinsblog.com/2012/09/configuring-caching-of-wsdl-urls.html

     

     

     2. MDS Cache

     1. System MBean Brower -> Application Defined MBeans -> oracle.mds.lcm -> Server: soa_server1(whatever names u gave while installation of SOA) -> Application: soa-infra -> MDSAppRuntime -> Operations tab -> clearCache

     

    참고사이트 : https://community.oracle.com/thread/1010030?tstart=0

    Posted by 아도니우스
    2014. 9. 16. 08:32

    From a first glimpse myself I have the following impressions:

    • The book gives a very good overview of the various topics of Performance Tuning
    • A lot of recommendations are very valuable and show that the authors have real project experience
    • My feeling is though that it concentrates a little bit too much on the low level infrastructure (like JVM tuning) and its config settings instead of explaining the why and what to tweak. Example: reducing audit level may help – but can also impact monitoring capabilities during production.
    • Even though it touches database tuning, the book underestimates the need of database performance monitoring, database tuning, of regular purging and of tuning to prevent data growth. This often is a major area which leads to performance problems if not addressed in an early stage. For example no word about using Secure File LOBs for reducing HW contention in the DB….
    • Architectural decisions are not mentioned– like splitting up one SOA domain into multiple ones for various reasons.
    • SOA monitoring chapter promotes and focuses Hyperic as a product and misses out Oracle Grid Control and other available solutions.
    • Design-level tuning covers only BPEL. Often one key area of performance tuning is to choose the right SOA component for a requirement. For example to use OSB
    • A few components are not covered, for example Mediator resequencer, OHS tuning, XREFs and DVMs.

     

    For some recommendations however, you should be careful to follow them without validation. Just one example:

    “The adapter.jms.receive.threads, adapter.aq.dequeue.threads, and InboundThreadCount properties set the number of threads available for processing JMS,
    AQ, and MQ messages. The default value for these is 5, and performance can be improved by using more threads to dequeue messages from these providers.”

    First, the default for “adapter.jms.receive.threads” is 1. Secondly, as an experience from real world complex deployments in large clusters, the right number of consumers should be determined by the expected load and for example the message size (potentially triggering different transaction times). Last but not least, in a cluster, each JMS consumer thread is multiplied by the number of cluster nodes. Therefore you should be very careful to increase JMS Adapter receive threads. I have seen performance tests where we proved that throughput increased dramatically by decreasing the number of JMS receive threads…

    As a summary, the book provides some good add on’s to the standard documentation available in the Oracle Fusion Middleware Performance and Tuning Guide.
    Get a copy, check them out and tune your SOA 11g environment!

     

    참고사이트 : http://stefankoser.blogspot.kr/2013/09/new-book-about-soa-11g-performance.html

    참고사이트 : https://www.packtpub.com/books/content/performance-tuning-%E2%80%93-systems-running-bpel-processes

     

    Part 1 - Principles of Performance Tuning

    Part 2 - Diagnosing and tuning performance problems in the java Virtual Machine

    Part 3 - Tuning and Scaling WebLogic

    Part 4 - Oracle Service Bus Performance

    Part 5 - Oracle BPEL Performance Best Practices

    Part 6 - Monitoring SOA Suite with Oracle Enterprise Manager

    Posted by 아도니우스
    2014. 9. 16. 07:45

    Up to release 11.1.1.5 there have been 4 thread pools in Oracle SOA Suite 11g to control parallelism of execution:

    1. Invoke Thread Pool ( for asynchronous invocations)

    2. Engine Thread Pool ( for callback execution)

    3. System Thread Pool

    4. Audit Thread Pool

    'SOA' 카테고리의 다른 글

    SOA WSDL Caching in SOA Server && MDS Cache referesh  (0) 2014.09.16
    SOA 11g Performance Tuning  (0) 2014.09.16
    SOA Infrastructure  (0) 2014.09.11
    COMPOSITE_INSTANCE  (0) 2014.09.03
    EAI관점에서 본 SOA  (0) 2014.09.01
    Posted by 아도니우스
    2014. 9. 14. 12:12

    1. 코드카데미 주소 : http://www.codecademy.com/

    2. what is SOA : http://www.middlewareschools.com/

     

    ※ 참고사이트 : http://www.bloter.net/archives/176582, http://www.bloter.net/archives/197960

    'Study' 카테고리의 다른 글

    Concurrent GC  (0) 2014.10.10
    -XX:SurvivorRatio=<value>  (0) 2014.10.08
    MOOC 강의  (0) 2014.09.09
    GC Options2  (0) 2014.08.14
    GC Option  (0) 2014.08.14
    Posted by 아도니우스
    2014. 9. 13. 12:00

    * 산술함수
    abs(n) : n의 절대값
    ceil(n) : n보다 크거나 같은 최소정수
    cos(n) : n의 cosine 값
    cosh(n) : n의 hyperbolic cosine 값
    exp : e의 n지수승
    floor(n) : n보다 작거나 같은 최대정수
    mod(m,n) : m을 n으로 나눈 나머지
    power(m,n) : m의 n지수승
    sign(n) : n<0이면 -1 / n=0이면 0 / n>0이면 1
    sin(n) : n의 sine값
    sqrt(n) : n의 루트근 / n<0이면 null
    tan(n) : n의 tangent
    greatest(a,b,c..) : 그중 가장 큰 값
    least(a,b,c...) : 그중 가장 작은 값
    round(n,2) : n을 소숫점 2자리에서 사사오입한 값
    to_number : 숫자를 포함하는 char값을 number로 변환
    trunc : 소숫점이하 ~ 자리에서 잘사한 값

     

    * 문자열함수
    decode(GRADE, 'A', 4, 'B', 3, 0) : GRADE필드값이 'A'이면 4, 'B'이면 3, 아니면 0
    initcap : 단어의 첫문자를 대문자로
    instr(LOC, '') : LOC에서 처음으로 나타나는 공백의 위치를 리턴
    length : 길이를 리턴
    lower : 소문자로 변환
    upper : 소문자를 대문자로 변환
    substr(GRADE, 1, 2) : GRADE필드값의 처음 2문자 리턴
    dump : oracle 내부 저장형식
    user : 현재 oracle 에 접속한 사용자명
    replace(char1, str1, str2) : char1에서 str1을 str2로 변환

     

    * 날짜포맷
    YYYY또는 SYYY : 년의표시. S를 지정하면 기원전에 -붙는다
    YYY, YY, Y : 년의 아래 3자리, 2자리, 1자리
    SYEAR or YEAR : 년을 절차로 표시. S를 지정하면 기원전에 -
    Q : 년의 1/4
    MM : 월
    MONTH or MON : 월의 명칭 또는 3문자의 단축형
    DDD, DD, D : 년,월,주의 몇번째 날인가 표시
    DAY, DY : 요일 또는 3문자의 단축형
    AM, PM : 오전(AM)과 오후(PM)의 표시
    HH 또는 HH12 : 시각(1~12)
    HH24 : 시각(0~23)
    MI : 분
    SS : 초

     

    * 날짜함수
    add_months(D, N) : 날짜 D에 N개월을 가산한다
    greatest(D1, D2) : D1과 D2에서 늦은쪽의 날짜
    least(D1, D2) : D1과 D2에서 빠른쪽의 날짜
    last_day(HIREDATE) : HIREDATE가 포함되어 있는 월의 마지막 일
    month_between(A, B) : B부터 A까지의 월 수
    next_day(hdate, 'FRIDAY') : hdate후의 첫 금요일
    round(hdate) : hdate를 일을 단위로 하여 사사오입
    to_char(FDATE, 'YYYY-MM-DD') : FDATE날짜의 값을 우측 포맷형식으로 문자열변환
    to_date(FDATE, 'YYYY-MM-DD') : 우측 포맷형식으로 된 문자열을 날짜타입으로 변환

     

    * 존재를 테스트하는 서브쿼리 : EXISTS

    - 서브쿼리가 적어도 1행이상 리턴시 참. 아니면 거짓

     

    * 합집합, 교집합, 차집합

    UNION : 합집함. 동일한 행 리턴시 한건으로 표시

    UNION ALL : 중복된 값도 모두 표시

    INTERSECT : 교집합. 양쪽 쿼리 모두에서 리턴된 행 표시

    MINUS : 차집합. 앞의 쿼리에서는 리턴되지만 뒤의 쿼리에서는 리턴되지 않는 행을 리턴

    ※ 참고사이트 : http://ggari.tistory.com/29

    'Database' 카테고리의 다른 글

    Control file  (0) 2014.09.19
    Oracle SQL 블록 구조  (0) 2014.09.17
    GRANT, REVOKE  (0) 2014.09.11
    Partition 조회  (0) 2014.09.11
    Database Listener, Instance  (0) 2014.08.29
    Posted by 아도니우스