[mysql] function 정보

DB 2014. 2. 4. 17:39


1. function 데이터 읽어오기

show function status;


* 참고 

procedure 확인하기

show procedure status; 


2. function 상세 정보 확인

select name, body from mysql.proc where name like 'myFunction';



3. function 구체적인 정보

http://www.java2s.com/Tutorial/MySQL/0201__Procedure-Function/Selectinformationfromthemysqlproctableandgetalltheunderlyingdata.htm


http://www.java2s.com/Tutorial/MySQL/0201__Procedure-Function/UsetheSHOWCREATEFUNCTIONcommand.htm


http://blog.daum.net/_blog/BlogTypeView.do?blogid=0Frx9&articleno=7333084&_bloghome_menu=recenttext




4. function 쓰면 좋은 것

auto_increment류의 nextval, curval, setval을 구현시, ibatis에서 두번 쿼리 날리지 않고, 한번의 쿼리로 insert 데이터 & select auto_increment값을 얻어올 수 있다. 


http://www.microshell.com/database/mysql/emulating-nextval-function-to-get-sequence-in-mysql/




5. mysqldump시 유의사항

function, procedure과 db dump를 아래와 같이 떠야 한다. 


 mysqldump --routines   -u 유저이름 -p DB명 > 백업파일



* 참고 

trigger까지 덤프를 떠야 안전. 


 mysqldump --routines --trigger  -u 유저이름 -p DB명 > 백업파일 



'DB' 카테고리의 다른 글

mysql partitioning 관련된 좋은 정보  (0) 2014.02.06
[mysql] replication leak  (0) 2014.02.04
[mysql] Tip - group_concat, if/ifnull/case  (0) 2013.12.19
Mysql HA  (0) 2013.04.23
[mysql] "Impossible WHERE noticed after reading const tables"  (0) 2012.06.20
Posted by '김용환'
,