{"id":3114,"date":"2020-04-16T11:34:52","date_gmt":"2020-04-16T02:34:52","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=3114"},"modified":"2023-06-17T07:40:18","modified_gmt":"2023-06-16T22:40:18","slug":"db2%ef%bc%88v11-5%ef%bc%89%e3%81%a7db%e3%81%ae%e4%bd%9c%e6%88%90%e3%81%a8%e3%82%a2%e3%83%bc%e3%82%ab%e3%82%a4%e3%83%96%e3%83%ad%e3%82%ae%e3%83%b3%e3%82%b0%e3%81%ae%e8%a8%ad%e5%ae%9a%e3%82%92%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/3114","title":{"rendered":"Db2\uff08V11.5\uff09\u3067DB\u306e\u4f5c\u6210\u3068\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30ae\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u884c\u3046\uff01"},"content":{"rendered":"<p>Db2\uff08V11.5\uff09\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u5f8c\u306e\u4f5c\u696d\u3068\u3057\u3066\u3001DB\u306e\u4f5c\u6210\u3068\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30ae\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>\u4f7f\u7528\u74b0\u5883<\/h2>\n<ul>\n<li>CentOS 8.1 (Server with GUI)<\/li>\n<li>Db2 V11.5<\/li>\n<\/ul>\n<h2>DB\u306e\u4f5c\u6210\u60c5\u5831<\/h2>\n<p>\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u3067DB\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<table>\n<tr>\n<th>No<\/th>\n<th>Name<\/th>\n<th>Value<\/th>\n<th>Comments<\/th>\n<\/tr>\n<tr>\n<td>01<\/td>\n<td>Database territory<\/td>\n<td>JP<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>02<\/td>\n<td>Database code page<\/td>\n<td>1208<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>03<\/td>\n<td>DB Name<\/td>\n<td>db01<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>04<\/td>\n<td>Database code set<\/td>\n<td>UTF-8<\/td>\n<td>Default<\/td>\n<\/tr>\n<tr>\n<td>05<\/td>\n<td>Database country\/region code<\/td>\n<td>81<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>06<\/td>\n<td>Database collating sequence<\/td>\n<td>IDENTITY<\/td>\n<td>Default<\/td>\n<\/tr>\n<tr>\n<td>07<\/td>\n<td>Database page size<\/td>\n<td>4096<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<h2>DB\u306e\u4f5c\u6210<\/h2>\n<p>DB\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8d77\u52d5\u5f8c\u3001DB\u306e\u4f5c\u6210\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n$ su - db2inst1\r\n$ db2 start db manager\r\n$ db2 create database db01 using codeset UTF-8 territory JP collate using IDENTITY\r\n<\/pre>\n<h2>\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210<\/h2>\n<p>\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3001SELECT\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3,4,5]; title: ; notranslate\" title=\"\">\r\n$ db2 connect to db01\r\n$ db2 &quot;CREATE TABLE TEST01 (ID INT , NAME VARCHAR(100))&quot;\r\n$ db2 &quot;INSERT INTO TEST01 VALUES (1,'\u3042\u3044\u3046\u3048\u304a')&quot;\r\n$ db2 &quot;SELECT * FROM TEST01&quot;\r\n<\/pre>\n<h2>Db2\u306e\u521d\u671f\u8a2d\u5b9a\u306e\u78ba\u8a8d<\/h2>\n<p>Db2\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30ec\u30b8\u30b9\u30c8\u30ea\u5909\u6570\u306e\u78ba\u8a8d<\/h3>\n<p>\u30ec\u30b8\u30b9\u30c8\u30ea\u5909\u6570\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ db2set -all\r\n&#x5B;i] DB2COMM=TCPIP\r\n&#x5B;g] DB2SYSTEM=server01\r\n<\/pre>\n<h3>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8a2d\u5b9a\u306e\u78ba\u8a8d<\/h3>\n<p>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ db2 get dbm cfg\r\n...\r\n<\/pre>\n<h3>DB\u306e\u8a2d\u5b9a\u306e\u78ba\u8a8d<\/h3>\n<p>DB\u306e\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ db2 get db cfg for db01\r\n...\r\n<\/pre>\n<h2>DB2\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30ae\u30f3\u30b0\u306e\u8a2d\u5b9a<\/h2>\n<p>\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30ae\u30f3\u30b0\u3092\u884c\u3046\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<table>\n<tr>\n<th>No<\/th>\n<th>Name<\/th>\n<th>Value<\/th>\n<th>Comments<\/th>\n<\/tr>\n<tr>\n<td>01<\/td>\n<td>NEWLOGPATH<\/td>\n<td>\/home\/db2inst1\/db2logs<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>02<\/td>\n<td>LOGARCHMETH1<\/td>\n<td>DISK:\/home\/db2inst1\/db2arclogs<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<h3>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4f5c\u6210<\/h3>\n<p>\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30ae\u30f3\u30b0\u7528\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u305f\u3081\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4f5c\u6210\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e6\u30fc\u30b6\u3067\u884c\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e6\u30fc\u30b6\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u672c\u7a3c\u50cd\u3055\u305b\u308b\u5834\u5408\u306f\u3001\u30c7\u30a3\u30b9\u30af\u3084\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u5206\u3051\u308b\u306a\u3069\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n$ mkdir db2logs\r\n$ mkdir db2arclogs\r\n$ mkdir db2backups\r\n<\/pre>\n<h3>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30ed\u30b0\u3068\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30b0\u306e\u4fdd\u7ba1\u5148\u306e\u8a2d\u5b9a<\/h3>\n<p>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30ed\u30b0\u3068\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30b0\u306e\u4fdd\u7ba1\u5148\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2]; title: ; notranslate\" title=\"\">\r\n$ db2 &quot;update db cfg for db01 using newlogpath \/home\/db2inst1\/db2logs&quot;\r\n$ db2 &quot;update db cfg for db01 using logarchmeth1 disk:\/home\/db2inst1\/db2arclogs&quot;\r\n<\/pre>\n<h3>Db2\u306e\u518d\u8d77\u52d5<\/h3>\n<p>\u8a2d\u5b9a\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u306bDb2\u306e\u518d\u8d77\u52d5\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,2,3]; title: ; notranslate\" title=\"\">\r\n$ db2 terminate\r\n$ db2stop\r\n$ db2start\r\n<\/pre>\n<h3>\u30aa\u30f3\u30e9\u30a4\u30f3\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306e\u53d6\u5f97<\/h3>\n<p>\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30ae\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u3001Db2\u306e\u518d\u8d77\u52d5\u5f8c\u306f\u3001DB\u304c\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30da\u30f3\u30c7\u30a3\u30f3\u30b0\u306e\u72b6\u614b\u306b\u306a\u308b\u305f\u3081\u3001\u30aa\u30f3\u30e9\u30a4\u30f3\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ db2 backup database db01 to \/home\/db2inst1\/db2backups\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>Db2\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30ae\u30f3\u30b0\u3092\u8a2d\u5b9a\u3092\u884c\u3046\u3053\u3068\u3067\u3001DB\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306e\u53d6\u5f97\u304c\u53ef\u80fd\u306a\u72b6\u614b\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h2>\u53c2\u8003\u60c5\u5831<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.ibm.com\/docs\/en\/db2\" target=\"_blank\" rel=\"noopener\">IBM Db2 documentation<\/a><\/li>\n<\/ul>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/4286\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Db2\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2022\/12\/eyecatch_db2_02-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Db2\u3092\u4f7f\u3044\u3053\u306a\u3059\uff01<\/div><div class=\"substr\">Db2\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304b\u3089\u6d3b\u7528\u306b\u95a2\u3059\u308b\u8a18\u4e8b\u306e\u4e00\u89a7\u3092\u63b2\u8f09\u3057\u307e\u3059\u3002...<\/div><\/a><\/div>\n<h2>Db2\u66f8\u7c4d\uff08Amazon\uff09<\/h2>\n<h3>\u5373\u6226\u529b\u306eDB2\u7ba1\u7406\u8853\u3000\uff5e\u4ed5\u7d44\u307f\u304b\u3089\u308f\u304b\u308b\u52b9\u7387\u7684\u7ba1\u7406\u306e\u30ce\u30a6\u30cf\u30a6<\/h3>\n<p><iframe style=\"width: 120px; height: 240px;\" sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=infotecr-22&amp;language=ja_JP&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=as_ss_li_til&amp;asins=B07FC6JDJF&amp;linkId=78a998dac5b175577ad0fd2f81956839\"><\/iframe><\/p>\n<h3>DB2 10 \u30a8\u30d0\u30ea\u30e5\u30a8\u30fc\u30b7\u30e7\u30f3\u30fb\u30ac\u30a4\u30c9\u30d6\u30c3\u30af<\/h3>\n<p><iframe style=\"width: 120px; height: 240px;\" sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=infotecr-22&amp;language=ja_JP&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=as_ss_li_til&amp;asins=479813189X&amp;linkId=f11cfb121245f63214f653b5812fa0cb\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Db2\uff08V11.5\uff09\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u5f8c\u306e\u4f5c\u696d\u3068\u3057\u3066\u3001DB\u306e\u4f5c\u6210\u3068\u30a2\u30fc\u30ab\u30a4\u30d6\u30ed\u30ae\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":6945,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[106],"tags":[480,518,517],"class_list":["post-3114","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-db2","tag-db2","tag-db","tag-517"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/3114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=3114"}],"version-history":[{"count":1,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/3114\/revisions"}],"predecessor-version":[{"id":10347,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/3114\/revisions\/10347"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/6945"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=3114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=3114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=3114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}