Redis connection check

 

Redis 서버를 레플리카 셋 구성 설정 명령어 후, OK 메시지를 받는 것과 실제 Master 서버와 Sync 를 맞추는 것과는 다른 문제다.

즉, 서버 설정에는 성공했어도, Master 서버와의 Sync 에는 실패할 수도 있다는 이야기다.

 

레플리카 설정 후에는 SYNC 혹은 INFO 명령으로 반드시 SYNC 를 확인하도록 하자.

Oracle Procedure Print 찍기…

Oracle Procedure 를 테스트할 때, 내부 변수들에 할당된 값을 확인해야할 때가 있다.

이럴 때, 다음의 구문을 사용하면 확인이 가능하다.

SQL> set serveroutput on format wrap
SQL> declare
  2      x varchar2(30) := 'My name is neo.';
  3  begin
  4      dbms_output.enable(1000000);
  5      dbms_output.put_line ('The value of variable "x" is: ['||x||']');
  6* end;
SQL> 
/The value of variable "x" is: [My name is neo.]
참조 : www.dbforums.com/oracle/1644155-how-print-value-variable-used-oracle-procedure.html
참조 : http://stackoverflow.com/questions/9519510/how-to-printf-in-oracle-stored-procedure-for-debugging-purposes
참조 : http://dscythe.tistory.com/69
참조 : http://stackoverflow.com/questions/7352366/oracle-stored-procedure-printing-varchar2-output-variable

INFO: /usr/bin/ld: cannot find /usr/lib/libpthread_nonshared.a inside

oracle 설치 도중 다음의 에러가 나타났다

INFO: /usr/bin/ld: cannot find /usr/lib/libpthread_nonshared.a inside

참조되는 라이브러리 링크 디렉토리 내에서 libpthread_nonshared.a 라이브러리를 찾을 수 없어서 나타나는 오류다.
다음을 입력해준다.

sudo ln -s /usr/lib/i386-linux-gnu/libpthread_nonshared.a /usr/lib/libpthread_nonshared.a

mysql_query() return 1

 

mysql 라이브러리를 이용한 MySQL C 프로그램에서 이상한 로그를 발견했다.

 

mysql_query()  함수 결과를 수행한 결과값이 1이 나왔던 것.
mysql_query() 에 관한 명세는 다음 링크에서 찾을 수 있었다.

http://dev.mysql.com/doc/refman/5.0/en/mysql-query.html

 

이 중, Return Value와 관계있는 항목을 아래에 나타내었다.

Return Values

Zero if the statement was successful. Nonzero if an error occurred.

정상일 경우 0, 실패일 경우 0이 아닌 다른 값이 나온다고 나와있다.
에러가 발생했을 경우의 나타나지는 결과값들을 살펴보았다.

Errors

mysql_query() 함수의 리턴값이 1인 경우에 대한 내용은 찾을 수 없었다.
결국 mysql_error() 와 mysql_errno() 함수를 이용해 에러 메시지를 직접 로그에 찍어보고 나서야 그 원인을 알 수 있었다.

1054  – Unknown column