{"id":61697,"date":"2024-10-13T12:58:15","date_gmt":"2024-10-13T04:58:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/61697\/"},"modified":"2024-10-13T12:58:16","modified_gmt":"2024-10-13T04:58:16","slug":"ibm-db2_v9-1_linux%e7%9a%84%e6%ad%a3%e7%a2%ba%e5%ae%89%e8%a3%9d%e9%85%8d%e7%bd%ae%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/61697\/","title":{"rendered":"IBM\/DB2_V9.1_Linux\u7684\u6b63\u78ba\u5b89\u88dd\u914d\u7f6e\u6d41\u7a0b"},"content":{"rendered":"<h1 id=\"ibm-db2_v9-1_linux%e7%9a%84%e6%ad%a3%e7%a2%ba%e5%ae%89%e8%a3%9d%e9%85%8d%e7%bd%ae%e6%b5%81%e7%a8%8b-TReVxMIgLw\">IBM\/DB2_V9.1_Linux\u7684\u6b63\u78ba\u5b89\u88dd\u914d\u7f6e\u6d41\u7a0b<\/h1>\n<p>IBM DB2 \u662f\u4e00\u6b3e\u529f\u80fd\u5f37\u5927\u7684\u95dc\u806f\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u4f01\u696d\u7d1a\u61c9\u7528\u4e2d\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5728 Linux \u74b0\u5883\u4e0b\u5b89\u88dd\u548c\u914d\u7f6e IBM DB2 V9.1 \u7684\u6b63\u78ba\u6d41\u7a0b\uff0c\u5e6b\u52a9\u7528\u6236\u9806\u5229\u5b8c\u6210\u5b89\u88dd\u4e26\u9032\u884c\u57fa\u672c\u914d\u7f6e\u3002<\/p>\n<h2 id=\"%e7%b3%bb%e7%b5%b1%e8%a6%81%e6%b1%82-TReVxMIgLw\">\u7cfb\u7d71\u8981\u6c42<\/h2>\n<p>\u5728\u5b89\u88dd IBM DB2 V9.1 \u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u78ba\u4fdd\u7cfb\u7d71\u6eff\u8db3\u4ee5\u4e0b\u8981\u6c42\uff1a<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7d71\uff1a\u652f\u6301\u7684 Linux \u767c\u884c\u7248\uff08\u5982 Red Hat\u3001SUSE \u7b49\uff09<\/li>\n<li>\u5167\u5b58\uff1a\u81f3\u5c11 1 GB RAM<\/li>\n<li>\u786c\u789f\u7a7a\u9593\uff1a\u81f3\u5c11 2 GB \u53ef\u7528\u7a7a\u9593<\/li>\n<li>\u8655\u7406\u5668\uff1a\u652f\u6301\u7684 x86 \u6216 x86_64 \u67b6\u69cb<\/li>\n<\/ul>\n<h2 id=\"%e4%b8%8b%e8%bc%89-db2-%e5%ae%89%e8%a3%9d%e5%8c%85-TReVxMIgLw\">\u4e0b\u8f09 DB2 \u5b89\u88dd\u5305<\/h2>\n<p>\u7528\u6236\u53ef\u4ee5\u5f9e IBM \u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09 DB2 V9.1 \u7684\u5b89\u88dd\u5305\u3002\u4e0b\u8f09\u5b8c\u6210\u5f8c\uff0c\u5c07\u5b89\u88dd\u5305\u4e0a\u50b3\u81f3 Linux \u4f3a\u670d\u5668\u7684\u6307\u5b9a\u76ee\u9304\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-TReVxMIgLw\">\u5b89\u88dd\u6b65\u9a5f<\/h2>\n<h3 id=\"1-%e8%a7%a3%e5%a3%93%e5%ae%89%e8%a3%9d%e5%8c%85-TReVxMIgLw\">1. \u89e3\u58d3\u5b89\u88dd\u5305<\/h3>\n<pre><code>tar -xvf db2_v9.1_linux.tar.gz<\/code><\/pre>\n<h3 id=\"2-%e9%80%b2%e5%85%a5%e5%ae%89%e8%a3%9d%e7%9b%ae%e9%8c%84-TReVxMIgLw\">2. \u9032\u5165\u5b89\u88dd\u76ee\u9304<\/h3>\n<pre><code>cd db2_v9.1_linux<\/code><\/pre>\n<h3 id=\"3-%e9%96%8b%e5%a7%8b%e5%ae%89%e8%a3%9d-TReVxMIgLw\">3. \u958b\u59cb\u5b89\u88dd<\/h3>\n<p>\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u555f\u52d5\u5b89\u88dd\u7a0b\u5e8f\uff1a<\/p>\n<pre><code>.\/db2icrt -u db2inst1<\/code><\/pre>\n<p>\u9019\u88e1\u7684 &#8220;db2inst1&#8221; \u662f\u7528\u6236\u81ea\u5b9a\u7fa9\u7684 DB2 \u5be6\u4f8b\u540d\u7a31\u3002<\/p>\n<h3 id=\"4-%e9%85%8d%e7%bd%ae%e7%92%b0%e5%a2%83%e8%ae%8a%e9%87%8f-TReVxMIgLw\">4. \u914d\u7f6e\u74b0\u5883\u8b8a\u91cf<\/h3>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u9700\u8981\u914d\u7f6e\u74b0\u5883\u8b8a\u91cf\u3002\u7de8\u8f2f\u7528\u6236\u7684 .bash_profile \u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u5167\u5bb9\uff1a<\/p>\n<pre><code>export DB2INSTANCE=db2inst1\nexport DB2_HOME=\/opt\/ibm\/db2\/V9.1\nexport PATH=$DB2_HOME\/bin:$PATH<\/code><\/pre>\n<p>\u4fdd\u5b58\u4e26\u9000\u51fa\u5f8c\uff0c\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u8b8a\u66f4\u751f\u6548\uff1a<\/p>\n<pre><code>source ~\/.bash_profile<\/code><\/pre>\n<h3 id=\"5-%e5%89%b5%e5%bb%ba-db2-%e5%af%a6%e4%be%8b-TReVxMIgLw\">5. \u5275\u5efa DB2 \u5be6\u4f8b<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5275\u5efa DB2 \u5be6\u4f8b\uff1a<\/p>\n<pre><code>db2icrt db2inst1<\/code><\/pre>\n<h3 id=\"6-%e5%95%9f%e5%8b%95-db2-%e5%af%a6%e4%be%8b-TReVxMIgLw\">6. \u555f\u52d5 DB2 \u5be6\u4f8b<\/h3>\n<p>\u555f\u52d5\u5be6\u4f8b\u7684\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<pre><code>db2start<\/code><\/pre>\n<h2 id=\"%e5%9f%ba%e6%9c%ac%e9%85%8d%e7%bd%ae-TReVxMIgLw\">\u57fa\u672c\u914d\u7f6e<\/h2>\n<h3 id=\"1-%e5%89%b5%e5%bb%ba%e6%95%b8%e6%93%9a%e5%ba%ab-TReVxMIgLw\">1. \u5275\u5efa\u6578\u64da\u5eab<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5275\u5efa\u4e00\u500b\u65b0\u7684\u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>db2 create database mydb<\/code><\/pre>\n<h3 id=\"2-%e8%a8%ad%e7%bd%ae%e7%94%a8%e6%88%b6%e6%ac%8a%e9%99%90-TReVxMIgLw\">2. \u8a2d\u7f6e\u7528\u6236\u6b0a\u9650<\/h3>\n<p>\u70ba\u4e86\u8b93\u7528\u6236\u80fd\u5920\u8a2a\u554f\u6578\u64da\u5eab\uff0c\u9700\u8981\u8a2d\u7f6e\u76f8\u61c9\u7684\u6b0a\u9650\uff1a<\/p>\n<pre><code>db2 GRANT CONNECT ON DATABASE TO USER myuser<\/code><\/pre>\n<h3 id=\"3-%e6%b8%ac%e8%a9%a6%e9%80%a3%e6%8e%a5-TReVxMIgLw\">3. \u6e2c\u8a66\u9023\u63a5<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6e2c\u8a66\u6578\u64da\u5eab\u9023\u63a5\uff1a<\/p>\n<pre><code>db2 connect to mydb user myuser using mypassword<\/code><\/pre>\n<h2 id=\"%e6%95%85%e9%9a%9c%e6%8e%92%e9%99%a4-TReVxMIgLw\">\u6545\u969c\u6392\u9664<\/h2>\n<p>\u5728\u5b89\u88dd\u548c\u914d\u7f6e\u904e\u7a0b\u4e2d\uff0c\u53ef\u80fd\u6703\u9047\u5230\u4e00\u4e9b\u5e38\u898b\u554f\u984c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6545\u969c\u6392\u9664\u7684\u5efa\u8b70\uff1a<\/p>\n<ul>\n<li>\u6aa2\u67e5\u7cfb\u7d71\u65e5\u8a8c\u4ee5\u7372\u53d6\u932f\u8aa4\u4fe1\u606f\u3002<\/li>\n<li>\u78ba\u4fdd\u6240\u6709\u74b0\u5883\u8b8a\u91cf\u6b63\u78ba\u8a2d\u7f6e\u3002<\/li>\n<li>\u78ba\u8a8d DB2 \u5be6\u4f8b\u5df2\u555f\u52d5\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-TReVxMIgLw\">\u7e3d\u7d50<\/h2>\n<p>\u672c\u6587\u4ecb\u7d39\u4e86\u5728 Linux \u74b0\u5883\u4e0b\u5b89\u88dd\u548c\u914d\u7f6e IBM DB2 V9.1 \u7684\u8a73\u7d30\u6d41\u7a0b\u3002\u901a\u904e\u9075\u5faa\u4e0a\u8ff0\u6b65\u9a5f\uff0c\u7528\u6236\u53ef\u4ee5\u9806\u5229\u5b8c\u6210\u5b89\u88dd\u4e26\u9032\u884c\u57fa\u672c\u914d\u7f6e\u3002\u5982\u679c\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u90e8\u7f72\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u4eab\u53d7\u66f4\u7a69\u5b9a\u7684\u6027\u80fd\u548c\u66f4\u9ad8\u7684\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3IBM DB2 V9.1\u5728Linux\u4e0a\u7684\u6b63\u78ba\u5b89\u88dd\u8207\u914d\u7f6e\u6d41\u7a0b\uff0c\u78ba\u4fdd\u6578\u64da\u5eab\u9ad8\u6548\u904b\u884c\u8207\u7ba1\u7406\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-61697","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/61697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=61697"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/61697\/revisions"}],"predecessor-version":[{"id":61698,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/61697\/revisions\/61698"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=61697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=61697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=61697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}