Margin(마진) : 테두리를 기준으로 바깥부분에 차지하는 영역 Padding(패딩): 테두리를 기준으로 안쪽에 차지하는 영역
Margin과 Padding은 보통 테이블을 작성할 때, View 객체들이 테이블 표테두리에 바짝 붙지 않고, 약간의 공백을 두기 위한 것으로, layout 을 정의할 때 layout_marginTop, layout_marginBottom등 특정면에만 공백을 줄 수 있고, layout_margin, layout_padding 으로 전체4면을 한꺼번에 줄 수도 있다.
안드로이드의 margin의 최소(기본)값은 8dp이며, 구글은 8의 배수(16, 24, ..)로 주는 것을 권고한다.
6. gravity : 자식뷰의 중력을 결정(Layout 에서 설정).. 중력이란 화면의 어느쪽에 정렬할 것인가? start, end, top, bottom, center, centerHorizontal, CenterVertical 등, |(파이프란인) 으로 여러 속성을 동시 설정가능
layout_gravity : 자식 뷰 각각의 중력을 결정... 자식 뷰(View에서 설정)에서 정의한다.
7. VIEW
View 객체들 배치 방법
8. 특정 View 간의 위치 배치 - 특정 뷰를 같이 배치하고자 할때, res/layout/activity_main.xml(해당 레이아웃 XML파일)의 뷰(EditView, Button, ImageView 등)에 아래와 같이 속성을 정의 한다.
9. ConstraintLayout : 마지막에 나온 Layout으로, 제한(규칙)을 붙일 수 있는 레이아웃이다. 아래에 보면, 뷰들간에 속성을 정의할 수 있도록 되어 있다. 또한 이미지뷰를 상단에 꽉 채우려면, 여백을 0으로 설정하고, layout_width에 match_constraints 속성을 준다. match_constraints 속성은 LinearLayout의 가중치(weight) 속성과 비슷. layout_width를 0dp로 주고, 좌우를 꽉 채울 때 사용.
--app:layout_constraintStart_toStartOf="[parent|다른뷰의 id]" : 현재 뷰의 왼쪽과 부모나 다른뷰의 왼쪽을 붙임
--app:layout_constraintEnd_toEndOf="[parent|다른뷰의 id]" : 현재 뷰의 오른쪽과 부모나 다른뷰의 오른쪽을 붙임
--app:layout_constraintTop_toTopOf="[parent|다른뷰의 id]" : 현재 뷰의 위쪽과 부모나 다른뷰의 위쪽을 붙임
android:lines="1" -- 줄 수 지정
android:ellipsize="end" -- 줄수 지정에 따라, 글을 다 표현하지 못할 때, "아름다운 강산에 ..." 처럼 "..."로 표현함.
android:maxLines : 최대 표시줄 수 지정
android:minLines : 최소 표시줄 수 지정
android:textColor="#FF0000"
android:textStyle="bold|italic"
2. EditView 속성
android:hint="빈칸일 경우 표시할 문구"
android:inputType="textPassword" -- 입력 속성(textPassword, phone, textWebEmailAddress, number, numberPassword, time, date, datetime, numberDecimal, numberSigned
android:textAllCaps="true" -- 대문자 활성화
3. ImageView 속성
android:scaleType="fitXY"
-- 여백에 대해 이미지처리 방식으로, matrix(자바코드로 setMatrix()메소드에서 객체를 지정하여 회전, 확대/축소를 런타임에 할 수있음
-- fitXY : 가로세로에 이미지를 꽉 채움
-- fitStart : 비율을 유지하며 꽉채우는데, 여백이 있으면 시작 지점으로 정렬한다.
--fitCenter : (기본값) 비유을 유지하고 가운데 정렬
--fitEnd : 비율을 유지하고 여백이 있으면 끝에 정렬
--Center : 뷰보다 이미지가 클 때, 원본 크기를 유지하고 중앙을 위주로 표시한다.
--centerCrop : 뷰에 여백이 생기지 않도록 이미지가 확대/축소되며, 중앙 위주로 표시하고 남은 부분은 잘라낸다.(유용)
--centerInside
4. 기타 View ProgressBar, SearchView, Spinner, CheckBox, RadioButton, RatingBar(별점 표시),
--android:layout_height="0dp"
--android:layout_weight="1" -- height를 반드시 0으로 설정하고, 가중치를 이용하여 View간에 비율로 크기 설정 가능
6. gravity : 자식뷰의 중력을 결정(Layout 에서 설정).. 중력이란 화면의 어느쪽에 정렬할 것인가? start, end, top, bottom, center, centerHorizontal, CenterVertical 등, |(파이프란인) 으로 여러 속성을 동시 설정가능
layout_gravity : 자식 뷰 각각의 중력을 결정... 자식 뷰(View에서 설정)에서 정의한다.
모든 문제 해결은 누군가에게 물어보기 보다는, 직접 찾아보고 해결책을 강구하는 것이 좋으며, 문제 해결은 이슈해결과 더불어 향후 재발방지를 위한 조치까지 확인해야 한다. 개발자라 하더라도, DB는 시스템 부분과 DB 아키텍쳐까지 이해해야 성능(튜닝)부터 운영까지 효율적으로 설계할 수 있으니, 틈틈히 보거나 문제 생겼을 때, 운영유지보수팀에 문의하면서 같이 고민해 보길 바란다.
# 오라클 기동 : crsctl start crs - (주의)startup 등 단일 인스턴스와는 명령어가 다름
클러스터 상태 확인 후, 오라클을 기동하고, 클러스터 자원 정보를 확인!!!! 상세한 내용은 아래를 참조하시기 바랍니다.
* 서버 재구동시, 오라클 역시 자동으로 reboot되게 하려며, crsctl disable crs * => rebooting 후 crs가 자동 시작되는 것을 disable crsctl enable crs* => rebooting 후 crs가 자동 시작되는 것을 enable crsctl config crs* => crs 설정 상태 확인
# 클러스터 상태 확인
crsctl check crs
vmgdb01n:/ORACLE> crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
vmgdb01n:/ORACLE> crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 97a1ccd5f7ca4f9ebf9ca9e23420e74a (/dev/raw/raw1) []
2. ONLINE 0ce6ebddc2764f97bfceaff24edc388e (/dev/raw/raw2) []
3. ONLINE ad28933487d24f09bf37169b8c67d786 (/dev/raw/raw3) []
Located 3 voting disk(s).
ocrcheck
vmgdb01n:/ORACLE> ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2884
Available space (kbytes) : 259236
ID : 560703319
Device/File Name : /dev/raw/raw4
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw5
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
crsctl get css disktimeout
crsctl get css misscount
crsctl get css reboottime
vmgdb01n:/ORACLE> crsctl get css disktimeout
CRS-4678: Successful get disktimeout 200 for Cluster Synchronization Services.
vmgdb01n:/ORACLE> crsctl get css misscount
CRS-4678: Successful get misscount 30 for Cluster Synchronization Services.
vmgdb01n:/ORACLE> crsctl get css reboottime
CRS-4678: Successful get reboottime 3 for Cluster Synchronization Services.
### crsctl 명령어 도움말
crsctl -h
Usage: crsctl add - add a resource, type or other entity
crsctl check - check a service, resource or other entity
crsctl config - output autostart configuration
crsctl debug - obtain or modify debug state
crsctl delete - delete a resource, type or other entity
crsctl disable - disable autostart
crsctl discover - discover DHCP server
crsctl enable - enable autostart
crsctl get - get an entity value
crsctl getperm - get entity permissions
crsctl lsmodules - list debug modules
crsctl modify - modify a resource, type or other entity
crsctl query - query service state
crsctl pin - pin the nodes in the node list
crsctl relocate - relocate a resource, server or other entity
crsctl replace - replaces the location of voting files
crsctl release - release a DHCP lease
crsctl request - request a DHCP lease
crsctl setperm - set entity permissions
crsctl set - set an entity value
crsctl start - start a resource, server or other entity
crsctl status - get status of a resource or other entity
crsctl stop - stop a resource, server or other entity
crsctl unpin - unpin the nodes in the node list
crsctl unset - unset an entity value, restoring its default
아래의 쿼리를 실행하면, 쉽게 전체 테이블별 건수 및 용량을 쉽게 체크할 수 있다. (참고로 Block의 사이즈는 8k, 16k 등 테이블 생성시 별도로 정할 수 있어서 확인 필요)
실제 추출되는 정보는 통계정보를 수행한 (Analyze)한 결과이므로, 실제 select count(*) 결과와는 다르다. 통계정보는 analyze한 시점의 정보이기 때문이다. 하지만 전체량을 확인코자 할 때, 약간의 오차 보다는 큰 틀에서 정보를 확인하는 것이 효율적이다.
특히, 주기적으로 삭제하는 테이블의 block을 보면 특이점이 있다. 분명히 많은 정보를 지웠음에도 불구하고, block이 많다. 그리고 full scan을 할 경우 너무 느리다. 그것을 delete의 한계 때문이다. delete를 할지라도 실제 최대로 할당 되었던 block을 반환하고 재구성하지 않기 때문에 차지하는 공간은 여전히 넓다. 필요하다면 테이블 재구성(rebuild 또는 shrink)를 해야 하겠지만, 온라인 상태인 경우 테이블의 lock되는 등 서비스가 일시 정지될 우려가 있으니 충분히 고려하길 바란다.
추가로, 통계정보를 갱신하기 위해 analyze할 경우 반드시 서버에 접속하여 topas로 서버의 상태를 모니터링하고 수행하기 바란다.
테이블명 규칙이 테이블의 명령 규칙이 : T + 업무명(2자리) + 유니크한 이름 EX) TOK_DFSFSDFWER, TQA_DSFSKFSF 등
SELECT TA.*, TB.NUM_ROWS 레코드수
FROM
(
SELECT SUBSTR(SEGMENT_NAME, 2,2) AS UPMU, SEGMENT_NAME, C.COMMENTS, ROUND(SUM(A.BYTES)/8/1024) BLOCK수
FROM DBA_SEGMENTS A, DBA_TABLES B, ALL_TAB_COMMENTS C
WHERE A.SEGMENT_NAME = B.TABLE_NAME
AND A.SEGMENT_TYPE IN ('TABLE','TABLE PARTITION')
AND A.OWNER = '홍길동'
AND A.SEGMENT_NAME LIKE 'T%' -- 테이블의 명령 규칙이 T + 업무명(2자리) + 유니크한 이름 인 경우...
AND A.SEGMENT_NAME = C.TABLE_NAME
AND C.TABLE_TYPE IN ('TABLE','TABLE PARTITION')
GROUP BY SUBSTR(SEGMENT_NAME, 2,2), SEGMENT_NAME, C.COMMENTS
) TA,
DBA_TABLES TB
WHERE
TA.SEGMENT_NAME = TB.TABLE_NAME
ORDER BY 1,2