{"id":236,"date":"2019-11-13T21:21:53","date_gmt":"2019-11-13T13:21:53","guid":{"rendered":"https:\/\/www.overwatchss.club\/?p=236"},"modified":"2019-11-16T13:09:02","modified_gmt":"2019-11-16T05:09:02","slug":"%e6%95%b0%e6%8d%ae%e5%ba%93%e8%80%83%e8%af%95%e7%9f%a5%e8%af%86%e7%82%b9%e6%b1%87%e6%80%bb","status":"publish","type":"post","link":"https:\/\/www.overwatchss.club\/?p=236","title":{"rendered":"\u6570\u636e\u5e93\u8003\u8bd5\u77e5\u8bc6\u70b9\u6c47\u603b"},"content":{"rendered":"\n<p class=\"has-text-align-center has-large-font-size\"><strong>0\u3001\u57fa\u7840<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-background has-text-align-center has-vivid-red-color has-very-light-gray-background-color\"><strong>0.0\u4f7f\u7528\u524d\u63d0<\/strong><\/p>\n\n\n\n<p>\u4e0b\u5217\u6240\u6709\u7684\u4ee3\u7801\u7684\u524d\u63d0\u90fd\u662f\u518dOracle\u6570\u636e\u5e93\u4e2d\u5bfc\u5165\u4e86emp\u4e0edept\u8868\uff0c\u4f7f\u7528\u7684\u7528\u6237\u4e3aSCOTT\u7528\u6237\u5bc6\u7801TIGER\u3002\u4e24\u4e2a\u8868\u7684\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a data-fancybox=\"gallery\"\r\n                data-caption=\"image\"\r\n                class=\"fancybox\"\r\n                href=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/Oracle-emp\u8868\u7ed3\u6784-1024x456.png\"\r\n                alt=\"image\"\r\n                title=\"image\"><img decoding=\"async\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/Oracle-emp\u8868\u7ed3\u6784-1024x456.png\" target=\"_blank\" rel=\"nofollow\" class=\"fancybox\"><\/a><figcaption><center>emp\u8868<\/center><\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a data-fancybox=\"gallery\"\r\n                data-caption=\"image\"\r\n                class=\"fancybox\"\r\n                href=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/Oracle-dept\u8868\u7ed3\u6784.png\"\r\n                alt=\"image\"\r\n                title=\"image\"><img decoding=\"async\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/Oracle-dept\u8868\u7ed3\u6784.png\" target=\"_blank\" rel=\"nofollow\" class=\"fancybox\"><\/a><figcaption><center>dept\u8868<\/center><\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>0.1\u4ec0\u4e48\u662fOracle\u6570\u636e\u5e93<\/strong><\/p>\n\n\n\n<p>Oracle database\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a\u5b9e\u4f8b\u548c\u6570\u636e\u5e93\u3002<br> <strong>\u5b9e\u4f8b\uff1a\u5b9e\u4f8b\u662f\u6570\u636e\u5e93\u542f\u52a8\u65f6\u521d\u59cb\u5316\u7684\u4e00\u7ec4\u8fdb\u7a0b\u548c\u5185\u5b58\u7ed3\u6784<\/strong> \u3002<br> <strong>\u6570\u636e\u5e93\uff1a\u6570\u636e\u5e93\u5219\u6307\u7684\u662f\u7528\u6237\u5b58\u50a8\u6570\u636e\u7684\u4e00\u4e9b\u7269\u7406\u6587\u4ef6<\/strong>\u3002<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>0.2\u4ea4\u4e92\u6d41\u7a0b<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"561\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u4ea4\u4e92\u6d41\u7a0b-1024x561.png\" alt=\"\" class=\"wp-image-350\" srcset=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u4ea4\u4e92\u6d41\u7a0b-1024x561.png 1024w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u4ea4\u4e92\u6d41\u7a0b-300x164.png 300w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u4ea4\u4e92\u6d41\u7a0b-768x421.png 768w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u4ea4\u4e92\u6d41\u7a0b.png 1438w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>1.\u7528\u6237\u548c\u7528\u6237\u8fdb\u7a0b\u4ea4\u4e92<\/strong><br><strong>2.\u7528\u6237\u8fdb\u7a0b\u548c\u670d\u52a1\u5668\u8fdb\u7a0b\u4ea4\u4e92<\/strong><br><strong>3.\u670d\u52a1\u5668\u8fdb\u7a0b\u548c\u5b9e\u4f8b\u8fdb\u7a0b\u4ea4\u4e92<\/strong><br><strong>4.\u5b9e\u4f8b\u548c\u6570\u636e\u5e93\u8fdb\u7a0b\u4ea4\u4e92<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>0.4 Oracle\u4f53\u7cfb\u7ed3\u6784<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"> Oracle\u6570\u636e\u5e93\u7684\u4f53\u7cfb\u7ed3\u6784\u5305\u62ec\u56db\u4e2a\u65b9\u9762\uff1a\u6570\u636e\u5e93\u7684\u7269\u7406\u7ed3\u6784\u3001\u903b\u8f91\u7ed3\u6784\u3001\u5185\u5b58\u7ed3\u6784\u53ca\u8fdb\u7a0b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u7269\u7406\u7ed3\u6784\uff1a\u6570\u636e\u6587\u4ef6\uff0c\u91cd\u505a\u6587\u4ef6\uff0c\u63a7\u5236\u6587\u4ef6\uff0c\u53c2\u6570\u6587\u4ef6\uff0c\u8ddf\u8e2a\u6587\u4ef6\uff0c\u5f52\u6863\u6587\u4ef6\u3002<\/li><li>\u903b\u8f91\u7ed3\u6784\uff1a\u8868\u7a7a\u95f4\uff0c\u6570\u636e\u5757\uff0c\u533a\uff0c\u6bb5\uff0c\u6a21\u5f0f\u5bf9\u8c61<\/li><li>\u5185\u5b58\u7ed3\u6784\u53ca\u8fdb\u7a0b\uff1aSGA\uff0cPGA\uff0cUGA\uff0c\u670d\u52a1\u8fdb\u7a0b\uff0c\u540e\u53f0\u8fdb\u7a0b\uff0c\u4ece\u5c5e\u8fdb\u7a0b\u3002<\/li><\/ul>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"><strong>\u4e00\u3001ER\u6a21\u578b<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"> <strong> 3.1\u6570\u636e\u5e93\u8bbe\u8ba1\u7684\u4e3b\u8981\u6b65\u9aa4<\/strong><\/p>\n\n\n\n<p><strong>\u2460\u6982\u5ff5\u8bbe\u8ba1\u2461\u903b\u8f91\u8bbe\u8ba1\u2462\u7269\u7406\u8bbe\u8ba1<\/strong>\u3002<br><strong>\u6982\u5ff5\u8bbe\u8ba1<\/strong>\uff1a\u5c06\u7ed3\u679c\u62bd\u8c61\u51fa\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u5b9e\u4f53\u4e0e\u8054\u7cfb\uff0c\u7136\u540e\u753b\u51faER\u56fe\u3002<br><strong>\u903b\u8f91\u8bbe\u8ba1<\/strong>\uff1a\u628a\u6982\u5ff5\u8bbe\u8ba1\u5f97\u5230\u7684ER\u56fe\u8f6c\u6362\u4e3a\u8868\u7684\u7ed3\u6784\uff0c\u4e3b\u8981\u7528\u7684\u662fER\u56fe\u4e2d\u7684\u8054\u7cfb\u8f6c\u5316\u4e3a\u8868\u7684\u57fa\u672c\u89c4\u5219\u53ca<font color=\"#f78da7\">\u8303\u5f0f\u7406\u8bba<\/font>\u3002<br><strong>\u7269\u7406\u8bbe\u8ba1<\/strong>\uff1a\u5728\u5177\u4f53\u7684DBMS\u4e0a\u628a\u903b\u8f91\u8bbe\u8ba1\u5f97\u5230\u7684\u8868\u5b9e\u73b0\uff0c\u5305\u62ec\u7269\u7406\u5b58\u50a8\u89c4\u5212\u548c\u521b\u5efa\u5408\u9002\u7684\u7d22\u5f15\u3002<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\">  <strong>3.2ER\u6a21\u578b\u7684\u4e3b\u8981\u6982\u5ff5<\/strong><\/p>\n\n\n\n<p>ER\u5c31\u662f\u5b9e\u4f53-\u8054\u7cfb\u56fe\uff0c\u4e5f\u53eb\u5b9e\u4f53-\u8054\u7cfb\u6a21\u578b\uff0c\u662f\u4e00\u79cd\u81ea\u9876\u800c\u4e0b\u7684\u6570\u636e\u5e93\u8bbe\u8ba1\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-background has-text-align-center has-vivid-red-color has-very-light-gray-background-color\">  <strong>3.3ER\u56fe\u7684\u8868\u793a\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p>UML\u65b9\u6cd5\u8868\u793a\uff1a\u4f7f\u7528<font color=\"#f78da7\">\u77e9\u5f62<\/font>\u8868\u793a\u5b9e\u4f53\uff0c\u8868\u793a\u5b9e\u4f53\u7684\u5c5e\u6027\u5219\u628a\u77e9\u5f62\u4e00\u5206\u4e3a\u4e8c\uff0c<strong>\u4e0a\u90e8\u8868\u793a\u5b9e\u4f53\u540d\u79f0\uff0c\u4e0b\u90e8\u8868\u793a\u5b9e\u4f53\u5c5e\u6027<\/strong>\uff08\u5c5e\u6027\u53ef\u4ee5\u6709\u591a\u4e2a\uff09\u3002<br>\u8054\u7cfb\uff1a\u8054\u7cfb\u4e00\u822c\u7528<font color=\"#f78da7\">\u52a8\u8bcd<\/font>\u8868\u793a\uff0c\u6bcf\u4e2a\u5355\u8bcd\u9996\u5b57\u6bcd<font color=\"#f78da7\">\u5927\u5199<\/font>\uff0c<strong>\u5b58\u5728\u8054\u7cfb\u7684\u4e24\u4e2a\u5b9e\u4f53\u7528<\/strong><font color=\"#f78da7\"><strong>\u76f4\u7ebf\u8fde\u63a5<\/strong><\/font>\uff0c\u628a\u8054\u7cfb\u540d\u79f0\u653e\u5728\u76f4\u7ebf<font color=\"#f78da7\">\u4e0a\u9762<\/font>\u3002\u56fe\u4f8b1-1<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a data-fancybox=\"gallery\"\r\n                data-caption=\"image\"\r\n                class=\"fancybox\"\r\n                href=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/ER\u56fe\u5b9e\u4f8b.png\"\r\n                alt=\"image\"\r\n                title=\"image\"><img decoding=\"async\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/ER\u56fe\u5b9e\u4f8b.png\" target=\"_blank\" rel=\"nofollow\" class=\"fancybox\"><\/a><\/figure>\n\n\n\n<p class=\"has-text-align-center\">1-1ER\u56fe\u5b9e\u4f8b<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><a data-fancybox=\"gallery\"\r\n                data-caption=\"image\"\r\n                class=\"fancybox\"\r\n                href=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/ER\u56fe-1.jpg\"\r\n                alt=\"image\"\r\n                title=\"image\"><img decoding=\"async\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/ER\u56fe-1.jpg\" target=\"_blank\" rel=\"nofollow\" class=\"fancybox\"><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center\">1-2ER\u56fe\u6a21\u578b<\/p>\n\n\n\n<p class=\"has-text-color has-background has-text-align-center has-vivid-red-color has-very-light-gray-background-color\">  <strong>3.4\u8054\u7cfb\u7684\u6620\u5c04\u7ea6\u675f<\/strong><\/p>\n\n\n\n<p>\u6620\u5c04\u7ea6\u675f\u662f\u4e00\u4e2a\u5b9e\u4f53\u96c6\u4e2d\u7684\u5b9e\u4f53\u901a\u8fc7\u8054\u7cfb\u53ef\u4ee5\u540c\u53e6\u4e00\u4e2a\u5b9e\u4f53\u96c6\u4e2d\u76f8\u8054\u7cfb\u7684\u5b9e\u4f53\u6570\u91cf\u3002\u6620\u5c04\u7ea6\u675f\u7684\u79cd\u7c7b\u6709\u4e09\u79cd\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4e00\u5bf9\u4e00\u8054\u7cfb<\/li><li>\u4e00\u5bf9\u591a\u8054\u7cfb<\/li><li>\u591a\u5bf9\u591a\u8054\u7cfb<\/li><\/ul>\n\n\n\n<p>\u4e00\u5bf9\u591a\u793a\u4f8b\u56fe\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"850\" height=\"482\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/\u4e00\u5bf9\u591a\u793a\u4f8b\u56fe.png\" alt=\"\" class=\"wp-image-260\" srcset=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/\u4e00\u5bf9\u591a\u793a\u4f8b\u56fe.png 850w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/\u4e00\u5bf9\u591a\u793a\u4f8b\u56fe-300x170.png 300w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/\u4e00\u5bf9\u591a\u793a\u4f8b\u56fe-768x436.png 768w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><figcaption><center>1-3 \u4e00\u5bf9\u591a\u5b9e\u4f8b\u56fe<\/center><\/figcaption><\/figure><\/div>\n\n\n\n<p><strong>\u5176\u4e2d\uff0c\u9644\u5e26<\/strong><font color=\"#f78da7\"><strong>\u4e0b\u5212\u7ebf<\/strong><\/font><strong>\u7684\u662f<\/strong><font color=\"#f78da7\"><strong>\u4e3b\u952e<\/strong><\/font><strong>\uff08\u4e3b\u952e\uff1a\u552f\u4e00\u80fd\u591f\u6807\u8bc6\u8be5\u5b9e\u4f53\u7684\u5c5e\u6027\u300a\u5bf9\u5e94\u591a\u503c\u5c31\u662f\u6307\u5c5e\u6027\u4e0d\u80fd\u552f\u4e00\u6807\u8bc6\u4e3b\u4f53\u300b\uff09\u3002<\/strong>\u56fe\u4e2dEmployee\u53ef\u4ee5\u5904\u7406\u591a\u4efdOrder\uff0c\u4f46\u662f\u4e00\u4efdOrder\u4e0d\u80fd\u88ab\u591a\u4e2aEmployee\u5904\u7406\uff0c\u8fd9\u5c31\u662f\u4e00\u5bf9\u591a\u8054\u7cfb\u3002Employee\u76840..1\u4ee3\u8868\u4e00\u4e2aEmployee\u53ef\u4ee5\u5904\u7406\u8ba2\u5355\uff0c\u4e5f\u53ef\u4ee5\u8d1f\u8d23\u5176\u4ed6\u4e8b\u52a1\u4e0d\u5904\u7406\u8ba2\u5355\uff0c\u800cOrder\u76841..*\u4ee3\u8868\u81f3\u5c11\u6709\u4e00\u4e2a\u8ba2\u5355\u53c2\u6570\u8fd9\u4e2aDealWith\u8054\u7cfb\u4e2d\u3002<br><strong>\u56fe\u4e2d\u7684dealDate\u662f\u8054\u7cfbDealWith\u7684\u5c5e\u6027\uff0c\u653e\u7f6e\u5728\u77e9\u5f62\u4e2d\uff0c\u4e3a\u4e86\u4e0e\u5b9e\u4f53\u533a\u522b\uff0c\u8be5\u5c5e\u6027\u4e0e\u8054\u7cfb\u4e4b\u95f4\u7528\u865a\u7ebf\u76f8\u8fde\u3002<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-background has-text-align-center has-vivid-red-color has-cyan-bluish-gray-background-color\"><strong>3.5ER\u56fe\u5982\u4f55\u8f6c\u6362\u4e3a\u8868<\/strong>\uff08\u91cd\u70b9\uff09<\/p>\n\n\n\n<p>3.5.1\u4e00\u5bf9\u4e00\u8054\u7cfb\u8f6c\u5316\u4e3a\u8868<br>\u5c31\u662f\u628a\u4e24\u4e2a\u5b9e\u4f53\u53ca\u8054\u7cfb\u7684\u5c5e\u6027\u76f4\u63a5\u5408\u5e76\u4e3a\u4e00\u4e2a\u8868\uff0c\u5176\u4e2d\u4e24\u4e2a\u5b9e\u4f53\u7684\u4e3b\u952e\u90fd\u53ef\u4ee5\u9009\u4f5c\u65b0\u8868\u7684\u4e3b\u952e\u3002\u4e3e\u4f8b\uff1aPublisher\u5b9e\u4f53\u4e2d\u542b\u6709\u5c5e\u6027pubID,pubName,pubAddress\u3002Contact\u5b9e\u4f53\u4e2d\u542b\u6709\u5c5e\u6027contactNo,contactName,phone\u3002\u4e24\u4e2a\u5b9e\u4f53\u4e00\u5bf9\u4e00\u8054\u7cfb\uff0c\u5219<font color=\"#f78da7\"><strong>\u8f6c\u5316\u8868\u65f6\u76f4\u63a5\u628a\u4e24\u4e2a\u5b9e\u4f53\u7684\u5c5e\u6027\u4f5c\u4e3a\u4e00\u4e2a\u65b0\u7684\u8868\uff08\u6574\u5408\u4e3a\u65b0\u7684\u4e00\u884c\uff09\uff0c\u7136\u540e\u4e24\u4e2a\u8868\u7684\u4e3b\u952e\uff08pubID\u548ccontactNo\uff09\u9009\u4e00\u4e2a\u4f5c\u4e3a\u65b0\u8868\u7684\u4e3b\u952e<\/strong><\/font>\u3002<\/p>\n\n\n\n<p>3.5.2\u4e00\u5bf9\u591a\u8054\u7cfb\u8f6c\u5316\u4e3a\u8868<br>\u505a\u6cd5\u5c31\u662f\u628a\u201c\u4e00\u201d\u7684\u4e00\u65b9\u7684\u4e3b\u952e\u548c\u8054\u7cfb\u7684\u5c5e\u6027\u5408\u5e76\u5230\u201c\u591a\u201d\u7684\u4e00\u65b9\u7684\u8868\u5185\uff0c\u7136\u540e\u518d\u5199\u4e0a\u539f\u6709\u7684\u201c\u4e00\u201d\u7684\u8868\u6784\u6210\u4e86\u4e24\u4e2a\u65b0\u8868\u5c31\u662f\u4e00\u5bf9\u591a\u8054\u7cfb\u8f6c\u6362\u4e3a\u8868\u3002<\/p>\n\n\n\n<p>3.5.2\u4e00\u5bf9\u591a\u8054\u7cfb\u8f6c\u5316\u4e3a\u8868<br>\u505a\u6cd5\u5c31\u662f\u628a\u8054\u7cfb\u7684\u5c5e\u6027\u3001\u4e24\u4e2a\u5b9e\u4f53\u7684\u4e3b\u952e\u6784\u6210\u4e00\u4e2a\u65b0\u7684\u8868\uff0c\u540c\u65f6\u8fd9\u4e2a\u65b0\u8868\u7684\u4e24\u4e2a\u5c5e\u6027\u4f5c\u4e3a\u5916\u952e\u6307\u5411\u4e24\u4e2a\u5b9e\u4f53\u7684\u4e3b\u952e\uff0c\u8fd9\u5c31\u662f\u591a\u5bf9\u591a\u6a21\u578b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a data-fancybox=\"gallery\"\r\n                data-caption=\"image\"\r\n                class=\"fancybox\"\r\n                href=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/\u591a\u5bf9\u591a\u8054\u7cfb\u8f6c\u5316\u8868-1024x642.jpg\"\r\n                alt=\"image\"\r\n                title=\"image\"><img decoding=\"async\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/\u591a\u5bf9\u591a\u8054\u7cfb\u8f6c\u5316\u8868-1024x642.jpg\" target=\"_blank\" rel=\"nofollow\" class=\"fancybox\"><\/a><figcaption><center>1-4\u591a\u5bf9\u591a\u8054\u7cfb\u8f6c\u5316\u8868<\/center><\/figcaption><\/figure>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"><strong>\u4e8c\u3001\u89c4\u8303\u5316\u7406\u8bba<\/strong><\/p>\n\n\n\n<p class=\"has-background has-very-light-gray-background-color has-text-align-center\"><strong>4.1\u5f15\u5165\u8303\u5f0f\u7406\u8bba\u7684\u539f\u56e0<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u51cf\u5c11\u5185\u5b58\u5360\u7528\uff0c\u7a7a\u95f4\u6d6a\u8d39\u3002<\/li><li>\u907f\u514dInsertion\u5f02\u5e38<\/li><li>\u907f\u514dDeletion\u5f02\u5e38<\/li><li>\u907f\u514dUpdate\u5f02\u5e38<\/li><\/ol>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"> <strong>4.2\u7b2c\u4e00\u8303\u5f0f<\/strong> <\/p>\n\n\n\n<p class=\"has-text-align-left\"><strong>\u5b9a\u4e49\uff1a<\/strong><br><font color=\"#f78da7\"><strong>\u4e00\u4e2a\u8868\u6ca1\u6709\u591a\u503c\u5b57\u6bb5\uff0c\u5c31\u662f\u6ee1\u8db3\u7b2c\u4e00\u8303\u5f0f\u3002<\/strong><\/font><br>\u4f8b\u5982\u8868\uff081-1\uff09\uff1a<\/p>\n\n\n\n<p class=\"has-text-align-center\">--------------------------------------------------BOOK------------------------------------------<br>|--ISBN--|--title--|--pubDate--|--price--|--publisher--|--contact--|--author--|<br>|--70.45--|\u6570\u636e\u5e93|--2002-1-1---|-25.10---|-\u6559\u80b2\u51fa\u7248\u793e--|-----\u674e\u4fca----|\u738b\u4e09\u3001\u674e\u56db|<\/p>\n\n\n\n<p>\u6b64\u65f6ISBN\u4f5c\u4e3a\u4e3b\u952e\uff0c\u4f46\u662f<font color=\"#f78da7\"><strong>author\u5b57\u6bb5\u6709\u591a\u4e2a\u4f5c\u8005\uff0c\u5219\u79f0author\u4e3a\u591a\u503c\u5b57\u6bb5<\/strong><\/font>\u3002<br>\u8981\u60f3\u6ee1\u8db3\u7b2c\u4e00\u8303\u5f0f\u5219\u5904\u7406\u591a\u503c\u5b57\u6bb5\u7684\u65b9\u6cd5\u6709\uff1a<br><strong>1\uff1a\u6309\u7167\u591a\u503c\u5b57\u6bb5\u503c\u5206\u89e3\u4e3a\u591a\u4e2a\u5b57\u6bb5\uff0c\u5982\u4e0b\u8868\uff081-2\uff09\uff1a<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"> --------------------------------------------------BOOK------------------------------------------<br> |--ISBN--|--title--|--pubDate--|--price--|--publisher--|--contact--|--author--|<br> |--70.45--|\u6570\u636e\u5e93|--2002-1-1---|-25.10---|-\u6559\u80b2\u51fa\u7248\u793e--|-----\u674e\u4fca----|---\u738b\u4e09---|<br> |--70.45--|\u6570\u636e\u5e93|--2002-1-1---|-25.10---|-\u6559\u80b2\u51fa\u7248\u793e--|-----\u674e\u4fca----|---\u674e\u56db---| <br><br><strong>\u6b64\u65f6ISBN\u5b57\u6bb5\u4e0d\u80fd\u5728\u4f5c\u4e3a\u4e3b\u952e\uff0c\u800c\u662f\u9700\u8981\u548cauthor\u5b57\u6bb5\u4e00\u8d77\u6784\u6210<font color=\"#f78da7\">\u590d\u5408\u4e3b\u952e<\/font>\u3002<\/strong><\/p>\n\n\n\n<p><strong>2\uff1a\u628a\u591a\u503c\u5b57\u6bb5\u5206\u89e3\u4e3a\u591a\u4e2a\u5b57\u6bb5\uff1a<\/strong><br> \u5bf9\u4e8e\u591a\u503c\u5b57\u6bb5\u4e2a\u6570\u6709\u9650\u7684\uff0c\u4e14\u6570\u91cf\u4e0d\u5927\u53ef\u4ee5\u91c7\u7528\u628aauthor\u5206\u89e3\u4e3aauthor1\uff0cauthor2\u6765\u5206\u89e3\u4e3a\u591a\u4e2a\u5b57\u6bb5\u3002 <\/p>\n\n\n\n<p><strong>3\uff1a\u628a\u591a\u503c\u5b57\u6bb5\u79fb\u51fa\u5e76\u4e14\u4e0e\u539f\u6765\u8868\u7684\u4e3b\u952e\u6784\u6210\u4e00\u4e2a\u65b0\u8868\uff0c\u5982\u8868\uff081-3\uff09\uff1a<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\"> ---------------------------------------------BOOK----------------------------------------<br>|--ISBN--|--title--|--pubDate--|--price--|--publisher--|--contact--|<br>|--70.45--|\u6570\u636e\u5e93|--2002-1-1---|-25.10---|-\u6559\u80b2\u51fa\u7248\u793e--|-----\u674e\u4fca----| <\/p>\n\n\n\n<p class=\"has-text-align-center\">----------------BookAuthor--------------- <br>|--ISBN--|--author--| <br> |--70.45--|----\u738b\u4e09----| <br> |--70.45--|----\u674e\u56db----| <br><br><strong>\u6b64\u65f6ISBN\u5b57\u6bb5\u4e0d\u80fd\u5728\u4f5c\u4e3a\u4e3b\u952e\uff0c\u800c\u662f\u9700\u8981\u548cauthor\u5b57\u6bb5\u4e00\u8d77\u6784\u6210\u590d\u5408\u4e3b\u952e\u3002<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>4.3\u7b2c\u4e8c\u8303\u5f0f<\/strong><\/p>\n\n\n\n<p><font color=\"#f78da7\">\u4ec0\u4e48\u662f\u975e\u4e3b\u952e\u5b57\u6bb5\u548c\u90e8\u4efd\u4f9d\u8d56\uff1f<\/font><br><strong>\u975e\u4e3b\u952e\u5b57\u6bb5<\/strong>\u6307\u5728\u8868\u4e2d<strong>\u4e0d\u662f\u4e3b\u952e\u7684\u5176\u4ed6\u5b57\u6bb5\u3002<\/strong>\u3010\u4f8b\u5982\u8868\uff081-2\uff09\u4e2d\u7684\"title\"\u5b57\u6bb5\u3011<br><strong>\u90e8\u4efd\u4f9d\u8d56<\/strong>\u6307\u8fd9\u4e9b<strong>\u975e\u4e3b\u952e\u5b57\u6bb5\u53ea\u4f9d\u8d56\u590d\u5408\u4e3b\u952e<\/strong>\u4e2d\u7684<strong>\u67d0\u4e00\u4e2a\u4e3b\u952e\u6709\u5173\u800c\u4e0e\u5269\u4e0b\u7684<\/strong>\u6216\u8005\u5176\u4e2d\u4e4b\u4e00<strong>\u65e0\u5173\u3002<\/strong>\u3010\u4f8b\u5982\u88681-2\u4e2d\u975e\u4e3b\u952e\u5b57\u6bb5title\u7b49\u7b49\u5b57\u6bb5\u81f3\u4e8e\u590d\u5408\u4e3b\u952e\u4e2d\u7684ISBN\u6709\u5173\uff0c\u800c\u4e0eauthor\u5b57\u6bb5\u65e0\u5173\u3011<\/p>\n\n\n\n<p><strong>\u5b9a\u4e49:<\/strong><br><font color=\"#f78da7\"><strong>\u6ee1\u8db3\u7b2c\u4e00\u8303\u5f0f\u7684\u524d\u63d0\u4e0b\uff0c\u975e\u4e3b\u952e\u5b57\u6bb5\u5b8c\u5168\u4f9d\u8d56\u4e8e\u4e3b\u952e<\/strong><\/font>\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u2b50<strong>\u89e3\u51b3\u529e\u6cd5<\/strong>\uff1a<strong>\u628a\u5b58\u5728\u90e8\u5206\u4f9d\u8d56\u7684\u975e\u4e3b\u952e\u5b57\u6bb5\u79fb\u51fa\uff0c\u4e0e\u539f\u8868\u6240\u4f9d\u8d56\u7684\u90e8\u5206\u4e3b\u952e\u6784\u6210\u4e00\u4e2a\u65b0\u8868\u3002<\/strong>\u5bf9\u4e8e\u8868\uff081-2\uff09\u8fdb\u884c\u4fee\u6539\u540e\uff0c\u5982\u8868\uff081-4\uff09\uff1a<\/p>\n\n\n\n<p class=\"has-text-align-center\"> ----------------------------------------------BOOK----------------------------------------<br> |--ISBN--|--title--|--pubDate--|--price--|--publisher--|--contact--|<br> |--70.45--|\u6570\u636e\u5e93|--2002-1-1---|-25.10---|-\u6559\u80b2\u51fa\u7248\u793e--|-----\u674e\u4fca----|<\/p>\n\n\n\n<p><strong>\u628a\u5b58\u5728\u90e8\u5206\u4f9d\u8d56\u5173\u7cfb\u7684\u975e\u4e3b\u952e\u5b57\u6bb5\u79fb\u51fa\u540c\u65f6\u4e0e\u539f\u8868\u7684\u4e3b\u952eISBN\u6784\u6210\u65b0\u7684Book\u8868\uff0c\u5219\u8fd8\u5269\u4e0b\u4e00\u4e2a\u8868\u53ea\u542b\u6709author\u548cISBN\uff0c\u8fd9\u65f6\u8fd9\u4e2a\u8868\u6ee1\u8db3\u7b2c\u4e8c\u8303\u5f0f\u3002<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-center\">  ----------------BookAuthor--------------- <br>|--ISBN--|--author--| <br> |--70.45--|----\u738b\u4e09----| <br> |--70.45--|----\u674e\u56db----|  <\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>4.4\u7b2c\u4e09\u8303\u5f0f<\/strong><\/p>\n\n\n\n<p><font color=\"#f78da7\">\u4ec0\u4e48\u53eb\u505a\u4f20\u9012\u4f9d\u8d56\uff1f<\/font><br>\u4f8b\u5982\u4e0a\u8868\uff081-4\uff09\u4e2d\u8054\u7cfb\u4eba\u5b57\u6bb5contact\u4f9d\u8d56\u4e8epublisher\u5b57\u6bb5\u800cpublisher\u5b57\u6bb5\u53c8\u4f9d\u8d56\u4e8e\u4e3b\u952eISBN\uff0c\u6211\u4eec\u628a\u8fd9\u79cd<strong>\u9012\u8fdb\u7684\u4f9d\u8d56\u5173\u7cfb\u6210\u4e3acontact\u4f20\u9012\u4f9d\u8d56\u4e8e\u4e3b\u952eISBN<\/strong>\u3002<\/p>\n\n\n\n<p><strong>\u5b9a\u4e49\uff1a<\/strong><br><font color=\"#f78da7\"><strong>\u4e00\u4e2a\u8868\u6ee1\u8db3\u7b2c\u4e8c\u8303\u5f0f\uff0c\u5e76\u4e14\u6ca1\u6709\u975e\u4e3b\u952e\u5b57\u6bb5\u4f20\u9012\u4f9d\u8d56\u4e8e\u4e3b\u952e\u5b57\u6bb5\uff0c\u5219\u79f0\u8fd9\u4e2a\u8868\u6ee1\u8db3\u7b2c\u4e09\u8303\u5f0f\u3002<\/strong><\/font><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u2b50<strong>\u89e3\u51b3\u529e\u6cd5\uff1a\u5728\u6ee1\u8db3\u7b2c\u4e8c\u8303\u5f0f\u7684\u524d\u63d0\u4e0b\uff0c\u628a\u5b58\u5728\u4f20\u9012\u4f9d\u8d56\u7684\u5b57\u6bb5\u79fb\u51fa\uff0c\u4e0e\u5176\u76f4\u63a5\u4f9d\u8d56\u7684\u5b57\u6bb5\u6784\u6210\u4e00\u4e2a\u65b0\u8868\u3002\u8fd9\u6837\u5c31\u6ee1\u8db3\u4e86\u7b2c\u4e09\u8303\u5f0f<\/strong>\u3002\u5982\u8868\uff081-5\uff09\uff1a<\/p>\n\n\n\n<p class=\"has-text-align-center\">  -----------------------------------------BOOK-----------------------------------<br> |--ISBN--|--title--|--pubDate--|--price--|--publisher--|<br> |--70.45--|\u6570\u636e\u5e93|--2002-1-1---|-25.10---|-\u6559\u80b2\u51fa\u7248\u793e--| <\/p>\n\n\n\n<p class=\"has-text-align-center\"> ----------------BookAuthor--------------- <br>|--ISBN--|--author--| <br> |--70.45--|----\u738b\u4e09----| <br> |--70.45--|----\u674e\u56db----|   <\/p>\n\n\n\n<p class=\"has-text-align-center\">\u79fb\u51fa\u6709\u4f20\u9012\u4f9d\u8d56\u7684contact\u5b57\u6bb5\uff0c\u5e76\u4e14\u4e0e\u76f4\u63a5\u4f9d\u8d56\u7684publisher\u6784\u6210\u4e00\u4e2a\u65b0\u7684Contact\u8868<\/p>\n\n\n\n<p class=\"has-text-align-center\"> ----------------Contact--------------- <br>|--publisher--|--contact--| <br> |--\u6559\u80b2\u51fa\u7248\u793e--|----\u674e\u4fca----| <\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"><strong>\u4e09\u3001SQL\u8bed\u53e5<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>8.2 SQL\u8bed\u8a00\u4e3b\u8981\u7c7b\u578b<\/strong><\/p>\n\n\n\n<p>sql\u8bed\u8a00\u6700\u5e38\u7528\u7684\u529f\u80fd\uff1a<br><strong>\u67e5\u8be2\u53ca\u4fee\u6539\u6570\u636e<br>\u521b\u5efa\u6570\u636e\u5e93\u5bf9\u8c61<br>\u6743\u9650\u7ba1\u7406<\/strong><br>\u8fd9\u4e09\u7c7b\u8bed\u8a00\u5206\u522b\u79f0\u4e3a\uff1aDML\uff0cDDL\u548cDCL\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u4e3b\u8981\u7684SQL\u8bed\u53e5\u548c\u529f\u80fd<\/strong>\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a data-fancybox=\"gallery\"\r\n                data-caption=\"image\"\r\n                class=\"fancybox\"\r\n                href=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/SQL\u6743\u9650\u8868-1024x604.png\"\r\n                alt=\"image\"\r\n                title=\"image\"><img decoding=\"async\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/SQL\u6743\u9650\u8868-1024x604.png\" target=\"_blank\" rel=\"nofollow\" class=\"fancybox\"><\/a><figcaption><center>\u56fe1-5 12\u4e2aSQL\u8bed\u53e5<\/center><\/figcaption><\/figure>\n\n\n\n<p>SQL\u8bed\u8a00\u4e3b\u8981\u5206\u4e3a\uff1aDDL\u8bed\u53e5\uff0cDML\u8bed\u53e5\uff0c\u4e8b\u52a1\u63a7\u5236\u8bed\u53e5\uff0c\u4f1a\u8bdd\u63a7\u5236\u8bed\u53e5\uff0c\u7cfb\u7edf\u63a7\u5236\u8bed\u53e5\uff0c\u5d4c\u5165\u5f0fSQL\u8bed\u53e5\u3002<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>8.3 \u5e38\u7528\u7684\u6570\u636e\u7c7b\u578b\u4e0e\u89e3\u91ca<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-pale-pink-color\">Oracle\u5e38\u7528\u7684\u6570\u636e\u7c7b\u578b\uff1a\u6570\u503c\u3001\u5b57\u7b26\u4e32\u3001\u65e5\u671f\u65f6\u95f4\u3002<\/p>\n\n\n\n<p>8.3.1 \u6570\u503c\u7c7b\u578b<\/p>\n\n\n\n<p>\u6570\u503c\u7c7b\u578b\u4e3a<font color=\"#f78da7\"><strong>number[(p,s)]<\/strong><\/font>\uff0c\u4e3b\u8981\u7528\u6765<font color=\"#f78da7\"><strong>\u5b58\u50a80\u3001\u6b63\u8d1f\u5b9a\u70b9\u6570\u3001\u6b63\u8d1f\u6d6e\u70b9\u6570<\/strong><\/font>\u3002<br>\u53c2\u6570p\u4e0es\uff1ap\u4ee3\u8868\u6709\u6548\u6570\u5b57\uff0cs\u4ee3\u8868\u7cbe\u5ea6\uff0c\u5373\u5c0f\u6570\u4f4d\u6570\u3002\u8303\u56f4p\uff081\u523038\uff09\uff0cs\uff08-84\u5230127\uff09\u3002<br><strong>\u7701\u7565S\u5c31\u4ee3\u8868\u4e0d\u5305\u542b\u5c0f\u6570\u7684\u6574\u6570\u3002<\/strong>S&gt;0\uff0c\u4ee3\u8868\u7cbe\u786e\u5230\u5c0f\u6570\u70b9\u53f3\u8fb9s\u4f4d\uff0c\u5e76\u4e14\u56db\u820d\u4e94\u5165\u3002S&lt;0\u4e0e\u4e4b\u76f8\u53cd\u3002<\/p>\n\n\n\n<p>8.3.2 \u5b57\u7b26\u4e32\u7c7b\u578b\u6570\u636e<\/p>\n\n\n\n<p>\u5b57\u7b26\u4e32\u56db\u79cd\u7c7b\u578b\uff1a<br>char(n)\uff0cvarchar(n)\uff0cnchar(n)\uff0cnvarchar(n)\u3002<br>char(n)\uff1a\u7528\u4e8e\u5b58\u50a8\u56fa\u5b9a\u957f\u5ea6\u7684\u5b57\u7b26\u4e32\uff0cn\u6700\u59272000\u5b57\u8282\u3002<strong>\u5982\u679c\u6dfb\u52a0\u7684\u5b57\u7b26\u4e32\u5c0f\u4e8en\uff0c\u5219\u7528\u7a7a\u683c\u8865\u9f50\u3002<\/strong><br>varchar(n)\uff1a\u5b58\u50a8\u53ef\u53d8\u957f\u5ea6\u7684\u5b57\u7b26\u4e32\uff0c<strong>\u53c2\u6570n\u4e0d\u80fd\u7701\u7565\u3002<\/strong><br> char(n)\uff0cvarchar(n)\u4e0enchar(n)\uff0cnvarchar(n) <strong>\u533a\u522b\u5728\u4e8e\u524d\u8005\u4f7f\u7528UTF\u7f16\u7801\u540e\u8005\u4f7f\u7528\u56fd\u5bb6\u5b57\u7b26\u96c6\u3002<\/strong><\/p>\n\n\n\n<p>8.3.3 \u65e5\u671f\u65f6\u95f4\u6570\u636e\u7c7b\u578b<\/p>\n\n\n\n<p>date\u7c7b\u578b\u6570\u636e\u56fa\u5b9a\u4f7f\u7528<strong>7\u4e2a\u5b57\u8282\u5b58\u50a8\u7a7a\u95f4<\/strong>\uff0c\u5305\u62ec\u5e74\u6708\u65e5\u5c0f\u65f6\u5206\u949f\u79d2\uff0c\u7cbe\u786e\u52301\u79d2\u3002<br>\u521d\u59cb\u5316\u53c2\u6570\u7531nls_date_format\u51b3\u5b9a\u3002<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>8.4SQL\u8bed\u53e5\u793a\u4f8b<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">8.4.1 select\u547d\u4ee4<\/p>\n\n\n\n<p>\u4e00\u822c\u6765\u8bf4select\u8bed\u53e5\u4e3b\u8981\u6709\uff1a<br><font color=\"#f78da7\"><strong>select ...  from ... where ... <\/strong><\/font><br>\u6784\u6210\u3002\u5176\u4e2dselect\u5b50\u53e5\u6307\u5b9a\u67e5\u8be2\u7684\u5217\u540d\uff0cfrom\u5b50\u53e5\u6307\u5b9a\u8981\u67e5\u8be2\u7684\u8868\u540d\uff0cwhere\u5b50\u53e5\u6307\u5b9a\u67e5\u8be2\u6761\u4ef6\u3002\u4e3e\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select * from dept; \/\/\u67e5\u8be2dept\u8868\u6240\u6709\u7684\u6570\u636e\nselect ename,sal from emp; \/\/\u67e5\u8be2emp\u4e2dename\u548csal\u5217\u7684\u6570\u636e\nselect ename \"EMPLOYEE NAME\",sal salary from emp; \/\/ename\u548csal\u4f7f\u7528\u522b\u540dEMPLOYEE NAME \u548csalary\u3002\n\/\/\u6ce8\u610f\u4e0a\u53e5\u4e2d\u4f7f\u7528\u522b\u540dEMPLOYEE NAME\u65f6\u542b\u6709\u7a7a\u683c\uff0c\u9700\u8981\u4f7f\u7528\u53cc\u5f15\u53f7\"EMPLOYEE NAME\"\u52a0\u4ee5\u9650\u5236\u3002\nselect ename as \"EMPLOYEE NAME\" from emp; \/\/\u4f7f\u7528as\u5173\u952e\u5b57<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">8.4.2\u67e5\u8be2\u6761\u4ef6<\/p>\n\n\n\n<p>\u5148\u719f\u6089\u5173\u7cfb\u8fd0\u7b97\u7b26\u548c\u903b\u8f91\u8fd0\u7b97\u7b26\uff0c\u8fd9\u4e9b\u4e3b\u8981\u7528\u4e8ewhere\u5b50\u53e5\u6307\u5b9a\u6761\u4ef6\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a data-fancybox=\"gallery\"\r\n                data-caption=\"image\"\r\n                class=\"fancybox\"\r\n                href=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u8fd0\u7b97\u7b26.png\"\r\n                alt=\"image\"\r\n                title=\"image\"><img decoding=\"async\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u8fd0\u7b97\u7b26.png\" target=\"_blank\" rel=\"nofollow\" class=\"fancybox\"><\/a><figcaption><center>Oracle\u8fd0\u7b97\u7b26\u548c\u903b\u8f91\u7b26<\/center><\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u4f7f\u7528\u4e0a\u56fe\u4e2d\u7b26\u53f7\u8fdb\u884c\u67e5\u8be2\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select ename,sal from emp\nwhere deptno = 10 and sal between 2000 and 3000;\n\/\/\u67e5\u8be2emp\u8868\u4e2d10\u53f7\u90e8\u95e8\u4e2d\u5de5\u8d44(sal)\u57282000\u52303000\u4e4b\u95f4\u7684\u5458\u5de5\u7684\u540d\u79f0\u548c\u5de5\u8d44\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u4f7f\u7528order by\u5b50\u53e5\u67e5\u8be2<\/strong>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select ename\uff0csal \nfrom emp \nwhere deptho  = 20 \norder by sal asc; \n\/\/\u67e5\u8be220\u53f7\u90e8\u95e8\u4e2d\u7684\u5458\u5de5\u540d\u79f0\u548c\u5de5\u8d44\uff0c\u5e76\u4e14\u6309\u5de5\u8d44\u4ece\u4f4e\u5230\u9ad8\u6392\u5e8f\u3002\n\/\/\u540e\u63a5\u53c2\u6570asc\u8868\u793a\u4ece\u4f4e\u5230\u9ad8\uff0cdesc\u8868\u793a\u4ece\u9ad8\u5230\u4f4e\u6392\u5e8f\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">order by\u6307\u5b9a\u591a\u4e2a\u5217\u6392\u5e8f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select deptno\uff0cename\uff0csal \nfrom emp\norder by deptno\uff0csal; \n\/\/\u6307\u5b9a\u591a\u4e2a\u5217\u6392\u5e8f\uff0c\u6b64\u65f6\u6392\u5e8f\u6309\u7167deptno\u6392\u5e8f\u518d\u6309Sal\u6392\u5e8f\u3002<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"451\" height=\"660\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/order-by\u6307\u5b9a\u591a\u4e2a\u5217.jpg\" alt=\"\" class=\"wp-image-323\" srcset=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/order-by\u6307\u5b9a\u591a\u4e2a\u5217.jpg 451w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/order-by\u6307\u5b9a\u591a\u4e2a\u5217-205x300.jpg 205w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/><figcaption>\u6392\u5e8f\u7ed3\u679c<\/figcaption><\/figure><\/div>\n\n\n\n<p> <strong>\u8865\u5145\uff1a\u540e\u6587\u51fa\u73b0\u7684<font color=\"#f78da7\">distinct<\/font>\u4e5f\u662f\u6392\u5e8f\u7684\u4f5c\u7528<\/strong> <strong>\u8fd9\u4e2a\u5173\u952e\u5b57\u6765\u8fc7\u6ee4\u6389\u591a\u4f59\u7684\u91cd\u590d\u8bb0\u5f55\u53ea\u4fdd\u7559\u4e00\u6761<\/strong> \uff0c\u7136\u540e\u8fdb\u884c\u6392\u5e8f\u4ece\u9ad8\u5230\u4f4e\u3002<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>8.5 \u5e38\u7528\u6570\u503c\uff0c\u5b57\u7b26\uff0c\u65e5\u671f\u5904\u7406\u51fd\u6570<\/strong><\/p>\n\n\n\n<p>8.5.1 \u5e38\u7528\u6570\u5b57\u5904\u7406<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>abs()\u6c42\u7edd\u5bf9\u503c<\/li><li>mod()\u53d6\u6a21<\/li><li>sqrt()\u6c42\u5e73\u65b9\u6839<\/li><\/ul>\n\n\n\n<p>8.5.2 \u5b57\u7b26\u4e32\u6570\u636e\u5904\u7406<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">1\uff1a<strong>\u5b57\u7b26\u4e32\u6a21\u7cca\u67e5\u8be2\u4e0e\u67e5\u8be2\u7279\u6b8a\u5b57\u7b26<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4f7f\u7528%\u6216_\u4f5c\u4e3a\u6a21\u7cca\u5339\u914d<\/li><li><font color=\"#f78da7\">%:\u8868\u793a\u4efb\u610f\u4e2a\u4efb\u610f\u5b57\u7b26<\/font><\/li><li><font color=\"#f78da7\">_:\u8868\u793a\u4e00\u4e2a\u4efb\u610f\u5b57\u7b26<\/font><\/li><li>\u4ee3\u7801\u4e2d\u5173\u952e\u547d\u4ee4\u4e3alike<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>select ename from emp \nwhere ename like 'S%';\n\/\/\u67e5\u8be2emp\u8868\u4e2d\u4ee5S\u5f00\u5934\u7684\u5458\u5de5\u540d\u79f0\u3002\nselect dname from dept \nwhere dname like '%\\%%'\nescape '\\'; \/\/\u5b9a\u4e49\u8f6c\u4e49\u5b57\u7b26\u4e3a\\\n\/\/\u67e5\u8be2dname\u4e2d\u542b\u6709%\u7684\u540d\u79f0<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">2\uff1a<strong>\u5e38\u7528\u7684\u5b57\u7b26\u4e32\u51fd\u6570<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>||\uff1a\u5408\u5e76\u5b57\u7b26\u4e32<\/li><li>concat()\uff1a\u5b57\u7b26\u4e32\u5408\u5e76\uff0c\u5176\u4e2d\u9700\u8981\u4e24\u4e2a\u5b57\u7b26\u53c2\u6570\u3002<\/li><li>length()\uff1a\u6c42\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u9700\u8981\u4e00\u4e2a\u53c2\u6570\u3002<\/li><li>lower()\/upper()\uff1a\u628a\u5b57\u7b26\u4e32\u8f6c\u5316\u4e3a\u5c0f\u5199\/\u5927\u5199\uff0c\u9700\u8981\u4e00\u4e2a\u5b57\u7b26\u53c2\u6570\u3002<\/li><li>lpad()\/rpad()\uff1a\u5728\u5b57\u7b26\u4e32\u7684\u5de6\/\u53f3\u4fa7\u9644\u52a0\u6307\u5b9a\u5b57\u7b26\uff0c\u9700\u8981\u4e09\u4e2a\u53c2\u6570\u3002<\/li><li>replace()\uff1a\u7528\u4e00\u4e2a\u5b50\u4e32\u4ee3\u66ff\u5b57\u7b26\u4e32\u4e2d\u7684\u6307\u5b9a\u90e8\u5206\uff0c\u4e09\u4e2a\u53c2\u6570\u3002<\/li><li>substr()\uff1a\u83b7\u53d6\u5b50\u4e32\uff0c\u622a\u53d6\u539f\u6709\u5b57\u7b26\u4e32\u4e2d\u90e8\u5206\u5b50\u4e32\uff0c\u9700\u8981\u4e09\u4e2a\u53c2\u6570\u3002<\/li><li>trim()\uff1a\u53bb\u9664\u5b57\u7b26\u4e32\u4e24\u7aef\u7684\u7a7a\u683c\u6216\u6307\u5b9a\u5b57\u7b26\uff0c\u9700\u8981\u4e00\u4e2a\u53c2\u6570<\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-pale-pink-color\"><strong>\u4ee3\u7801\u6f14\u793a<\/strong>\uff1a||\uff0clpad\uff0creplace<\/p>\n\n\n\n<figure class=\"wp-block-gallery aligncenter columns-2 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"565\" height=\"343\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u62fc\u63a5\u5b57\u7b26\u4e32\u6f14\u793a.png\" alt=\"\" data-id=\"326\" class=\"wp-image-326\" srcset=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u62fc\u63a5\u5b57\u7b26\u4e32\u6f14\u793a.png 565w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u62fc\u63a5\u5b57\u7b26\u4e32\u6f14\u793a-300x182.png 300w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><figcaption class=\"blocks-gallery-item__caption\">||\u62fc\u63a5\u5b57\u7b26\u4e32<\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"505\" height=\"398\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u6dfb\u52a0\u5b57\u7b26\u4e32\u6f14\u793a.png\" alt=\"\" data-id=\"327\" data-full-url=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u6dfb\u52a0\u5b57\u7b26\u4e32\u6f14\u793a.png\" data-link=\"https:\/\/www.overwatchss.club\/2019\/11\/13\/%e6%95%b0%e6%8d%ae%e5%ba%93%e8%80%83%e8%af%95%e7%9f%a5%e8%af%86%e7%82%b9%e6%b1%87%e6%80%bb\/oracle%e6%b7%bb%e5%8a%a0%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%bc%94%e7%a4%ba\/\" class=\"wp-image-327\" srcset=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u6dfb\u52a0\u5b57\u7b26\u4e32\u6f14\u793a.png 505w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u6dfb\u52a0\u5b57\u7b26\u4e32\u6f14\u793a-300x236.png 300w\" sizes=\"auto, (max-width: 505px) 100vw, 505px\" \/><figcaption class=\"blocks-gallery-item__caption\">\u4f5c\u7528\u5728\u5b57\u7b26\u4e32\u5de6\u4fa7\u6dfb\u52a0#\u53f7\u76f4\u5230\u957f\u5ea6\u4e3a10<\/figcaption><\/figure><\/li><\/ul><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"478\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u66ff\u6362\u5b57\u7b26\u4e32\u6f14\u793a-1024x478.png\" alt=\"\" class=\"wp-image-328\" srcset=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u66ff\u6362\u5b57\u7b26\u4e32\u6f14\u793a-1024x478.png 1024w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u66ff\u6362\u5b57\u7b26\u4e32\u6f14\u793a-300x140.png 300w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u66ff\u6362\u5b57\u7b26\u4e32\u6f14\u793a-768x359.png 768w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oracle\u66ff\u6362\u5b57\u7b26\u4e32\u6f14\u793a.png 1191w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>\u66ff\u6362\u5b57\u7b26\u4e32\u6f14\u793a<\/figcaption><\/figure>\n\n\n\n<p>\u4e0a\u9762replace\u51fd\u6570\u4e09\u4e2a\u53c2\u6570\u5206\u522b\u662f\uff1a\u9009\u62e9\u5b57\u7b26\u4e32\u5e38\u91cf\uff0c\u539f\u6709\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\uff0c\u66ff\u6362\u540e\u7684\u65b0\u5b57\u7b26\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">3\uff1a<strong>\u5e38\u7528\u7684\u65e5\u671f\u5904\u7406\u51fd\u6570\uff1a<\/strong><\/p>\n\n\n\n<p>\u83b7\u53d6\u5f53\u524d\u65e5\u671f\u65f6\u95f4\uff1aselect sysdate from dual;<br><strong><font color=\"#f78da7\">to_char()\u51fd\u6570<\/font><\/strong>\uff1a\u628a\u65e5\u671f\u7c7b\u578b\u8f6c\u5316\u4e3a\u6307\u5b9a\u683c\u5f0f\u5b57\u7b26\u4e32\u3002<br><strong><font color=\"#f78da7\">to_date()\u51fd\u6570<\/font><\/strong>\uff1a\u5305\u542b\u4e24\u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u8868\u793a\u65e5\u671f\u7684\u5b57\u7b26\u4e32\u5e38\u91cf\uff0c\u7b2c\u4e8c\u4e2a\u662f\u683c\u5f0f\u7801\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select ename from emp\nwhere hiredate = to_date('1981-02-20','yyyy-mm-dd');\n\/\/\u67e5\u8be2ename\u5217\u4e2d\u65e5\u671f\u6ee1\u8db31981-02-20\u7684\u4eba\u7684\u540d\u5b57<\/code><\/pre>\n\n\n\n<p><strong><font color=\"#f78da7\">extract()\u51fd\u6570<\/font><\/strong>\uff1a\u62bd\u53d6\u65e5\u671f\u4e2d\u7684\u6307\u5b9a\u90e8\u5206\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select ename from emp\nwhere extract(year\/month\/day\/hour\/minute\/second\/ from hiredate) = 1980;\n\/\/\u67e5\u8be2emp\u8868\u4e2d\u6240\u67091980\u5e74\u7684\u5458\u5de5\u540d\u79f0,\u5e74\u4e5f\u53ef\u4ee5\u6362\u6210\u5176\u4ed6\u65f6\u95f4\u53c2\u6570\u3002<\/code><\/pre>\n\n\n\n<p>\u83b7\u53d6\u65f6\u95f4\u5dee\u7684\u529e\u6cd5\uff1a1\uff0cdate'1980-02-20' - date'1980-02-18' ; 2\uff0cround()\u51fd\u6570\u3002round()\u51fd\u6570\u89e3\u6790\uff0c\u5148define\u4e24\u4e2a\u65f6\u95f4\u53c2\u6570\uff1a<\/p>\n\n\n\n<p>define startdate = \"to_date('2013-08-10 15:30:25','yyyy-mm-dd hh24:mi:ss')\";<br> define enddate = \"to_date('2013-09-15 12:30:25','yyyy-mm-dd hh24:mi:ss')\"; <\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u89e3\u91ca\uff1adefine\u5173\u952e\u5b57\uff0c\u7528\u6765\u5b9a\u4e49\u4e86\u4e24\u4e2adate\u53c2\u6570\u7684\u503c\uff0c\u5176\u4e2dhh24\u4ee3\u886824\u5c0f\u65f6\u5236\uff0c\u5728\u5f15\u7528date\u53c2\u6570\u65f6\uff0c\u9700\u8981\u4f7f\u7528&amp;enddate\u8fd9\u79cd\u5f62\u5f0f\u3002<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u76f8\u5dee\u5929\u6570\uff1around(&amp;enddate-&amp;startdate)<\/li><li>\u76f8\u5dee\u5c0f\u65f6\u6570\uff1a round(round(&amp;enddate-&amp;startdate)*24)<\/li><li>\u76f8\u5dee\u5206\u949f\u6570\uff1around( roud(&amp;enddate-&amp;startdate) *24*60)<\/li><li>\u76f8\u5dee\u79d2\u6570\uff1a  round( roud(&amp;enddate-&amp;startdate) *24*60*60) <\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-pale-pink-color\">\u9488\u5bf9\u4e24\u4e2adefine\u5b9a\u4e49\u7684\u65f6\u95f4\u5dee\u6307\u8ba1\u7b97\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select round((&amp;enddate-&amp;startdate)*24) as hours from dual;\n\/\/\u8ba1\u7b97\u4e86\u4e24\u4e2adate\u4e4b\u95f4\u7684\u5dee\u4e86\u591a\u5c11\u5929\u5e76\u4e14\u7528\u66ff\u4ee3\u540dhours\u663e\u793a\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-text-align-left has-vivid-red-color\">4\uff1a<strong>\u7a7a\u503c\u7684\u5904\u7406<\/strong>\uff1a<\/p>\n\n\n\n<p><strong>Oracle\u9047\u5230null\u503c\u7684\u5224\u5b9a\u7684\u65f6\u5019\u53ea\u80fd\u4f7f\u7528is null\u548cis not null\u5224\u65ad\uff0c\u4e0d\u80fd\u4f7f\u7528=\u4e0e&lt;\u7b49\u5224\u5b9a\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select ename from emp \nwhere comm is null;\n\/\/\u67e5\u8be2emp\u8868\u4e2d\uff0ccomm\u5217\u4e3a\u7a7a\u7684\u5458\u5de5\u540d\u79f0\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">5\uff1a<strong>\u5206\u7ec4\u6c47\u603b\u67e5\u8be2<\/strong>\uff1a<\/p>\n\n\n\n<p><strong><font color=\"#f78da7\">\u6c47\u603b\u51fd\u6570\u4e5f\u79f0\u4e3a\u5206\u7ec4\u51fd\u6570<\/font><\/strong>\uff0c\u4e3b\u8981\u7528\u6237\u67e5\u8be2\u6307\u5b9a\u5217\u7684\u6700\u5927\u503c\u3001\u6700\u5c0f\u503c\u3001\u5e73\u5747\u503c\u3001\u603b\u548c\u53ca\u975e\u7a7a\u5217\u503c\u6570\uff0c<strong><font color=\"#f78da7\">\u51fd\u6570\u5206\u522b\u79f0\u4e3amax\u3001min\u3001avg\u3001sum\u3001\u53cacount<\/font><\/strong>\u3002\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select max(sal) from emp; \/\/\u67e5\u8be2emp\u8868\u4e2dsal\u5217\u7684\u6700\u5927\u503c\nselect min(sal) from emp; \/\/\u67e5\u8be2emp\u8868\u4e2dsal\u5217\u7684\u6700\u5c0f\u503c\nselect avg(sal) from emp; \/\/\u67e5\u8be2emp\u8868\u4e2dsal\u5217\u7684\u5e73\u5747\u503c\nselect sum(sal) from emp; \/\/\u67e5\u8be2emp\u8868\u4e2dsal\u5217\u7684\u603b\u548c\nselect count(comm) from emp; \/\/\u67e5\u8be2emp\u8868\u4e2dcomm\u5217\u7684\u975e\u7a7a\u503c\u4e2a\u6570<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-text-align-left has-vivid-red-color\"><strong>\u6ce8\u610f\uff01\u4f7f\u7528\u5206\u7ec4\u51fd\u6570\u4e00\u5b9a\u8981\u4e0egroup by\u4e00\u8d77\u4f7f\u7528\uff01\uff01<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>8.6\u5176\u4ed6\u5b50\u53e5\u7684\u4f7f\u7528<\/strong><\/p>\n\n\n\n<p>8.6.1group by\u5b50\u53e5\u4f7f\u7528<\/p>\n\n\n\n<p><strong>group by\u6309\u7167\u6307\u5b9a\u5217\u7684\u4e0d\u540c\u503c\u5206\u7ec4\u540e\uff0c\u518d\u67e5\u8be2\u5176\u4ed6\u6307\u5b9a\u5217\u7684\u6c47\u603b\u503c\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select deptno,sum(sal) from emp\ngroup by deptno;\n\/\/\u67e5\u8be2emp\u8868\u4e2d\u6bcf\u4e2a\u90e8\u95e8\u7684sal\u603b\u548c\uff0c\u4ee5deptno\u5217\u5206\u7ec4<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"522\" height=\"229\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oralce-group-by\u5b50\u53e5.png\" alt=\"\" class=\"wp-image-333\" srcset=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oralce-group-by\u5b50\u53e5.png 522w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oralce-group-by\u5b50\u53e5-300x132.png 300w\" sizes=\"auto, (max-width: 522px) 100vw, 522px\" \/><figcaption>\u4ee3\u7801\u8fd0\u884c\u7ed3\u679c<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"has-text-color has-luminous-vivid-orange-color\"><strong>\u5728select\u5b50\u53e5\u4e2d\u51fa\u73b0\uff0c\u5e76\u4e14\u672a\u88ab\u5206\u7ec4\u51fd\u6570\u4f5c\u7528\u7684\u5217\u90fd\u8981\u5728group by\u5b50\u53e5\u4e2d\u51fa\u73b0\uff0c\u5426\u5219\u4f1a\u62a5\u9519\uff01\uff01<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"599\" height=\"173\" src=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oralce-group-by\u5b50\u53e5\u9519\u8bef.png\" alt=\"\" class=\"wp-image-334\" srcset=\"https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oralce-group-by\u5b50\u53e5\u9519\u8bef.png 599w, https:\/\/www.overwatchss.club\/wp-content\/uploads\/2019\/11\/oralce-group-by\u5b50\u53e5\u9519\u8bef-300x87.png 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><figcaption>group by\u5b50\u53e5\u4e2d\u53ea\u542b\u6709ename\u5bfc\u81f4\u62a5\u9519<\/figcaption><\/figure><\/div>\n\n\n\n<p>8.6.2 having\u5b50\u53e5<\/p>\n\n\n\n<p>where\u5b50\u53e5\u5728\u5206\u7ec4\u524d\u5bf9\u8bb0\u5f55\u8fdb\u884c\u8fc7\u6ee4\uff0c<strong>\u5982\u679c\u8981\u5bf9\u5206\u7ec4\u4e4b\u540e\u7684\u7ed3\u679c\u8fc7\u6ee4\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528having\u5b50\u53e5\u9644\u52a0\u6761\u4ef6\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select deptno,sum(sal) from emp\ngroup by deptno\nhaving sum(sal)>7000;\n\/\/\u67e5\u8be2emp\u8868\u4e2dsal\u603b\u548c\u8d85\u8fc77000\u7684deptno\uff08\u90e8\u95e8\u7f16\u53f7\uff09\u548c\u5de5\u8d44\u603b\u989d\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-luminous-vivid-orange-color\">\u2b50<strong>\u5982\u679chaving\u5b50\u53e5\u4e2d\u7684\u5217\u4e0d\u542b\u5206\u7ec4\u51fd\u6570\uff0c\u5219\u6b64\u5217\u8981\u9884\u5148\u5728group by\u5b50\u53e5\u4e2d\u51fa\u73b0\u3002<\/strong>\uff08\u540c\u65f6\u6ce8\u610f\u524d\u9762select\u548cgroup by\u5b50\u53e5\u7684\u4f7f\u7528\u6ce8\u610f\uff09<\/p>\n\n\n\n<p>8.6.3 in\u4e0enot in<\/p>\n\n\n\n<p>\u7528\u4e8e<strong>\u5224\u65ad\u4e00\u4e2a\u5b50\u67e5\u8be2\u7ed3\u679c\u4e2d\u662f\u5426\u51fa\u73b0\u4e86\u67d0\u4e2a\u8868\u7684\u5217\u503c<\/strong>\uff0c\u53ef\u4ee5\u770b\u4f5c\u5143\u7d20\u4e0e\u96c6\u5408\u7684\u5173\u7cfb\u3002\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select dname from dept\nwhere deptno not in \n(select distinct deptno from emp); \/\/distinct\u51fd\u6570\uff0c\u6392\u5e8f\u4ece\u9ad8\u5230\u4f4e\uff0c\u6392\u9664\u91cd\u590d\u7684\u9009\u9879\n\/\/\u67e5\u8be2dname\u540d\u79f0\u4ecedept\u8868\u4e2d\uff0c\u8981\u6c42dname\u6ee1\u8db3\u5176\u5bf9\u5e94\u7684deptno\u4e0d\u5728emp\u7684deptno\u5217\u503c\u4e2d\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-luminous-vivid-orange-color\">not in\u4e0ein\u4e0d\u80fd\u7528\u6765\u68c0\u6d4b\u5b50\u67e5\u8be2\u7ed3\u679c\u4e2d\u542b\u6709null\u503c\uff0c\u9700\u8981\u63d0\u524d\u5bf9\u5b50\u67e5\u8be2\u7ed3\u679c\u6392\u9664null\u503c\u5426\u5219\u4f1a\u51fa\u73b0\u610f\u5916\u60c5\u51b5\u3002\u5177\u4f53\u793a\u4f8b\u53c2\u7167\u8bfe\u672cP94\u3002<\/p>\n\n\n\n<p>8.6.4 exists\u4e0enot exists<\/p>\n\n\n\n<p>\u5b83\u4eec\u7684\u4f5c\u7528\u4e0ein\u548cnot in\u76f8\u4f3c\uff0c\u4f46\u662fexists\u66f4\u6709<strong>\u5b58\u5728<\/strong>\u7684\u542b\u4e49\uff0c<strong>\u8fd9\u4e24\u4e2a\u5b50\u53e5\u4e00\u822c\u4f7f\u7528\u76f8\u5173\u5b50\u67e5\u8be2\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select dname from dept\nwhere exists(select deptno from emp where deptno = dept.deptno);\n\/\/where deptno = dept.deptno\u7b2c\u4e00\u4e2adeptno\u662femp\u8868\u4e2d\u7684\uff0c\u7b2c\u4e8c\u4e2a\u662fdept\u8868\u4e2d\u7684\u3002\u7ed3\u679c\u9650\u5b9adeptno\u6ee1\u8db3\u4e24\u8868\u7684deptno\u76f8\u7b49\u3002\n\/\/\u8fd9\u6bb5\u8bed\u53e5\u4f5c\u7528\uff1a\u4f7f\u7528exists\u67e5\u8be2\u6709\u5458\u5de5\u7684\u90e8\u95e8\u540d\u79f0\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-luminous-vivid-orange-color\"> not exists\u4e0eexists\u80fd\u7528\u6765\u68c0\u6d4b\u5b50\u67e5\u8be2\u7ed3\u679c\u4e2d\u542b\u6709null\u503c\uff01<\/p>\n\n\n\n<p><strong>8.6.5\u4f7f\u7528\u8868\u522b\u540d<\/strong><\/p>\n\n\n\n<p>\u4f7f\u7528\u8868\u522b\u540d\u5f15\u7528\u5404\u81ea\u7684\u5217\uff0c\u6709\u66f4\u597d\u7684\u53ef\u8bfb\u6027\u3002\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>select e.ename,e.deptno,d.* \nfrom emp e,dept d \/\/\u8868\u522b\u540d\u4f7f\u7528\nwhere e.deptno = d.deptno;\n\/\/emp\u4e0edept\u5206\u522b\u4f7f\u7528\u522b\u540de\u548cd\uff0c\u7136\u540e\u67e5\u8be2ename\uff0cdeptno\uff0cdept\u8868\u4e2d\u6ee1\u8db3emp\u4e0edept\u8868deptno\u76f8\u7b49\u7684\u4fe1\u606f\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>8.7 \u6570\u636e\u4fee\u6539\u8bed\u53e5<\/strong><\/p>\n\n\n\n<p>8.7.1 delete\u8bed\u53e5<\/p>\n\n\n\n<p><strong>delete\u7528\u4e8e\u5220\u9664\u8868\u4e2d\u7684\u8bb0\u5f55\uff08\u4e0etruncate\u533a\u5206\uff09\uff0c\u4e00\u822c\u4f1a\u9644\u52a0where\u5b50\u53e5\u9650\u5b9a\u5220\u9664\u8bb0\u5f55\u7684\u8303\u56f4\uff0c\u4e0d\u9644\u52a0where\u5219\u5220\u9664\u6574\u4e2a\u8868\u7684\u6570\u636e\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>delete from emp; \/\/\u6e05\u9664emp\u8868\u4e2d\u7684\u6570\u636e\ndelete from emp where deptno = 10; \/\/\u5220\u9664emp\u8868\u4e2ddeptno=10\u7684\u90e8\u95e8\u8bb0\u5f55<\/code><\/pre>\n\n\n\n<p>8.7.2 update\u8bed\u53e5<\/p>\n\n\n\n<p><strong>update\u7528\u4e8e\u4fee\u6539\u8868\u4e2d\u8bb0\u5f55\u7684\u5217\u503c\uff0c\u4e00\u822c\u4f1a\u9644\u52a0where\u5b50\u53e5\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>update emp set sal = 2000,comm = 1200 where deptno = 20;\n\/\/\u4fee\u6539emp\u7684deptno\u768420\u90e8\u95e8\u4e2d\u7684sal\u4e0ecomm\u5217\u503c\u3002<\/code><\/pre>\n\n\n\n<p>8.7.3 insert\u8bed\u53e5<\/p>\n\n\n\n<p><strong>insert\u8bed\u53e5\u7528\u4e8e\u5411\u8868\u4e2d\u6dfb\u52a0\u8bb0\u5f55\uff0c\u4e5f\u5c31\u662f\u6dfb\u52a0\u884c\u503c\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u7b2c\u4e00\u79cd\u65b9\u5f0f\ninsert into dept(deptno,dname)\nvalues(50,'HR');\n\/\/\u5bf9dept\u8868\u589e\u52a0\u4e00\u884c\u8bb0\u5f55\uff0c\u5bf9deptno\u4e0edname\u589e\u52a0\u4e00\u884c50\uff0cHR\u503c\uff0c\u7b2c\u4e09\u4e2a\u5217\u672a\u51fa\u73b0\u5219\u4e3anull\u3002\n\n\/\/\u7b2c\u4e8c\u79cd\u65b9\u5f0f\ninsert into dept values(60.'RD',null);\n\/\/\u5bf9dept\u589e\u52a0\u4e00\u884c\u503c\u5bf9\u5e94\u7684\u5217\u503c\u5206\u522b\u4e3a60\uff0cRD\uff0cnull<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>8.7.4\u6784\u9020\u590d\u6742\u7684update\u8bed\u53e5<\/strong>\uff0c\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u628aemp\u8868\u4e2d\u5de5\u8d44\u8d85\u8fc7\u5176\u7ecf\u7406\u7684\u5458\u5de5\u5de5\u8d44\u964d\u4f4e1000\nupdate emp set sal=sal-1000 \/\/\u66f4\u65b0sal\u503c\uff0c\u5728\u539f\u6709\u57fa\u7840\u51cf\u53bb1000\nwhere empno in \/\/\u8981\u6c42\u66f4\u6539\u7684sal\u5bf9\u5e94\u7684empno\u6ee1\u8db3\u5728\u4e0b\u9762\u7684\u5458\u5de5\u5217\u4e2d\n(\n      select e.empno \/\/\u627e\u51faempno\uff0ce\u548cm\u4e3aemp\u8868\u522b\u540d\n      from emp e,emp m \/\/\u4eceemp\u8868\u4e2d\u627e\u51fa\n      where e.mgr = m.empno \/\/where\u5b50\u53e5\u8981\u6c42\u6ee1\u8db3mgr\u7b49\u4e8eempno\u5e76\u4e14\u540c\u65f6\u6ee1\u8db3\u5458\u5de5sal\u5927\u4e8e\u7ecf\u7406sal\n      and e.sal > m.sal\n);<\/code><\/pre>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>8.8\u521b\u5efa\u8868\uff0c\u7ea6\u675f\uff0c\u6dfb\u52a0\u4e0e\u4fee\u6539\u5217<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">8.8.1 \u521b\u5efa\u8868\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create table t(a int,b char(15))\ntablesapce tbs;\n\/\/\u521b\u5efa\u4e00\u4e2a\u8868t\u5176\u4e2d\u542b\u6709\u4e24\u5217\u5206\u522b\u662fint a\u548c15\u5b57\u7b26\u957f\u5ea6\u7684b\n\/\/\u6307\u5b9a\u8868\u7a7a\u95f4\u4e3atbs<\/code><\/pre>\n\n\n\n<p>8.8.2\u5bf9\u5217\u6216\u8005\u8868\u6dfb\u52a0\u7ea6\u675f<\/p>\n\n\n\n<p>\u7ea6\u675f\u79cd\u7c7b\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4e3b\u952e\u7ea6\u675f\uff1a\u5217\u503c\u4e0d\u80fd\u4e3a\u7a7a\u4e5f\u4e0d\u80fd\u91cd\u590d<\/li><li>\u552f\u4e00\u7ea6\u675f\uff1a\u5217\u4e0a\u7684\u503c\u4e0d\u80fd\u91cd\u590d<\/li><li>\u5916\u952e\u7ea6\u675f\uff1a\u5217\u503c\u8981\u5339\u914d\u4e0e\u5176\u6307\u5411\u4e3b\u8868\u7684\u76f8\u5e94\u5217\u503c<\/li><li>\u68c0\u67e5\u7ea6\u675f\uff1a\u7ed9\u5217\u7684\u53d6\u503c\u8303\u56f4\u9644\u52a0\u9650\u5236<\/li><li>\u975e\u7a7a\u7ea6\u675f\uff1a\u5217\u4e0a\u7684\u503c\u4e0d\u80fd\u4e3a\u7a7a\u3002\u53ea\u80fd\u9644\u52a0\u5728\u5217\u7ea7<\/li><li>\u9ed8\u8ba4\u7ea6\u675f\uff1a\u5982\u679c\u67d0\u4e9b\u5217\u672a\u8d4b\u503c\uff0c\u53d6\u9ed8\u8ba4\u7ea6\u675f\u4e2d\u6240\u6307\u5b9a\u7684\u503c\u3002<\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u8868<strong>\u7684\u7ea6\u675f\u4e3b\u8981\u5206\u4e3a\uff1a\u5217\u7ea7\u7ea6\u675f\u4e0e\u8868\u7ea7\u7ea6\u675f\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create table t\n(     a int primary key, \/\/\u5217\u7ea7\u7ea6\u675f\uff0c\u672a\u6307\u5b9a\u7ea6\u675f\u540d\u79f0\n      b int constraint pk_test primary key \/\/\u5217\u7ea7\u7ea6\u675f\u6307\u5b9a\u540d\u79f0\n      \/\/constraint &lt;\u7ea6\u675f\u540d> primary key\uff08\u4e3b\u952e\u542b\u4e49\uff09\n);\n\ncreate table t1\n(    a int,\n     b int,\n     primary key(a) \/\/\u8868\u7ea7\u7ea6\u675f\uff0c\u672a\u6307\u5b9a\u540d\u79f0\n     \/\/constraint pk_test primary key(a) \u8868\u7ea7\u7ea6\u675f\u6307\u5b9a\u5217\u540d\u79f0\n     \/\/constraint &lt;\u7ea6\u675f\u540d> primary key\uff08\u4e3b\u952e\u542b\u4e49\uff09 &lt;>\u5217\u540d\n);<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>8.8.3 \u4fee\u6539\u8868\u7684\u7ed3\u6784<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u4fee\u6539\u5217\u6570\u636e\u7c7b\u578b\nalter table dept modify dname vatchar2(20);\n\/\/\u4fee\u6539dept\u8868\u4e2ddname\u7684\u6570\u636e\u7c7b\u578b\u672avarchar(20)\nalter table dept modify (dname vatchar2(20),loc varchar2(20)); \/\/\u4fee\u6539\u591a\u4e2a\n\n\/\/\u6dfb\u52a0\u53ca\u5220\u9664\u5217\n\/\/\u6dfb\u52a0\u5217\uff1aalter table \u8868\u540d add \u5217\u540d \u6570\u636e\u7c7b\u578b\n\/\/\u5220\u9664\u5217\uff1aalter table \u8868\u540d drop column \u5217\u540d \nalter table dept add phone_number char(12); \/\/\u5bf9dept\u8868\u6dfb\u52a0\u5217phone\u6570\u636e\u7c7b\u578bchar(12)\nalter table dept drop column phone_number; \/\/\u5220\u9664dept\u4e2d\u7684phone\u5217\n\n\/\/\u4fee\u6539\u5217\u540d\n\/\/\u5f62\u5f0f\uff1aalter table \u8868\u540d rename column \u65e7\u5217\u540d to \u65b0\u5217\u540d\nalter table dept rename column loc to location\n\n\/\/\u4fee\u6539\u8868\u540d\n\/\/\u5f62\u5f0f\uff1aalter table \u8868\u540d rename to \u65b0\u8868\u540d\nalter table dept rename to dept1;\n\n\/\/\u6e05\u7a7a\u8868\uff1atruncate table \u8868\u540d\ntruncate table emp; \/\/\u6e05\u7a7aemp\u8868\n\n\/\/\u5220\u9664\u8868\ndrop table emp; \/\/\u5220\u9664emp\u8868<\/code><\/pre>\n\n\n\n<p><strong>truncate\u4e0edelete\u76f8\u6bd4\uff0c\u9996\u5148\u6267\u884c\u540e\u4e0d\u80fd\u4f7f\u7528rollback\u64a4\u56de\u56e0\u4e3a\u5b83\u662fddl\u8bed\u53e5\uff0c\u5176\u6b21\u5b83\u662f\u901a\u8fc7\u91ca\u653e\u8868\u5360\u7528\u7684\u7a7a\u95f4\u5220\u9664\u6570\u636e\u3002<\/strong><\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"> <strong>\u56db\u3001\u5b58\u50a8\u7ed3\u6784:\u6570\u636e\u5e93\u6587\u4ef6\u4e0e\u8868\u7a7a\u95f4<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>9.1 \u8868\u7a7a\u95f4<\/strong><\/p>\n\n\n\n<p>9.1.1 <br>\u5b9a\u4e49\uff1a<strong><font color=\"#f78da7\">\u8868\u7a7a\u95f4\u53ef\u4ee5\u770b\u9519\u662f\u653e\u7f6e\u8868\u7684\u5bb9\u5668\u3002\u8868\u7a7a\u95f4\u7531\u4e00\u4e2a\u6216\u8005\u591a\u4e2a\u6570\u636e\u6587\u4ef6\u6784\u6210<\/font>\u3002<\/strong><br>\u521b\u5efa\u8868\u53ef\u4ee5\u6307\u5b9a\u8868\u7a7a\u95f4\uff0c\u4ece\u800c\u628a\u8868\u7684\u6570\u636e\u5b58\u50a8\u4e0e\u6307\u5b9a\u7684\u6570\u636e\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>9.1.2<br>\u521b\u5efa\u8868\u7a7a\u95f4\uff0c\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>create tablespace tbs\ndatefile '\/home\/oracle\/tbs01.dbf' size 20m,\n           '\/home\/oracle\/tbs02.dbf' size 30m\n             autoextend on next 5m makesize 3G;\n\/\/\u521b\u5efa\u8868\u7a7a\u95f4tbs \u5305\u542b\u4e86\u4e24\u4e2a\u6570\u636e\u6587\u4ef6\uff0c\u7a7a\u95f4\u5206\u914d\u65b9\u5f0f\u81ea\u52a8\u3002\n\/\/\u5176\u4e2d\u7b2c\u4e8c\u4e2a\u6587\u4ef6\u5927\u5c0f30m \u81ea\u52a8\u589e\u957f\uff0c\u6bcf\u6b21\u589e\u957f5m\uff0c\u6700\u59273GB<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">9.1.3 <br><strong>\u8868\u7684\u6570\u636e\u5b58\u653e\u4e8e\u591a\u4e2a\u6587\u4ef6\u7684\u539f\u56e0<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u591a\u4e2a\u6570\u636e\u6587\u4ef6\u5206\u5e03\u4e0e\u4e0d\u540c\u78c1\u76d8\uff0c\u53ef\u4ee5\u5b9e\u73b0\u6570\u636e\u5e76\u884c\u8bfb\u5199<\/li><li>\u6267\u884c\u5907\u4efd\u6062\u590d\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5bf9\u5404\u4e2a\u6587\u4ef6\u5206\u6279\u5206\u671f\u8fdb\u884c<\/li><li>\u53ef\u4ee5\u6839\u636e\u6570\u6587\u4ef6\u4e2d\u7684\u6570\u636e\u91cd\u8981\u6027\uff0c\u53ea\u5907\u4efd\u90e8\u5206\u6587\u4ef6<\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>9.1.4<br>\u8868\u7a7a\u95f4\u7684\u7c7b\u578b\u548c\u529f\u80fd<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-pale-pink-color\">\u8868\u7a7a\u95f4\u7c7b\u578b\uff1a\u7cfb\u7edf\u8868\u7a7a\u95f4\uff0cundo\u8868\u7a7a\u95f4\uff0c\u4e34\u65f6\u8868\u7a7a\u95f4\uff0c\u7528\u6237\u8868\u7a7a\u95f4\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-pale-pink-color\">\u6bcf\u4e2a\u8868\u7a7a\u95f4\u529f\u80fd\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u7cfb\u7edf\u8868\u7a7a\u95f4\uff1a<strong>\u5b58\u653eOracle\u6b63\u5e38\u8fd0\u884c\u6240\u9700\u8981\u7684\u7cfb\u7edf\u6570\u636e\uff0c\u5305\u62ecsystem\u548csysaux\u8868\u7a7a\u95f4<\/strong>\uff0c\u5176\u540d\u79f0\u4e0d\u80fd\u6539\u53d8\uff0c\u4e5f\u4e0d\u80fd\u5220\u9664\u3002<\/li><li>undo\u8868\u7a7a\u95f4\uff1a\u7528\u4e8e<strong>\u4fdd\u5b58\u6570\u636e\u5e93\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684undo\u6570\u636e<\/strong>\uff0c\u5b9e\u73b0\u5bf9data\u591a\u7248\u672c\u8bfb\u53d6\u548c\u6570\u636e\u5e93\u5d29\u6e83\u65f6data recovery\u3002undo\u53ef\u4ee5\u6709\u591a\u4e2a\u3002<strong>\u5982\u679c\u6ca1\u521b\u5efaundo\u8868\u7a7a\u95f4\uff0c\u5219ubdo\u6570\u636e\u653e\u5165system\u8868\u7a7a\u95f4\u3002<\/strong><\/li><li>\u4e34\u65f6\u8868\u7a7a\u95f4\uff1a<strong>\u7528\u4e8e\u5b58\u653e\u4e34\u65f6\u6570\u636e<\/strong>\u3002\u5982\u679c\u5185\u5b58\u6392\u5e8f\u533a\u6216\u8005\u6563\u5217\u533a\u7a7a\u95f4\u4e0d\u591f\uff0c\u5219\u628a\u4e2d\u95f4\u7684\u4e34\u65f6\u5904\u7406\u7ed3\u679c\u653e\u5165\u6b64\u3002<\/li><li>\u7528\u6237\u8868\u7a7a\u95f4\uff1a\u5b58\u653e\u7528\u6237\u6570\u636e\uff0c<strong>\u6570\u636e\u5e93\u4e2d\u7684\u8868\u7a7a\u95f4\u4e3b\u8981\u5c31\u662f\u8fd9\u79cd\u8868\u7a7a\u95f4\u3002<\/strong><\/li><\/ul>\n\n\n\n<p>\u8868\u7a7a\u95f4\u4e2d\u7684\u6570\u636e\u5b58\u5728\u6709\u6548\u65f6\u95f4\uff1apermanent(\u6c38\u4e45)\uff0ctemporary(\u4e34\u65f6)\uff0cundo(undo)\u6570\u636e<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>9.2 Oracle\u5b58\u50a8\u7a7a\u95f4\u5206\u914d<\/strong><\/p>\n\n\n\n<p>9.3.1 \u6570\u636e\u5757\u3001\u6bb5\u548c\u533a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u6570\u636e\u5757\uff1a<strong>oracle\u6700\u5c0f\u7684\u903b\u8f91\u5b58\u50a8\u5355\u4f4d\u3002<\/strong> <font color=\"#f78da7\">\u5757\u7684\u5927\u5c0f\u9ed8\u8ba4\u4e3a8kb<\/font>\uff0cblcoksize\u53ef\u4ee5\u6307\u5b9a\u5757\u5927\u5c0f\u3002<\/li><li>\u533a\uff1a\u6570\u636e\u5757\u7684<strong>\u4e0b\u4e00\u5c42\u903b\u8f91\u5b58\u50a8\u5355\u5143<\/strong>\uff0c\u4f7f\u7528\u4f4d\u56fe\u65b9\u5f0f\u7ba1\u7406\uff0c\u4f4d\u56fe\u6570\u636e\u5b58\u4e8e\u6570\u636e\u6587\u4ef6\u5934\u90e8\u3002\u4f4d\u56fe\u4e2d\u6bcf\u4e2a\u4f4d\u5bf9\u5e94\u4e00\u4e2a\u533a\u662f\u5426\u5206\u914d\uff0c0\u6ca1\u6709\uff0c1\u5206\u914d\u3002 <\/li><li>\u6bb5\uff1a<strong>\u6700\u540e\u4e00\u4e2a\u5c42\u6b21<\/strong>\uff0c<strong>\u6bcf\u4e2a\u6bb5\u4f4d\u4e8e\u540c\u4e00\u4e2a\u8868\u7a7a\u95f4\uff0c\u7531\u82e5\u5404\u5e72\u533a\u6784\u6210\u3002<\/strong>\uff0c\u6bb5\u4e2d\u7684\u591a\u4e2a\u533a\u4e0d\u4e00\u5b9a\u7269\u7406\u4e0a\u8fde\u7eed<\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u5982\u679c\u6bb5\u6240\u5728\u7684\u8868\u7a7a\u95f4\u7531\u591a\u4e2a\u6570\u636e\u6587\u4ef6\u6784\u6210\uff0c\u5219\u5bf9\u5e94\u7684\u6bb5\u5185\u7684\u533a\u4e5f\u4f1a\u5206\u5e03\u5728\u591a\u4e2a\u6570\u636e\u6587\u4ef6\uff0c\u4f46\u662f\u533a\u5185\u90e8\u7684\u6570\u636e\u5757\u4e0d\u80fd\u5206\u5e03\u3002<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>9.4\u6570\u636e\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p><strong>\u6570\u636e\u6587\u4ef6<\/strong>\u4e3b\u8981\u5305\u62ec:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u6570\u636e\u6587\u4ef6\uff08\u5b58\u653e\u6570\u636e\u5e93\u6570\u636e\u7684\u6587\u4ef6\uff09<\/li><li>\u53c2\u6570\u6587\u4ef6<\/li><li>\u8ddf\u8e2a\u6587\u4ef6<\/li><li>\u63a7\u5236\u6587\u4ef6<\/li><li>\u91cd\u505a\u6587\u4ef6<\/li><li>\u5f52\u6863\u6587\u4ef6<\/li><\/ul>\n\n\n\n<p>9.4.1 \u53c2\u6570\u6587\u4ef6<\/p>\n\n\n\n<p>\u53c2\u6570\u6587\u4ef6\u4e5f\u53eb\u505a\u521d\u59cb\u5316\u6587\u4ef6\uff0c<strong><font color=\"#f78da7\">\u5b58\u50a8\u4e86\u6570\u636e\u5e93\u542f\u52a8\u65f6\u9700\u8981\u4f7f\u7528\u7684\u91cd\u8981\u53c2\u6570\uff08\u5206\u914d\u5404\u4e2a\u5185\u5b58\u533a\u57df\u5927\u5c0f\u3001\u914d\u7f6e\u540e\u53f0\u8fdb\u7a0b\u3001\u5b9a\u4f4d\u6570\u636e\u5e93\u8fd0\u884c\u9700\u8981\u7684\u5404\u79cd\u6587\u4ef6\uff09<\/font>\u3002<\/strong><br>\u53c2\u6570\u6587\u4ef6\u4e3b\u8981<font color=\"#f78da7\">\u5305\u542bpfile\uff08initsid.ora\uff09\u548cspfile\uff08spfilesid.ord\uff09\u4e24\u4e2a\u6587\u4ef6<\/font>\u3002\u4f18\u5148\u4f7f\u7528spfile\u3002\u4e24\u4e2a\u6587\u4ef6\u53ef\u4ee5\u4e92\u76f8\u751f\u6210\uff08create pfile from spfile\uff09\u3002<\/p>\n\n\n\n<p>9.4.2 \u8ddf\u8e2a\u6587\u4ef6<\/p>\n\n\n\n<p>\u8ddf\u8e2a\u6587\u4ef6\u65f6\u6570\u636e\u5e93\u8fd0\u884c\u4ea7\u751f\u7684\u4e00\u4e9b\u6587\u672c\u6587\u4ef6\uff0c<strong>\u4f5c\u7528\u7528\u4e8e\u7ba1\u7406\u5458\u53ef\u4ee5\u67e5\u770b\u8ddf\u8e2a\u6587\u4ef6\u6765\u4e86\u89e3\u6570\u636e\u5e93\u8fd0\u884c\u72b6\u6001\u3001\u8bca\u65ad\u9519\u8bef\u3002<\/strong><\/p>\n\n\n\n<p><strong>\u6587\u4ef6\u79cd\u7c7b\uff1a\u4e25\u683c\u610f\u4e49\u7684\u8ddf\u8e2a\u6587\u4ef6(trace files)\uff0c\u8fd8\u6709\u8f6c\u50a8\u6587\u4ef6\uff0c\u5185\u6838\u8f6c\u50a8\u6587\u4ef6\uff0c\u8fd9\u4e9b\u6587\u4ef6\u90fd\u5728ADR\u4e2d\u3002<\/strong><br><font color=\"#f78da7\">\u66f4\u8be6\u7ec6\u7684\u5206\u7c7b\uff1a\u524d\u53f0\u548c\u540e\u53f0\u8fdb\u7a0b\u8ddf\u8e2a\u6587\u4ef6\uff08\u524d\u53f0\u4f1a\u8bdd\u4e0e\u540e\u53f0\u8fdb\u7a0b\u7684\u8ddf\u8e2a\u4fe1\u606f\uff09\uff0c\u8b66\u544a\u6587\u4ef6\uff08\u8bb0\u5f55\u6570\u636e\u5e93\u6574\u4e2a\u6574\u4e2a\u751f\u547d\u671f\u7684\u8bb0\u5f55\uff09\uff0c\u5185\u6838\u8f6c\u50a8\u6587\u4ef6\uff0c\u610f\u5916\u4e8b\u4ef6\u4f20\u8f93\u6587\u4ef6\u3002<\/font><\/p>\n\n\n\n<p>9.4.3 \u63a7\u5236\u6587\u4ef6<\/p>\n\n\n\n<p><strong>\u63a7\u5236\u6587\u4ef6<\/strong>\uff1a<strong>\u5b58\u50a8<\/strong>\u4e86\u6570\u636e\u5e93\u7684<strong>\u7269\u7406\u6587\u4ef6\u4fe1\u606f<\/strong>\u548c<strong>RMAN\u5907\u4efd\u4fe1\u606f<\/strong>\u7b49\u3002<strong><font color=\"#f78da7\">\u5bf9\u4e8e\u6570\u636e\u5e93\u7684\u6b63\u5e38\u8fd0\u884c\u548c\u5907\u4efd\u6062\u590d\u975e\u5e38\u91cd\u8981\u3002<\/font><\/strong>\u63a7\u5236\u6587\u4ef6\u867d\u574f\uff0c\u6570\u636e\u5e93\u5c31\u65e0\u6cd5\u542f\u52a8\uff0c\u4e5f\u65e0\u6cd5\u901a\u8fc7\u666e\u901a\u65b9\u5f0f\u4f7f\u7528RMAN\u5907\u4efd\u6587\u4ef6\u6062\u590d\u3002<br><strong>\u6587\u4ef6\u7ed3\u6784<\/strong>\uff1a\u662f\u4e00\u4e2a<strong>\u4e8c\u8fdb\u5236\u6587\u4ef6<\/strong>\uff0c<strong>\u6700\u5927\u4e0d\u8d85\u8fc764MB<\/strong>\u3002\u5176<strong>\u6570\u636e\u5206\u4e3a\u4e0d\u53ef\u8986\u76d6\u548c\u53ef\u8986\u76d6\u91cd\u7528\u4e24\u90e8\u5206\u3002<\/strong><br><br>\u4e0d\u53ef\u8986\u76d6\u90e8\u5206\u5305\u542b\uff1a\u6570\u636e\u6587\u4ef6\u3001\u91cd\u505a\u6587\u4ef6\u7b49\u7269\u7406\u6587\u4ef6\u7684\u4f4d\u7f6e\u4fe1\u606f\u3002<br>\u53ef\u8986\u76d6\u91cd\u7528\u90e8\u5206\u5305\u542b\uff1a\u5f52\u6863\u65e5\u5fd7\u6587\u4ef6\u5386\u53f2\u548cRMAN\u5907\u4efd\u5386\u53f2\u7b49\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u2b50<strong>\u63a7\u5236\u6587\u4ef6\u7684\u5b89\u5168\u6027\u4fdd\u62a4<\/strong>\uff1aOracle\u63d0\u4f9b\u4e0b\u5217\u64cd\u4f5c\u4fdd\u62a4\u63a7\u5236\u6587\u4ef6<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5bf9\u63a7\u5236\u6587\u4ef6\u955c\u50cf<\/li><li>\u7528RMAN\u5907\u4efd\u63a7\u5236\u6587\u4ef6<\/li><li>\u5355\u72ec\u5907\u4efd\u5176\u4e8c\u8fdb\u5236\u6587\u4ef6 alter database backup contorfile to '\/home\/oracle\/control.bak';<\/li><li>\u5907\u4efd\u91cd\u5efa\u63a7\u5236\u6587\u4ef6\u7684\u547d\u4ee4<\/li><\/ul>\n\n\n\n<p>9.4.4 \u91cd\u505a\u6587\u4ef6<\/p>\n\n\n\n<p><strong>\u5728\u6062\u590d\u64cd\u4f5c\u4e2d\u8d77\u5173\u952e\u4f5c\u7528\u7684\u6587\u4ef6<font color=\"#f78da7\">\u5728\u6570\u636e\u5e93\u51fa\u73b0\u6545\u969c\u65f6\u7528\u4e8e\u6062\u590d\u4e22\u5931\u7684\u6570\u636e<\/font><\/strong>\uff0c<strong>\u4e3b\u8981\u7531\u91cd\u505a\u8bb0\u5f55\uff08\u7531\u6539\u53d8\u5411\u91cf\u6784\u6210\uff0c\u6539\u53d8\u5411\u91cf\u5305\u542b\u6570\u636e\u5757\uff09\u6784\u6210\u3002<\/strong><br>\u5404\u79cd\u4fee\u6539\u6570\u636e\u7684\u64cd\u4f5c\u4f1a\u4ea7\u751f\u91cd\u505a\u6570\u636e\u3002\u9664\u4e86\u521b\u5efa\u8868\u7a7a\u95f4\uff0c\u5bf9\u9762\u8868\u7a7a\u95f4\u589e\u52a0\u6570\u636e\u6587\u4ef6\uff0c\u6539\u53d8\u6570\u636e\u6587\u4ef6\u5c5e\u6027\u4e0d\u4f1a\u4ea7\u751f\u91cd\u505a\u6570\u636e\u3002<\/p>\n\n\n\n<p>9.4.5 \u5f52\u6863\u6587\u4ef6<\/p>\n\n\n\n<p><strong>\u6570\u636e\u5e93\u5904\u4e8e\u5f52\u6863\u6a21\u5f0f<\/strong>\uff0c\u53d1\u751f\u65e5\u5fd7\u5207\u6362\u65f6\uff0cOracle\u628a<strong>\u8054\u673a\u65e5\u5fd7\u6587<\/strong>\u4ef6\u4e2d<strong>\u7684\u6570\u636e<\/strong>\u590d\u5236\u5230\u5f52\u6863\u76ee\u5f55\u5f62<strong>\u6210\u5f52\u6863\u6587\u4ef6<\/strong>\u3002<\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"><strong>\u4e94\u3001\u5185\u5b58\u7ed3\u6784\u4e0e\u8fdb\u7a0b\u7ed3\u6784<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>10.1\u5185\u5b58\u6784\u6210\u90e8\u5206<\/strong><\/p>\n\n\n\n<p>\u5728\u5b9e\u4f8b\u542f\u52a8\u65f6\uff0c\u9996\u5148\u5c31\u8981\u5206\u914d\u5fc5\u987b\u7684\u5185\u5b58\u7ed3\u6784\u548c\u542f\u52a8\u5fc5\u8981\u7684\u540e\u53f0\u8fdb\u7a0b\u3002<br>\u5b9e\u4f8b\u7684<strong><font color=\"#f78da7\">\u5185\u5b58\u7ed3\u6784\u4e3b\u8981\u5305\u542b\uff1aSGA\u3001PGA\u4ee5\u53caUGA<\/font><\/strong>\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>SGA\uff1a\u7531\u670d\u52a1\u5668\u8fdb\u7a0b\u548c\u540e\u53f0\u8fdb\u7a0b\u5171\u4eab\u8bbf\u95ee\u3002<\/li><li>PGA\uff1a\u7528\u4e8e\u4fdd\u62a4\u4e0e\u5355\u4e2a\u8fdb\u7a0b\u76f8\u5173\u7684\u6570\u636e\u548c\u63a7\u5236\u4fe1\u606f\u3002\u6bcf\u4e2a\u670d\u52a1\u5668\u8fdb\u7a0b\u548c\u540e\u53f0\u8fdb\u7a0b\u90fd\u6709\u5176\u4e13\u5c5e\u7684PGA\u3002<\/li><li>UGA\uff1a\u4fdd\u5b58\u4e0e\u5355\u4e2a\u7528\u6237\u4f1a\u8bdd\u76f8\u5173\u7684\u4fe1\u606f\uff0c\u5982\u767b\u5f55\u8d26\u53f7\u7b49\u6570\u636e\u3002<\/li><\/ul>\n\n\n\n<p>10.1.1 SGA<\/p>\n\n\n\n<p>\u5168\u79f0\u4e3aSystem Global Area\uff0c<font color=\"#f78da7\">\u5305\u542b\u4e00\u4e2aOracle\u5b9e\u4f8b\u7684\u6570\u636e\u53ca\u63a7\u5236\u4fe1\u606f<\/font>\uff0c\u5b9e\u4f8b\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\u548c\u540e\u53f0\u8fdb\u7a0b\u90fd\u53ef\u4ee5\u8bbf\u95ee\u8fd9\u4e2a\u533a\uff0c<font color=\"#f78da7\">Oracle\u4e3b\u8981\u6d88\u8017\u5185\u5b58\u6765\u81ea\u8fd9\u4e2a\u533a\u3002<\/font><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>SGA\u4e3b\u8981\u6784\u6210\u5305\u62ec\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><font color=\"#f78da7\">\u56fa\u5b9a\u533a\u57df<\/font><\/strong>\uff1a\u8d1f\u8d23\u5b58\u50a8SGA\u81ea\u8eab\u7cfb\u7edf\u4fe1\u606f\uff0c\u5927\u5c0f\u56fa\u5b9a\uff0c\u5305\u542b\u4e86SGA\u7684<strong>\u5404\u533a\u57df\u6307\u9488<\/strong>\uff0c\u5404\u79cd<strong>\u53d8\u91cf\u7684\u503c<\/strong>\u548c<strong>\u6570\u636e\u5e93\u53ca\u5b9e\u4f8b<\/strong>\u7684<strong>\u4e00\u822c\u4fe1\u606f<\/strong>\uff0c<strong>\u8fdb\u7a0b\u95f4\u901a\u4fe1<\/strong>\u6240\u9700\u8981\u7684<strong>\u4fe1\u606f<\/strong>\uff08\u4f8b\u5982\u9501\uff09\u3002<\/li><li><strong>\u6570<font color=\"#f78da7\">\u636e\u7f13\u51b2\u533a<\/font><\/strong>\uff1a<strong>\u5b58\u653e\u4ece\u6570\u636e\u6587\u4ef6\u4e2d\u8bfb\u53d6\u7684\u6570\u636e<\/strong>\uff0c\u591a\u6b21\u8bbf\u95ee\u7684\u6570\u636e\u4f1a\u4fdd\u7559\u5728\u6b64\u3002<strong>\u7ed3\u6784\uff1a\u9ed8\u8ba4\u6c60\u4e0e\u4fdd\u7559\u6c60\u4e0e\u5faa\u73af\u6c60<\/strong>\u3002<\/li><li><strong><font color=\"#f78da7\">Java\u6c60<\/font><\/strong>\uff1a<strong>\u5206\u914d<\/strong>\u7ed9\u6570\u636e\u5e93\u4e2d\u7684<strong>java\u865a\u62df\u673a<\/strong>\u4f7f\u7528<\/li><li><strong><font color=\"#f78da7\">\u5927\u6c60<\/font><\/strong>\uff1a\u7528\u4e8e<strong>\u5b58\u50a8\u5171\u4eab\u670d\u52a1\u5668\u8fde\u63a5\u6a21\u5f0f<\/strong>\u4e0b\u7684<strong>UGA<\/strong>\uff0c<strong>\u5e76\u53d1\u64cd\u4f5c\u4fe1\u606f<\/strong>\u4ee5\u53ca<strong>RMAN\u5907\u4efd\u64cd\u4f5c<\/strong>\u7684\u78c1\u76d8<strong>I\/O\u6570\u636e<\/strong>\u3002<\/li><li><strong><font color=\"#f78da7\">\u91cd\u505a\u7f13\u51b2\u533a<\/font><\/strong>\uff1a\u6570\u636e\u5e93\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u4ea7\u751f\u7684<strong>\u91cd\u505a\u4fe1\u606f<\/strong>\u5148\u5199\u5165\u5230<strong>\u8be5\u7f13\u51b2\u533a<\/strong>\u3002<\/li><li><strong><font color=\"#f78da7\">\u5171\u4eab\u6c60<\/font><\/strong>\uff1a<strong>\u5b58\u50a8\u591a\u79cd\u7a0b\u5e8f\u6570\u636e<\/strong>\uff0c\u5305\u62ec\u89e3\u6790\u540e\u7684<strong>SQL\uff0cPL\/SQL\u4ee3\u7801<\/strong>\uff0c<strong>\u7cfb\u7edf\u53c2\u6570<\/strong>\uff0c<strong>\u6570\u636e\u5b57\u5178<\/strong>\u7b49\u3002<strong>\u7ed3\u6784\uff1a\u5e93\u7f13\u5b58<\/strong>\uff08\u5b58\u50a8SQL\u548cPL\/SQL\u7684\u6267\u884c\u8ba1\u5212\uff09\u548c<strong>\u6570\u636e\u5b57\u5178\u7f13\u5b58<\/strong>\uff08\u4fdd\u5b58\u8868\u6216\u89c6\u56fe\u7b49\u5bf9\u8c61\u7684\u7ed3\u6784\u3001\u7528\u6237\u6743\u9650\u7b49\u7cfb\u7edf\u53c2\u6570\uff09\u3002<\/li><\/ul>\n\n\n\n<p>10.1.2 PGA<\/p>\n\n\n\n<p>\u5168\u79f0\u4e3aprocess global area\uff0c<strong>\u72ec\u7acb\u4e8eSGA<\/strong>\u7684\u53e6\u4e00\u90e8\u5206\u5185\u5b58\u533a\u57df\uff0c\u5c5e\u4e8e<strong>\u64cd\u4f5c\u7cfb\u7edf<\/strong>\u8fdb\u7a0b<strong>\u79c1\u6709<\/strong>\uff0c<strong>\u5176\u4ed6\u8fdb\u7a0b\u4e0d\u80fd\u8bbf\u95ee<\/strong>\u3002<font color=\"#f78da7\">PGA\u4e3b\u8981\u4f5c\u7528\u7528\u4e8e\u5728\u5185\u5b58\u4e2d\u6267\u884c\u7684\u6392\u5e8f\u3001\u6563\u5217\u548c\u4f4d\u56fe\u5408\u5e76\u7b49\u64cd\u4f5c\u3002<\/font><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>PGA\u4e3b\u8981\u7531\u79c1\u6709SQL\u533a\u57df\u548cSQL\u5de5\u4f5c\u533a\u57df\u6784\u6210\u3002<\/strong><br>\u79c1\u6709SQL\uff1a\u4fdd\u5b58\u89e3\u6790\u540e\u7684SQL\u8bed\u53e5\u7684\u79c1\u6709\u4fe1\u606f\uff0c\u5982\u7ed1\u5b9a\u7684\u53d8\u91cf\u7684\u503c\u3002<br>SQL\u5de5\u4f5c\u533a\u57df\uff1a\u5b58\u653e\u670d\u52a1\u5668\u8fdb\u7a0b\u6267\u884c\u6392\u5e8f\u3001\u6563\u5217\u4ee5\u53ca\u4f4d\u56fe\u5408\u5e76\u7b49\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>10.1.3 UGA<\/p>\n\n\n\n<p><font color=\"#f78da7\">UGA\u4e3b\u8981\u7528\u4e8e\u5b58\u50a8\u7528\u6237\u4f1a\u8bdd\u7684\u72b6\u6001\u4fe1\u606f\u3002<\/font><br>\u4f7f\u7528<strong>\u5171\u4eab\u670d\u52a1\u5668\u6a21\u5f0f<\/strong>\u8fde\u63a5\u6570\u636e\u5e93\u65f6\uff0c<strong>UGA\u5728SGA\u4e2d\u8fdb\u884c\u5206\u914d<\/strong>\u3002<br>\u4f7f\u7528<strong>\u4e13\u7528\u670d\u52a1\u5668\u6a21\u5f0f<\/strong>\u8fde\u63a5\u6570\u636e\u5e93\u65f6<strong>\uff0cUGA\u5728PGA\u4e2d\u8fdb\u884c\u5206\u914d\u3002<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>10.2\u8fdb\u7a0b<\/strong><\/p>\n\n\n\n<p>Oracle\u5b9e\u4f8b\u5305\u542b\u4e09\u79cd\u8fdb\u7a0b<strong>\uff1a<font color=\"#f78da7\">\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u540e\u53f0\u8fdb\u7a0b\u548c\u4ece\u5c5e\u8fdb\u7a0b\u3002<\/font><\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">10.2.1 \u670d\u52a1\u5668\u8fdb\u7a0b<\/p>\n\n\n\n<p><strong>\u5b9a\u4e49\uff1a\u5904\u7406\u7528\u6237\u8fde\u63a5\u63d0\u51fa\u7684\u5404\u79cd\u8bf7\u6c42<\/strong>\uff0c\u5b83\u4e3b\u8981\u5b8c\u6210\u4ee5\u4e0b\u4efb\u52a1\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><font color=\"#f78da7\">\u89e3\u6790\u5e76\u6267\u884cSQL\u8bed\u53e5\uff0c\u5305\u62ec\u521b\u5efa\u5e76\u6267\u884c\u67e5\u8be2\u8ba1\u5212<\/font><\/li><li><font color=\"#f78da7\">\u6267\u884cPL\/SQL\u4ee3\u7801<\/font><\/li><li><font color=\"#f78da7\">\u628a\u9700\u8981\u7684\u6570\u636e\u4ece\u78c1\u76d8\u6570\u636e\u6587\u4ef6\u8bfb\u5165\u5230SGA\u4e2d\u7684\u6570\u636e\u7f13\u51b2\u533a<\/font><\/li><li><font color=\"#f78da7\">\u5c06\u5904\u7406\u7ed3\u679c\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u8fde\u63a5<\/font><\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u2b50<strong>\u670d\u52a1\u8fdb\u7a0b\u4e3b\u8981\u5206\u4e3a\u4e24\u7c7b\uff1a\u4e13\u7528\u670d\u52a1\u5668\u8fdb\u7a0b\u548c\u5171\u4eab\u670d\u52a1\u5668\u8fdb\u7a0b\u3002<\/strong><br>\u4e13\u7528\u670d\u52a1\u5668\u8fdb\u7a0b\uff1a\u53ea\u670d\u52a1\u4e8e\u4e00\u4e2a\u7528\u6237\u8fdb\u7a0b<br>\u5171\u4eab\u670d\u52a1\u5668\u8fdb\u7a0b\uff1a\u53ef\u670d\u52a1\u4e8e\u591a\u4e2a\u7528\u6237\u8fdb\u7a0b\uff0c\u4f46\u662f\u5904\u7406\u7528\u6237\u8bf7\u6c42\u9700\u8981\u6309\u987a\u5e8f\u6765\u5904\u7406\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">10.2.2 \u540e\u53f0\u8fdb\u7a0b<\/p>\n\n\n\n<p><strong>\u5b9a\u4e49\uff1a\u540e\u53f0\u8fdb\u7a0b\u968f\u7740\u5b9e\u4f8b\u542f\u52a8\u800c\u542f\u52a8\uff0c\u4f5c\u7528\u4fdd\u8bc1\u6570\u636e\u5e93\u6b63\u5e38\u8fd0\u884c\u3002\u5b8c\u6210\u7684\u529f\u80fd\uff1a\u78c1\u76d8I\/O\uff0c\u5b9e\u4f8b\u6062\u590d\uff0c\u5199\u5165\u91cd\u505a\u6570\u636e\u5230\u78c1\u76d8\u7b49\u3002<\/strong>\u4ecb\u7ecd\u51e0\u4e2a<strong><font color=\"#f78da7\">\u91cd\u8981\u7684\u540e\u53f0\u8fdb\u7a0b<\/font><\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>DBWn<\/strong>\uff1a\u6570\u636e\u5199\u5165\u8fdb\u7a0b\uff0c\u628a\u6570\u636e\u7f13\u51b2\u533a\u4e2d\u7684\u4fee\u6539\u8fc7\u7684\u6570\u636e\u5199\u5165\u5230\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u6587\u4ef6\u3002<\/li><li><strong>LGWR<\/strong>\uff1a\u65e5\u5fd7\u5199\u5165\u8fdb\u7a0b\uff0c \u628a\u91cd\u505a\u7f13\u51b2\u533a\u7684\u91cd\u505a\u6570\u636e\u5199\u5165\u5230\u78c1\u76d8\u7684\u91cd\u505a\u65e5\u5fd7\u6587\u4ef6\u3002 <\/li><li><strong>CKPT<\/strong>\uff1a\u68c0\u67e5\u70b9\u8fdb\u7a0b\uff0c\u628a\u68c0\u67e5\u70b9\u4fe1\u606f\uff08SCN\u53f7\uff09\u5199\u5165\u6570\u636e\u6587\u4ef6\u5934\u53ca\u63a7\u5236\u6587\u4ef6\uff0c\u5e76\u901a\u77e5DBWn\u8fdb\u7a0b\u628a\u6570\u636e\u7f13\u51b2\u533a\u4e2d\u7684\u810f\u5757\u5199\u5165\u6570\u636e\u6587\u4ef6\u3002<\/li><li><strong>SMON<\/strong>\uff1a\u7cfb\u7edf\u76d1\u63a7\u8fdb\u7a0b\uff0c\u5b8c\u6210\u4efb\u52a1\uff1a\u7cfb\u7edf\u6545\u969c\u91cd\u542f\u65f6\uff0c\u6267\u884c\u5b9e\u4f8b\u6062\u590d\uff0c\u56de\u6536\u4e0d\u518d\u4f7f\u7528\u7684\u4e34\u65f6\u6bb5\u3002<\/li><li><strong>PMON<\/strong>\uff1a\u8fdb\u7a0b\u76d1\u89c6\u5668\uff0c\u8d1f\u8d23\u91ca\u653e\u4f53\u957f\u5173\u95ed\u8fdb\u7a0b\u5360\u7528\u7684\u5185\u5b58\u3001\u9501\u7b49\u8d44\u6e90\uff0c\u68c0\u67e5\u8c03\u5ea6\u5668\u8fdb\u7a0b\u548c\u670d\u52a1\u5668\u8fdb\u7a0b\u662f\u5426\u5f02\u5e38\u5173\u95ed\uff0c\u5f02\u5e38\u5173\u95ed\u5219\u91cd\u542f\u3002<\/li><\/ul>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"><strong>\u516d\u3001\u4e8b\u52a1\u6a21\u578b\u4e0e\u4e8b\u52a1\u5904\u7406<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>11.1\u4e8b\u52a1\u6a21\u578b<\/strong><\/p>\n\n\n\n<p><strong>11.1.1<\/strong> <strong>\u4e8b\u52a1\u7684\u6982\u5ff5<\/strong><\/p>\n\n\n\n<p><strong>\u5b9a\u4e49<\/strong>\uff1a<strong><font color=\"#f78da7\">\u4e8b\u52a1\u5c31\u662f\u64cd\u4f5c\u7684\u96c6\u5408<\/font><\/strong>\uff0c\u96c6\u5408\u5185\u7684\u6240\u6709\u64cd\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\uff0c<font color=\"#f78da7\">\u8981\u4e48\u90fd\u5b8c\u6210\uff0c\u8981\u4e48\u90fd\u4e0d\u5b8c\u6210\u3002<\/font><\/p>\n\n\n\n<p>11.1.2 \u4e8b\u52a1\u7684ACID\u5c5e\u6027<\/p>\n\n\n\n<p>ACID\u5c31\u662f\uff1aAtomicity(\u539f\u5b50\u6027)\uff0cConsistency(\u4e00\u81f4\u6027)\uff0cIsolation(\u9694\u79bb\u6027)\uff0cDurability(\u6301\u4e45\u6027)\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>\u539f\u5b50\u6027<\/strong>\uff1a\u6307\u4e8b\u52a1\u4e2d\u7684\u64cd\u4f5c<strong>\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u4e0d\u53ef\u5206\u5272<\/strong>\u3002\u8981\u4e48\u90fd\u5b8c\u6210\uff0c\u8981\u4e48\u90fd\u4e0d\u5b8c\u6210\u3002<\/li><li><strong>\u4e00\u81f4\u6027<\/strong>\uff1a\u4e8b\u52a1\u5e94\u8be5\u628a\u6570\u636e\u5e93\u4ece\u4e00\u4e2a\u4e00\u81f4\u72b6\u6001\u8f6c\u5230\u53e6\u4e00\u4e2a\u4e00\u81f4\u72b6\u6001\u3002<strong>\u4e5f\u5c31\u662f\u8bf4\u6570\u636e\u5e93\u5728\u7ecf\u5386\u8fc7\u4e8b\u52a1\u5904\u7406\u540e\u8bc1\u636e\u5e93\u4f9d\u7136\u6ee1\u8db3\u6b63\u786e\u6027\u8981\u6c42\u3002<\/strong><\/li><li><strong>\u9694\u79bb\u6027<\/strong>\uff1a\u4e00\u4e2a\u4e8b\u52a1<strong>\u5bf9\u6570\u636e\u4fee\u6539<\/strong>\u7684\u6548\u679c\u53ea\u6709<strong>commit\u540e<\/strong>\u624d\u80fd<strong>\u5bf9\u5176\u4ed6\u4e8b\u52a1\u53ef\u89c1<\/strong>\u3002<\/li><li><strong>\u6301\u4e45\u6027<\/strong>\uff1a\u4e8b\u52a1commit\u6210\u529f\u540e\uff0c\u5373\u4f7f\u7cfb\u7edf\u6545\u969c\uff0c<strong>\u5176commit\u540e\u7684\u6548\u679c\u5728\u6570\u636e\u5e93\u4e2d\u662f\u6c38\u4e45\u7684\u3002<\/strong><\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u7ed3\u675f\u4e8b\u52a1\u53ef\u4ee5\u8f93\u5165commit\u6216\u8005rollback\u547d\u4ee4<\/strong>\uff0c<strong>DDL\u8bed\u53e5\uff0c\u7528\u6237\u6b63\u5e38\u9000\u51fa\u6570\u636e\u5e93\u8fde\u63a5\uff0c\u5ba2\u6237\u7aef\u975e\u6b63\u5e38\u5173\u95ed\uff0csavepoint\u3002<\/strong><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>11.2\u9501<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u5b9a\u4e49<\/strong>\uff1a\u9501\u662f\u7528\u6765\u63a7\u5236\u8bbf\u95ee\u5171\u4eab\u8d44\u6e90\u7684\u4e00\u79cd\u673a\u5236\uff0c\u628a\u5e76\u53d1\u8bbf\u95ee\u64cd\u4f5c\u4e32\u884c\u5316\u7684\u4e3b\u8981\u65b9\u6cd5\u3002\u9501\u4e5f\u53ef\u4ee5\u89e3\u51b3\u5e76\u884c\u64cd\u4f5c\u4e2d\u4e22\u5931\u66f4\u65b0\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<p>11.2.1 \u9501\u7684\u79cd\u7c7b<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>DML\u9501<\/strong>\uff08\u6570\u636e\u9501\uff09\uff1a\u7528\u4e8e\u4fdd\u62a4\u4fee\u6539\u7684\u6570\u636e\u4e0d\u88ab\u5176\u4ed6\u4e8b\u52a1\u5e76\u53d1\u4fee\u6539\u3002<\/li><li><strong>DDL\u9501<\/strong>\uff08\u6570\u636e\u5b57\u5178\u9501\uff09\uff1a\u5728\u7528\u6237\u6267\u884cDDL\u64cd\u4f5c\u65f6\uff0c\u907f\u514dDDL\u8bed\u53e5\u64cd\u4f5c\u5bf9\u8c61\u88ab\u5176\u5b83\u7528\u6237\u4fee\u6539\u3002<\/li><li><strong>\u5185\u90e8\u6813\u9501<\/strong>\uff08Internal locks and latches\uff09\uff1a\u5b83\u662f\u4e34\u65f6\u9501<\/li><\/ul>\n\n\n\n<p><strong>DML\u9501\u53c8\u5206\u4e3a\uff1aTX\uff08\u8868\u9501)\u3001TX(\u884c\u9501)\u3002<\/strong><br><strong>TX\u9501<\/strong>\uff1a\u7531UPDATE\u3001INSERT\u3001DELETE\u3001MARGE\u7b49\u64cd\u4f5c\u4ea7\u751f\uff0c\u8fd9\u4e9b\u64cd\u4f5c\u4fee\u6539\u6bcf\u884c\u8bb0\u5f55\u90fd\u4f1a\u9644\u52a0\u4e00\u4e2aTX\u9501\uff0c<strong>\u9632\u6b62\u5176\u4ed6\u5e76\u53d1\u4e8b\u52a1\u4fee\u6539<\/strong>\u3002<br><strong>TM\u9501<\/strong>\uff1a<strong>\u7528\u4e8e\u9501\u4f4f\u88ab\u4fee\u6539\u7684\u8868<\/strong>\uff0c\u9632\u6b62\u5176\u4ed6\u4e8b\u52a1\u5bf9\u6b64\u8868\u6267\u884cDDL\u4fee\u6539\u8868\u7684\u7ed3\u6784\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>11.2.2 \u6b7b\u9501<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u6b7b\u9501\uff1a\u4e24\u4e2a\u6216\u591a\u4e2a\u4e8b\u52a1\u540c\u65f6\u5904\u4e8e\u7b49\u5f85\u72b6\u6001\uff0c\u6bcf\u4e2a\u4e8b\u52a1\u90fd\u5728\u7b49\u5f85\u53e6\u4e00\u4e2a\u4e8b\u52a1\u91ca\u653e\u5bf9\u67d0\u4e2a\u8d44\u6e90\u9501\u5b9a\u540e\u624d\u80fd\u7ee7\u7eed\u81ea\u5df1\u7684\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>oracle\u4f1a\u81ea\u52a8\u63a2\u6d4b\u5230\u6b7b\u9501\u7684\u53d1\u751f\uff0c\u5e76\u64a4\u9500\u5176\u4e2d\u4e00\u4e2a\u4e8b\u52a1\u4e2d\u5f15\u8d77\u7684\u9501\u7684\u64cd\u4f5c\u3002<br>\u603b\u7ed3\uff1aOracle\u89e3\u51b3\u4e09\u4e2a\u5e76\u53d1\u63a7\u5236\u95ee\u9898\u7684\u65b9\u6cd5\uff1a\u7b2c\u4e00\uff0c<strong>\u4e22\u5931\u66f4\u65b0\u95ee\u9898\u901a\u8fc7\u9501\u89e3\u51b3<\/strong>\uff1b\u7b2c\u4e8c\uff0c\u810f\u8bfb\u95ee\u9898\u7684\u89e3\u51b3\u901a\u8fc7\u591a\u7248\u672c\u6570\u636e\u89e3\u51b3\uff1b\u7b2c\u4e09\uff0c\u4e0d\u53ef\u91cd\u590d\u8bfb\u95ee\u9898\u901a\u8fc7\u591a\u7248\u672c\u6570\u636e\u89e3\u51b3\u3002<\/p>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"><strong>\u4e03\u3001\u6743\u9650\u7ba1\u7406<\/strong><\/p>\n\n\n\n<p><strong>\u7528\u6237\u5c5e\u6027\u3001\u6743\u9650\u3001\u6388\u6743\/\u56de\u6536\u662f\u672c\u5355\u5143\u7684\u4e3b\u8981\u5185\u5bb9\u3002<\/strong><br><font color=\"#f78da7\">\u6570\u636e\u5e93\u4e2d\u5b58\u5728\u9884\u5b9a\u4e49\u7528\u6237\u4e3b\u8981\u5206\u4e3a\u4e09\u7c7b\uff1a\u7ba1\u7406\u7528\u6237\uff08sys\uff0csystem\uff09\uff0c\u5185\u7f6e\u7528\u6237\uff0c\u793a\u4f8b\u7528\u6237\u3002<\/font><\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>12.1 \u7528\u6237\u5c5e\u6027<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>12.1.1 \u7528\u6237\u5c5e\u6027\u5305\u62ec\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>\u9a8c\u8bc1\u65b9\u5f0f<\/strong><\/li><li><strong>\u53e3\u4ee4<\/strong><\/li><li><strong>\u9ed8\u8ba4\u8868\u7a7a\u95f4<\/strong>\uff1a\u521b\u5efa\u7684\u8868\u6216\u8005\u7d22\u5f15\u653e\u5165\u6b64\uff0c\u5982\u679c\u7528\u6237\u6ca1\u6709\u6307\u5b9a\u5c31\u653e\u5165\u5230\u6570\u636e\u5e93\u7684\u9ed8\u8ba4\u8868\u7a7a\u95f4\u3002<\/li><li><strong>\u9ed8\u8ba4\u4e34\u65f6\u8868\u7a7a\u95f4<\/strong>\uff1a\u5f53\u6392\u5e8f\u6216\u6563\u5217\u64cd\u4f5c\u6570\u636e\u8d85\u8fc7PGA\u5927\u5c0f\uff0c\u5c06\u5176\u6570\u636e\u653e\u5165\u6b64\u3002<\/li><li><strong>\u8868\u7a7a\u95f4\u914d\u989d<\/strong>\uff1a\u8fd9\u4e2a\u8868\u7a7a\u95f4\u80fd\u591f\u4f7f\u7528\u7684\u6700\u5927\u7a7a\u95f4\u9650\u5236\u3002<\/li><li><strong>\u9501\u5b9a\u72b6\u6001<\/strong>\uff08\u662f\u5426\u5904\u4e8e\u9501\u5b9a\u72b6\u6001\uff09<\/li><li><strong>\u53e3\u4ee4\u72b6\u6001<\/strong>\uff08\u662f\u5426\u8fc7\u671f\uff09<\/li><\/ul>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>12.1.2\u521b\u5efa\u7528\u6237\u4e0e\u4fee\u6539\u7528\u6237\u5c5e\u6027\uff0c\u5220\u9664\u7528\u6237\u3002\u4ee3\u7801\u793a\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-luminous-vivid-orange-color\"><strong>\u521b\u5efa\u7528\u6237\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u521b\u5efa\u7528\u6237 \u9996\u5148\u4fdd\u8bc1\u5728system\u7528\u6237\u4e0b\ncreate user law identified by password \/\/\u521b\u5efalaw\u7528\u6237\u5bc6\u7801\u4e3apassword\ndefault tablespace users \/\/\u6307\u5b9a\u9ed8\u8ba4\u8868\u7a7a\u95f4\u4e3ausers\ntemporary tablespace temp  \/\/\u4e34\u65f6\u8868\u7a7a\u95f4\u4e3atemp\nquota 100m on users  \/\/users\u8868\u7a7a\u95f4\u914d\u989d100mb\nquota unlimited on test; \/\/test\u8868\u7a7a\u95f4\u7684\u914d\u989d:\u65e0\u9650\u5236\u3002<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u6ce8\u610f\uff01\u7528\u6237\u521b\u5efa\u540e\uff0c\u56e0\u4e3a\u8fd8\u6ca1\u5bf9\u7528\u6237\u8d4b\u4e88\u76f8\u5e94\u7684\u6743\u9650\uff0c\u8fd9\u4e2a\u7528\u6237\u8fd8\u4e0d\u80fd\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u4efb\u4f55\u64cd\u4f5c\u3002<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-luminous-vivid-orange-color\"><strong>\u4fee\u6539\u7528\u6237\u5c5e\u6027\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>alter user law indentified by newpassword; \/\/\u4fee\u6539\u7528\u6237law\u5bc6\u7801\u4e3anewpassword\nalter user law default tablespace test; \/\/\u4fee\u6539\u7528\u6237law\u9ed8\u8ba4\u8868\u7a7a\u95f4\u4e3atest\nalter user law temporary tablespace temp1; \/\/\u4fee\u6539\u7528\u6237law\u4e34\u65f6\u8868\u7a7a\u95f4\u4e3atemp1\nalter user law quota 200m on users; \/\/\u4fee\u6539users\u8868\u7a7a\u95f4\u914d\u989d\u4e3a200mb\nalter user law account lock\/unlock; \/\/\u9501\u5b9a\/\u89e3\u9501law\u7528\u6237<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-luminous-vivid-orange-color\"><strong>\u5220\u9664\u7528\u6237\uff1a<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u5220\u9664\u7528\u6237\u65f6\uff0c\u5982\u679c\u7528\u6237\u8fd8\u672a\u521b\u5efa\u6570\u636e\u5e93\u5bf9\u8c61\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\"drop user username\"\u6765\u5220\u9664\uff0c\u5982\u679c\u7528\u6237\u521b\u5efa\u4e86\u6570\u636e\u5e93\u5bf9\u8c61\u9700\u8981\u4f7f\u7528\"drop user username cascade\"\u6765\u5220\u9664\u3002<\/strong>\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>drop user law; \/\/\u5220\u9664\u7528\u6237law\uff0claw\u672a\u521b\u5efa\u6570\u636e\u5e93\ndrop user scott cascade; \/\/\u5220\u9664\u521b\u5efa\u4e86\u6570\u636e\u5e93\u7684\u7528\u6237scott<\/code><\/pre>\n\n\n\n<p class=\"has-text-color has-light-green-cyan-color\">\u8865\u5145\u4e00\u4e9b\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>conn system\/password;\nselect username from dba_user\nwhere rownum &lt; 6; \/\/\u67e5\u8be2\u6570\u636e\u5e93\u4e2d\u6240\u6709\u7684\u7528\u6237\u540d\u79f0\uff08where\u5b50\u53e5\u542b\u4e49:\u540d\u5b57\u957f\u5ea6\u5c0f\u4e8e6\u4e2a\u5b57\u7b26\uff09<\/code><\/pre>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>12.2\u6743\u9650\u7ba1\u7406<\/strong><\/p>\n\n\n\n<p>12.2.1 \u6743\u9650\u79cd\u7c7b<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>\u4e3b\u8981\u5206\u4e3a\u7cfb\u7edf\u6743\u9650\u4e0e\u5bf9\u8c61\u6743\u9650<\/strong>\u3002<\/p>\n\n\n\n<p><strong>\u7cfb\u7edf\u6743\u9650\uff1a<br>create session\u6743\u9650\uff1a\u53ef\u4ee5\u8fde\u63a5\u6570\u636e\u5e93\u3002<br>create table\u6743\u9650\uff1a\u53ef\u4ee5\u521b\u5efa\u8868\u3002<br>any\u6743\u9650\uff1aselect any table \u5219\u7528\u6237\u53ef\u4ee5\u5728\u4efb\u610f\u7528\u6237\u4e2d\u4f7f\u7528\u8868\u3002<br>unlimited tablespace\u6743\u9650\uff1a\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u6240\u6709\u7684\u8868\u7a7a\u95f4\uff0c\u7a7a\u95f4\u5927\u5c0f\u4e0d\u53d7\u9650\u5236\u3002<br>sysdba\u6743\u9650\uff1a\u7528\u6237\u7684\u6743\u9650\u7b49\u7ea7\u4e0esys\u76f8\u540c\uff0c\u53ef\u4ee5\u6267\u884c\u4efb\u4f55\u64cd\u4f5c\u3002<br>sysoper\u6743\u9650\uff1a\u6267\u884c\u57fa\u672c\u7684\u7ba1\u7406\u4efb\u52a1\uff0c\u4f46\u662f\u4e0d\u80fd\u6267\u884c\u521b\u5efa\u548c\u5220\u9664\u6570\u636e\u5e93\uff0c\u4e0d\u80fd\u4fee\u6539\u6570\u636e\u5e93\u5b57\u7b26\uff0c\u4e0d\u80fd\u67e5\u770b\u7528\u6237\u6570\u636e\uff0c\u4e0d\u80fd\u6267\u884c\u6570\u636e\u5e93\u6062\u590d\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grant create session to law; \/\/\u8d4b\u4e88law\u8fde\u63a5\u6570\u636e\u5e93\u7684\u6743\u9650\ngrant select on scott.emp to law; \/\/\u6388\u4e88law\u7528\u6237\u67e5\u8be2scott\u7684emp\u8868\u7684\u6743\u9650<\/code><\/pre>\n\n\n\n<p><strong>\u5bf9\u8c61\u6743\u9650\uff1aalter\uff08\u4fee\u6539\u8868\u7ed3\u6784\uff09\uff0cdelete\uff0cexecute\uff0cindex\uff08\u6dfb\u52a0\u7d22\u5f15\uff09\uff0cinsert\uff08\u6dfb\u52a0\u884c\u6570\u636e\uff09\uff0creferences\uff08\u5f15\u7528\u8868\uff09,select\uff0cupdate\uff08\u66f4\u65b0\u5217\u503c\uff09\u3002<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"><strong>12.2.2 \u6388\u6743\u4e0e\u64a4\u9500\u6743\u9650\u64cd\u4f5c<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u7cfb\u7edf\u6743\u9650\u7684\u6388\u6743\u4e0e\u64a4\u9500\u6743\u9650\u4ee3\u7801\n\n\/\/\u6388\u4e88\u6743\u9650\ngrant create session,create table \nto scott,law; \/\/\u5bf9scott\u548claw\u6388\u6743\u8fde\u63a5\u6570\u636e\u5e93\u4e0e\u521b\u5efa\u8868\u7684\u6743\u9650\ngrant createsession \nto scott with admin option; \/\/\u6388\u6743scott\u8fde\u63a5\u6570\u636e\u5e93\u540c\u65f6\u53ef\u4ee5\u628a\u8fd9\u4e2a\u6743\u9650\u518d\u6388\u4e88\u7ed9\u5176\u4ed6\u7528\u6237\u3002\n\/\/\u64a4\u9500\u6743\u9650\nrevoke create session,create table \nfrom scott,law; \/\/\u56de\u6536law\u548cscott\u7684\u8fde\u63a5\u6570\u636e\u5e93\u4e0e\u521b\u5efa\u8868\u7684\u6743\u9650\n\n\/\/\u8d4b\u4e88\u5bf9\u8c61\u6743\u9650 \u57fa\u672c\u8bed\u6cd5 grant \u5bf9\u8c61\u6743\u9650 on \u5b58\u5728\u7684\u7528\u6237\u7684\u8868 to \u7528\u6237\ngrant alter on scott.emp to law; \/\/\u6388\u4e88law\u7528\u6237\u6539\u53d8emp\u8868\u7ed3\u6784\u7684\u6743\u9650\ngrant index on scott.emp to law; \/\/\u6388\u4e88law\u7528\u6237\u5728emp\u8868\u521b\u5efa\u7d22\u5f15\u7684\u6743\u9650\ngrant references on scott.emp to law; \/\/\u6388\u4e88law\u7528\u6237\u5f15\u7528emp\u8868\u7684\u6743\u9650\uff0c\u5373\u53ef\u4ee5\u628a\u5916\u952e\u6307\u5411emp\u8868\ngrant update(sal) on scott.emp to law with grant option;\n\/\/\u6388\u6743law\u7528\u6237\u53ef\u4ee5\u4fee\u6539emp\u7684sal\u5217\u503c\uff0c\u540c\u65f6\u53ef\u4ee5\u628a\u6743\u9650\u6388\u4e88\u5176\u4ed6\u7528\u6237\u3002<\/code><\/pre>\n\n\n\n<p><strong>\u6ce8\u610fwith admin option \u6708with grant option\u4e00\u4e2a\u9488\u5bf9\u7cfb\u7edf\u6743\u9650\uff0c\u4e00\u4e2a\u9488\u5bf9\u5bf9\u8c61\u6743\u9650\uff08\u8fd1\u4f3c\u4e8e\u4f20\u9012\u4e00\u7ea7\u4e00\u7ea7\u7ed9\u4e0b\u9762\u7528\u6237\u6743\u9650\uff0c\u7ea7\u8054\uff09<\/strong>\u3002<strong><font color=\"#f78da7\">\u540c\u65f6\u7cfb\u7edf\u6743\u9650\u4e0d\u80fd\u7ea7\u8054\u64a4\u9500\u3002\u6bd4\u5982\u7528\u6237A\u628a\u6743\u9650P\u6388\u6743\u7ed9B\u65f6\u9644\u5e26\u4e86with admin option\uff0c\u7528\u6237B\u53c8\u628a\u6743\u9650P\u7ed9\u4e86C\uff0c\u90a3\u4e48A\u4eceB\u64a4\u9500\u6743\u9650P\u65f6\uff0cC\u7684\u6743\u9650P\u4e0d\u4f1a\u88ab\u64a4\u9500\u3002<\/font><\/strong><\/p>\n\n\n\n<p>\u8865\u5145\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u67e5\u8be2\u5f53\u524d\u8fde\u63a5\u7528\u6237\u6743\u9650\u4fe1\u606f\ndesc dba_sys_privs\n\/\/\u67e5\u8be2scott\u7528\u6237\u7684\u7cfb\u7edf\u6743\u9650\nselect grantee,privilege\nfrom dba_sys_privs\nwhere grantee='SCOTT';<\/code><\/pre>\n\n\n\n<!--nextpage-->\n\n\n\n<p class=\"has-text-align-center has-large-font-size\"><strong>\u516b\u3001PL\/SQL\u7f16\u7a0b<\/strong><\/p>\n\n\n\n<p>\u5148\u6765\u770b\u4e00\u4e2a\u7b80\u5355\u7684\u7f16\u7a0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>declare             \/\/\u5b9a\u4e49\u53d8\u91cf\u7684\u5f00\u5934\u5173\u952e\u5b57declare\n    --\u5458\u5de5\u7f16\u53f7      \/\/--\u4e3aPL\/SQL\u7684\u6ce8\u91ca\u5f00\u5934\n    var_empno number; \/\/\u521d\u59cb\u5316\u53d8\u91cfvar_empno \u6570\u636e\u7c7b\u578bnumber\n    --\u5de5\u8d44\n    var_sal number;\nbegin    \/\/\u7a0b\u5e8f\u5f00\u59cb\u7684\u5173\u952e\u5b57begin\n    --\u83b7\u5f97\u5458\u5de5\u7f16\u53f7\n    var_empno:=&amp;var_empno; \/\/&amp;var_empno\u63d0\u793a\u7528\u6237\u8f93\u5165\u503c var_empno:=&amp;var_empno\u628a\u83b7\u53d6\u5230\u7684\u503c\u8d4b\u503c\u7ed9var_empno\n    --\u6839\u636e\u7f16\u53f7\u83b7\u5f97\u5176\u5de5\u8d44\n    select sal into var_sal from scott.emp where empno=var_empno; \/\/select \u67e5\u8be2\u7684\u5185\u5bb9 into(\u8d4b\u503c\u7ed9) var_sal \uff0c\u5176\u4e2d\u67e5\u5230\u7684\u884c\u6570\u8981\u4e0e\u8d4b\u503c\u7684\u4e2a\u6570\u4fdd\u6301\u4e00\u81f4\uff01\n    --\u5224\u65ad\u5de5\u8d44\u589e\u957f\u540e\u662f\u5426\u8d85\u8fc73200\n    if var_sal*1.1&lt;=3200 then \/\/\u5206\u652f\u8bed\u53e5\u7ed3\u6784\uff1aif \u5224\u65ad\u6761\u4ef6 then end if;\n        --\u66f4\u65b0\u5de5\u8d44\n        update scott.emp set sal=sal*1.1 where empno=var_empno; \/\/\u66f4\u65b0\u5bf9\u5e94\u7684\u503c\n        commit; \/\/\u63d0\u4ea4\u4fee\u6539\u540e\u7684\u6570\u636e\n    end if;\nend; \/\/\u7a0b\u5e8f\u7ed3\u675f\u7684\u5173\u952e\u5b57end \u7a0b\u5e8f\u6700\u540e\u8981\u6709;\u53f7<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u5c31\u662f\u4e00\u4e2a\u7b80\u5355\u7684PL\/SQL\u7f16\u7a0b\uff0c\u4e3b\u8981\u529f\u80fd\uff1a\u6839\u636e\u7528\u6237\u8f93\u5165\u7684\u5458\u5de5\u7f16\u53f7\u8fdb\u884c\u6da8\u5de5\u8d4410%\uff0c\u4f46\u662f\u5982\u679c\u589e\u957f\u540e\u7684\u5de5\u8d44\u8d85\u8fc73200\u5219\u4e0d\u4e88\u589e\u957f\u3002<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>13.1 \u53d8\u91cf\u4e0e\u6570\u636e\u7c7b\u578b<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>declare \/\/\u5b9a\u4e49\u90e8\u5206\uff0c\u5b9a\u4e49\u53d8\u91cf\n\u53d8\u91cf\u540d \u6570\u636e\u7c7b\u578b := \u521d\u503c ; \n\u53d8\u91cf\u540d \u6570\u636e\u7c7b\u578b  default  \u521d\u503c ;\nconstant \u8868\u793a\u5b9a\u4e49\u7684\u662f\u5e38\u91cf\uff0c\u5fc5\u987b\u5148\u8981\u521d\u59cb\u5316\u5b83\nvar_empno number := 45 ; \u628a45\u8d4b\u503c\u7ed9var_empno<\/code><\/pre>\n\n\n\n<p> <strong>\u53d8\u91cf\u7684\u6807\u51c6\u6570\u636e\u7c7b\u578b\uff1a<\/strong> number\u6570\u5b57\u7c7b\u578b\uff0cint\u6574\u5f62\uff0cpls_integer\u6574\u6570\u578b\uff0cchar\uff08n\uff09\u5b9a\u957f\u5b57\u7b26\uff0cvarchar2\uff08n\uff09\u53d8\u957f\u5b57\u7b26\uff0cdate\uff08'yyyy-dd-mm hh24:mi;ss'\uff09\u65e5\u671f\u578b\uff0cboolean\u5e03\u5c14\u578b\u3002<\/p>\n\n\n\n<p class=\"has-background has-text-align-center has-very-light-gray-background-color\"><strong>13.2\u6d41\u7a0b\u63a7\u5236\u8bed\u53e5<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\"> d<strong>bms_output.put_line('hello world!');  \u8f93\u51fa\u6587\u672c\u4fe1\u606f<\/strong><br><br>begin <br>...<br>end<br>\u7a0b\u5e8f\u5f00\u59cb\u4e0e\u7ed3\u675f\u7684\u6807\u5fd7\u3002<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-red-color\">select\u8bed\u53e5\u8d4b\u503c\u7ed9\u53d8\u91cf\u8bed\u6cd5\uff1a<br>select &lt;\u67e5\u8be2\u7684\u5185\u5bb9&gt; into(\u8d4b\u503c\u7ed9) &lt;\u53d8\u91cf&gt; ;<br>\u5176\u4e2d\u67e5\u5230\u7684\u884c\u6570\u8981\u4e0e\u8d4b\u503c\u7684\u4e2a\u6570\u4fdd\u6301\u4e00\u81f4\uff01<\/p>\n\n\n\n<p>\u6761\u4ef6\u8bed\u53e5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if &lt;\u8868\u8fbe\u5f0f> then\n    \u8bed\u53e5\u5757;\nend if;\n\/\/if else\u7ed3\u6784\nif &lt;\u8868\u8fbe\u5f0f> then\n    \u8bed\u53e5\u57571;\nelse\n    \u8bed\u53e5\u57572;\nend if;\n\/\/if elseif else \u7ed3\u6784\nif &lt;\u8868\u8fbe\u5f0f1> then\n       \u8bed\u53e5\u57571;\nelsif &lt;\u8868\u8fbe\u5f0f2> then\n       \u8bed\u53e5\u57572;\nelse\n       \u8bed\u53e5\u57573;\nend if;<\/code><\/pre>\n\n\n\n<p>case\u8bed\u53e5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>case &lt;\u8868\u8fbe\u5f0f>\n    when &lt;\u8868\u8fbe\u5f0f1> then \u8bed\u53e5\u57571;\n    when &lt;\u8868\u8fbe\u5f0f2> then \u8bed\u53e5\u57572;\n      \u2026\u2026\n    when &lt;\u8868\u8fbe\u5f0fn> then \u8bed\u53e5\u5757n;\n   [ else \u8bed\u53e5\u5757 n+1 ]\nend ;<\/code><\/pre>\n\n\n\n<p>\u5faa\u73af\u8bed\u53e5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>loop\n  \u5faa\u73af\u4f53; \n  exit when \u5faa\u73af\u9000\u51fa\u6761\u4ef6\nend loop;\n\nwhile \u5faa\u73af\u6761\u4ef6\nloop \n    \u5faa\u73af\u4f53;\nend loop;\n\nfor \u5faa\u73af\u63a7\u5236\u53d8\u91cf in [reverse] \u5faa\u73af\u4e0b\u9650 .. \u5faa\u73af\u4e0a\u9650 \nloop\n  \u5faa\u73af\u4f53;\nend loop<\/code><\/pre>\n\n\n\n<p>for\u5faa\u73af\u5c55\u793a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>declare \n   sum_num number := 0; \/\/sum_number\u8d4b\u503c\u4e3a0\nbegin \/\/\u7a0b\u5e8f\u5f00\u59cb\n   for i in 1..100 \/\/for\u5faa\u73af i i\u4ece1\u5230100\nloop \/\/\u5faa\u73af\u6807\u5fd7\n     sum_num := sum_num + i; \/\/\u5faa\u73af\u4f53\n   end loop; \/\/\u7ed3\u675f\u5faa\u73af\n   dbms_output.put_line(sum_num); \/\/\u8f93\u51fa\u7ed3\u679c\nend; \/\/\u7ed3\u675f\u6807\u5fd7<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>0\u3001\u57fa\u7840 0.0\u4f7f\u7528\u524d\u63d0 \u4e0b\u5217\u6240\u6709\u7684\u4ee3\u7801\u7684\u524d\u63d0\u90fd\u662f\u518dOracle\u6570\u636e\u5e93\u4e2d\u5bfc\u5165\u4e86emp\u4e0edept\u8868\uff0c\u4f7f\u7528\u7684\u7528\u6237\u4e3aSCOTT\u7528\u6237\u5bc6\u7801T &#8230;<\/p>\n","protected":false},"author":1,"featured_media":312,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[29,41],"tags":[42,43],"class_list":["post-236","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-29","category-41","tag-oracle","tag-sql"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=\/wp\/v2\/posts\/236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=236"}],"version-history":[{"count":0,"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=\/wp\/v2\/posts\/236\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=\/wp\/v2\/media\/312"}],"wp:attachment":[{"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.overwatchss.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}