블로그 이미지
bedbmsguru

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
  • total
  • today
  • yesterday
2018. 6. 19. 11:55 오라클

한글깨짐으로 인해 DB 캐릭터셋을 변경하고 impdb 작업하다가  


ORA-00600 internal error code, arguments:[kokle_lob2lob13:input mismatch] 

ORA-29213 두가지 에러가 발생


아래 두개의 블로그로 해결 가능


http://atin.tistory.com/463


http://www.dba-oracle.com/t_ora_39213_metadata_processing.htm

posted by bedbmsguru
2018. 6. 15. 13:58 오라클

오라클 인덱스 칼럼 정보 조회

select  index_name
    ,index_type
    ,decode(constraint_name, null, ' ', 'pk') primary_key
    ,uniqueness
    ,nvl(max(a),' ') index_pos1
    ,nvl(max(b),' ') index_pos2
    ,nvl(max(c),' ') index_pos3
    ,nvl(max(d),' ') index_pos4
    ,nvl(max(e),' ') index_pos5
    ,nvl(max(f),' ') index_pos6    
    ,nvl(max(g),' ') index_pos7        
    ,nvl(max(h),' ') index_pos8        
    ,nvl(max(i),' ') index_pos9
    ,nvl(max(j),' ') index_pos10
from
(
select  a.index_name
    ,a.index_type
       ,a.uniqueness
       ,c.constraint_name
       ,DECODE(column_position, 1, column_name, '') a
       ,DECODE(column_position, 2, column_name, '') b
       ,DECODE(column_position, 3, column_name, '') c
       ,DECODE(column_position, 4, column_name, '') d
       ,DECODE(column_position, 5, column_name, '') e          
       ,DECODE(column_position, 6, column_name, '') f
       ,DECODE(column_position, 7, column_name, '') g       
       ,DECODE(column_position, 8, column_name, '') h       
       ,DECODE(column_position, 9, column_name, '') i       
       ,DECODE(column_position, 10, column_name, '') j       
from all_indexes a, all_ind_columns b, all_constraints c
where a.table_name = upper('테이블이름')
and a.table_name = b.table_name
and a.index_name = b.index_name
and a.table_name = c.table_name(+)
and a.index_name = c.constraint_name(+)
and c.constraint_type(+) = 'P'
order by index_name, column_position
)
group by index_name, index_type,constraint_name, uniqueness
order by primary_key desc, index_name
;


posted by bedbmsguru
2018. 5. 25. 15:39 Powershell

1. AD  등록된 서버

AD 관리자 계정으로 스크립트 실행


Invoke-Command -ComputerName host1, host2 -ScriptBlock {Invoke-Expression 'C:\script.bat'}



2.AD에 등록되지 않은 서버


(1) 로컬 서버의 "신뢰할 수 있는 호스트 목록" 에 원격 서버 추가하기.
    Set-Item WSMan:\localhost\Client\TrustedHosts -Value "원격서버IP 혹은 호스트네임"


    여러개의 원격 서버를 지정해야할 경우

     Set-Item WSMan:\localhost\Client\TrustedHosts -Value "host1, host2"



(2)원격서버에서 스크립트 실행

$password='p@ssword'|convertto-securestring -asplaintext -force;

$cred=new-object -typename system.management.automation.pscredential('Domain\Username',$password);

$s = New-PSSession -computer "127.0.0.1" -credential $cred;

Invoke-Command -Session $s -ScriptBlock { cmd /c "c:\myfile.bat" };

Remove-PSSession $s;



'Powershell' 카테고리의 다른 글

AD계정 정보 가져오기  (0) 2018.12.26
Powershell 방화벽 관리하기  (0) 2018.10.27
TCP 소켓 통신 예제  (0) 2018.10.27
로컬( local)계정 생성후 Administrator 그룹에 넣기  (0) 2018.10.27
posted by bedbmsguru
2018. 5. 9. 14:07 SQL SERVER


replication 구독 type 확인하는 법


https://ask.sqlservercentral.com/questions/112368/how-to-identitfy-pushpulll-method-of-replication-i.html

posted by bedbmsguru
2018. 4. 11. 16:00 오라클

http://hello-nanam.tistory.com/23



posted by bedbmsguru
2018. 4. 10. 11:34 오라클
call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse      1      0.01       0.03          0          0          0           0
Execute      1      0.00       0.01          0          0          0           0
Fetch         2      0.00       0.00          0          8          0          14
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total      4      0.01       0.04          0          8          0          14




Call : 커서상태에 따라 Parse, Execute, Fetch 세개의 Call로 나누어 각각에 대한 통계정보를 보여줌

Parse:커서를 파싱하고 최적화를수행하는 단계 라이브러리캐시에서 

        실행계획을 찾으면 생략가능 

Execute: SQL 실행 DML은 여기서 종료되고 SELECT 는 Fetch 단계로 넘어감

Fetch: 데이터를 읽어서 사용자에게 전송하는 과정 SELECT 에서만 나타남 

         전송할 데이터가 많을 경우 Fetch Call 이 여러번 발생


Count:     Parse, Execute, Fetch 각 단계가 수행된 횟수


Cpu:        현재  커서가 각 단계에서 사용한 CPU Time


Elapsed:    현재 커서가 각 단계를 수행하는데 소요된 시간 (Cpu time + Wait time)


Disk:        디스크로부터 읽은 블록 수


Query:     Consistent 모드에서 읽은 버퍼 블록 수


current:    Current 모드에서 읽은 버퍼 블록 수


rows        각 단계에서 읽거나 갱신한 처리 건 수



AutoTrace 항목과 비교


db block gets                                =  current

consistent                                     =  query

physical reads                                = disk

SQL*Net roundtrips to/from client      = fetch count

rows processed                              = fetch rows


posted by bedbmsguru
2018. 1. 29. 11:32 Zabbix


설정데이터만 백업하고 history 나 trends data는 table schema 만 백업


zabbix-mysql-dump 스크립트를 사용한다.



https://github.com/maxhq/zabbix-backup/wiki

posted by bedbmsguru
2018. 1. 26. 13:12 Linux

https://www.question-defense.com/2009/01/13/how-to-install-iostat-using-yum

'Linux' 카테고리의 다른 글

Centos7 YUM설치시 인증서 오류  (0) 2021.05.31
vmstat를 사용한 모니터링  (0) 2020.04.29
posted by bedbmsguru
2017. 12. 26. 15:45 maridb&mysql

1. /etc/yum.repos.d/MariaDB.repo 파일 생성

[mariadb]

name = MariaDB

baseurl = http://yum.mariadb.org/10.1/centos7-amd64 

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1


2.인증서 import


rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB



3. yum으로 MariaDB 설치

yum install MariaDB-server MariaDB-client MariaDB-compat 




'maridb&mysql' 카테고리의 다른 글

procedure 생성 템플릿  (0) 2018.10.26
Function 템플릿  (0) 2018.10.26
Foreign key 정보조회 및 삭제  (0) 2018.10.26
mariadb (mysql)백업  (0) 2018.10.26
innobackupex dependency 오류 해결  (0) 2017.12.21
posted by bedbmsguru
2017. 12. 21. 11:59 maridb&mysql

innobackupex 로 백업도중 아래와 같은 에러가 발생할 경우


./xtrabackup --defaults-file=/etc/my.cnf --backup --datadir=/var/lib/mysql/ --target-dir=/home/backup_dir/full/ --user=root --password=12345

Can't locate Digest/MD5.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at - line 693.
BEGIN failed--compilation aborted at - line 693.
Connecting to MySQL server host: (null), user: root, password: set, port: 0, socket: /var/lib/mysql/mysql.sock



의존성 오류이므로 해당 rpm을 설치해주면 된다.



yum install perl-Digest-MD5

'maridb&mysql' 카테고리의 다른 글

procedure 생성 템플릿  (0) 2018.10.26
Function 템플릿  (0) 2018.10.26
Foreign key 정보조회 및 삭제  (0) 2018.10.26
mariadb (mysql)백업  (0) 2018.10.26
mariadb 설치  (0) 2017.12.26
posted by bedbmsguru