<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Joy's Devlog</title>
    <link>https://joysdevlog.tistory.com/</link>
    <description>Joy의 개발 블로그</description>
    <language>ko</language>
    <pubDate>Sat, 11 Apr 2026 15:17:37 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>DevJoy</managingEditor>
    <image>
      <title>Joy's Devlog</title>
      <url>https://tistory1.daumcdn.net/tistory/6630877/attach/0ae79ddad0e442bdaa38eeec3ff41f18</url>
      <link>https://joysdevlog.tistory.com</link>
    </image>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260226 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260226-TIL</link>
      <description>&lt;h1&gt;RAC(Cont.)&lt;/h1&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;네트워크 확인&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;RAC1&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac1 ~]# ping -c 3 rac2
PING rac2 (192.168.56.111) 56(84) bytes of data.
64 bytes from rac2 (192.168.56.111): icmp_seq=1 ttl=64 time=2.08 ms
64 bytes from rac2 (192.168.56.111): icmp_seq=2 ttl=64 time=0.658 ms
64 bytes from rac2 (192.168.56.111): icmp_seq=3 ttl=64 time=0.796 ms

--- rac2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2005ms
rtt min/avg/max/mdev = 0.658/1.180/2.088/0.645 ms
[root@rac1 ~]# ping -c 3 rac2-priv
PING rac2-priv (192.168.55.111) 56(84) bytes of data.
64 bytes from rac2-priv (192.168.55.111): icmp_seq=1 ttl=64 time=2.72 ms
64 bytes from rac2-priv (192.168.55.111): icmp_seq=2 ttl=64 time=0.822 ms
64 bytes from rac2-priv (192.168.55.111): icmp_seq=3 ttl=64 time=0.919 ms

--- rac2-priv ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2006ms
rtt min/avg/max/mdev = 0.822/1.489/2.727/0.876 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;RAC2&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac2 ~]# ping -c 3 rac1
PING rac1 (192.168.56.110) 56(84) bytes of data.
64 bytes from rac1 (192.168.56.110): icmp_seq=1 ttl=64 time=0.628 ms
64 bytes from rac1 (192.168.56.110): icmp_seq=2 ttl=64 time=2.09 ms
64 bytes from rac1 (192.168.56.110): icmp_seq=3 ttl=64 time=7.85 ms

--- rac1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2029ms
rtt min/avg/max/mdev = 0.628/3.526/7.853/3.118 ms
[root@rac2 ~]# ping -c 3 rac1-priv
PING rac1-priv (192.168.55.110) 56(84) bytes of data.
64 bytes from rac1-priv (192.168.55.110): icmp_seq=1 ttl=64 time=0.983 ms
64 bytes from rac1-priv (192.168.55.110): icmp_seq=2 ttl=64 time=1.69 ms
64 bytes from rac1-priv (192.168.55.110): icmp_seq=3 ttl=64 time=0.950 ms

--- rac1-priv ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2024ms
rtt min/avg/max/mdev = 0.950/1.208/1.692/0.343 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;grid s/w 설치&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;MobaXterm으로 rac1 oracle ssh 접속&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;jboss-cli&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ ls .bashrc
.bashrc
[oracle@rac1 ~]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
alias grid_env='. ~/.grid_env'
alias db_env='. ~/.db_env'&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;grid 환경으로 변경&lt;/h3&gt;
&lt;pre class=&quot;elixir&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ grid_env
[oracle@rac1 ~]$ echo $ORACLE_HOME
/u01/app/11.2.0/grid

[oracle@rac1 ~]$ echo $ORACLE_SID
+ASM1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;grid 설치&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ cd /media/sf_11g_rac_file/linux_11gR2_grid/grid
[oracle@rac1 grid]$ ls
doc  install  response  rpm  runcluvfy.sh  runInstaller  sshsetup  stage  welcome.html
[oracle@rac1 grid]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 80 MB.   Actual 5866 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4094 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2026-02-26_10-48-26AM. Please wait ...[oracle@rac1 grid]$&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bf3jfc/dJMcabjbhhi/Z21eZ6yIShFpnKsqD7abB1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bf3jfc/dJMcabjbhhi/Z21eZ6yIShFpnKsqD7abB1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bf3jfc/dJMcabjbhhi/Z21eZ6yIShFpnKsqD7abB1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbf3jfc%2FdJMcabjbhhi%2FZ21eZ6yIShFpnKsqD7abB1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;629&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Standalone Server : Single 인데 데이터베이스 스토리지를 ASM으로 사용하려는 경우 사용
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;기존에 사용하던거는 File System&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/xunHs/dJMcabDsZj6/blVaJpEykUTpvozEFId0W0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/xunHs/dJMcabDsZj6/blVaJpEykUTpvozEFId0W0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/xunHs/dJMcabDsZj6/blVaJpEykUTpvozEFId0W0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FxunHs%2FdJMcabDsZj6%2FblVaJpEykUTpvozEFId0W0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;629&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/JhKFx/dJMcabDsZkj/b1x8RhkUFcK81xttYOqKF1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/JhKFx/dJMcabDsZkj/b1x8RhkUFcK81xttYOqKF1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/JhKFx/dJMcabDsZkj/b1x8RhkUFcK81xttYOqKF1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FJhKFx%2FdJMcabDsZkj%2Fb1x8RhkUFcK81xttYOqKF1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;629&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/n6GKX/dJMcabDsZkb/uPsvPgX1jwlRLSavAlNrn1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/n6GKX/dJMcabDsZkb/uPsvPgX1jwlRLSavAlNrn1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/n6GKX/dJMcabDsZkb/uPsvPgX1jwlRLSavAlNrn1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fn6GKX%2FdJMcabDsZkb%2FuPsvPgX1jwlRLSavAlNrn1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;629&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;/etc/hosts 에서 설정한 grid scan 이름&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/ciUz3e/dJMcaaLjQ0V/qNFOxf3LILuvxj8d3Z8tUK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/ciUz3e/dJMcaaLjQ0V/qNFOxf3LILuvxj8d3Z8tUK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/ciUz3e/dJMcaaLjQ0V/qNFOxf3LILuvxj8d3Z8tUK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FciUz3e%2FdJMcaaLjQ0V%2FqNFOxf3LILuvxj8d3Z8tUK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;793&quot; height=&quot;629&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bpzrw9/dJMcafZ8Bjl/AqN0kxqgAgVKZF72rCT9QK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bpzrw9/dJMcafZ8Bjl/AqN0kxqgAgVKZF72rCT9QK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bpzrw9/dJMcafZ8Bjl/AqN0kxqgAgVKZF72rCT9QK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbpzrw9%2FdJMcafZ8Bjl%2FAqN0kxqgAgVKZF72rCT9QK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;802&quot; height=&quot;629&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;628&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/DaugZ/dJMcaiWQqqH/jjLraF2aBlflGlTe5HB781/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/DaugZ/dJMcaiWQqqH/jjLraF2aBlflGlTe5HB781/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/DaugZ/dJMcaiWQqqH/jjLraF2aBlflGlTe5HB781/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDaugZ%2FdJMcaiWQqqH%2FjjLraF2aBlflGlTe5HB781%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;793&quot; height=&quot;628&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;628&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;627&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/nuXEL/dJMcaiP4seu/kGO7AJUJuJl6KQOPL854i1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/nuXEL/dJMcaiP4seu/kGO7AJUJuJl6KQOPL854i1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/nuXEL/dJMcaiP4seu/kGO7AJUJuJl6KQOPL854i1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FnuXEL%2FdJMcaiP4seu%2FkGO7AJUJuJl6KQOPL854i1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;627&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;627&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;627&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bYZcB4/dJMcahXYm0s/1O37Li36o0ILktZKLz49kk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bYZcB4/dJMcahXYm0s/1O37Li36o0ILktZKLz49kk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bYZcB4/dJMcahXYm0s/1O37Li36o0ILktZKLz49kk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbYZcB4%2FdJMcahXYm0s%2F1O37Li36o0ILktZKLz49kk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;627&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;627&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;627&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/wnclB/dJMcagSjlcv/ajqdoEiBZlA2LfEAQI3Xsk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/wnclB/dJMcagSjlcv/ajqdoEiBZlA2LfEAQI3Xsk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/wnclB/dJMcagSjlcv/ajqdoEiBZlA2LfEAQI3Xsk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FwnclB%2FdJMcagSjlcv%2FajqdoEiBZlA2LfEAQI3Xsk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;627&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;627&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;794&quot; data-origin-height=&quot;628&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b697kP/dJMb99TaoX3/TNh9HtcCMsM2b2IKw53UP1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b697kP/dJMb99TaoX3/TNh9HtcCMsM2b2IKw53UP1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b697kP/dJMb99TaoX3/TNh9HtcCMsM2b2IKw53UP1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb697kP%2FdJMb99TaoX3%2FTNh9HtcCMsM2b2IKw53UP1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;794&quot; height=&quot;628&quot; data-origin-width=&quot;794&quot; data-origin-height=&quot;628&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;353&quot; data-origin-height=&quot;136&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/d4pC8G/dJMcahwVdk2/Y1am4tyURIQNn4Gkv92wg0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/d4pC8G/dJMcahwVdk2/Y1am4tyURIQNn4Gkv92wg0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/d4pC8G/dJMcahwVdk2/Y1am4tyURIQNn4Gkv92wg0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fd4pC8G%2FdJMcahwVdk2%2FY1am4tyURIQNn4Gkv92wg0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;353&quot; height=&quot;136&quot; data-origin-width=&quot;353&quot; data-origin-height=&quot;136&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;elixir&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ cd /dev/oracleasm/disks
[oracle@rac1 disks]$ ls
ASMDISK01  ASMDISK02  ASMDISK03  ASMDISK04  ASMDISK05  ASMDISK06  ASMDISK07&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/zoIRO/dJMcahwVdk5/HJL1vUoVS0rfc745PXH6Kk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/zoIRO/dJMcahwVdk5/HJL1vUoVS0rfc745PXH6Kk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/zoIRO/dJMcahwVdk5/HJL1vUoVS0rfc745PXH6Kk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FzoIRO%2FdJMcahwVdk5%2FHJL1vUoVS0rfc745PXH6Kk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;629&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;데이터의 복사본을 몇 개 만들지 선택
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;high : 삼중화&lt;/li&gt;
&lt;li&gt;normal : 이중화&lt;/li&gt;
&lt;li&gt;External : 복제 안 함&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;626&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/mALm9/dJMcaf6URVU/wHjDjCGVBC79q1Up1VeK51/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/mALm9/dJMcaf6URVU/wHjDjCGVBC79q1Up1VeK51/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/mALm9/dJMcaf6URVU/wHjDjCGVBC79q1Up1VeK51/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmALm9%2FdJMcaf6URVU%2FwHjDjCGVBC79q1Up1VeK51%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;626&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;626&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;oracle/oracle&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bC86kh/dJMcafy6HrX/R1Csc5anYpUbieFrMwzXZk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bC86kh/dJMcafy6HrX/R1Csc5anYpUbieFrMwzXZk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bC86kh/dJMcafy6HrX/R1Csc5anYpUbieFrMwzXZk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbC86kh%2FdJMcafy6HrX%2FR1Csc5anYpUbieFrMwzXZk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;629&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;804&quot; data-origin-height=&quot;632&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bdbNyb/dJMcaio3EHx/zyu7Mh0JufHu573oKfdvwk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bdbNyb/dJMcaio3EHx/zyu7Mh0JufHu573oKfdvwk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bdbNyb/dJMcaio3EHx/zyu7Mh0JufHu573oKfdvwk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbdbNyb%2FdJMcaio3EHx%2Fzyu7Mh0JufHu573oKfdvwk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;804&quot; height=&quot;632&quot; data-origin-width=&quot;804&quot; data-origin-height=&quot;632&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/nVQgt/dJMcagLydua/pW9XVcl3c5Q37gcUbZ0F71/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/nVQgt/dJMcagLydua/pW9XVcl3c5Q37gcUbZ0F71/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/nVQgt/dJMcagLydua/pW9XVcl3c5Q37gcUbZ0F71/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FnVQgt%2FdJMcagLydua%2FpW9XVcl3c5Q37gcUbZ0F71%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;629&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;632&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b6YHWu/dJMb996InWk/O1EU04Ymqv1KeU75Bqi9P0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b6YHWu/dJMb996InWk/O1EU04Ymqv1KeU75Bqi9P0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b6YHWu/dJMb996InWk/O1EU04Ymqv1KeU75Bqi9P0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb6YHWu%2FdJMb996InWk%2FO1EU04Ymqv1KeU75Bqi9P0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;632&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;632&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;630&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cCHQqk/dJMb996InWo/XB8wIjYFPIrNnPgghauGy0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cCHQqk/dJMb996InWo/XB8wIjYFPIrNnPgghauGy0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cCHQqk/dJMb996InWo/XB8wIjYFPIrNnPgghauGy0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcCHQqk%2FdJMb996InWo%2FXB8wIjYFPIrNnPgghauGy0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;630&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;630&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;631&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/blmBwE/dJMcacoPB3m/iWQI4TSoXCk5vlF2ojuzNk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/blmBwE/dJMcacoPB3m/iWQI4TSoXCk5vlF2ojuzNk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/blmBwE/dJMcacoPB3m/iWQI4TSoXCk5vlF2ojuzNk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FblmBwE%2FdJMcacoPB3m%2FiWQI4TSoXCk5vlF2ojuzNk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;802&quot; height=&quot;631&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;631&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;어쩔 수 없음 그냥 무시하고 넘어가면 됨&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;628&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/GDNjj/dJMcabDsZnY/7xbGwDhaCAgo7cA1GlvqW1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/GDNjj/dJMcabDsZnY/7xbGwDhaCAgo7cA1GlvqW1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/GDNjj/dJMcabDsZnY/7xbGwDhaCAgo7cA1GlvqW1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FGDNjj%2FdJMcabDsZnY%2F7xbGwDhaCAgo7cA1GlvqW1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;628&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;628&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;628&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/U5h4n/dJMcaivMmAi/bIpUXtYt6RsaFTKEBYaee1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/U5h4n/dJMcaivMmAi/bIpUXtYt6RsaFTKEBYaee1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/U5h4n/dJMcaivMmAi/bIpUXtYt6RsaFTKEBYaee1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FU5h4n%2FdJMcaivMmAi%2FbIpUXtYt6RsaFTKEBYaee1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;628&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;628&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;975&quot; data-origin-height=&quot;808&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bq2qPi/dJMcaivMmAu/V0IDwtHDbRm3uv0cKBCysK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bq2qPi/dJMcaivMmAu/V0IDwtHDbRm3uv0cKBCysK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bq2qPi/dJMcaivMmAu/V0IDwtHDbRm3uv0cKBCysK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbq2qPi%2FdJMcaivMmAu%2FV0IDwtHDbRm3uv0cKBCysK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;975&quot; height=&quot;808&quot; data-origin-width=&quot;975&quot; data-origin-height=&quot;808&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;순서 중요!!&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;# RAC1에서 orainstRoot.sh 수행
[root@rac1 ~]# /u01/app/oraInventory/orainstRoot.sh

# RAC2에서 orainstRoot.sh 수행
[root@rac2 ~]# /u01/app/oraInventory/orainstRoot.sh

# RAC1에서 root.sh 수행
[root@rac1 ~]# /u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: &amp;lt;&amp;lt;- ENTER

# RAC2에서 root.sh 수행
[root@rac2 ~]# /u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: &amp;lt;&amp;lt;- ENTER

# successful 뜨면 성공&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;failed 뜨면 grid s/w 삭제 후 재설치
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;로그 정보 확인&lt;/li&gt;
&lt;li&gt;오류가 난 경우 로그가 /u01/app/oracle/cfgtoollogs 디렉터리에 쌓임&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;jboss-cli&quot;&gt;&lt;code&gt;# 디렉터리 삭제(rac1)
rm -fr  /u01
rm -f  /etc/oraInst.loc  /etc/oratab
rm -f  /usr/bin/orachk  /usr/bin/tfactl
rm -fr  /etc/oracle
rm -fr  /var/tmp/.oracle  /var/opt/oracle
rm -fr  /opt/ORCLfmap  /opt/oracle  /opt/oracle.ahf
rm -rf /etc/ora*
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -f /etc/inittab.crs&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;mipsasm&quot;&gt;&lt;code&gt;# ASM Disk 목록 조회(rac1)
oracleasm listdisks

# ASM Disk 삭제(rac1)
oracleasm deletedisk asmdisk01
oracleasm deletedisk asmdisk02
...&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;properties&quot;&gt;&lt;code&gt;# ASM Disk 생성(rac1)
oracleasm createdisk ASMDISK01 /dev/sdb1;
oracleasm createdisk ASMDISK02 /dev/sdc1;
...

# RAC1, RAC2 모두 수행
oracleasm scandisks
oracleasm listdisks&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;stata&quot;&gt;&lt;code&gt;# 디렉터리 생성(rac1,2)
mkdir -p /u01/app/oraInventory
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/cfgtoollogs
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1   
chown -R oracle:oinstall /u01             
chmod -R 755 /u01

ls -RL /u01&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;vala&quot;&gt;&lt;code&gt;# OS 재시작(rac1,2)
reboot&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;runInstaller 다시 실행&lt;/li&gt;
&lt;li&gt;스크립트 실행 성공한 경우 네트워크와 crs_stat 확인&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:01:4A:35
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:289 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3004 (2.9 KiB)  TX bytes:47603 (46.4 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:7E:F9:63
          inet addr:192.168.56.110  Bcast:192.168.56.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:656738 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2264734 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:47064984 (44.8 MiB)  TX bytes:3284465349 (3.0 GiB)

eth1:1    Link encap:Ethernet  HWaddr 08:00:27:7E:F9:63
          inet addr:192.168.56.112  Bcast:192.168.56.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth1:2    Link encap:Ethernet  HWaddr 08:00:27:7E:F9:63
          inet addr:192.168.56.114  Bcast:192.168.56.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth2      Link encap:Ethernet  HWaddr 08:00:27:E5:B9:BB
          inet addr:192.168.55.110  Bcast:192.168.55.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:39642 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3536 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4159495 (3.9 MiB)  TX bytes:1578733 (1.5 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:158754 errors:0 dropped:0 overruns:0 frame:0
          TX packets:158754 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:139837251 (133.3 MiB)  TX bytes:139837251 (133.3 MiB)

[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    rac1
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1
ora.eons       ora.eons.type  ONLINE    ONLINE    rac1
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE
ora....network ora....rk.type ONLINE    ONLINE    rac1
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1
ora....SM1.asm application    ONLINE    ONLINE    rac1
ora.rac1.gsd   application    OFFLINE   OFFLINE
ora.rac1.ons   application    ONLINE    ONLINE    rac1
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1
ora....SM2.asm application    ONLINE    ONLINE    rac2
ora.rac2.gsd   application    OFFLINE   OFFLINE
ora.rac2.ons   application    ONLINE    ONLINE    rac2
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1          &lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac2 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:59:06:F4
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:239 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2254 (2.2 KiB)  TX bytes:38487 (37.5 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:15:4D:07
          inet addr:192.168.56.111  Bcast:192.168.56.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2196284 errors:0 dropped:0 overruns:0 frame:0
          TX packets:593505 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3267838243 (3.0 GiB)  TX bytes:40474179 (38.5 MiB)

eth1:1    Link encap:Ethernet  HWaddr 08:00:27:15:4D:07
          inet addr:192.168.56.113  Bcast:192.168.56.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth2      Link encap:Ethernet  HWaddr 08:00:27:40:54:08
          inet addr:192.168.55.111  Bcast:192.168.55.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:39785 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3343 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4473709 (4.2 MiB)  TX bytes:1312135 (1.2 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3614 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3614 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2856536 (2.7 MiB)  TX bytes:2856536 (2.7 MiB)

[root@rac2 ~]# su - oracle
[oracle@rac2 ~]$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATA.dg    ora....up.type ONLINE    ONLINE    rac1
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1
ora.asm        ora.asm.type   ONLINE    ONLINE    rac1
ora.eons       ora.eons.type  ONLINE    ONLINE    rac1
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE
ora....network ora....rk.type ONLINE    ONLINE    rac1
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE
ora.ons        ora.ons.type   ONLINE    ONLINE    rac1
ora....SM1.asm application    ONLINE    ONLINE    rac1
ora.rac1.gsd   application    OFFLINE   OFFLINE
ora.rac1.ons   application    ONLINE    ONLINE    rac1
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1
ora....SM2.asm application    ONLINE    ONLINE    rac2
ora.rac2.gsd   application    OFFLINE   OFFLINE
ora.rac2.ons   application    ONLINE    ONLINE    rac2
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/eAblTv/dJMcaaLjQ1w/lAfzyavyMDjMesgvZFr9M0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/eAblTv/dJMcaaLjQ1w/lAfzyavyMDjMesgvZFr9M0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/eAblTv/dJMcaaLjQ1w/lAfzyavyMDjMesgvZFr9M0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FeAblTv%2FdJMcaaLjQ1w%2FlAfzyavyMDjMesgvZFr9M0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;629&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;627&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bbJzUt/dJMcabKfPLh/eD5Mi71oetbnA7v9tos1Ok/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bbJzUt/dJMcabKfPLh/eD5Mi71oetbnA7v9tos1Ok/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bbJzUt/dJMcabKfPLh/eD5Mi71oetbnA7v9tos1Ok/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbbJzUt%2FdJMcabKfPLh%2FeD5Mi71oetbnA7v9tos1Ok%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;793&quot; height=&quot;627&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;627&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;MobaXterm을 이용해서 Oracle S/W 설치&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;db 환경으로 변경&lt;/h3&gt;
&lt;pre class=&quot;elixir&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ db_env
[oracle@rac1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@rac1 ~]$ echo $ORACLE_SID
racdb1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;db 설치&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ cd /media/sf_11g_rac_file/
[oracle@rac1 sf_11g_rac_file]$ ls
database  database.zip  Enterprise-R5-U6-Server-x86_64-dvd.iso  linux_11gR2_grid  linux_11gR2_grid.zip  oracleasmlib-2.0.4-1.el5.x86_64.rpm
[oracle@rac1 sf_11g_rac_file]$ cd database
[oracle@rac1 database]$ ls
doc  install  response  rpm  runInstaller  sshsetup  stage  welcome.html

[oracle@rac1 database]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 80 MB.   Actual 2847 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4085 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2026-02-26_02-43-02PM. Please wait ...&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;627&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/RYQsa/dJMcajuHahw/NBHvxjQGu1UnWEKbFS8Ky0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/RYQsa/dJMcajuHahw/NBHvxjQGu1UnWEKbFS8Ky0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/RYQsa/dJMcajuHahw/NBHvxjQGu1UnWEKbFS8Ky0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FRYQsa%2FdJMcajuHahw%2FNBHvxjQGu1UnWEKbFS8Ky0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;627&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;627&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;체크 해제&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;626&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/4KFNs/dJMcacvCKA1/SF5swxHpCGX261SdYjMjKk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/4KFNs/dJMcacvCKA1/SF5swxHpCGX261SdYjMjKk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/4KFNs/dJMcacvCKA1/SF5swxHpCGX261SdYjMjKk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F4KFNs%2FdJMcacvCKA1%2FSF5swxHpCGX261SdYjMjKk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;626&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;626&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;625&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/ITkL2/dJMcacvCKA2/khNS56FdcOfBsNxgZoZvk0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/ITkL2/dJMcacvCKA2/khNS56FdcOfBsNxgZoZvk0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/ITkL2/dJMcacvCKA2/khNS56FdcOfBsNxgZoZvk0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FITkL2%2FdJMcacvCKA2%2FkhNS56FdcOfBsNxgZoZvk0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;625&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;625&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bhi00e/dJMcag5Qpi5/W1biHDbvgSRQRsoNzwtWA1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bhi00e/dJMcag5Qpi5/W1biHDbvgSRQRsoNzwtWA1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bhi00e/dJMcag5Qpi5/W1biHDbvgSRQRsoNzwtWA1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbhi00e%2FdJMcag5Qpi5%2FW1biHDbvgSRQRsoNzwtWA1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;629&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;private connectivity가 연결되어 있어야 가능&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/AO34F/dJMcag5Qpjk/4pG61oydoT6cnw34JBSzHk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/AO34F/dJMcag5Qpjk/4pG61oydoT6cnw34JBSzHk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/AO34F/dJMcag5Qpjk/4pG61oydoT6cnw34JBSzHk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FAO34F%2FdJMcag5Qpjk%2F4pG61oydoT6cnw34JBSzHk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;629&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;625&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/tqt90/dJMcacbim0E/mUOUIsjPB452KQKc2BzMW1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/tqt90/dJMcacbim0E/mUOUIsjPB452KQKc2BzMW1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/tqt90/dJMcacbim0E/mUOUIsjPB452KQKc2BzMW1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Ftqt90%2FdJMcacbim0E%2FmUOUIsjPB452KQKc2BzMW1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;625&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;625&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;629&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bjadU0/dJMcac3phay/kKpEmDdBE6rgOwH1I1ECwk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bjadU0/dJMcac3phay/kKpEmDdBE6rgOwH1I1ECwk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bjadU0/dJMcac3phay/kKpEmDdBE6rgOwH1I1ECwk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbjadU0%2FdJMcac3phay%2FkKpEmDdBE6rgOwH1I1ECwk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;795&quot; height=&quot;629&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;629&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;498&quot; data-origin-height=&quot;375&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/GmuUA/dJMcahRcsJC/j3kUT1vgjKlrSLdKf8JDZ1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/GmuUA/dJMcahRcsJC/j3kUT1vgjKlrSLdKf8JDZ1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/GmuUA/dJMcahRcsJC/j3kUT1vgjKlrSLdKf8JDZ1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FGmuUA%2FdJMcahRcsJC%2Fj3kUT1vgjKlrSLdKf8JDZ1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;498&quot; height=&quot;375&quot; data-origin-width=&quot;498&quot; data-origin-height=&quot;375&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;624&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dsrRcd/dJMcah4KA7j/QEYKpdmzPT8dNfkD4IKask/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dsrRcd/dJMcah4KA7j/QEYKpdmzPT8dNfkD4IKask/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dsrRcd/dJMcah4KA7j/QEYKpdmzPT8dNfkD4IKask/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdsrRcd%2FdJMcah4KA7j%2FQEYKpdmzPT8dNfkD4IKask%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;624&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;624&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;공간 부족하면 grid 디렉터리 지우기&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;626&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/BbRar/dJMcajuHajh/U3Un9bK8VH1pzpJZLfRCak/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/BbRar/dJMcajuHajh/U3Un9bK8VH1pzpJZLfRCak/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/BbRar/dJMcajuHajh/U3Un9bK8VH1pzpJZLfRCak/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FBbRar%2FdJMcajuHajh%2FU3Un9bK8VH1pzpJZLfRCak%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;626&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;626&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;631&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cmU9D5/dJMcaiJjbq8/B7Dej5K7YuvOks0qK5kKLk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cmU9D5/dJMcaiJjbq8/B7Dej5K7YuvOks0qK5kKLk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cmU9D5/dJMcaiJjbq8/B7Dej5K7YuvOks0qK5kKLk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcmU9D5%2FdJMcaiJjbq8%2FB7Dej5K7YuvOks0qK5kKLk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;631&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;631&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;801&quot; data-origin-height=&quot;628&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/nQTkL/dJMcabjbhnV/Ci5KYQmKoeSyMnbNwKf7G1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/nQTkL/dJMcabjbhnV/Ci5KYQmKoeSyMnbNwKf7G1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/nQTkL/dJMcabjbhnV/Ci5KYQmKoeSyMnbNwKf7G1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FnQTkL%2FdJMcabjbhnV%2FCi5KYQmKoeSyMnbNwKf7G1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;801&quot; height=&quot;628&quot; data-origin-width=&quot;801&quot; data-origin-height=&quot;628&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;오류 해결&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;631&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/060EU/dJMcaiJjbri/9fhNTobwJgGEkRI5aG0YE1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/060EU/dJMcaiJjbri/9fhNTobwJgGEkRI5aG0YE1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/060EU/dJMcaiJjbri/9fhNTobwJgGEkRI5aG0YE1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F060EU%2FdJMcaiJjbri%2F9fhNTobwJgGEkRI5aG0YE1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;631&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;631&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;subunit&quot;&gt;&lt;code&gt;Error in invoking target 'nmo' of makefile 
'/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk'. 
See '/u01/app/oraInventory/logs/installActions2026-02-26_02-43-02PM.log' for details.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;crystal&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ vi /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;674&quot; data-origin-height=&quot;454&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bYYJvo/dJMcacI9C0w/dxWwvhcmEU0xl6Hke4KDN0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bYYJvo/dJMcacI9C0w/dxWwvhcmEU0xl6Hke4KDN0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bYYJvo/dJMcacI9C0w/dxWwvhcmEU0xl6Hke4KDN0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbYYJvo%2FdJMcacI9C0w%2FdxWwvhcmEU0xl6Hke4KDN0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;674&quot; height=&quot;454&quot; data-origin-width=&quot;674&quot; data-origin-height=&quot;454&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;diff&quot;&gt;&lt;code&gt;-lnnz11&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;627&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bjRK2M/dJMcaf6URZS/jnlbrJ4N69zK3183LOLqpK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bjRK2M/dJMcaf6URZS/jnlbrJ4N69zK3183LOLqpK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bjRK2M/dJMcaf6URZS/jnlbrJ4N69zK3183LOLqpK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbjRK2M%2FdJMcaf6URZS%2FjnlbrJ4N69zK3183LOLqpK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;627&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;627&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;오류 창 안 나올 때까지 Continue&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;630&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/SwXwF/dJMcahp9exL/ET7uBBkVHajctqn08gADl1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/SwXwF/dJMcahp9exL/ET7uBBkVHajctqn08gADl1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/SwXwF/dJMcahp9exL/ET7uBBkVHajctqn08gADl1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FSwXwF%2FdJMcahp9exL%2FET7uBBkVHajctqn08gADl1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;630&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;630&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;스크립트 실행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ su -
Password:

[root@rac1 ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: &amp;lt;&amp;lt;- 엔터
The file &quot;dbhome&quot; already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y &amp;lt;&amp;lt;- 입력
   Copying dbhome to /usr/local/bin ...
The file &quot;oraenv&quot; already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y &amp;lt;&amp;lt;- 입력
   Copying oraenv to /usr/local/bin ...
The file &quot;coraenv&quot; already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y &amp;lt;&amp;lt;- 입력
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;[oracle@rac2 ~]$ su -
Password:

[root@rac2 ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: &amp;lt;&amp;lt;- 엔터
The file &quot;dbhome&quot; already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y &amp;lt;&amp;lt;- 입력
   Copying dbhome to /usr/local/bin ...
The file &quot;oraenv&quot; already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y &amp;lt;&amp;lt;- 입력
   Copying oraenv to /usr/local/bin ...
The file &quot;coraenv&quot; already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y &amp;lt;&amp;lt;- 입력
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;627&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bszAa9/dJMcabjbhnX/xyoTlqZ4Z65q8Dx0TeCMo1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bszAa9/dJMcabjbhnX/xyoTlqZ4Z65q8Dx0TeCMo1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bszAa9/dJMcabjbhnX/xyoTlqZ4Z65q8Dx0TeCMo1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbszAa9%2FdJMcabjbhnX%2FxyoTlqZ4Z65q8Dx0TeCMo1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;795&quot; height=&quot;627&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;627&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;MobaXterm을 이용해서 ASM 디스크 그룹 설정&lt;/h2&gt;
&lt;pre class=&quot;elixir&quot;&gt;&lt;code&gt;[oracle@rac1 database]$ cd
[oracle@rac1 ~]$  grid_env
[oracle@rac1 ~]$  echo $ORACLE_HOME
/u01/app/11.2.0/grid
[oracle@rac1 ~]$  echo $ORACLE_SID
+ASM1
[oracle@rac1 ~]$  . oraenv
ORACLE_SID = [+ASM1] ?
The Oracle base for ORACLE_HOME=/u01/app/11.2.0/grid is /u01/app/oracle
[oracle@rac1 ~]$  asmca
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;962&quot; data-origin-height=&quot;567&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dooS7r/dJMcafZ8Boz/xmh2EYHu0XdeKVBRUKu8G0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dooS7r/dJMcafZ8Boz/xmh2EYHu0XdeKVBRUKu8G0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dooS7r/dJMcafZ8Boz/xmh2EYHu0XdeKVBRUKu8G0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdooS7r%2FdJMcafZ8Boz%2Fxmh2EYHu0XdeKVBRUKu8G0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;962&quot; height=&quot;567&quot; data-origin-width=&quot;962&quot; data-origin-height=&quot;567&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;960&quot; data-origin-height=&quot;563&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dkZ5Lq/dJMcaaLjQ3S/cYsiNfKRe0a3RR9KLKqQYk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dkZ5Lq/dJMcaaLjQ3S/cYsiNfKRe0a3RR9KLKqQYk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dkZ5Lq/dJMcaaLjQ3S/cYsiNfKRe0a3RR9KLKqQYk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdkZ5Lq%2FdJMcaaLjQ3S%2FcYsiNfKRe0a3RR9KLKqQYk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;960&quot; height=&quot;563&quot; data-origin-width=&quot;960&quot; data-origin-height=&quot;563&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;858&quot; data-origin-height=&quot;613&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bag494/dJMcafZ8BoI/Lqvyr114Zibm9psxNZYrmK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bag494/dJMcafZ8BoI/Lqvyr114Zibm9psxNZYrmK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bag494/dJMcafZ8BoI/Lqvyr114Zibm9psxNZYrmK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbag494%2FdJMcafZ8BoI%2FLqvyr114Zibm9psxNZYrmK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;858&quot; height=&quot;613&quot; data-origin-width=&quot;858&quot; data-origin-height=&quot;613&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;860&quot; data-origin-height=&quot;609&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/I7Pex/dJMcafZ8BoJ/thAqSwcB8DKIBxpkp1gRSk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/I7Pex/dJMcafZ8BoJ/thAqSwcB8DKIBxpkp1gRSk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/I7Pex/dJMcafZ8BoJ/thAqSwcB8DKIBxpkp1gRSk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FI7Pex%2FdJMcafZ8BoJ%2FthAqSwcB8DKIBxpkp1gRSk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;860&quot; height=&quot;609&quot; data-origin-width=&quot;860&quot; data-origin-height=&quot;609&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;960&quot; data-origin-height=&quot;568&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cC3vnZ/dJMcafZ8BoP/qnQu00Ol0gRw9R0fMKgy0K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cC3vnZ/dJMcafZ8BoP/qnQu00Ol0gRw9R0fMKgy0K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cC3vnZ/dJMcafZ8BoP/qnQu00Ol0gRw9R0fMKgy0K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcC3vnZ%2FdJMcafZ8BoP%2FqnQu00Ol0gRw9R0fMKgy0K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;960&quot; height=&quot;568&quot; data-origin-width=&quot;960&quot; data-origin-height=&quot;568&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;956&quot; data-origin-height=&quot;568&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bKbYff/dJMcaflyI0b/DrUcWN27i8OZRsqYolVkWk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bKbYff/dJMcaflyI0b/DrUcWN27i8OZRsqYolVkWk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bKbYff/dJMcaflyI0b/DrUcWN27i8OZRsqYolVkWk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbKbYff%2FdJMcaflyI0b%2FDrUcWN27i8OZRsqYolVkWk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;956&quot; height=&quot;568&quot; data-origin-width=&quot;956&quot; data-origin-height=&quot;568&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;MobaXterm을 이용해서 DB 생성&lt;/h2&gt;
&lt;pre class=&quot;elixir&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ db_env
[oracle@rac1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@rac1 ~]$ echo $ORACLE_SID
racdb1
[oracle@rac1 ~]$ . oraenv
ORACLE_SID = [racdb1] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/dbhome_1
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle
[oracle@rac1 ~]$ dbca&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;535&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/maisI/dJMcai3AQEX/wL4RrVyIrsleSUtGKhTRt1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/maisI/dJMcai3AQEX/wL4RrVyIrsleSUtGKhTRt1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/maisI/dJMcai3AQEX/wL4RrVyIrsleSUtGKhTRt1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmaisI%2FdJMcai3AQEX%2FwL4RrVyIrsleSUtGKhTRt1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;746&quot; height=&quot;535&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;535&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;743&quot; data-origin-height=&quot;533&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/2RX56/dJMcai3AQE1/PwKs7AaaCM1BMKqRfgusm0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/2RX56/dJMcai3AQE1/PwKs7AaaCM1BMKqRfgusm0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/2RX56/dJMcai3AQE1/PwKs7AaaCM1BMKqRfgusm0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F2RX56%2FdJMcai3AQE1%2FPwKs7AaaCM1BMKqRfgusm0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;743&quot; height=&quot;533&quot; data-origin-width=&quot;743&quot; data-origin-height=&quot;533&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;745&quot; data-origin-height=&quot;534&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/HohNo/dJMcajg8Qxo/K88R2LtQYMCdUdFqwbRwlK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/HohNo/dJMcajg8Qxo/K88R2LtQYMCdUdFqwbRwlK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/HohNo/dJMcajg8Qxo/K88R2LtQYMCdUdFqwbRwlK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FHohNo%2FdJMcajg8Qxo%2FK88R2LtQYMCdUdFqwbRwlK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;745&quot; height=&quot;534&quot; data-origin-width=&quot;745&quot; data-origin-height=&quot;534&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;742&quot; data-origin-height=&quot;532&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cLse9S/dJMcajg8Qxp/1D3iw6NoSdF3iBLyReAjHk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cLse9S/dJMcajg8Qxp/1D3iw6NoSdF3iBLyReAjHk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cLse9S/dJMcajg8Qxp/1D3iw6NoSdF3iBLyReAjHk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcLse9S%2FdJMcajg8Qxp%2F1D3iw6NoSdF3iBLyReAjHk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;742&quot; height=&quot;532&quot; data-origin-width=&quot;742&quot; data-origin-height=&quot;532&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;741&quot; data-origin-height=&quot;533&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/UvY7h/dJMcaf6UR2f/E8yQZrjep0a6XDOIhK7WZk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/UvY7h/dJMcaf6UR2f/E8yQZrjep0a6XDOIhK7WZk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/UvY7h/dJMcaf6UR2f/E8yQZrjep0a6XDOIhK7WZk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FUvY7h%2FdJMcaf6UR2f%2FE8yQZrjep0a6XDOIhK7WZk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;741&quot; height=&quot;533&quot; data-origin-width=&quot;741&quot; data-origin-height=&quot;533&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;742&quot; data-origin-height=&quot;536&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cbKKZG/dJMcaaR6KA2/44UZKMhyNiIjpCU6nNnSFk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cbKKZG/dJMcaaR6KA2/44UZKMhyNiIjpCU6nNnSFk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cbKKZG/dJMcaaR6KA2/44UZKMhyNiIjpCU6nNnSFk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcbKKZG%2FdJMcaaR6KA2%2F44UZKMhyNiIjpCU6nNnSFk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;742&quot; height=&quot;536&quot; data-origin-width=&quot;742&quot; data-origin-height=&quot;536&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;748&quot; data-origin-height=&quot;535&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bPB51C/dJMcaaEzsKo/WJgnpLuePBqMoYMtP7OHK0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bPB51C/dJMcaaEzsKo/WJgnpLuePBqMoYMtP7OHK0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bPB51C/dJMcaaEzsKo/WJgnpLuePBqMoYMtP7OHK0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbPB51C%2FdJMcaaEzsKo%2FWJgnpLuePBqMoYMtP7OHK0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;748&quot; height=&quot;535&quot; data-origin-width=&quot;748&quot; data-origin-height=&quot;535&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;oracle/oracle&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;749&quot; data-origin-height=&quot;535&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b21TDZ/dJMcaaR6KBd/RkFKWQ0vKiKYSbtZKMKZJ0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b21TDZ/dJMcaaR6KBd/RkFKWQ0vKiKYSbtZKMKZJ0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b21TDZ/dJMcaaR6KBd/RkFKWQ0vKiKYSbtZKMKZJ0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb21TDZ%2FdJMcaaR6KBd%2FRkFKWQ0vKiKYSbtZKMKZJ0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;749&quot; height=&quot;535&quot; data-origin-width=&quot;749&quot; data-origin-height=&quot;535&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;743&quot; data-origin-height=&quot;537&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/R7wDW/dJMcahjo4R6/3j7NrXxGC9hqFGn8cOlfRk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/R7wDW/dJMcahjo4R6/3j7NrXxGC9hqFGn8cOlfRk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/R7wDW/dJMcahjo4R6/3j7NrXxGC9hqFGn8cOlfRk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FR7wDW%2FdJMcahjo4R6%2F3j7NrXxGC9hqFGn8cOlfRk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;743&quot; height=&quot;537&quot; data-origin-width=&quot;743&quot; data-origin-height=&quot;537&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;749&quot; data-origin-height=&quot;534&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/lAZVf/dJMcahjo4R9/2cOSb9scXQT0AGPkTUeQM0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/lAZVf/dJMcahjo4R9/2cOSb9scXQT0AGPkTUeQM0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/lAZVf/dJMcahjo4R9/2cOSb9scXQT0AGPkTUeQM0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlAZVf%2FdJMcahjo4R9%2F2cOSb9scXQT0AGPkTUeQM0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;749&quot; height=&quot;534&quot; data-origin-width=&quot;749&quot; data-origin-height=&quot;534&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;oracle&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;745&quot; data-origin-height=&quot;536&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bfbdu6/dJMcabXLjvS/GDzIX4usUrQ2gRPx6d8ek1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bfbdu6/dJMcabXLjvS/GDzIX4usUrQ2gRPx6d8ek1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bfbdu6/dJMcabXLjvS/GDzIX4usUrQ2gRPx6d8ek1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbfbdu6%2FdJMcabXLjvS%2FGDzIX4usUrQ2gRPx6d8ek1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;745&quot; height=&quot;536&quot; data-origin-width=&quot;745&quot; data-origin-height=&quot;536&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;533&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cJALPn/dJMcadOKtCn/iGIyKRiCs3riKIA7MCRQI0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cJALPn/dJMcadOKtCn/iGIyKRiCs3riKIA7MCRQI0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cJALPn/dJMcadOKtCn/iGIyKRiCs3riKIA7MCRQI0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcJALPn%2FdJMcadOKtCn%2FiGIyKRiCs3riKIA7MCRQI0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;746&quot; height=&quot;533&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;533&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;HR 유저 샘플 데이터&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;539&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/w9sxc/dJMcaa5CF5k/FgKBLYMzniVl2sr2YN7Oh1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/w9sxc/dJMcaa5CF5k/FgKBLYMzniVl2sr2YN7Oh1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/w9sxc/dJMcaa5CF5k/FgKBLYMzniVl2sr2YN7Oh1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fw9sxc%2FdJMcaa5CF5k%2FFgKBLYMzniVl2sr2YN7Oh1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;746&quot; height=&quot;539&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;539&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;744&quot; data-origin-height=&quot;535&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/t3iIs/dJMcaaR6KBl/gKsHC7WkqhpWCgDZQt7WWk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/t3iIs/dJMcaaR6KBl/gKsHC7WkqhpWCgDZQt7WWk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/t3iIs/dJMcaaR6KBl/gKsHC7WkqhpWCgDZQt7WWk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Ft3iIs%2FdJMcaaR6KBl%2FgKsHC7WkqhpWCgDZQt7WWk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;744&quot; height=&quot;535&quot; data-origin-width=&quot;744&quot; data-origin-height=&quot;535&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;744&quot; data-origin-height=&quot;533&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/wAeFz/dJMcad2hWNK/FJ82KeboUyNN73fd1o6wzk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/wAeFz/dJMcad2hWNK/FJ82KeboUyNN73fd1o6wzk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/wAeFz/dJMcad2hWNK/FJ82KeboUyNN73fd1o6wzk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FwAeFz%2FdJMcad2hWNK%2FFJ82KeboUyNN73fd1o6wzk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;744&quot; height=&quot;533&quot; data-origin-width=&quot;744&quot; data-origin-height=&quot;533&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;744&quot; data-origin-height=&quot;539&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bWX1Wd/dJMcaaR6KBt/dofQpDKAcl7JKZYMXNAqVk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bWX1Wd/dJMcaaR6KBt/dofQpDKAcl7JKZYMXNAqVk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bWX1Wd/dJMcaaR6KBt/dofQpDKAcl7JKZYMXNAqVk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbWX1Wd%2FdJMcaaR6KBt%2FdofQpDKAcl7JKZYMXNAqVk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;744&quot; height=&quot;539&quot; data-origin-width=&quot;744&quot; data-origin-height=&quot;539&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;745&quot; data-origin-height=&quot;528&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/qtXKr/dJMcajnSFMW/VGIeTF4TZ4VJzhMgsnwbgk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/qtXKr/dJMcajnSFMW/VGIeTF4TZ4VJzhMgsnwbgk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/qtXKr/dJMcajnSFMW/VGIeTF4TZ4VJzhMgsnwbgk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FqtXKr%2FdJMcajnSFMW%2FVGIeTF4TZ4VJzhMgsnwbgk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;745&quot; height=&quot;528&quot; data-origin-width=&quot;745&quot; data-origin-height=&quot;528&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;740&quot; data-origin-height=&quot;536&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/In5X2/dJMcabDsZA5/C7GaP5j49UWOh9ZbF5mckK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/In5X2/dJMcabDsZA5/C7GaP5j49UWOh9ZbF5mckK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/In5X2/dJMcabDsZA5/C7GaP5j49UWOh9ZbF5mckK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FIn5X2%2FdJMcabDsZA5%2FC7GaP5j49UWOh9ZbF5mckK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;740&quot; height=&quot;536&quot; data-origin-width=&quot;740&quot; data-origin-height=&quot;536&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;이 설정을 바꿔야 하는 경우 컨트롤 파일을 재생성해야 함&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;743&quot; data-origin-height=&quot;538&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cujOng/dJMb99MnGQ8/Ghty7dGKKNmKhqVSLn1ikk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cujOng/dJMb99MnGQ8/Ghty7dGKKNmKhqVSLn1ikk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cujOng/dJMb99MnGQ8/Ghty7dGKKNmKhqVSLn1ikk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcujOng%2FdJMb99MnGQ8%2FGhty7dGKKNmKhqVSLn1ikk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;743&quot; height=&quot;538&quot; data-origin-width=&quot;743&quot; data-origin-height=&quot;538&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;743&quot; data-origin-height=&quot;532&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/r1o52/dJMb99MnGRa/CxkVnTK1FVDh6eKanqV9v0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/r1o52/dJMb99MnGRa/CxkVnTK1FVDh6eKanqV9v0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/r1o52/dJMb99MnGRa/CxkVnTK1FVDh6eKanqV9v0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fr1o52%2FdJMb99MnGRa%2FCxkVnTK1FVDh6eKanqV9v0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;743&quot; height=&quot;532&quot; data-origin-width=&quot;743&quot; data-origin-height=&quot;532&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;744&quot; data-origin-height=&quot;536&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Br4bU/dJMcacbinaC/i9ywMvNNUCwit5tE8fvbt0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Br4bU/dJMcacbinaC/i9ywMvNNUCwit5tE8fvbt0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Br4bU/dJMcacbinaC/i9ywMvNNUCwit5tE8fvbt0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FBr4bU%2FdJMcacbinaC%2Fi9ywMvNNUCwit5tE8fvbt0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;744&quot; height=&quot;536&quot; data-origin-width=&quot;744&quot; data-origin-height=&quot;536&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;537&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/luQFM/dJMcacCnpeo/RwmjHvVCiDo6mUCKaKFNL0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/luQFM/dJMcacCnpeo/RwmjHvVCiDo6mUCKaKFNL0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/luQFM/dJMcacCnpeo/RwmjHvVCiDo6mUCKaKFNL0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FluQFM%2FdJMcacCnpeo%2FRwmjHvVCiDo6mUCKaKFNL0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;746&quot; height=&quot;537&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;537&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;684&quot; data-origin-height=&quot;807&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/xb2K6/dJMcac3phdS/CFyJXLkPEUkJR06KoO38a1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/xb2K6/dJMcac3phdS/CFyJXLkPEUkJR06KoO38a1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/xb2K6/dJMcac3phdS/CFyJXLkPEUkJR06KoO38a1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fxb2K6%2FdJMcac3phdS%2FCFyJXLkPEUkJR06KoO38a1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;684&quot; height=&quot;807&quot; data-origin-width=&quot;684&quot; data-origin-height=&quot;807&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;605&quot; data-origin-height=&quot;450&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/lmRF9/dJMcac3phea/k0cmUrb6kzLBHK8TSh8Hqk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/lmRF9/dJMcac3phea/k0cmUrb6kzLBHK8TSh8Hqk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/lmRF9/dJMcac3phea/k0cmUrb6kzLBHK8TSh8Hqk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlmRF9%2FdJMcac3phea%2Fk0cmUrb6kzLBHK8TSh8Hqk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;605&quot; height=&quot;450&quot; data-origin-width=&quot;605&quot; data-origin-height=&quot;450&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;428&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/2b6YJ/dJMcagSjlk3/Uc3JoALYIDSWFxTokEkrd1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/2b6YJ/dJMcagSjlk3/Uc3JoALYIDSWFxTokEkrd1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/2b6YJ/dJMcagSjlk3/Uc3JoALYIDSWFxTokEkrd1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F2b6YJ%2FdJMcagSjlk3%2FUc3JoALYIDSWFxTokEkrd1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;746&quot; height=&quot;428&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;428&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;842&quot; data-origin-height=&quot;534&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/uCRYE/dJMcagSjlk6/Ipw4Vpvk7wSe1cZGnwAkc0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/uCRYE/dJMcagSjlk6/Ipw4Vpvk7wSe1cZGnwAkc0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/uCRYE/dJMcagSjlk6/Ipw4Vpvk7wSe1cZGnwAkc0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FuCRYE%2FdJMcagSjlk6%2FIpw4Vpvk7wSe1cZGnwAkc0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;842&quot; height=&quot;534&quot; data-origin-width=&quot;842&quot; data-origin-height=&quot;534&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;노드 별 환경 설정 후 SQL*Plus로 접속&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;RAC1&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ db_env
[oracle@rac1 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@rac1 ~]$ . oraenv
ORACLE_SID = [racdb1] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/dbhome_1
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle
[oracle@rac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 26 16:12:22 2026

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL&amp;gt; select name from v$database;

NAME
---------
RACDB
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;RAC2&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac2 ~]# su - oracle
[oracle@rac2 ~]$ db_env
[oracle@rac2 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@rac2 ~]$ . oraenv
ORACLE_SID = [racdb2] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/dbhome_1
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 is /u01/app/oracle
[oracle@rac2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 26 16:12:27 2026

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL&amp;gt; select name from v$database;

NAME
---------
RACDB
&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>rac</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/239</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260226-TIL#entry239comment</comments>
      <pubDate>Sun, 15 Mar 2026 23:22:36 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260225 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260225-TIL</link>
      <description>&lt;h1&gt;RAC&lt;/h1&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;3840&quot; data-origin-height=&quot;2160&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bBUgoR/dJMcaio3Es8/53agJr8MI3s115uG1LQ6i0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bBUgoR/dJMcaio3Es8/53agJr8MI3s115uG1LQ6i0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bBUgoR/dJMcaio3Es8/53agJr8MI3s115uG1LQ6i0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbBUgoR%2FdJMcaio3Es8%2F53agJr8MI3s115uG1LQ6i0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3840&quot; height=&quot;2160&quot; data-origin-width=&quot;3840&quot; data-origin-height=&quot;2160&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;환경 설정&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;환경 변수 설정&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# oracle 계정에서 수행
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ vi .bash_profile

export TMP=/tmp
export TMPDIR=$TMP
export EDITOR=vi
export ORACLE_HOSTNAME=rac1                            
export ORACLE_UNQNAME=racdb                                
export ORACLE_BASE=/u01/app/oracle
export DB_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1    
export ORACLE_HOME=$DB_HOME                
export GRID_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=racdb1                                
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

umask 022&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;grid 환경 설정 파일 생성&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;vi .grid_env        

export ORACLE_SID=+ASM1 # +ASM2                        
export ORACLE_HOME=$GRID_HOME
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;db 환경 설정 파일 생성&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;vi .db_env

export ORACLE_SID=racdb1 # racdb2
export ORACLE_HOME=$DB_HOME
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;grid_env, db_env 별칭 설정&lt;/h3&gt;
&lt;pre class=&quot;jboss-cli&quot;&gt;&lt;code&gt;vi .bashrc            

alias grid_env='. ~/.grid_env'
alias db_env='. ~/.db_env'

[oracle@rac1 ~]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
alias grid_env='. ~/.grid_env'
alias db_env='. ~/.db_env'
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;OS 종료&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ exit
logout
[root@rac1 ~]# shutdown -h now

Broadcast message from root (pts/1) (Wed Feb 25 10:54:43 2026):

The system is going down for system halt NOW!&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;ASM Disk 생성(윈도우)&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;CMD에서 생성&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;843&quot; data-origin-height=&quot;866&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bJYxUb/dJMb99MnGB3/MWckmWbpknjmQnHP9Lv6jK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bJYxUb/dJMb99MnGB3/MWckmWbpknjmQnHP9Lv6jK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bJYxUb/dJMb99MnGB3/MWckmWbpknjmQnHP9Lv6jK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbJYxUb%2FdJMb99MnGB3%2FMWckmWbpknjmQnHP9Lv6jK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;843&quot; height=&quot;866&quot; data-origin-width=&quot;843&quot; data-origin-height=&quot;866&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;jboss-cli&quot;&gt;&lt;code&gt;cd C:\Program Files\Oracle\VirtualBox   

VBoxManage.exe createhd --filename c:\ORACLE\asm_disk1.vdi --size 5120 --format VDI --variant fixed  
VBoxManage.exe createhd --filename c:\ORACLE\asm_disk2.vdi --size 5120 --format VDI --variant fixed
VBoxManage.exe createhd --filename c:\ORACLE\asm_disk3.vdi --size 5120 --format VDI --variant fixed
VBoxManage.exe createhd --filename c:\ORACLE\asm_disk4.vdi --size 5120 --format VDI --variant fixed
VBoxManage.exe createhd --filename c:\ORACLE\asm_disk5.vdi --size 5120 --format VDI --variant fixed
VBoxManage.exe createhd --filename c:\ORACLE\asm_disk6.vdi --size 5120 --format VDI --variant fixed

VBoxManage.exe modifyhd c:\ORACLE\asm_disk1.vdi --type shareable
VBoxManage.exe modifyhd c:\ORACLE\asm_disk2.vdi --type shareable
VBoxManage.exe modifyhd c:\ORACLE\asm_disk3.vdi --type shareable
VBoxManage.exe modifyhd c:\ORACLE\asm_disk4.vdi --type shareable
VBoxManage.exe modifyhd c:\ORACLE\asm_disk5.vdi --type shareable
VBoxManage.exe modifyhd c:\ORACLE\asm_disk6.vdi --type shareable&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1061&quot; data-origin-height=&quot;628&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bCDMfy/dJMcaio3Euc/yXmmSrv4kvwVL6830hC2EK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bCDMfy/dJMcaio3Euc/yXmmSrv4kvwVL6830hC2EK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bCDMfy/dJMcaio3Euc/yXmmSrv4kvwVL6830hC2EK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbCDMfy%2FdJMcaio3Euc%2FyXmmSrv4kvwVL6830hC2EK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1061&quot; height=&quot;628&quot; data-origin-width=&quot;1061&quot; data-origin-height=&quot;628&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Virtual Box에서 생성&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;946&quot; data-origin-height=&quot;373&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/KsJZ5/dJMb996InOZ/SmjqNpHlsQjmXbFNZmADu1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/KsJZ5/dJMb996InOZ/SmjqNpHlsQjmXbFNZmADu1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/KsJZ5/dJMb996InOZ/SmjqNpHlsQjmXbFNZmADu1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FKsJZ5%2FdJMb996InOZ%2FSmjqNpHlsQjmXbFNZmADu1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;946&quot; height=&quot;373&quot; data-origin-width=&quot;946&quot; data-origin-height=&quot;373&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;946&quot; data-origin-height=&quot;373&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bHCKKl/dJMcai3AQvD/qjP8BARYYJnBK2lPXxrKP0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bHCKKl/dJMcai3AQvD/qjP8BARYYJnBK2lPXxrKP0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bHCKKl/dJMcai3AQvD/qjP8BARYYJnBK2lPXxrKP0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbHCKKl%2FdJMcai3AQvD%2FqjP8BARYYJnBK2lPXxrKP0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;946&quot; height=&quot;373&quot; data-origin-width=&quot;946&quot; data-origin-height=&quot;373&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;601&quot; data-origin-height=&quot;365&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/drwb6s/dJMcai3AQwa/o8ApMXAeIPfiDIGRFLFgoK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/drwb6s/dJMcai3AQwa/o8ApMXAeIPfiDIGRFLFgoK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/drwb6s/dJMcai3AQwa/o8ApMXAeIPfiDIGRFLFgoK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fdrwb6s%2FdJMcai3AQwa%2Fo8ApMXAeIPfiDIGRFLFgoK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;601&quot; height=&quot;365&quot; data-origin-width=&quot;601&quot; data-origin-height=&quot;365&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;601&quot; data-origin-height=&quot;365&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bok0fP/dJMcai3AQwy/J5R9d7h2QbpxAm3kVj0Qbk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bok0fP/dJMcai3AQwy/J5R9d7h2QbpxAm3kVj0Qbk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bok0fP/dJMcai3AQwy/J5R9d7h2QbpxAm3kVj0Qbk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbok0fP%2FdJMcai3AQwy%2FJ5R9d7h2QbpxAm3kVj0Qbk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;601&quot; height=&quot;365&quot; data-origin-width=&quot;601&quot; data-origin-height=&quot;365&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;941&quot; data-origin-height=&quot;527&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bzuVAN/dJMb996InPi/psj8GF5mPSeNpyKCcyytxK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bzuVAN/dJMb996InPi/psj8GF5mPSeNpyKCcyytxK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bzuVAN/dJMb996InPi/psj8GF5mPSeNpyKCcyytxK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbzuVAN%2FdJMb996InPi%2Fpsj8GF5mPSeNpyKCcyytxK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;941&quot; height=&quot;527&quot; data-origin-width=&quot;941&quot; data-origin-height=&quot;527&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;609&quot; data-origin-height=&quot;364&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/osODU/dJMcabDsZbY/yn9Kl13aAMmPLKrJIw46yK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/osODU/dJMcabDsZbY/yn9Kl13aAMmPLKrJIw46yK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/osODU/dJMcabDsZbY/yn9Kl13aAMmPLKrJIw46yK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FosODU%2FdJMcabDsZbY%2Fyn9Kl13aAMmPLKrJIw46yK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;609&quot; height=&quot;364&quot; data-origin-width=&quot;609&quot; data-origin-height=&quot;364&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;953&quot; data-origin-height=&quot;360&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cczg1k/dJMcabDsZcs/BPUzTqreg6h0BRv5rWufa1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cczg1k/dJMcabDsZcs/BPUzTqreg6h0BRv5rWufa1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cczg1k/dJMcabDsZcs/BPUzTqreg6h0BRv5rWufa1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fcczg1k%2FdJMcabDsZcs%2FBPUzTqreg6h0BRv5rWufa1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;953&quot; height=&quot;360&quot; data-origin-width=&quot;953&quot; data-origin-height=&quot;360&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;953&quot; data-origin-height=&quot;360&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cwBn2B/dJMb996InPF/UBrE86n8azZm8010PmOUIK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cwBn2B/dJMb996InPF/UBrE86n8azZm8010PmOUIK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cwBn2B/dJMb996InPF/UBrE86n8azZm8010PmOUIK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcwBn2B%2FdJMb996InPF%2FUBrE86n8azZm8010PmOUIK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;953&quot; height=&quot;360&quot; data-origin-width=&quot;953&quot; data-origin-height=&quot;360&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;950&quot; data-origin-height=&quot;1023&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/doZuQS/dJMb996InPI/Hj12pXNtlc0PlHVYRuiSF1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/doZuQS/dJMb996InPI/Hj12pXNtlc0PlHVYRuiSF1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/doZuQS/dJMb996InPI/Hj12pXNtlc0PlHVYRuiSF1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdoZuQS%2FdJMb996InPI%2FHj12pXNtlc0PlHVYRuiSF1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;950&quot; height=&quot;1023&quot; data-origin-width=&quot;950&quot; data-origin-height=&quot;1023&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;ASM Disk 추가&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;484&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bj9182/dJMcac3pgZx/ptHuHo6XIXKsmpqIShxkc0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bj9182/dJMcac3pgZx/ptHuHo6XIXKsmpqIShxkc0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bj9182/dJMcac3pgZx/ptHuHo6XIXKsmpqIShxkc0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbj9182%2FdJMcac3pgZx%2FptHuHo6XIXKsmpqIShxkc0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;746&quot; height=&quot;484&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;484&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;484&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cPUiC0/dJMcah4KA2D/VX4o62HIoRVQBKmYsGWHdK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cPUiC0/dJMcah4KA2D/VX4o62HIoRVQBKmYsGWHdK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cPUiC0/dJMcah4KA2D/VX4o62HIoRVQBKmYsGWHdK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcPUiC0%2FdJMcah4KA2D%2FVX4o62HIoRVQBKmYsGWHdK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;746&quot; height=&quot;484&quot; data-origin-width=&quot;746&quot; data-origin-height=&quot;484&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;734&quot; data-origin-height=&quot;503&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/DXefP/dJMcah4KA2H/euo95yefgRewNxgxl0bBEk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/DXefP/dJMcah4KA2H/euo95yefgRewNxgxl0bBEk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/DXefP/dJMcah4KA2H/euo95yefgRewNxgxl0bBEk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FDXefP%2FdJMcah4KA2H%2Feuo95yefgRewNxgxl0bBEk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;734&quot; height=&quot;503&quot; data-origin-width=&quot;734&quot; data-origin-height=&quot;503&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;734&quot; data-origin-height=&quot;503&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bAMv1Q/dJMb996InPU/2LpnBSKGeWoNalKjPOodGk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bAMv1Q/dJMb996InPU/2LpnBSKGeWoNalKjPOodGk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bAMv1Q/dJMb996InPU/2LpnBSKGeWoNalKjPOodGk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbAMv1Q%2FdJMb996InPU%2F2LpnBSKGeWoNalKjPOodGk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;734&quot; height=&quot;503&quot; data-origin-width=&quot;734&quot; data-origin-height=&quot;503&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;OS 시작&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;fdisk : 물리적인 디스크에 논리적 파티션을 생성하는 명령어&lt;/h3&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;[root@rac1 ~]# fdisk -l

Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         535     4192965   82  Linux swap / Solaris
/dev/sda3             536        2610    16667437+  83  Linux

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/sde: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sde doesn't contain a valid partition table

Disk /dev/sdf: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdf doesn't contain a valid partition table

Disk /dev/sdg: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdg doesn't contain a valid partition table

Disk /dev/sdh: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdh doesn't contain a valid partition table&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;[root@rac1 ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab                                     el
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n &amp;lt;&amp;lt;- 입력
Command action
   e   extended
   p   primary partition (1-4)
p &amp;lt;&amp;lt;- 입력
Partition number (1-4): 1 &amp;lt;&amp;lt;- 입력
First cylinder (1-652, default 1): &amp;lt;&amp;lt;- 엔터
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-652, default 652): &amp;lt;&amp;lt;- 엔터
Using default value 652

Command (m for help): w &amp;lt;&amp;lt;- 입력
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

# 순서대로 위와 똑같이 수행
fdisk /dev/sdc
fdisk /dev/sdd
fdisk /dev/sde
fdisk /dev/sdf
fdisk /dev/sdg
fdisk /dev/sdh&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 ~]# fdisk -l |perl -ne 'print if/^\/dev\/sd[b-h]\d/'
/dev/sdb1               1         652     5237158+  83  Linux
/dev/sdc1               1         652     5237158+  83  Linux
/dev/sdd1               1         652     5237158+  83  Linux
/dev/sde1               1         652     5237158+  83  Linux
/dev/sdf1               1         652     5237158+  83  Linux
/dev/sdg1               1         652     5237158+  83  Linux
/dev/sdh1               1         652     5237158+  83  Linux&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;ASM 라이브러리 드라이버 구성&lt;/h2&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac1 ~]# oracleasm configure -i
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting &amp;lt;ENTER&amp;gt; without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle &amp;lt;&amp;lt;- 입력
Default group to own the driver interface []: oinstall &amp;lt;&amp;lt;- 입력
Start Oracle ASM library driver on boot (y/n) [n]: y &amp;lt;&amp;lt;- 입력
Scan for Oracle ASM disks on boot (y/n) [y]: &amp;lt;&amp;lt;- 엔터
Writing Oracle ASM library driver configuration: done&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;ASM 라이브러리 드라이브 환경 초기화&lt;/h2&gt;
&lt;pre class=&quot;awk&quot;&gt;&lt;code&gt;[root@rac1 ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module &quot;oracleasm&quot;: oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;ASM 디스크 생성(Linux)&lt;/h2&gt;
&lt;pre class=&quot;awk&quot;&gt;&lt;code&gt;oracleasm createdisk ASMDISK01 /dev/sdb1
oracleasm createdisk ASMDISK02 /dev/sdc1
oracleasm createdisk ASMDISK03 /dev/sdd1
oracleasm createdisk ASMDISK04 /dev/sde1
oracleasm createdisk ASMDISK05 /dev/sdf1
oracleasm createdisk ASMDISK06 /dev/sdg1
oracleasm createdisk ASMDISK07 /dev/sdh1&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;properties&quot;&gt;&lt;code&gt;[root@rac1 ~]# ls -l /etc/init.d
lrwxrwxrwx 1 root root 11 Feb 24 21:56 /etc/init.d -&amp;gt; rc.d/init.d

[root@rac1 ~]# ls /etc/init.d
acpid           cups-config-daemon  iptables      mdmonitor       ntpd             restorecond     syslog
anacron         dnsmasq             irda          mdmpd           o2cb             rhnsd           sysstat
atd             dund                irqbalance    messagebus      ocfs2            rpcgssd         vboxadd
auditd          firstboot           iscsi         microcode_ctl   oracleasm        rpcidmapd       vboxadd-service
autofs          functions           iscsid        multipathd      oraclevalidated  rpcsvcgssd      vncserver
avahi-daemon    gpm                 isdn          netconsole      pand             saslauthd       wdaemon
avahi-dnsconfd  haldaemon           kdump         netfs           pcscd            sendmail        winbind
bluetooth       halt                killall       netplugd        portmap          setroubleshoot  wpa_supplicant
capi            hidd                krb524        network         psacct           single          xfs
conman          hplip               kudzu         NetworkManager  rawdevices       smartd          xinetd
cpuspeed        ip6tables           lm_sensors    nfs             rdisc            snmpd           ypbind
crond           ipmi                lvm2-monitor  nfslock         readahead_early  snmptrapd       yum-updatesd
cups            ipmievd             mcstrans      nscd            readahead_later  sshd&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac1 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:               [  OK  ]

[root@rac1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;생성된 ASM 디스크 확인&lt;/h2&gt;
&lt;pre class=&quot;autoit&quot;&gt;&lt;code&gt;[root@rac1 ~]# oracleasm listdisks
ASMDISK01
ASMDISK02
ASMDISK03
ASMDISK04
ASMDISK05
ASMDISK06
ASMDISK07&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;OS 종료&lt;/h2&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac1 ~]# shutdown -h now

Broadcast message from root (pts/1) (Wed Feb 25 12:10:16 2026):

The system is going down for system halt NOW!&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;RAC1 복제하여 RAC2 생성&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;수동 복제&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;CMD(관리자 권한)에서 rac1 가상 디스크 파일 복사하여 rac2 가상 디스크 파일 생성&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;taggerscript&quot;&gt;&lt;code&gt;cd C:\Program Files\Oracle\VirtualBox
VBoxManage.exe clonehd c:\ORACLE\rac1\rac1.vdi c:\ORACLE\rac2.vdi&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1063&quot; data-origin-height=&quot;627&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bBvnd0/dJMcafsjl27/D6hLLnB1FQrnDPX4NPmLB0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bBvnd0/dJMcafsjl27/D6hLLnB1FQrnDPX4NPmLB0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bBvnd0/dJMcafsjl27/D6hLLnB1FQrnDPX4NPmLB0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbBvnd0%2FdJMcafsjl27%2FD6hLLnB1FQrnDPX4NPmLB0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1063&quot; height=&quot;627&quot; data-origin-width=&quot;1063&quot; data-origin-height=&quot;627&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;rac2 가상 머신 생성&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;370&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/coL79q/dJMcajnSFwp/vcQrh7KONKHfeF1gI9LYT0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/coL79q/dJMcajnSFwp/vcQrh7KONKHfeF1gI9LYT0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/coL79q/dJMcajnSFwp/vcQrh7KONKHfeF1gI9LYT0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcoL79q%2FdJMcajnSFwp%2FvcQrh7KONKHfeF1gI9LYT0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;802&quot; height=&quot;370&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;370&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;370&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bwDnLX/dJMcaaq1ryj/zU9xQfPEbeioPRcXKHZ4EK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bwDnLX/dJMcaaq1ryj/zU9xQfPEbeioPRcXKHZ4EK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bwDnLX/dJMcaaq1ryj/zU9xQfPEbeioPRcXKHZ4EK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbwDnLX%2FdJMcaaq1ryj%2FzU9xQfPEbeioPRcXKHZ4EK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;802&quot; height=&quot;370&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;370&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;위에서 만들어 놓은 rac2.vdi 파일 선택&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;804&quot; data-origin-height=&quot;373&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/clKMli/dJMcaaq1ryo/fMYg3xCCmGkKO2hAZmLcf1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/clKMli/dJMcaaq1ryo/fMYg3xCCmGkKO2hAZmLcf1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/clKMli/dJMcaaq1ryo/fMYg3xCCmGkKO2hAZmLcf1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FclKMli%2FdJMcaaq1ryo%2FfMYg3xCCmGkKO2hAZmLcf1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;804&quot; height=&quot;373&quot; data-origin-width=&quot;804&quot; data-origin-height=&quot;373&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;804&quot; data-origin-height=&quot;373&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/ZxatJ/dJMcaflyIPh/kpcqDzbYLwep4qeyyHM7qk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/ZxatJ/dJMcaflyIPh/kpcqDzbYLwep4qeyyHM7qk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/ZxatJ/dJMcaflyIPh/kpcqDzbYLwep4qeyyHM7qk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FZxatJ%2FdJMcaflyIPh%2FkpcqDzbYLwep4qeyyHM7qk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;804&quot; height=&quot;373&quot; data-origin-width=&quot;804&quot; data-origin-height=&quot;373&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;ASM 디스크 추가&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;742&quot; data-origin-height=&quot;488&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dKJyMj/dJMcabpWP2D/LUuDXRzFCdWDfx6O1xXvGK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dKJyMj/dJMcabpWP2D/LUuDXRzFCdWDfx6O1xXvGK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dKJyMj/dJMcabpWP2D/LUuDXRzFCdWDfx6O1xXvGK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdKJyMj%2FdJMcabpWP2D%2FLUuDXRzFCdWDfx6O1xXvGK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;742&quot; height=&quot;488&quot; data-origin-width=&quot;742&quot; data-origin-height=&quot;488&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;네트워크 설정&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;740&quot; data-origin-height=&quot;481&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/beYD2w/dJMcag5Qo7L/E3CK7wklTF61tNHoOg3g5k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/beYD2w/dJMcag5Qo7L/E3CK7wklTF61tNHoOg3g5k/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/beYD2w/dJMcag5Qo7L/E3CK7wklTF61tNHoOg3g5k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbeYD2w%2FdJMcag5Qo7L%2FE3CK7wklTF61tNHoOg3g5k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;740&quot; height=&quot;481&quot; data-origin-width=&quot;740&quot; data-origin-height=&quot;481&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;741&quot; data-origin-height=&quot;488&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bNAib2/dJMcafToQtE/Y8gW1JRjzIkK9lYRB0D0j0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bNAib2/dJMcafToQtE/Y8gW1JRjzIkK9lYRB0D0j0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bNAib2/dJMcafToQtE/Y8gW1JRjzIkK9lYRB0D0j0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbNAib2%2FdJMcafToQtE%2FY8gW1JRjzIkK9lYRB0D0j0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;741&quot; height=&quot;488&quot; data-origin-width=&quot;741&quot; data-origin-height=&quot;488&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;739&quot; data-origin-height=&quot;479&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cpHkXr/dJMcaaduEUL/KM3Kl6hcUykFd4ickKt28K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cpHkXr/dJMcaaduEUL/KM3Kl6hcUykFd4ickKt28K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cpHkXr/dJMcaaduEUL/KM3Kl6hcUykFd4ickKt28K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcpHkXr%2FdJMcaaduEUL%2FKM3Kl6hcUykFd4ickKt28K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;739&quot; height=&quot;479&quot; data-origin-width=&quot;739&quot; data-origin-height=&quot;479&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;955&quot; data-origin-height=&quot;860&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cXbBpB/dJMcacoPBXQ/eNYkS75x42mvHBKNfWY9kK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cXbBpB/dJMcacoPBXQ/eNYkS75x42mvHBKNfWY9kK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cXbBpB/dJMcacoPBXQ/eNYkS75x42mvHBKNfWY9kK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcXbBpB%2FdJMcacoPBXQ%2FeNYkS75x42mvHBKNfWY9kK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;955&quot; height=&quot;860&quot; data-origin-width=&quot;955&quot; data-origin-height=&quot;860&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Virtual Box에서 수행&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;955&quot; data-origin-height=&quot;836&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cnvv7Q/dJMcadVwSK8/3fo0WilVVRgGmlKfq8gkK1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cnvv7Q/dJMcadVwSK8/3fo0WilVVRgGmlKfq8gkK1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cnvv7Q/dJMcadVwSK8/3fo0WilVVRgGmlKfq8gkK1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fcnvv7Q%2FdJMcadVwSK8%2F3fo0WilVVRgGmlKfq8gkK1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;955&quot; height=&quot;836&quot; data-origin-width=&quot;955&quot; data-origin-height=&quot;836&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;554&quot; data-origin-height=&quot;356&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bg8xi2/dJMcadVwSLa/zACYgnp9z7SM5WHCuOYE41/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bg8xi2/dJMcadVwSLa/zACYgnp9z7SM5WHCuOYE41/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bg8xi2/dJMcadVwSLa/zACYgnp9z7SM5WHCuOYE41/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbg8xi2%2FdJMcadVwSLa%2FzACYgnp9z7SM5WHCuOYE41%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;554&quot; height=&quot;356&quot; data-origin-width=&quot;554&quot; data-origin-height=&quot;356&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;557&quot; data-origin-height=&quot;356&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/uinPY/dJMcadVwSLm/PMf1kvOZLmJZx5mbIYJL5K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/uinPY/dJMcadVwSLm/PMf1kvOZLmJZx5mbIYJL5K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/uinPY/dJMcadVwSLm/PMf1kvOZLmJZx5mbIYJL5K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FuinPY%2FdJMcadVwSLm%2FPMf1kvOZLmJZx5mbIYJL5K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;557&quot; height=&quot;356&quot; data-origin-width=&quot;557&quot; data-origin-height=&quot;356&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;956&quot; data-origin-height=&quot;827&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dmUYce/dJMcaf6URSQ/pr7Dett1JTeoulYCgOwMk1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dmUYce/dJMcaf6URSQ/pr7Dett1JTeoulYCgOwMk1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dmUYce/dJMcaf6URSQ/pr7Dett1JTeoulYCgOwMk1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdmUYce%2FdJMcaf6URSQ%2Fpr7Dett1JTeoulYCgOwMk1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;956&quot; height=&quot;827&quot; data-origin-width=&quot;956&quot; data-origin-height=&quot;827&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;디스크가 잘못 설정되어 있음&lt;/li&gt;
&lt;li&gt;추가된 디스크 삭제하고 기존에 생성해둔 asm 디스크로 설정&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;738&quot; data-origin-height=&quot;481&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/byxbsl/dJMcafZ8Bd2/O8ZKWxkIOG1yL9RUsBR0a0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/byxbsl/dJMcafZ8Bd2/O8ZKWxkIOG1yL9RUsBR0a0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/byxbsl/dJMcafZ8Bd2/O8ZKWxkIOG1yL9RUsBR0a0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbyxbsl%2FdJMcafZ8Bd2%2FO8ZKWxkIOG1yL9RUsBR0a0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;738&quot; height=&quot;481&quot; data-origin-width=&quot;738&quot; data-origin-height=&quot;481&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;737&quot; data-origin-height=&quot;484&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/qHvqu/dJMcafZ8Bd6/KKqZJGPW7PmdBgqBy6gg31/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/qHvqu/dJMcafZ8Bd6/KKqZJGPW7PmdBgqBy6gg31/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/qHvqu/dJMcafZ8Bd6/KKqZJGPW7PmdBgqBy6gg31/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FqHvqu%2FdJMcafZ8Bd6%2FKKqZJGPW7PmdBgqBy6gg31%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;737&quot; height=&quot;484&quot; data-origin-width=&quot;737&quot; data-origin-height=&quot;484&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;739&quot; data-origin-height=&quot;483&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/xEU87/dJMcajuHabP/vsPbglYSAE7p1gElkSuGF0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/xEU87/dJMcajuHabP/vsPbglYSAE7p1gElkSuGF0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/xEU87/dJMcajuHabP/vsPbglYSAE7p1gElkSuGF0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FxEU87%2FdJMcajuHabP%2FvsPbglYSAE7p1gElkSuGF0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;739&quot; height=&quot;483&quot; data-origin-width=&quot;739&quot; data-origin-height=&quot;483&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;951&quot; data-origin-height=&quot;823&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bm093n/dJMcacvCKqB/tuAtalWpJTK7ktKpSMygLk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bm093n/dJMcacvCKqB/tuAtalWpJTK7ktKpSMygLk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bm093n/dJMcacvCKqB/tuAtalWpJTK7ktKpSMygLk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbm093n%2FdJMcacvCKqB%2FtuAtalWpJTK7ktKpSMygLk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;951&quot; height=&quot;823&quot; data-origin-width=&quot;951&quot; data-origin-height=&quot;823&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;미디어에서 잘못 생성된 디스크들 삭제&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;958&quot; data-origin-height=&quot;489&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bkQRYP/dJMcaiP4r57/rVji02eju5STMlx7ut4kw0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bkQRYP/dJMcaiP4r57/rVji02eju5STMlx7ut4kw0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bkQRYP/dJMcaiP4r57/rVji02eju5STMlx7ut4kw0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbkQRYP%2FdJMcaiP4r57%2FrVji02eju5STMlx7ut4kw0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;958&quot; height=&quot;489&quot; data-origin-width=&quot;958&quot; data-origin-height=&quot;489&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;955&quot; data-origin-height=&quot;403&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/R6HWe/dJMcaiP4r6a/1MhhRNTwe0ORGEa24TkY41/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/R6HWe/dJMcaiP4r6a/1MhhRNTwe0ORGEa24TkY41/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/R6HWe/dJMcaiP4r6a/1MhhRNTwe0ORGEa24TkY41/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FR6HWe%2FdJMcaiP4r6a%2F1MhhRNTwe0ORGEa24TkY41%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;955&quot; height=&quot;403&quot; data-origin-width=&quot;955&quot; data-origin-height=&quot;403&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;RAC2 시작&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;RAC1과 RAC2는 현재 완전히 똑같은 상태이므로 동시에 실행하면 충돌됨&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;이더넷 설정(GUI)&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;665&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cUZUYj/dJMcacWElrF/s56HOXVnrmIwRdpMiwOHs1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cUZUYj/dJMcacWElrF/s56HOXVnrmIwRdpMiwOHs1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cUZUYj/dJMcacWElrF/s56HOXVnrmIwRdpMiwOHs1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcUZUYj%2FdJMcacWElrF%2Fs56HOXVnrmIwRdpMiwOHs1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;665&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;665&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dhk73E/dJMcacWElrS/M3wKXh6XUh5vKjK5Owkrx1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dhk73E/dJMcacWElrS/M3wKXh6XUh5vKjK5Owkrx1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dhk73E/dJMcacWElrS/M3wKXh6XUh5vKjK5Owkrx1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fdhk73E%2FdJMcacWElrS%2FM3wKXh6XUh5vKjK5Owkrx1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;667&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;모두 비활성화&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;458&quot; data-origin-height=&quot;452&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b8dGbm/dJMcacWElr5/1jtfkcHJ2AVecHOh76XXEk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b8dGbm/dJMcacWElr5/1jtfkcHJ2AVecHOh76XXEk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b8dGbm/dJMcacWElr5/1jtfkcHJ2AVecHOh76XXEk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb8dGbm%2FdJMcacWElr5%2F1jtfkcHJ2AVecHOh76XXEk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;458&quot; height=&quot;452&quot; data-origin-width=&quot;458&quot; data-origin-height=&quot;452&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;eth1 IP 및 서브넷 설정&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;517&quot; data-origin-height=&quot;533&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/b3q6eT/dJMcacWElr7/7gLMOC37dYTSeEpoijXtuK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/b3q6eT/dJMcacWElr7/7gLMOC37dYTSeEpoijXtuK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/b3q6eT/dJMcacWElr7/7gLMOC37dYTSeEpoijXtuK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fb3q6eT%2FdJMcacWElr7%2F7gLMOC37dYTSeEpoijXtuK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;517&quot; height=&quot;533&quot; data-origin-width=&quot;517&quot; data-origin-height=&quot;533&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;eth2 IP 및 서브넷 설정&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;520&quot; data-origin-height=&quot;524&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Lswqp/dJMcacWElsh/0nSCgt3eLCnYMfeVkZxAak/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Lswqp/dJMcacWElsh/0nSCgt3eLCnYMfeVkZxAak/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Lswqp/dJMcacWElsh/0nSCgt3eLCnYMfeVkZxAak/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FLswqp%2FdJMcacWElsh%2F0nSCgt3eLCnYMfeVkZxAak%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;520&quot; height=&quot;524&quot; data-origin-width=&quot;520&quot; data-origin-height=&quot;524&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;ethN.bak 은 모두 삭제&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;458&quot; data-origin-height=&quot;456&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bwSB7f/dJMcai3AQy0/QufZv2gaggze0Lgatglp21/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bwSB7f/dJMcai3AQy0/QufZv2gaggze0Lgatglp21/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bwSB7f/dJMcai3AQy0/QufZv2gaggze0Lgatglp21/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbwSB7f%2FdJMcai3AQy0%2FQufZv2gaggze0Lgatglp21%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;458&quot; height=&quot;456&quot; data-origin-width=&quot;458&quot; data-origin-height=&quot;456&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;eth0, 1, 2 활성화&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;453&quot; data-origin-height=&quot;452&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/kLd36/dJMcajnSFGE/nWo1pjG60nx30wSVctjxyK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/kLd36/dJMcajnSFGE/nWo1pjG60nx30wSVctjxyK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/kLd36/dJMcajnSFGE/nWo1pjG60nx30wSVctjxyK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FkLd36%2FdJMcajnSFGE%2FnWo1pjG60nx30wSVctjxyK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;453&quot; height=&quot;452&quot; data-origin-width=&quot;453&quot; data-origin-height=&quot;452&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;이더넷 설정(터미널)&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;659&quot; data-origin-height=&quot;247&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/xX1fb/dJMb99MnGD3/K8DtjjbEeQqVFPfMHMQmKk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/xX1fb/dJMb99MnGD3/K8DtjjbEeQqVFPfMHMQmKk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/xX1fb/dJMb99MnGD3/K8DtjjbEeQqVFPfMHMQmKk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FxX1fb%2FdJMb99MnGD3%2FK8DtjjbEeQqVFPfMHMQmKk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;659&quot; height=&quot;247&quot; data-origin-width=&quot;659&quot; data-origin-height=&quot;247&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 네트워크 서비스 상태 확인
service network status

# 네티워크 서비스 중지
service network stop&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;528&quot; data-origin-height=&quot;224&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/9BBAb/dJMcabQYQPp/hV0s6TayBE4Ud5h67xddK0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/9BBAb/dJMcabQYQPp/hV0s6TayBE4Ud5h67xddK0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/9BBAb/dJMcabQYQPp/hV0s6TayBE4Ud5h67xddK0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F9BBAb%2FdJMcabQYQPp%2FhV0s6TayBE4Ud5h67xddK0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;528&quot; height=&quot;224&quot; data-origin-width=&quot;528&quot; data-origin-height=&quot;224&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;awk&quot;&gt;&lt;code&gt;cd /etc/sysconfig/network-scripts/&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;386&quot; data-origin-height=&quot;136&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cmKhvg/dJMcadurA9S/oO3XKkpsrjs17qfKaR7oyk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cmKhvg/dJMcadurA9S/oO3XKkpsrjs17qfKaR7oyk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cmKhvg/dJMcadurA9S/oO3XKkpsrjs17qfKaR7oyk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcmKhvg%2FdJMcadurA9S%2FoO3XKkpsrjs17qfKaR7oyk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;386&quot; height=&quot;136&quot; data-origin-width=&quot;386&quot; data-origin-height=&quot;136&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;jboss-cli&quot;&gt;&lt;code&gt;# .bak가 붙은 파일들 삭제
ls *.bak
rm *.bak&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;500&quot; data-origin-height=&quot;341&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/vMpQs/dJMcaaR6Ksl/irdNsTUCFKOQuNWMUUi541/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/vMpQs/dJMcaaR6Ksl/irdNsTUCFKOQuNWMUUi541/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/vMpQs/dJMcaaR6Ksl/irdNsTUCFKOQuNWMUUi541/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FvMpQs%2FdJMcaaR6Ksl%2FirdNsTUCFKOQuNWMUUi541%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;500&quot; height=&quot;341&quot; data-origin-width=&quot;500&quot; data-origin-height=&quot;341&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;awk&quot;&gt;&lt;code&gt;# rac2 ip 주소 확인
cat /etc/hosts&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;661&quot; data-origin-height=&quot;200&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/c0VxMc/dJMcaaR6Ksm/735b0Yi9AtDrPcgpJOzChK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/c0VxMc/dJMcaaR6Ksm/735b0Yi9AtDrPcgpJOzChK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/c0VxMc/dJMcaaR6Ksm/735b0Yi9AtDrPcgpJOzChK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fc0VxMc%2FdJMcaaR6Ksm%2F735b0Yi9AtDrPcgpJOzChK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;661&quot; height=&quot;200&quot; data-origin-width=&quot;661&quot; data-origin-height=&quot;200&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;makefile&quot;&gt;&lt;code&gt;# eth1 설정
vi ifcfg-eth1

BOOTPROTO=static
IPADDR=192.168.56.111
NETMASK=255.255.255.0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;658&quot; data-origin-height=&quot;200&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/CO9w6/dJMcahKsxGA/sHqPQOcrX6OCL1Y3SkfkvK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/CO9w6/dJMcahKsxGA/sHqPQOcrX6OCL1Y3SkfkvK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/CO9w6/dJMcahKsxGA/sHqPQOcrX6OCL1Y3SkfkvK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FCO9w6%2FdJMcahKsxGA%2FsHqPQOcrX6OCL1Y3SkfkvK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;658&quot; height=&quot;200&quot; data-origin-width=&quot;658&quot; data-origin-height=&quot;200&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;makefile&quot;&gt;&lt;code&gt;# eth2 설정
vi ifcfg-eth2

BOOTPROTO=static
IPADDR=192.168.55.111
NETMASK=255.255.255.0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;641&quot; data-origin-height=&quot;122&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bIy1fA/dJMcahKsxGE/hIpE27LEmVQBng53kVvPB1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bIy1fA/dJMcahKsxGE/hIpE27LEmVQBng53kVvPB1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bIy1fA/dJMcahKsxGE/hIpE27LEmVQBng53kVvPB1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbIy1fA%2FdJMcahKsxGE%2FhIpE27LEmVQBng53kVvPB1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;641&quot; height=&quot;122&quot; data-origin-width=&quot;641&quot; data-origin-height=&quot;122&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 네트워크 서비스 시작
service network start&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;host 설정&lt;/h2&gt;
&lt;pre class=&quot;awk&quot;&gt;&lt;code&gt;vi /etc/hosts&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;662&quot; data-origin-height=&quot;382&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/EoJdc/dJMcajnSFGW/Z1WFMAZSeBRZPVD0Cm6XAk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/EoJdc/dJMcajnSFGW/Z1WFMAZSeBRZPVD0Cm6XAk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/EoJdc/dJMcajnSFGW/Z1WFMAZSeBRZPVD0Cm6XAk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FEoJdc%2FdJMcajnSFGW%2FZ1WFMAZSeBRZPVD0Cm6XAk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;662&quot; height=&quot;382&quot; data-origin-width=&quot;662&quot; data-origin-height=&quot;382&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;rac1 &amp;rarr; rac2로 변경&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;awk&quot;&gt;&lt;code&gt;vi /etc/sysconfig/network&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;659&quot; data-origin-height=&quot;128&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/s585f/dJMcajnSFGZ/jG0fqWP1qFeP3NvMzbFtXK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/s585f/dJMcajnSFGZ/jG0fqWP1qFeP3NvMzbFtXK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/s585f/dJMcajnSFGZ/jG0fqWP1qFeP3NvMzbFtXK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fs585f%2FdJMcajnSFGZ%2FjG0fqWP1qFeP3NvMzbFtXK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;659&quot; height=&quot;128&quot; data-origin-width=&quot;659&quot; data-origin-height=&quot;128&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;rac1 &amp;rarr; rac2로 변경&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;ebnf&quot;&gt;&lt;code&gt;reboot&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;RAC1, RAC2 실행&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1605&quot; data-origin-height=&quot;663&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/MOFWg/dJMcagEM0I7/74XGpYmAEYUu9XNQLKAgI0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/MOFWg/dJMcagEM0I7/74XGpYmAEYUu9XNQLKAgI0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/MOFWg/dJMcagEM0I7/74XGpYmAEYUu9XNQLKAgI0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FMOFWg%2FdJMcagEM0I7%2F74XGpYmAEYUu9XNQLKAgI0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1605&quot; height=&quot;663&quot; data-origin-width=&quot;1605&quot; data-origin-height=&quot;663&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;putty 접속&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;901&quot; data-origin-height=&quot;439&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/mD327/dJMcaaR6Ksq/NdhiPWHNF1cjHEpkB4XQXK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/mD327/dJMcaaR6Ksq/NdhiPWHNF1cjHEpkB4XQXK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/mD327/dJMcaaR6Ksq/NdhiPWHNF1cjHEpkB4XQXK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmD327%2FdJMcaaR6Ksq%2FNdhiPWHNF1cjHEpkB4XQXK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;901&quot; height=&quot;439&quot; data-origin-width=&quot;901&quot; data-origin-height=&quot;439&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1317&quot; data-origin-height=&quot;412&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/diUsd3/dJMcad2hWzX/OMv7j0RYP9sNO1O2KJLNu1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/diUsd3/dJMcad2hWzX/OMv7j0RYP9sNO1O2KJLNu1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/diUsd3/dJMcad2hWzX/OMv7j0RYP9sNO1O2KJLNu1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdiUsd3%2FdJMcad2hWzX%2FOMv7j0RYP9sNO1O2KJLNu1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1317&quot; height=&quot;412&quot; data-origin-width=&quot;1317&quot; data-origin-height=&quot;412&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;RAC1 네트워크 설정 확인&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac1 ~]# service network status
Configured devices:
lo eth0 eth1 eth2
Currently active devices:
lo eth0 eth1 eth2
[root@rac1 ~]# cd /etc/sysconfig/network-scripts/
[root@rac1 network-scripts]# ls
ifcfg-eth0   ifdown-ipsec   ifdown-tunnel  ifup-ipx     ifup-sl
ifcfg-eth1   ifdown-ipv6    ifup           ifup-isdn    ifup-tunnel
ifcfg-eth2   ifdown-isdn    ifup-aliases   ifup-plip    ifup-wireless
ifcfg-lo     ifdown-post    ifup-bnep      ifup-plusb   init.ipv6-global
ifdown       ifdown-ppp     ifup-eth       ifup-post    net.hotplug
ifdown-bnep  ifdown-routes  ifup-ippp      ifup-ppp     network-functions
ifdown-eth   ifdown-sit     ifup-ipsec     ifup-routes  network-functions-ipv6
ifdown-ippp  ifdown-sl      ifup-ipv6      ifup-sit
[root@rac1 network-scripts]# cat ifcfg-eth1
# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.168.56.255
HWADDR=08:00:27:7E:F9:63
IPADDR=192.168.56.110
NETMASK=255.255.255.0
NETWORK=192.168.56.0
ONBOOT=yes
[root@rac1 network-scripts]# cat ifcfg-eth2
# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth2
BOOTPROTO=static
BROADCAST=192.168.55.255
HWADDR=08:00:27:E5:B9:BB
IPADDR=192.168.55.110
NETMASK=255.255.255.0
NETWORK=192.168.55.0
ONBOOT=yes&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;RAC2 네트워크 설정 확인&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac2 ~]# service network status
Configured devices:
lo eth0 eth1 eth2
Currently active devices:
lo eth0 eth1 eth2
[root@rac2 ~]# cd /etc/sysconfig/network-scripts/
[root@rac2 network-scripts]# ls
ifcfg-eth0   ifdown-ipsec   ifdown-tunnel  ifup-ipx     ifup-sl
ifcfg-eth1   ifdown-ipv6    ifup           ifup-isdn    ifup-tunnel
ifcfg-eth2   ifdown-isdn    ifup-aliases   ifup-plip    ifup-wireless
ifcfg-lo     ifdown-post    ifup-bnep      ifup-plusb   init.ipv6-global
ifdown       ifdown-ppp     ifup-eth       ifup-post    net.hotplug
ifdown-bnep  ifdown-routes  ifup-ippp      ifup-ppp     network-functions
ifdown-eth   ifdown-sit     ifup-ipsec     ifup-routes  network-functions-ipv6
ifdown-ippp  ifdown-sl      ifup-ipv6      ifup-sit
[root@rac2 network-scripts]# cat ifcfg-eth1
# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.56.111
NETMASK=255.255.255.0
HWADDR=08:00:27:15:4d:07
[root@rac2 network-scripts]# cat ifcfg-eth2
# Intel Corporation 82540EM Gigabit Ethernet Controller
DEVICE=eth2
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.55.111
NETMASK=255.255.255.0
HWADDR=08:00:27:40:54:08&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;RAC2 환경 설정&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;.bash_profile 수정&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac2 ~]# su - oracle
[oracle@rac2 ~]$ vi .bash_profile
[oracle@rac2 ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export TMP=/tmp
export TMPDIR=$TMP
export EDITOR=vi
export ORACLE_HOSTNAME=rac2
export ORACLE_UNQNAME=racdb
export ORACLE_BASE=/u01/app/oracle
export DB_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_HOME=$DB_HOME
export GRID_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=racdb2
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

umask 022
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;ORACLE_HOSTNAME=rac2&lt;/li&gt;
&lt;li&gt;ORACLE_SID=racdb2&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;.grid_env 수정&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[oracle@rac2 ~]$ vi .grid_env
[oracle@rac2 ~]$ cat .grid_env
export ORACLE_SID=+ASM2 # +ASM2
export ORACLE_HOME=$GRID_HOME
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;ORACLE_SID=+ASM2&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;.db_env 수정&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[oracle@rac2 ~]$ vi .db_env
[oracle@rac2 ~]$ cat .db_env
export ORACLE_SID=racdb2 # racdb2
export ORACLE_HOME=$DB_HOME
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;ORACLE_SID=racdb2&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;ping&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;RAC1에서 RAC2로 ping&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[oracle@rac1 ~]$ su -
Password:
[root@rac1 ~]# ping -c 3 rac2
PING rac2 (192.168.56.111) 56(84) bytes of data.
64 bytes from rac2 (192.168.56.111): icmp_seq=1 ttl=64 time=37.7 ms
64 bytes from rac2 (192.168.56.111): icmp_seq=2 ttl=64 time=1.44 ms
64 bytes from rac2 (192.168.56.111): icmp_seq=3 ttl=64 time=0.824 ms

--- rac2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2007ms
rtt min/avg/max/mdev = 0.824/13.329/37.722/17.250 ms
[root@rac1 ~]# ping -c 3 rac2-priv
PING rac2-priv (192.168.55.111) 56(84) bytes of data.
64 bytes from rac2-priv (192.168.55.111): icmp_seq=1 ttl=64 time=4.44 ms
64 bytes from rac2-priv (192.168.55.111): icmp_seq=2 ttl=64 time=1.71 ms
64 bytes from rac2-priv (192.168.55.111): icmp_seq=3 ttl=64 time=1.48 ms

--- rac2-priv ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2008ms
rtt min/avg/max/mdev = 1.480/2.547/4.443/1.344 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;RAC2에서 RAC1로 ping&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[oracle@rac2 ~]$ su -
Password:
[root@rac2 ~]# ping -c 3 rac1
PING rac1 (192.168.56.110) 56(84) bytes of data.
64 bytes from rac1 (192.168.56.110): icmp_seq=1 ttl=64 time=0.695 ms
64 bytes from rac1 (192.168.56.110): icmp_seq=2 ttl=64 time=0.352 ms
64 bytes from rac1 (192.168.56.110): icmp_seq=3 ttl=64 time=2.28 ms

--- rac1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.352/1.109/2.280/0.839 ms
[root@rac2 ~]# ping -c 3 rac1-priv
PING rac1-priv (192.168.55.110) 56(84) bytes of data.
64 bytes from rac1-priv (192.168.55.110): icmp_seq=1 ttl=64 time=1.36 ms
64 bytes from rac1-priv (192.168.55.110): icmp_seq=2 ttl=64 time=1.10 ms
64 bytes from rac1-priv (192.168.55.110): icmp_seq=3 ttl=64 time=0.724 ms

--- rac1-priv ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 0.724/1.066/1.367/0.264 ms
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;linux_11gR2_grid, database 압축 파일 전송&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1915&quot; data-origin-height=&quot;1021&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bhYIdu/dJMcagdH78H/ydyuZBuK7zLx8QNXofMCA1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bhYIdu/dJMcagdH78H/ydyuZBuK7zLx8QNXofMCA1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bhYIdu/dJMcagdH78H/ydyuZBuK7zLx8QNXofMCA1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbhYIdu%2FdJMcagdH78H%2FydyuZBuK7zLx8QNXofMCA1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1915&quot; height=&quot;1021&quot; data-origin-width=&quot;1915&quot; data-origin-height=&quot;1021&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;압축 해제 및 파일 권한 설정&lt;/h2&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# 오라클 계정으로 전환
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ ls
database.zip  linux_11gR2_grid.zip

# 압축 풀 폴더 생성
[oracle@rac1 ~]$ mkdir grid
[oracle@rac1 ~]$ mkdir database

# 압축 파일을 압축을 풀 폴더로 이동
[oracle@rac1 ~]$ mv linux_11gR2_grid.zip grid
[oracle@rac1 ~]$ mv database.zip database
[oracle@rac1 ~]$ ls
database  grid

# grid 압축 파일 압축 해제
[oracle@rac1 ~]$ cd grid
[oracle@rac1 grid]$ ls
linux_11gR2_grid.zip
[oracle@rac1 grid]$ unzip -q linux_11gR2_grid.zip
[oracle@rac1 grid]$ ls -l
total 958180
drwxr-xr-x 8 oracle oinstall      4096 Feb 25 16:34 grid
-rw-r--r-- 1 oracle oinstall 980208950 Feb 25 16:30 linux_11gR2_grid.zip
[oracle@rac1 grid]$ cd grid
[oracle@rac1 grid]$ ls -l
total 44
drwxr-xr-x  9 oracle oinstall 4096 Feb 25 16:34 doc
drwxr-xr-x  4 oracle oinstall 4096 Feb 25 16:34 install
drwxr-xr-x  2 oracle oinstall 4096 Feb 25 16:34 response
drwxr-xr-x  2 oracle oinstall 4096 Feb 25 16:34 rpm
-rw-r--r--  1 oracle oinstall 3795 Jan 28  2009 runcluvfy.sh
-rw-r--r--  1 oracle oinstall 4353 Aug 13  2009 runInstaller
drwxr-xr-x  2 oracle oinstall 4096 Feb 25 16:34 sshsetup
drwxr-xr-x 14 oracle oinstall 4096 Feb 25 16:34 stage
-rw-r--r--  1 oracle oinstall 4279 Aug 17  2009 welcome.html

# grid 폴더 권한 설정
[oracle@rac1 grid]$ cd ..
[oracle@rac1 grid]$ chmod -R 755 grid/
[oracle@rac1 grid]$ cd grid/
[oracle@rac1 grid]$ ls -l
total 44
drwxr-xr-x  9 oracle oinstall 4096 Feb 25 16:34 doc
drwxr-xr-x  4 oracle oinstall 4096 Feb 25 16:34 install
drwxr-xr-x  2 oracle oinstall 4096 Feb 25 16:34 response
drwxr-xr-x  2 oracle oinstall 4096 Feb 25 16:34 rpm
-rwxr-xr-x  1 oracle oinstall 3795 Jan 28  2009 runcluvfy.sh
-rwxr-xr-x  1 oracle oinstall 4353 Aug 13  2009 runInstaller
drwxr-xr-x  2 oracle oinstall 4096 Feb 25 16:34 sshsetup
drwxr-xr-x 14 oracle oinstall 4096 Feb 25 16:34 stage
-rwxr-xr-x  1 oracle oinstall 4279 Aug 17  2009 welcome.html

# database 압축 파일 압축 해제
[oracle@rac1 grid]$ cd
[oracle@rac1 ~]$ cd database
[oracle@rac1 database]$ ls
database.zip
[oracle@rac1 database]$ unzip -q database.zip
[oracle@rac1 database]$ ls -l
total 2229140
-rw-r--r--  1 oracle oinstall 2280363817 Feb 25 16:33 database.zip
drwxr-xr-x 12 oracle oinstall       4096 Feb 25 16:36 doc
drwxr-xr-x  4 oracle oinstall       4096 Feb 25 16:36 install
drwxr-xr-x  2 oracle oinstall       4096 Feb 25 16:36 response
drwxr-xr-x  2 oracle oinstall       4096 Feb 25 16:36 rpm
-rw-r--r--  1 oracle oinstall       4352 Aug 13  2009 runInstaller
drwxr-xr-x  2 oracle oinstall       4096 Feb 25 16:36 sshsetup
drwxr-xr-x 14 oracle oinstall       4096 Feb 25 16:37 stage
-rw-r--r--  1 oracle oinstall       5400 Aug 17  2009 welcome.html

# database 폴더 권한 설정
[oracle@rac1 database]$ cd ..
[oracle@rac1 ~]$ ls
database  grid
[oracle@rac1 ~]$ chmod -R 755 database/
[oracle@rac1 ~]$ cd database/
[oracle@rac1 database]$ ls -l
total 2229140
-rwxr-xr-x  1 oracle oinstall 2280363817 Feb 25 16:33 database.zip
drwxr-xr-x 12 oracle oinstall       4096 Feb 25 16:36 doc
drwxr-xr-x  4 oracle oinstall       4096 Feb 25 16:36 install
drwxr-xr-x  2 oracle oinstall       4096 Feb 25 16:36 response
drwxr-xr-x  2 oracle oinstall       4096 Feb 25 16:36 rpm
-rwxr-xr-x  1 oracle oinstall       4352 Aug 13  2009 runInstaller
drwxr-xr-x  2 oracle oinstall       4096 Feb 25 16:36 sshsetup
drwxr-xr-x 14 oracle oinstall       4096 Feb 25 16:37 stage
-rwxr-xr-x  1 oracle oinstall       5400 Aug 17  2009 welcome.html&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>rac</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/238</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260225-TIL#entry238comment</comments>
      <pubDate>Sun, 15 Mar 2026 23:12:14 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260224 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260224-TIL</link>
      <description>&lt;h1&gt;병렬 처리(Cont.)&lt;/h1&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;둘 다 파티셔닝 되지 않은 경우 : 동적 파티셔닝&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;어느 한 쪽도 조인 컬럼에 대해 파티셔닝이 되지 않은 상황&lt;/li&gt;
&lt;li&gt;양쪽 테이블이 모두 대용량 테이블&lt;/li&gt;
&lt;li&gt;pq_distribute(inner 테이블(별칭), outer table distribution 방식, inner table distribution 방식)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pq_distribute(e, hash, hash)&lt;/code&gt; : 조인 키 컬럼을 해시 함수에 적용하고 거기서 반환된 값을 기준으로 양쪽 테이블을 동적으로 파티셔닝 하라는 의미&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션되지 않은 dept 테이블 생성
create table hr.dept_non tablespace users as select * from hr.departments;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d) full(e) parallel(d 2) parallel(e 2) pq_distribute(e, hash, hash) opt_param('optimizer_features_enable','11.2.0.4') */ e.employee_id, e.last_name, e.salary, d.department_id, d.department_name
from  hr.dept_non d, hr.emp_non e
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  41jvhz2m9ap92, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d)
full(e) parallel(d 2) parallel(e 2) pq_distribute(e, hash, hash)
opt_param('optimizer_features_enable','11.2.0.4') */ e.employee_id,
e.last_name, e.salary, d.department_id, d.department_name from
hr.dept_non d, hr.emp_non e where e.department_id = d.department_id

Plan hash value: 3155175171

------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |          |      1 |        |        |      |            |    106 |00:00:00.03 |   6 |        |       |          |
|   1 |  PX COORDINATOR         |          |      1 |        |        |      |            |    106 |00:00:00.03 |   6 | 73728 | 73728 |           |
|   2 |   PX SEND QC (RANDOM)   | :TQ10002 |      0 |    106 |  Q1,02 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |   0 |        |       |          |
|*  3 |    HASH JOIN BUFFERED   |          |      0 |    106 |  Q1,02 | PCWP |            |      0 |00:00:00.01 |   0 |  2949K|  2681K| 3911K (0)|
|   4 |     PX RECEIVE          |          |      0 |     27 |  Q1,02 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   5 |      PX SEND HASH       | :TQ10000 |      0 |     27 |  Q1,00 | P-&amp;gt;P | HASH       |      0 |00:00:00.01 |   0 |        |       |          |
|   6 |       PX BLOCK ITERATOR |          |      0 |     27 |  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  7 |        TABLE ACCESS FULL| DEPT_NON |      0 |     27 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   8 |     PX RECEIVE          |          |      0 |    107 |  Q1,02 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   9 |      PX SEND HASH       | :TQ10001 |      0 |    107 |  Q1,01 | P-&amp;gt;P | HASH       |      0 |00:00:00.01 |   0 |        |       |          |
|  10 |       PX BLOCK ITERATOR |          |      0 |    107 |  Q1,01 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|* 11 |        TABLE ACCESS FULL| EMP_NON  |      0 |    107 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   7 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)
  11 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

38 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P002                             27        513          1
         0 Producer                                 P003                              0         48          0
         0 Consumer                                 P000                             15        313        283
         0 Consumer                                 P001                             12        248        282
         1 Producer                                 P002                             97       2102          1
         1 Producer                                 P003                              9        241          1
         1 Consumer                                 P000                             87       1891        287
         1 Consumer                                 P001                             19        452        284
         2 Producer                                 P000                             87       2651          8
         2 Producer                                 P001                             19        608          4
         2 Consumer                                 QC                              106       3259          1

11 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;TQ_ID = 0인 P002, P003 : dept_non 테이블 파티셔닝&lt;/li&gt;
&lt;li&gt;TQ_ID = 1인 P002, P003 : emp_non 테이블 파티셔닝&lt;/li&gt;
&lt;li&gt;P000는 department_id = 20, 50, 80, 100인 부서와 사원을 처리&lt;/li&gt;
&lt;li&gt;P001는 department_id = 20, 50, 80, 100이 아닌 부서와 사원을 처리&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# department_id = 20, 50, 80, 100인 사원 수
SYS@ora19c&amp;gt; select sum(cnt)
from (select department_id, count(*) cnt from hr.emp_non where department_id in (20, 50, 80, 100) group by department_id);

  SUM(CNT)
----------
        87

# department_id = 20, 50, 80, 100이 아닌 사원 수
SYS@ora19c&amp;gt; select sum(cnt)
from (select department_id, count(*) cnt from hr.emp_non where department_id not in (20, 50, 80, 100) or department_id is null group by department_id);  2

  SUM(CNT)
----------
        20&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;pq_replicate&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;PQ_REPLICATE(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)&lt;/code&gt; : 테이블을 파티셔닝하지 않고 전체를 읽도록 유도하는 힌트&lt;/li&gt;
&lt;li&gt;현재 테이블의 크기가 크지 않으므로 데이터 분배 힌트를 제거하면 굳이 파티셔닝하지 않고 전체를 읽어 일반적인 조인처럼 동작하도록 함&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d) full(e) parallel(d 2) parallel(e 2) */ e.employee_id, e.last_name, e.salary, d.department_id, d.department_name
from  hr.dept_non d, hr.emp_non e
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel outline'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  1q6ykrd3mrfaf, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d)
full(e) parallel(d 2) parallel(e 2) */ e.employee_id, e.last_name,
e.salary, d.department_id, d.department_name from  hr.dept_non d,
hr.emp_non e where e.department_id = d.department_id

Plan hash value: 1969334012

----------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation             | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |          |      1 |        |        |      |            |    106 |00:00:00.01 |       3 |    |       |          |
|   1 |  PX COORDINATOR       |          |      1 |        |        |      |            |    106 |00:00:00.01 |       3 | 73728 | 73728 |       |
|   2 |   PX SEND QC (RANDOM) | :TQ10000 |      0 |    106 |  Q1,00 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |       0 |    |       |          |
|*  3 |    HASH JOIN          |          |      0 |    106 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |  1572K|  1572K| 1636K (0)|
|   4 |     TABLE ACCESS FULL | DEPT_NON |      0 |     27 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |    |       |          |
|   5 |     PX BLOCK ITERATOR |          |      0 |    107 |  Q1,00 | PCWC |            |      0 |00:00:00.01 |       0 |    |       |          |
|*  6 |      TABLE ACCESS FULL| EMP_NON  |      0 |    107 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |    |       |          |
----------------------------------------------------------------------------------------------------------------------------------------------------

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE('19.1.0')
      DB_VERSION('19.1.0')
      ALL_ROWS
      OUTLINE_LEAF(@&quot;SEL$1&quot;)
      FULL(@&quot;SEL$1&quot; &quot;D&quot;@&quot;SEL$1&quot;)
      FULL(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)
      LEADING(@&quot;SEL$1&quot; &quot;D&quot;@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)
      USE_HASH(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)
      PQ_DISTRIBUTE(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot; BROADCAST NONE)
      PQ_REPLICATE(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   6 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

50 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P000                             97       2925          1
         0 Producer                                 P001                              9        334          1
         0 Consumer                                 QC                              106       3259          3

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P000                             97       2925          1
         0 Producer                                 P001                              9        334          1
         0 Consumer                                 QC                              106       3259          5&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;둘 다 파티셔닝 되지 않은 경우 : broadcast&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;어느 한쪽도 조인 컬럼에 대해 파티셔닝이 되지 않은 상황&lt;/li&gt;
&lt;li&gt;둘 중 하나의 데이터 집합이 매우 작을 때&lt;/li&gt;
&lt;li&gt;pq_distribute(inner 테이블(별칭), outer table distribution 방식, inner table distribution 방식)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pq_distribute(e, broadcast, none)&lt;/code&gt; : 작은 테이블을 큰 테이블 쪽으로 브로드캐스트&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d) full(e) parallel(d 2) parallel(e 2) pq_distribute(e, broadcast, none) */ e.employee_id, e.last_name, e.salary, d.department_id, d.department_name
from  hr.dept_non d, hr.emp_non e
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel outline'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  fw4n8vq6a9tds, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d)
full(e) parallel(d 2) parallel(e 2) pq_distribute(e, broadcast, none)
*/ e.employee_id, e.last_name, e.salary, d.department_id,
d.department_name from  hr.dept_non d, hr.emp_non e where
e.department_id = d.department_id

Plan hash value: 1969334012

----------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation             | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |          |      1 |        |        |      |            |    106 |00:00:00.01 |       3 |    |       |          |
|   1 |  PX COORDINATOR       |          |      1 |        |        |      |            |    106 |00:00:00.01 |       3 | 73728 | 73728 |       |
|   2 |   PX SEND QC (RANDOM) | :TQ10000 |      0 |    106 |  Q1,00 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |       0 |    |       |          |
|*  3 |    HASH JOIN          |          |      0 |    106 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |  1572K|  1572K| 1636K (0)|
|   4 |     TABLE ACCESS FULL | DEPT_NON |      0 |     27 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |    |       |          |
|   5 |     PX BLOCK ITERATOR |          |      0 |    107 |  Q1,00 | PCWC |            |      0 |00:00:00.01 |       0 |    |       |          |
|*  6 |      TABLE ACCESS FULL| EMP_NON  |      0 |    107 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |    |       |          |
----------------------------------------------------------------------------------------------------------------------------------------------------

Outline Data
-------------

  /*+
      BEGIN_OUTLINE_DATA
      IGNORE_OPTIM_EMBEDDED_HINTS
      OPTIMIZER_FEATURES_ENABLE('19.1.0')
      DB_VERSION('19.1.0')
      ALL_ROWS
      OUTLINE_LEAF(@&quot;SEL$1&quot;)
      FULL(@&quot;SEL$1&quot; &quot;D&quot;@&quot;SEL$1&quot;)
      FULL(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)
      LEADING(@&quot;SEL$1&quot; &quot;D&quot;@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)
      USE_HASH(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)
      PQ_DISTRIBUTE(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot; BROADCAST NONE)
      PQ_REPLICATE(@&quot;SEL$1&quot; &quot;E&quot;@&quot;SEL$1&quot;)
      END_OUTLINE_DATA
  */

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   6 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

51 rows selected.
SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;
  2    3
     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P000                             97       2925          1
         0 Producer                                 P001                              9        334          1
         0 Consumer                                 QC                              106       3259          4&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;PQ_REPLICATE&lt;/code&gt; 힌트가 자동으로 추가되어 broadcast가 작동하지 않으므로 &lt;code&gt;no_pq_replicate(e)&lt;/code&gt; 힌트 추가&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d) full(e) parallel(d 2) parallel(e 2) pq_distribute(e, broadcast, none) no_pq_replicate(e) */ e.employee_id, e.last_name, e.salary, d.department_id, d.department_name
from  hr.dept_non d, hr.emp_non e
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  bgk29c34wvbgr, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d)
full(e) parallel(d 2) parallel(e 2) pq_distribute(e, broadcast, none)
no_pq_replicate(e) */ e.employee_id, e.last_name, e.salary,
d.department_id, d.department_name from  hr.dept_non d, hr.emp_non e
where e.department_id = d.department_id

Plan hash value: 3298713937

------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |          |      1 |        |        |      |            |    106 |00:00:00.01 |   6 |        |       |          |
|   1 |  PX COORDINATOR         |          |      1 |        |        |      |            |    106 |00:00:00.01 |   6 | 73728 | 73728 |           |
|   2 |   PX SEND QC (RANDOM)   | :TQ10001 |      0 |    106 |  Q1,01 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |   0 |        |       |          |
|*  3 |    HASH JOIN            |          |      0 |    106 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |  1572K|  1572K| 1620K (0)|
|   4 |     PX RECEIVE          |          |      0 |     27 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   5 |      PX SEND BROADCAST  | :TQ10000 |      0 |     27 |  Q1,00 | P-&amp;gt;P | BROADCAST  |      0 |00:00:00.01 |   0 |        |       |          |
|   6 |       PX BLOCK ITERATOR |          |      0 |     27 |  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  7 |        TABLE ACCESS FULL| DEPT_NON |      0 |     27 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   8 |     PX BLOCK ITERATOR   |          |      0 |    107 |  Q1,01 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  9 |      TABLE ACCESS FULL  | EMP_NON  |      0 |    107 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   7 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)
   9 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

36 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P002                             54        978          0
         0 Producer                                 P003                              0         48          0
         0 Consumer                                 P000                             27        513        108
         0 Consumer                                 P001                             27        513        108
         1 Producer                                 P000                             97       2925          4
         1 Producer                                 P001                              9        334          3
         1 Consumer                                 QC                              106       3259          5

7 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;DML 병렬 처리&lt;/h2&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;# 대용량 테이블 emp_dw 생성
SYS@ora19c&amp;gt; create table hr.emp_dw as
select rownum as employee_id, last_name, first_name, hire_date, job_id, salary, manager_id, department_id
from hr.employees e,(select level as id from dual connect by level &amp;lt;=10000);  2    3

Table created.

# 대용량 테이블 구조 복사
SYS@ora19c&amp;gt; create table hr.emp_dw_copy tablespace users as select * from hr.emp_dw where 1=2;

Table created.

# emp_dw 테이블 블록 수 및 사이즈 조회
SYS@ora19c&amp;gt; select blocks, bytes/1024/1024 mb from dba_segments where owner = 'HR' and segment_name = 'EMP_DW';

    BLOCKS         MB
---------- ----------
      7552         59

# emp_dw 테이블 데이터를 emp_dw_copy 테이블로 복사하는 쿼리 예상 실행 계획 생성
SYS@ora19c&amp;gt; explain plan for
insert /*+ parallel(e1 2) */ into hr.emp_dw_copy e1
select /*+ parallel(e2 2) */ * from hr.emp_dw e2;  2    3

Explained.

# 예상 실행 계획 조회
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 446358369

---------------------------------------------------------------------------------------------------------------------
| Id  | Operation                | Name        | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
---------------------------------------------------------------------------------------------------------------------
|   0 | INSERT STATEMENT         |             |  1070K|    45M|   882  (42)| 00:00:01 |        |      |            |
|   1 |  LOAD TABLE CONVENTIONAL | EMP_DW_COPY |       |       |            |          |        |      |            |
|   2 |   PX COORDINATOR         |             |       |       |            |          |        |      |            |
|   3 |    PX SEND QC (RANDOM)   | :TQ10000    |  1070K|    45M|   882  (42)| 00:00:01 |  Q1,00 | P-&amp;gt;S | QC (RAND)  |
|   4 |     PX BLOCK ITERATOR    |             |  1070K|    45M|   882  (42)| 00:00:01 |  Q1,00 | PCWC |            |
|   5 |      TABLE ACCESS FULL   | EMP_DW      |  1070K|    45M|   882  (42)| 00:00:01 |  Q1,00 | PCWP |            |
---------------------------------------------------------------------------------------------------------------------

Note
-----
   - Degree of Parallelism is 2 because of table property
   - PDML is disabled in current session

17 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;병렬 처리를 유도했지만 conventional한 방식으로 insert하도록 실행 계획이 생성됨&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;direct path write&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;병렬 처리 dml을 하려면 parallel dml을 활성화 해야 함&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;# parallel dml을 활성화
alter session enable parallel dml;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; explain plan for
insert /*+ parallel(e1 2) */ into hr.emp_dw_copy e1
select /*+ parallel(e2 2) */ * from hr.emp_dw e2;  2    3

Explained.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plan hash value: 3194517437

-------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                          | Name        | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
-------------------------------------------------------------------------------------------------------------------------------
|   0 | INSERT STATEMENT                   |             |  1070K|    45M|   718  (29)| 00:00:01 |        |      |        |
|   1 |  PX COORDINATOR                    |             |       |       |            |          |        |      |        |
|   2 |   PX SEND QC (RANDOM)              | :TQ10000    |  1070K|    45M|   718  (29)| 00:00:01 |  Q1,00 | P-&amp;gt;S | QC (RAND)  |
|   3 |    LOAD AS SELECT (HYBRID TSM/HWMB)| EMP_DW_COPY |       |       |            |          |  Q1,00 | PCWP |        |
|   4 |     OPTIMIZER STATISTICS GATHERING |             |  1070K|    45M|   718  (29)| 00:00:01 |  Q1,00 | PCWP |        |
|   5 |      PX BLOCK ITERATOR             |             |  1070K|    45M|   718  (29)| 00:00:01 |  Q1,00 | PCWC |        |
|   6 |       TABLE ACCESS FULL            | EMP_DW      |  1070K|    45M|   718  (29)| 00:00:01 |  Q1,00 | PCWP |        |
-------------------------------------------------------------------------------------------------------------------------------

Note
-----
   - Degree of Parallelism is 2 because of table property

17 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Direct Path Wirte가 동작하면 HWM 이후에 데이터를 추가&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;less&quot;&gt;&lt;code&gt;# 예상 실행 계획을 생성하더라도 트랜잭션이 처리 중인 것처럼 되기 때문에 rollback 필요
SYS@ora19c&amp;gt; alter session disable parallel dml;
ERROR:
ORA-12841: Cannot alter the session parallel DML state within a transaction

SYS@ora19c&amp;gt; rollback;

Rollback complete.

# parallel dml 비활성화
SYS@ora19c&amp;gt; alter session disable parallel dml;

Session altered.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;DML 병렬 처리&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# parallel dml 활성화
SYS@ora19c&amp;gt; alter session enable parallel dml;

Session altered.

# 병렬 insert 수행
SYS@ora19c&amp;gt; insert /*+ parallel(e1 2) */ into hr.emp_dw_copy e1
select /*+ parallel(e2 2) */ * from hr.emp_dw e2;  2

1070000 rows created.

SYS@ora19c&amp;gt; commit;

Commit complete.

# parallel dml 비활성화
SYS@ora19c&amp;gt; alter session disable parallel dml;

Session altered.

SYS@ora19c&amp;gt; truncate table hr.emp_dw_copy;

Table truncated.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;enable_parallel_dml : 병렬 처리 dml 활성화 힌트(12c)&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# enable_parallel_dml 힌트를 통해 쿼리 단위로 parallel dml 활성화 가능
SYS@ora19c&amp;gt; insert /*+ enable_parallel_dml parallel(e1 2) */ into hr.emp_dw_copy e1
select /*+ parallel(e2 2) */ * from hr.emp_dw e2;

1070000 rows created.

SYS@ora19c&amp;gt; commit;

Commit complete.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;direct path read&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;병렬 쿼리 수행&lt;/li&gt;
&lt;li&gt;temp segment 블록을 읽을 때&lt;/li&gt;
&lt;li&gt;serial direct read&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Serial Direct Read&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;full table scan, index fast full scan이 발생할 경우 multi block i/o 발생&lt;/li&gt;
&lt;li&gt;이 때 데이터 버퍼 캐시 영역에 부담을 줄 수 있음&lt;/li&gt;
&lt;li&gt;이런 문제 때문에 full table scan 시에 데이터 블록을 데이터 버퍼 캐시에 올리지 않고 PGA 영역 안에 CURSOR에 바로 읽어오는 기능&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select  a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm in ('_very_large_object_threshold','_small_table_threshold','_serial_direct_read');  2    3    4

PARAMETER                      VALUE
------------------------------ ------------------------------
_small_table_threshold         312  
_very_large_object_threshold   500
_serial_direct_read            auto&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;_small_table_threshold&lt;/code&gt; : 임계값(블록수)
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;full scan이 발생한 테이블 블록 수 &amp;gt; _small_table_threshold 이면 serial direct read 발생&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_very_large_object_threshold&lt;/code&gt; : 이 값보다 큰 테이블&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_serial_direct_read&lt;/code&gt; : serial direct read 활성화(자동 관리)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# EMP_DW 테이블 블록 수 및 사이즈 조회
SYS@ora19c&amp;gt; select blocks, bytes/1024/1024 mb from dba_segments where owner = 'HR' and segment_name = 'EMP_DW';

    BLOCKS         MB
---------- ----------
      7552         59&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 세션 이벤트 정보 조회
SYS@ora19c&amp;gt; select sid, event, total_waits, time_waited from v$session_event where sid = (select  sid from v$session where username='HR');

no rows selected

# HR 접속 후 재실행
SYS@ora19c&amp;gt; select sid, event, total_waits, time_waited from v$session_event where sid = (select  sid from v$session where username='HR');

       SID EVENT                                                            TOTAL_WAITS TIME_WAITED
---------- ---------------------------------------------------------------- ----------- -----------
        31 Disk file operations I/O                                                   1           0
        31 db file sequential read                                                   11           1
        31 SQL*Net message to client                                                  8           0
        31 SQL*Net message from client                                                7           0
        31 events in waitclass Other                                                 21           0&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;oxygene&quot;&gt;&lt;code&gt;# emp_dw 테이블 전체 건수 조회
HR@ora19c&amp;gt; select count(*) from hr.emp_dw;

  COUNT(*)
----------
   1070000&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# direct path read 발생
SYS@ora19c&amp;gt; select sid, event, total_waits, time_waited from v$session_event where sid = (select  sid from v$session where username='HR');

       SID EVENT                                                            TOTAL_WAITS TIME_WAITED
---------- ---------------------------------------------------------------- ----------- -----------
        31 Disk file operations I/O                                                   2           0
        31 db file sequential read                                                   11           1
        31 direct path read                                                         240           7
        31 SQL*Net message to client                                                 10           0
        31 SQL*Net message from client                                                9        6871
        31 events in waitclass Other                                                 23           0

6 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 새로운 HR 세션 접속 후 세션 이벤트 정보 조회
SYS@ora19c&amp;gt; select sid, event, total_waits, time_waited from v$session_event where sid = (select  sid from v$session where username='HR');

       SID EVENT                                                            TOTAL_WAITS TIME_WAITED
---------- ---------------------------------------------------------------- ----------- -----------
        33 log file sync                                                              1           0
        33 SQL*Net message to client                                                  8           0
        33 SQL*Net message from client                                                7           1
        33 events in waitclass Other                                                  8           0
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;oxygene&quot;&gt;&lt;code&gt;# direct path read 방식을 막는 이벤트 설정
HR@ora19c&amp;gt; alter session set events '10949 trace name context forever, level 1';

Session altered.

HR@ora19c&amp;gt; select count(*) from hr.emp_dw;

  COUNT(*)
----------
   1070000&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# db file scattered read 발생
SYS@ora19c&amp;gt; select sid, event, total_waits, time_waited from v$session_event where sid = (select  sid from v$session where username='HR');

       SID EVENT                                                            TOTAL_WAITS TIME_WAITED
---------- ---------------------------------------------------------------- ----------- -----------
        33 Disk file operations I/O                                                   1           0
        33 log file sync                                                              1           0
        33 db file scattered read                                                   189           2
        33 SQL*Net message to client                                                 11           0
        33 SQL*Net message from client                                               10       10610
        33 events in waitclass Other                                                 11           0

6 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 이벤트 종료
HR@ora19c&amp;gt; alter session set events '10949 trace name context off';

Session altered.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;direct path write&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;parallel dml을 수행할 때&lt;/li&gt;
&lt;li&gt;&lt;code&gt;insert /*+ append */ ... select ...&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;CTAS&lt;/li&gt;
&lt;li&gt;SQL*Loader(sqlldr) direct 옵션 설정&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;RAC&lt;/h1&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Enterprise-R5-U6-Server-x86_64-dvd&lt;/li&gt;
&lt;li&gt;linux_11gR2_grid&lt;/li&gt;
&lt;li&gt;database&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;# IP
192.168.56.110 ~ 192.168.56.114&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;가상 머신 생성&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;957&quot; data-origin-height=&quot;743&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dnaSW9/dJMcabKfPvB/ILtxDmrTQRkYgUaGPzTg1K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dnaSW9/dJMcabKfPvB/ILtxDmrTQRkYgUaGPzTg1K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dnaSW9/dJMcabKfPvB/ILtxDmrTQRkYgUaGPzTg1K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdnaSW9%2FdJMcabKfPvB%2FILtxDmrTQRkYgUaGPzTg1K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;957&quot; height=&quot;743&quot; data-origin-width=&quot;957&quot; data-origin-height=&quot;743&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;이름 : rac1&lt;/li&gt;
&lt;li&gt;폴더 : 원하는 곳 선택&lt;/li&gt;
&lt;li&gt;종류 : Linux&lt;/li&gt;
&lt;li&gt;버전 : Oracle Linux(64-bit)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;956&quot; data-origin-height=&quot;740&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dnes1p/dJMcaaq1rkX/nWPMOLApmKW8cvkomqMqI0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dnes1p/dJMcaaq1rkX/nWPMOLApmKW8cvkomqMqI0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dnes1p/dJMcaaq1rkX/nWPMOLApmKW8cvkomqMqI0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fdnes1p%2FdJMcaaq1rkX%2FnWPMOLApmKW8cvkomqMqI0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;956&quot; height=&quot;740&quot; data-origin-width=&quot;956&quot; data-origin-height=&quot;740&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;기본 메모리 : 2048MB&lt;/li&gt;
&lt;li&gt;프로세서 : 2&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;956&quot; data-origin-height=&quot;744&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cHgb1m/dJMcagxYDSI/9yGiZtfgoIZ4tjdTp11PM1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cHgb1m/dJMcagxYDSI/9yGiZtfgoIZ4tjdTp11PM1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cHgb1m/dJMcagxYDSI/9yGiZtfgoIZ4tjdTp11PM1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcHgb1m%2FdJMcagxYDSI%2F9yGiZtfgoIZ4tjdTp11PM1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;956&quot; height=&quot;744&quot; data-origin-width=&quot;956&quot; data-origin-height=&quot;744&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;디스크 크기 : 20GB&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;957&quot; data-origin-height=&quot;742&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/GlGxx/dJMcafZ8A07/gEARxfzGZk4OdttYoc0bk1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/GlGxx/dJMcafZ8A07/gEARxfzGZk4OdttYoc0bk1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/GlGxx/dJMcafZ8A07/gEARxfzGZk4OdttYoc0bk1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FGlGxx%2FdJMcafZ8A07%2FgEARxfzGZk4OdttYoc0bk1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;957&quot; height=&quot;742&quot; data-origin-width=&quot;957&quot; data-origin-height=&quot;742&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;가상 머신 설정&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;리눅스 이미지 선택&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1131&quot; data-origin-height=&quot;750&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/3oUCy/dJMcajuG9Um/AStomMVMvBgPwVK6XaXUz0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/3oUCy/dJMcajuG9Um/AStomMVMvBgPwVK6XaXUz0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/3oUCy/dJMcajuG9Um/AStomMVMvBgPwVK6XaXUz0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F3oUCy%2FdJMcajuG9Um%2FAStomMVMvBgPwVK6XaXUz0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1131&quot; height=&quot;750&quot; data-origin-width=&quot;1131&quot; data-origin-height=&quot;750&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;939&quot; data-origin-height=&quot;528&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dJKxpd/dJMcagLydbJ/df47oGER5XvlTvMs6MZGpk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dJKxpd/dJMcagLydbJ/df47oGER5XvlTvMs6MZGpk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dJKxpd/dJMcagLydbJ/df47oGER5XvlTvMs6MZGpk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdJKxpd%2FdJMcagLydbJ%2Fdf47oGER5XvlTvMs6MZGpk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;939&quot; height=&quot;528&quot; data-origin-width=&quot;939&quot; data-origin-height=&quot;528&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;737&quot; data-origin-height=&quot;480&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/mzgTZ/dJMcagLydbN/XqRbiB3q7vCfCTJjCJLKJ1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/mzgTZ/dJMcagLydbN/XqRbiB3q7vCfCTJjCJLKJ1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/mzgTZ/dJMcagLydbN/XqRbiB3q7vCfCTJjCJLKJ1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FmzgTZ%2FdJMcagLydbN%2FXqRbiB3q7vCfCTJjCJLKJ1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;737&quot; height=&quot;480&quot; data-origin-width=&quot;737&quot; data-origin-height=&quot;480&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;네트워크 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;736&quot; data-origin-height=&quot;501&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/sdml4/dJMcajuG9UA/GdkkKEhcL1Vl4DYQqpwi2K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/sdml4/dJMcajuG9UA/GdkkKEhcL1Vl4DYQqpwi2K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/sdml4/dJMcajuG9UA/GdkkKEhcL1Vl4DYQqpwi2K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fsdml4%2FdJMcajuG9UA%2FGdkkKEhcL1Vl4DYQqpwi2K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;736&quot; height=&quot;501&quot; data-origin-width=&quot;736&quot; data-origin-height=&quot;501&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;어댑터 1 : NAT&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;737&quot; data-origin-height=&quot;504&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/OS0Go/dJMcajuG9UE/afCKjdjIBroL9wAkt0zSQ0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/OS0Go/dJMcajuG9UE/afCKjdjIBroL9wAkt0zSQ0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/OS0Go/dJMcajuG9UE/afCKjdjIBroL9wAkt0zSQ0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FOS0Go%2FdJMcajuG9UE%2FafCKjdjIBroL9wAkt0zSQ0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;737&quot; height=&quot;504&quot; data-origin-width=&quot;737&quot; data-origin-height=&quot;504&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;어댑터 2 : 호스트 전용 어댑터&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;737&quot; data-origin-height=&quot;502&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/eadrlm/dJMcagkrPSs/GKAGpHA8JBYD3mvslczEA1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/eadrlm/dJMcagkrPSs/GKAGpHA8JBYD3mvslczEA1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/eadrlm/dJMcagkrPSs/GKAGpHA8JBYD3mvslczEA1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Feadrlm%2FdJMcagkrPSs%2FGKAGpHA8JBYD3mvslczEA1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;737&quot; height=&quot;502&quot; data-origin-width=&quot;737&quot; data-origin-height=&quot;502&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;어댑터 3 : 어댑터에 브리지&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;공유 폴더 설정&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;940&quot; data-origin-height=&quot;525&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cB5WyI/dJMcabQYQFH/ff9S53w1u1ITCikbJU8YyK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cB5WyI/dJMcabQYQFH/ff9S53w1u1ITCikbJU8YyK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cB5WyI/dJMcabQYQFH/ff9S53w1u1ITCikbJU8YyK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcB5WyI%2FdJMcabQYQFH%2Fff9S53w1u1ITCikbJU8YyK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;940&quot; height=&quot;525&quot; data-origin-width=&quot;940&quot; data-origin-height=&quot;525&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;736&quot; data-origin-height=&quot;481&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/clKt9u/dJMcabQYQFL/utFYfOoRCDrn0OCK1nr7mk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/clKt9u/dJMcabQYQFL/utFYfOoRCDrn0OCK1nr7mk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/clKt9u/dJMcabQYQFL/utFYfOoRCDrn0OCK1nr7mk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FclKt9u%2FdJMcabQYQFL%2FutFYfOoRCDrn0OCK1nr7mk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;736&quot; height=&quot;481&quot; data-origin-width=&quot;736&quot; data-origin-height=&quot;481&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;735&quot; data-origin-height=&quot;479&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/ufORa/dJMcaiigWis/6Xn4Y91eXjzg3NX5j9yRiK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/ufORa/dJMcaiigWis/6Xn4Y91eXjzg3NX5j9yRiK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/ufORa/dJMcaiigWis/6Xn4Y91eXjzg3NX5j9yRiK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FufORa%2FdJMcaiigWis%2F6Xn4Y91eXjzg3NX5j9yRiK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;735&quot; height=&quot;479&quot; data-origin-width=&quot;735&quot; data-origin-height=&quot;479&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;리눅스 설치&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;958&quot; data-origin-height=&quot;745&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cKtb5P/dJMcaaLjQLT/mh8WYiEpj9k0qjk0YK8zTK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cKtb5P/dJMcaaLjQLT/mh8WYiEpj9k0qjk0YK8zTK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cKtb5P/dJMcaaLjQLT/mh8WYiEpj9k0qjk0YK8zTK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcKtb5P%2FdJMcaaLjQLT%2Fmh8WYiEpj9k0qjk0YK8zTK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;958&quot; height=&quot;745&quot; data-origin-width=&quot;958&quot; data-origin-height=&quot;745&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;가상 머신 시작&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;636&quot; data-origin-height=&quot;545&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cea1Fn/dJMcaiigWiw/60cqu15GNdLk0pT2sOcVYK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cea1Fn/dJMcaiigWiw/60cqu15GNdLk0pT2sOcVYK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cea1Fn/dJMcaiigWiw/60cqu15GNdLk0pT2sOcVYK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fcea1Fn%2FdJMcaiigWiw%2F60cqu15GNdLk0pT2sOcVYK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;636&quot; height=&quot;545&quot; data-origin-width=&quot;636&quot; data-origin-height=&quot;545&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;엔터&lt;/li&gt;
&lt;li&gt;안되면 boot: &lt;code&gt;linux nmi_watchdog=0 ide=nodma&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;717&quot; data-origin-height=&quot;469&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/czKMmw/dJMcaiP4rZS/eBKXoG5fxUi2sCwhivjN8K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/czKMmw/dJMcaiP4rZS/eBKXoG5fxUi2sCwhivjN8K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/czKMmw/dJMcaiP4rZS/eBKXoG5fxUi2sCwhivjN8K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FczKMmw%2FdJMcaiP4rZS%2FeBKXoG5fxUi2sCwhivjN8K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;717&quot; height=&quot;469&quot; data-origin-width=&quot;717&quot; data-origin-height=&quot;469&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;skip&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;794&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/be50wL/dJMcaiigWiz/FGkvCuyUBUaKW2ZkT27JOk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/be50wL/dJMcaiigWiz/FGkvCuyUBUaKW2ZkT27JOk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/be50wL/dJMcaiigWiz/FGkvCuyUBUaKW2ZkT27JOk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbe50wL%2FdJMcaiigWiz%2FFGkvCuyUBUaKW2ZkT27JOk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;794&quot; height=&quot;667&quot; data-origin-width=&quot;794&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;next&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;언어 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;803&quot; data-origin-height=&quot;668&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/kzWYr/dJMcacvCKfa/6uW92QxJHUdXBqmxt9Tk70/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/kzWYr/dJMcacvCKfa/6uW92QxJHUdXBqmxt9Tk70/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/kzWYr/dJMcacvCKfa/6uW92QxJHUdXBqmxt9Tk70/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FkzWYr%2FdJMcacvCKfa%2F6uW92QxJHUdXBqmxt9Tk70%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;803&quot; height=&quot;668&quot; data-origin-width=&quot;803&quot; data-origin-height=&quot;668&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;English 선택 후 next&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;663&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bWscjK/dJMcaiigWiK/PkPDohNJisuuUfZsmkj79k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bWscjK/dJMcaiigWiK/PkPDohNJisuuUfZsmkj79k/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bWscjK/dJMcaiigWiK/PkPDohNJisuuUfZsmkj79k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbWscjK%2FdJMcaiigWiK%2FPkPDohNJisuuUfZsmkj79k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;663&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;663&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;U.S. English 선택 후 next&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;666&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/qrptp/dJMcabXLjgX/jV5jK7sQa0ygqYryjULoJ1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/qrptp/dJMcabXLjgX/jV5jK7sQa0ygqYryjULoJ1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/qrptp/dJMcabXLjgX/jV5jK7sQa0ygqYryjULoJ1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fqrptp%2FdJMcabXLjgX%2FjV5jK7sQa0ygqYryjULoJ1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;666&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;666&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;yes&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;스토리지 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;665&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/1QUJx/dJMcabXLjgY/dhwFkEcRzhCT0qtyhPcRC1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/1QUJx/dJMcabXLjgY/dhwFkEcRzhCT0qtyhPcRC1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/1QUJx/dJMcabXLjgY/dhwFkEcRzhCT0qtyhPcRC1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F1QUJx%2FdJMcabXLjgY%2FdhwFkEcRzhCT0qtyhPcRC1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;665&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;665&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;create custom layout 선택 후 next&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;666&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/biHJz0/dJMcaaduEK2/sftGXDPqhWFEH2QDm6PLr0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/biHJz0/dJMcaaduEK2/sftGXDPqhWFEH2QDm6PLr0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/biHJz0/dJMcaaduEK2/sftGXDPqhWFEH2QDm6PLr0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbiHJz0%2FdJMcaaduEK2%2FsftGXDPqhWFEH2QDm6PLr0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;666&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;666&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Pua1Q/dJMcaaduEK6/8akFIHQfpkdSfJdrtuFEvK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Pua1Q/dJMcaaduEK6/8akFIHQfpkdSfJdrtuFEvK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Pua1Q/dJMcaaduEK6/8akFIHQfpkdSfJdrtuFEvK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FPua1Q%2FdJMcaaduEK6%2F8akFIHQfpkdSfJdrtuFEvK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;667&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;New
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Mount Point : /boot&lt;/li&gt;
&lt;li&gt;File System Type : ext3&lt;/li&gt;
&lt;li&gt;Size : 100&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;655&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bE77pH/dJMcaaq1roF/s0CMLDarxwEvLmVk4Yvsk1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bE77pH/dJMcaaq1roF/s0CMLDarxwEvLmVk4Yvsk1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bE77pH/dJMcaaq1roF/s0CMLDarxwEvLmVk4Yvsk1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbE77pH%2FdJMcaaq1roF%2Fs0CMLDarxwEvLmVk4Yvsk1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;655&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;655&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;New
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;File System Type : swap&lt;/li&gt;
&lt;li&gt;Size : 4096(메모리 사이즈 2배)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;665&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/qaRaS/dJMcaaq1roK/mjgRCGH6VMnxq1iNKoFLOk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/qaRaS/dJMcaaq1roK/mjgRCGH6VMnxq1iNKoFLOk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/qaRaS/dJMcaaq1roK/mjgRCGH6VMnxq1iNKoFLOk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FqaRaS%2FdJMcaaq1roK%2FmjgRCGH6VMnxq1iNKoFLOk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;665&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;665&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;New
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Mount Point : /&lt;/li&gt;
&lt;li&gt;File System Type : ext3&lt;/li&gt;
&lt;li&gt;Size : 100&lt;/li&gt;
&lt;li&gt;Fill to maximum allowable size 선택&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;662&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cn76N4/dJMcai3AQta/pv9PNdUqt7uSUrREOMGOlK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cn76N4/dJMcai3AQta/pv9PNdUqt7uSUrREOMGOlK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cn76N4/dJMcai3AQta/pv9PNdUqt7uSUrREOMGOlK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fcn76N4%2FdJMcai3AQta%2Fpv9PNdUqt7uSUrREOMGOlK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;662&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;662&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;next&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Boot Loader 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;664&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Z7jLL/dJMcab4wcPf/QRwkV6CHrx1xzixvpsw1cK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Z7jLL/dJMcab4wcPf/QRwkV6CHrx1xzixvpsw1cK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Z7jLL/dJMcab4wcPf/QRwkV6CHrx1xzixvpsw1cK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FZ7jLL%2FdJMcab4wcPf%2FQRwkV6CHrx1xzixvpsw1cK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;795&quot; height=&quot;664&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;664&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;next&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;네트워크 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;671&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/oRGHJ/dJMcahXYmLB/OKDS3ONE6KP5FpSkHl1U40/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/oRGHJ/dJMcahXYmLB/OKDS3ONE6KP5FpSkHl1U40/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/oRGHJ/dJMcahXYmLB/OKDS3ONE6KP5FpSkHl1U40/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FoRGHJ%2FdJMcahXYmLB%2FOKDS3ONE6KP5FpSkHl1U40%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;795&quot; height=&quot;671&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;671&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/mi0zn/dJMcadurAYj/eGgxFo9QzsLB4soAzINhJk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/mi0zn/dJMcadurAYj/eGgxFo9QzsLB4soAzINhJk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/mi0zn/dJMcadurAYj/eGgxFo9QzsLB4soAzINhJk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fmi0zn%2FdJMcadurAYj%2FeGgxFo9QzsLB4soAzINhJk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;667&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;eth0 체크 후 Edit
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Enable IPv6 support 체크 해제&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dneaN1/dJMcahXYmLF/7ZKo2atqoYhkXtTVagmZo1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dneaN1/dJMcahXYmLF/7ZKo2atqoYhkXtTVagmZo1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dneaN1/dJMcahXYmLF/7ZKo2atqoYhkXtTVagmZo1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdneaN1%2FdJMcahXYmLF%2F7ZKo2atqoYhkXtTVagmZo1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;667&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;eth1 체크 후 Edit
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Enable IPv4 support
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Manual configuration 선택 후 IP 주소/Prefix 설정&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Enable IPv6 support 체크 해제&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;669&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Omxoj/dJMcadurAYv/1xUUeCFSu0BRvbX68lsYk0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Omxoj/dJMcadurAYv/1xUUeCFSu0BRvbX68lsYk0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Omxoj/dJMcadurAYv/1xUUeCFSu0BRvbX68lsYk0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FOmxoj%2FdJMcadurAYv%2F1xUUeCFSu0BRvbX68lsYk0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;795&quot; height=&quot;669&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;669&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;eth2 체크 후 Edit
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Enable IPv4 support
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Manual configuration 선택 후 IP 주소/Prefix 설정&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Enable IPv6 support 체크 해제&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;794&quot; data-origin-height=&quot;664&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/deExMd/dJMcagxYDUC/krIMR5uZQNrGkucGDfW9zK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/deExMd/dJMcagxYDUC/krIMR5uZQNrGkucGDfW9zK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/deExMd/dJMcagxYDUC/krIMR5uZQNrGkucGDfW9zK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdeExMd%2FdJMcagxYDUC%2FkrIMR5uZQNrGkucGDfW9zK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;794&quot; height=&quot;664&quot; data-origin-width=&quot;794&quot; data-origin-height=&quot;664&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;manually 선택 후 rac1으로 설정 후 next&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;지역 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;669&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/KO7hi/dJMcagxYDUI/b1xjDnYCKLpuIPeTv0VAKK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/KO7hi/dJMcagxYDUI/b1xjDnYCKLpuIPeTv0VAKK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/KO7hi/dJMcagxYDUI/b1xjDnYCKLpuIPeTv0VAKK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FKO7hi%2FdJMcagxYDUI%2Fb1xjDnYCKLpuIPeTv0VAKK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;669&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;669&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Asia/Seoul&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;root 계정 비밀번호 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;668&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bumKAz/dJMcacWEljh/hpKKieZHxeAvGdHZe9Uev0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bumKAz/dJMcacWEljh/hpKKieZHxeAvGdHZe9Uev0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bumKAz/dJMcacWEljh/hpKKieZHxeAvGdHZe9Uev0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbumKAz%2FdJMcacWEljh%2FhpKKieZHxeAvGdHZe9Uev0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;668&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;668&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;oracle/oracle&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;기본 소프트웨어 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;670&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cYEMX7/dJMcabKfPAU/ebymtI8K7ko3mmjiBfk6QK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cYEMX7/dJMcabKfPAU/ebymtI8K7ko3mmjiBfk6QK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cYEMX7/dJMcabKfPAU/ebymtI8K7ko3mmjiBfk6QK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcYEMX7%2FdJMcabKfPAU%2FebymtI8K7ko3mmjiBfk6QK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;670&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;670&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Customize now 선택 후 next&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/tHBe6/dJMcaiJjbkM/wJ7kLqMWvKOj3ZCsaiPVF0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/tHBe6/dJMcaiJjbkM/wJ7kLqMWvKOj3ZCsaiPVF0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/tHBe6/dJMcaiJjbkM/wJ7kLqMWvKOj3ZCsaiPVF0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FtHBe6%2FdJMcaiJjbkM%2FwJ7kLqMWvKOj3ZCsaiPVF0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;667&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Development
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Development Libraries&lt;/li&gt;
&lt;li&gt;Development Tools&lt;/li&gt;
&lt;li&gt;Legacy Software Development&lt;/li&gt;
&lt;li&gt;X Software Development&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;664&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/qQ3pn/dJMcacI9CD9/V6QO8khIpForKh6lYopTv0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/qQ3pn/dJMcacI9CD9/V6QO8khIpForKh6lYopTv0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/qQ3pn/dJMcacI9CD9/V6QO8khIpForKh6lYopTv0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FqQ3pn%2FdJMcacI9CD9%2FV6QO8khIpForKh6lYopTv0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;664&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;664&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Base System : System Tools 체크&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;669&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/csofCU/dJMcagkrPUA/oJloMEymAQCGWEdzzOz0aK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/csofCU/dJMcagkrPUA/oJloMEymAQCGWEdzzOz0aK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/csofCU/dJMcagkrPUA/oJloMEymAQCGWEdzzOz0aK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcsofCU%2FdJMcagkrPUA%2FoJloMEymAQCGWEdzzOz0aK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;793&quot; height=&quot;669&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;669&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Optional packages 선택
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;ocfs2&lt;/li&gt;
&lt;li&gt;oracle-validated&lt;/li&gt;
&lt;li&gt;oracleasm&lt;/li&gt;
&lt;li&gt;oracleasm-support&lt;/li&gt;
&lt;li&gt;sysstat&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;665&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cY6VnR/dJMcacWEllb/C9dNn5E6mgO37piLGnUx2K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cY6VnR/dJMcacWEllb/C9dNn5E6mgO37piLGnUx2K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cY6VnR/dJMcacWEllb/C9dNn5E6mgO37piLGnUx2K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcY6VnR%2FdJMcacWEllb%2FC9dNn5E6mgO37piLGnUx2K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;665&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;665&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;664&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/esM2SB/dJMcab4wcST/1pRyVduAu89P7Y70oqpIIK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/esM2SB/dJMcab4wcST/1pRyVduAu89P7Y70oqpIIK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/esM2SB/dJMcab4wcST/1pRyVduAu89P7Y70oqpIIK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FesM2SB%2FdJMcab4wcST%2F1pRyVduAu89P7Y70oqpIIK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;664&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;664&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/boIxTm/dJMb99TaoPY/QEdukxcmEMYhYvWuZM7hn0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/boIxTm/dJMb99TaoPY/QEdukxcmEMYhYvWuZM7hn0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/boIxTm/dJMb99TaoPY/QEdukxcmEMYhYvWuZM7hn0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FboIxTm%2FdJMb99TaoPY%2FQEdukxcmEMYhYvWuZM7hn0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;793&quot; height=&quot;667&quot; data-origin-width=&quot;793&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/djddnu/dJMcach4oGc/s46ik1Le7k1XKyvoXdvJzk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/djddnu/dJMcach4oGc/s46ik1Le7k1XKyvoXdvJzk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/djddnu/dJMcach4oGc/s46ik1Le7k1XKyvoXdvJzk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fdjddnu%2FdJMcach4oGc%2Fs46ik1Le7k1XKyvoXdvJzk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;667&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;669&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/wMqBh/dJMcach4oGM/T2OCfkvetym8repMGOUR50/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/wMqBh/dJMcach4oGM/T2OCfkvetym8repMGOUR50/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/wMqBh/dJMcach4oGM/T2OCfkvetym8repMGOUR50/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FwMqBh%2FdJMcach4oGM%2FT2OCfkvetym8repMGOUR50%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;669&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;669&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;19개 선택 후 next&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;설치 진행&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;670&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bXXxgu/dJMcadOKs3U/8YpwgA1nnBek1xRcAJTsa1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bXXxgu/dJMcadOKs3U/8YpwgA1nnBek1xRcAJTsa1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bXXxgu/dJMcadOKs3U/8YpwgA1nnBek1xRcAJTsa1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbXXxgu%2FdJMcadOKs3U%2F8YpwgA1nnBek1xRcAJTsa1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;670&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;670&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;next&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;669&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/rLRvE/dJMcach4oGV/raYFJvKzi91IQPQOF8hMkk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/rLRvE/dJMcach4oGV/raYFJvKzi91IQPQOF8hMkk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/rLRvE/dJMcach4oGV/raYFJvKzi91IQPQOF8hMkk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FrLRvE%2FdJMcach4oGV%2FraYFJvKzi91IQPQOF8hMkk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;669&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;669&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;reboot&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;669&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/tTUSD/dJMcadHZQFt/fLVtsZusgk4IOxc608Kpwk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/tTUSD/dJMcadHZQFt/fLVtsZusgk4IOxc608Kpwk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/tTUSD/dJMcadHZQFt/fLVtsZusgk4IOxc608Kpwk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FtTUSD%2FdJMcadHZQFt%2FfLVtsZusgk4IOxc608Kpwk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;795&quot; height=&quot;669&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;669&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;669&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/ZTJbi/dJMcahwVc7d/2OiK74hbIyZair7TQ0qkxK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/ZTJbi/dJMcahwVc7d/2OiK74hbIyZair7TQ0qkxK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/ZTJbi/dJMcahwVc7d/2OiK74hbIyZair7TQ0qkxK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FZTJbi%2FdJMcahwVc7d%2F2OiK74hbIyZair7TQ0qkxK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;669&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;669&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;리눅스 설정&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;669&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bcTU22/dJMcaiWQqeW/EPkNlUTCFhcLyMF4hkhjD1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bcTU22/dJMcaiWQqeW/EPkNlUTCFhcLyMF4hkhjD1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bcTU22/dJMcaiWQqeW/EPkNlUTCFhcLyMF4hkhjD1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbcTU22%2FdJMcaiWQqeW%2FEPkNlUTCFhcLyMF4hkhjD1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;798&quot; height=&quot;669&quot; data-origin-width=&quot;798&quot; data-origin-height=&quot;669&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;forward&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;라이센스 동의&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;668&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cl7j16/dJMcahwVc7l/mwjKNLFiohBlEPd5qHFeCK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cl7j16/dJMcahwVc7l/mwjKNLFiohBlEPd5qHFeCK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cl7j16/dJMcahwVc7l/mwjKNLFiohBlEPd5qHFeCK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fcl7j16%2FdJMcahwVc7l%2FmwjKNLFiohBlEPd5qHFeCK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;668&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;668&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;License 동의 후 forward&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;방화벽 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;665&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/Axdn5/dJMcahwVc7r/wlLJ8HNsV36ykVlTxqci60/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/Axdn5/dJMcahwVc7r/wlLJ8HNsV36ykVlTxqci60/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/Axdn5/dJMcahwVc7r/wlLJ8HNsV36ykVlTxqci60/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FAxdn5%2FdJMcahwVc7r%2FwlLJ8HNsV36ykVlTxqci60%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;665&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;665&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;방화벽 disabled&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;801&quot; data-origin-height=&quot;671&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bTy4VT/dJMcaiCyKbI/GppZ3dGyPnOxhhN84EWfEK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bTy4VT/dJMcaiCyKbI/GppZ3dGyPnOxhhN84EWfEK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bTy4VT/dJMcaiCyKbI/GppZ3dGyPnOxhhN84EWfEK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbTy4VT%2FdJMcaiCyKbI%2FGppZ3dGyPnOxhhN84EWfEK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;801&quot; height=&quot;671&quot; data-origin-width=&quot;801&quot; data-origin-height=&quot;671&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Yes&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;SELinux 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;666&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/7kXAA/dJMcaiCyKbM/L0tKlrMxAMBUNAiZbu3Ta1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/7kXAA/dJMcaiCyKbM/L0tKlrMxAMBUNAiZbu3Ta1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/7kXAA/dJMcaiCyKbM/L0tKlrMxAMBUNAiZbu3Ta1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F7kXAA%2FdJMcaiCyKbM%2FL0tKlrMxAMBUNAiZbu3Ta1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;799&quot; height=&quot;666&quot; data-origin-width=&quot;799&quot; data-origin-height=&quot;666&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;SELinux 설정 Disabled&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;666&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/E6pCZ/dJMcahDEsID/BYithcLUlERV6EK69GZ6l1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/E6pCZ/dJMcahDEsID/BYithcLUlERV6EK69GZ6l1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/E6pCZ/dJMcahDEsID/BYithcLUlERV6EK69GZ6l1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FE6pCZ%2FdJMcahDEsID%2FBYithcLUlERV6EK69GZ6l1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;666&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;666&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Yes&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Kdump 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;670&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bAeKgu/dJMcafMEAVS/yRUOBKIW73e2KfWX9CeJuk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bAeKgu/dJMcafMEAVS/yRUOBKIW73e2KfWX9CeJuk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bAeKgu/dJMcafMEAVS/yRUOBKIW73e2KfWX9CeJuk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbAeKgu%2FdJMcafMEAVS%2FyRUOBKIW73e2KfWX9CeJuk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;802&quot; height=&quot;670&quot; data-origin-width=&quot;802&quot; data-origin-height=&quot;670&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Enable kdump 체크 X&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;날짜 및 시간 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;666&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/dlQMLY/dJMcabwFYmG/xXTFRmk7Jb0G5Crr3FIFH0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/dlQMLY/dJMcabwFYmG/xXTFRmk7Jb0G5Crr3FIFH0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/dlQMLY/dJMcabwFYmG/xXTFRmk7Jb0G5Crr3FIFH0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdlQMLY%2FdJMcabwFYmG%2FxXTFRmk7Jb0G5Crr3FIFH0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;666&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;666&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;현재 시간으로 설정&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;사용자 생성&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/chIeYu/dJMcabwFYmJ/mnP36ehnaX2Jv2ZaFgWNF0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/chIeYu/dJMcabwFYmJ/mnP36ehnaX2Jv2ZaFgWNF0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/chIeYu/dJMcabwFYmJ/mnP36ehnaX2Jv2ZaFgWNF0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FchIeYu%2FdJMcabwFYmJ%2FmnP36ehnaX2Jv2ZaFgWNF0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;667&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Username : itwill&lt;/li&gt;
&lt;li&gt;Full Name : itwill&lt;/li&gt;
&lt;li&gt;Password : oracle&lt;/li&gt;
&lt;li&gt;Confirm Password : oracle&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Sound Card 설정&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;792&quot; data-origin-height=&quot;668&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/czURTo/dJMcagrdTWS/elEkzStt9bS53IKd1y5PiK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/czURTo/dJMcagrdTWS/elEkzStt9bS53IKd1y5PiK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/czURTo/dJMcagrdTWS/elEkzStt9bS53IKd1y5PiK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FczURTo%2FdJMcagrdTWS%2FelEkzStt9bS53IKd1y5PiK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;792&quot; height=&quot;668&quot; data-origin-width=&quot;792&quot; data-origin-height=&quot;668&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Sound Card 는 그대로 둠&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;추가 CD 설치&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;801&quot; data-origin-height=&quot;665&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/pMjeS/dJMcagrdTW0/0nIlMlE1lYWnDjbaXc1tx0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/pMjeS/dJMcagrdTW0/0nIlMlE1lYWnDjbaXc1tx0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/pMjeS/dJMcagrdTW0/0nIlMlE1lYWnDjbaXc1tx0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FpMjeS%2FdJMcagrdTW0%2F0nIlMlE1lYWnDjbaXc1tx0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;801&quot; height=&quot;665&quot; data-origin-width=&quot;801&quot; data-origin-height=&quot;665&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;안하고 Finish&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;801&quot; data-origin-height=&quot;667&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/R0vnY/dJMcagY3mLy/IdYsb8nUWXRzs4ChcFJ73k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/R0vnY/dJMcagY3mLy/IdYsb8nUWXRzs4ChcFJ73k/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/R0vnY/dJMcagY3mLy/IdYsb8nUWXRzs4ChcFJ73k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FR0vnY%2FdJMcagY3mLy%2FIdYsb8nUWXRzs4ChcFJ73k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;801&quot; height=&quot;667&quot; data-origin-width=&quot;801&quot; data-origin-height=&quot;667&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;OK&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;root 접속&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;666&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/I60WN/dJMcahcA2JV/feuJ7Yds4TIyhKkOiOYVvk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/I60WN/dJMcahcA2JV/feuJ7Yds4TIyhKkOiOYVvk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/I60WN/dJMcahcA2JV/feuJ7Yds4TIyhKkOiOYVvk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FI60WN%2FdJMcahcA2JV%2FfeuJ7Yds4TIyhKkOiOYVvk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;666&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;666&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;root/oracle로 로그인&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;게스트 확장 CD 이미지 삽입&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;673&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bdgqvP/dJMcaiigWoD/8WpGDirEzCOxnYeUqvh3c0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bdgqvP/dJMcaiigWoD/8WpGDirEzCOxnYeUqvh3c0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bdgqvP/dJMcaiigWoD/8WpGDirEzCOxnYeUqvh3c0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbdgqvP%2FdJMcaiigWoD%2F8WpGDirEzCOxnYeUqvh3c0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;795&quot; height=&quot;673&quot; data-origin-width=&quot;795&quot; data-origin-height=&quot;673&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;VBoxLinuxAdditions.run 실행&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;660&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/QC43g/dJMcabQYQJW/g0nPbxiLLH0SuaFU83CcA0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/QC43g/dJMcabQYQJW/g0nPbxiLLH0SuaFU83CcA0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/QC43g/dJMcabQYQJW/g0nPbxiLLH0SuaFU83CcA0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FQC43g%2FdJMcabQYQJW%2Fg0nPbxiLLH0SuaFU83CcA0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;796&quot; height=&quot;660&quot; data-origin-width=&quot;796&quot; data-origin-height=&quot;660&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;662&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bw0EQo/dJMcaaLjQSA/SNY5ocP0IfxL1V7KSINujk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bw0EQo/dJMcaaLjQSA/SNY5ocP0IfxL1V7KSINujk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bw0EQo/dJMcaaLjQSA/SNY5ocP0IfxL1V7KSINujk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbw0EQo%2FdJMcaaLjQSA%2FSNY5ocP0IfxL1V7KSINujk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;800&quot; height=&quot;662&quot; data-origin-width=&quot;800&quot; data-origin-height=&quot;662&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;reboot&lt;/h3&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;664&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/YkqWA/dJMcajanxgi/sRgAdXmEsrW6uUhVOFJRp1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/YkqWA/dJMcajanxgi/sRgAdXmEsrW6uUhVOFJRp1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/YkqWA/dJMcajanxgi/sRgAdXmEsrW6uUhVOFJRp1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FYkqWA%2FdJMcajanxgi%2FsRgAdXmEsrW6uUhVOFJRp1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;664&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;664&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;668&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/B3XkN/dJMcagLydl3/CtpKqKEM8nRVmqF3bmF1t0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/B3XkN/dJMcagLydl3/CtpKqKEM8nRVmqF3bmF1t0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/B3XkN/dJMcagLydl3/CtpKqKEM8nRVmqF3bmF1t0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FB3XkN%2FdJMcagLydl3%2FCtpKqKEM8nRVmqF3bmF1t0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;797&quot; height=&quot;668&quot; data-origin-width=&quot;797&quot; data-origin-height=&quot;668&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;터미널에서 &lt;code&gt;reboot&lt;/code&gt; 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Putty 접속&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;448&quot; data-origin-height=&quot;434&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/EBQj2/dJMcagLydl5/8jr8CbvRYieWFK860Ny9Qk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/EBQj2/dJMcagLydl5/8jr8CbvRYieWFK860Ny9Qk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/EBQj2/dJMcagLydl5/8jr8CbvRYieWFK860Ny9Qk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FEBQj2%2FdJMcagLydl5%2F8jr8CbvRYieWFK860Ny9Qk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;448&quot; height=&quot;434&quot; data-origin-width=&quot;448&quot; data-origin-height=&quot;434&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;ip 정보 확인&lt;/h3&gt;
&lt;pre class=&quot;properties&quot;&gt;&lt;code&gt;login as: root
root@192.168.56.110's password:
Last login: Tue Feb 24 16:13:11 2026
[root@rac1 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:48:70:17
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:805 (805.0 b)  TX bytes:7026 (6.8 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:A6:E0:45
          inet addr:192.168.56.110  Bcast:192.168.56.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5853 (5.7 KiB)  TX bytes:8669 (8.4 KiB)

eth2      Link encap:Ethernet  HWaddr 08:00:27:3B:7C:C2
          inet addr:192.168.55.110  Bcast:192.168.55.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2082 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:167631 (163.7 KiB)  TX bytes:4737 (4.6 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:866 errors:0 dropped:0 overruns:0 frame:0
          TX packets:866 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1686704 (1.6 MiB)  TX bytes:1686704 (1.6 MiB)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;hosts 설정&lt;/h3&gt;
&lt;pre class=&quot;accesslog&quot;&gt;&lt;code&gt;[root@rac1 ~]# vi /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               rac1 localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

# Public
192.168.56.110 rac1
192.168.56.111 rac2

# Private
192.168.55.110 rac1-priv
192.168.55.111 rac2-priv

# Virtual
192.168.56.112 rac1-vip
192.168.56.113 rac2-vip

# grid scan
192.168.56.114 rac-scan&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;리소스 낭비를 줄이기 위해 불필요한 서비스 중단&lt;/h3&gt;
&lt;pre class=&quot;nginx&quot;&gt;&lt;code&gt;chkconfig --level 123456 xinetd off
chkconfig --level 123456 sendmail off
chkconfig --level 123456 cups off
chkconfig --level 123456 cups-config-daemon off
chkconfig --level 123456 smartd off
chkconfig --level 123456 iptables off
chkconfig --level 123456 ip6tables off
chkconfig --level 123456 bluetooth off&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;temp size 수정&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 ~]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0

[root@rac1 ~]# vi /etc/fstab

[root@rac1 ~]# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   size=1500m        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;tmpfs : defaults &amp;rarr; size=1500m&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;사용자 인증에 관한 내용 추가&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;[root@rac1 ~]# cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth       include      system-auth
account    required     pam_nologin.so
account    include      system-auth
password   include      system-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    optional     pam_keyinit.so force revoke
session    required     pam_loginuid.so
session    include      system-auth
session    optional     pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open

[root@rac1 ~]# vi /etc/pam.d/login

[root@rac1 ~]# cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth       include      system-auth
account    required     pam_nologin.so
account    include      system-auth
password   include      system-auth
# pam_selinux.so close should be the first session rule
session    required     pam_selinux.so close
session    optional     pam_keyinit.so force revoke
session    required     pam_loginuid.so
session    include      system-auth
session    optional     pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session    required     pam_selinux.so open
session required pam_limits.so&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;session required pam_limits.so&lt;/code&gt; 추가&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;커널 기반 타이머를 사용하여 시스템 태스크 스케줄러에 발생하는 딜레이를 정기적으로 점검하는 방식&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac1 ~]# cat /etc/modprobe.conf
alias eth0 e1000
alias eth1 e1000
alias eth2 e1000
alias scsi_hostadapter ata_piix
alias scsi_hostadapter1 ahci
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1
alias snd-card-0 snd-intel8x0
options snd-card-0 index=0
options snd-intel8x0 index=0
remove snd-intel8x0 { /usr/sbin/alsactl store 0 &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0

[root@rac1 ~]# vi /etc/modprobe.conf
[root@rac1 ~]# cat /etc/modprobe.conf
alias eth0 e1000
alias eth1 e1000
alias eth2 e1000
alias scsi_hostadapter ata_piix
alias scsi_hostadapter1 ahci
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1
alias snd-card-0 snd-intel8x0
options snd-card-0 index=0
options snd-intel8x0 index=0
remove snd-intel8x0 { /usr/sbin/alsactl store 0 &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180

[root@rac1 ~]# modprobe -v hangcheck-timer
insmod /lib/modules/2.6.32-100.26.2.el5/kernel/drivers/char/hangcheck-timer.ko hangcheck_tick=30 hangcheck_margin=180&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180&lt;/code&gt; 추가&lt;/li&gt;
&lt;li&gt;&lt;code&gt;modprobe -v hangcheck-tim&lt;/code&gt;행&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;시간 동기화 방식 사용&lt;/h3&gt;
&lt;pre class=&quot;bash&quot;&gt;&lt;code&gt;[root@rac1 ~]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

[root@rac1 ~]# vi /etc/rc.local
[root@rac1 ~]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/sbin/modprobe hangcheck-timer
rdate -s 203.248.240.140&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;ntp 관련 설정 파일들을 사용하지 못하도록 변경&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;mv /etc/sysconfig/ntpd /etc/sysconfig/ntpd.original 
mv /etc/ntp /etc/ntp.origina 
mv /etc/ntp.conf /etc/ntp.conf.original&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;ASM 구성 패키지&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 ~]# rpm -qa | grep oracle
oracle-logos-4.9.17-10
oracle-linux-5.0.0-7.el5
oracle-validated-1.1.0-7.el5
oracleasm-support-2.1.4-1.el5
oracleasm-2.6.18-238.el5-2.0.5-1.el5
oraclelinux-release-5-6.0.1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;공유 폴더로 이동&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 ~]# cd /media/sf_11g_rac_file
[root@rac1 sf_11g_rac_file]# ls
database                                linux_11gR2_grid
database.zip                            linux_11gR2_grid.zip
Enterprise-R5-U6-Server-x86_64-dvd.iso  oracleasmlib-2.0.4-1.el5.x86_64.rpm&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;공유 폴더가 안생기면 MobaXterm sftp로 rpm 파일 전송해도 됨
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;developer 소프트웨어 설치할 때 제대로 체크 안해서 안됐었음&amp;hellip;ㅠ&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1916&quot; data-origin-height=&quot;1026&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/3KMPB/dJMcagxYDVV/kXIOOuVKD68lqkMWuBxP2K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/3KMPB/dJMcagxYDVV/kXIOOuVKD68lqkMWuBxP2K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/3KMPB/dJMcagxYDVV/kXIOOuVKD68lqkMWuBxP2K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F3KMPB%2FdJMcagxYDVV%2FkXIOOuVKD68lqkMWuBxP2K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1916&quot; height=&quot;1026&quot; data-origin-width=&quot;1916&quot; data-origin-height=&quot;1026&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;rpm 파일 실행&lt;/h3&gt;
&lt;pre class=&quot;clean&quot;&gt;&lt;code&gt;[root@rac1 sf_11g_rac_file]# rpm -Uvh oracleasmlib-2.0.4-1.el5.x86_64.rpm
warning: oracleasmlib-2.0.4-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 sf_11g_rac_file]# rpm -qa | grep oracle
oracleasm-support-2.1.4-1.el5
oracleasm-2.6.18-238.el5-2.0.5-1.el5
oracleasmlib-2.0.4-1.el5
oracle-logos-4.9.17-10
oracle-linux-5.0.0-7.el5
oraclelinux-release-5-6.0.1
oracle-validated-1.1.0-7.el5&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;유저와 그룹 생성&lt;/h3&gt;
&lt;pre class=&quot;less&quot;&gt;&lt;code&gt;[root@rac1 ~]# cat /etc/group
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
tty:x:5:
disk:x:6:root
lp:x:7:daemon,lp
mem:x:8:
kmem:x:9:
wheel:x:10:root
mail:x:12:mail
news:x:13:news
uucp:x:14:uucp
man:x:15:
games:x:20:
gopher:x:30:
dip:x:40:
ftp:x:50:
lock:x:54:
nobody:x:99:
users:x:100:
utmp:x:22:
utempter:x:35:
nscd:x:28:
floppy:x:19:
vcsa:x:69:
ntp:x:38:
pcap:x:77:
slocate:x:21:
dbus:x:81:
audio:x:63:gdm
avahi:x:70:
rpc:x:32:
mailnull:x:47:
smmsp:x:51:
sshd:x:74:
screen:x:84:
xfs:x:43:
rpcuser:x:29:
nfsnobody:x:4294967294:
haldaemon:x:68:
avahi-autoipd:x:101:
gdm:x:42:
oinstall:x:54321:
dba:x:54322:oracle
sabayon:x:86:
itwill:x:500:
vboxsf:x:102:
vboxdrmipc:x:103:&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;groupadd -g 501 oinstall -- 생성되어 있음
groupadd -g 502 dba -- 생성되어 있음
groupadd -g 503 oper
groupadd -g 504 asmadmin            
groupadd -g 506 asmdba
groupadd -g 507 asmoper
groupadd -g 508 vboxsf -- 생성되어 있음&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;less&quot;&gt;&lt;code&gt;[root@rac1 ~]# cat /etc/group
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
tty:x:5:
disk:x:6:root
lp:x:7:daemon,lp
mem:x:8:
kmem:x:9:
wheel:x:10:root
mail:x:12:mail
news:x:13:news
uucp:x:14:uucp
man:x:15:
games:x:20:
gopher:x:30:
dip:x:40:
ftp:x:50:
lock:x:54:
nobody:x:99:
users:x:100:
utmp:x:22:
utempter:x:35:
nscd:x:28:
floppy:x:19:
vcsa:x:69:
ntp:x:38:
pcap:x:77:
slocate:x:21:
dbus:x:81:
audio:x:63:gdm
avahi:x:70:
rpc:x:32:
mailnull:x:47:
smmsp:x:51:
sshd:x:74:
screen:x:84:
xfs:x:43:
rpcuser:x:29:
nfsnobody:x:4294967294:
haldaemon:x:68:
avahi-autoipd:x:101:
gdm:x:42:
oinstall:x:54321:
dba:x:54322:oracle
sabayon:x:86:
itwill:x:500:
vboxsf:x:102:
vboxdrmipc:x:103:
oper:x:503:
asmadmin:x:504:
asmdba:x:506:
asmoper:x:507:&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;ruby&quot;&gt;&lt;code&gt;[root@rac1 ~]# cat /etc/passwd | grep oracle
oracle:x:54321:54321::/home/oracle:/bin/bash
[root@rac1 ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;oracle 유저 2차 그룹 추가&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 ~]# usermod -a -G oper,asmadmin,asmdba,asmoper,vboxsf oracle
[root@rac1 ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),102(vboxsf),503(oper),504(asmadmin),506(asmdba),507(asmoper)&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;oracle 패스워드 설정&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;[root@rac1 ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;디렉터리 생성&lt;/h3&gt;
&lt;pre class=&quot;groovy&quot;&gt;&lt;code&gt;mkdir -p /u01/app/oraInventory
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/cfgtoollogs
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1   
chown -R oracle:oinstall /u01             
chmod -R 755 /u01&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;[root@rac1 ~]# ls -Rl /u01
/u01:
total 4
drwxr-xr-x 5 oracle oinstall 4096 Feb 24 17:21 app

/u01/app:
total 12
drwxr-xr-x 3 oracle oinstall 4096 Feb 24 17:21 11.2.0
drwxr-xr-x 4 oracle oinstall 4096 Feb 24 17:21 oracle
drwxr-xr-x 2 oracle oinstall 4096 Feb 24 17:20 oraInventory

/u01/app/11.2.0:
total 4
drwxr-xr-x 2 oracle oinstall 4096 Feb 24 17:21 grid

/u01/app/11.2.0/grid:
total 0

/u01/app/oracle:
total 8
drwxr-xr-x 2 oracle oinstall 4096 Feb 24 17:21 cfgtoollogs
drwxr-xr-x 3 oracle oinstall 4096 Feb 24 17:21 product

/u01/app/oracle/cfgtoollogs:
total 0

/u01/app/oracle/product:
total 4
drwxr-xr-x 3 oracle oinstall 4096 Feb 24 17:21 11.2.0

/u01/app/oracle/product/11.2.0:
total 4
drwxr-xr-x 2 oracle oinstall 4096 Feb 24 17:21 dbhome_1

/u01/app/oracle/product/11.2.0/dbhome_1:
total 0

/u01/app/oraInventory:
total 0
&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>rac</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <category>튜닝</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/237</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260224-TIL#entry237comment</comments>
      <pubDate>Sun, 15 Mar 2026 23:04:04 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260223 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260223-TIL</link>
      <description>&lt;h1&gt;병렬처리&lt;/h1&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;SQL문이 수행해야 할 작업 범위를 여러 개의 작은 단위로 나누어 여러 프로세스가 동시에 처리하는 작업을 의미&lt;/li&gt;
&lt;li&gt;대용량 데이터를 처리할 때 효과적&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 실습용 테이블 생성
drop table hr.emp purge;

create table hr.emp tablespace users
as
select rownum as employee_id, last_name, first_name, hire_date, job_id, salary, manager_id, department_id
from hr.employees e,(select level as id from dual connect by level &amp;lt;=1000) ;

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, logging from dba_tables where owner = 'HR' and table_name = 'EMP';

  NUM_ROWS     BLOCKS AVG_ROW_LEN LOG
---------- ---------- ----------- ---
    107000        761          45 YES&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;smali&quot;&gt;&lt;code&gt;# arraysize 증가
SYS@ora19c&amp;gt; show arraysize
arraysize 15
SYS@ora19c&amp;gt; set array 1000
SYS@ora19c&amp;gt; show array
arraysize 1000&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Serial Full Table Scan&lt;/h2&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ count(*) from hr.emp;

  COUNT(*)
----------
    107000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5z9q6fftms7vk, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ count(*) from hr.emp

Plan hash value: 2083865914

----------------------------------------------------------------------------------------------
| Id  | Operation          | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |      |      1 |        |      1 |00:00:00.03 |     743 |    741 |
|   1 |  SORT AGGREGATE    |      |      1 |      1 |      1 |00:00:00.03 |     743 |    741 |
|   2 |   TABLE ACCESS FULL| EMP  |      1 |    107K|    107K|00:00:00.04 |     743 |    741 |
----------------------------------------------------------------------------------------------

14 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Parallel Full Table Scan&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Direct Path Read 방식&lt;/li&gt;
&lt;li&gt;데이터파일에서 PGA로 바로 읽어들여서 처리&lt;/li&gt;
&lt;li&gt;CPU 코어 수의 영향을 받음(현재는 CPU 코어 수가 적기 때문에 병렬 처리로 수행한 쿼리의 수행 시간이 조금 더 나왔음)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics parallel(e 2) */ count(*) from hr.emp e;

  COUNT(*)
----------
    107000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4nazhuvgtfkj8, child number 0
-------------------------------------
select /*+ gather_plan_statistics parallel(e 2) */ count(*) from hr.emp
e

Plan hash value: 2810914317

--------------------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |          |      1 |        |        |      |            |      1 |00:00:00.08 |       5 |
|   1 |  SORT AGGREGATE        |          |      1 |      1 |        |      |            |      1 |00:00:00.08 |       5 |
|   2 |   PX COORDINATOR       |          |      1 |        |        |      |            |      2 |00:00:00.08 |       5 |
|   3 |    PX SEND QC (RANDOM) | :TQ10000 |      0 |      1 |  Q1,00 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |       0 |
|   4 |     SORT AGGREGATE     |          |      0 |      1 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |
|   5 |      PX BLOCK ITERATOR |          |      0 |    107K|  Q1,00 | PCWC |            |      0 |00:00:00.01 |       0 |
|*  6 |       TABLE ACCESS FULL| EMP      |      0 |    107K|  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |
--------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   6 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

28 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;병렬 쿼리에서 사용한 테이블 큐(TQ) 통계 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P000                              1         36         10
         0 Producer                                 P001                              1         36         17
         0 Consumer                                 QC                                2         72         27&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;전체 row 조회&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics parallel(e 2) */ * from hr.emp e;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  amwgw4vrwnwhk, child number 0
-------------------------------------
select /*+ gather_plan_statistics parallel(e 2) */ * from hr.emp e

Plan hash value: 2873591275

------------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |          |      1 |        |        |      |            |    107K|00:00:00.08 |       5 |
|   1 |  PX COORDINATOR      |          |      1 |        |        |      |            |    107K|00:00:00.08 |       5 |
|   2 |   PX SEND QC (RANDOM)| :TQ10000 |      0 |    107K|  Q1,00 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |       0 |
|   3 |    PX BLOCK ITERATOR |          |      0 |    107K|  Q1,00 | PCWC |            |      0 |00:00:00.01 |       0 |
|*  4 |     TABLE ACCESS FULL| EMP      |      0 |    107K|  Q1,00 | PCWP |            |      0 |00:00:00.01 |       0 |
------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

25 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P000                          52394    2779042         25
         0 Producer                                 P001                          54606    2886252         21
         0 Consumer                                 QC                           107000    5665294         79&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;병렬도(degree)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;병렬도 = 2&lt;/li&gt;
&lt;li&gt;병렬 서버 프로세스 = 병렬도 * 2 = 2 * 2 = 4&lt;/li&gt;
&lt;li&gt;통신 채널 수 = 병렬도 ** 2 = 2 ** 2 = 4&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;정렬 수행&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics parallel(e 2) */ * from hr.emp e order by last_name;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5na4aafpvb1xk, child number 0
-------------------------------------
select /*+ gather_plan_statistics parallel(e 2) */ * from hr.emp e
order by last_name

Plan hash value: 3979194000

------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |          |      1 |        |        |      |            |    107K|00:00:00.11 |   5 |        |       |          |
|   1 |  PX COORDINATOR         |          |      1 |        |        |      |            |    107K|00:00:00.11 |   5 | 24576 | 24576 |22528  (0)|
|   2 |   PX SEND QC (ORDER)    | :TQ10001 |      0 |    107K|  Q1,01 | P-&amp;gt;S | QC (ORDER) |      0 |00:00:00.01 |   0 |        |       |          |
|   3 |    SORT ORDER BY        |          |      0 |    107K|  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |  8469K|  1142K| 3763K (0)|
|   4 |     PX RECEIVE          |          |      0 |    107K|  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   5 |      PX SEND RANGE      | :TQ10000 |      0 |    107K|  Q1,00 | P-&amp;gt;P | RANGE      |      0 |00:00:00.01 |   0 |        |       |          |
|   6 |       PX BLOCK ITERATOR |          |      0 |    107K|  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  7 |        TABLE ACCESS FULL| EMP      |      0 |    107K|  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   7 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

29 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Ranger                                   QC                                2       9622          4
         0 Producer                                 P002                          57038    3010589         18
         0 Producer                                 P003                          50394    2664351         16
         0 Consumer                                 P000                          53000    2795668        277
         0 Consumer                                 P001                          54000    2869650        277
         1 Producer                                 P000                          53000    2795644         97
         1 Producer                                 P001                          54000    2869650         91
         1 Consumer                                 QC                           107000    5665294        218

8 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;생산자(Producer) : 작업을 생성, 데이터 추출, 데이터를 추출해서 버퍼에 저장, PX SEND&lt;/li&gt;
&lt;li&gt;소비자(Consumer) : 작업을 추리, 버퍼에 있는 데이터를 꺼내서 소비(정렬, 그룹 작업 수행) PX RECEIVE&lt;/li&gt;
&lt;li&gt;테이블 큐 : 프로세스 간 통신 즉 메시지 또는 데이터를 전송하기 위한 통신, 파이프라인(pipeline)&lt;/li&gt;
&lt;li&gt;intra operation parallelism
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;서로 배타적인 범위를 독립적으로 동시에 처리&lt;/li&gt;
&lt;li&gt;여러 프로세스가 처리 범위를 달리하면서 병렬도 작업을 진행하는 것으로 집합 내에서는 절대 프로세스 간 통신은 발생하지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;inter operation parallelism
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;다른 서버 집합에 분배하거나 결과를 QC에게 전송하는 작업을 병렬로 동시에 진행하는 것을 의미&lt;/li&gt;
&lt;li&gt;프로세스 간 통신이 발생하고 메시지 또는 데이터를 전송하기 위한 통신 채널이 필요&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://docs.oracle.com/en/database/oracle/oracle-database/19/cncpt/process-architecture.html#GUID-BD43E5D1-82C1-4997-8461-7CBBAFC7ED49&quot;&gt;https://docs.oracle.com/en/database/oracle/oracle-database/19/cncpt/process-architecture.html#GUID-BD43E5D1-82C1-4997-8461-7CBBAFC7ED49&lt;/a&gt;&lt;/p&gt;
&lt;table data-ke-align=&quot;alignLeft&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;P002, P003&lt;/th&gt;
&lt;th&gt;테이블 큐(:TQ10000)&lt;/th&gt;
&lt;th&gt;P000, P001&lt;/th&gt;
&lt;th&gt;P000, P001&lt;/th&gt;
&lt;th&gt;테이블 큐(:TQ10001)&lt;/th&gt;
&lt;th&gt;QC&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Producer (병렬 서버 집합 1)&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;Consumer (병렬 서버 집합 2)&lt;/td&gt;
&lt;td&gt;Producer&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;Consumer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PX BLOCK ITERATOR&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;데이터 추출&lt;/td&gt;
&lt;td&gt;PX SEND RANGE&lt;/td&gt;
&lt;td&gt;PX RECEIVE&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;정렬&lt;/td&gt;
&lt;td&gt;정렬 결과 집합&lt;/td&gt;
&lt;td&gt;PX SEND QC (ORDER)&lt;/td&gt;
&lt;td&gt;PX COORDINATOR&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;생산자로부터 받은 각각의 정렬 결과를 머지해서 유저한테 전달&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;intra operation parallelism&lt;/td&gt;
&lt;td&gt;inter operation parallelism&lt;/td&gt;
&lt;td&gt;intra operation parallelism&lt;/td&gt;
&lt;td&gt;intra operation parallelism&lt;/td&gt;
&lt;td&gt;inter operation parallelism&lt;/td&gt;
&lt;td&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;3840&quot; data-origin-height=&quot;2160&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/P4ztD/dJMcabpWPO2/WJeKzgOw0lWlw8Od1Fjc10/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/P4ztD/dJMcabpWPO2/WJeKzgOw0lWlw8Od1Fjc10/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/P4ztD/dJMcabpWPO2/WJeKzgOw0lWlw8Od1Fjc10/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FP4ztD%2FdJMcabpWPO2%2FWJeKzgOw0lWlw8Od1Fjc10%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;3840&quot; height=&quot;2160&quot; data-origin-width=&quot;3840&quot; data-origin-height=&quot;2160&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;병렬도 4로 수행&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;병렬 서버 프로세스 수 = 4 *2 = 8&lt;/li&gt;
&lt;li&gt;통신 채널 수 = 4 ** 2 = 16&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics parallel(e 4) */ * from hr.emp e order by last_name;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  dp197498z3d62, child number 0
-------------------------------------
select /*+ gather_plan_statistics parallel(e 4) */ * from hr.emp e
order by last_name

Plan hash value: 3979194000

------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |          |      1 |        |        |      |            |    107K|00:00:00.25 |   5 |        |       |          |
|   1 |  PX COORDINATOR         |          |      1 |        |        |      |            |    107K|00:00:00.25 |   5 |   115K|   115K|  102K (0)|
|   2 |   PX SEND QC (ORDER)    | :TQ10001 |      0 |    107K|  Q1,01 | P-&amp;gt;S | QC (ORDER) |      0 |00:00:00.01 |   0 |        |       |          |
|   3 |    SORT ORDER BY        |          |      0 |    107K|  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |  8433K|  1140K| 1810K (0)|
|   4 |     PX RECEIVE          |          |      0 |    107K|  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   5 |      PX SEND RANGE      | :TQ10000 |      0 |    107K|  Q1,00 | P-&amp;gt;P | RANGE      |      0 |00:00:00.01 |   0 |        |       |          |
|   6 |       PX BLOCK ITERATOR |          |      0 |    107K|  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  7 |        TABLE ACCESS FULL| EMP      |      0 |    107K|  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   7 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 4 because of table property

29 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Ranger                                   QC                               12      44755          4
         0 Producer                                 P004                          24865    1285464         13
         0 Producer                                 P005                          33531    1767441         21
         0 Producer                                 P006                          26477    1387705         14
         0 Producer                                 P007                          24147    1269511         12
         0 Consumer                                 P000                          27000    1431340       1617
         0 Consumer                                 P001                          26000    1364352       1616
         0 Consumer                                 P002                          27000    1432337       1616
         0 Consumer                                 P003                          27000    1437337       1616
         1 Producer                                 P000                          27000    1431340         28
         1 Producer                                 P001                          26000    1364328         50
         1 Producer                                 P002                          27000    1432337         16
         1 Producer                                 P003                          27000    1437337         33
         1 Consumer                                 QC                           107000    5665342        217

14 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;QC(Query Coordinator)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;병렬 SQL문을 발생한 세션&lt;/li&gt;
&lt;li&gt;작업을 지시하고 일이 잘 진행되는지 관리, 감독하는 역할&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;병렬 서버 프로세스&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;실제 작업을 수행하는 프로세스&lt;/li&gt;
&lt;li&gt;병렬 서버 = 병렬 프로세스 = 병렬 슬레이브&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;병렬 서버 풀(Parallel Execution Server Pool)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;large pool을 사용&lt;/li&gt;
&lt;li&gt;병렬 처리가 발생하지 않더라도 &lt;code&gt;parallel_min_servers&lt;/code&gt; 파라미터로 지정된 개수만큼 병렬 프로세스를 유지&lt;/li&gt;
&lt;li&gt;병렬 처리 시 서버 프로세스를 띄우는 부하를 줄이기 위해 사용&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; show parameter parallel_min_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
parallel_min_servers                 integer     4&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;부족한 경우 추가로 생성&lt;/li&gt;
&lt;li&gt;생성할 수 있는 최대 병렬 서버 프로세스 수는 &lt;code&gt;parallel_max_servers&lt;/code&gt; 파라미터로 설정되어 있음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; show parameter parallel_max_servers

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
parallel_max_servers                 integer     40&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;병렬 서버 집합(server set)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;병렬도 (DOP, Degree Of Parallelism)와 operation 종류에 따라 한 개 또는 여러 개의 병렬 서버 집합이 할당됨&lt;/li&gt;
&lt;li&gt;병렬 서버 풀로부터 필요한 만큼 병렬 서버 프로세스를 확보&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;IN-OUT Operation&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;blank : serial 한 작업&lt;/li&gt;
&lt;li&gt;P&amp;rarr;S : Parallel To Serial, 각 병렬 서버 프로세스가 처리한 데이터를 QC에게 전송&lt;/li&gt;
&lt;li&gt;P&amp;rarr;P : Parallel To Parallel, 데이터 정렬, 그룹핑하거나 조인을 위해 동적으로 파티셔닝할 때 사용, 첫 번째병렬 서버 집합이 읽거나 가공한 데이터를 두 번째 병렬 서버 집합에 전송&lt;/li&gt;
&lt;li&gt;S&amp;rarr;P : Serial To Parallel, QC가 읽은 데이터를 테이블 큐를 통해 병렬 서버 프로세스에게 전송&lt;/li&gt;
&lt;li&gt;PCWP : Parallel Combined With Parent, 한 서버 집합에서 현재 스텝과 그 부모 스텝을 모두 처리&lt;/li&gt;
&lt;li&gt;PCWC : Parallel Combined With Child, 한 서버 집합에서 현재 스텝과 그 자식 스텝을 모두 처리&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;병렬 쿼리 수행 시 Partial Checkpoint가 발생하는 이유&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Direct Path Read를 하기 전에 dirty buffer의 변경 사항들이 데이터 파일에 반영되어야 일관성 있는 읽기함&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;group by hash down(gby_pushdown)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;parallel query group by가 포함되어 있는 경우 발생&lt;/li&gt;
&lt;li&gt;데이터를 추출하면서 group by를 수행하여 데이터 건수를 줄일 수 있어 다음 Consumer 프로세스에게 데이터를 전달할 때 일량을 줄이면 성능을 향상시킬 수 있음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics parallel(e 2) */ department_id, count(*) from hr.emp e group by department_id;

DEPARTMENT_ID   COUNT(*)
------------- ----------
           50      45000
          110       2000
           30       6000
           80      34000
           40       1000
           90       3000
           70       1000
                    1000
           10       1000
           20       2000
           60       5000
          100       6000

12 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  bb2f5t3ps5pt8, child number 0
-------------------------------------
select /*+ gather_plan_statistics parallel(e 2) */ department_id,
count(*) from hr.emp e group by department_id

Plan hash value: 3345252319

-------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT         |          |      1 |        |        |      |            |     12 |00:00:00.03 |   5 |        |       |          |
|   1 |  PX COORDINATOR          |          |      1 |        |        |      |            |     12 |00:00:00.03 |   5 | 73728 | 73728 |           |
|   2 |   PX SEND QC (RANDOM)    | :TQ10001 |      0 |     11 |  Q1,01 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |   0 |        |       |          |
|   3 |    HASH GROUP BY         |          |      0 |     11 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |  1558K|  1558K| 1184K (0)|
|   4 |     PX RECEIVE           |          |      0 |     11 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   5 |      PX SEND HASH        | :TQ10000 |      0 |     11 |  Q1,00 | P-&amp;gt;P | HASH       |      0 |00:00:00.01 |   0 |        |       |          |
|   6 |       HASH GROUP BY      |          |      0 |     11 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |  1520K|  1520K| 1278K (0)|
|   7 |        PX BLOCK ITERATOR |          |      0 |    107K|  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  8 |         TABLE ACCESS FULL| EMP      |      0 |    107K|  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   8 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

30 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P002                             12        239          0
         0 Producer                                 P003                             12        239          0
         0 Consumer                                 P000                              8        178      11862
         0 Consumer                                 P001                             16        300      11865
         1 Producer                                 P000                              4         59          2
         1 Producer                                 P001                              8         86          2
         1 Consumer                                 QC                               12        145          2

7 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;hash group by 가 총 2번 동작&lt;/li&gt;
&lt;li&gt;P002, P003 프로세스가 데이터를 추출하면서 그룹핑 수행
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;각각 12개의 그룹을 생성(Null ~ 110번 부서)&lt;/li&gt;
&lt;li&gt;P000에 각각 4개의 그룹(20, 50, 80, 100번 부서)을 전송(총 8개)&lt;/li&gt;
&lt;li&gt;P001에 각각 8개의 그룹(나머지 부서)을 전송(총 16개)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;P000, P001 프로세스가 전달 받은 소계 데이터를 가지고 그룹핑 수행
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;P000 그룹핑 결과 4건&lt;/li&gt;
&lt;li&gt;P001 그룹핑 결과 8건&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;no_gby_pushdown&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics parallel(e 2) no_gby_pushdown */ department_id, count(*) from hr.emp e group by department_id;

DEPARTMENT_ID   COUNT(*)
------------- ----------
           40       1000
           90       3000
           70       1000
                    1000
           10       1000
           20       2000
           60       5000
          100       6000
           50      45000
          110       2000
           30       6000
           80      34000

12 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  f63r2bm4k6pdh, child number 0
-------------------------------------
select /*+ gather_plan_statistics parallel(e 2) no_gby_pushdown */
department_id, count(*) from hr.emp e group by department_id

Plan hash value: 3475411915

------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |          |      1 |        |        |      |            |     12 |00:00:00.03 |   5 |        |       |          |
|   1 |  PX COORDINATOR         |          |      1 |        |        |      |            |     12 |00:00:00.03 |   5 | 73728 | 73728 |           |
|   2 |   PX SEND QC (RANDOM)   | :TQ10001 |      0 |     11 |  Q1,01 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |   0 |        |       |          |
|   3 |    HASH GROUP BY        |          |      0 |     11 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |  1558K|  1558K|  890K (0)|
|   4 |     PX RECEIVE          |          |      0 |    107K|  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   5 |      PX SEND HASH       | :TQ10000 |      0 |    107K|  Q1,00 | P-&amp;gt;P | HASH       |      0 |00:00:00.01 |   0 |        |       |          |
|   6 |       PX BLOCK ITERATOR |          |      0 |    107K|  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  7 |        TABLE ACCESS FULL| EMP      |      0 |    107K|  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   7 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

29 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P002                          65039     260562         17
         0 Producer                                 P003                          41961     168110         12
         0 Consumer                                 P000                          87000     350552        449
         0 Consumer                                 P001                          20000      78120        448
         1 Producer                                 P000                              4         59         15
         1 Producer                                 P001                              8         86          8
         1 Consumer                                 QC                               12        145          1

7 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;no_gby_pushdown&lt;/code&gt; 힌트를 통해 Producer 서버 프로세스 집합에서 group by를 먼저 수행하지 않도록 함&lt;/li&gt;
&lt;li&gt;P000 프로세스가 20, 50, 80, 100번 부서 사원을 그룹핑
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;20, 50, 80, 100번 부서 사원 8700명을 부서별로 그룹핑하면 4건&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;P0001 프로세스가 나머지 부서 사원을 그룹핑
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;나머지 부서 사원 20000명을 부서별로 그룹핑하면 8건&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;병렬 쿼리 조인&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Full Partition Wise Join&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인하려는 두 테이블에 조인 키 컬럼을 기준으로 파티션된 경우&lt;/li&gt;
&lt;li&gt;데이터 재분배가 필요 없음&lt;/li&gt;
&lt;li&gt;pq_distribute(inner 테이블(별칭), outer table distribution 방식, inner table distribution 방식)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pq_distribute(e, none, none)&lt;/code&gt; : full partition wise join으로 유도할 때 사용, 양쪽 테이블 모두 조인 컬럼에 대해 같은 기준으로 파티셔닝되어 있을 경우 사용&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 테이블 생성
create table hr.emp_part
partition  by list(department_id)(
partition p_dept_1 values(10,20,30,40),
partition p_dept_2 values(50),
partition p_dept_3 values(60,70,80,90,100,110),
partition p_dept_4 values(default))
tablespace users
as select * from hr.employees; 

create table hr.dept_part
partition  by list(department_id)(
partition p_dept_1 values(10,20,30,40),
partition p_dept_2 values(50),
partition p_dept_3 values(60,70,80,90,100,110),
partition p_dept_4 values(default))
tablespace users
as select * from hr.departments;

# 통계 정보 수집
exec dbms_stats.gather_table_stats('HR', 'EMP_PART', granularity=&amp;gt;'auto');
exec dbms_stats.gather_table_stats('HR', 'DEPT_PART', granularity=&amp;gt;'auto');&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션 통계 정보 조회
SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_owner = 'HR' and table_name = 'EMP_PART';  2    3

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------ ------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
                 1 P_DEPT_1                       10, 20, 30, 40                 USERS                              10          19          64
                 2 P_DEPT_2                       50                             USERS                              45          19          66
                 3 P_DEPT_3                       60, 70, 80, 90, 100, 110       USERS                              51          19          71
                 4 P_DEPT_4                       default                        USERS                               1          19          71

SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_owner = 'HR' and table_name = 'DEPT_PART';  2    3

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------ ------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
                 1 P_DEPT_1                       10, 20, 30, 40                 USERS                               4          19          23
                 2 P_DEPT_2                       50                             USERS                               1          19          19
                 3 P_DEPT_3                       60, 70, 80, 90, 100, 110       USERS                               6          19          19
                 4 P_DEPT_4                       default                        USERS                              16          19          19                 &lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_part_key_columns where name in ('EMP_PART', 'DEPT_PART');

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             DEPT_PART                                          TABLE DEPARTMENT_ID                    1
HR                             EMP_PART                                           TABLE DEPARTMENT_ID                    1&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d) full(e) parallel(d 2) parallel(e 2) pq_distribute(e,none,none) */ e.employee_id, e.last_name, e.salary, d.department_id, d.department_name
from  hr.dept_part d, hr.emp_part e
where e.department_id = d.department_id;
...
106 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  dd2qaf7z5g932, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d)
full(e) parallel(d 2) parallel(e 2) pq_distribute(e,none,none) */
e.employee_id, e.last_name, e.salary, d.department_id,
d.department_name from  hr.dept_part d, hr.emp_part e where
e.department_id = d.department_id

Plan hash value: 2856402575

-------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name      | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |           |      1 |        |        |      |            |    106 |00:00:00.01 |  24 |        |       |          |
|   1 |  PX COORDINATOR         |           |      1 |        |        |      |            |    106 |00:00:00.01 |  24 | 73728 | 73728 |           |
|   2 |   PX SEND QC (RANDOM)   | :TQ10000  |      0 |    106 |  Q1,00 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |   0 |        |       |          |
|   3 |    PX PARTITION LIST ALL|           |      0 |    106 |  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  4 |     HASH JOIN           |           |      0 |    106 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |  1695K|  1695K| 1620K (0)|
|   5 |      TABLE ACCESS FULL  | DEPT_PART |      0 |     27 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   6 |      TABLE ACCESS FULL  | EMP_PART  |      0 |    107 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - Degree of Parallelism is 2 because of table property

31 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P000                             45       1420          2
         0 Producer                                 P001                             61       1839          2
         0 Consumer                                 QC                              106       3259          5&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d) full(e) parallel(d 4) parallel(e 4) pq_distribute(e,none,none) */ e.employee_id, e.last_name, e.salary, d.department_id, d.department_name
from  hr.dept_part d, hr.emp_part e
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  1m2zca9av3xjm, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d)
full(e) parallel(d 4) parallel(e 4) pq_distribute(e,none,none) */
e.employee_id, e.last_name, e.salary, d.department_id,
d.department_name from  hr.dept_part d, hr.emp_part e where
e.department_id = d.department_id

Plan hash value: 2856402575

-------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name      | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |           |      1 |        |        |      |            |    106 |00:00:00.02 |  24 |        |       |          |
|   1 |  PX COORDINATOR         |           |      1 |        |        |      |            |    106 |00:00:00.02 |  24 | 73728 | 73728 |           |
|   2 |   PX SEND QC (RANDOM)   | :TQ10000  |      0 |    106 |  Q1,00 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |   0 |        |       |          |
|   3 |    PX PARTITION LIST ALL|           |      0 |    106 |  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  4 |     HASH JOIN           |           |      0 |    106 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |  1695K|  1695K| 1124K (0)|
|   5 |      TABLE ACCESS FULL  | DEPT_PART |      0 |     27 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   6 |      TABLE ACCESS FULL  | EMP_PART  |      0 |    107 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - Degree of Parallelism is 4 because of table property

31 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P000                              0         24          1
         0 Producer                                 P001                             51       1497          1
         0 Producer                                 P002                             45       1420          1
         0 Producer                                 P003                             10        366          1
         0 Consumer                                 QC                              106       3307          7
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;P000 : department_id = null인 파티션(P_DEPT_4)&lt;/li&gt;
&lt;li&gt;P001 : department_id = 60, 70, 80, 90, 100, 110인 파티션(P_DEPT_3)&lt;/li&gt;
&lt;li&gt;P002 : department_id = 50인 파티션(P_DEPT_2)&lt;/li&gt;
&lt;li&gt;P003 : department_id = 10, 20, 30, 40인 파티션(P_DEPT_1)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Partial Partition Wise Join&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인 테이블에 한쪽만 파티셔닝된 경우&lt;/li&gt;
&lt;li&gt;파티셔닝이 되어 있지 않은 다른 쪽 테이블을 같은 기준으로 파티셔닝을 하고 나서 full partition wise join 수행&lt;/li&gt;
&lt;li&gt;동적 파티셔닝을 위한 데이터 재분배가 필요&lt;/li&gt;
&lt;li&gt;pq_distribute(inner 테이블(별칭), outer table distribution 방식, inner table distribution 방식)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pq_distribute(e, none, partition)&lt;/code&gt; : inner table을 outer 파티션 테이블 기준에 따라 파티셔닝하라는 의미&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pq_distribute(e, partition, none)&lt;/code&gt; : outer table을 inner 파티션 테이블 기준에 따라 파티셔닝하라는 의미&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션되지 않은 emp 테이블 생성
create table hr.emp_non tablespace users as select * from hr.employees;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d) full(e) parallel(d 2) parallel(e 2) pq_distribute(e,none,partition) */ e.employee_id, e.last_name, e.salary, d.department_id, d.department_name
from  hr.dept_part d, hr.emp_non e
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  djwwmdfbzc4cn, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d)
full(e) parallel(d 2) parallel(e 2) pq_distribute(e,none,partition) */
e.employee_id, e.last_name, e.salary, d.department_id,
d.department_name from  hr.dept_part d, hr.emp_non e where
e.department_id = d.department_id

Plan hash value: 3658105173

-----------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                   | Name      | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT            |           |      1 |        |        |      |            |    106 |00:00:00.02 |           15 |       |       |          |
|   1 |  PX COORDINATOR             |           |      1 |        |        |      |            |    106 |00:00:00.02 |           15 | 73728 | 73728 |          |
|   2 |   PX SEND QC (RANDOM)       | :TQ10001  |      0 |    106 |  Q1,01 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |            0 |       |       |          |
|*  3 |    HASH JOIN BUFFERED       |           |      0 |    106 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |            0 |  3024K|  2749K| 3658K (0)|
|   4 |     PX PARTITION LIST ALL   |           |      0 |     27 |  Q1,01 | PCWC |            |      0 |00:00:00.01 |            0 |       |       |          |
|   5 |      TABLE ACCESS FULL      | DEPT_PART |      0 |     27 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |            0 |       |       |          |
|   6 |     PX RECEIVE              |           |      0 |    107 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |            0 |       |       |          |
|   7 |      PX SEND PARTITION (KEY)| :TQ10000  |      0 |    107 |  Q1,00 | P-&amp;gt;P | PART (KEY) |      0 |00:00:00.01 |            0 |       |       |          |
|   8 |       PX BLOCK ITERATOR     |           |      0 |    107 |  Q1,00 | PCWC |            |      0 |00:00:00.01 |            0 |       |       |          |
|*  9 |        TABLE ACCESS FULL    | EMP_NON   |      0 |    107 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |            0 |       |       |          |
-----------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   9 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

35 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P002                             98       2120          1
         0 Producer                                 P003                              9        241          1
         0 Consumer                                 P000                             46       1012        167
         0 Consumer                                 P001                             61       1349        166
         1 Producer                                 P000                             45       1420          4
         1 Producer                                 P001                             61       1839          2
         1 Consumer                                 QC                              106       3259          3

7 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;P000 : department_id =50인 파티션(P_DEPT_2), department_id = null인 파티션(P_DEPT_4)&lt;/li&gt;
&lt;li&gt;P001 : department_id = 10, 20, 30, 40인 파티션(P_DEPT_1), department_id = 60, 70, 80, 90, 100, 110인 파티션(P_DEPT_3)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;둘 다 파티셔닝 되지 않은 경우 : 동적 파티셔닝&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;어느 한 쪽도 조인 컬럼에 대해 파티셔닝이 되지 않은 상황&lt;/li&gt;
&lt;li&gt;양쪽 테이블이 모두 대용량 테이블&lt;/li&gt;
&lt;li&gt;pq_distribute(inner 테이블(별칭), outer table distribution 방식, inner table distribution 방식)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pq_distribute(e, hash, hash)&lt;/code&gt; : 조인 키 컬럼을 해시 함수에 적용하고 거기서 반환된 값을 기준으로 양쪽 테이블을 동적으로 파티셔닝 하라는 의미&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션되지 않은 dept 테이블 생성
create table hr.dept_non tablespace users as select * from hr.departments;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d) full(e) parallel(d 2) parallel(e 2) pq_distribute(e,hash, hash) */ e.employee_id, e.last_name, e.salary, d.department_id, d.department_name
from  hr.dept_non d, hr.emp_non e
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3  ^C

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last parallel'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  1f46qu9crfyab, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) full(d)
full(e) parallel(d 2) parallel(e 2) pq_distribute(e,hash, hash) */
e.employee_id, e.last_name, e.salary, d.department_id,
d.department_name from  hr.dept_non d, hr.emp_non e where
e.department_id = d.department_id

Plan hash value: 3809241757

---------------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                  | Name     | Starts | E-Rows |    TQ  |IN-OUT| PQ Distrib | A-Rows |   A-Time   | Buffers |       OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT           |          |      1 |        |        |      |            |    106 |00:00:00.02 |   6 |        |       |          |
|   1 |  PX COORDINATOR            |          |      1 |        |        |      |            |    106 |00:00:00.02 |   6 | 73728 | 73728 |           |
|   2 |   PX SEND QC (RANDOM)      | :TQ10002 |      0 |    106 |  Q1,02 | P-&amp;gt;S | QC (RAND)  |      0 |00:00:00.01 |   0 |        |       |          |
|*  3 |    HASH JOIN BUFFERED      |          |      0 |    106 |  Q1,02 | PCWP |            |      0 |00:00:00.01 |   0 |   2881K|  2619K| 3415K (0)|
|   4 |     PX RECEIVE             |          |      0 |     27 |  Q1,02 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   5 |      PX SEND HYBRID HASH   | :TQ10000 |      0 |     27 |  Q1,00 | P-&amp;gt;P | HYBRID HASH|      0 |00:00:00.01 |   0 |        |       |          |
|   6 |       STATISTICS COLLECTOR |          |      0 |        |  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|   7 |        PX BLOCK ITERATOR   |          |      0 |     27 |  Q1,00 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|*  8 |         TABLE ACCESS FULL  | DEPT_NON |      0 |     27 |  Q1,00 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|   9 |     PX RECEIVE             |          |      0 |    107 |  Q1,02 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
|  10 |      PX SEND HYBRID HASH   | :TQ10001 |      0 |    107 |  Q1,01 | P-&amp;gt;P | HYBRID HASH|      0 |00:00:00.01 |   0 |        |       |          |
|  11 |       PX BLOCK ITERATOR    |          |      0 |    107 |  Q1,01 | PCWC |            |      0 |00:00:00.01 |   0 |        |       |          |
|* 12 |        TABLE ACCESS FULL   | EMP_NON  |      0 |    107 |  Q1,01 | PCWP |            |      0 |00:00:00.01 |   0 |        |       |          |
---------------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   8 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)
  12 - access(:Z&amp;gt;=:Z AND :Z&amp;lt;=:Z)

Note
-----
   - Degree of Parallelism is 2 because of table property

39 rows selected.

SYS@ora19c&amp;gt; select tq_id, server_type, process, num_rows, bytes, waits
from v$pq_tqstat
order by  tq_id,decode(substr(server_type,1,4),'Rang',1,'Prod',2,'Cons',3),process;  2    3

     TQ_ID SERVER_TYPE                              PROCESS                    NUM_ROWS      BYTES      WAITS
---------- ---------------------------------------- ------------------------ ---------- ---------- ----------
         0 Producer                                 P002                             27        513          2
         0 Producer                                 P003                              0         48          0
         0 Consumer                                 P000                             15        313       1453
         0 Consumer                                 P001                             12        248       1453
         1 Producer                                 P002                             97       2102          2
         1 Producer                                 P003                              9        241          2
         1 Consumer                                 P000                             87       1891       1456
         1 Consumer                                 P001                             19        452       1455
         2 Producer                                 P000                             87       2651          5
         2 Producer                                 P001                             19        608          5
         2 Consumer                                 QC                              106       3259          1

11 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;TQ_ID = 0인 P002, P003 : dept_non 테이블 파티셔닝&lt;/li&gt;
&lt;li&gt;TQ_ID = 1인 P002, P003 : emp_non 테이블 파티셔닝&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select sum(cnt)
from (select department_id, count(*) cnt from hr.emp_non where department_id in (20, 50, 80, 100) group by department_id);  2

  SUM(CNT)
----------
        87

SYS@ora19c&amp;gt; select sum(cnt)
from (select department_id, count(*) cnt from hr.emp_non where department_id not in (20, 50, 80, 100) or department_id is null group by department_id);  2

  SUM(CNT)
----------
        20&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <category>튜닝</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/236</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260223-TIL#entry236comment</comments>
      <pubDate>Sun, 15 Mar 2026 22:54:13 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260220 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260220-TIL</link>
      <description>&lt;h1&gt;파티션&lt;/h1&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;파티셔닝은 대규모 테이블과 인덱스를 관리하는데 있어 핵심적인 문제를 해결해줌&lt;/li&gt;
&lt;li&gt;테이블과 인덱스를 파티션이라고 하는 더 작고 관리하기 쉬운 단위로 분해할 수 있기 때문&lt;/li&gt;
&lt;li&gt;파티션은 테이블 또는 인덱스를 파티션 단위로 나눠서 저장하는 객체(세그먼트)&lt;/li&gt;
&lt;li&gt;테이블을 파티션하면 하나의 테이블일지라도 파티션 키에 따라 물리적으로 별도의 세그먼트에 데이터가 저장됨&lt;/li&gt;
&lt;li&gt;관리적 측면으로 보면 보관 주기가 지난 데이터들을 별도로 백업하고 지우는 일이 쉬움&lt;/li&gt;
&lt;li&gt;성능적 측면으로 보면 파티셔닝하지 않은 테이블이 대용량일 대 인덱스를 이용해서 데이터를 검색하더라도 데이터의 양이 많아서 인덱스를 이용해 건건히 테이블 액세스하는 방식(random I/O)은 일정량이 넘는 순간 Full Table Scan보다 더 못한 결과가 나옴&lt;/li&gt;
&lt;li&gt;그렇다고 Full Table Scan도 부담스러운 경우 파티션을 나누면 Full Table Scan을 하더라도 일부 파티션 세그먼트만 읽고 멈출 수 있음(Partition Pruning)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;수동 파티셔닝(manual partitioning)&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;7i 버전까지는 파티션 테이블이 제공되지 않았기 때문에 파티션 뷰를 통해 파티션 기능을 구현&lt;/li&gt;
&lt;li&gt;파티션 뷰의 핵심 기능은 뷰 쿼리에 사용된 조건절에 부합하는 테이블만 읽는 것. 이를 partition pruning이라고 함&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;테이블 생성&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;# 기존 테이블 삭제
drop table hr.p1 purge;
drop table hr.p2 purge;
drop table hr.p3 purge;

# 테이블 생성
create table hr.p1 tablespace users as select * from hr.employees where 1=2;
create table hr.p2 tablespace users as select * from hr.employees where 1=2;
create table hr.p3 tablespace users as select * from hr.employees where 1=2;

# 제약 조건 생성
alter table hr.p1 add constraint p1_sal_ck check(salary &amp;lt; 5000);
alter table hr.p2 add constraint p2_sal_ck check(salary between 5000 and 9999);
alter table hr.p3 add constraint p3_sal_ck check(salary between 10000 and 25000);

# 데이터 입력
insert into hr.p1 select * from hr.employees where salary &amp;lt; 5000;
insert into hr.p2 select * from hr.employees where salary between 5000 and 9999;
insert into hr.p3 select * from hr.employees where salary between 10000 and 25000;

commit;

# 테이블 통계 정보 수집
exec dbms_stats.gather_table_stats('hr','p1')
exec dbms_stats.gather_table_stats('hr','p2')
exec dbms_stats.gather_table_stats('hr','p3')&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 뷰 생성&lt;/h3&gt;
&lt;pre class=&quot;crystal&quot;&gt;&lt;code&gt;create or replace view hr.emp_partition
as
select * from hr.p1
union all
select * from hr.p2
union all
select * from hr.p3;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 뷰 조회&lt;/h3&gt;
&lt;pre class=&quot;lasso&quot;&gt;&lt;code&gt;select * from hr.emp_partition;
...
107 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Partition Pruning&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;partition pruning이 일어나면 조건에 해당하는 세그먼트만 액세스해서 읽음&lt;/li&gt;
&lt;li&gt;p1, p2 테이블에는 salary = 24000 인 데이터가 없기 때문에(제약 조건이 걸려있음) I/O가 발생하지 않음&lt;/li&gt;
&lt;li&gt;p3 테이블에서만 I/O 발생&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_partition
where salary = 24000;  2    3

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        100 Steven               King                      SKING                     515.123.4567         17-JUN-03 AD_PRES      24000                                      90

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4vv3maa3gapgu, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_partition where
salary = 24000

Plan hash value: 198085840

------------------------------------------------------------------------------------------------
| Id  | Operation            | Name          | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |               |      1 |        |      1 |00:00:00.01 |       7 |
|   1 |  VIEW                | EMP_PARTITION |      1 |      3 |      1 |00:00:00.01 |       7 |
|   2 |   UNION-ALL          |               |      1 |        |      1 |00:00:00.01 |       7 |
|*  3 |    FILTER            |               |      1 |        |      0 |00:00:00.01 |       0 |
|*  4 |     TABLE ACCESS FULL| P1            |      0 |      1 |      0 |00:00:00.01 |       0 |
|*  5 |    FILTER            |               |      1 |        |      0 |00:00:00.01 |       0 |
|*  6 |     TABLE ACCESS FULL| P2            |      0 |      1 |      0 |00:00:00.01 |       0 |
|*  7 |    TABLE ACCESS FULL | P3            |      1 |      1 |      1 |00:00:00.01 |       7 |
------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(NULL IS NOT NULL)
   4 - filter(&quot;SALARY&quot;=24000)
   5 - filter(NULL IS NOT NULL)
   6 - filter(&quot;SALARY&quot;=24000)
   7 - filter(&quot;SALARY&quot;=24000)

29 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;p1, p3 테이블에는 salary = 6000 인 데이터가 없기 때문에(제약 조건이 걸려있음) I/O가 발생하지 않음&lt;/li&gt;
&lt;li&gt;p2 테이블에서만 I/O 발생&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_partition
where salary = 6000;  2    3

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  6a1t6p85s6z5u, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_partition where
salary = 6000

Plan hash value: 2486487561

------------------------------------------------------------------------------------------------
| Id  | Operation            | Name          | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |               |      1 |        |      2 |00:00:00.01 |       7 |
|   1 |  VIEW                | EMP_PARTITION |      1 |      4 |      2 |00:00:00.01 |       7 |
|   2 |   UNION-ALL          |               |      1 |        |      2 |00:00:00.01 |       7 |
|*  3 |    FILTER            |               |      1 |        |      0 |00:00:00.01 |       0 |
|*  4 |     TABLE ACCESS FULL| P1            |      0 |      1 |      0 |00:00:00.01 |       0 |
|*  5 |    TABLE ACCESS FULL | P2            |      1 |      2 |      2 |00:00:00.01 |       7 |
|*  6 |    FILTER            |               |      1 |        |      0 |00:00:00.01 |       0 |
|*  7 |     TABLE ACCESS FULL| P3            |      0 |      1 |      0 |00:00:00.01 |       0 |
------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(NULL IS NOT NULL)
   4 - filter(&quot;SALARY&quot;=6000)
   5 - filter(&quot;SALARY&quot;=6000)
   6 - filter(NULL IS NOT NULL)
   7 - filter(&quot;SALARY&quot;=6000)

29 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;바인드 변수 사용 시 어떤 값이 사용될지 모르므로 전체 테이블을 액세스 해야 함 &amp;rarr; partition pruning 발생 X&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; var b_sal number
SYS@ora19c&amp;gt; exec :b_sal := 6000

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_partition
where salary = :b_sal;  2    3

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  c74bm5yzfkgy7, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_partition where
salary = :b_sal

Plan hash value: 4051985346

-----------------------------------------------------------------------------------------------
| Id  | Operation           | Name          | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |               |      1 |        |      2 |00:00:00.01 |      19 |
|   1 |  VIEW               | EMP_PARTITION |      1 |      4 |      2 |00:00:00.01 |      19 |
|   2 |   UNION-ALL         |               |      1 |        |      2 |00:00:00.01 |      19 |
|*  3 |    TABLE ACCESS FULL| P1            |      1 |      1 |      0 |00:00:00.01 |       6 |
|*  4 |    TABLE ACCESS FULL| P2            |      1 |      2 |      2 |00:00:00.01 |       7 |
|*  5 |    TABLE ACCESS FULL| P3            |      1 |      1 |      0 |00:00:00.01 |       6 |
-----------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(&quot;SALARY&quot;=:B_SAL)
   4 - filter(&quot;SALARY&quot;=:B_SAL)
   5 - filter(&quot;SALARY&quot;=:B_SAL)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;인덱스가 없기 때문에 p2 테이블에 Full Table Scan이 발생&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_partition
where salary = 6000
and employee_id = 104;  2    3    4

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  87sxhjsrab45h, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_partition where
salary = 6000 and employee_id = 104

Plan hash value: 2486487561

------------------------------------------------------------------------------------------------
| Id  | Operation            | Name          | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |               |      1 |        |      1 |00:00:00.01 |       7 |
|   1 |  VIEW                | EMP_PARTITION |      1 |      3 |      1 |00:00:00.01 |       7 |
|   2 |   UNION-ALL          |               |      1 |        |      1 |00:00:00.01 |       7 |
|*  3 |    FILTER            |               |      1 |        |      0 |00:00:00.01 |       0 |
|*  4 |     TABLE ACCESS FULL| P1            |      0 |      1 |      0 |00:00:00.01 |       0 |
|*  5 |    TABLE ACCESS FULL | P2            |      1 |      1 |      1 |00:00:00.01 |       7 |
|*  6 |    FILTER            |               |      1 |        |      0 |00:00:00.01 |       0 |
|*  7 |     TABLE ACCESS FULL| P3            |      0 |      1 |      0 |00:00:00.01 |       0 |
------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(NULL IS NOT NULL)
   4 - filter((&quot;SALARY&quot;=6000 AND &quot;EMPLOYEE_ID&quot;=104))
   5 - filter((&quot;EMPLOYEE_ID&quot;=104 AND &quot;SALARY&quot;=6000))
   6 - filter(NULL IS NOT NULL)
   7 - filter((&quot;SALARY&quot;=6000 AND &quot;EMPLOYEE_ID&quot;=104))

29 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;인덱스 생성&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; create unique index hr.p2_idx on hr.p2(employee_id) tablespace users;

Index created.

SYS@ora19c&amp;gt; alter table hr.p2 add constraint p2_id_pk primary key(employee_id) using index hr.p2_idx;

Table altered.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;p2 테이블에 인덱스가 있기 때문에 Index Range Scan 발생&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_partition
where salary = 6000
and employee_id = 104;  2    3    4

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  87sxhjsrab45h, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_partition where
salary = 6000 and employee_id = 104

Plan hash value: 1514361703

---------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name          | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
---------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |               |      1 |        |      1 |00:00:00.01 |       2 |
|   1 |  VIEW                         | EMP_PARTITION |      1 |      3 |      1 |00:00:00.01 |       2 |
|   2 |   UNION-ALL                   |               |      1 |        |      1 |00:00:00.01 |       2 |
|*  3 |    FILTER                     |               |      1 |        |      0 |00:00:00.01 |       0 |
|*  4 |     TABLE ACCESS FULL         | P1            |      0 |      1 |      0 |00:00:00.01 |       0 |
|*  5 |    TABLE ACCESS BY INDEX ROWID| P2            |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  6 |     INDEX UNIQUE SCAN         | P2_IDX        |      1 |      1 |      1 |00:00:00.01 |       1 |
|*  7 |    FILTER                     |               |      1 |        |      0 |00:00:00.01 |       0 |
|*  8 |     TABLE ACCESS FULL         | P3            |      0 |      1 |      0 |00:00:00.01 |       0 |
---------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(NULL IS NOT NULL)
   4 - filter((&quot;SALARY&quot;=6000 AND &quot;EMPLOYEE_ID&quot;=104))
   5 - filter(&quot;SALARY&quot;=6000)
   6 - access(&quot;EMPLOYEE_ID&quot;=104)
   7 - filter(NULL IS NOT NULL)
   8 - filter((&quot;SALARY&quot;=6000 AND &quot;EMPLOYEE_ID&quot;=104))

31 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;drop table hr.p1 purge;
drop table hr.p2 purge;
drop table hr.p3 purge;
drop view hr.emp_partition;&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Range Partition&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;8i 버전부터 제공&lt;/li&gt;
&lt;li&gt;이력성 데이터 조회에 유리&lt;/li&gt;
&lt;li&gt;여러 컬럼을 파티션 키로 지정(최대 16)&lt;/li&gt;
&lt;li&gt;maxvalue 파티션을 제공&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Range Partition 생성&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;create table hr.emp_year
partition by range(hire_date)(
    partition p2004 values less than(to_date('20050101','yyyymmdd')),
    partition p2005 values less than(to_date('20060101','yyyymmdd')),
    partition p2006 values less than(to_date('20070101','yyyymmdd')),
    partition pmax values less than(maxvalue)
) tablespace users
as 
select employee_id, last_name, salary, hire_date, department_id from hr.employees;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_YEAR'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                                                                       TABLESPACE_NAME               NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ -------------------------------------------------------------------------------- ------------------------------ ---------- ---------- -----------
P2004                          TO_DATE(' 2005-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA USERS
P2005                          TO_DATE(' 2006-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA USERS
P2006                          TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA USERS
PMAX                           MAXVALUE                                                                         USERS&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 테이블 메타 정보 조회
SYS@ora19c&amp;gt; select partitioning_type, partition_count from dba_part_tables where table_name = 'EMP_YEAR' and owner = 'HR';

PARTITION PARTITION_COUNT
--------- ---------------
RANGE                   4&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_part_key_columns where name = 'EMP_YEAR' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_YEAR                                           TABLE HIRE_DATE                        1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 조회&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;# 전체 데이터 조회
select * from hr.emp_year;

# 2004년 입사자 조회 
select * from hr.emp_year partition(p2004);

# 2005년 입사자 조회
select * from hr.emp_year partition(p2005);

# 2006년 입사자 조회
select * from hr.emp_year partition(p2006);

# 2007년 이후 입사자 조회
select * from hr.emp_year partition(pmax);&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 별 테이블스페이스 지정&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;파티션은 각각 별도의 저장 공간을 가짐&lt;/li&gt;
&lt;li&gt;파티션 별로 테이블스페이스 지정 가능&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; drop table hr.emp_year purge;

Table dropped.

SYS@ora19c&amp;gt;
SYS@ora19c&amp;gt; create table hr.emp_year
partition by range(hire_date)(
        partition p2004 values less than(to_date('20050101','yyyymmdd')) tablespace sysaux,
        partition p2005 values less than(to_date('20060101','yyyymmdd')) tablespace users,
        partition p2006 values less than(to_date('20070101','yyyymmdd')) tablespace sysaux,
        partition pmax values less than(maxvalue)
) tablespace users
as
select employee_id, last_name, salary, hire_date, department_id from hr.employees;  2    3    4    5    6    7    8    9

Table created.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;# 세그먼트 조회
select * from dba_segments where segment_name = 'EMP_YEAR';&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1187&quot; data-origin-height=&quot;104&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/tAyay/dJMcadBcjNe/3AW8kF625ekkpaL5oRUqFK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/tAyay/dJMcadBcjNe/3AW8kF625ekkpaL5oRUqFK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/tAyay/dJMcadBcjNe/3AW8kF625ekkpaL5oRUqFK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FtAyay%2FdJMcadBcjNe%2F3AW8kF625ekkpaL5oRUqFK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1187&quot; height=&quot;104&quot; data-origin-width=&quot;1187&quot; data-origin-height=&quot;104&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;# 익스텐트 조회
select * from dba_extents where segment_name = 'EMP_YEAR';&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1076&quot; data-origin-height=&quot;103&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bmXuOj/dJMcadBcjNl/vSbrKE35w77uGYkyjxH72K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bmXuOj/dJMcadBcjNl/vSbrKE35w77uGYkyjxH72K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bmXuOj/dJMcadBcjNl/vSbrKE35w77uGYkyjxH72K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbmXuOj%2FdJMcadBcjNl%2FvSbrKE35w77uGYkyjxH72K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1076&quot; height=&quot;103&quot; data-origin-width=&quot;1076&quot; data-origin-height=&quot;103&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Interval Range Partition&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;TO_YMINTERVAL&lt;/h3&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# 1년 10개월 더한 날짜 구하기
select sysdate + to_yminterval('1-10') from dual;

SYSDATE+T
---------
20-DEC-27

# numtoyminterval(n, 'year|month') 함수는 n을 interval year to month 기능과 비슷하게 구현 가능
select sysdate + numtoyminterval(1, 'year') + numtoyminterval(10,'month') from dual;

SYSDATE+N
---------
20-DEC-27&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;TO_DSINTERVAL&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# 10일 10시간 10분 10초 더한 날짜 구하기
SYS@ora19c&amp;gt; select localtimestamp + to_dsinterval('10 10:10:10') from dual;

LOCALTIMESTAMP+TO_DSINTERVAL('1010:10:10')
---------------------------------------------------------------------------
02-MAR-26 09.23.37.219512000 PM

# numtodsinterval 함수는 n을 interval day to second 기능과 비슷하게 구현 가능
SYS@ora19c&amp;gt; select localtimestamp + numtodsinterval(10, 'day') + numtodsinterval(10,'hour') + numtodsinterval(10,'minute') + numtodsinterval(10,'second') from dual;

LOCALTIMESTAMP+NUMTODSINTERVAL(10,'DAY')+NUMTODSINTERVAL(10,'HOUR')+NUMTODS
---------------------------------------------------------------------------
02-MAR-26 09.26.24.240534000 PM&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Interval Range Partition 생성&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; drop table hr.emp_year purge;

Table dropped.

# 1년 단위로 partitoin 생성
SYS@ora19c&amp;gt; create table hr.emp_year
partition by range(hire_date) interval(numtoyminterval(1,'year'))
(partition p2004 values less than (to_date('2005-01-01','yyyy-mm-dd')),
 partition p2005 values less than (to_date('2006-01-01','yyyy-mm-dd')),
 partition p2006 values less than (to_date('2007-01-01','yyyy-mm-dd')))
tablespace users
as
select employee_id, last_name, salary, hire_date, department_id from hr.employees;

Table created.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_YEAR'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                                                                       TABLESPACE_NAME               NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ -------------------------------------------------------------------------------- ------------------------------ ---------- ---------- -----------
P2004                          TO_DATE(' 2005-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA USERS
P2005                          TO_DATE(' 2006-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA USERS
P2006                          TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA USERS
SYS_P854                       TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA USERS
SYS_P855                       TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA USERS&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 테이블 메타 정보 조회
SYS@ora19c&amp;gt; select partitioning_type, partition_count from dba_part_tables where table_name = 'EMP_YEAR' and owner = 'HR';

PARTITION PARTITION_COUNT
--------- ---------------
RANGE             1048575&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_part_key_columns where name = 'EMP_YEAR' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_YEAR                                           TABLE HIRE_DATE                        1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 조회&lt;/h3&gt;
&lt;pre class=&quot;n1ql&quot;&gt;&lt;code&gt;select * from hr.emp_year;
select * from hr.emp_year partition(p2004);
select * from hr.emp_year partition(p2005);
select * from hr.emp_year partition(p2006);
select * from hr.emp_year partition(SYS_P854);
select * from hr.emp_year partition(SYS_P855);&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 세그먼트, 익스텐트 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;select * from dba_segments where segment_name = 'EMP_YEAR';&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1518&quot; data-origin-height=&quot;123&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/8hvXm/dJMcabDsYP0/XeE9LezNTTVo9tnE65tBck/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/8hvXm/dJMcabDsYP0/XeE9LezNTTVo9tnE65tBck/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/8hvXm/dJMcabDsYP0/XeE9LezNTTVo9tnE65tBck/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F8hvXm%2FdJMcabDsYP0%2FXeE9LezNTTVo9tnE65tBck%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1518&quot; height=&quot;123&quot; data-origin-width=&quot;1518&quot; data-origin-height=&quot;123&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;select * from dba_extents where segment_name = 'EMP_YEAR';&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;126&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cRKhK5/dJMcabDsYP5/ParslDec7ZVTsYBwplXXkK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cRKhK5/dJMcabDsYP5/ParslDec7ZVTsYBwplXXkK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cRKhK5/dJMcabDsYP5/ParslDec7ZVTsYBwplXXkK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcRKhK5%2FdJMcabDsYP5%2FParslDec7ZVTsYBwplXXkK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1080&quot; height=&quot;126&quot; data-origin-width=&quot;1080&quot; data-origin-height=&quot;126&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Hash Partition&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;8i 버전 제공&lt;/li&gt;
&lt;li&gt;parition key 값에 해시 함수를 적용하여 데이터를 분할하는 방식&lt;/li&gt;
&lt;li&gt;중복성보다는 유일한 키 값으로 키 값을 정하자&lt;/li&gt;
&lt;li&gt;데이터 분포가 고른 컬럼을 파티션 컬럼으로 선정하는 것이 좋음&lt;/li&gt;
&lt;li&gt;파티션 개수는 2의 제곱수(2, 4, 8, 16, 32, &amp;hellip;)로 설정하는 것이 좋음&lt;/li&gt;
&lt;li&gt;조건절에 =, in 조건으로 검색할 때만 partition pruning 기능이 수행됨&lt;/li&gt;
&lt;li&gt;병렬 쿼리 성능 향상 뿐 아니라 동시에 입력이 많은 대용량 테이블이나 인덱스에 발생하는 경합을 줄일 목적으로 해시 파티셔닝을 사용
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;인덱스는 정렬된 상태를 유지해야 하므로 시간에 따라 쌓이는 데이터인 경우(예 : 주문) right growing 됨 (뒤쪽에만 데이터가 계속 쌓임) &amp;rarr; 동시 insert 시 경합이 심함&lt;/li&gt;
&lt;li&gt;이 때 인덱스를 해시 파티셔닝 해주면 해시 값에 따라 insert 할 위치가 흩어지므로 경합이 줄음&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Hash Partition 생성&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;create table hr.emp_hash
partition by hash(employee_id) partitions 4
tablespace users
as select employee_id, last_name, salary, department_id from hr.employees;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_HASH'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                                                                       TABLESPACE_NAME               NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ -------------------------------------------------------------------------------- ------------------------------ ---------- ---------- -----------
SYS_P856                                                                                                        USERS
SYS_P857                                                                                                        USERS
SYS_P858                                                                                                        USERS
SYS_P859                                                                                                        USERS&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 테이블 메타 정보 조회
SYS@ora19c&amp;gt; select partitioning_type, partition_count from dba_part_tables where table_name = 'EMP_HASH' and owner = 'HR';

PARTITION PARTITION_COUNT
--------- ---------------
HASH                    4&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_part_key_columns where name = 'EMP_HASH' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_HASH                                           TABLE EMPLOYEE_ID                      1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 조회&lt;/h3&gt;
&lt;pre class=&quot;n1ql&quot;&gt;&lt;code&gt;select * from hr.emp_hash;
select * from hr.emp_hash partition(SYS_P856);
select * from hr.emp_hash partition(SYS_P857);
select * from hr.emp_hash partition(SYS_P858);
select * from hr.emp_hash partition(SYS_P859);&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;List Partition&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;9i 버전 제공&lt;/li&gt;
&lt;li&gt;미리 정해진 그룹을 기준으로 데이터를 분할 저장&lt;/li&gt;
&lt;li&gt;값 목록&lt;/li&gt;
&lt;li&gt;단일 컬럼만 가능&lt;/li&gt;
&lt;li&gt;default 파티션 제공&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;List Partition 생성&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;create table hr.emp_list
partition by list(department_id)
(partition p_dept_1 values(10,20,30,40),
partition p_dept_2 values(50),
partition p_dept_3 values(60,70,80,90,100,110),
partition p_dept_4 values(default)
)
tablespace users
as select employee_id, last_name, salary, department_id from hr.employees;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_LIST'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                                                                       TABLESPACE_NAME               NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ -------------------------------------------------------------------------------- ------------------------------ ---------- ---------- -----------
P_DEPT_1                       10, 20, 30, 40                                                                   USERS
P_DEPT_2                       50                                                                               USERS
P_DEPT_3                       60, 70, 80, 90, 100, 110                                                         USERS
P_DEPT_4                       default                                                                          USERS
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 테이블 메타 정보 조회
SYS@ora19c&amp;gt; select partitioning_type, partition_count from dba_part_tables where table_name = 'EMP_LIST' and owner = 'HR';

PARTITION PARTITION_COUNT
--------- ---------------
LIST                    4&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_part_key_columns where name = 'EMP_LIST' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_LIST                                           TABLE DEPARTMENT_ID                    1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 조회&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;select * from hr.emp_list;

# 10, 20, 30, 40번 부서 사원 조회
select * from hr.emp_list partition(P_DEPT_1);

# 50번 부서 사원 조회
select * from hr.emp_list partition(P_DEPT_2);

# 60, 70, 80, 90, 100, 110번 부서 사원 조회
select * from hr.emp_list partition(P_DEPT_3);

# 나머지 부서 사원 조회
select * from hr.emp_list partition(P_DEPT_4);&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;조합 파티션(composite partition)&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;서브 파티션마다 세그먼트를 하나씩 할당하고 서브 파티션 단위로 데이터를 저장&lt;/li&gt;
&lt;li&gt;주 파티션 키에 따라 1차적으로 데이터를 분배하고 서브 파티션 키에 따라 최종적으로 저장할(세그먼트) 위치를 결정&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조합 파티션 종류&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;range - hash partition(8i)&lt;/li&gt;
&lt;li&gt;range - list partition(9i)&lt;/li&gt;
&lt;li&gt;range - range partition(11g)&lt;/li&gt;
&lt;li&gt;list - hash partition(11g)&lt;/li&gt;
&lt;li&gt;list - list partition(11g)&lt;/li&gt;
&lt;li&gt;list - range partition(11g)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;range - hash 조합 파티션 생성&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;create table hr.emp_comp
partition by range(salary)
subpartition by hash(employee_id) subpartitions 4
(partition p4999 values less than(5000),
partition p9999 values less than(10000),
partition p19999 values less than(20000),
partition pmax values less than(maxvalue)
)
tablespace users
as select employee_id, last_name, salary, department_id from hr.employees;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1960&quot; data-origin-height=&quot;1364&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/4Gkt4/dJMcaaLjQGc/m9AcQ3XLviKTJIygcDZv4K/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/4Gkt4/dJMcaaLjQGc/m9AcQ3XLviKTJIygcDZv4K/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/4Gkt4/dJMcaaLjQGc/m9AcQ3XLviKTJIygcDZv4K/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F4Gkt4%2FdJMcaaLjQGc%2Fm9AcQ3XLviKTJIygcDZv4K%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1960&quot; height=&quot;1364&quot; data-origin-width=&quot;1960&quot; data-origin-height=&quot;1364&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;range - hash 조합 파티션 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_COMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                                                                       TABLESPACE_NAME               NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ -------------------------------------------------------------------------------- ------------------------------ ---------- ---------- -----------
P19999                         20000                                                                            USERS
P4999                          5000                                                                             USERS
P9999                          10000                                                                            USERS
PMAX                           MAXVALUE                                                                         USERS

# 서브 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, subpartition_name, subpartition_position, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_subpartitions
where table_name='EMP_COMP'
and table_owner='HR';  2    3    4

PARTITION_NAME                 SUBPARTITION_NAME              SUBPARTITION_POSITION HIGH_VALUE                     TABLESPACE_NAME               NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ --------------------- ------------------------------ ------------------------------ ---------- ---------- -----------
P19999                         SYS_SUBP868                                        1                                USERS
P19999                         SYS_SUBP869                                        2                                USERS
P19999                         SYS_SUBP870                                        3                                USERS
P19999                         SYS_SUBP871                                        4                                USERS
P4999                          SYS_SUBP860                                        1                                USERS
P4999                          SYS_SUBP861                                        2                                USERS
P4999                          SYS_SUBP862                                        3                                USERS
P4999                          SYS_SUBP863                                        4                                USERS
P9999                          SYS_SUBP864                                        1                                USERS
P9999                          SYS_SUBP865                                        2                                USERS
P9999                          SYS_SUBP866                                        3                                USERS
P9999                          SYS_SUBP867                                        4                                USERS
PMAX                           SYS_SUBP872                                        1                                USERS
PMAX                           SYS_SUBP873                                        2                                USERS
PMAX                           SYS_SUBP874                                        3                                USERS
PMAX                           SYS_SUBP875                                        4                                USERS

16 rows selected.

# 파티션 테이블 메타 정보 조회
SYS@ora19c&amp;gt; select partitioning_type, partition_count, subpartitioning_type, def_subpartition_count from dba_part_tables where table_name = 'EMP_COMP' and owner = 'HR';

PARTITION PARTITION_COUNT SUBPARTIT DEF_SUBPARTITION_COUNT
--------- --------------- --------- ----------------------
RANGE                   4 HASH                           4

# 주 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_part_key_columns where name = 'EMP_COMP' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_COMP                                           TABLE SALARY                           1

# 서브 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_subpart_key_columns where name = 'EMP_COMP' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_COMP                                           TABLE EMPLOYEE_ID                      1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조건절에 주 파티션 키 컬럼만 사용&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;employee_id(서브 파티션 키)에 대한 조건이 없기 때문에 salary(주 파티션 키) 조건에 해당하는 파티션 안에 모든 서브 파티션을 읽음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# salary &amp;lt; 5000 인 사원 조회
select /*+ gather_plan_statistics */ * from hr.emp_comp where salary &amp;lt; 5000;

# 실행 계획 조회
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  10y5fpp6a0a38, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_comp where salary &amp;lt;
5000

Plan hash value: 1662051861

-------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name     | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |          |      1 |        |       |       |     49 |00:00:00.01 |      12 |
|   1 |  PARTITION RANGE SINGLE|          |      1 |     14 |     1 |     1 |     49 |00:00:00.01 |      12 |
|   2 |   PARTITION HASH ALL   |          |      1 |     14 |     1 |     4 |     49 |00:00:00.01 |      12 |
|   3 |    TABLE ACCESS FULL   | EMP_COMP |      4 |     14 |     1 |     4 |     49 |00:00:00.01 |      12 |
-------------------------------------------------------------------------------------------------------------

16 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조건절에 주 파티션 키 컬럼과, 서브 파티션 키 컬럼 모두 사용&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;주 파티션 키와 서브 파티션 키에 해당하는 컬럼을 모두 조건절에 사용했으므로 조건에 해당하는 하나의 파티션만 읽음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ * from hr.emp_comp where salary &amp;lt; 5000 and employee_id = 185;

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        185 Bull                            4100            50

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2ufctgpt2u7dp, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_comp where salary &amp;lt;
5000 and employee_id = 185

Plan hash value: 1744254969

-------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name     | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |          |      1 |        |       |       |      1 |00:00:00.01 |       2 |
|   1 |  PARTITION RANGE SINGLE|          |      1 |      1 |     1 |     1 |      1 |00:00:00.01 |       2 |
|   2 |   PARTITION HASH SINGLE|          |      1 |      1 |     4 |     4 |      1 |00:00:00.01 |       2 |
|*  3 |    TABLE ACCESS FULL   | EMP_COMP |      1 |      1 |     4 |     4 |      1 |00:00:00.01 |       2 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(&quot;EMPLOYEE_ID&quot;=185)

21 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조건절에 서브 파티션 키 컬럼만 사용&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;salary(주 파티션 키)에 대한 조건이 없기 때문에 모든 주 파티션을 읽으면서 employee_id(서브 파티션 키) 에 대한 조건을 만족하는 서브 파티션 찾음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ * from hr.emp_comp where employee_id = 185;

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        185 Bull                            4100            50

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2b0ff4q6bkkfu, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_comp where
employee_id = 185

Plan hash value: 2583045259

-------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name     | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |          |      1 |        |       |       |      1 |00:00:00.01 |       6 |
|   1 |  PARTITION RANGE ALL   |          |      1 |      1 |     1 |     4 |      1 |00:00:00.01 |       6 |
|   2 |   PARTITION HASH SINGLE|          |      4 |      1 |     4 |     4 |      1 |00:00:00.01 |       6 |
|*  3 |    TABLE ACCESS FULL   | EMP_COMP |      4 |      1 |       |       |      1 |00:00:00.01 |       6 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(&quot;EMPLOYEE_ID&quot;=185)

21 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ * from hr.emp_comp where salary &amp;gt; 20000;

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 King                           24000            90

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  c1dhzk1k962bf, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_comp where salary &amp;gt;
20000

Plan hash value: 1662051861

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name     | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers | Reads  |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |          |      1 |        |       |       |      1 |00:00:00.01 |       2 |      1 |
|   1 |  PARTITION RANGE SINGLE|          |      1 |     20 |     4 |     4 |      1 |00:00:00.01 |       2 |      1 |
|   2 |   PARTITION HASH ALL   |          |      1 |     20 |     1 |     4 |      1 |00:00:00.01 |       2 |      1 |
|*  3 |    TABLE ACCESS FULL   | EMP_COMP |      4 |     20 |    13 |    16 |      1 |00:00:00.01 |       2 |      1 |
----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(&quot;SALARY&quot;&amp;gt;20000)

21 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;range - list 조합 파티션 생성&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;drop table hr.emp_year purge;

create table hr.emp_year
partition by range(hire_date)
subpartition by list(department_id)
subpartition template
(subpartition s_dept_1 values(10,20,30,40),
subpartition s_dept_2 values(50),
subpartition s_dept_3 values(60,70,80,90,100,110),
subpartition s_dept_4 values(default))
(partition p2004 values less than(to_date('2005-01-01','yyyy-mm-dd')),
partition p2005 values less than(to_date('2006-01-01','yyyy-mm-dd')),
partition p2006 values less than(to_date('2007-01-01','yyyy-mm-dd')),
partition pmax values less than(maxvalue))
nologging
tablespace users 
as select employee_id, last_name, salary,hire_date, department_id from hr.employees;

SYS@ora19c&amp;gt; alter table hr.emp_year logging;

Table altered.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;range - list 조합 파티션 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_YEAR'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P2004                          TO_DATE(' 2005-01-01 00:00:00' USERS
                               , 'SYYYY-MM-DD HH24:MI:SS', 'N
                               LS_CALENDAR=GREGORIAN'

P2005                          TO_DATE(' 2006-01-01 00:00:00' USERS
                               , 'SYYYY-MM-DD HH24:MI:SS', 'N
                               LS_CALENDAR=GREGORIAN'

P2006                          TO_DATE(' 2007-01-01 00:00:00' USERS
                               , 'SYYYY-MM-DD HH24:MI:SS', 'N
                               LS_CALENDAR=GREGORIAN'

PMAX                           MAXVALUE                       USERS

# 서브 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, subpartition_name, subpartition_position, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_subpartitions
where table_name='EMP_YEAR'
and table_owner='HR';  2    3    4

PARTITION_NAME                 SUBPARTITION_NAME              SUBPARTITION_POSITION HIGH_VALUE                     TABLESPACE_NAME               NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ --------------------- ------------------------------ ------------------------------ ---------- ---------- -----------
P2004                          P2004_S_DEPT_1                                     1 10, 20, 30, 40                 USERS
P2004                          P2004_S_DEPT_2                                     2 50                             USERS
P2004                          P2004_S_DEPT_3                                     3 60, 70, 80, 90, 100, 110       USERS
P2004                          P2004_S_DEPT_4                                     4 default                        USERS
P2005                          P2005_S_DEPT_1                                     1 10, 20, 30, 40                 USERS
P2005                          P2005_S_DEPT_2                                     2 50                             USERS
P2005                          P2005_S_DEPT_3                                     3 60, 70, 80, 90, 100, 110       USERS
P2005                          P2005_S_DEPT_4                                     4 default                        USERS
P2006                          P2006_S_DEPT_1                                     1 10, 20, 30, 40                 USERS
P2006                          P2006_S_DEPT_2                                     2 50                             USERS
P2006                          P2006_S_DEPT_3                                     3 60, 70, 80, 90, 100, 110       USERS
P2006                          P2006_S_DEPT_4                                     4 default                        USERS
PMAX                           PMAX_S_DEPT_1                                      1 10, 20, 30, 40                 USERS
PMAX                           PMAX_S_DEPT_2                                      2 50                             USERS
PMAX                           PMAX_S_DEPT_3                                      3 60, 70, 80, 90, 100, 110       USERS
PMAX                           PMAX_S_DEPT_4                                      4 default                        USERS

16 rows selected.

# 파티션 테이블 메타 정보 조회
SYS@ora19c&amp;gt; select partitioning_type, partition_count, subpartitioning_type, def_subpartition_count from dba_part_tables where table_name = 'EMP_YEAR' and owner = 'HR';

PARTITION PARTITION_COUNT SUBPARTIT DEF_SUBPARTITION_COUNT
--------- --------------- --------- ----------------------
RANGE                   4 LIST                           4

# 주 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_part_key_columns where name = 'EMP_YEAR' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_YEAR                                           TABLE HIRE_DATE                        1

# 서브 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_subpart_key_columns where name = 'EMP_YEAR' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_YEAR                                           TABLE DEPARTMENT_ID                    1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조건절에 주 파티션 키 컬럼만 사용&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_year
where hire_date between to_date('2002-01-01', 'yyyy-mm-dd') and to_date('2002-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss');  2    3

EMPLOYEE_ID LAST_NAME                     SALARY HIRE_DATE DEPARTMENT_ID
----------- ------------------------- ---------- --------- -------------
        114 Raphaely                       11000 07-DEC-02            30
        203 Mavris                          6500 07-JUN-02            40
        108 Greenberg                      12008 17-AUG-02           100
        109 Faviet                          9000 16-AUG-02           100
        204 Baer                           10000 07-JUN-02            70
        205 Higgins                        12008 07-JUN-02           110
        206 Gietz                           8300 07-JUN-02           110

7 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  3wmv39uqpnnqj, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_year where hire_date
between to_date('2002-01-01', 'yyyy-mm-dd') and to_date('2002-12-31
23:59:59', 'yyyy-mm-dd hh24:mi:ss')

Plan hash value: 3146090949

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name     | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers | Reads  |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |          |      1 |        |       |       |      7 |00:00:00.01 |       7 |      3 |
|   1 |  PARTITION RANGE SINGLE|          |      1 |     17 |     1 |     1 |      7 |00:00:00.01 |       7 |      3 |
|   2 |   PARTITION LIST ALL   |          |      1 |     17 |     1 |     4 |      7 |00:00:00.01 |       7 |      3 |
|*  3 |    TABLE ACCESS FULL   | EMP_YEAR |      4 |     17 |     1 |     4 |      7 |00:00:00.01 |       7 |      3 |
----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter((&quot;HIRE_DATE&quot;&amp;lt;=TO_DATE(' 2002-12-31 23:59:59', 'syyyy-mm-dd hh24:mi:ss') AND
              &quot;HIRE_DATE&quot;&amp;gt;=TO_DATE(' 2002-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss')))

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조건절에 주 파티션 키 컬럼과, 서브 파티션 키 컬럼 모두 사용&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_year
where hire_date between to_date('2002-01-01', 'yyyy-mm-dd') and to_date('2002-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
and department_id = 30;  2    3    4

EMPLOYEE_ID LAST_NAME                     SALARY HIRE_DATE DEPARTMENT_ID
----------- ------------------------- ---------- --------- -------------
        114 Raphaely                       11000 07-DEC-02            30

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2ntsw0kr1ja08, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_year where hire_date
between to_date('2002-01-01', 'yyyy-mm-dd') and to_date('2002-12-31
23:59:59', 'yyyy-mm-dd hh24:mi:ss') and department_id = 30

Plan hash value: 2837558950

-------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name     | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |          |      1 |        |       |       |      1 |00:00:00.01 |       3 |
|   1 |  PARTITION RANGE SINGLE|          |      1 |      2 |     1 |     1 |      1 |00:00:00.01 |       3 |
|   2 |   PARTITION LIST SINGLE|          |      1 |      2 |   KEY |   KEY |      1 |00:00:00.01 |       3 |
|*  3 |    TABLE ACCESS FULL   | EMP_YEAR |      1 |      2 |     1 |     1 |      1 |00:00:00.01 |       3 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter((&quot;DEPARTMENT_ID&quot;=30 AND &quot;HIRE_DATE&quot;&amp;lt;=TO_DATE(' 2002-12-31 23:59:59', 'syyyy-mm-dd
              hh24:mi:ss') AND &quot;HIRE_DATE&quot;&amp;gt;=TO_DATE(' 2002-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss')))

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조건절에 서브 파티션 키 컬럼만 사용&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_year
where department_id = 30;  2    3

EMPLOYEE_ID LAST_NAME                     SALARY HIRE_DATE DEPARTMENT_ID
----------- ------------------------- ---------- --------- -------------
        114 Raphaely                       11000 07-DEC-02            30
        115 Khoo                            3100 18-MAY-03            30
        116 Baida                           2900 24-DEC-05            30
        117 Tobias                          2800 24-JUL-05            30
        118 Himuro                          2600 15-NOV-06            30
        119 Colmenares                      2500 10-AUG-07            30

6 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  acwau2bnmz7hg, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_year where
department_id = 30

Plan hash value: 3471153647

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name     | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers | Reads  |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |          |      1 |        |       |       |      6 |00:00:00.01 |       9 |      3 |
|   1 |  PARTITION RANGE ALL   |          |      1 |     10 |     1 |     4 |      6 |00:00:00.01 |       9 |      3 |
|   2 |   PARTITION LIST SINGLE|          |      4 |     10 |   KEY |   KEY |      6 |00:00:00.01 |       9 |      3 |
|*  3 |    TABLE ACCESS FULL   | EMP_YEAR |      4 |     10 |   KEY |   KEY |      6 |00:00:00.01 |       9 |      3 |
----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter(&quot;DEPARTMENT_ID&quot;=30)

21 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;파티션 관리&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 생성&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;create table hr.sal_emp
partition by range(salary)(
partition p1 values less than(5000),   
partition p2 values less than(15000),  
partition p3 values less than(25000))
tablespace users  
as select employee_id, last_name, salary, department_id from hr.employees;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 파티션 메타 정보 및 통계 정보 조회
SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             25000                          USERS                          YES

# 파티션 테이블 메타 정보 조회
SYS@ora19c&amp;gt; select partitioning_type, partition_count, subpartitioning_type, def_subpartition_count from dba_part_tables where table_name = 'SAL_EMP' and owner = 'HR';

PARTITION PARTITION_COUNT SUBPARTIT DEF_SUBPARTITION_COUNT
--------- --------------- --------- ----------------------
RANGE                   3 NONE                           0

# 파티션 키 컬럼 정보 조회
SYS@ora19c&amp;gt; select * from dba_part_key_columns where name = 'EMP_YEAR' and owner = 'HR';

OWNER                          NAME                                               OBJEC COLUMN_NAME                    COLUMN_POSITION COLLATED_COLUMN_ID
------------------------------ -------------------------------------------------- ----- ------------------------------ --------------- ------------------
HR                             EMP_YEAR                                           TABLE HIRE_DATE                        1&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 나누기&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter table hr.sal_emp split partition p3 at(20000) into (partition p3, partition p4);

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';   2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             20000                          USERS                          YES
P4                             25000                          USERS                          YES

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p3);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        101 Kochhar                        17000            90
        102 De Haan                        17000            90

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p4);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 King                           24000            90
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 추가&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter table hr.sal_emp add partition p5_1 values less than(30000);

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             20000                          USERS                          YES
P4                             25000                          USERS                          YES
P5_1                           30000                          USERS                          YES&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 이름 변경&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter table hr.sal_emp rename partition p5_1 to p5;

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';   2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             20000                          USERS                          YES
P4                             25000                          USERS                          YES
P5                             30000                          USERS                          YES&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 삭제&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter table hr.sal_emp drop partition p5;

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';   2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             20000                          USERS                          YES
P4                             25000                          USERS                          YES&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;특정 파티션 truncate&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p3);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        101 Kochhar                        17000            90
        102 De Haan                        17000            90

SYS@ora19c&amp;gt; alter table hr.sal_emp truncate partition p3;

Table truncated.

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p3);

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# 원상 복구
SYS@ora19c&amp;gt; insert into hr.sal_emp
select employee_id, last_name, salary, department_id
from hr.employees
where employee_id in (101, 102);  2    3    4

2 rows created.

SYS@ora19c&amp;gt; commit;

Commit complete.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;키 컬럼을 다른 파티션에 해당하는 값으로 변경&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; update hr.sal_emp set salary = 18000 where employee_id = 101;

1 row updated.

SYS@ora19c&amp;gt; rollback;

Rollback complete.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;salary = 18000도 p3에 해당하므로 문제 없음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;subunit&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; update hr.sal_emp set salary = 21000 where employee_id = 101;
update hr.sal_emp set salary = 21000 where employee_id = 101
          *
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;salary = 21000은 p4에 해당하므로 수정 시 파티션을 변경해서 저장해야 함 &amp;rarr; 오류 발생&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter table hr.sal_emp disable row movement;

Table altered.

SYS@ora19c&amp;gt; alter table hr.sal_emp enable row movement;

Table altered.

SYS@ora19c&amp;gt; update hr.sal_emp set salary = 21000 where employee_id = 101;

1 row updated.

SYS@ora19c&amp;gt; commit;

Commit complete.

SYS@ora19c&amp;gt; alter table hr.sal_emp disable row movement;

Table altered.

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p3);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        102 De Haan                        17000            90

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p4);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 King                           24000            90
        101 Kochhar                        21000            90&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;row movement를 활성화해주면 수정 가능&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;maxvalue partition 추가&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             20000                          USERS                          YES
P4                             25000                          USERS                          YES

SYS@ora19c&amp;gt; alter table hr.sal_emp add partition pmax values less than(maxvalue);

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             20000                          USERS                          YES
P4                             25000                          USERS                          YES
PMAX                           MAXVALUE                       USERS                          YES&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; insert into hr.sal_emp values(300, 'oracle', 29000, 20);

1 row created.

SYS@ora19c&amp;gt; insert into hr.sal_emp values(400, 'itwill', 30000, 10);

1 row created.

SYS@ora19c&amp;gt; commit;

Commit complete.

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(pmax);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        300 oracle                         29000            20
        400 itwill                         30000            10&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# pmax 파티션 split
SYS@ora19c&amp;gt; alter table hr.sal_emp split partition pmax at(30000) into(partition p5, partition pmax);

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';   2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             20000                          USERS                          YES
P4                             25000                          USERS                          YES
P5                             30000                          USERS                          YES
PMAX                           MAXVALUE                       USERS                          YES

6 rows selected.

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p5);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        300 oracle                         29000            20

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(pmax);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        400 itwill                         30000            10&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 merge&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter table hr.sal_emp merge partitions p4, p5 into partition p5;

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                LOGGING
------------------------------ ------------------------------ ------------------------------ -------
P1                             5000                           USERS                          YES
P2                             15000                          USERS                          YES
P3                             20000                          USERS                          YES
P5                             30000                          USERS                          YES
PMAX                           MAXVALUE                       USERS                          YES&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p5);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 King                           24000            90
        101 Kochhar                        21000            90
        300 oracle                         29000            20&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 exchange&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# 테이블 생성
SYS@ora19c&amp;gt; create table hr.exch_emp
tablespace users
as
select employee_id, last_name, salary, department_id
from hr.employees
where 1 = 2;  2    3    4    5    6

Table created.

# 데이터 입력
SYS@ora19c&amp;gt; insert into hr.exch_emp values(500, 'sql', 25000, 30);

1 row created.

SYS@ora19c&amp;gt; insert into hr.exch_emp values(501, 'plsql', 26000, 10);

1 row created.

SYS@ora19c&amp;gt; commit;

Commit complete.

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p5);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 King                           24000            90
        101 Kochhar                        21000            90
        300 oracle                         29000            20&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# 파티션 exchange
SYS@ora19c&amp;gt; alter table hr.sal_emp exchange partition p5 with table hr.exch_emp;

Table altered.

SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p5);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        500 sql                            25000            30
        501 plsql                          26000            10

SYS@ora19c&amp;gt; select * from hr.exch_emp;

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 king                           24000            90
        101 Kochhar                        21000            90
        300 oracle                         29000            20&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, logging
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR'; 

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS
P2                             15000                          USERS
P3                             20000                          USERS
P5                             30000                          USERS                                   0          0       0
PMAX                           MAXVALUE                       USERS

# 파티션 이름 변경
SYS@ora19c&amp;gt; alter table hr.sal_emp rename partition p5 to p4;

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS
P2                             15000                          USERS
P3                             20000                          USERS
P4                             30000                          USERS                                   0          0       0
PMAX                           MAXVALUE                       USERS&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 테이블 통계 정보 조회
SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len from dba_tables where owner = 'HR' and table_name = 'SAL_EMP';

  NUM_ROWS     BLOCKS AVG_ROW_LEN
---------- ---------- -----------
       106       1082          17&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 통계 수집&lt;/h3&gt;
&lt;pre class=&quot;reasonml&quot;&gt;&lt;code&gt;exec dbms_stats.gather_table_stats('hr', 'sal_emp', granularity=&amp;gt;'auto')&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS                                  49         19      17
P2                             15000                          USERS                                  55         19      17
P3                             20000                          USERS                                   1       1006      19
P4                             30000                          USERS                                   3          5      17
PMAX                           MAXVALUE                       USERS                                   1         19      16&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';   2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS                                  49         19      17
P2                             15000                          USERS                                  55         19      17
P3                             20000                          USERS                                   1       1006      19
P4                             30000                          USERS                                   3          5      17
PMAX                           MAXVALUE                       USERS                                   1         19      16
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;976&quot; data-origin-height=&quot;488&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bgfcBR/dJMcah4KAJv/lpCdE0znpuCXMjmIPse1a1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bgfcBR/dJMcah4KAJv/lpCdE0znpuCXMjmIPse1a1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bgfcBR/dJMcah4KAJv/lpCdE0znpuCXMjmIPse1a1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbgfcBR%2FdJMcah4KAJv%2FlpCdE0znpuCXMjmIPse1a1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;976&quot; height=&quot;488&quot; data-origin-width=&quot;976&quot; data-origin-height=&quot;488&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 shrink&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;alter table hr.sal_emp enable row movement;
alter table hr.sal_emp modify partition p4 shrink space cascade;
alter table hr.sal_emp disable row movement;
exec dbms_stats.gather_table_stats('hr', 'sal_emp', granularity=&amp;gt;'auto')&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS                                  49         19      17
P2                             15000                          USERS                                  55         19      17
P3                             20000                          USERS                                   1       1006      19
P4                             30000                          USERS                                   3          1      17
PMAX                           MAXVALUE                       USERS                                   1         19      16&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 move&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter table hr.sal_emp move partition p3;

Table altered.

SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 'sal_emp', granularity=&amp;gt;'auto')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS                                  49         19      17
P2                             15000                          USERS                                  55         19      17
P3                             20000                          USERS                                   1         19      19
P4                             30000                          USERS                                   3          1      17
PMAX                           MAXVALUE                       USERS                                   1         19      16&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 export&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;select * from dba_directories where directory_name = 'DATA_PUMP_DIR';&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;[oracle@ora19c ~]$ expdp system/oracle directory=data_pump_dir tables=hr.sal_emp dumpfile=hr_sal_emp.pump

Export: Release 19.0.0.0.0 - Production on Fri Feb 20 16:37:31 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Starting &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TABLE_01&quot;:  system/******** directory=data_pump_dir tables=hr.sal_emp dumpfile=hr_sal_emp.pump
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P2&quot;                         7.601 KB      55 rows
. . exported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P1&quot;                         7.476 KB      49 rows
. . exported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P4&quot;                         6.523 KB       3 rows
. . exported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P3&quot;                         6.484 KB       1 rows
. . exported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;PMAX&quot;                       6.484 KB       1 rows
Master table &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TABLE_01&quot; successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
  /u01/app/oracle/admin/ora19c/dpdump/hr_sal_emp.pump
Job &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TABLE_01&quot; successfully completed at Fri Feb 20 16:37:53 2026 elapsed 0 00:00:18

[oracle@ora19c ~]$ ls -l /u01/app/oracle/admin/ora19c/dpdump/hr_sal_emp.pump
-rw-r-----. 1 oracle oinstall 237568 Feb 20 16:37 /u01/app/oracle/admin/ora19c/dpdump/hr_sal_emp.pump&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 import&lt;/h3&gt;
&lt;pre class=&quot;subunit&quot;&gt;&lt;code&gt;# 파티션 테이블 삭제
SYS@ora19c&amp;gt; drop table hr.sal_emp purge;

Table dropped.

SYS@ora19c&amp;gt; select * from hr.sal_emp;
select * from hr.sal_emp
                 *
ERROR at line 1:
ORA-00942: table or view does not exist
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;[oracle@ora19c ~]$ impdp system/oracle directory=data_pump_dir tables=hr.sal_emp dumpfile=hr_sal_emp.pump

Import: Release 19.0.0.0.0 - Production on Fri Feb 20 16:39:59 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Master table &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot; successfully loaded/unloaded
Starting &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot;:  system/******** directory=data_pump_dir tables=hr.sal_emp dumpfile=hr_sal_emp.pump
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P2&quot;                         7.601 KB      55 rows
. . imported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P1&quot;                         7.476 KB      49 rows
. . imported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P4&quot;                         6.523 KB       3 rows
. . imported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P3&quot;                         6.484 KB       1 rows
. . imported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;PMAX&quot;                       6.484 KB       1 rows
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Job &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot; successfully completed at Fri Feb 20 16:40:19 2026 elapsed 0 00:00:18
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS                                  49         19      17
P2                             15000                          USERS                                  55         19      17
P3                             20000                          USERS                                   1         19      19
P4                             30000                          USERS                                   3          5      17
PMAX                           MAXVALUE                       USERS                                   1         19      16&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;특정 파티션 테이블만 import&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p4);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 king                           24000            90
        101 Kochhar                        21000            90
        300 oracle                         29000            20

# 특정 파티션 삭제
SYS@ora19c&amp;gt; alter table hr.sal_emp drop partition p4;

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS                                  49         19      17
P2                             15000                          USERS                                  55         19      17
P3                             20000                          USERS                                   1         19      19
PMAX                           MAXVALUE                       USERS                                   1         19      16&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;[oracle@ora19c ~]$ impdp system/oracle directory=data_pump_dir dumpfile=hr_sal_emp.pump sqlfile=hr_sal_emp.sql

Import: Release 19.0.0.0.0 - Production on Fri Feb 20 16:46:53 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Master table &quot;SYSTEM&quot;.&quot;SYS_SQL_FILE_FULL_01&quot; successfully loaded/unloaded
Starting &quot;SYSTEM&quot;.&quot;SYS_SQL_FILE_FULL_01&quot;:  system/******** directory=data_pump_dir dumpfile=hr_sal_emp.pump sqlfile=hr_sal_emp.sql
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Job &quot;SYSTEM&quot;.&quot;SYS_SQL_FILE_FULL_01&quot; successfully completed at Fri Feb 20 16:46:57 2026 elapsed 0 00:00:02

[oracle@ora19c dpdump]$ ls /u01/app/oracle/admin/ora19c/dpdump/hr_sal_emp.sql
/u01/app/oracle/admin/ora19c/dpdump/hr_sal_emp.sql

[oracle@ora19c dpdump]$ vi hr_sal_emp.sql&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;619&quot; data-origin-height=&quot;889&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bsST6W/dJMcaiP4rS4/zU2YTR3sTeNjLQiX3gwmc1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bsST6W/dJMcaiP4rS4/zU2YTR3sTeNjLQiX3gwmc1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bsST6W/dJMcaiP4rS4/zU2YTR3sTeNjLQiX3gwmc1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbsST6W%2FdJMcaiP4rS4%2FzU2YTR3sTeNjLQiX3gwmc1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;619&quot; height=&quot;889&quot; data-origin-width=&quot;619&quot; data-origin-height=&quot;889&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# pmax 파티션을 30000을 기준으로 p4와 pmax로 split
SYS@ora19c&amp;gt; alter table hr.sal_emp split partition pmax at(30000) into (partition p4, partition pmax);

Table altered.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS                                  49         19      17
P2                             15000                          USERS                                  55         19      17
P3                             20000                          USERS                                   1         19      19
P4                             30000                          USERS
PMAX                           MAXVALUE                       USERS                                   1         19      16&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;# p4 파티션의 데이터만 import
SYS@ora19c&amp;gt; ! impdp system/oracle directory=data_pump_dir dumpfile=hr_sal_emp.pump tables=hr.sal_emp:p4 content=data_only

Import: Release 19.0.0.0.0 - Production on Fri Feb 20 16:52:42 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Master table &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot; successfully loaded/unloaded
Starting &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot;:  system/******** directory=data_pump_dir dumpfile=hr_sal_emp.pump tables=hr.sal_emp:p4 content=data_only
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P4&quot;                         6.523 KB       3 rows
Job &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot; successfully completed at Fri Feb 20 16:52:49 2026 elapsed 0 00:00:06
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p4);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 king                           24000            90
        101 Kochhar                        21000            90
        300 oracle                         29000            20&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;특정 파티션 테이블만 통계 수집&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 'sal_emp', partname=&amp;gt;'p4', granularity=&amp;gt;'partition')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'SAL_EMP'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             5000                           USERS                                  49         19      17
P2                             15000                          USERS                                  55         19      17
P3                             20000                          USERS                                   1         19      19
P4                             30000                          USERS                                   3         19      17
PMAX                           MAXVALUE                       USERS                                   1         19      16&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;특정 파티션 테이블만 export&lt;/h3&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; ! expdp system/oracle directory=data_pump_dir dumpfile=hr_sal_emp_p4.pump tables=hr.sal_emp:p4

Export: Release 19.0.0.0.0 - Production on Fri Feb 20 16:57:35 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Starting &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TABLE_01&quot;:  system/******** directory=data_pump_dir dumpfile=hr_sal_emp_p4.pump tables=hr.sal_emp:p4
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P4&quot;                         6.523 KB       3 rows
Master table &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TABLE_01&quot; successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
  /u01/app/oracle/admin/ora19c/dpdump/hr_sal_emp_p4.pump
Job &quot;SYSTEM&quot;.&quot;SYS_EXPORT_TABLE_01&quot; successfully completed at Fri Feb 20 16:57:53 2026 elapsed 0 00:00:17

SYS@ora19c&amp;gt; ! ls -l /u01/app/oracle/admin/ora19c/dpdump/hr_sal_emp_p4.pump
-rw-r-----. 1 oracle oinstall 204800 Feb 20 16:57 /u01/app/oracle/admin/ora19c/dpdump/hr_sal_emp_p4.pump&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p4);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 king                           24000            90
        101 Kochhar                        21000            90
        300 oracle                         29000            20

# p4 파티션 truncate
SYS@ora19c&amp;gt; alter table hr.sal_emp truncate partition p4;

Table truncated.

# p4 파티션 데이터만 import
SYS@ora19c&amp;gt; ! impdp system/oracle directory=data_pump_dir dumpfile=hr_sal_emp_p4.pump tables=hr.sal_emp:p4 content=data_only

Import: Release 19.0.0.0.0 - Production on Fri Feb 20 17:00:08 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Master table &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot; successfully loaded/unloaded
Starting &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot;:  system/******** directory=data_pump_dir dumpfile=hr_sal_emp_p4.pump tables=hr.sal_emp:p4 content=data_only
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported &quot;HR&quot;.&quot;SAL_EMP&quot;:&quot;P4&quot;                         6.523 KB       3 rows
Job &quot;SYSTEM&quot;.&quot;SYS_IMPORT_TABLE_01&quot; successfully completed at Fri Feb 20 17:00:16 2026 elapsed 0 00:00:06

# 복구 완료
SYS@ora19c&amp;gt; select * from hr.sal_emp partition(p4);

EMPLOYEE_ID LAST_NAME                     SALARY DEPARTMENT_ID
----------- ------------------------- ---------- -------------
        100 king                           24000            90
        101 Kochhar                        21000            90
        300 oracle                         29000            20
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Local Partition Index&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;파티션 테이블의 각 파티션과 파티션 인덱스의 각 파티션이 1 : 1로 매핑되는 인덱스&lt;/li&gt;
&lt;li&gt;테이블 파티션 개수와 인덱스 파티션 개수가 일치하며 테이블의 파티션 키와 파티션 인덱스의 파티션 키가 일치&lt;/li&gt;
&lt;li&gt;유지 관리 작업은 오라클이 자동으로 관리. 다른 파티션에 영향을 주지 않음&lt;/li&gt;
&lt;li&gt;prefixed : 파티션 인덱스를 생성할 때 파티션 키 컬럼을 인덱스 파티션 키 컬럼 왼쪽 선두에 두는 것을 의미&lt;/li&gt;
&lt;li&gt;nonprefixed : 파티션 인덱스를 생성할 때 파티션 키 컬럼을 인덱스 파티션 키 컬럼 왼쪽 선두에 두지 않는 것을 의미&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 생성&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; drop table hr.sal_emp purge;

SYS@ora19c&amp;gt; create table hr.emp_local
partition by range(employee_id)(
partition p1 values less than(20000),
partition p2 values less than(40000),
partition p3 values less than(80000),
partition p4 values less than(100000),
partition p5 values less than(120000),
partition pmax values less than(maxvalue))
tablespace users
as select rownum as employee_id, last_name, first_name, hire_date, job_id, salary, manager_id, department_id
from hr.employees e,(select level as id from dual connect by level &amp;lt;=1000) ;  2    3    4    5    6    7    8    9   10   11

Table created.

SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 'emp_local', granularity=&amp;gt;'auto')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_LOCAL'
and table_owner = 'HR';  2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             20000                          USERS                               19999        156      44
P2                             40000                          USERS                               20000        157      45
P3                             80000                          USERS                               40000        296      45
P4                             100000                         USERS                               20000        157      45
P5                             120000                         USERS                                7001         67      45
PMAX                           MAXVALUE                       USERS                                   0          0       0

6 rows selected.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len from dba_tables where owner = 'HR' and table_name = 'EMP_LOCAL';

  NUM_ROWS     BLOCKS AVG_ROW_LEN
---------- ---------- -----------
    107000        833          45
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;로컬 파티션 인덱스 생성 전&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;파티션 테이블을 Full Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.emp_local 
where employee_id between 1000 and 1100;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  80466vmw5hkuf, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_local where
employee_id between 1000 and 1100

Plan hash value: 2758726452

--------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name      | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |           |      1 |        |       |       |    101 |00:00:00.01 |     146 |
|   1 |  PARTITION RANGE SINGLE|           |      1 |    102 |     1 |     1 |    101 |00:00:00.01 |     146 |
|*  2 |   TABLE ACCESS FULL    | EMP_LOCAL |      1 |    102 |     1 |     1 |    101 |00:00:00.01 |     146 |
--------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter((&quot;EMPLOYEE_ID&quot;&amp;lt;=1100 AND &quot;EMPLOYEE_ID&quot;&amp;gt;=1000))

20 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_local
where employee_id = 1000;  2    3

EMPLOYEE_ID LAST_NAME                 FIRST_NAME           HIRE_DATE JOB_ID         SALARY MANAGER_ID DEPARTMENT_ID
----------- ------------------------- -------------------- --------- ---------- ---------- ---------- -------------
       1000 Philtanker                Hazel                06-FEB-08 ST_CLERK         2200        122            50

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  1snwrr5x5ftqg, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_local where
employee_id = 1000

Plan hash value: 2758726452

--------------------------------------------------------------------------------------------------------------
| Id  | Operation              | Name      | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT       |           |      1 |        |       |       |      1 |00:00:00.01 |     140 |
|   1 |  PARTITION RANGE SINGLE|           |      1 |      1 |     1 |     1 |      1 |00:00:00.01 |     140 |
|*  2 |   TABLE ACCESS FULL    | EMP_LOCAL |      1 |      1 |     1 |     1 |      1 |00:00:00.01 |     140 |
--------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;EMPLOYEE_ID&quot;=1000)

20 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Local Partition Index 생성&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;create unique index hr.emp_local_idx on hr.emp_local(employee_id) local;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select i.index_name, i.uniqueness, p.locality, p.alignment, i.partitioned, p.partition_count
from dba_indexes i, dba_part_indexes p
where i.owner = 'HR'
and i.table_name = 'EMP_LOCAL'
and p.table_name = i.table_name
and p.index_name = i.index_name;  2    3    4    5    6

INDEX_NAME                     UNIQUENES LOCALI ALIGNMENT    PAR PARTITION_COUNT
------------------------------ --------- ------ ------------ --- ---------------
EMP_LOCAL_IDX                  UNIQUE    LOCAL  PREFIXED     YES               6&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, blevel, leaf_blocks
from dba_ind_partitions
where index_owner = 'HR'
and index_name='EMP_LOCAL_IDX';  2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                         BLEVEL LEAF_BLOCKS
------------------ ------------------------------ ------------------------------ ---------- -----------
                 1 P1                             20000                                   1          41
                 2 P2                             40000                                   1          42
                 3 P3                             80000                                   1          84
                 4 P4                             100000                                  1          42
                 5 P5                             120000                                  1          15
                 6 PMAX                           MAXVALUE                                0           0

6 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;로컬 파티션 인덱스 생성 후&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;I/O 발생량이 140 &amp;rarr; 3으로 줄음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.emp_local
where employee_id = 1000;  2    3

EMPLOYEE_ID LAST_NAME                 FIRST_NAME           HIRE_DATE JOB_ID         SALARY MANAGER_ID DEPARTMENT_ID
----------- ------------------------- -------------------- --------- ---------- ---------- ---------- -------------
       1000 Philtanker                Hazel                06-FEB-08 ST_CLERK         2200        122            50

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  1snwrr5x5ftqg, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_local where
employee_id = 1000

Plan hash value: 2113456604

---------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                          | Name          | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers | Reads  |
---------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                   |               |      1 |        |       |       |      1 |00:00:00.01 |   3 |       1 |
|   1 |  PARTITION RANGE SINGLE            |               |      1 |      1 |     1 |     1 |      1 |00:00:00.01 |   3 |       1 |
|   2 |   TABLE ACCESS BY LOCAL INDEX ROWID| EMP_LOCAL     |      1 |      1 |     1 |     1 |      1 |00:00:00.01 |   3 |       1 |
|*  3 |    INDEX UNIQUE SCAN               | EMP_LOCAL_IDX |      1 |      1 |     1 |     1 |      1 |00:00:00.01 |   2 |       1 |
---------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;EMPLOYEE_ID&quot;=1000)

21 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;I/O 발생량이 146 &amp;rarr; 19로 줄음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.emp_local 
where employee_id between 1000 and 1100;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  80466vmw5hkuf, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp_local where
employee_id between 1000 and 1100

Plan hash value: 1709852961

-----------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                                  | Name          | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers | Reads  |
-----------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                           |               |      1 |        |       |       |    101 |00:00:00.01 |   19 |      1 |
|   1 |  PARTITION RANGE SINGLE                    |               |      1 |    102 |     1 |     1 |    101 |00:00:00.01 |   19 |      1 |
|   2 |   TABLE ACCESS BY LOCAL INDEX ROWID BATCHED| EMP_LOCAL     |      1 |    102 |     1 |     1 |    101 |00:00:00.01 |   19 |      1 |
|*  3 |    INDEX RANGE SCAN                        | EMP_LOCAL_IDX |      1 |    102 |     1 |     1 |    101 |00:00:00.01 |   10 |      1 |
-----------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;EMPLOYEE_ID&quot;&amp;gt;=1000 AND &quot;EMPLOYEE_ID&quot;&amp;lt;=1100)

21 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Global Partition Index&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;파티션 테이블의 파티션 키와 파티션 인덱스 파티션 키가 일치하지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;파티션 테이블 생성&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; create table hr.emp_global
partition by range(employee_id)(
partition p1 values less than(20000),
partition p2 values less than(40000),
partition p3 values less than(80000),
partition p4 values less than(100000),
partition p5 values less than(120000),
partition pmax values less than(maxvalue))
tablespace users
as select rownum as employee_id, last_name, first_name, hire_date, job_id, salary, manager_id, department_id
from hr.employees e,(select level as id from dual connect by level &amp;lt;=1000) ;  2    3    4    5    6    7    8    9   10   11

Table created.

SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 'emp_global', granularity=&amp;gt;'auto')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_GLOBAL'
and table_owner = 'HR';   2    3    4

PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
P1                             20000                          USERS                               19999        156      44
P2                             40000                          USERS                               20000        157      45
P3                             80000                          USERS                               40000        296      45
P4                             100000                         USERS                               20000        157      45
P5                             120000                         USERS                                7001         67      45
PMAX                           MAXVALUE                       USERS                                   0          0       0

6 rows selected.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len from dba_tables where owner = 'HR' and table_name = 'EMP_GLOBAL';

  NUM_ROWS     BLOCKS AVG_ROW_LEN
---------- ---------- -----------
    107000        833          45&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Global Partition Index 생성&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; create index hr.emp_global_idx on hr.emp_global(hire_date) global
     partition by range(hire_date)(
     partition p2004 values less than(to_date('2005-01-01','yyyy-mm-dd')),
     partition p2005 values less than(to_date('2006-01-01','yyyy-mm-dd')),
     partition p2006 values less than(to_date('2007-01-01','yyyy-mm-dd')),
     partition pmax values less than(maxvalue))
     tablespace users;  2    3    4    5    6    7

Index created.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select i.index_name, i.uniqueness, p.locality, p.alignment, i.partitioned, p.partition_count
from dba_indexes i, dba_part_indexes p
where i.owner = 'HR'
and i.table_name = 'EMP_GLOBAL'
and p.table_name = i.table_name
and p.index_name = i.index_name;  2    3    4    5    6

INDEX_NAME                     UNIQUENES LOCALI ALIGNMENT    PAR PARTITION_COUNT
------------------------------ --------- ------ ------------ --- ---------------
EMP_GLOBAL_IDX                 NONUNIQUE GLOBAL PREFIXED     YES               4&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, blevel, leaf_blocks
from dba_ind_partitions
where index_owner = 'HR'
and index_name='EMP_GLOBAL_IDX';   2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                         BLEVEL LEAF_BLOCKS
------------------ ------------------------------ ------------------------------ ---------- -----------
                 1 P2004                          TO_DATE(' 2005-01-01 00:00:00'          1          77
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 2 P2005                          TO_DATE(' 2006-01-01 00:00:00'          1          93
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 3 P2006                          TO_DATE(' 2007-01-01 00:00:00'          1          77
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 4 PMAX                           MAXVALUE                                1          97
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ count(*) from hr.emp_global where hire_date between to_date('2001-01-01','yyyy-mm-dd') and to_date('2001-12-31','yyyy-mm-dd');

  COUNT(*)
----------
      1000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  fjrj7nr8jw1sz, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ count(*) from hr.emp_global where
hire_date between to_date('2001-01-01','yyyy-mm-dd') and
to_date('2001-12-31','yyyy-mm-dd')

Plan hash value: 1584155811

-----------------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name           | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers | Reads  |
-----------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |                |      1 |        |       |       |      1 |00:00:00.01 |      85 | 77 |
|   1 |  SORT AGGREGATE         |                |      1 |      1 |       |       |      1 |00:00:00.01 |      85 | 77 |
|   2 |   PARTITION RANGE SINGLE|                |      1 |  15278 |     1 |     1 |   1000 |00:00:00.01 |      85 | 77 |
|*  3 |    INDEX FAST FULL SCAN | EMP_GLOBAL_IDX |      1 |  15278 |     1 |     1 |   1000 |00:00:00.01 |      85 | 77 |
-----------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter((&quot;HIRE_DATE&quot;&amp;lt;=TO_DATE(' 2001-12-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND &quot;HIRE_DATE&quot;&amp;gt;=TO_DATE('
              2001-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss')))

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics index_rs(e emp_global_idx) */ count(*) from hr.emp_global e where hire_date between to_date('2001-01-01','yyyy-mm-dd') and to_date('2001-12-31','yyyy-mm-dd');

  COUNT(*)
----------
      1000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  3rqv6dxdws8x2, child number 0
-------------------------------------
select /*+ gather_plan_statistics index_rs(e emp_global_idx) */
count(*) from hr.emp_global e where hire_date between
to_date('2001-01-01','yyyy-mm-dd') and
to_date('2001-12-31','yyyy-mm-dd')

Plan hash value: 1502691026

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation               | Name           | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT        |                |      1 |        |       |       |      1 |00:00:00.01 |       5 |
|   1 |  SORT AGGREGATE         |                |      1 |      1 |       |       |      1 |00:00:00.01 |       5 |
|   2 |   PARTITION RANGE SINGLE|                |      1 |  15278 |     1 |     1 |   1000 |00:00:00.01 |       5 |
|*  3 |    INDEX RANGE SCAN     | EMP_GLOBAL_IDX |      1 |  15278 |     1 |     1 |   1000 |00:00:00.01 |       5 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;HIRE_DATE&quot;&amp;gt;=TO_DATE(' 2001-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              &quot;HIRE_DATE&quot;&amp;lt;=TO_DATE(' 2001-12-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))

24 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, blevel, leaf_blocks, status
from dba_ind_partitions
where index_owner = 'HR'
and index_name='EMP_GLOBAL_IDX';   2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                         BLEVEL LEAF_BLOCKS STATUS
------------------ ------------------------------ ------------------------------ ---------- ----------- --------
                 1 P2004                          TO_DATE(' 2005-01-01 00:00:00'          1          77 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 2 P2005                          TO_DATE(' 2006-01-01 00:00:00'          1          93 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 3 P2006                          TO_DATE(' 2007-01-01 00:00:00'          1          77 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 4 PMAX                           MAXVALUE                                1          97 USABLE&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_GLOBAL'
and table_owner = 'HR';  2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------ ------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
                 1 P1                             20000                          USERS                               19999     156          44
                 2 P2                             40000                          USERS                               20000     157          45
                 3 P3                             80000                          USERS                               40000     296          45
                 4 P4                             100000                         USERS                               20000     157          45
                 5 P5                             120000                         USERS                                7001      67          45
                 6 PMAX                           MAXVALUE                       USERS                               0           0           0

6 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter table hr.emp_global drop partition p4;

Table altered.

SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_GLOBAL'
and table_owner = 'HR';  2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------ ------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
                 1 P1                             20000                          USERS                               19999     156          44
                 2 P2                             40000                          USERS                               20000     157          45
                 3 P3                             80000                          USERS                               40000     296          45
                 4 P5                             120000                         USERS                                7001      67          45
                 5 PMAX                           MAXVALUE                       USERS                               0           0           0

SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, blevel, leaf_blocks, status
from dba_ind_partitions
where index_owner = 'HR'
and index_name='EMP_GLOBAL_IDX';   2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                         BLEVEL LEAF_BLOCKS STATUS
------------------ ------------------------------ ------------------------------ ---------- ----------- --------
                 1 P2004                          TO_DATE(' 2005-01-01 00:00:00'          1          77 UNUSABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 2 P2005                          TO_DATE(' 2006-01-01 00:00:00'          1          93 UNUSABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 3 P2006                          TO_DATE(' 2007-01-01 00:00:00'          1          77 UNUSABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 4 PMAX                           MAXVALUE                                1          97 UNUSABLE
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;파티션을 삭제하는 순간 종속되어 있는 인덱스가 unusable 상태로 바뀜&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics index_rs(e emp_global_idx) */ count(*) from hr.emp_global e where hire_date between to_date('2001-01-01','yyyy-mm-dd') and to_date('2001-12-31','yyyy-mm-dd');
select /*+ gather_plan_statistics index_rs(e emp_global_idx) */ count(*) from hr.emp_global e where hire_date between to_date('2001-01-01','yyyy-mm-dd') and to_date('2001-12-31','yyyy-mm-dd')
*
ERROR at line 1:
ORA-01502: index 'HR.EMP_GLOBAL_IDX' or partition of such index is in unusable state&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ count(*) from hr.emp_global e where hire_date between to_date('2001-01-01','yyyy-mm-dd') and to_date('2001-12-31','yyyy-mm-dd');

  COUNT(*)
----------
       813

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last +partition'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5sf3rxpd2n09c, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ count(*) from hr.emp_global e
where hire_date between to_date('2001-01-01','yyyy-mm-dd') and
to_date('2001-12-31','yyyy-mm-dd')

Plan hash value: 4068342047

-------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name       | Starts | E-Rows | Pstart| Pstop | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |            |      1 |        |       |       |      1 |00:00:00.01 |     608 |
|   1 |  SORT AGGREGATE      |            |      1 |      1 |       |       |      1 |00:00:00.01 |     608 |
|   2 |   PARTITION RANGE ALL|            |      1 |  12398 |     1 |     5 |    813 |00:00:00.01 |     608 |
|*  3 |    TABLE ACCESS FULL | EMP_GLOBAL |      5 |  12398 |     1 |     5 |    813 |00:00:00.01 |     608 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter((&quot;HIRE_DATE&quot;&amp;lt;=TO_DATE(' 2001-12-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              &quot;HIRE_DATE&quot;&amp;gt;=TO_DATE(' 2001-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss')))

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;n1ql&quot;&gt;&lt;code&gt;# 인덱스 rebuild -&amp;gt; 오류 발생
SYS@ora19c&amp;gt; alter index hr.emp_global_idx rebuild;
alter index hr.emp_global_idx rebuild
               *
ERROR at line 1:
ORA-14086: a partitioned index may not be rebuilt as a whole

# 파티션 인덱스는 각각 rebuild 수행해줘야 함
SYS@ora19c&amp;gt; alter index hr.emp_global_idx rebuild partition p2004;

Index altered.

SYS@ora19c&amp;gt; alter index hr.emp_global_idx rebuild partition p2005;

Index altered.

SYS@ora19c&amp;gt; alter index hr.emp_global_idx rebuild partition p2006;

Index altered.

SYS@ora19c&amp;gt; alter index hr.emp_global_idx rebuild partition pmax;

Index altered.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, tablespace_name, num_rows, blocks, avg_row_len
from dba_tab_partitions
where table_name = 'EMP_GLOBAL'
and table_owner = 'HR';  2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                     TABLESPACE_NAME                  NUM_ROWS     BLOCKS AVG_ROW_LEN
------------------ ------------------------------ ------------------------------ ------------------------------ ---------- ---------- -----------
                 1 P1                             20000                          USERS                               19999     156          44
                 2 P2                             40000                          USERS                               20000     157          45
                 3 P3                             80000                          USERS                               40000     296          45
                 4 P5                             120000                         USERS                                7001      67          45
                 5 PMAX                           MAXVALUE                       USERS                               0           0           0

SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, blevel, leaf_blocks, status
from dba_ind_partitions
where index_owner = 'HR'
and index_name='EMP_GLOBAL_IDX';  3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                         BLEVEL LEAF_BLOCKS STATUS
------------------ ------------------------------ ------------------------------ ---------- ----------- --------
                 1 P2004                          TO_DATE(' 2005-01-01 00:00:00'          1          63 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 2 P2005                          TO_DATE(' 2006-01-01 00:00:00'          1          76 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 3 P2006                          TO_DATE(' 2007-01-01 00:00:00'          1          63 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 4 PMAX                           MAXVALUE                                1          79 USABLE
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# pmax 파티션 split
SYS@ora19c&amp;gt; alter index hr.emp_global_idx split partition pmax at (to_date('2008-01-01','yyyy-mm-dd')) into (partition p2007, partition pmax);

Index altered.

SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, blevel, leaf_blocks, status
from dba_ind_partitions
where index_owner = 'HR'
and index_name='EMP_GLOBAL_IDX';  2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                         BLEVEL LEAF_BLOCKS STATUS
------------------ ------------------------------ ------------------------------ ---------- ----------- --------
                 1 P2004                          TO_DATE(' 2005-01-01 00:00:00'          1          63 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 2 P2005                          TO_DATE(' 2006-01-01 00:00:00'          1          76 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 3 P2006                          TO_DATE(' 2007-01-01 00:00:00'          1          63 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 4 P2007                          TO_DATE(' 2008-01-01 00:00:00'                        USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 5 PMAX                           MAXVALUE                                              USABLE
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;# p2007 파티션 삭제
SYS@ora19c&amp;gt; alter index hr.emp_global_idx drop partition p2007;

Index altered.

# pmax 파티션이 unusable 상태로 바뀜
SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, blevel, leaf_blocks, status
from dba_ind_partitions
where index_owner = 'HR'
and index_name='EMP_GLOBAL_IDX';  2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                         BLEVEL LEAF_BLOCKS STATUS
------------------ ------------------------------ ------------------------------ ---------- ----------- --------
                 1 P2004                          TO_DATE(' 2005-01-01 00:00:00'          1          63 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 2 P2005                          TO_DATE(' 2006-01-01 00:00:00'          1          76 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 3 P2006                          TO_DATE(' 2007-01-01 00:00:00'          1          63 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 4 PMAX                           MAXVALUE                                              UNUSABLE
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;# pmax 파티션 인덱스만 rebuild
SYS@ora19c&amp;gt; alter index hr.emp_global_idx rebuild partition pmax;

Index altered.

SYS@ora19c&amp;gt; select partition_position, partition_name, high_value, blevel, leaf_blocks, status
from dba_ind_partitions
where index_owner = 'HR'
and index_name='EMP_GLOBAL_IDX';   2    3    4

PARTITION_POSITION PARTITION_NAME                 HIGH_VALUE                         BLEVEL LEAF_BLOCKS STATUS
------------------ ------------------------------ ------------------------------ ---------- ----------- --------
                 1 P2004                          TO_DATE(' 2005-01-01 00:00:00'          1          63 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 2 P2005                          TO_DATE(' 2006-01-01 00:00:00'          1          76 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 3 P2006                          TO_DATE(' 2007-01-01 00:00:00'          1          63 USABLE
                                                  , 'SYYYY-MM-DD HH24:MI:SS', 'N
                                                  LS_CALENDAR=GREGORIA

                 4 PMAX                           MAXVALUE                                1          79 USABLE&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <category>튜닝</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/235</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260220-TIL#entry235comment</comments>
      <pubDate>Sun, 15 Mar 2026 22:52:22 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260219 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260219-TIL</link>
      <description>&lt;h1&gt;통계 정보&lt;/h1&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;통계 정보 삭제&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;5일 전 통계 정보 삭제&lt;/h3&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;# 통계 정보 삭제
SYS@ora19c&amp;gt; exec dbms_stats.purge_stats(systimestamp - 5)

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select * from dba_tab_stats_history where owner='HR' and table_name='TAB';

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;특정 시점 이전의 통계 정보 삭제&lt;/h3&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;# 통계 정보 수집
SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr','tab',method_opt=&amp;gt;'for columns col1 size 254')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select * from dba_tab_stats_history;

OWNER                          TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME          STATS_UPDATE_TIME
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------------------------------------------------------------------------
HR                             TAB                                                                                      19-FEB-26 09.51.37.037032 AM +09:00

SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr','tab',method_opt=&amp;gt;'for columns col1 size 254')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select * from dba_tab_stats_history;

OWNER                          TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME          STATS_UPDATE_TIME
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------------------------------------------------------------------------
HR                             TAB                                                                                      19-FEB-26 09.51.37.037032 AM +09:00
HR                             TAB                                                                                      19-FEB-26 09.51.53.257990 AM +09:00

# 특정 시점 이전의 통계 정보 삭제
SYS@ora19c&amp;gt; exec dbms_stats.purge_stats(to_timestamp_tz('2026-02-19 09:51:38 +09:00', 'yyyy-mm-dd hh24:mi:ss tzh:tzm'))

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select * from dba_tab_stats_history;

OWNER                          TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME          STATS_UPDATE_TIME
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------------------------------------------------------------------------
HR                             TAB                                                                                      19-FEB-26 09.51.53.257990 AM +09:00&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;특정 테이블 통계 정보 삭제&lt;/h3&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;# 특정 테이블 통계 정보 삭제
SYS@ora19c&amp;gt; exec dbms_stats.delete_table_stats('hr','tab')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='TAB';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;수동으로 통계 정보 수정&lt;/h2&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# 수동으로 통계 정보 수정
SYS@ora19c&amp;gt; exec dbms_stats.set_table_stats(ownname=&amp;gt;'hr', tabname=&amp;gt;'tab', numrows=&amp;gt;110, numblks=&amp;gt;5, avgrlen=&amp;gt;7)

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='TAB';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----
       110          5           7 2026-02-19 10:03:47 NO
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Cursor Sharing&lt;/h1&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/CURSOR_SHARING.html&quot;&gt;https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/CURSOR_SHARING.html&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; show parameter cursor_sharing

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cursor_sharing                       string      EXACT&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;shared pool 메모리 안에 library cache에 있는 SQL문의 실행계획을 공유하는 기준&lt;/li&gt;
&lt;li&gt;&lt;code&gt;EXACT&lt;/code&gt; : SQL문이 똑같은 경우 CURSOR를 공유, 기본값&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FORCE&lt;/code&gt; : 다른 문자열은 모두 같고 일부 값만 다를 때 그 값을 바인드 변수로 대체함으로써 공유 가능한 CURSOR를 만들어 사용, 값의 분포도를 고려하지 않음&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SIMILAR&lt;/code&gt; : FORCE 확장 기능, 값의 분포도를 고려해서 실행계획을 공유하지 말지를 판단, 11gR2이후부터는 사용 X&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;EXACT&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;테이블 생성&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; create table hr.t1(c1 varchar2(1), c2 number) tablespace users;

Table created.

SYS@ora19c&amp;gt; insert into hr.t1(c1, c2)
select 'a', level from dual connect by level &amp;lt;= 10000
union all
select 'b', level from dual connect by level &amp;lt;= 100
union all
select 'c', level from dual connect by level &amp;lt;= 100;  2    3    4    5    6

10200 rows created.

SYS@ora19c&amp;gt; commit;

Commit complete.

SYS@ora19c&amp;gt; select c1, count(*) from hr.t1 group by c1;

C   COUNT(*)
- ----------
b        100
c        100
a      10000&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;인덱스 생성&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; create index hr.t1_idx on hr.t1(c1) tablespace users;

Index created.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;각각 하드 파싱 발생&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'a';

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'b';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'c';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
a6d5rmvjjn4gv select count(*) from hr.t1 where c1 = 'b'                    1          1          1
dnjaf1puh46xu select count(*) from hr.t1 where c1 = 'c'                    1          1          1
c9w6zrpym6pf3 select count(*) from hr.t1 where c1 = 'a'                    1          1          1&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;PARSE_CALLS&lt;/code&gt; : 파싱 횟수&lt;/li&gt;
&lt;li&gt;&lt;code&gt;LOADS&lt;/code&gt; : 하드 파싱 횟수&lt;/li&gt;
&lt;li&gt;&lt;code&gt;EXECUTIONS&lt;/code&gt; : 실행 횟수&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;c1 = &amp;lsquo;a&amp;rsquo; 실행 계획 조회&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;c1=&amp;rsquo;a&amp;rsquo;인 데이터가 대부분이기 때문에 Index Fast Full Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('c9w6zrpym6pf3'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  c9w6zrpym6pf3, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = 'a'

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     5 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX | 10000 | 20000 |     5  (40)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;='a')

Note
-----
   - dynamic statistics used: dynamic sampling (level=2)

23 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;c1 = &amp;lsquo;b&amp;rsquo; 실행 계획 조회&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;c1=&amp;rsquo;b&amp;rsquo;인 데이터는 소량이기 때문에 Index Range Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('a6d5rmvjjn4gv'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  a6d5rmvjjn4gv, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = 'b'

Plan hash value: 383751810

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |       |       |     1 (100)|          |
|   1 |  SORT AGGREGATE   |        |     1 |     2 |            |          |
|*  2 |   INDEX RANGE SCAN| T1_IDX |   100 |   200 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;='b')

Note
-----
   - dynamic statistics used: dynamic sampling (level=2)

23 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;c1 = &amp;lsquo;c&amp;rsquo; 실행 계획 조회&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;c1=&amp;rsquo;c&amp;rsquo;인 데이터는 소량이기 때문에 Index Range Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('dnjaf1puh46xu'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  dnjaf1puh46xu, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = 'c'

Plan hash value: 383751810

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |       |       |     1 (100)|          |
|   1 |  SORT AGGREGATE   |        |     1 |     2 |            |          |
|*  2 |   INDEX RANGE SCAN| T1_IDX |   100 |   200 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;='c')

Note
-----
   - dynamic statistics used: dynamic sampling (level=2)

23 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;FORCE&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;force 는 값의 분포가 고를 때 효과적&lt;/li&gt;
&lt;li&gt;현장에서는 exact를 사용&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;cursor_sharing = force로 설정&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# shared pool flush
SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

no rows selected

# cursor_sharing을 force로 설정
SYS@ora19c&amp;gt; alter session set cursor_sharing = force;

Session altered.

SYS@ora19c&amp;gt; show parameter cursor_sharing

NAME                                 TYPE                             VALUE
------------------------------------ -------------------------------- ------------------------------
cursor_sharing                       string                           FORCE
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;자동으로 바인드 변수 사용하여 실행 계획 공유됨&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'a';

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'b';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'c';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
9444k49k06853 select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;             3          1          3&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;실행 계획 조회 : INDEX FAST FULL SCAN&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;첫 번째 수행된 쿼리 조건이 c1 = &amp;lsquo;a&amp;rsquo; 였기 때문에 이 컬럼 값 분포를 기준으로 실행 계획 생성 &amp;rArr; Index Fast Full Scan(c1=&amp;rsquo;a&amp;rsquo;인 데이터가 대부분)&lt;/li&gt;
&lt;li&gt;bind peeking 동작&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('9444k49k06853'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  9444k49k06853, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     5 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX | 10000 | 20000 |     5  (40)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:SYS_B_0)

Note
-----
   - dynamic statistics used: dynamic sampling (level=2)

23 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select name, value_string, last_captured
from v$sql_bind_capture
where sql_id = '9444k49k06853';  2    3

NAME                                               VALUE_STRING                   LAST_CAPT
-------------------------------------------------- ------------------------------ ---------
:SYS_B_0                                           a                              19-FEB-26&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;초기화&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.

SYS@ora19c&amp;gt; alter session set cursor_sharing = force;

Session altered.

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;c1 = &amp;lsquo;b&amp;rsquo;인 데이터부터 조회&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'b';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'a';

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'c';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
9444k49k06853 select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;             3          1          3&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;실행 계획 조회 : INDEX RANGE SCAN&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;첫 번째 수행된 쿼리 조건이 c1 = &amp;lsquo;b&amp;rsquo; 였기 때문에 이 컬럼 값 분포를 기준으로 실행 계획 생성 &amp;rArr; Index Range Scan(c1=&amp;rsquo;b&amp;rsquo;인 데이터는 소량)&lt;/li&gt;
&lt;li&gt;bind peeking 동작&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('9444k49k06853'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  9444k49k06853, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;

Plan hash value: 383751810

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |       |       |     1 (100)|          |
|   1 |  SORT AGGREGATE   |        |     1 |     2 |            |          |
|*  2 |   INDEX RANGE SCAN| T1_IDX |   100 |   200 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;=:SYS_B_0)

Note
-----
   - dynamic statistics used: dynamic sampling (level=2)

23 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select name, value_string, last_captured
from v$sql_bind_capture
where sql_id = '9444k49k06853';  2    3

NAME                                               VALUE_STRING                   LAST_CAPT
-------------------------------------------------- ------------------------------ ---------
:SYS_B_0                                           b                              19-FEB-26&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;C1 컬럼 통계 정보 수집(히스토그램 수집)&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 't1', method_opt=&amp;gt;'for columns size 3 c1')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select t.num_rows, c.column_name, c.num_nulls, c.num_distinct, 1/c.num_distinct selectivity, num_rows/c.num_distinct cardinality, c.histogram
from dba_tables t, dba_tab_columns c
where t.table_name = 'T1'
and c.table_name = t.table_name
and t.owner = 'HR'
and c.owner = 'HR';   2    3    4    5    6

  NUM_ROWS COLUMN_NAME                     NUM_NULLS NUM_DISTINCT SELECTIVITY CARDINALITY HISTOGRAM
---------- ------------------------------ ---------- ------------ ----------- ----------- ---------------
     10200 C1                                      0            3  .333333333        3400 FREQUENCY
     10200 C2                                                                             NONE&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;초기화&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;상수 사용하여 쿼리 실행&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'a';

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'b';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'c';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
9444k49k06853 select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;             3          1          2
9444k49k06853 select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;             0          1          1

SYS@ora19c&amp;gt; select name, child_number, value_string, last_captured
from v$sql_bind_capture
where sql_id = '9444k49k06853';  2    3

NAME                                               CHILD_NUMBER VALUE_STRING                   LAST_CAPT
-------------------------------------------------- ------------ ------------------------------ ---------
:SYS_B_0                                                      1 c                              19-FEB-26
:SYS_B_0                                                      0 a                              19-FEB-26&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;실행 계획이 2개 생김 &amp;rarr; adaptive cursor sharing 동작&lt;/li&gt;
&lt;li&gt;A분포로 먼저 조회했을 때 A 분포를 기준으로 공유 커서 생성&lt;/li&gt;
&lt;li&gt;A분포를 가지는 컬럼으로 N번 조회했을 때 B분포를 가지는 컬럼으로 N+1번째 조회하면 B의 값 분포를 기준으로 child cursor 생성&lt;/li&gt;
&lt;li&gt;위 예시에서는 c1=&amp;rsquo;a&amp;rsquo;(10000개) 조건으로 1번 조회 후 c1=&amp;rsquo;b&amp;rsquo;(100개), c1=&amp;rsquo;c&amp;rsquo;(100개) 조건으로 같은 분포를 가지는 조건으로 2번 조회함 &amp;rarr; 2번째 쿼리까지는 컬럼 값 분포에 상관 없이 첫번째 수행한 c1=&amp;rsquo;a&amp;rsquo; 조건을 기준으로 생성된 실행 계획을 공유해서 사용하다 3번째 쿼리를 c1=&amp;rsquo;c&amp;rsquo; 조건으로 수행하면서 c1=&amp;rsquo;c&amp;rsquo; 조건을 기준으로 새로운 child cursor 생성&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;실행 계획 조회&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;bind peeking 기능이 동작하여 실제 바인드 변수 값을 기준으로 실행 계획을 만들었기 때문에 예상 row수가 정확 &amp;rarr; 값 분포에 따른 적절한 실행 계획 생성됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# c1 = a 기준으로 생성된 실행 계획은 INDEX FAST FULL SCAN 으로 탐색
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('9444k49k06853', 0));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  9444k49k06853, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     5 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX | 10000 | 20000 |     5  (40)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:SYS_B_0)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# c1 = c 기준으로 생성된 실행 계획은 INDEX RANGE SCAN 으로 탐색
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('9444k49k06853', 1));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  9444k49k06853, child number 1
-------------------------------------
select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;

Plan hash value: 383751810

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |       |       |     1 (100)|          |
|   1 |  SORT AGGREGATE   |        |     1 |     2 |            |          |
|*  2 |   INDEX RANGE SCAN| T1_IDX |   100 |   200 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;=:SYS_B_0)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;초기화&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;바인드 변수 사용하여 쿼리 실행&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;실행 계획이 2개 생김 &amp;rarr; adaptive cursor sharing 동작&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; var b_id varchar2(1)
SYS@ora19c&amp;gt; exec :b_id := 'a'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; exec :b_id := 'b'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; exec :b_id := 'c'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  3          1          2
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  0          1          1

SYS@ora19c&amp;gt; select name, child_number, value_string, last_captured
from v$sql_bind_capture
where sql_id = 'gykdday3yx64c';  2    3

NAME                                               CHILD_NUMBER VALUE_STRING                   LAST_CAPT
-------------------------------------------------- ------------ ------------------------------ ---------
:B_ID                                                         1 c                              19-FEB-26
:B_ID                                                         0 a                              19-FEB-26&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;bind peeking 기능이 동작하여 실제 바인드 변수 값을 기준으로 실행 계획을 만들었기 때문에 예상 row수가 정확 &amp;rarr; 값 분포에 따른 적절한 실행 계획 생성됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# c1 = a 기준으로 생성된 실행 계획은 INDEX FAST FULL SCAN 으로 탐색
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c', 0));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     5 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX | 10000 | 20000 |     5  (40)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:B_ID)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# c1 = c 기준으로 생성된 실행 계획은 INDEX RANGE SCAN 으로 탐색
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c', 1));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 1
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 383751810

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |       |       |     1 (100)|          |
|   1 |  SORT AGGREGATE   |        |     1 |     2 |            |          |
|*  2 |   INDEX RANGE SCAN| T1_IDX |   100 |   200 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;=:B_ID)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;히든 파라미터(_optim_peek_user_binds, _optimizer_adaptive_cursor_sharing) 조회&lt;/h3&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select a.ksppinm parameter, b.ksppstvl session_value, c.ksppstvl instance_value
from x$ksppi a, x$ksppcv b, x$ksppsv c
where a.indx = b.indx
and a.indx = c.indx
and a.ksppinm in ('_optim_peek_user_binds','_optimizer_adaptive_cursor_sharing');   2    3    4    5

PARAMETER                      SESSION_VALUE                  INSTANCE_VALUE
------------------------------ ------------------------------ ------------------------------
_optimizer_adaptive_cursor_sha TRUE                           TRUE
ring

_optim_peek_user_binds         TRUE                           TRUE&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;세션 레벨에서 히든 파라미터 값 false로 변경&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter session set &quot;_optimizer_adaptive_cursor_sharing&quot;=false;

Session altered.

SYS@ora19c&amp;gt; alter session set &quot;_optim_peek_user_binds&quot;=false;

Session altered.

SYS@ora19c&amp;gt; select a.ksppinm parameter, b.ksppstvl session_value, c.ksppstvl instance_value
from x$ksppi a, x$ksppcv b, x$ksppsv c
where a.indx = b.indx
and a.indx = c.indx
and a.ksppinm in ('_optim_peek_user_binds','_optimizer_adaptive_cursor_sharing');  2    3    4    5

PARAMETER                      SESSION_VALUE                  INSTANCE_VALUE
------------------------------ ------------------------------ ------------------------------
_optimizer_adaptive_cursor_sha FALSE                          TRUE
ring

_optim_peek_user_binds         FALSE                          TRUE&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;초기화&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.

SYS@ora19c&amp;gt; select sql_id,  sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;바인드 변수 사용하여 쿼리 실행&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;현재 bind peeking 기능이 동작할 수 없으므로 컬럼 값의 분포와 상관없이 통계 정보에 따라 3400개로 예측 &amp;rarr; INDEX FAST FULL SCAN&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; var b_id varchar2(1)
SYS@ora19c&amp;gt; exec :b_id := 'a'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; exec :b_id := 'b'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; exec :b_id := 'c'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  3          1          3

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     5 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX |  3400 |  6800 |     5  (40)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:B_ID)

19 rows selected.

SYS@ora19c&amp;gt; select name, value_string, last_captured
from v$sql_bind_capture
where sql_id = 'gykdday3yx64c';  2    3

NAME                                               VALUE_STRING                   LAST_CAPT
-------------------------------------------------- ------------------------------ ---------
:B_ID                                              a                              19-FEB-26&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select t.num_rows, c.column_name, c.num_nulls, c.num_distinct, 1/c.num_distinct selectivity, num_rows/c.num_distinct cardinality, c.histogram
from dba_tables t, dba_tab_columns c
where t.table_name = 'T1'
and c.table_name = t.table_name
and t.owner = 'HR'
and c.owner = 'HR';  2    3    4    5    6

  NUM_ROWS COLUMN_NAME                     NUM_NULLS NUM_DISTINCT SELECTIVITY CARDINALITY HISTOGRAM
---------- ------------------------------ ---------- ------------ ----------- ----------- ---------------
     10200 C1                                      0            3  .333333333        3400 FREQUENCY
     10200 C2                                                                             NONE&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;상수 사용하여 쿼리 실행&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;force 옵션에서는 상수가 들어오더라도 자동으로 바인드 변수를 사용&lt;/li&gt;
&lt;li&gt;현재 bind peeking 기능이 동작할 수 없으므로 c1 = &amp;lsquo;b&amp;rsquo;인 데이터는 100개뿐이지만 통계 정보에 따라 3400개로 예측&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'b';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  3          1          3
9444k49k06853 select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;             1          1          1

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('9444k49k06853'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  9444k49k06853, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     5 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX |  3400 |  6800 |     5  (40)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:SYS_B_0)

19 rows selected.

SYS@ora19c&amp;gt; select name, value_string, last_captured
from v$sql_bind_capture
where sql_id = '9444k49k06853';  2    3

NAME                                               VALUE_STRING                   LAST_CAPT
-------------------------------------------------- ------------------------------ ---------
:SYS_B_0                                           b                              19-FEB-26&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;C1 컬럼 통계 정보 수집(히스토그램 수집 X)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;통계 정보가 수집되더라도 히스토그램이 수집되지 않으면 adaptive cursor sharing이 발생하지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 't1', method_opt=&amp;gt;'for columns size 1 c1')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select t.num_rows, c.column_name, c.num_nulls, c.num_distinct, 1/c.num_distinct selectivity, num_rows/c.num_distinct cardinality, c.histogram
from dba_tables t, dba_tab_columns c
where t.table_name = 'T1'
and c.table_name = t.table_name
and t.owner = 'HR'
and c.owner = 'HR';  2    3    4    5    6

  NUM_ROWS COLUMN_NAME                     NUM_NULLS NUM_DISTINCT SELECTIVITY CARDINALITY HISTOGRAM
---------- ------------------------------ ---------- ------------ ----------- ----------- ---------------
     10200 C1                                      0            3  .333333333        3400 NONE
     10200 C2                                                                             NONE&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;초기화&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;쿼리 실행&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'b';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'a';

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = 'c';

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
9444k49k06853 select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;             3          1          3&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;실행 계획 조회&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;수집된 통계 정보에 따라 row 수를 평균 row 수인 3400 건으로 예측 &amp;rarr; INDEX FAST FULL SCAN&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('9444k49k06853'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  9444k49k06853, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :&quot;SYS_B_0&quot;

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     5 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX |  3400 |  6800 |     5  (40)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:SYS_B_0)

19 rows selected.

SYS@ora19c&amp;gt; select name, value_string, last_captured
from v$sql_bind_capture
where sql_id = '9444k49k06853';  2    3

NAME                                               VALUE_STRING                   LAST_CAPT
-------------------------------------------------- ------------------------------ ---------
:SYS_B_0                                           b                              19-FEB-26&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;SIMILAR&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;더이상 쓰지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;초기화&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;cursor_sharing = similar로 설정&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# cursor_sharing = similar로 설정
HR@ora19c&amp;gt; alter session set cursor_sharing = similar;

Session altered.

HR@ora19c&amp;gt; select * from hr.employees where department_id = 50;
HR@ora19c&amp;gt; select * from hr.employees where department_id = 20;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;커서 및 실행 계획 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# SQL 커서 정보 조회
SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like 'select * from hr.employees where department_id%'
and sql_text not like '%v$sqlarea%'
and sql_text not like '%v$sql%';  2    3    4    5

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS
------------- -------------------------------------------------- ----------- ---------- ----------
4787hrf22agj3 select * from hr.employees where department_id = :           2          1          2
              &quot;SYS_B_0&quot;

# 실행 계획 조회
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('4787hrf22agj3'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4787hrf22agj3, child number 0
-------------------------------------
select * from hr.employees where department_id = :&quot;SYS_B_0&quot;

Plan hash value: 1445457117

-------------------------------------------------------------------------------
| Id  | Operation         | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
-------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |       |       |     2 (100)|          |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |    45 |  3105 |     2   (0)| 00:00:01 |
-------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot;=:SYS_B_0)

18 rows selected.

# 바인드 변수 정보 조회
SYS@ora19c&amp;gt; select name, value_string, last_captured
from v$sql_bind_capture
where sql_id = '4787hrf22agj3';  2    3

NAME                                               VALUE_STRING                   LAST_CAPT
-------------------------------------------------- ------------------------------ ---------
:SYS_B_0                                           50                             19-FEB-26

# sql 버전 조회
SYS@ora19c&amp;gt; select sql_id, sql_text, version_count
from v$sqlarea
where sql_text like '%hr.employees%'
and sql_text not like '%v$sqlarea%'
and sql_text not like '%v$sql%';  2    3    4    5

SQL_ID        SQL_TEXT                                           VERSION_COUNT
------------- -------------------------------------------------- -------------
4787hrf22agj3 select * from hr.employees where department_id = :             1
              &quot;SYS_B_0&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Adaptive Cursor Sharing(11g)&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Adaptive Cursor Sharing 기법을 사용하면 bind peeking에 의해 최초 실행 시점에 실행계획이 결정되더라도 이후 새로운 바인드 변수 값에 따라 실행 계획을 분화시킴(새로운 child cursor 생성)&lt;/li&gt;
&lt;li&gt;따라서 bind peeking에 의한 부작용이 없어지도록 함&lt;/li&gt;
&lt;li&gt;단 조건절에 쓰인 컬럼에 히스토그램이 있고, 히스토그램의 분포도에 따라 실행계획에 큰 차이가 있을 수 있다고 판단되는 조건이 중요&lt;/li&gt;
&lt;li&gt;bind peeking이 활성화되어 있고, 히스토그램이 수집되어 있어야 함&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;cursor_sharing 모드 조회&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; show parameter cursor_sharing

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cursor_sharing                       string      EXACT&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;히든 파라미터 조회&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;_optimizer_adaptive_cursor_sharing&lt;/code&gt; 과 &lt;code&gt;_optim_peek_user_binds&lt;/code&gt; 의 값이 모두 TRUE&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select a.ksppinm  parameter, b.ksppstvl session_value, c.ksppstvl  instance_value
from   x$ksppi a,   x$ksppcv b,   x$ksppsv c
where   a.indx = b.indx
and   a.indx = c.indx
and   a.ksppinm in ('_optim_peek_user_binds','_optimizer_adaptive_cursor_sharing');  2    3    4    5

PARAMETER                      SESSION_VALUE                  INSTANCE_VALUE
------------------------------ ------------------------------ ------------------------------
_optimizer_adaptive_cursor_sha TRUE                           TRUE
ring

_optim_peek_user_binds         TRUE                           TRUE&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;초기화&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;# shared pool flush
SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.

SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions
from v$sql
where sql_text like '%hr.t1%'
and sql_text not like '%v$sql%';  2    3    4

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;T1 테이블 컬럼 통계 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# T1 테이블 컬럼 통계 정보 조회
SYS@ora19c&amp;gt; select t.num_rows, c.column_name, c.num_nulls, c.num_distinct, 1/c.num_distinct selectivity, num_rows/c.num_distinct cardinality, c.histogram
from dba_tables t, dba_tab_columns c
where t.table_name = 'T1'
and c.table_name = t.table_name
and t.owner = 'HR'
and c.owner = 'HR';  2    3    4    5    6

  NUM_ROWS COLUMN_NAME                     NUM_NULLS NUM_DISTINCT SELECTIVITY CARDINALITY HISTOGRAM
---------- ------------------------------ ---------- ------------ ----------- ----------- ---------------
     10200 C1                                      0            3  .333333333        3400 FREQUENCY
     10200 C2                                                                             NONE&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;바인드 변수를 사용하여 쿼리 실행&lt;/h3&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;# 바인드 변수를 사용하여 쿼리 실행
SYS@ora19c&amp;gt; var b_id varchar2(1)
SYS@ora19c&amp;gt; exec :b_id := 'a'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; exec :b_id := 'b'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; exec :b_id := 'c'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
       100&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# SQL 커서 정보 조회
SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions, is_bind_sensitive, is_bind_aware
from v$sql
where sql_text like '%hr.t1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS I I
------------- -------------------------------------------------- ----------- ---------- ---------- - -
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  3          1          2 Y N
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  0          1          1 Y Y

SYS@ora19c&amp;gt; select child_number, name, value_string from v$sql_bind_capture where sql_id = 'gykdday3yx64c';

CHILD_NUMBER NAME                                               VALUE_STRING
------------ -------------------------------------------------- ------------------------------
           1 :B_ID                                              c
           0 :B_ID                                              a
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;is_bind_sensitive&lt;/code&gt; : bind 값에 민감한 cursor라는 의미, 바인드 변수 값이 바뀌면 그것을 민감하게 처리하겠다는 의미(YES/NO)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;is_bind_aware&lt;/code&gt; : 바인드 변수 값에 따라 child cursor를 생성(YES/NO)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# 바인드 변수 값이 a인 경우에는 INDEX FAST FULL SCAN
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c', 0));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     5 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX | 10000 | 20000 |     5  (40)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:B_ID)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# 바인드 변수 값이 c인 경우에는 INDEX RANGE SCAN
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c', 1));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 1
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 383751810

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |       |       |     1 (100)|          |
|   1 |  SORT AGGREGATE   |        |     1 |     2 |            |          |
|*  2 |   INDEX RANGE SCAN| T1_IDX |   100 |   200 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;=:B_ID)

19 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# SQL 버전 조회
SYS@ora19c&amp;gt; select sql_id, sql_text, version_count
from v$sqlarea
where sql_text like '%select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sqlarea%'
and sql_text not like '%v$sql%';  2    3    4    5

SQL_ID        SQL_TEXT                                           VERSION_COUNT
------------- -------------------------------------------------- -------------
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                    2&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# child cursor 가 생성된 이유 조회
SYS@ora19c&amp;gt; select sql_id, child_number, bind_equiv_failure from v$sql_shared_cursor where sql_id = 'gykdday3yx64c';

SQL_ID        CHILD_NUMBER B
------------- ------------ -
gykdday3yx64c            0 N
gykdday3yx64c            1 Y&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;초기화&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 테이블 삭제
SYS@ora19c&amp;gt; drop table hr.t1 purge;

Table dropped.

# 테이블 생성
SYS@ora19c&amp;gt; create table hr.t1(c1 varchar2(1), c2 number) tablespace users;

Table created.

# 데이터 입력
SYS@ora19c&amp;gt; insert into hr.t1(c1, c2)
select 'a', level from dual connect by level &amp;lt;= 10000
union all
select 'b', level from dual connect by level &amp;lt;= 10000
union all
select 'c', level from dual connect by level &amp;lt;= 100
union all
select 'd', level from dual connect by level &amp;lt;= 90;   2    3    4    5    6    7    8

20190 rows created.

SYS@ora19c&amp;gt; commit;

Commit complete.

SYS@ora19c&amp;gt; select c1, count(*) from hr.t1 group by c1;

C   COUNT(*)
- ----------
b      10000
c        100
a      10000
d         90

#히스토그램 생성
exec dbms_stats.gather_table_stats('hr', 't1', method_opt=&amp;gt;'for all columns size 4')&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;바인드 변수를 사용하여 쿼리 실행&lt;/h3&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;# 바인드 변수를 사용하여 쿼리 실행
SYS@ora19c&amp;gt; var b_id varchar2(1)
SYS@ora19c&amp;gt; exec :b_id := 'a'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; exec :b_id := 'b'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
     10000

SYS@ora19c&amp;gt; exec :b_id := 'c'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
       100

SYS@ora19c&amp;gt; exec :b_id := 'd'

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select count(*) from hr.t1 where c1 = :b_id;

  COUNT(*)
----------
        90&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;child cursor가 여러 개 생성됨&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;같은 바인드 변수 값을 사용하는 경우에도 child cursor가 생김&lt;/li&gt;
&lt;li&gt;같은 데이터 분포를 가지고 있는 경우에도 child cursor가 생김&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select sql_id, sql_text, parse_calls, loads, executions, is_bind_sensitive, is_bind_aware
from v$sql
where sql_text like '%hr.t1%'
and sql_text not like '%v$sql%';  2    3    4

SQL_ID        SQL_TEXT                                           PARSE_CALLS      LOADS EXECUTIONS I I
------------- -------------------------------------------------- ----------- ---------- ---------- - -
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  5          1          4 Y N
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  2          1          2 Y Y
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  1          1          1 Y Y
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                  0          1          1 Y Y

select child_number, name, value_string from v$sql_bind_capture where sql_id = 'gykdday3yx64c';

select child_number, name, value_string from v$sql_bind_capture where sql_id = 'gykdday3yx64c';

SYS@ora19c&amp;gt; select child_number, name, value_string from v$sql_bind_capture where sql_id = 'gykdday3yx64c';

CHILD_NUMBER NAME                                               VALUE_STRING
------------ -------------------------------------------------- ------------------------------
           3 :B_ID                                              d
           2 :B_ID                                              c
           1 :B_ID                                              a
           0 :B_ID                                              a

SYS@ora19c&amp;gt; select sql_id, sql_text, version_count
from v$sqlarea
where sql_text like '%select count(*) from hr.t1 where c1%'
and sql_text not like '%v$sqlarea%'
and sql_text not like '%v$sql%';  2    3    4    5

SQL_ID        SQL_TEXT                                           VERSION_COUNT
------------- -------------------------------------------------- -------------
gykdday3yx64c select count(*) from hr.t1 where c1 = :b_id                    4&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c', 0));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 0
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     8 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX | 10000 | 20000 |     8  (50)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:B_ID)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c', 1));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 1
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 1447436376

--------------------------------------------------------------------------------
| Id  | Operation             | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |        |       |       |     8 (100)|          |
|   1 |  SORT AGGREGATE       |        |     1 |     2 |            |          |
|*  2 |   INDEX FAST FULL SCAN| T1_IDX | 10000 | 20000 |     8  (50)| 00:00:01 |
--------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(&quot;C1&quot;=:B_ID)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c', 2));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 2
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 383751810

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |       |       |     1 (100)|          |
|   1 |  SORT AGGREGATE   |        |     1 |     2 |            |          |
|*  2 |   INDEX RANGE SCAN| T1_IDX |   100 |   200 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;=:B_ID)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor('gykdday3yx64c', 3));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gykdday3yx64c, child number 3
-------------------------------------
select count(*) from hr.t1 where c1 = :b_id

Plan hash value: 383751810

----------------------------------------------------------------------------
| Id  | Operation         | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |        |       |       |     1 (100)|          |
|   1 |  SORT AGGREGATE   |        |     1 |     2 |            |          |
|*  2 |   INDEX RANGE SCAN| T1_IDX |    90 |   180 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;=:B_ID)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;실제 실행 계획 조회&lt;/h3&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.t1
where c1 = 'a';

select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));
SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7jfjxky68kc1u, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.t1 where c1 = 'a'

Plan hash value: 3617692013

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |  10000 |00:00:00.01 |     704 |
|*  1 |  TABLE ACCESS FULL| T1   |      1 |  10000 |  10000 |00:00:00.01 |     704 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;C1&quot;='a')

18 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;array size 증가&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;smali&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select blocks from dba_segments where owner = 'HR' and segment_name = 'T1';

    BLOCKS
----------
        40

SYS@ora19c&amp;gt; select 10000/15 from dual;

  10000/15
----------
666.666667

SYS@ora19c&amp;gt; show array
arraysize 15

SYS@ora19c&amp;gt; set array 1000
SYS@ora19c&amp;gt; show array
arraysize 1000&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;c1 = a or b 인 경우에는 table full scan&lt;/li&gt;
&lt;li&gt;c1 = c or d인 경우에는 index range scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.t1
where c1 = 'a';

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7jfjxky68kc1u, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.t1 where c1 = 'a'

Plan hash value: 3617692013

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |  10000 |00:00:00.01 |      47 |
|*  1 |  TABLE ACCESS FULL| T1   |      1 |  10000 |  10000 |00:00:00.01 |      47 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;C1&quot;='a')&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.t1
where c1 = 'c';

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  95j92gsm9gshj, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.t1 where c1 = 'c'

Plan hash value: 1775246573

--------------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name   | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |        |      1 |        |    100 |00:00:00.01 |       5 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| T1     |      1 |    100 |    100 |00:00:00.01 |       5 |
|*  2 |   INDEX RANGE SCAN                  | T1_IDX |      1 |    100 |    100 |00:00:00.01 |       3 |
--------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;='c')

19 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.t1
where c1 = 'b';

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7gdb92jg2jhx1, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.t1 where c1 = 'b'

Plan hash value: 3617692013

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |  10000 |00:00:00.01 |      47 |
|*  1 |  TABLE ACCESS FULL| T1   |      1 |  10000 |  10000 |00:00:00.01 |      47 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;C1&quot;='b')

18 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.t1
where c1 = 'd';

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  fnm59sgnuxj7y, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.t1 where c1 = 'd'

Plan hash value: 1775246573

--------------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name   | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |        |      1 |        |     90 |00:00:00.01 |       5 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| T1     |      1 |     90 |     90 |00:00:00.01 |       5 |
|*  2 |   INDEX RANGE SCAN                  | T1_IDX |      1 |     90 |     90 |00:00:00.01 |       3 |
--------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;C1&quot;='d')

19 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;컬럼 값 분포에 따라 쿼리 분기&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; var b_c1 varchar2(1)
SYS@ora19c&amp;gt; exec :b_c1 := 'a'

PL/SQL procedure successfully completed.

select /*+ gather_plan_statistics full(t) */ *
from hr.t1 t
where c1 = :b_c1
and :b_c1 in ('a', 'b')
union all
select /*+ index(t t1_idx) */ *
from hr.t1 t
where c1 = :b_c1
and :b_c1 in ('c', 'd');

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  03puusx7xtwns, child number 0
-------------------------------------
select /*+ gather_plan_statistics full(t) */ * from hr.t1 t where c1 =
:b_c1 and :b_c1 in ('a', 'b') union all select /*+ index(t t1_idx) */ *
from hr.t1 t where c1 = :b_c1 and :b_c1 in ('c', 'd')

Plan hash value: 1917977112

----------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name   | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
----------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |        |      1 |        |  10000 |00:00:00.01 |      47 |
|   1 |  UNION-ALL                            |        |      1 |        |  10000 |00:00:00.01 |      47 |
|*  2 |   FILTER                              |        |      1 |        |  10000 |00:00:00.01 |      47 |
|*  3 |    TABLE ACCESS FULL                  | T1     |      1 |  10000 |  10000 |00:00:00.01 |      47 |
|*  4 |   FILTER                              |        |      1 |        |      0 |00:00:00.01 |       0 |
|   5 |    TABLE ACCESS BY INDEX ROWID BATCHED| T1     |      0 |  10000 |      0 |00:00:00.01 |       0 |
|*  6 |     INDEX RANGE SCAN                  | T1_IDX |      0 |  10000 |      0 |00:00:00.01 |       0 |
----------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter((:B_C1='a' OR :B_C1='b'))
   3 - filter(&quot;C1&quot;=:B_C1)
   4 - filter((:B_C1='c' OR :B_C1='d'))
   6 - access(&quot;C1&quot;=:B_C1)

28 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec :b_c1 := 'c'

PL/SQL procedure successfully completed.

select /*+ gather_plan_statistics full(t) */ *
from hr.t1 t
where c1 = :b_c1
and :b_c1 in ('a', 'b')
union all
select /*+ index(t t1_idx) */ *
from hr.t1 t
where c1 = :b_c1
and :b_c1 in ('c', 'd');

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  03puusx7xtwns, child number 0
-------------------------------------
select /*+ gather_plan_statistics full(t) */ * from hr.t1 t where c1 =
:b_c1 and :b_c1 in ('a', 'b') union all select /*+ index(t t1_idx) */ *
from hr.t1 t where c1 = :b_c1 and :b_c1 in ('c', 'd')

Plan hash value: 1917977112

----------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name   | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
----------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |        |      1 |        |    100 |00:00:00.01 |       5 |
|   1 |  UNION-ALL                            |        |      1 |        |    100 |00:00:00.01 |       5 |
|*  2 |   FILTER                              |        |      1 |        |      0 |00:00:00.01 |       0 |
|*  3 |    TABLE ACCESS FULL                  | T1     |      0 |  10000 |      0 |00:00:00.01 |       0 |
|*  4 |   FILTER                              |        |      1 |        |    100 |00:00:00.01 |       5 |
|   5 |    TABLE ACCESS BY INDEX ROWID BATCHED| T1     |      1 |  10000 |    100 |00:00:00.01 |       5 |
|*  6 |     INDEX RANGE SCAN                  | T1_IDX |      1 |  10000 |    100 |00:00:00.01 |       3 |
----------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter((:B_C1='a' OR :B_C1='b'))
   3 - filter(&quot;C1&quot;=:B_C1)
   4 - filter((:B_C1='c' OR :B_C1='d'))
   6 - access(&quot;C1&quot;=:B_C1)

28 rows selected.&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <category>튜닝</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/234</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260219-TIL#entry234comment</comments>
      <pubDate>Sun, 15 Mar 2026 22:43:43 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260213 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260213-TIL</link>
      <description>&lt;h1&gt;OPTIMIZER(Optimization(SQL문 최적화))&lt;/h1&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://docs.oracle.com/en/database/oracle/oracle-database/19/tgsql/sql-processing.html&quot;&gt;https://docs.oracle.com/en/database/oracle/oracle-database/19/tgsql/sql-processing.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;338&quot; data-origin-height=&quot;558&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/x4SW5/dJMcaiCyJIn/Nc9hKN5iIE0hfJkG0G1MK1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/x4SW5/dJMcaiCyJIn/Nc9hKN5iIE0hfJkG0G1MK1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/x4SW5/dJMcaiCyJIn/Nc9hKN5iIE0hfJkG0G1MK1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fx4SW5%2FdJMcaiCyJIn%2FNc9hKN5iIE0hfJkG0G1MK1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;338&quot; height=&quot;558&quot; data-origin-width=&quot;338&quot; data-origin-height=&quot;558&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;옵티마이저는 SQL문 성능을 최적화하는 것&lt;/li&gt;
&lt;li&gt;옵티마이저는 SQL문에 대한 가장 적합한 실행계획을 생성하려고 함&lt;/li&gt;
&lt;li&gt;가장 적합한 실행계획은 고려되는 모든 후보 계획 중에 비용이 가장 낮은 계획으로 정의&lt;/li&gt;
&lt;li&gt;사용자가 요청한 SQL문을 가장 효율적이고 빠르게 수행할 수 있는 최저 비용의 처리 경로를 선택해주는 엔진(프로그램)&lt;/li&gt;
&lt;li&gt;실행계획을 생성하는 엔진
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;데이터 처리 방법&lt;/li&gt;
&lt;li&gt;조인 방법&lt;/li&gt;
&lt;li&gt;조인 순서&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;RBO(Rule Based Optimization)&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;미리 정해져 있는 규칙에 의한 순위에 따라 실행계획 결정(순위 결정 방식)&lt;/li&gt;
&lt;li&gt;데이터에 대한 통계 내지는 실제 SQL문을 수행할 경우 소요될 비용에 대해 고려하지 않음&lt;/li&gt;
&lt;li&gt;조건절 컬럼에 인덱스가 있으면 무조건 인덱스 사용&lt;/li&gt;
&lt;li&gt;order by 절에 사용된 컬럼에 인덱스가 있으면 무조건 인덱스 사용&lt;/li&gt;
&lt;li&gt;부등호 조건의 인덱스보다 between and 조건의 인덱스를 우선으로 사용&lt;/li&gt;
&lt;li&gt;10g부터 지원 중단&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;CBO(Cost Based Optimization)&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;oracle 7부터 지원&lt;/li&gt;
&lt;li&gt;cost를 기반으로 SQL문 최적화 수행&lt;/li&gt;
&lt;li&gt;실제 SQL문을 수행할 때 소요될 비용을 예측하고 그 값을 기준으로 실행계획을 설정&lt;/li&gt;
&lt;li&gt;OBJECT 통계
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;테이블 통계(sys.tab$, dba_tables, dba_tab_statistics)&lt;/li&gt;
&lt;li&gt;컬럼 통계(sys.col$, dba_tab_columns, dba_tab_col_statistics)&lt;/li&gt;
&lt;li&gt;인덱스 통계(sys.ind$, dba_indexes, dba_ind_statistics)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;SYSTEM 통계(sys.aux_stats$)
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;CPU 속도&lt;/li&gt;
&lt;li&gt;디스크 I/O&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;SYSTEM 통계&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;9i부터 하드웨어 및 애플리케이션 특성에 맞는 시스템 통계를 수집하고 활용&lt;/li&gt;
&lt;li&gt;I/O, CPU 성능 같은 하드웨어 특성
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;CPU 속도&lt;/li&gt;
&lt;li&gt;평균적인 single block I/O 속도, multiblock I/O 속도&lt;/li&gt;
&lt;li&gt;평균적인 multiblock I/O 개수&lt;/li&gt;
&lt;li&gt;I/O 서브 시스템의 최대 처리량&lt;/li&gt;
&lt;li&gt;병렬 slave의 평균적 처리량&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from sys.aux_stats$;

SNAME                          PNAME                            PVAL1 PVAL2
------------------------------ ------------------------------ ------- ------------------------------
SYSSTATS_INFO                  STATUS                                 COMPLETED
SYSSTATS_INFO                  DSTART                                 04-17-2019 02:06
SYSSTATS_INFO                  DSTOP                                  04-17-2019 02:06
SYSSTATS_INFO                  FLAGS                               1.
SYSSTATS_MAIN                  CPUSPEEDNW                       3107.
SYSSTATS_MAIN                  IOSEEKTIM                          10.
SYSSTATS_MAIN                  IOTFRSPEED                       4096.
SYSSTATS_MAIN                  SREADTIM
SYSSTATS_MAIN                  MREADTIM
SYSSTATS_MAIN                  CPUSPEED
SYSSTATS_MAIN                  MBRC
SYSSTATS_MAIN                  MAXTHR
SYSSTATS_MAIN                  SLAVETHR

13 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Noworkload 시스템 통계(10g)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;시스템 통계 수집을 하지 않더라도 CPU 비용 모델을 사용할 수 있도록 하기 위해서 오라클이 내부적으로 시스템 통계 설정&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CPUSPEEDNW&lt;/code&gt; : cpu 속도(백만/초)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IOSEEKTIM&lt;/code&gt; : 데이터를 읽으려고 디스크 헤드를 옮기는데 걸리는 시간(5~15ms)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IOTFRSPEED&lt;/code&gt; : OS 프로세스 I/O 서브 시스템으로부터 데이터를 읽는 속도(byte/ms)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Worklaod 시스템 통계(9i)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;실제 애플리케이션에서 발생하는 부하를 측정한 값&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SREADTIM&lt;/code&gt; : 평균적 single block I/O 속도(ms)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MREADTIM&lt;/code&gt; : 평균적 multi block I/O 속도(ms)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CPUSPEED&lt;/code&gt; : 단일 cpu가 초당 수행할 수 있는 오퍼레이션 수(백만/초)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MBRC&lt;/code&gt; : multi block I/O 발생 시 평균적으로 읽은 블록 수&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MAXTHR&lt;/code&gt; : I/O 서브 시스템의 초당 최대 처리량(byte/초)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SLAVETHR&lt;/code&gt; : 병렬 slave의 평균적인 초당 처리량(byte/초)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Workload 시스템 통계 수집&lt;/h3&gt;
&lt;pre class=&quot;smali&quot;&gt;&lt;code&gt;# 120분동안 wokload 시스템 통계 수집
execute dbms_stats.gather_system_stats(gathering_mode=&amp;gt;'interval', interval=&amp;gt;120)

# 시작 ~ 종료
execute dbms_stats.gather_system_stats(gathering_mode=&amp;gt;'start')
execute dbms_stats.gather_system_stats(gathering_mode=&amp;gt;'stop')&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; execute dbms_stats.gather_system_stats(gathering_mode=&amp;gt;'start')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; execute dbms_stats.gather_system_stats(gathering_mode=&amp;gt;'stop')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select * from sys.aux_stats$;

SNAME                          PNAME                            PVAL1 PVAL2
------------------------------ ------------------------------ ------- ------------------------------
SYSSTATS_INFO                  STATUS                                 COMPLETED
SYSSTATS_INFO                  DSTART                                 02-13-2026 11:49
SYSSTATS_INFO                  DSTOP                                  02-13-2026 11:49
SYSSTATS_INFO                  FLAGS                               1.
SYSSTATS_MAIN                  CPUSPEEDNW                       3107.
SYSSTATS_MAIN                  IOSEEKTIM                          10.
SYSSTATS_MAIN                  IOTFRSPEED                       4096.
SYSSTATS_MAIN                  SREADTIM                            0.
SYSSTATS_MAIN                  MREADTIM
SYSSTATS_MAIN                  CPUSPEED                         2008.
SYSSTATS_MAIN                  MBRC
SYSSTATS_MAIN                  MAXTHR
SYSSTATS_MAIN                  SLAVETHR

13 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Noworkload 시스템 통계 수집&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;execute dbms_stats.gather_system_stats(gathering_mode=&amp;gt;'noworkload')&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; execute dbms_stats.gather_system_stats(gathering_mode=&amp;gt;'noworkload')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select * from sys.aux_stats$;

SNAME                          PNAME                            PVAL1 PVAL2
------------------------------ ------------------------------ ------- ------------------------------
SYSSTATS_INFO                  STATUS                                 COMPLETED
SYSSTATS_INFO                  DSTART                                 02-13-2026 11:53
SYSSTATS_INFO                  DSTOP                                  02-13-2026 11:53
SYSSTATS_INFO                  FLAGS                               1.
SYSSTATS_MAIN                  CPUSPEEDNW                       2007.
SYSSTATS_MAIN                  IOSEEKTIM                           1.
SYSSTATS_MAIN                  IOTFRSPEED                       4096.
SYSSTATS_MAIN                  SREADTIM
SYSSTATS_MAIN                  MREADTIM
SYSSTATS_MAIN                  CPUSPEED
SYSSTATS_MAIN                  MBRC
SYSSTATS_MAIN                  MAXTHR
SYSSTATS_MAIN                  SLAVETHR

13 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;테스트 데이터베이스 시스템 통계 정보를 운영 시스템 통계 정보로 반영&lt;/h3&gt;
&lt;pre class=&quot;less&quot;&gt;&lt;code&gt;begin
    dbms_stats.set_system_stats('SREADTIM', 1.2);
    dbms_stats.set_system_stats('MREADTIM', 1.3);
    dbms_stats.set_system_stats('MBRC', 16);
    dbms_stats.set_system_stats('CPUSPEED', 700);
    dbms_stats.set_system_stats('MAXTHR', 40580544);   
    dbms_stats.set_system_stats('SLAVETHR', 32224);   
end;
/&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from sys.aux_stats$;

SNAME                          PNAME                                PVAL1 PVAL2
------------------------------ ------------------------------ ----------- ------------------------------
SYSSTATS_INFO                  STATUS                                     COMPLETED
SYSSTATS_INFO                  DSTART                                     02-13-2026 11:56
SYSSTATS_INFO                  DSTOP                                      02-13-2026 11:56
SYSSTATS_INFO                  FLAGS                                    1
SYSSTATS_MAIN                  CPUSPEEDNW                            2007
SYSSTATS_MAIN                  IOSEEKTIM                                1
SYSSTATS_MAIN                  IOTFRSPEED                            4096
SYSSTATS_MAIN                  SREADTIM                                 1
SYSSTATS_MAIN                  MREADTIM                                 1
SYSSTATS_MAIN                  CPUSPEED                               700
SYSSTATS_MAIN                  MBRC                                    16
SYSSTATS_MAIN                  MAXTHR                            40580544
SYSSTATS_MAIN                  SLAVETHR                             32224

13 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Optimizer Mode&lt;/h2&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; show parameter optimizer_mode

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
optimizer_mode                       string      ALL_ROWS&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;all_rows&lt;/code&gt; : 전체 처리율의 최적화(best throughput(단위 시간 동안 완료된 작업량)), batch 성 업무가 있는 환경, dss(의사결정시스템), 10g(기본값)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;first_rows&lt;/code&gt; : 최초 응답 시간 최적화(best response time(작업 단위를 완료하는 데 필요한 시간)), OLTP 환경&lt;/li&gt;
&lt;li&gt;&lt;code&gt;first_rows_n&lt;/code&gt;(n : 1, 10, 100, 1000) : 처음 결과가 나올 때까지의 시간을 줄이기 위해 최적화(best response time(작업 단위를 완료하는 데 필요한 시간)), OLTP 환경&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rule&lt;/code&gt; : 통계 정보와 상관 없이 RBO 사용&lt;/li&gt;
&lt;li&gt;&lt;code&gt;choose&lt;/code&gt; : 통계 정보가 있으면 all_rows, 없으면 rule&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;# 시스템 레벨에서 optimizer_mode 변경
alter system set optimizer_mode = first_rows;

# 세션 레벨에서 optimizer_mode 변경
alter session set optimizer_mode = first_rows;

# 힌트로 optimizer_mode 변경
select /*+ gather_plan_statistics first_rows(10) */ * from hr.employees where department_id = 50;&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;first_rows(10) 실행 계획 &amp;rArr; Index Range Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8t9bvnp2z02k9, child number 0
-------------------------------------
select /*+ gather_plan_statistics first_rows(10) */ * from hr.employees
where department_id = 50

Plan hash value: 235881476

-------------------------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |                   |      1 |        |     45 |00:00:00.01 |      10 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |     10 |     45 |00:00:00.01 |      10 |
|*  2 |   INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |        |     45 |00:00:00.01 |       4 |
-------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;DEPARTMENT_ID&quot;=50)

20 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;first_rows(45) 실행 계획 &amp;rArr; Table Full Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  3cr3t6jfqg8b4, child number 0
-------------------------------------
select /*+ gather_plan_statistics first_rows(45) */ * from hr.employees
where department_id = 50

Plan hash value: 1445457117

-----------------------------------------------------------------------------------------
| Id  | Operation         | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |      1 |        |     45 |00:00:00.01 |      10 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |      1 |     45 |     45 |00:00:00.01 |      10 |
-----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot;=50)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Optimizer에게 영향을 주는 요소&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;오라클 버전&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from v$version;

BANNER                                             BANNER_FULL                                        BANNER_LEGACY                                      CON_ID
-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ----------
Oracle Database 19c Enterprise Edition Release 19. Oracle Database 19c Enterprise Edition Release 19. Oracle Database 19c Enterprise Edition Release 19.       0
0.0.0.0 - Production                               0.0.0.0 - Production                               0.0.0.0 - Production
                                                   Version 19.3.0.0.0&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;옵티마이저 버전&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; show parameter optimizer_features_enable

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
optimizer_features_enable            string      19.1.0&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;옵티마이저 관련 파라미터&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;n1ql&quot;&gt;&lt;code&gt;select * from v$sys_optimizer_env;&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;통계정보&lt;/li&gt;
&lt;li&gt;힌트&lt;/li&gt;
&lt;li&gt;SQL문에서 사용되는 연산자&lt;/li&gt;
&lt;li&gt;인덱스 설계&lt;/li&gt;
&lt;li&gt;제약조건&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Optimizer Components&lt;/h2&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;452&quot; data-origin-height=&quot;354&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cFeQaC/dJMcacvCJMu/cyJmbAF4daks91mbdrjjDk/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cFeQaC/dJMcacvCJMu/cyJmbAF4daks91mbdrjjDk/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cFeQaC/dJMcacvCJMu/cyJmbAF4daks91mbdrjjDk/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcFeQaC%2FdJMcacvCJMu%2FcyJmbAF4daks91mbdrjjDk%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;452&quot; height=&quot;354&quot; data-origin-width=&quot;452&quot; data-origin-height=&quot;354&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;b&gt;Query Transformer&lt;/b&gt; : SQL문을 최적화 하기 쉬운 형태로 변환&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Estimator&lt;/b&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;selectivity : 전체 대상 행 중에 특정한 조건에 의해 선택될 것으로 예상되는 행 비율&lt;/li&gt;
&lt;li&gt;cardinality : 특정 액세스 단계를 거치고 나서 출력 될 것으로 예상되는 결과 건수&lt;br /&gt;(총 행의 수 * selectivity = num_rows/num_distinct)&lt;/li&gt;
&lt;li&gt;cost : 특정 명령문을 실행하는데 필요한 표준화된 I/O에 대한 옵티마이저의 최적 예측 비용&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Plan Generator&lt;/b&gt; : 후보군이 될만한 실행계획들을 생성
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;_optimizer_cost_model&lt;/code&gt; = io(8i) | cpu(10g) | choose(기본값)&lt;/li&gt;
&lt;li&gt;choose : 시스템 통계가 있으면 CPU 비용, 없으면 I/O 비용&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select  a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_optimizer_cost_model';  2    3    4

PARAMETER                      VALUE
------------------------------ ------------------------------
_optimizer_cost_model          CHOOSE&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Row Source Generation&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;옵티마이저에서 최적 실행계획을 수신하고 SQL문에 대한 실행계획을 출력하는 소프트웨어&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Dynamic Sampling&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;통계 정보가 있는 경우&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;drop table hr.emp purge;

# ctas를 수행하면 통계 수집이 자동적으로 수행됨
create table hr.emp tablespace users as select * from hr.employees;

# 테이블 통계 정보 조회
select t.num_rows, c.column_name, c.num_nulls, c.num_distinct, 1/c.num_distinct selectivity, num_rows/c.num_distinct cardinality, c.histogram
from dba_tables t, dba_tab_columns c
where t.table_name = 'EMP'
and c.table_name = t.table_name
and t.owner = 'HR'
and c.owner = 'HR';

  NUM_ROWS COLUMN_NAME                     NUM_NULLS NUM_DISTINCT SELECTIVITY CARDINALITY HISTOGRAM
---------- ------------------------------ ---------- ------------ ----------- ----------- ---------------
       107 EMPLOYEE_ID                             0          107  .009345794           1 NONE
       107 FIRST_NAME                              0           91  .010989011  1.17582418 NONE
       107 LAST_NAME                               0          102  .009803922  1.04901961 NONE
       107 EMAIL                                   0          107  .009345794           1 NONE
       107 PHONE_NUMBER                            0          107  .009345794           1 NONE
       107 HIRE_DATE                               0           98  .010204082  1.09183673 NONE
       107 JOB_ID                                  0           19  .052631579  5.63157895 NONE
       107 SALARY                                  0           58  .017241379  1.84482759 NONE
       107 COMMISSION_PCT                         72            7  .142857143  15.2857143 NONE
       107 MANAGER_ID                              1           18  .055555556  5.94444444 NONE
       107 DEPARTMENT_ID                           1           11  .090909091  9.72727273 NONE

11 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;employee_id에 대한 cardinality가 1이므로 예측 row 수도 1개이고, 실제 row 수도 1개&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics*/ * from hr.emp where employee_id = 100;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        100 Steven               King                      SKING                     515.123.4567         17-JUN-03 AD_PRES      24000                                      90

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4k79fh4g6kxtg, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where employee_id =
100

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |      1 |00:00:00.01 |       4 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |      1 |      1 |00:00:00.01 |       4 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;EMPLOYEE_ID&quot;=100)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;department_id에 대한 cardinality가 9.7이므로 예측 row 수는 10개이지만 실제 row 수는 1개&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics*/ * from hr.emp where department_id = 10;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        200 Jennifer             Whalen                    JWHALEN                   515.123.4444         17-SEP-03 AD_ASST       4840                       101            10

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  3twp7hky51y57, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where department_id =
10

Plan hash value: 3956160932

---------------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
---------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |      1 |00:00:00.01 |       4 |      2 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |     10 |      1 |00:00:00.01 |       4 |      2 |
---------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot;=10)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;department_id에 대한 cardinality가 9.7이므로 예측 row 수는 10개이지만 실제 row 수는 45개&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics*/ * from hr.emp where department_id = 50;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        120 Matthew              Weiss                     MWEISS                    650.123.1234         18-JUL-04 ST_MAN        8000                       100            50
        121 Adam                 Fripp                     AFRIPP                    650.123.2234         10-APR-05 ST_MAN        8200                       100            50
        122 Payam                Kaufling                  PKAUFLIN                  650.123.3234         01-MAY-03 ST_MAN        7900                       100            50
        123 Shanta               Vollman                   SVOLLMAN                  650.123.4234         10-OCT-05 ST_MAN        6500                       100            50
                ...

45 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  0n5jfjt38z0c7, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where department_id =
50

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |     45 |00:00:00.01 |       6 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |     10 |     45 |00:00:00.01 |       6 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot;=50)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;예측 row 수는 통계 정보에 기반하기 때문에 정확하지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;통계 정보 삭제&lt;/h3&gt;
&lt;pre class=&quot;bash&quot;&gt;&lt;code&gt;exec dbms_stats.delete_table_stats('hr','emp')&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select t.num_rows, c.column_name, c.num_nulls, c.num_distinct, 1/c.num_distinct selectivity, num_rows/c.num_distinct cardinality, c.histogram
from dba_tables t, dba_tab_columns c
where t.table_name = 'EMP'
and c.table_name = t.table_name
and t.owner = 'HR'
and c.owner = 'HR';  2    3    4    5    6

  NUM_ROWS COLUMN_NAME                     NUM_NULLS NUM_DISTINCT SELECTIVITY CARDINALITY HISTOGRAM
---------- ------------------------------ ---------- ------------ ----------- ----------- ---------------
           EMPLOYEE_ID                                                                    NONE
           FIRST_NAME                                                                     NONE
           LAST_NAME                                                                      NONE
           EMAIL                                                                          NONE
           PHONE_NUMBER                                                                   NONE
           HIRE_DATE                                                                      NONE
           JOB_ID                                                                         NONE
           SALARY                                                                         NONE
           COMMISSION_PCT                                                                 NONE
           MANAGER_ID                                                                     NONE
           DEPARTMENT_ID                                                                  NONE

11 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4k79fh4g6kxtg, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where employee_id =
100

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |      1 |00:00:00.01 |       4 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |      1 |      1 |00:00:00.01 |       4 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;EMPLOYEE_ID&quot;=100)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  3twp7hky51y57, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where department_id =
10

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |      1 |00:00:00.01 |       4 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |     10 |      1 |00:00:00.01 |       4 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot;=10)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  0n5jfjt38z0c7, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where department_id =
50

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |     45 |00:00:00.01 |       6 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |     10 |     45 |00:00:00.01 |       6 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot;=50)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2krmqchjudat0, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where job_id =
'IT_PROG'

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |      5 |00:00:00.01 |       5 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |      5 |      5 |00:00:00.01 |       5 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;JOB_ID&quot;='IT_PROG')

Note
-----
   - dynamic statistics used: dynamic sampling (level=2)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;통계 정보가 없을 경우 오라클은 dynamic sampling을 이용해서 테이블에 통계 수집한 후 실행계획을 만들고 수집한 통계는 지움&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;통계 수집&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 'emp', method_opt=&amp;gt;'for all columns size 1')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select t.num_rows, c.column_name, c.num_nulls, c.num_distinct, 1/c.num_distinct selectivity, num_rows/c.num_distinct cardinality, c.histogram
from dba_tables t, dba_tab_columns c
where t.table_name = 'EMP'
and c.table_name = t.table_name
and t.owner = 'HR'
and c.owner = 'HR';  2    3    4    5    6

  NUM_ROWS COLUMN_NAME                     NUM_NULLS NUM_DISTINCT SELECTIVITY CARDINALITY HISTOGRAM
---------- ------------------------------ ---------- ------------ ----------- ----------- ---------------
       107 EMPLOYEE_ID                             0          107  .009345794           1 NONE
       107 FIRST_NAME                              0           91  .010989011  1.17582418 NONE
       107 LAST_NAME                               0          102  .009803922  1.04901961 NONE
       107 EMAIL                                   0          107  .009345794           1 NONE
       107 PHONE_NUMBER                            0          107  .009345794           1 NONE
       107 HIRE_DATE                               0           98  .010204082  1.09183673 NONE
       107 JOB_ID                                  0           19  .052631579  5.63157895 NONE
       107 SALARY                                  0           58  .017241379  1.84482759 NONE
       107 COMMISSION_PCT                         72            7  .142857143  15.2857143 NONE
       107 MANAGER_ID                              1           18  .055555556  5.94444444 NONE
       107 DEPARTMENT_ID                           1           11  .090909091  9.72727273 NONE

11 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter system flush shared_pool;

System altered.

SYS@ora19c&amp;gt; select /*+ gather_plan_statistics*/ * from hr.emp where job_id = 'IT_PROG';

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG       9000                       102            60
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG       4800                       103            60
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG       4800                       103            60
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG       4200                       103            60

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2krmqchjudat0, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where job_id =
'IT_PROG'

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |      5 |00:00:00.01 |       4 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |      6 |      5 |00:00:00.01 |       4 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;JOB_ID&quot;='IT_PROG')

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics*/ * from hr.emp where job_id = 'SA_REP';

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        150 Peter                Tucker                    PTUCKER                   011.44.1344.129268   30-JAN-05 SA_REP       10000             .3        145            80
        151 David                Bernstein                 DBERNSTE                  011.44.1344.345268   24-MAR-05 SA_REP        9500            .25        145            80
        152 Peter                Hall                      PHALL                     011.44.1344.478968   20-AUG-05 SA_REP        9000            .25        145            80
        153 Christopher          Olsen                     COLSEN                    011.44.1344.498718   30-MAR-06 SA_REP        8000             .2        145            80
                ...

30 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  f3z9tnbyz8rad, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where job_id =
'SA_REP'

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |     30 |00:00:00.01 |       5 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |      6 |     30 |00:00:00.01 |       5 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;JOB_ID&quot;='SA_REP')

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Histogram&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조건절에 자주 사용되는 컬럼들 중에 값의 분포도가 균일하지 않은 컬럼에 히스토그램 생성&lt;/li&gt;
&lt;li&gt;버킷 수는 최대 2048만 허용 11g(254), 12c(2048)&lt;/li&gt;
&lt;li&gt;히스토그램 유형
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;도수 분포 히스토그램(Frequency) 값의 수 = 버킷 개수&lt;/li&gt;
&lt;li&gt;높이 균형 히스토그램(Height balanced) 값의 수 &amp;gt; 버킷 개수&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;히스토그램 생성 옵션
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;method_opt=&amp;gt;'for columns size 20 job_id'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;method_opt=&amp;gt;'for columns size 20 job_id, department_id'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;method_opt=&amp;gt;'for columns job_id size 20, department_id size 12'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;method_opt=&amp;gt;'for all columns size 254'&lt;/code&gt; : 모든 컬럼 히스토그램 생성(주의!!)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;size [ integer | repeat | auto | skewonly ]
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;integer : 버킷 개수 지정(1 ~ 2048)&lt;/li&gt;
&lt;li&gt;repeat : 히스토그램이 기존에 생성되어 있는 컬럼에만 히스토그램 생성
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;method_opt=&amp;gt;'for all columns size repeat'&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;auto : 컬럼이 조건절에 사용되는 비중이 높은 컬럼(sys.col_usage$)을 찾아서 히스토그램 생성
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;method_opt=&amp;gt;'for all columns size auto'&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;skewonly : 데이터 분포를 분석해 균일하지 않은 컬럼에 대해서 히스토그램 생성
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;method_opt=&amp;gt;'for all columns size skewonly'&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre id=&quot;code_1773581780861&quot; class=&quot;sql&quot; data-ke-language=&quot;sql&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;# 조건절에 사용되는 비중이 높은 컬럼 조회
SYS@ora19c&amp;gt; select * from sys.col_usage$;

      OBJ#    INTCOL# EQUALITY_PREDS EQUIJOIN_PREDS NONEQUIJOIN_PREDS RANGE_PREDS LIKE_PREDS NULL_PREDS TIMESTAMP      FLAGS
---------- ---------- -------------- -------------- ----------------- ----------- ---------- ---------- --------- ----------
        18          6            335              0                 0           0          0        463 13-FEB-26     97
        18          7            965            143                 0          24          0          0 13-FEB-26    587
        22          3            592              0                 0           0          0          0 13-FEB-26    577
       453          2             33            108                 0           0          1          0 13-FEB-26    595
      1567          1             86              1                 0           0          0          0 11-FEB-26    579
         4          1            712            784                 0           0          0          0 13-FEB-26    579
        18          1            892           1013                 0           0          0          0 13-FEB-26    579
        19          1            505            623                 0           0          0          0 13-FEB-26    579
        19          6            440            576                 0           0          0          0 13-FEB-26    579
        20          1            296             76                 0           0          0          0 13-FEB-26    579
			...
			
3885 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;reasonml&quot;&gt;&lt;code&gt;exec dbms_stats.gather_table_stats('hr', 'emp', method_opt=&amp;gt;'for columns size 20 job_id', no_invalidate=&amp;gt;true)&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;no_invalidate : library cache에 있는 연관된 LCO를 무효화할지 결정
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;no_invalidate=&amp;gt;true&lt;/code&gt; : 연관된 LCO를 무효화 하지 않음(10g)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;no_invalidate=&amp;gt;false&lt;/code&gt; : 연관된 LCO를 무효화(9i)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;no_invalidate=&amp;gt;dbms_stats.auto_invalidate&lt;/code&gt; : 정해진 시간동안 조금씩 무효화(10g 새롭게 나온 기능), 기본 값&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;18000초(5시간) 동안 천천히 invalidation 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select  a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_optimizer_invalidation_period';  2    3    4

PARAMETER                      VALUE
------------------------------ ------------------------------
_optimizer_invalidation_period 18000&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;reasonml&quot;&gt;&lt;code&gt;exec dbms_stats.gather_table_stats('hr', 'emp', method_opt=&amp;gt;'for columns size 20 job_id', no_invalidate=&amp;gt;true, cascade=&amp;gt;true)&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;cascade&amp;rArr;true : 테이블 통계 수집하면서 관련된 인덱스 통계 수집도 함께 수행&lt;/li&gt;
&lt;li&gt;인덱스 통계 수집
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;exec dbms_stats.gather_index_stats('hr', 'emp_idx')&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;job_id 컬럼 값 분포 조회&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select job_id, count(*) from hr.emp group by job_id order by 2 desc;

JOB_ID       COUNT(*)
---------- ----------
SA_REP             30
SH_CLERK           20
ST_CLERK           20
PU_CLERK            5
FI_ACCOUNT          5
ST_MAN              5
SA_MAN              5
IT_PROG             5
AD_VP               2
MK_MAN              1
AC_ACCOUNT          1
FI_MGR              1
HR_REP              1
AD_PRES             1
PR_REP              1
AC_MGR              1
PU_MAN              1
AD_ASST             1
MK_REP              1

19 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;bucket을 20개 가지는 job_id 컬럼 히스토그램 생성&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 'emp', method_opt=&amp;gt;'for columns size 20 job_id')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select t.num_rows, c.column_name, c.num_nulls, c.num_distinct, 1/c.num_distinct selectivity, num_rows/c.num_distinct cardinality, c.histogram
from dba_tables t, dba_tab_columns c
where t.table_name = 'EMP'
and c.table_name = t.table_name
and t.owner = 'HR'
and c.owner = 'HR';  2    3    4    5    6

  NUM_ROWS COLUMN_NAME                     NUM_NULLS NUM_DISTINCT SELECTIVITY CARDINALITY HISTOGRAM
---------- ------------------------------ ---------- ------------ ----------- ----------- ---------------
       107 EMPLOYEE_ID                             0          107  .009345794           1 NONE
       107 FIRST_NAME                              0           91  .010989011  1.17582418 NONE
       107 LAST_NAME                               0          102  .009803922  1.04901961 NONE
       107 EMAIL                                   0          107  .009345794           1 NONE
       107 PHONE_NUMBER                            0          107  .009345794           1 NONE
       107 HIRE_DATE                               0           98  .010204082  1.09183673 NONE
       107 JOB_ID                                  0           19  .052631579  5.63157895 FREQUENCY
       107 SALARY                                  0           58  .017241379  1.84482759 NONE
       107 COMMISSION_PCT                         72            7  .142857143  15.2857143 NONE
       107 MANAGER_ID                              1           18  .055555556  5.94444444 NONE
       107 DEPARTMENT_ID                           1           11  .090909091  9.72727273 NONE

11 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;라이브러리 캐시에 기존 실행 계획이 캐싱되어 있기 때문에 새로운 실행 계획을 사용하도록 flush 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter system flush shared_pool;&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;예측 row 수가 실제 row 수와 동일해짐&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2krmqchjudat0, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where job_id =
'IT_PROG'

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |      5 |00:00:00.01 |       4 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |      5 |      5 |00:00:00.01 |       4 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;JOB_ID&quot;='IT_PROG')

19 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  f3z9tnbyz8rad, child number 0
-------------------------------------
select /*+ gather_plan_statistics*/ * from hr.emp where job_id =
'SA_REP'

Plan hash value: 3956160932

------------------------------------------------------------------------------------
| Id  | Operation         | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |      |      1 |        |     30 |00:00:00.01 |       5 |
|*  1 |  TABLE ACCESS FULL| EMP  |      1 |     30 |     30 |00:00:00.01 |       5 |
------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;JOB_ID&quot;='SA_REP')

19 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;자동 통계 수집(10g)&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Oracle이 자동으로 수행하는 유지 보수 작업 상태 조회&lt;/h3&gt;
&lt;pre class=&quot;scss&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select client_name, status, consumer_group, window_group from dba_autotask_client;

CLIENT_NAME                                        STATUS   CONSUMER_GROUP                 WINDOW_GROUP
-------------------------------------------------- -------- ------------------------------ ------------------------------
sql tuning advisor                                 ENABLED  ORA$AUTOTASK                   ORA$AT_WGRP_SQ
auto optimizer stats collection                    ENABLED  ORA$AUTOTASK                   ORA$AT_WGRP_OS
auto space advisor                                 ENABLED  ORA$AUTOTASK                   ORA$AT_WGRP_SA
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;자동 통계 수집이 실행되는 Scheduler Window 조회&lt;/h3&gt;
&lt;pre class=&quot;lasso&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from dba_scheduler_wingroup_members where window_group_name = 'ORA$AT_WGRP_OS';

WINDOW_GROUP_NAME              WINDOW_NAME
------------------------------ ------------------------------
ORA$AT_WGRP_OS                 MONDAY_WINDOW
ORA$AT_WGRP_OS                 TUESDAY_WINDOW
ORA$AT_WGRP_OS                 WEDNESDAY_WINDOW
ORA$AT_WGRP_OS                 THURSDAY_WINDOW
ORA$AT_WGRP_OS                 FRIDAY_WINDOW
ORA$AT_WGRP_OS                 SATURDAY_WINDOW
ORA$AT_WGRP_OS                 SUNDAY_WINDOW

7 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Window의 실행 시간과 리소스 관리 정책 조회&lt;/h3&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;select window_name, resource_plan, repeat_interval, duration from dba_scheduler_windows;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;962&quot; data-origin-height=&quot;202&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bAgqLE/dJMb99Taou4/oKhkyLmoAaNluuH6QCtA2k/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bAgqLE/dJMb99Taou4/oKhkyLmoAaNluuH6QCtA2k/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bAgqLE/dJMb99Taou4/oKhkyLmoAaNluuH6QCtA2k/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbAgqLE%2FdJMb99Taou4%2FoKhkyLmoAaNluuH6QCtA2k%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;962&quot; height=&quot;202&quot; data-origin-width=&quot;962&quot; data-origin-height=&quot;202&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;각 Scheduler Window에서 자동 유지보수 작업(autotask) 상태 조회&lt;/h3&gt;
&lt;pre class=&quot;n1ql&quot;&gt;&lt;code&gt;select window_name, window_next_time, autotask_status, optimizer_stats, segment_advisor, sql_tune_advisor from dba_autotask_window_clients;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;982&quot; data-origin-height=&quot;164&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bpps67/dJMb99Taovb/RMNiFS8digZnAppjPvt1j0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bpps67/dJMb99Taovb/RMNiFS8digZnAppjPvt1j0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bpps67/dJMb99Taovb/RMNiFS8digZnAppjPvt1j0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fbpps67%2FdJMb99Taovb%2FRMNiFS8digZnAppjPvt1j0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;982&quot; height=&quot;164&quot; data-origin-width=&quot;982&quot; data-origin-height=&quot;164&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Window 속성 값 수정&lt;/h3&gt;
&lt;pre class=&quot;reasonml&quot;&gt;&lt;code&gt;EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE('FRIDAY_WINDOW',   'repeat_interval','freq=daily;byday=FRI;byhour=05;byminute=0; bysecond=0');

EXECUTE DBMS_SCHEDULER.SET_ATTRIBUTE(name =&amp;gt; 'MONDAY_WINDOW', attribute =&amp;gt; 'duration', value =&amp;gt; numtodsinterval(5, 'hour'));&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;967&quot; data-origin-height=&quot;201&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/rUDr6/dJMb99ZYgVV/5fpgk2T57zo2Q5sH4k3ji1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/rUDr6/dJMb99ZYgVV/5fpgk2T57zo2Q5sH4k3ji1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/rUDr6/dJMb99ZYgVV/5fpgk2T57zo2Q5sH4k3ji1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FrUDr6%2FdJMb99ZYgVV%2F5fpgk2T57zo2Q5sH4k3ji1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;967&quot; height=&quot;201&quot; data-origin-width=&quot;967&quot; data-origin-height=&quot;201&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Autotask 실행 이력 조회&lt;/h3&gt;
&lt;pre class=&quot;mipsasm&quot;&gt;&lt;code&gt;select client_name, job_status, job_start_time, job_duration from dba_autotask_job_history;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;777&quot; data-origin-height=&quot;86&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bUlV5t/dJMcaaR6JQa/jfykNgCebaiIHKupWlw0uK/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bUlV5t/dJMcaaR6JQa/jfykNgCebaiIHKupWlw0uK/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bUlV5t/dJMcaaR6JQa/jfykNgCebaiIHKupWlw0uK/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbUlV5t%2FdJMcaaR6JQa%2FjfykNgCebaiIHKupWlw0uK%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;777&quot; height=&quot;86&quot; data-origin-width=&quot;777&quot; data-origin-height=&quot;86&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;자동 통계 수집 비활성화&lt;/h3&gt;
&lt;pre class=&quot;php&quot;&gt;&lt;code&gt;BEGIN
DBMS_AUTO_TASK_ADMIN.DISABLE(
        client_name =&amp;gt; 'auto optimizer stats collection',
        operation =&amp;gt; NULL,
        window_name =&amp;gt; NULL);
END;
/

SYS@ora19c&amp;gt; select client_name, status, consumer_group, window_group from dba_autotask_client;

CLIENT_NAME                                        STATUS   CONSUMER_GROUP                 WINDOW_GROUP
-------------------------------------------------- -------- ------------------------------ ------------------------------
sql tuning advisor                                 ENABLED  ORA$AUTOTASK                   ORA$AT_WGRP_SQ
auto optimizer stats collection                    DISABLED ORA$AUTOTASK                   ORA$AT_WGRP_OS
auto space advisor                                 ENABLED  ORA$AUTOTASK                   ORA$AT_WGRP_SA&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;자동 통계 수집 활성화&lt;/h3&gt;
&lt;pre class=&quot;php&quot;&gt;&lt;code&gt;BEGIN
DBMS_AUTO_TASK_ADMIN.ENABLE(
        client_name =&amp;gt; 'auto optimizer stats collection',
        operation =&amp;gt; NULL,
        window_name =&amp;gt; NULL);
END;
/

SYS@ora19c&amp;gt; select client_name, status, consumer_group, window_group from dba_autotask_client;

CLIENT_NAME                                        STATUS   CONSUMER_GROUP                 WINDOW_GROUP
-------------------------------------------------- -------- ------------------------------ ------------------------------
sql tuning advisor                                 ENABLED  ORA$AUTOTASK                   ORA$AT_WGRP_SQ
auto optimizer stats collection                    ENABLED  ORA$AUTOTASK                   ORA$AT_WGRP_OS
auto space advisor                                 ENABLED  ORA$AUTOTASK                   ORA$AT_WGRP_SA&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;통계 수집 제어 파라미터&lt;/h3&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; show parameter statistics_level

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
client_statistics_level              string      TYPICAL
statistics_level                     string      TYPICAL&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;alter system set statistics_level = typical;(기본값)
alter system set statistics_level = all;
alter system set statistics_level = basic;&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;basic : 통계 수집 X&lt;/li&gt;
&lt;li&gt;typical : 통계 수집&lt;/li&gt;
&lt;li&gt;all : 가능한 모든 통계 수집 (OS 정보)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;auto optimizer stats collection 활성화되어 있으면 통계 수집 대상 테이블은?&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;한번도 통계 수집하지 않은 테이블&lt;/li&gt;
&lt;li&gt;마지막 통계 수집한 이후 10% 변화율이 있는 테이블&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;exec dbms_stats.delete_table_stats('hr', 'emp')

SYS@ora19c&amp;gt; select owner, table_name, last_analyzed from dba_tables
where owner = 'HR'
and table_name = 'EMP';  2    3

OWNER                          TABLE_NAME                     LAST_ANAL
------------------------------ ------------------------------ ---------
HR                             EMP&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;reasonml&quot;&gt;&lt;code&gt;# 통계 수집 degree=&amp;gt;2 병렬처리 수행
exec dbms_stats.gather_table_stats('hr', 'emp', degree=&amp;gt;2)&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; drop table hr.emp purge;

Table dropped.

SYS@ora19c&amp;gt; create table hr.emp tablespace users as select employee_id, last_name, salary from hr.employees;

Table created.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed from dba_tables where owner='HR' and table_name='EMP';

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED
---------- ---------- ----------- -------------------
       107          4          14 2026-02-13 16:33:27&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 테이블 DML 작업이 수행될 때 수집된 정보
SYS@ora19c&amp;gt; select * from dba_tab_modifications where table_name = 'EMP' and table_owner = 'HR';

no rows selected
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;마지막 gathering 후 10% 변화율의 테이블을 이곳에서 찾음&lt;/li&gt;
&lt;li&gt;HR 세션에서 데이터 입력&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;HR@ora19c&amp;gt; insert into hr.emp(employee_id,last_name,salary) values(300,'oracle',1000);

1 row created.

HR@ora19c&amp;gt; insert into hr.emp(employee_id,last_name,salary) values(400, 'itwill', 1000);

1 row created.

HR@ora19c&amp;gt; commit;

Commit complete.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;inserts = 2로 나옴&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brainfuck&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from dba_tab_modifications where table_name = 'EMP' and table_owner = 'HR';

TABLE_OWNER                    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME             INSERTS     UPDATES    DELETES TIMESTAMP TRU DROP_SEGMENTS
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------- ---------- ---------- --------- --- -------------
HR                             EMP                                                                                       2           0          0           NO              0&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;혹시 정보가 안 보일 경우 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;bash&quot;&gt;&lt;code&gt;exec dbms_stats.flush_database_monitoring_info&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;stale_stats&lt;/code&gt; : 마지막 통계 수집 이후 10% 변화율이 발생한 테이블이면 YES, 아니면 NO&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats
from dba_tab_statistics
where owner='HR'
and table_name='EMP';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S
---------- ---------- ----------- ------------------- -------
       107          4          14 2026-02-13 16:33:27 NO&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;HR 세션에서 update 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;HR@ora19c&amp;gt; update hr.emp set salary = salary * 1.1 where salary &amp;gt; 10000;

15 rows updated.

HR@ora19c&amp;gt; commit;

Commit complete.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;updates=15로 나옴&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brainfuck&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from dba_tab_modifications where table_name = 'EMP' and table_owner = 'HR';

TABLE_OWNER                    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME             INSERTS     UPDATES    DELETES TIMESTAMP TRU DROP_SEGMENTS
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------- ---------- ---------- --------- --- -------------
HR                             EMP                                                                                       2          15          0 13-FEB-26 NO              0&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;stale_stats&lt;/code&gt; 가 YES로 변경됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats
from dba_tab_statistics
where owner='HR'
and table_name='EMP';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S
---------- ---------- ----------- ------------------- -------
       107          4          14 2026-02-13 16:33:27 YES
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;HR 세션에서 삭제 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;HR@ora19c&amp;gt; delete hr.emp where employee_id in (100, 200, 102, 106, 107);

5 rows deleted.

HR@ora19c&amp;gt; commit;

Commit complete.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;deletes = 5로 나옴&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;brainfuck&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from dba_tab_modifications where table_name = 'EMP' and table_owner = 'HR';

TABLE_OWNER                    TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME             INSERTS     UPDATES    DELETES TIMESTAMP TRU DROP_SEGMENTS
------------------------------ ------------------------------ ------------------------------ ------------------------------ ---------- ---------- ---------- --------- --- -------------
HR                             EMP                                                                                       2          15          5 13-FEB-26 NO              0&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;EMP 테이블에 대한 옵티마이저 통계 정보 조회&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats
from dba_tab_statistics
where owner='HR'
and table_name='EMP';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S
---------- ---------- ----------- ------------------- -------
       107          4          14 2026-02-13 16:33:27 YES&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;통계 수집&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;exec dbms_stats.gather_table_stats('hr', 'emp', degree=&amp;gt;2)

# 통계 수집을 하게 되면 대상 테이블의 dba_tab_modifications 정보는 자동으로 purge됨
SYS@ora19c&amp;gt; select * from dba_tab_modifications where table_name = 'EMP' and table_owner = 'HR';

no rows selected

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats
from dba_tab_statistics
where owner='HR'
and table_name='EMP';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S
---------- ---------- ----------- ------------------- -------
       104          8          14 2026-02-13 16:50:11 NO&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;stale 상태로 빠지는 변화율의 값을 바꾸는 방법
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;기본 값 10%&lt;/li&gt;
&lt;li&gt;exec dbms_stats.set_table_prefs(&amp;rsquo;hr&amp;rsquo;, &amp;lsquo;emp&amp;rsquo;, &amp;lsquo;stale_percent&amp;rsquo;,&amp;rsquo;40&amp;rsquo;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;select * from dba_tab_stat_prefs where owner = &amp;lsquo;HR&amp;rsquo; and table_name = &amp;lsquo;EMP&amp;rsquo;;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;통계 수집을 못하게 lock 거는 방법&lt;/h3&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.lock_table_stats('hr','emp')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='EMP';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----
       104          8          14 2026-02-13 16:50:11 NO      ALL

# 통계 수집 시 오류 발생       
SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 'emp', degree=&amp;gt;2)
BEGIN dbms_stats.gather_table_stats('hr', 'emp', degree=&amp;gt;2); END;

*
ERROR at line 1:
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 40751
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 40035
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 9393
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 10317
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 39324
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 40183
ORA-06512: at &quot;SYS.DBMS_STATS&quot;, line 40732
ORA-06512: at line 1       &lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;통계 수집 lock 해지하는 방법&lt;/h3&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.unlock_table_stats('hr','emp')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='EMP';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----
       104          8          14 2026-02-13 16:50:11 NO

SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr', 'emp', degree=&amp;gt;2)

PL/SQL procedure successfully completed.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; create table hr.tab(col1 number, col2 number) tablespace users;

Table created.

SYS@ora19c&amp;gt; insert into hr.tab(col1, col2) select level, level from dual connect by level &amp;lt;= 100;

100 rows created.

SYS@ora19c&amp;gt; commit;

Commit complete.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='TAB';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----

SYS@ora19c&amp;gt; select column_name, num_distinct, num_nulls, num_buckets, histogram from dba_tab_columns where owner='HR' and table_name='TAB';

COLUMN_NAME                    NUM_DISTINCT  NUM_NULLS NUM_BUCKETS HISTOGRAM
------------------------------ ------------ ---------- ----------- ---------------
COL1                                                               NONE
COL2                                                               NONE&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr','tab',method_opt=&amp;gt;'for all columns size auto')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='TAB';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----
       100          5           6 2026-02-13 17:25:44 NO

SYS@ora19c&amp;gt; select column_name, num_distinct, num_nulls, num_buckets, histogram from dba_tab_columns where owner='HR' and table_name='TAB';

COLUMN_NAME                    NUM_DISTINCT  NUM_NULLS NUM_BUCKETS HISTOGRAM
------------------------------ ------------ ---------- ----------- ---------------
COL1                                    100          0           1 NONE
COL2                                    100          0           1 NONE&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# 과거 통계 정보 수집 정보
SYS@ora19c&amp;gt; select * from dba_tab_stats_history where owner='HR' and table_name='TAB';

OWNER                          TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME          STATS_UPDATE_TIME
------------------------------ ------------------------------ ------------------------------ ------------------------------ ----------------------------------------
HR                             TAB                                                                                      13-FEB-26 05.25.44.684695 PM +09:00
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;현재 통계 정보 EXPORT&lt;/h2&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;통계 정보를 저장할 테이블 생성&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.create_stat_table('hr','tab_sta','users')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select * from hr.tab_sta;

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;통계 정보를 export&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; exec dbms_stats.export_table_stats(ownname=&amp;gt;'hr', tabname=&amp;gt;'tab',stattab=&amp;gt;'tab_sta')

PL/SQL procedure successfully completed.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;n1ql&quot;&gt;&lt;code&gt;select * from hr.tab_sta;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;1498&quot; data-origin-height=&quot;81&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/bgxT4A/dJMcadOKsGo/vF0agriaOgFAOhkFKTgQo1/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/bgxT4A/dJMcadOKsGo/vF0agriaOgFAOhkFKTgQo1/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/bgxT4A/dJMcadOKsGo/vF0agriaOgFAOhkFKTgQo1/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbgxT4A%2FdJMcadOKsGo%2FvF0agriaOgFAOhkFKTgQo1%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;1498&quot; height=&quot;81&quot; data-origin-width=&quot;1498&quot; data-origin-height=&quot;81&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;새로운 데이터 입력 후 통계 수집
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;이전 통계 정보와 현재 통계 정보를 비교&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; insert into hr.tab(col1,col2) select mod(level,2), level from dual connect by level &amp;lt;= 1000;

1000 rows created.

SYS@ora19c&amp;gt; commit;

Commit complete.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;cal&quot;&gt;&lt;code&gt;# 통계 수집
SYS@ora19c&amp;gt; exec dbms_stats.gather_table_stats('hr','tab',method_opt=&amp;gt;'for columns col1 size 254')

PL/SQL procedure successfully completed.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# TAB 테이블에 대한 옵티마이저 통계 정보 상태 조회
SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='TAB';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----
      1100          5           7 2026-02-13 17:36:16 NO

# TAB 테이블의 컬럼 통계 상태 조회
SYS@ora19c&amp;gt; select column_name, num_distinct, num_nulls, num_buckets, histogram from dba_tab_columns where owner='HR' and table_name='TAB';

COLUMN_NAME                    NUM_DISTINCT  NUM_NULLS NUM_BUCKETS HISTOGRAM
------------------------------ ------------ ---------- ----------- ---------------
COL1                                    101          0         101 FREQUENCY
COL2                                    100          0           1 NONE

# TAB 테이블의 통계 변경 이력 조회
SYS@ora19c&amp;gt; select * from dba_tab_stats_history where owner='HR' and table_name='TAB';

OWNER                          TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME          STATS_UPDATE_TIME
------------------------------ ------------------------------ ------------------------------ ------------------------------ ----------------------------------------
HR                             TAB                                                                                      13-FEB-26 05.25.44.684695 PM +09:00
HR                             TAB                                                                                      13-FEB-26 05.36.16.048605 PM +09:00&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;clean&quot;&gt;&lt;code&gt;# 과거 export 받은 통계 정보와 현제 통계 정보 비교
SYS@ora19c&amp;gt; select * from table(dbms_stats.diff_table_stats_in_stattab('hr','tab','tab_sta'));

REPORT                                                                           MAXDIFFPCT
-------------------------------------------------------------------------------- ----------
###############################################################################        1000

STATISTICS DIFFERENCE REPORT FOR:
.................................

TABLE         : TAB
OWNER         : HR
SOURCE A      : User statistics table TAB_STA
              : Statid     :
              : Owner      : HR
SOURCE B      : Current Statistics in dictionary
PCTTHRESHOLD  : 10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

TABLE / (SUB)PARTITION STATISTICS DIFFERENCE:
.............................................

OBJECTNAME                  TYP SRC ROWS       BLOCKS     ROWLEN     SAMPSIZE
...............................................................................

TAB                         T   A   100        5          6          100
                                B   1100       5          7          1100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

COLUMN STATISTICS DIFFERENCE:
.............................

COLUMN_NAME     SRC NDV     DENSITY    HIST NULLS   LEN  MIN   MAX   SAMPSIZ
...............................................................................

COL1            A   100     .01        NO   0       3    C102  C202  100
                B   101     .000454545 YES  0       3    80    C202  1100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

NO DIFFERENCE IN INDEX / (SUB)PARTITION STATISTICS
###############################################################################
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# export 받은 통계 정보를 이용해서 import
SYS@ora19c&amp;gt; exec dbms_stats.import_table_stats('hr','tab',stattab=&amp;gt;'tab_sta')

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='TAB';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----
       100          5           6 2026-02-13 17:25:44 NO

SYS@ora19c&amp;gt; select column_name, num_distinct, num_nulls, num_buckets, histogram from dba_tab_columns where owner='HR' and table_name='TAB';

COLUMN_NAME                    NUM_DISTINCT  NUM_NULLS NUM_BUCKETS HISTOGRAM
------------------------------ ------------ ---------- ----------- ---------------
COL1                                    100          0           1 NONE
COL2                                    100          0           1 NONE
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# 특정한 시간을 기준으로 통계 정보 restore
SYS@ora19c&amp;gt; select * from dba_tab_stats_history where owner='HR' and table_name='TAB';

OWNER                          TABLE_NAME                     PARTITION_NAME                 SUBPARTITION_NAME          STATS_UPDATE_TIME
------------------------------ ------------------------------ ------------------------------ ------------------------------ ----------------------------------------
HR                             TAB                                                                                      13-FEB-26 05.25.44.684695 PM +09:00
HR                             TAB                                                                                      13-FEB-26 05.36.16.048605 PM +09:00 &amp;lt;&amp;lt;- restore 기준 시간
HR                             TAB                                                                                      13-FEB-26 05.45.11.483215 PM +09:00

exec dbms_stats.restore_table_stats('hr','tab','13-FEB-26 05.36.16.048605 PM +09:00')&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;# restore 됨
SYS@ora19c&amp;gt; select num_rows, blocks, avg_row_len, to_char(last_analyzed,'yyyy-mm-dd hh24:mi:ss') last_analyzed, stale_stats, stattype_locked
from dba_tab_statistics
where owner='HR'
and table_name='TAB';  2    3    4

  NUM_ROWS     BLOCKS AVG_ROW_LEN LAST_ANALYZED       STALE_S STATT
---------- ---------- ----------- ------------------- ------- -----
      1100          5           7 2026-02-13 17:36:16 NO

# 히스토그램은 restore 안됨
SYS@ora19c&amp;gt; select column_name, num_distinct, num_nulls, num_buckets, histogram from dba_tab_columns where owner='HR' and table_name='TAB';

COLUMN_NAME                    NUM_DISTINCT  NUM_NULLS NUM_BUCKETS HISTOGRAM
------------------------------ ------------ ---------- ----------- ---------------
COL1                                    100          0           1 NONE
COL2                                    100          0           1 NONE
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# restore 가능한 가장 오래된 날짜 확인
SYS@ora19c&amp;gt; select dbms_stats.get_stats_history_availability from dual;

GET_STATS_HISTORY_AVAILABILITY
---------------------------------------------------------------------------
13-JAN-26 12.30.55.718907000 PM +09:00&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# 통계 정보 보유 기간 확인
SYS@ora19c&amp;gt; select dbms_stats.get_stats_history_retention from dual;

GET_STATS_HISTORY_RETENTION
---------------------------
                         31

# 통계 정보 보유 기간 수정                  
SYS@ora19c&amp;gt; exec dbms_stats.alter_stats_history_retention(7)

PL/SQL procedure successfully completed.

SYS@ora19c&amp;gt; select dbms_stats.get_stats_history_retention from dual;

GET_STATS_HISTORY_RETENTION
---------------------------
                          7                         &lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <category>튜닝</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/233</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260213-TIL#entry233comment</comments>
      <pubDate>Sun, 15 Mar 2026 22:39:21 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260212 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260212-TIL</link>
      <description>&lt;h1&gt;쿼리 변환(Cont.)&lt;/h1&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;조건 이동 기능 활성화 여부&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조건절 pushdown, pullup 기능 활성화&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select  a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_pred_move_around';  2    3    4

PARAMETER                      VALUE
------------------------------ ------------------------------
_pred_move_around              TRUE&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조건 이동 기능 비활성화&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;opt_param('_pred_move_around','false') no_push_pred(b)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics opt_param('_pred_move_around','false') no_push_pred(b) */ 
        a.department_id, a.sum_sal, b.avg_sal, b.max_sal
from (select department_id, sum(salary) sum_sal 
        from hr.employees 
        where department_id = 20 
        group by department_id) a,
    (select department_id, avg(salary) avg_sal, max(salary) max_sal 
        from hr.employees 
        group by department_id) b
where a.department_id = b.department_id;

DEPARTMENT_ID    SUM_SAL    AVG_SAL    MAX_SAL
------------- ---------- ---------- ----------
           20      19000       9500      13000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5fbq8qp1ds24n, child number 0
-------------------------------------
select /*+ gather_plan_statistics opt_param('_pred_move_around','false')
 no_push_pred(b) */ a.department_id, a.sum_sal, b.avg_sal, b.max_sal
from (select department_id, sum(salary) sum_sal from hr.employees where
department_id = 20 group by department_id) a, (select department_id,
avg(salary) avg_sal, max(salary) max_sal from hr.employees group by
department_id) b where a.department_id = b.department_id

Plan hash value: 3990132733

-------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |       OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |                   |      1 |        |      1 |00:00:00.01 |       8 |            |       |          |
|*  1 |  HASH JOIN                             |                   |      1 |      2 |      1 |00:00:00.01 |       8 |       1995K|  1995K|  734K (0)|
|   2 |   VIEW                                 |                   |      1 |      2 |      1 |00:00:00.01 |       2 |            |       |          |
|   3 |    HASH GROUP BY                       |                   |      1 |      2 |      1 |00:00:00.01 |       2 |       1200K|  1200K|  746K (0)|
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |            |       |          |
|*  5 |      INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |            |       |          |
|   6 |   VIEW                                 |                   |      1 |     11 |     12 |00:00:00.01 |       6 |            |       |          |
|   7 |    HASH GROUP BY                       |                   |      1 |     11 |     12 |00:00:00.01 |       6 |        952K|   952K| 2306K (0)|
|   8 |     TABLE ACCESS FULL                  | EMPLOYEES         |      1 |    107 |    107 |00:00:00.01 |       6 |            |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;A&quot;.&quot;DEPARTMENT_ID&quot;=&quot;B&quot;.&quot;DEPARTMENT_ID&quot;)
   5 - access(&quot;DEPARTMENT_ID&quot;=20)

31 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;10053 event&lt;/h2&gt;
&lt;pre class=&quot;sql&quot;&gt;&lt;code&gt;alter session set tracefile_identifier = 'hr';
alter session set events '10053 trace name context forever,level 1';

select a.department_id, a.sum_sal, b.avg_sal, b.max_sal
from (select department_id, sum(salary) sum_sal 
            from hr.employees 
            where department_id = 20 
            group by department_id) a,
        (select department_id, avg(salary) avg_sal, max(salary) max_sal 
            from hr.employees 
            group by department_id) b
where a.department_id = b.department_id;

alter session set events '10053 trace name context off';&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;mel&quot;&gt;&lt;code&gt;[oracle@ora19c trace]$ pwd
/u01/app/oracle/diag/rdbms/ora19c/ora19c/trace
[oracle@ora19c trace]$ ls *hr*
ora19c_ora_14917_hr.trc  ora19c_ora_14917_hr.trm&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조건절 pull up&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;914&quot; data-origin-height=&quot;357&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/lIPE2/dJMb99MnFaw/bKgDK37KUhgnN1Sm31xw91/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/lIPE2/dJMb99MnFaw/bKgDK37KUhgnN1Sm31xw91/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/lIPE2/dJMb99MnFaw/bKgDK37KUhgnN1Sm31xw91/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FlIPE2%2FdJMb99MnFaw%2FbKgDK37KUhgnN1Sm31xw91%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;914&quot; height=&quot;357&quot; data-origin-width=&quot;914&quot; data-origin-height=&quot;357&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;변환된 최종 쿼리&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;938&quot; data-origin-height=&quot;100&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/cEfF0m/dJMb99MnFaC/eozuxNG6kGOk0MtMlPS0T0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/cEfF0m/dJMb99MnFaC/eozuxNG6kGOk0MtMlPS0T0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/cEfF0m/dJMb99MnFaC/eozuxNG6kGOk0MtMlPS0T0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcEfF0m%2FdJMb99MnFaC%2FeozuxNG6kGOk0MtMlPS0T0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;938&quot; height=&quot;100&quot; data-origin-width=&quot;938&quot; data-origin-height=&quot;100&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;pre class=&quot;routeros&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; SELECT &quot;A&quot;.&quot;DEPARTMENT_ID&quot; &quot;DEPARTMENT_ID&quot;,&quot;A&quot;.&quot;SUM_SAL&quot; &quot;SUM_SAL&quot;,&quot;B&quot;.&quot;AVG_SAL&quot; &quot;AVG_SAL&quot;,&quot;B&quot;.&quot;MAX_SAL&quot; &quot;MAX_SAL&quot; 
FROM  (SELECT 20 &quot;DEPARTMENT_ID&quot;,SUM(&quot;EMPLOYEES&quot;.&quot;SALARY&quot;) &quot;SUM_SAL&quot; 
                FROM &quot;HR&quot;.&quot;EMPLOYEES&quot; &quot;EMPLOYEES&quot; 
                WHERE &quot;EMPLOYEES&quot;.&quot;DEPARTMENT_ID&quot;=20 
                GROUP BY 20) &quot;A&quot;, 
            (SELECT 20 &quot;DEPARTMENT_ID&quot;,AVG(&quot;EMPLOYEES&quot;.&quot;SALARY&quot;) &quot;AVG_SAL&quot;,MAX(&quot;EMPLOYEES&quot;.&quot;SALARY&quot;) &quot;MAX_SAL&quot; 
                FROM &quot;HR&quot;.&quot;EMPLOYEES&quot; &quot;EMPLOYEES&quot; 
                WHERE &quot;EMPLOYEES&quot;.&quot;DEPARTMENT_ID&quot;=20 
                GROUP BY 20) &quot;B&quot; 
WHERE &quot;A&quot;.&quot;DEPARTMENT_ID&quot;=&quot;B&quot;.&quot;DEPARTMENT_ID&quot;;

DEPARTMENT_ID    SUM_SAL    AVG_SAL MAX_SA     L
------------- ---------- ---------- ------------
           20      19000       9500        13000&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;실행 계획&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure class=&quot;imageblock alignCenter&quot; data-ke-mobileStyle=&quot;widthOrigin&quot; data-origin-width=&quot;895&quot; data-origin-height=&quot;560&quot;&gt;&lt;span data-url=&quot;https://blog.kakaocdn.net/dn/d8GhM9/dJMcaf6UQJd/2kDyAUrgyMdg12ZeTcDEh0/img.png&quot; data-phocus=&quot;https://blog.kakaocdn.net/dn/d8GhM9/dJMcaf6UQJd/2kDyAUrgyMdg12ZeTcDEh0/img.png&quot;&gt;&lt;img src=&quot;https://blog.kakaocdn.net/dn/d8GhM9/dJMcaf6UQJd/2kDyAUrgyMdg12ZeTcDEh0/img.png&quot; srcset=&quot;https://img1.daumcdn.net/thumb/R1280x0/?scode=mtistory2&amp;fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fd8GhM9%2FdJMcaf6UQJd%2F2kDyAUrgyMdg12ZeTcDEh0%2Fimg.png&quot; onerror=&quot;this.onerror=null; this.src='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png'; this.srcset='//t1.daumcdn.net/tistory_admin/static/images/no-image-v1.png';&quot; loading=&quot;lazy&quot; width=&quot;895&quot; height=&quot;560&quot; data-origin-width=&quot;895&quot; data-origin-height=&quot;560&quot;/&gt;&lt;/span&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;OR-EXPANSION&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;인덱스 정보 조회&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select ix.index_name, ix.uniqueness, ic.column_name, ix.blevel, ix.leaf_blocks, ix.distinct_keys
from dba_indexes ix, dba_ind_columns ic
where ix.index_name = ic.index_name
and ix.table_name = 'EMPLOYEES'
and ix.owner = 'HR'
and ix.owner = ic.index_owner;  2    3    4    5    6

INDEX_NAME                     UNIQUENES COLUMN_NAME                        BLEVEL LEAF_BLOCKS DISTINCT_KEYS
------------------------------ --------- ------------------------------ ---------- ----------- -------------
EMP_EMAIL_UK                   UNIQUE    EMAIL                                   0           1           107
EMP_EMP_ID_PK                  UNIQUE    EMPLOYEE_ID                             0           1           107
EMP_DEPARTMENT_IX              NONUNIQUE DEPARTMENT_ID                           0           1            11
EMP_JOB_IX                     NONUNIQUE JOB_ID                                  0           1            19
EMP_MANAGER_IX                 NONUNIQUE MANAGER_ID                              0           1            18
EMP_NAME_IX                    NONUNIQUE LAST_NAME                               0           1           107
EMP_NAME_IX                    NONUNIQUE FIRST_NAME                              0           1           107

7 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;job_id = &amp;lsquo;IT_PROG&amp;rsquo;&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Index Range Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ * from hr.employees where job_id = 'IT_PROG';

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG       9000                       102            60
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG       4800                       103            60
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG       4800                       103            60
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG       4200                       103            60

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  6pfkwhrd96a8s, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where job_id =
'IT_PROG'

Plan hash value: 2096651594

---------------------------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name       | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
---------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |            |      1 |        |      5 |00:00:00.01 |       4 |      2 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES  |      1 |      5 |      5 |00:00:00.01 |       4 |      2 |
|*  2 |   INDEX RANGE SCAN                  | EMP_JOB_IX |      1 |      5 |      5 |00:00:00.01 |       2 |      1 |
---------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;JOB_ID&quot;='IT_PROG')

20 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;department_id = 20&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Index Range Scan&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ * from hr.employees where department_id = 20;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  c48y19gs7zk95, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where
department_id = 20

Plan hash value: 235881476

-------------------------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |                   |      1 |        |      2 |00:00:00.01 |       4 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       4 |
|*  2 |   INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       2 |
-------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;DEPARTMENT_ID&quot;=20)

20 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;job_id = &amp;lsquo;IT_PROG&amp;rsquo; or department_id = 20&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Table Full Scan&lt;/li&gt;
&lt;li&gt;or 조건으로 조회하고 있기 때문에 인덱스를 탈 수 없음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where job_id = 'IT_PROG'
or department_id = 20;  2    3    4

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG       9000                       102            60
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG       4800                       103            60
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG       4800                       103            60
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG       4200                       103            60
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20

7 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4f210g95gvvxq, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where job_id =
'IT_PROG' or department_id = 20

Plan hash value: 1445457117

--------------------------------------------------------------------------------------------------
| Id  | Operation         | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |      1 |        |      7 |00:00:00.01 |       7 |      4 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |      1 |      7 |      7 |00:00:00.01 |       7 |      4 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter((&quot;JOB_ID&quot;='IT_PROG' OR &quot;DEPARTMENT_ID&quot;=20))

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;UNION&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;union 집합 연산자를 사용하여 쿼리를 분기하면 각 쿼리에 대해 Index Range Scan이 가능해짐&lt;/li&gt;
&lt;li&gt;중복을 제거하기 위해 sort unique 연산이 수행됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where job_id = 'IT_PROG'
union
select *
from hr.employees
where department_id = 20;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG       9000                       102            60
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG       4800                       103            60
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG       4800                       103            60
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG       4200                       103            60
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20

7 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  6u97d1az2ahfd, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where job_id =
'IT_PROG' union select * from hr.employees where department_id = 20

Plan hash value: 2807426306

------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |                   |      1 |        |      7 |00:00:00.01 |       4 |    |       |          |
|   1 |  SORT UNIQUE                          |                   |      1 |      7 |      7 |00:00:00.01 |       4 |  2048 |  2048 | 2048  (0)|
|   2 |   UNION-ALL                           |                   |      1 |        |      7 |00:00:00.01 |       4 |    |       |          |
|   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      5 |      5 |00:00:00.01 |       2 |    |       |          |
|*  4 |     INDEX RANGE SCAN                  | EMP_JOB_IX        |      1 |      5 |      5 |00:00:00.01 |       1 |    |       |          |
|   5 |    TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |    |       |          |
|*  6 |     INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |    |       |          |
------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;JOB_ID&quot;='IT_PROG')
   6 - access(&quot;DEPARTMENT_ID&quot;=20)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;UNION ALL&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;연결할 두 쿼리 결과 집합에 중복이 없다면 union all을 사용하여 불필요한 sort unique 연산이 발생하지 않도록 하는 것이 좋음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where job_id = 'IT_PROG'
union all
select *
from hr.employees
where department_id = 20;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG       9000                       102            60
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG       4800                       103            60
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG       4800                       103            60
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG       4200                       103            60
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20

7 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7nmr7f8xsw7k4, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where job_id =
'IT_PROG' union all select * from hr.employees where department_id = 20

Plan hash value: 3700819316

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      7 |00:00:00.01 |       6 |
|   1 |  UNION-ALL                           |                   |      1 |        |      7 |00:00:00.01 |       6 |
|   2 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      5 |      5 |00:00:00.01 |       4 |
|*  3 |    INDEX RANGE SCAN                  | EMP_JOB_IX        |      1 |      5 |      5 |00:00:00.01 |       2 |
|   4 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  5 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;JOB_ID&quot;='IT_PROG')
   5 - access(&quot;DEPARTMENT_ID&quot;=20)

24 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;현재는 두 결과 집합에 중복이 없기 때문에 결과 집합이 제대로 나왔지만 중복이 있을 경우 아래와 같은 처리 필요&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;department_id &amp;lt;&amp;gt; 20 or department_id is null&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where job_id = 'IT_PROG'
and (department_id &amp;lt;&amp;gt; 20 or department_id is null)
union all
select * from hr.employees where department_id = 20;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG       9000                       102            60
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG       4800                       103            60
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG       4800                       103            60
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG       4200                       103            60
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20

7 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2tcy9qwzyq5xz, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where job_id =
'IT_PROG' and (department_id &amp;lt;&amp;gt; 20 or department_id is null) union all
select * from hr.employees where department_id = 20

Plan hash value: 3700819316

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      7 |00:00:00.01 |       6 |
|   1 |  UNION-ALL                           |                   |      1 |        |      7 |00:00:00.01 |       6 |
|*  2 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      5 |      5 |00:00:00.01 |       4 |
|*  3 |    INDEX RANGE SCAN                  | EMP_JOB_IX        |      1 |      5 |      5 |00:00:00.01 |       2 |
|   4 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  5 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter((&quot;DEPARTMENT_ID&quot;&amp;lt;&amp;gt;20 OR &quot;DEPARTMENT_ID&quot; IS NULL))
   3 - access(&quot;JOB_ID&quot;='IT_PROG')
   5 - access(&quot;DEPARTMENT_ID&quot;=20)

26 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;lnnvl(department_id = 20)&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;위 쿼리와 동일&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ * 
from hr.employees 
where job_id = 'IT_PROG'
and lnnvl(department_id = 20)
union all
select * from hr.employees where department_id = 20;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG       9000                       102            60
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG       4800                       103            60
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG       4800                       103            60
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG       4200                       103            60
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20

7 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5m6b8xyaa0r0h, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where job_id =
'IT_PROG' and lnnvl(department_id = 20) union all select * from
hr.employees where department_id = 20

Plan hash value: 3700819316

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      7 |00:00:00.01 |       6 |
|   1 |  UNION-ALL                           |                   |      1 |        |      7 |00:00:00.01 |       6 |
|*  2 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      5 |      5 |00:00:00.01 |       4 |
|*  3 |    INDEX RANGE SCAN                  | EMP_JOB_IX        |      1 |      5 |      5 |00:00:00.01 |       2 |
|   4 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  5 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(LNNVL(&quot;DEPARTMENT_ID&quot;=20))
   3 - access(&quot;JOB_ID&quot;='IT_PROG')
   5 - access(&quot;DEPARTMENT_ID&quot;=20)

26 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;OR - Expansion&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;사용자의 쿼리를 직접 바꾸지 않아도 옵티마이저가 or 조건을 full table scan 이 아닌 index range scan을 수행하면서 union all 형태로 처리해 주는 기능&lt;/li&gt;
&lt;li&gt;힌트 : &lt;code&gt;use_concat&lt;/code&gt; (or-expansion 유도), &lt;code&gt;no_expand&lt;/code&gt; (or-expansion 방지)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics use_concat */ *
from hr.employees
where job_id = 'IT_PROG'
or department_id = 20;  2    3    4

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- -------------
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20
        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20
        103 Alexander            Hunold                    AHUNOLD                   590.423.4567         03-JAN-06 IT_PROG       9000                       102            60
        104 Bruce                Ernst                     BERNST                    590.423.4568         21-MAY-07 IT_PROG       6000                       103            60
        105 David                Austin                    DAUSTIN                   590.423.4569         25-JUN-05 IT_PROG       4800                       103            60
        106 Valli                Pataballa                 VPATABAL                  590.423.4560         05-FEB-06 IT_PROG       4800                       103            60
        107 Diana                Lorentz                   DLORENTZ                  590.423.5567         07-FEB-07 IT_PROG       4200                       103            60

7 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  f436dra8jq6tw, child number 0
-------------------------------------
select /*+ gather_plan_statistics use_concat */ * from hr.employees
where job_id = 'IT_PROG' or department_id = 20

Plan hash value: 1672003501

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      7 |00:00:00.01 |       6 |
|   1 |  CONCATENATION                       |                   |      1 |        |      7 |00:00:00.01 |       6 |
|   2 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       4 |
|*  3 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  4 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      5 |      5 |00:00:00.01 |       2 |
|*  5 |    INDEX RANGE SCAN                  | EMP_JOB_IX        |      1 |      5 |      5 |00:00:00.01 |       1 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=20)
   4 - filter(LNNVL(&quot;DEPARTMENT_ID&quot;=20))
   5 - access(&quot;JOB_ID&quot;='IT_PROG')

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;컬럼 분포 조회&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select department_id, count(*) from hr.employees group by department_id order by 2 desc;

DEPARTMENT_ID   COUNT(*)
------------- ----------
           50         45
           80         34
          100          6
           30          6
           60          5
           90          3
           20          2
          110          2
           10          1
                       1
           40          1
           70          1

12 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;department_id = 50&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;50번 부서에 소속된 사원 수는 45명으로 employees 테이블의 절반 정도를 차지함&lt;/li&gt;
&lt;li&gt;인덱스 range scan 보다는 테이블 full scan이 효과적&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where department_id = 50;

...
45 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  fjqs7d186a8fa, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees
where department_id = 50

Plan hash value: 1445457117

-----------------------------------------------------------------------------------------
| Id  | Operation         | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |      1 |        |     45 |00:00:00.01 |       9 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |      1 |     45 |     45 |00:00:00.01 |       9 |
-----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot;=50)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;array size를 늘려주면 테이블 스캔 효율을 더 높일 수 있음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; set array 100
SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.employees
where department_id = 50;  2    3

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  fjqs7d186a8fa, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees
where department_id = 50

Plan hash value: 1445457117

-----------------------------------------------------------------------------------------
| Id  | Operation         | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |      1 |        |     45 |00:00:00.01 |       7 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |      1 |     45 |     45 |00:00:00.01 |       7 |
-----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot;=50)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;인덱스 힌트 강제 사용&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics index(e emp_department_ix) */ *
from hr.employees e
where department_id = 50; 

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5hzmw8nd9rdt6, child number 0
-------------------------------------
select /*+ gather_plan_statistics index(e emp_department_ix) */ * from
hr.employees e where department_id = 50

Plan hash value: 235881476

-------------------------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |                   |      1 |        |     45 |00:00:00.01 |       6 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |     45 |     45 |00:00:00.01 |       6 |
|*  2 |   INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |     45 |     45 |00:00:00.01 |       2 |
-------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;DEPARTMENT_ID&quot;=50)

20 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;use_concat&lt;/code&gt; 힌트 사용 &amp;rarr; or-expansion 일어남&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics use_concat */ *
from hr.employees
where job_id = 'IT_PROG'
or department_id = 50;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  25r15r8u2tcp0, child number 0
-------------------------------------
select /*+ gather_plan_statistics use_concat */ * from hr.employees
where job_id = 'IT_PROG' or department_id = 50

Plan hash value: 1214418925

-------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name       | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |            |      1 |        |     50 |00:00:00.01 |      10 |
|   1 |  CONCATENATION                       |            |      1 |        |     50 |00:00:00.01 |      10 |
|   2 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES  |      1 |      5 |      5 |00:00:00.01 |       4 |
|*  3 |    INDEX RANGE SCAN                  | EMP_JOB_IX |      1 |      5 |      5 |00:00:00.01 |       2 |
|*  4 |   TABLE ACCESS FULL                  | EMPLOYEES  |      1 |     43 |     45 |00:00:00.01 |       6 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;JOB_ID&quot;='IT_PROG')
   4 - filter((&quot;DEPARTMENT_ID&quot;=50 AND LNNVL(&quot;JOB_ID&quot;='IT_PROG')))

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;아래 쿼리와 같이 쿼리 변환이 수행됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ * 
from hr.employees 
where job_id = 'IT_PROG'
and lnnvl(department_id = 50)
union all
select * from hr.employees where department_id = 50;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  6jhpvckvn8tmn, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where job_id =
'IT_PROG' and lnnvl(department_id = 50) union all select * from
hr.employees where department_id = 50

Plan hash value: 3092441848

-------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name       | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |            |      1 |        |     50 |00:00:00.01 |      10 |
|   1 |  UNION-ALL                           |            |      1 |        |     50 |00:00:00.01 |      10 |
|*  2 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES  |      1 |      3 |      5 |00:00:00.01 |       4 |
|*  3 |    INDEX RANGE SCAN                  | EMP_JOB_IX |      1 |      5 |      5 |00:00:00.01 |       2 |
|*  4 |   TABLE ACCESS FULL                  | EMPLOYEES  |      1 |     45 |     45 |00:00:00.01 |       6 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(LNNVL(&quot;DEPARTMENT_ID&quot;=50))
   3 - access(&quot;JOB_ID&quot;='IT_PROG')
   4 - filter(&quot;DEPARTMENT_ID&quot;=50)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;힌트까지 명시&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics index(e emp_job_ix) */ * 
from hr.employees e
where job_id = 'IT_PROG'
and lnnvl(department_id = 50)
union all
select /*+ full(e) */ * from hr.employees e where department_id = 50;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  cy8gmmw0s35uk, child number 0
-------------------------------------
select /*+ gather_plan_statistics index(e emp_job_ix) */ * from
hr.employees e where job_id = 'IT_PROG' and lnnvl(department_id = 50)
union all select /*+ full(e) */ * from hr.employees e where
department_id = 50

Plan hash value: 3092441848

-------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name       | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |            |      1 |        |     50 |00:00:00.01 |      10 |
|   1 |  UNION-ALL                           |            |      1 |        |     50 |00:00:00.01 |      10 |
|*  2 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES  |      1 |      3 |      5 |00:00:00.01 |       4 |
|*  3 |    INDEX RANGE SCAN                  | EMP_JOB_IX |      1 |      5 |      5 |00:00:00.01 |       2 |
|*  4 |   TABLE ACCESS FULL                  | EMPLOYEES  |      1 |     45 |     45 |00:00:00.01 |       6 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - filter(LNNVL(&quot;DEPARTMENT_ID&quot;=50))
   3 - access(&quot;JOB_ID&quot;='IT_PROG')
   4 - filter(&quot;DEPARTMENT_ID&quot;=50)

26 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;분석 함수&lt;/h1&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;sum&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;20번 부서 사원 salary 누적 합 구하기&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;employees 테이블을 2번 읽음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ e1.employee_id, e1.salary, e1.department_id, sum(e2.salary) total
from hr.employees e1, hr.employees e2
where e1.employee_id &amp;gt;= e2.employee_id
and e1.department_id = e2.department_id
and e1.department_id = 20
group by e1.employee_id, e1.salary, e1.department_id;  2    3    4    5    6

EMPLOYEE_ID     SALARY DEPARTMENT_ID      TOTAL
----------- ---------- ------------- ----------
        201      13000            20      13000
        202       6000            20      19000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2h6gupfxkgtq9, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e1.employee_id, e1.salary,
e1.department_id, sum(e2.salary) total from hr.employees e1,
hr.employees e2 where e1.employee_id &amp;gt;= e2.employee_id and
e1.department_id = e2.department_id and e1.department_id = 20 group by
e1.employee_id, e1.salary, e1.department_id

Plan hash value: 892704000

-------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |       OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |                   |      1 |        |      2 |00:00:00.01 |       5 |            |       |          |
|   1 |  HASH GROUP BY                         |                   |      1 |      2 |      2 |00:00:00.01 |       5 |       1127K|  1127K|  618K (0)|
|   2 |   NESTED LOOPS                         |                   |      1 |      2 |      3 |00:00:00.01 |       5 |            |       |          |
|   3 |    NESTED LOOPS                        |                   |      1 |      4 |      4 |00:00:00.01 |       4 |            |       |          |
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |            |       |          |
|*  5 |      INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |            |       |          |
|*  6 |     INDEX RANGE SCAN                   | EMP_DEPARTMENT_IX |      2 |      2 |      4 |00:00:00.01 |       2 |            |       |          |
|*  7 |    TABLE ACCESS BY INDEX ROWID         | EMPLOYEES         |      4 |      1 |      3 |00:00:00.01 |       1 |            |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;E1&quot;.&quot;DEPARTMENT_ID&quot;=20)
   6 - access(&quot;E2&quot;.&quot;DEPARTMENT_ID&quot;=20)
   7 - filter(&quot;E1&quot;.&quot;EMPLOYEE_ID&quot;&amp;gt;=&quot;E2&quot;.&quot;EMPLOYEE_ID&quot;)

Note
-----
   - this is an adaptive plan

34 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;전체 사원 salary 누적 합 구하기&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ 
    e1.employee_id, 
    e1.salary, 
    sum(e2.salary) total
from hr.employees e1, hr.employees e2
where e1.employee_id &amp;gt;= e2.employee_id 
group by e1.employee_id, e1.salary;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5j7pp65uk5vcb, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e1.employee_id, e1.salary,
sum(e2.salary) total from hr.employees e1, hr.employees e2 where
e1.employee_id &amp;gt;= e2.employee_id group by e1.employee_id, e1.salary

Plan hash value: 2897100764

---------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name          | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |               |      1 |        |    107 |00:00:00.02 |      10 |   |        |          |
|   1 |  HASH GROUP BY                         |               |      1 |   4389 |    107 |00:00:00.02 |      10 |  1116K|  1116K| 1482K (0)|
|   2 |   MERGE JOIN                           |               |      1 |   5778 |   5778 |00:00:00.01 |      10 |   |        |          |
|   3 |    SORT JOIN                           |               |      1 |    107 |    107 |00:00:00.01 |       4 |  9216 |  9216 | 8192  (0)|
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES     |      1 |    107 |    107 |00:00:00.01 |       4 |   |        |          |
|   5 |      INDEX FULL SCAN                   | EMP_EMP_ID_PK |      1 |    107 |    107 |00:00:00.01 |       1 |   |        |          |
|*  6 |    SORT JOIN                           |               |    107 |    107 |   5778 |00:00:00.01 |       6 |  9216 |  9216 | 8192  (0)|
|   7 |     TABLE ACCESS FULL                  | EMPLOYEES     |      1 |    107 |    107 |00:00:00.01 |       6 |   |        |          |
---------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   6 - access(INTERNAL_FUNCTION(&quot;E1&quot;.&quot;EMPLOYEE_ID&quot;)&amp;gt;=INTERNAL_FUNCTION(&quot;E2&quot;.&quot;EMPLOYEE_ID&quot;))
       filter(INTERNAL_FUNCTION(&quot;E1&quot;.&quot;EMPLOYEE_ID&quot;)&amp;gt;=INTERNAL_FUNCTION(&quot;E2&quot;.&quot;EMPLOYEE_ID&quot;))

27 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;분석 함수로 20번 부서 사원 salary 누적 합 구하기&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;sum(salary) over (partition by department_id, employee_id)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ employee_id, salary, department_id, 
        sum(salary) over (partition by department_id, employee_id)
from hr.employees
where department_id = 20
order by salary;

EMPLOYEE_ID     SALARY DEPARTMENT_ID SUM(SALARY)OVER(PARTITIONBYDEPARTMENT_ID,EMPLOYEE_ID)
----------- ---------- ------------- -----------------------------------------------------
        202       6000            20                                                  6000
        201      13000            20                                                 13000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  b0py96mz9cgyf, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ employee_id, salary,
department_id, sum(salary) over (partition by department_id,
employee_id) from hr.employees where department_id = 20 order by salary

Plan hash value: 599948670

------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |                   |      1 |        |      2 |00:00:00.01 |       2 |    |       |          |
|   1 |  SORT ORDER BY                        |                   |      1 |      2 |      2 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   2 |   WINDOW SORT                         |                   |      1 |      2 |      2 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |    |       |          |
|*  4 |     INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |    |       |          |
------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;DEPARTMENT_ID&quot;=20)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;분석 함수로 전체 사원 salary 누적 합 구하기&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;sum(salary) over (order by employee_id)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ employee_id, salary, department_id,
        sum(salary) over (order by employee_id) total 
from hr.employees;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  a70m90hdu830j, child number 0
-------------------------------------
select /*+ gather_plan_statistics */  employee_id, salary,
department_id,  sum(salary) over (order by employee_id) total from
hr.employees

Plan hash value: 3780749497

-----------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name          | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |               |      1 |        |    107 |00:00:00.01 |       4 |       |       |       |
|   1 |  WINDOW BUFFER               |               |      1 |    107 |    107 |00:00:00.01 |       4 |  9216 |  9216 | 8192  (0)|
|   2 |   TABLE ACCESS BY INDEX ROWID| EMPLOYEES     |      1 |    107 |    107 |00:00:00.01 |       4 |       |       |       |
|   3 |    INDEX FULL SCAN           | EMP_EMP_ID_PK |      1 |    107 |    107 |00:00:00.01 |       1 |       |       |       |
-----------------------------------------------------------------------------------------------------------------------------------

17 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;avg, max, min&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;전체 급여 통계&lt;/h3&gt;
&lt;pre class=&quot;yaml&quot;&gt;&lt;code&gt;select
        employee_id, salary,
        sum(salary) over () total, # 전체 합
        avg(salary) over () avg, # 전체 평균
        max(salary) over () max, # 최대값
        min(salary) over () min # 최소값
from hr.employees;  2    3    4    5    6    7

EMPLOYEE_ID     SALARY      TOTAL        AVG        MAX        MIN
----------- ---------- ---------- ---------- ---------- ----------
        100      20000     687856 6428.56075      20000       2100
        101      17000     687856 6428.56075      20000       2100
        102      17000     687856 6428.56075      20000       2100
        103       9000     687856 6428.56075      20000       2100
        104       6000     687856 6428.56075      20000       2100
        105       4800     687856 6428.56075      20000       2100
        106       4800     687856 6428.56075      20000       2100
        107       4200     687856 6428.56075      20000       2100
        108      12008     687856 6428.56075      20000       2100
        109       9000     687856 6428.56075      20000       2100
        110       8200     687856 6428.56075      20000       2100&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;부서별 급여 통계&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select employee_id, salary,
        sum(salary) over (partition by department_id) total,
        avg(salary) over (partition by department_id) avg,
        max(salary) over (partition by department_id) max,
        min(salary) over (partition by department_id) min
from hr.employees
order by employee_id;  2    3    4    5    6    7    8

EMPLOYEE_ID     SALARY      TOTAL        AVG        MAX        MIN
----------- ---------- ---------- ---------- ---------- ----------
        100      20000      54000      18000      20000      17000
        101      17000      54000      18000      20000      17000
        102      17000      54000      18000      20000      17000
        103       9000      28800       5760       9000       4200
        104       6000      28800       5760       9000       4200
        105       4800      28800       5760       9000       4200
        106       4800      28800       5760       9000       4200
        107       4200      28800       5760       9000       4200
        108      12008      51608 8601.33333      12008       6900
        109       9000      51608 8601.33333      12008       6900
        110       8200      51608 8601.33333      12008       6900&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;rank, dense_rank&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;급여 순위&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select employee_id, salary,
                rank() over (order by salary desc) rank,
                dense_rank() over (order by salary desc) dense_rank
from hr.employees
order by salary desc;  2    3    4    5

EMPLOYEE_ID     SALARY       RANK DENSE_RANK
----------- ---------- ---------- ----------
        100      20000          1          1
        101      17000          2          2
        102      17000          2          2
        145      14000          4          3
        146      13500          5          4
        201      13000          6          5
        108      12008          7          6
        205      12008          7          6
        147      12000          9          7
        168      11500         10          8
        114      11000         11          9
        148      11000         11          9
        174      11000         11          9&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;부서별 급여 순위&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select employee_id, salary, department_id,
                rank() over (partition by department_id order by salary desc) rank,
                dense_rank() over (partition by department_id order by salary desc) dense_rank
from hr.employees
order by department_id;  2    3    4    5

EMPLOYEE_ID     SALARY DEPARTMENT_ID       RANK DENSE_RANK
----------- ---------- ------------- ---------- ----------
        200       4840            10          1          1
        201      13000            20          1          1
        202       6000            20          2          2
        114      11000            30          1          1
        115       3100            30          2          2
        116       2900            30          3          3
        117       2800            30          4          4
        118       2600            30          5          5
        119       2500            30          6          6
        203       6500            40          1          1
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;TOP-N 분석&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;최고 급여 10위까지 출력&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select rownum, employee_id, salary
from (select employee_id, salary
                from hr.employees
                order by salary desc)
where rownum &amp;lt;= 10;  2    3    4    5

    ROWNUM EMPLOYEE_ID     SALARY
---------- ----------- ----------
         1         100      24000
         2         101      17000
         3         102      17000
         4         145      14000
         5         146      13500
         6         201      13000
         7         108      12008
         8         205      12008
         9         147      12000
        10         168      11500

10 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;rownum을 기준으로 하면 salary에 중복 값이 존재하기 때문에 누락되는 사원이 있음&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;rank&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;중복 값이 있을 경우 같은 순위를 부여하고 중복 값만큼 순위에 gap이 생김&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select *
from (select employee_id, salary, rank() over (order by salary desc) rank
                from hr.employees)
where rank &amp;lt;= 10;  2    3    4

EMPLOYEE_ID     SALARY       RANK
----------- ---------- ----------
        100      24000          1
        101      17000          2
        102      17000          2
        145      14000          4
        146      13500          5
        201      13000          6
        108      12008          7
        205      12008          7
        147      12000          9
        168      11500         10

10 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;dense_rank&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;중복 값이 있을 경우 같은 순위를 부여하고 이어서 순위를 부여하기 때문에 순위에 gap이 생기지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select *
from (select employee_id, salary, dense_rank() over (order by salary desc) rank
                from hr.employees)
where rank &amp;lt;= 10;  2    3    4

EMPLOYEE_ID     SALARY       RANK
----------- ---------- ----------
        100      24000          1
        101      17000          2
        102      17000          2
        145      14000          3
        146      13500          4
        201      13000          5
        108      12008          6
        205      12008          6
        147      12000          7
        168      11500          8
        114      11000          9
        174      11000          9
        148      11000          9
        149      10500         10
        162      10500         10

15 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;row_number&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;정렬 순서에 따라 번호를 부여하기 때문에 rownum 슈도 컬럼을 사용했을 때와 마찬가지로 중복 값이 있는 경우 누락되는 사원이 있을 수 있음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select *
from (select employee_id, salary, row_number() over (order by salary desc) rank
                from hr.employees)
where rank &amp;lt;= 10;  2    3    4

EMPLOYEE_ID     SALARY       RANK
----------- ---------- ----------
        100      24000          1
        101      17000          2
        102      17000          3
        145      14000          4
        146      13500          5
        201      13000          6
        108      12008          7
        205      12008          8
        147      12000          9
        168      11500         10

10 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;상호 관련 서브 쿼리 사용하여 부서 평균 급여보다 급여가 많은 사원 조회&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;뷰가 생성됨&lt;/li&gt;
&lt;li&gt;employees 테이블을 한 번만 조회&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ e.employee_id, e.salary, d.department_id, d.department_name
from hr.employees e, hr.departments d
where e.department_id = d.department_id
and e.salary &amp;gt; (select avg(salary) from hr.employees where department_id = d.department_id);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  bd4ucf94a2d9q, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.employee_id, e.salary,
d.department_id, d.department_name from hr.employees e, hr.departments
d where e.department_id = d.department_id and e.salary &amp;gt; (select
avg(salary) from hr.employees where department_id = d.department_id)

Plan hash value: 2470543756

--------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                      | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
--------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT               |             |      1 |        |     38 |00:00:00.01 |       8 |      2 |   ||          |
|*  1 |  VIEW                          | VW_WIF_1    |      1 |    106 |     38 |00:00:00.01 |       8 |      2 |   ||          |
|   2 |   WINDOW BUFFER                |             |      1 |    106 |    106 |00:00:00.01 |       8 |      2 | 11264 | 11264 |10240       (0)|
|   3 |    MERGE JOIN                  |             |      1 |    106 |    106 |00:00:00.01 |       8 |      2 |   ||          |
|   4 |     TABLE ACCESS BY INDEX ROWID| DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       2 |      2 |   ||          |
|   5 |      INDEX FULL SCAN           | DEPT_ID_PK  |      1 |     27 |     27 |00:00:00.01 |       1 |      1 |   ||          |
|*  6 |     SORT JOIN                  |             |     27 |    107 |    106 |00:00:00.01 |       6 |      0 | 18432 | 18432 |16384       (0)|
|   7 |      TABLE ACCESS FULL         | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       6 |      0 |   ||          |
--------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;VW_COL_5&quot; IS NOT NULL)
   6 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

29 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;인라인 뷰로 부서 별 평균 급여 구해 놓은 후 조인&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ e.employee_id, e.salary, d.department_id, d.department_name
from hr.employees e, hr.departments d, 
    (select department_id, avg(salary) avg_sal
    from hr.employees
    group by department_id) c
where e.department_id = d.department_id
and e.department_id = c.department_id
and e.salary &amp;gt; c.avg_sal;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  44kc2yynznzvv, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.employee_id, e.salary,
d.department_id, d.department_name from hr.employees e, hr.departments
d,     (select department_id, avg(salary) avg_sal     from hr.employees
    group by department_id) c where e.department_id = d.department_id
and e.department_id = c.department_id and e.salary &amp;gt; c.avg_sal

Plan hash value: 3630439784

----------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |             |      1 |        |     38 |00:00:00.01 |      14 |       |       |       |
|*  1 |  HASH JOIN                    |             |      1 |     17 |     38 |00:00:00.01 |      14 |  1335K|  1335K| 1457K (0)|
|   2 |   MERGE JOIN                  |             |      1 |    106 |    106 |00:00:00.01 |       8 |       |       |       |
|   3 |    TABLE ACCESS BY INDEX ROWID| DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |       |
|   4 |     INDEX FULL SCAN           | DEPT_ID_PK  |      1 |     27 |     27 |00:00:00.01 |       1 |       |       |       |
|*  5 |    SORT JOIN                  |             |     27 |    107 |    106 |00:00:00.01 |       6 | 15360 | 15360 |14336  (0)|
|   6 |     TABLE ACCESS FULL         | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |       |
|   7 |   VIEW                        |             |      1 |     11 |     12 |00:00:00.01 |       6 |       |       |       |
|   8 |    HASH GROUP BY              |             |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 1278K (0)|
|   9 |     TABLE ACCESS FULL         | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |       |
----------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;C&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;SALARY&quot;&amp;gt;&quot;C&quot;.&quot;AVG_SAL&quot;)
   5 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

33 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;인라인 뷰로 부서 평균 급여보다 급여가 많은 사원 조회&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ e.employee_id, e.salary
from hr.employees e,
    (select department_id, avg(salary) avg_sal
    from hr.employees
    group by department_id) c
where e.department_id = c.department_id
and e.salary &amp;gt; c.avg_sal;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  55x2ys9f6zsz0, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.employee_id, e.salary from
hr.employees e,     (select department_id, avg(salary) avg_sal     from
hr.employees     group by department_id) c where e.department_id =
c.department_id and e.salary &amp;gt; c.avg_sal

Plan hash value: 2695105989

-----------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |           |      1 |        |     38 |00:00:00.01 |      13 |       |       |          |
|*  1 |  HASH JOIN           |           |      1 |     17 |     38 |00:00:00.01 |      13 |  1506K|  1506K| 1157K (0)|
|   2 |   VIEW               |           |      1 |     11 |     12 |00:00:00.01 |       6 |       |       |          |
|   3 |    HASH GROUP BY     |           |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2340K (0)|
|   4 |     TABLE ACCESS FULL| EMPLOYEES |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |          |
|   5 |   TABLE ACCESS FULL  | EMPLOYEES |      1 |    107 |    107 |00:00:00.01 |       7 |       |       |          |
-----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;C&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;SALARY&quot;&amp;gt;&quot;C&quot;.&quot;AVG_SAL&quot;)

Note
-----
   - this is an adaptive plan

30 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;서브쿼리로 부서 평균 급여보다 급여가 많은 사원 조회&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;내부적으로 인라인 뷰를 생성하도록 쿼리 변환 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ e.employee_id, e.salary
from hr.employees e
where e.salary &amp;gt; (select avg(salary) from hr.employees where department_id = e.department_id);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  cmh82xw32gkgr, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.employee_id, e.salary from
hr.employees e where e.salary &amp;gt; (select avg(salary) from hr.employees
where department_id = e.department_id)

Plan hash value: 2167610409

-----------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |           |      1 |        |     38 |00:00:00.01 |      13 |       |       |          |
|*  1 |  HASH JOIN           |           |      1 |     17 |     38 |00:00:00.01 |      13 |  1506K|  1506K| 1174K (0)|
|   2 |   VIEW               | VW_SQ_1   |      1 |     11 |     12 |00:00:00.01 |       6 |       |       |          |
|   3 |    HASH GROUP BY     |           |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2338K (0)|
|   4 |     TABLE ACCESS FULL| EMPLOYEES |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |          |
|   5 |   TABLE ACCESS FULL  | EMPLOYEES |      1 |    107 |    107 |00:00:00.01 |       7 |       |       |          |
-----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;ITEM_1&quot;=&quot;E&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;SALARY&quot;&amp;gt;&quot;AVG(SALARY)&quot;)

Note
-----
   - this is an adaptive plan

29 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;집계 서브 쿼리 제거 기능 비활성화&lt;/h3&gt;
&lt;pre class=&quot;livecodeserver&quot;&gt;&lt;code&gt;# 집계 서브 쿼리 제거를 제어하는 파라미터
SYS@ora19c&amp;gt; select a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_remove_aggr_subquery';  2    3    4

PARAMETER                      VALUE
------------------------------ ------------------------------
_remove_aggr_subquery          TRUE&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics opt_param('_remove_aggr_subquery','false') */ e.employee_id, e.salary, d.department_id, d.department_name
from hr.employees e, hr.departments d
where e.department_id = d.department_id
and e.salary &amp;gt; (select avg(salary) from hr.employees where department_id = d.department_id);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  axfmmv6t82h33, child number 0
-------------------------------------
select /*+ gather_plan_statistics opt_param('_remove_aggr_subquery','fal
se') */ e.employee_id, e.salary, d.department_id, d.department_name
from hr.employees e, hr.departments d where e.department_id =
d.department_id and e.salary &amp;gt; (select avg(salary) from hr.employees
where department_id = d.department_id)

Plan hash value: 1243603226

----------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |             |      1 |        |     38 |00:00:00.01 |      15 |       |       |       |
|*  1 |  HASH JOIN                    |             |      1 |      5 |     38 |00:00:00.01 |      15 |  1250K|  1250K| 1148K (0)|
|   2 |   MERGE JOIN                  |             |      1 |     11 |     11 |00:00:00.01 |       8 |       |       |       |
|   3 |    TABLE ACCESS BY INDEX ROWID| DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |       |
|   4 |     INDEX FULL SCAN           | DEPT_ID_PK  |      1 |     27 |     27 |00:00:00.01 |       1 |       |       |       |
|*  5 |    SORT JOIN                  |             |     27 |     11 |     11 |00:00:00.01 |       6 |  2048 |  2048 | 2048  (0)|
|   6 |     VIEW                      | VW_SQ_1     |      1 |     11 |     12 |00:00:00.01 |       6 |       |       |       |
|   7 |      HASH GROUP BY            |             |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2336K (0)|
|   8 |       TABLE ACCESS FULL       | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |       |
|   9 |   TABLE ACCESS FULL           | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       7 |       |       |       |
----------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;SALARY&quot;&amp;gt;&quot;AVG(SALARY)&quot;)
   5 - access(&quot;ITEM_1&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;ITEM_1&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

37 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;집계 서브 쿼리 제거 기능을 비활성화했기 때문에 employees를 두 번 조회&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select *
from (select d.department_id, d.department_name, e1.avg_sal
                from (select department_id, avg(salary) avg_sal
                                from hr.employees
                                group by department_id) e1, hr.departments d
                where e1.department_id = d.department_id) e;  2    3    4    5    6

DEPARTMENT_ID DEPARTMENT_NAME                   AVG_SAL
------------- ------------------------------ ----------
           10 Administration                       4840
           20 Marketing                            9500
           30 Purchasing                           4150
           40 Human Resources                      6500
           50 Shipping                       3475.55556
           60 IT                                   5760
           70 Public Relations                    10000
           80 Sales                          8955.88235
           90 Executive                      19333.3333
          100 Finance                        8601.33333
          110 Accounting                          10154

11 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;아래 쿼리처럼 작성하면 집계 서브 쿼리 제거 기능을 비활성화했을 때와 동일하게 수행됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ e2.*, e.*
from (select d.department_id, d.department_name, e1.avg_sal
        from (select department_id, avg(salary) avg_sal
                from hr.employees
                group by department_id) e1, hr.departments d
        where e1.department_id = d.department_id) e, hr.employees e2
where e.department_id = e2.department_id
and e2.salary &amp;gt; e.avg_sal;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  71kdpzrcmzcp8, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e2.*, e.* from (select
d.department_id, d.department_name, e1.avg_sal   from (select
department_id, avg(salary) avg_sal     from hr.employees     group by
department_id) e1, hr.departments d   where e1.department_id =
d.department_id) e, hr.employees e2 where e.department_id =
e2.department_id and e2.salary &amp;gt; e.avg_sal

Plan hash value: 2393354249

----------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |             |      1 |        |     38 |00:00:00.01 |      15 |       |       |       |
|*  1 |  HASH JOIN                    |             |      1 |      5 |     38 |00:00:00.01 |      15 |  1061K|  1061K| 1154K (0)|
|   2 |   MERGE JOIN                  |             |      1 |     11 |     11 |00:00:00.01 |       8 |       |       |       |
|   3 |    TABLE ACCESS BY INDEX ROWID| DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |       |
|   4 |     INDEX FULL SCAN           | DEPT_ID_PK  |      1 |     27 |     27 |00:00:00.01 |       1 |       |       |       |
|*  5 |    SORT JOIN                  |             |     27 |     11 |     11 |00:00:00.01 |       6 |  2048 |  2048 | 2048  (0)|
|   6 |     VIEW                      |             |      1 |     11 |     12 |00:00:00.01 |       6 |       |       |       |
|   7 |      HASH GROUP BY            |             |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2347K (0)|
|   8 |       TABLE ACCESS FULL       | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |       |
|   9 |   TABLE ACCESS FULL           | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       7 |       |       |       |
----------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;E2&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E2&quot;.&quot;SALARY&quot;&amp;gt;&quot;E1&quot;.&quot;AVG_SAL&quot;)
   5 - access(&quot;E1&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E1&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

38 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;상호 관련 서브 쿼리에서 분석 함수를 사용하여 서브 쿼리 제거&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from (select e.employee_id, e.salary, e.department_id, 
        avg(e.salary) over (partition by e.department_id) dept_avg,
        case when e.salary &amp;gt; avg(e.salary) over (partition by e.department_id) then 'x' end case_sal,
        d.department_name
        from hr.employees e, hr.departments d
        where e.department_id = d.department_id)
where case_sal = 'x';        

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  765pvjvdapbnf, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from (select e.employee_id,
e.salary, e.department_id,   avg(e.salary) over (partition by
e.department_id) dept_avg,   case when e.salary &amp;gt; avg(e.salary) over
(partition by e.department_id) then 'x' end case_sal,
d.department_name   from hr.employees e, hr.departments d   where
e.department_id = d.department_id) where case_sal = 'x'

Plan hash value: 1227561690

-----------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                      | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT               |             |      1 |        |     38 |00:00:00.01 |       8 |       |       |       |
|*  1 |  VIEW                          |             |      1 |    106 |     38 |00:00:00.01 |       8 |       |       |       |
|   2 |   WINDOW BUFFER                |             |      1 |    106 |    106 |00:00:00.01 |       8 |  9216 |  9216 | 8192  (0)|
|   3 |    MERGE JOIN                  |             |      1 |    106 |    106 |00:00:00.01 |       8 |       |       |       |
|   4 |     TABLE ACCESS BY INDEX ROWID| DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |       |
|   5 |      INDEX FULL SCAN           | DEPT_ID_PK  |      1 |     27 |     27 |00:00:00.01 |       1 |       |       |       |
|*  6 |     SORT JOIN                  |             |     27 |    107 |    106 |00:00:00.01 |       6 | 15360 | 15360 |14336  (0)|
|   7 |      TABLE ACCESS FULL         | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |       |
-----------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;CASE_SAL&quot;='x')
   6 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

31 rows selected.
&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <category>튜닝</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/232</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260212-TIL#entry232comment</comments>
      <pubDate>Sun, 15 Mar 2026 22:03:19 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260211 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260211-TIL</link>
      <description>&lt;h1&gt;쿼리 변환(Cont.)&lt;/h1&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Semi Join&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;서브쿼리를 조인으로 바꿈&lt;/li&gt;
&lt;li&gt;조인으로 바뀐 서브쿼리는 항상 후행 처리(inner)&lt;/li&gt;
&lt;li&gt;메인 쿼리의 행이 서브 쿼리의 행과 매치되면 조인 조건에 만족되니 해당 행에 대해서 더이상 검색을 진행하지 않음&lt;/li&gt;
&lt;li&gt;exists : 조인에 성공하는 서브 쿼리 데이터를 만나는 순간 결과 집합에 담고 메인 쿼리 다음 행을 처리&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;소속 사원이 있는 부서 정보만 출력&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where exists (select 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           30 Purchasing                            114        1700
           40 Human Resources                       203        2400
           50 Shipping                              121        1500
           60 IT                                    103        1400
           70 Public Relations                      204        2700
           80 Sales                                 145        2500
           90 Executive                             100        1700
          100 Finance                               108        1700
          110 Accounting                            205        1700

11 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  dp91nhv510566, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
exists (select 'x' from hr.employees where department_id =
d.department_id)

Plan hash value: 2605691773

--------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     11 |00:00:00.01 |      10 |
|   1 |  NESTED LOOPS SEMI |                   |      1 |     11 |     11 |00:00:00.01 |      10 |
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       7 |
|*  3 |   INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |     44 |     11 |00:00:00.01 |       3 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조인으로 풀 경우 결과 건수가 맞지 않음&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;메인 쿼리 집합(departments)과 서브 쿼리 집합(employees)이 1 : M 관계이기 때문&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select d.*
from hr.departments d, hr.employees e
where d.department_id = e.department_id;  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           20 Marketing                             201        1800
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
                                                                    ...
          100 Finance                               108        1700
          100 Finance                               108        1700
          100 Finance                               108        1700
          100 Finance                               108        1700
          100 Finance                               108        1700
          100 Finance                               108        1700
          110 Accounting                            205        1700
          110 Accounting                            205        1700

106 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;서브 쿼리에 distinct 사용&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;HASH UNIQUE 작업으로 메모리 사용량이 증가&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ d.*
from hr.departments d, (select distinct department_id from hr.employees) e
where d.department_id = e.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  43r47ys7vb465, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ d.* from hr.departments d, (select
distinct department_id from hr.employees) e where d.department_id =
e.department_id

Plan hash value: 3639742973

-------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |                   |      1 |        |     11 |00:00:00.01 |       9 |       |       |      |
|   1 |  VIEW                | VM_NWVW_1         |      1 |     11 |     11 |00:00:00.01 |       9 |       |       |      |
|   2 |   HASH UNIQUE        |                   |      1 |     11 |     11 |00:00:00.01 |       9 |  1028K|  1028K| 1035K (0)|
|   3 |    NESTED LOOPS SEMI |                   |      1 |     11 |     11 |00:00:00.01 |       9 |       |       |      |
|   4 |     TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       6 |       |       |      |
|*  5 |     INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |     44 |     11 |00:00:00.01 |       3 |       |       |      |
-------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENT_ID&quot;)

24 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;NL Semi Join&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;unnest nl_sj&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where exists (select /*+ unnest nl_sj */ 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           30 Purchasing                            114        1700
           40 Human Resources                       203        2400
           50 Shipping                              121        1500
           60 IT                                    103        1400
           70 Public Relations                      204        2700
           80 Sales                                 145        2500
           90 Executive                             100        1700
          100 Finance                               108        1700
          110 Accounting                            205        1700

11 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  14t9wuf20gj4p, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
exists (select /*+ unnest nl_sj */ 'x' from hr.employees where
department_id = d.department_id)

Plan hash value: 2605691773

--------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     11 |00:00:00.01 |      10 |
|   1 |  NESTED LOOPS SEMI |                   |      1 |     11 |     11 |00:00:00.01 |      10 |
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       7 |
|*  3 |   INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |     44 |     11 |00:00:00.01 |       3 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Sort Merge Semi Join&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;unnest merge_sj&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where exists (select /*+ unnest merge_sj */ 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           30 Purchasing                            114        1700
           40 Human Resources                       203        2400
           50 Shipping                              121        1500
           60 IT                                    103        1400
           70 Public Relations                      204        2700
           80 Sales                                 145        2500
           90 Executive                             100        1700
          100 Finance                               108        1700
          110 Accounting                            205        1700

11 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  brjj3kvxubgtn, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
exists (select /*+ unnest merge_sj */ 'x' from hr.employees where
department_id = d.department_id)

Plan hash value: 954076352

---------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |                   |      1 |        |    11 |00:00:00.01 |        5 |       |       |          |
|   1 |  MERGE JOIN SEMI             |                   |      1 |     11 |    11 |00:00:00.01 |        5 |       |       |          |
|   2 |   TABLE ACCESS BY INDEX ROWID| DEPARTMENTS       |      1 |     27 |    12 |00:00:00.01 |        4 |       |       |          |
|   3 |    INDEX FULL SCAN           | DEPT_ID_PK        |      1 |     27 |    12 |00:00:00.01 |        2 |       |       |          |
|*  4 |   SORT UNIQUE                |                   |     12 |    107 |    11 |00:00:00.01 |        1 |  2048 |  2048 | 2048  (0)|
|   5 |    INDEX FULL SCAN           | EMP_DEPARTMENT_IX |      1 |    107 |   106 |00:00:00.01 |        1 |       |       |          |
---------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Hash Semi Join&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;unnest hash_sj&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where exists (select /*+ unnest hash_sj */ 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           30 Purchasing                            114        1700
           40 Human Resources                       203        2400
           50 Shipping                              121        1500
           60 IT                                    103        1400
           70 Public Relations                      204        2700
           80 Sales                                 145        2500
           90 Executive                             100        1700
          100 Finance                               108        1700
          110 Accounting                            205        1700

11 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  bq5crgkx1cj2v, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
exists (select /*+ unnest hash_sj */ 'x' from hr.employees where
department_id = d.department_id)

Plan hash value: 1087652491

-----------------------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     11 |00:00:00.01 |       8 |       |       |          |
|*  1 |  HASH JOIN SEMI    |                   |      1 |     11 |     11 |00:00:00.01 |       8 |  1376K|  1376K| 1480K (0)|
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       6 |       |       |          |
|   3 |   INDEX FULL SCAN  | EMP_DEPARTMENT_IX |      1 |    107 |    106 |00:00:00.01 |       2 |       |       |          |
-----------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Filter&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;I/O가 많이 발생&lt;/li&gt;
&lt;li&gt;buffer pinning 작동 X&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where exists (select /*+ no_unnest */ 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           30 Purchasing                            114        1700
           40 Human Resources                       203        2400
           50 Shipping                              121        1500
           60 IT                                    103        1400
           70 Public Relations                      204        2700
           80 Sales                                 145        2500
           90 Executive                             100        1700
          100 Finance                               108        1700
          110 Accounting                            205        1700

11 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  cd9r5744st0s8, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
exists (select /*+ no_unnest */ 'x' from hr.employees where
department_id = d.department_id)

Plan hash value: 440241596

--------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     11 |00:00:00.01 |      35 |
|*  1 |  FILTER            |                   |      1 |        |     11 |00:00:00.01 |      35 |
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       8 |
|*  3 |   INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |      2 |     11 |00:00:00.01 |      27 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter( IS NOT NULL)
   3 - access(&quot;DEPARTMENT_ID&quot;=:B1)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Anti Join&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인의 값이 존재하지 않은 행을 찾음&lt;/li&gt;
&lt;li&gt;서브쿼리를 조인으로 바꿈&lt;/li&gt;
&lt;li&gt;조인으로 바뀐 서브쿼리는 항상 후행 처리(inner)&lt;/li&gt;
&lt;li&gt;메인 쿼리의 행이 서브 쿼리의 행과 매치되면 버려야 할 데이터이고, 서브 쿼리에 존재하지 않으면 우리가 찾는 데이터임&lt;/li&gt;
&lt;li&gt;힌트 : &lt;code&gt;nl_aj&lt;/code&gt;, &lt;code&gt;merge_aj&lt;/code&gt; , &lt;code&gt;hash_aj&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;not exists : 조인에 성공하는 서브 쿼리 데이터를 만나는 순간 버리고 메인 쿼리 다음 행을 처리&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where not exists (select 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
          120 Treasury                                         1700
          130 Corporate Tax                                    1700
          140 Control And Credit                               1700
          150 Shareholder Services                             1700
          160 Benefits                                         1700
          170 Manufacturing                                    1700
          180 Construction                                     1700
          190 Contracting                                      1700
          200 Operations                                       1700
          210 IT Support                                       1700
          220 NOC                                              1700
          230 IT Helpdesk                                      1700
          240 Government Sales                                 1700
          250 Retail Sales                                     1700
          260 Recruiting                                       1700
          270 Payroll                                          1700

16 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7vtzry23zbtv9, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where not
exists (select 'x' from hr.employees where department_id =
d.department_id)

Plan hash value: 3082375452

--------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     16 |00:00:00.01 |      11 |
|   1 |  NESTED LOOPS ANTI |                   |      1 |     17 |     16 |00:00:00.01 |      11 |
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       7 |
|*  3 |   INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |     41 |     11 |00:00:00.01 |       4 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;NL Anti Join&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;unnest nl_aj&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where not exists (select /*+ unnest nl_aj */ 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
          120 Treasury                                         1700
          130 Corporate Tax                                    1700
          140 Control And Credit                               1700
          150 Shareholder Services                             1700
          160 Benefits                                         1700
          170 Manufacturing                                    1700
          180 Construction                                     1700
          190 Contracting                                      1700
          200 Operations                                       1700
          210 IT Support                                       1700
          220 NOC                                              1700
          230 IT Helpdesk                                      1700
          240 Government Sales                                 1700
          250 Retail Sales                                     1700
          260 Recruiting                                       1700
          270 Payroll                                          1700

16 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  b9fzwgg2rw0qx, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where not
exists (select /*+ unnest nl_aj */ 'x' from hr.employees where
department_id = d.department_id)

Plan hash value: 3082375452

--------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     16 |00:00:00.01 |      11 |
|   1 |  NESTED LOOPS ANTI |                   |      1 |     17 |     16 |00:00:00.01 |      11 |
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       7 |
|*  3 |   INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |     41 |     11 |00:00:00.01 |       4 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Sort Merge Anti Join&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;unnest merge_aj&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where not exists (select /*+ unnest merge_aj */ 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
          120 Treasury                                         1700
          130 Corporate Tax                                    1700
          140 Control And Credit                               1700
          150 Shareholder Services                             1700
          160 Benefits                                         1700
          170 Manufacturing                                    1700
          180 Construction                                     1700
          190 Contracting                                      1700
          200 Operations                                       1700
          210 IT Support                                       1700
          220 NOC                                              1700
          230 IT Helpdesk                                      1700
          240 Government Sales                                 1700
          250 Retail Sales                                     1700
          260 Recruiting                                       1700
          270 Payroll                                          1700

16 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  6wp5drxz3d617, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where not
exists (select /*+ unnest merge_aj */ 'x' from hr.employees where
department_id = d.department_id)

Plan hash value: 1314441467

---------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |                   |      1 |        |    16 |00:00:00.01 |        5 |       |       |          |
|   1 |  MERGE JOIN ANTI             |                   |      1 |     17 |    16 |00:00:00.01 |        5 |       |       |          |
|   2 |   TABLE ACCESS BY INDEX ROWID| DEPARTMENTS       |      1 |     27 |    27 |00:00:00.01 |        4 |       |       |          |
|   3 |    INDEX FULL SCAN           | DEPT_ID_PK        |      1 |     27 |    27 |00:00:00.01 |        2 |       |       |          |
|*  4 |   SORT UNIQUE                |                   |     27 |    107 |    11 |00:00:00.01 |        1 |  2048 |  2048 | 2048  (0)|
|   5 |    INDEX FULL SCAN           | EMP_DEPARTMENT_IX |      1 |    107 |   106 |00:00:00.01 |        1 |       |       |          |
---------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Hash Anti Join&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;unnest hash_aj&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where not exists (select /*+ unnest hash_aj */ 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
          210 IT Support                                       1700
          200 Operations                                       1700
          270 Payroll                                          1700
          180 Construction                                     1700
          240 Government Sales                                 1700
          250 Retail Sales                                     1700
          190 Contracting                                      1700
          260 Recruiting                                       1700
          140 Control And Credit                               1700
          220 NOC                                              1700
          120 Treasury                                         1700
          170 Manufacturing                                    1700
          130 Corporate Tax                                    1700
          230 IT Helpdesk                                      1700
          150 Shareholder Services                             1700
          160 Benefits                                         1700

16 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  baf0pqw5727yw, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where not
exists (select /*+ unnest hash_aj */ 'x' from hr.employees where
department_id = d.department_id)

Plan hash value: 3587451639

-----------------------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     16 |00:00:00.01 |       7 |       |       |          |
|*  1 |  HASH JOIN ANTI    |                   |      1 |     17 |     16 |00:00:00.01 |       7 |  1376K|  1376K| 1535K (0)|
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       6 |       |       |          |
|   3 |   INDEX FULL SCAN  | EMP_DEPARTMENT_IX |      1 |    107 |    106 |00:00:00.01 |       1 |       |       |          |
-----------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Filter&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;I/O 가 많이 발생&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where not exists (select /*+ no_unnest */ 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
          120 Treasury                                         1700
          130 Corporate Tax                                    1700
          140 Control And Credit                               1700
          150 Shareholder Services                             1700
          160 Benefits                                         1700
          170 Manufacturing                                    1700
          180 Construction                                     1700
          190 Contracting                                      1700
          200 Operations                                       1700
          210 IT Support                                       1700
          220 NOC                                              1700
          230 IT Helpdesk                                      1700
          240 Government Sales                                 1700
          250 Retail Sales                                     1700
          260 Recruiting                                       1700
          270 Payroll                                          1700

16 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  fkc10p31mat3x, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where not
exists (select /*+ no_unnest */ 'x' from hr.employees where
department_id = d.department_id)

Plan hash value: 440241596

--------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     16 |00:00:00.01 |      35 |
|*  1 |  FILTER            |                   |      1 |        |     16 |00:00:00.01 |      35 |
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       8 |
|*  3 |   INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |      2 |     11 |00:00:00.01 |      27 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter( IS NULL)
   3 - access(&quot;DEPARTMENT_ID&quot;=:B1)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;NOT IN&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;employees 에 department_id가 null 인 데이터가 있기 때문에 결과 집합이 나오지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where department_id not in (select department_id from hr.employees);  2    3

no rows selected&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;is not null 조건을 추가해주면 anti join으로 풀림&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where department_id not in (select department_id from hr.employees where department_id is not null);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
          120 Treasury                                         1700
          130 Corporate Tax                                    1700
          140 Control And Credit                               1700
          150 Shareholder Services                             1700
          160 Benefits                                         1700
          170 Manufacturing                                    1700
          180 Construction                                     1700
          190 Contracting                                      1700
          200 Operations                                       1700
          210 IT Support                                       1700
          220 NOC                                              1700
          230 IT Helpdesk                                      1700
          240 Government Sales                                 1700
          250 Retail Sales                                     1700
          260 Recruiting                                       1700
          270 Payroll                                          1700

16 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  d3j34akukq1q8, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
department_id not in (select department_id from hr.employees where
department_id is not null)

Plan hash value: 3082375452

--------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     16 |00:00:00.01 |      11 |
|   1 |  NESTED LOOPS ANTI |                   |      1 |     17 |     16 |00:00:00.01 |      11 |
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       7 |
|*  3 |   INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |     41 |     11 |00:00:00.01 |       4 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENT_ID&quot;)
       filter(&quot;DEPARTMENT_ID&quot; IS NOT NULL)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;filter 방식으로 수행하면 I/O수가 늘어남&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where department_id not in (select /*+ no_unnest */ department_id from hr.employees where department_id is not null);
  2    3
DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
          120 Treasury                                         1700
          130 Corporate Tax                                    1700
          140 Control And Credit                               1700
          150 Shareholder Services                             1700
          160 Benefits                                         1700
          170 Manufacturing                                    1700
          180 Construction                                     1700
          190 Contracting                                      1700
          200 Operations                                       1700
          210 IT Support                                       1700
          220 NOC                                              1700
          230 IT Helpdesk                                      1700
          240 Government Sales                                 1700
          250 Retail Sales                                     1700
          260 Recruiting                                       1700
          270 Payroll                                          1700

16 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  dbtyhpvgxp9j2, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
department_id not in (select /*+ no_unnest */ department_id from
hr.employees where department_id is not null)

Plan hash value: 440241596

--------------------------------------------------------------------------------------------------
| Id  | Operation          | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |                   |      1 |        |     16 |00:00:00.01 |      35 |
|*  1 |  FILTER            |                   |      1 |        |     16 |00:00:00.01 |      35 |
|   2 |   TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       8 |
|*  3 |   INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |      2 |     11 |00:00:00.01 |      27 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter( IS NULL)
   3 - access(&quot;DEPARTMENT_ID&quot;=:B1)
       filter(&quot;DEPARTMENT_ID&quot; IS NOT NULL)

24 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Pushing Subquery&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;실행 계획 상 가능한 앞 단계에서 서브 쿼리 필터링을 먼저 처리함으로써 다음 수행 단계로 넘어가는 행수를 줄일 수 있는 기능&lt;/li&gt;
&lt;li&gt;unnest가 되지 않은 서브 쿼리의 처리 순서를 제어하는 기능&lt;/li&gt;
&lt;li&gt;힌트 : &lt;code&gt;push_subq&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;unnest&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ e.*, d.*
from hr.employees e, hr.departments d
where e.department_id = d.department_id
and exists (select 'x'
                        from hr.locations
                        where location_id = d.location_id
                        and city = 'London');  2    3    4    5    6    7

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                    PHONE_NUMBER          HIRE_DATE JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        203 Susan                Mavris                    SMAVRIS                  515.123.7777          07-JUN-02 HR_REP           6500                      101             40            40
Human Resources                       203        2400

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5zs627v0k6wqh, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.*, d.* from hr.employees e,
hr.departments d where e.department_id = d.department_id and exists
(select 'x'    from hr.locations    where location_id = d.location_id
 and city = 'London')

Plan hash value: 2580071586

-------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
-------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |                   |      1 |       |       1 |00:00:00.01 |       7 |      3 |
|   1 |  NESTED LOOPS                          |                   |      1 |    15 |       1 |00:00:00.01 |       7 |      3 |
|   2 |   NESTED LOOPS                         |                   |      1 |    40 |       1 |00:00:00.01 |       6 |      3 |
|   3 |    NESTED LOOPS                        |                   |      1 |     4 |       1 |00:00:00.01 |       4 |      3 |
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| LOCATIONS         |      1 |     1 |       1 |00:00:00.01 |       2 |      2 |
|*  5 |      INDEX RANGE SCAN                  | LOC_CITY_IX       |      1 |     1 |       1 |00:00:00.01 |       1 |      1 |
|   6 |     TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS       |      1 |     4 |       1 |00:00:00.01 |       2 |      1 |
|*  7 |      INDEX RANGE SCAN                  | DEPT_LOCATION_IX  |      1 |     4 |       1 |00:00:00.01 |       1 |      1 |
|*  8 |    INDEX RANGE SCAN                    | EMP_DEPARTMENT_IX |      1 |    10 |       1 |00:00:00.01 |       2 |      0 |
|   9 |   TABLE ACCESS BY INDEX ROWID          | EMPLOYEES         |      1 |     4 |       1 |00:00:00.01 |       1 |      0 |
-------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;CITY&quot;='London')
   7 - access(&quot;LOCATION_ID&quot;=&quot;D&quot;.&quot;LOCATION_ID&quot;)
   8 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

35 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;아래와 같이 조인으로 쿼리 변환 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ e.*, d.*
from hr.employees e, hr.departments d, hr.locations l
where e.department_id = d.department_id
and d.location_id = l.location_id
and l.city = 'London';  2    3    4    5

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                    PHONE_NUMBER          HIRE_DATE JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        203 Susan                Mavris                    SMAVRIS                  515.123.7777          07-JUN-02 HR_REP           6500                      101             40            40
Human Resources                       203        2400

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  3d4jxhqr36nhk, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.*, d.* from hr.employees e,
hr.departments d, hr.locations l where e.department_id =
d.department_id and d.location_id = l.location_id and l.city = 'London'

Plan hash value: 2580071586

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |                   |      1 |       |       1 |00:00:00.01 |       7 |
|   1 |  NESTED LOOPS                          |                   |      1 |    15 |       1 |00:00:00.01 |       7 |
|   2 |   NESTED LOOPS                         |                   |      1 |    40 |       1 |00:00:00.01 |       6 |
|   3 |    NESTED LOOPS                        |                   |      1 |     4 |       1 |00:00:00.01 |       4 |
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| LOCATIONS         |      1 |     1 |       1 |00:00:00.01 |       2 |
|*  5 |      INDEX RANGE SCAN                  | LOC_CITY_IX       |      1 |     1 |       1 |00:00:00.01 |       1 |
|   6 |     TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS       |      1 |     4 |       1 |00:00:00.01 |       2 |
|*  7 |      INDEX RANGE SCAN                  | DEPT_LOCATION_IX  |      1 |     4 |       1 |00:00:00.01 |       1 |
|*  8 |    INDEX RANGE SCAN                    | EMP_DEPARTMENT_IX |      1 |    10 |       1 |00:00:00.01 |       2 |
|   9 |   TABLE ACCESS BY INDEX ROWID          | EMPLOYEES         |      1 |     4 |       1 |00:00:00.01 |       1 |
----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;L&quot;.&quot;CITY&quot;='London')
   7 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=&quot;L&quot;.&quot;LOCATION_ID&quot;)
   8 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

34 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Filter&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;employee와 departments를 조인해서 107건을 읽은 후 locations 조건을 만족하는 데이터를 필터링해서 1건만 남음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ e.*, d.*
from hr.employees e, hr.departments d
where e.department_id = d.department_id
and exists (select /*+ no_unnest */ 'x'
                        from hr.locations
                        where location_id = d.location_id
                        and city = 'London');  2    3    4    5    6    7

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                    PHONE_NUMBER          HIRE_DATE JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        203 Susan                Mavris                    SMAVRIS                  515.123.7777          07-JUN-02 HR_REP           6500                      101             40            40
Human Resources                       203        2400

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  3vx30tq7xh2ag, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.*, d.* from hr.employees e,
hr.departments d where e.department_id = d.department_id and exists
(select /*+ no_unnest */ 'x'    from hr.locations    where location_id
= d.location_id    and city = 'London')

Plan hash value: 745645447

-------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |             |      1 |        |      1 |00:00:00.01 |      25 |      1 |       |       |          |
|*  1 |  FILTER                       |             |      1 |        |      1 |00:00:00.01 |      25 |      1 |       |       |          |
|   2 |   MERGE JOIN                  |             |      1 |    106 |    106 |00:00:00.01 |      11 |      0 |       |       |          |
|   3 |    TABLE ACCESS BY INDEX ROWID| DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       4 |      0 |       |       |          |
|   4 |     INDEX FULL SCAN           | DEPT_ID_PK  |      1 |     27 |     27 |00:00:00.01 |       2 |      0 |       |       |          |
|*  5 |    SORT JOIN                  |             |     27 |    107 |    106 |00:00:00.01 |       7 |      0 | 22528 | 22528 |20480  (0)|
|   6 |     TABLE ACCESS FULL         | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       7 |      0 |       |       |          |
|*  7 |   TABLE ACCESS BY INDEX ROWID | LOCATIONS   |      7 |      1 |      1 |00:00:00.01 |      14 |      1 |       |       |          |
|*  8 |    INDEX UNIQUE SCAN          | LOC_ID_PK   |      7 |      1 |      7 |00:00:00.01 |       7 |      1 |       |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter( IS NOT NULL)
   5 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   7 - filter(&quot;CITY&quot;='London')
   8 - access(&quot;LOCATION_ID&quot;=:B1)

32 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from hr.locations where city = 'London';

LOCATION_ID STREET_ADDRESS                           POSTAL_CODE  CITY          STATE_PROVINCE     CO
----------- ---------------------------------------- ------------ ------------------------------ ------------------------- --
       2400 8204 Arthur St                                        London          UK

SYS@ora19c&amp;gt; select * from hr.departments where location_id = 2400;

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           40 Human Resources                       203        2400

SYS@ora19c&amp;gt; select *
from hr.departments d
where exists (select 'x' from hr.locations where location_id = d.location_id and city = 'London');  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           40 Human Resources                       203        2400
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Push Subquery&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;no_unnest push_subq&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;서브 쿼리를 통해 location_id를 먼저 구해서 해당하는 부서 1개를 구한 후 사원 테이블과 조인&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ e.*, d.*
from hr.employees e, hr.departments d
where e.department_id = d.department_id
and exists (select /*+ no_unnest push_subq */ 'x'
                        from hr.locations
                        where location_id = d.location_id
                        and city = 'London');  2    3    4    5    6    7

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                    PHONE_NUMBER          HIRE_DATE JOB_ID         SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        203 Susan                Mavris                    SMAVRIS                  515.123.7777          07-JUN-02 HR_REP           6500                      101             40            40
Human Resources                       203        2400

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4f7nn7zq325pz, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.*, d.* from hr.employees e,
hr.departments d where e.department_id = d.department_id and exists
(select /*+ no_unnest push_subq */ 'x'    from hr.locations    where
location_id = d.location_id    and city = 'London')

Plan hash value: 3821569963

--------------------------------------------------------------------------------------------------------------
| Id  | Operation                      | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT               |                   |      1 |        |     1 |00:00:00.01 |       24 |
|   1 |  NESTED LOOPS                  |                   |      1 |     13 |     1 |00:00:00.01 |       24 |
|   2 |   NESTED LOOPS                 |                   |      1 |     13 |     1 |00:00:00.01 |       23 |
|*  3 |    TABLE ACCESS FULL           | DEPARTMENTS       |      1 |      1 |     1 |00:00:00.01 |       21 |
|*  4 |     TABLE ACCESS BY INDEX ROWID| LOCATIONS         |      7 |      1 |     1 |00:00:00.01 |       14 |
|*  5 |      INDEX UNIQUE SCAN         | LOC_ID_PK         |      7 |      1 |     7 |00:00:00.01 |        7 |
|*  6 |    INDEX RANGE SCAN            | EMP_DEPARTMENT_IX |      1 |     10 |     1 |00:00:00.01 |        2 |
|   7 |   TABLE ACCESS BY INDEX ROWID  | EMPLOYEES         |      1 |     10 |     1 |00:00:00.01 |        1 |
--------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - filter( IS NOT NULL)
   4 - filter(&quot;CITY&quot;='London')
   5 - access(&quot;LOCATION_ID&quot;=:B1)
   6 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

34 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;3,4,5번 operation에서 아래 쿼리와 같이 동작 중&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where exists (select /*+ no_unnest */ 'x' from hr.locations where location_id = d.location_id and city = 'London');  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           40 Human Resources                       203        2400

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  a5wx3zb223d4k, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
exists (select /*+ no_unnest */ 'x' from hr.locations where location_id
= d.location_id and city = 'London')

Plan hash value: 2586129675

------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |             |      1 |        |      1 |00:00:00.01 |      22 |
|*  1 |  FILTER                      |             |      1 |        |      1 |00:00:00.01 |      22 |
|   2 |   TABLE ACCESS FULL          | DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       8 |
|*  3 |   TABLE ACCESS BY INDEX ROWID| LOCATIONS   |      7 |      1 |      1 |00:00:00.01 |      14 |
|*  4 |    INDEX UNIQUE SCAN         | LOC_ID_PK   |      7 |      1 |      7 |00:00:00.01 |       7 |
------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter( IS NOT NULL)
   3 - filter(&quot;CITY&quot;='London')
   4 - access(&quot;LOCATION_ID&quot;=:B1)

25 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;View Merging&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;view를 해제하여 메인 쿼리와 통합&lt;/li&gt;
&lt;li&gt;힌트 : &lt;code&gt;merge&lt;/code&gt; (view merging 유도), &lt;code&gt;no_merge&lt;/code&gt; (view merging 방지)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ e.*, z.*
from hr.employees e, (select *
                        from hr.departments d
                        where exists (select 'x'
                                        from hr.locations
                                        where location_id = d.location_id and city = 'London')) z
where e.department_id = z.department_id;

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        203 Susan                Mavris                    SMAVRIS                   515.123.7777         07-JUN-02 HR_REP        6500                       101            40            40
Human Resources                       203        2400

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8w1x9vr7tr6f0, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.*, z.* from hr.employees e,
(select *       from hr.departments d       where exists (select 'x'
       from hr.locations           where location_id = d.location_id
and city = 'London')) z where e.department_id = z.department_id

Plan hash value: 2580071586

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |                   |      1 |        |      1 |00:00:00.01 |       7 |
|   1 |  NESTED LOOPS                          |                   |      1 |     15 |      1 |00:00:00.01 |       7 |
|   2 |   NESTED LOOPS                         |                   |      1 |     40 |      1 |00:00:00.01 |       6 |
|   3 |    NESTED LOOPS                        |                   |      1 |      4 |      1 |00:00:00.01 |       4 |
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| LOCATIONS         |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  5 |      INDEX RANGE SCAN                  | LOC_CITY_IX       |      1 |      1 |      1 |00:00:00.01 |       1 |
|   6 |     TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS       |      1 |      4 |      1 |00:00:00.01 |       2 |
|*  7 |      INDEX RANGE SCAN                  | DEPT_LOCATION_IX  |      1 |      4 |      1 |00:00:00.01 |       1 |
|*  8 |    INDEX RANGE SCAN                    | EMP_DEPARTMENT_IX |      1 |     10 |      1 |00:00:00.01 |       2 |
|   9 |   TABLE ACCESS BY INDEX ROWID          | EMPLOYEES         |      1 |      4 |      1 |00:00:00.01 |       1 |
----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;CITY&quot;='London')
   7 - access(&quot;LOCATION_ID&quot;=&quot;D&quot;.&quot;LOCATION_ID&quot;)
   8 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

35 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;manager_id = 145이고, 부서 location_id = 2500 인 사원 정보 조회&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from (select * from hr.employees where manager_id = 145) e,
    (select * from hr.departments where location_id = 2500) d
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  0twa11q1qnsps, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from (select * from hr.employees
where manager_id = 145) e,  (select * from hr.departments where
location_id = 2500) d where e.department_id = d.department_id

Plan hash value: 531697940

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |                  |      1 |        |      6 |00:00:00.01 |       6 |
|   1 |  NESTED LOOPS                         |                  |      1 |      1 |      6 |00:00:00.01 |       6 |
|   2 |   NESTED LOOPS                        |                  |      1 |      6 |      6 |00:00:00.01 |       4 |
|   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS      |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  4 |     INDEX RANGE SCAN                  | DEPT_LOCATION_IX |      1 |      1 |      1 |00:00:00.01 |       1 |
|*  5 |    INDEX RANGE SCAN                   | EMP_MANAGER_IX   |      1 |      6 |      6 |00:00:00.01 |       2 |
|*  6 |   TABLE ACCESS BY INDEX ROWID         | EMPLOYEES        |      6 |      1 |      6 |00:00:00.01 |       2 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;LOCATION_ID&quot;=2500)
   5 - access(&quot;MANAGER_ID&quot;=145)
   6 - filter(&quot;EMPLOYEES&quot;.&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENTS&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

31 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;아래와 같이 뷰 머징하여 쿼리 변환&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees e, hr.departments d
where e.department_id = d.department_id
and e.manager_id = 145
and d.location_id = 2500;  2    3    4    5

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8smafdd3dm6f4, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees e,
hr.departments d where e.department_id = d.department_id and
e.manager_id = 145 and d.location_id = 2500

Plan hash value: 531697940

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |                  |      1 |        |      6 |00:00:00.01 |       6 |
|   1 |  NESTED LOOPS                         |                  |      1 |      1 |      6 |00:00:00.01 |       6 |
|   2 |   NESTED LOOPS                        |                  |      1 |      6 |      6 |00:00:00.01 |       4 |
|   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS      |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  4 |     INDEX RANGE SCAN                  | DEPT_LOCATION_IX |      1 |      1 |      1 |00:00:00.01 |       1 |
|*  5 |    INDEX RANGE SCAN                   | EMP_MANAGER_IX   |      1 |      6 |      6 |00:00:00.01 |       2 |
|*  6 |   TABLE ACCESS BY INDEX ROWID         | EMPLOYEES        |      6 |      1 |      6 |00:00:00.01 |       2 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=2500)
   5 - access(&quot;E&quot;.&quot;MANAGER_ID&quot;=145)
   6 - filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

31 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;NO_MERGE&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;뷰 머징 방지&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from (select /*+ no_merge */ * from hr.employees where manager_id = 145) e,
    (select /*+ no_merge */ * from hr.departments where location_id = 2500) d
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  d3ar7360s6uk7, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from (select /*+ no_merge */ *
from hr.employees where manager_id = 145) e,  (select /*+ no_merge */ *
from hr.departments where location_id = 2500) d where e.department_id =
d.department_id

Plan hash value: 2868034613

-----------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |                  |      1 |        |      6 |00:00:00.01 |       6 |   |        |          |
|*  1 |  HASH JOIN                            |                  |      1 |      1 |      6 |00:00:00.01 |       6 |  1476K|  1476K|  425K (0)|
|   2 |   VIEW                                |                  |      1 |      1 |      1 |00:00:00.01 |       2 |   |        |          |
|   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS      |      1 |      1 |      1 |00:00:00.01 |       2 |   |        |          |
|*  4 |     INDEX RANGE SCAN                  | DEPT_LOCATION_IX |      1 |      1 |      1 |00:00:00.01 |       1 |   |        |          |
|   5 |   VIEW                                |                  |      1 |      6 |      6 |00:00:00.01 |       4 |   |        |          |
|   6 |    TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES        |      1 |      6 |      6 |00:00:00.01 |       4 |   |        |          |
|*  7 |     INDEX RANGE SCAN                  | EMP_MANAGER_IX   |      1 |      6 |      6 |00:00:00.01 |       2 |   |        |          |
-----------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   4 - access(&quot;LOCATION_ID&quot;=2500)
   7 - access(&quot;MANAGER_ID&quot;=145)

29 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;1. simple view merging&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;view, inline view 내부에 group by, distinct(unique) 등이 없는 view 의미&lt;/li&gt;
&lt;li&gt;simple view를 만나면 view를 해제하고 메인 쿼리와 통합하는 작업 수행&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.employees e, (select * from hr.departments d where department_id = 20) d
where e.department_id = d.department_id;  2    3

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20            20
Marketing                             201        1800

        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20            20
Marketing                             201        1800

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gcy7t3tdudupk, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees e, (select *
from hr.departments d where department_id = 20) d where e.department_id
= d.department_id

Plan hash value: 1475904561

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      2 |00:00:00.01 |       6 |
|   1 |  NESTED LOOPS                        |                   |      1 |      2 |      2 |00:00:00.01 |       6 |
|   2 |   TABLE ACCESS BY INDEX ROWID        | DEPARTMENTS       |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  3 |    INDEX UNIQUE SCAN                 | DEPT_ID_PK        |      1 |      1 |      1 |00:00:00.01 |       1 |
|   4 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       4 |
|*  5 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       2 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=20)
   5 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=20)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;&lt;b&gt;View Merging&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.employees e, hr.departments d
where e.department_id = d.department_id
and d.department_id = 20;  2    3    4

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20            20
Marketing                             201        1800

        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20            20
Marketing                             201        1800

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  9s3vu8y9uq2ym, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees e,
hr.departments d where e.department_id = d.department_id and
d.department_id = 20

Plan hash value: 1475904561

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      2 |00:00:00.01 |       6 |
|   1 |  NESTED LOOPS                        |                   |      1 |      2 |      2 |00:00:00.01 |       6 |
|   2 |   TABLE ACCESS BY INDEX ROWID        | DEPARTMENTS       |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  3 |    INDEX UNIQUE SCAN                 | DEPT_ID_PK        |      1 |      1 |      1 |00:00:00.01 |       1 |
|   4 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       4 |
|*  5 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       2 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=20)
   5 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=20)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;&lt;b&gt;Transitive Predicate&lt;/b&gt; : 조인 조건을 이용하여 다른 테이블에 상수 조건을 생성&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.employees e, hr.departments d
where e.department_id = 20
and d.department_id = 20;  2    3    4

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20            20
Marketing                             201        1800

        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20            20
Marketing                             201        1800

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2rtzt7q99bbrc, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees e,
hr.departments d where e.department_id = 20 and d.department_id = 20

Plan hash value: 1475904561

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      2 |00:00:00.01 |       6 |
|   1 |  NESTED LOOPS                        |                   |      1 |      2 |      2 |00:00:00.01 |       6 |
|   2 |   TABLE ACCESS BY INDEX ROWID        | DEPARTMENTS       |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  3 |    INDEX UNIQUE SCAN                 | DEPT_ID_PK        |      1 |      1 |      1 |00:00:00.01 |       1 |
|   4 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       4 |
|*  5 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       2 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=20)
   5 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=20)

24 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;no_merge
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;view operation이 실행 계획에 나옴(2번 operation)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.employees e, (select /*+ no_merge */ * from hr.departments d where department_id = 20) d
where e.department_id = d.department_id;  2    3

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL                     PHONE_NUMBER         HIRE_DATE JOB_ID      SALARY COMMISSION_PCT MANAGER_ID DEPARTMENT_ID DEPARTMENT_ID
----------- -------------------- ------------------------- ------------------------- -------------------- --------- ---------- ---------- -------------- ---------- ------------- -------------
DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------------------------ ---------- -----------
        201 Michael              Hartstein                 MHARTSTE                  515.123.5555         17-FEB-04 MK_MAN       13000                       100            20            20
Marketing                             201        1800

        202 Pat                  Fay                       PFAY                      603.123.6666         17-AUG-05 MK_REP        6000                       201            20            20
Marketing                             201        1800

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  47avtst70m4yv, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees e, (select /*+
no_merge */ * from hr.departments d where department_id = 20) d where
e.department_id = d.department_id

Plan hash value: 2783614112

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      2 |00:00:00.01 |       6 |
|   1 |  NESTED LOOPS                        |                   |      1 |     10 |      2 |00:00:00.01 |       6 |
|   2 |   VIEW                               |                   |      1 |      1 |      1 |00:00:00.01 |       2 |
|   3 |    TABLE ACCESS BY INDEX ROWID       | DEPARTMENTS       |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  4 |     INDEX UNIQUE SCAN                | DEPT_ID_PK        |      1 |      1 |      1 |00:00:00.01 |       1 |
|   5 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |     10 |      2 |00:00:00.01 |       4 |
|*  6 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |     10 |      2 |00:00:00.01 |       2 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;DEPARTMENT_ID&quot;=20)
   6 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

30 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;2. complex view merging&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;group by, distinct(unique) 가 있는 view, inline view를 merging&lt;/li&gt;
&lt;li&gt;union, union all, intersect, minus, connect by, rownum, group by 가 없는 전체 집계 값을 구하는 그룹 함수, 분석 함수가 포함되어 있을 경우 merging 불가&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_complex_view_merging';  2    3    4

PARAMETER                                                                        VALUE
-------------------------------------------------------------------------------- ------------------------------
_complex_view_merging                                                            TRUE&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;view merging 발생 X&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ d.department_id, d.department_name, e.avg_sal
from hr.departments d, (select department_id, avg(salary) avg_sal
                                                from hr.employees
                                                group by department_id) e
where d.department_id = e.department_id;

DEPARTMENT_ID DEPARTMENT_NAME                   AVG_SAL
------------- ------------------------------ ----------
           10 Administration                       4840
           20 Marketing                            9500
           30 Purchasing                           4150
           40 Human Resources                      6500
           50 Shipping                       3475.55556
           60 IT                                   5760
           70 Public Relations                    10000
           80 Sales                          8955.88235
           90 Executive                           18000
          100 Finance                        8601.33333
          110 Accounting                          10154

11 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7v8v1u6hxnsjp, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ d.department_id,
d.department_name, e.avg_sal from hr.departments d, (select
department_id, avg(salary) avg_sal             from hr.employees
     group by department_id) e where d.department_id = e.department_id

Plan hash value: 523547400

---------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |             |      1 |        |     11 |00:00:00.01 |      10 |       |       |               |
|   1 |  MERGE JOIN                  |             |      1 |     11 |     11 |00:00:00.01 |      10 |       |       |               |
|   2 |   TABLE ACCESS BY INDEX ROWID| DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       4 |       |       |               |
|   3 |    INDEX FULL SCAN           | DEPT_ID_PK  |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |               |
|*  4 |   SORT JOIN                  |             |     27 |     11 |     11 |00:00:00.01 |       6 |  2048 |  2048 | 2048  (0)|
|   5 |    VIEW                      |             |      1 |     11 |     12 |00:00:00.01 |       6 |       |       |               |
|   6 |     HASH GROUP BY            |             |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2350K (0)|
|   7 |      TABLE ACCESS FULL       | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |               |
---------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;E&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;E&quot;.&quot;DEPARTMENT_ID&quot;)

28 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인으로 쿼리를 작성하더라도 내부적으로 view 생성됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ d.department_id, d.department_name, avg(e.salary) avg_sal
from hr.departments d, hr.employees e
where d.department_id = e.department_id
group by d.department_id, d.department_name;  2    3    4

DEPARTMENT_ID DEPARTMENT_NAME                   AVG_SAL
------------- ------------------------------ ----------
           10 Administration                       4840
           20 Marketing                            9500
           30 Purchasing                           4150
           40 Human Resources                      6500
           50 Shipping                       3475.55556
           60 IT                                   5760
           70 Public Relations                    10000
           80 Sales                          8955.88235
           90 Executive                           18000
          100 Finance                        8601.33333
          110 Accounting                          10154

11 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  1a01k7ntr4htx, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ d.department_id,
d.department_name, avg(e.salary) avg_sal from hr.departments d,
hr.employees e where d.department_id = e.department_id group by
d.department_id, d.department_name

Plan hash value: 3156283505

---------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name        | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |             |      1 |        |     11 |00:00:00.01 |      10 |       |       |               |
|   1 |  MERGE JOIN                  |             |      1 |     11 |     11 |00:00:00.01 |      10 |       |       |               |
|   2 |   TABLE ACCESS BY INDEX ROWID| DEPARTMENTS |      1 |     27 |     27 |00:00:00.01 |       4 |       |       |               |
|   3 |    INDEX FULL SCAN           | DEPT_ID_PK  |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |               |
|*  4 |   SORT JOIN                  |             |     27 |     11 |     11 |00:00:00.01 |       6 |  2048 |  2048 | 2048  (0)|
|   5 |    VIEW                      | VW_GBC_5    |      1 |     11 |     12 |00:00:00.01 |       6 |       |       |               |
|   6 |     HASH GROUP BY            |             |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2346K (0)|
|   7 |      TABLE ACCESS FULL       | EMPLOYEES   |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |               |
---------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;ITEM_1&quot;)
       filter(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;ITEM_1&quot;)

28 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;view merging 발생&lt;/li&gt;
&lt;li&gt;view merging되지 않으면 뷰에서 필요없는 데이터까지 모두 그루핑해서 집계 결과를 만든 후 메인 쿼리에서 비조인 조건절에 의해 필터링되기 때문에 비효율적&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ d.department_id, d.department_name, e.avg_sal
from hr.departments d, (select department_id, avg(salary) avg_sal
                                                from hr.employees
                                                group by department_id) e
where d.department_id = e.department_id
and d.location_id = 1800;

DEPARTMENT_ID DEPARTMENT_NAME                   AVG_SAL
------------- ------------------------------ ----------
           20 Marketing                            9500

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8bmhd646tr6x7, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ d.department_id,
d.department_name, e.avg_sal from hr.departments d, (select
department_id, avg(salary) avg_sal       from hr.employees       group
by department_id) e where d.department_id = e.department_id and
d.location_id = 1800

Plan hash value: 1057383372

-------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |       OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |                   |      1 |        |      1 |00:00:00.01 |       4 |            |       |          |
|   1 |  HASH GROUP BY                         |                   |      1 |      1 |      1 |00:00:00.01 |       4 |        960K|   960K|  530K (0)|
|   2 |   NESTED LOOPS                         |                   |      1 |     10 |      2 |00:00:00.01 |       4 |            |       |          |
|   3 |    NESTED LOOPS                        |                   |      1 |     10 |      2 |00:00:00.01 |       3 |            |       |          |
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS       |      1 |      1 |      1 |00:00:00.01 |       2 |            |       |          |
|*  5 |      INDEX RANGE SCAN                  | DEPT_LOCATION_IX  |      1 |      1 |      1 |00:00:00.01 |       1 |            |       |          |
|*  6 |     INDEX RANGE SCAN                   | EMP_DEPARTMENT_IX |      1 |     10 |      2 |00:00:00.01 |       1 |            |       |          |
|   7 |    TABLE ACCESS BY INDEX ROWID         | EMPLOYEES         |      2 |     10 |      2 |00:00:00.01 |       1 |            |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=1800)
   6 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

33 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;아래처럼 쿼리 변환됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ d.department_id, d.department_name, avg(e.salary) avg_sal
from hr.departments d, hr.employees e
where d.department_id = e.department_id
and d.location_id = 1800
group by d.department_id, d.department_name;

DEPARTMENT_ID DEPARTMENT_NAME                   AVG_SAL
------------- ------------------------------ ----------
           20 Marketing                            9500

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7xk4h2ru0t5q4, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ d.department_id,
d.department_name, avg(e.salary) avg_sal from hr.departments d,
hr.employees e where d.department_id = e.department_id and
d.location_id = 1800 group by d.department_id, d.department_name

Plan hash value: 1057383372

-------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |       OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |                   |      1 |        |      1 |00:00:00.01 |       4 |            |       |          |
|   1 |  HASH GROUP BY                         |                   |      1 |      1 |      1 |00:00:00.01 |       4 |       1022K|  1022K|  530K (0)|
|   2 |   NESTED LOOPS                         |                   |      1 |     10 |      2 |00:00:00.01 |       4 |            |       |          |
|   3 |    NESTED LOOPS                        |                   |      1 |     10 |      2 |00:00:00.01 |       3 |            |       |          |
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS       |      1 |      1 |      1 |00:00:00.01 |       2 |            |       |          |
|*  5 |      INDEX RANGE SCAN                  | DEPT_LOCATION_IX  |      1 |      1 |      1 |00:00:00.01 |       1 |            |       |          |
|*  6 |     INDEX RANGE SCAN                   | EMP_DEPARTMENT_IX |      1 |     10 |      2 |00:00:00.01 |       1 |            |       |          |
|   7 |    TABLE ACCESS BY INDEX ROWID         | EMPLOYEES         |      2 |     10 |      2 |00:00:00.01 |       1 |            |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=1800)
   6 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;E&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

32 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;조인 조건 pushdown&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인 조건을 뷰 쿼리 블록 안으로 넣어서 조인 수행 시 드라이빙 테이블에서 읽은 조인 컬럼 값을 inner 쪽 뷰 쿼리 블록 내에서 참조할 수 있도록 하는 기능&lt;/li&gt;
&lt;li&gt;view merging이 실패했을 때 메인 쿼리의 조건절이 서브 쿼리의 결과 집합을 줄이는데 도움이 된다면 조인 조건 pushdown 수행&lt;/li&gt;
&lt;li&gt;힌트 : &lt;code&gt;push_pred&lt;/code&gt; (조인 조건 pushdown 활성화), &lt;code&gt;no_push_pred&lt;/code&gt; (조인 조건 pushdown 비활성화)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ d.department_id, d.department_name, e.avg_sal
from hr.departments d, (select /*+ no_merge */ department_id, avg(salary) avg_sal
                        from hr.employees
                        group by department_id) e
where d.department_id = e.department_id
and d.location_id = 1800;

DEPARTMENT_ID DEPARTMENT_NAME                   AVG_SAL
------------- ------------------------------ ----------
           20 Marketing                            9500

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  bfjbkf1rd04s7, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ d.department_id,
d.department_name, e.avg_sal from hr.departments d, (select /*+
no_merge */ department_id, avg(salary) avg_sal       from hr.employees
     group by department_id) e where d.department_id = e.department_id
and d.location_id = 1800

Plan hash value: 3847904864

-----------------------------------------------------------------------------------------------------------------------
| Id  | Operation                               | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                        |                   |      1 |        |      1 |00:00:00.01 |       5 |
|   1 |  NESTED LOOPS                           |                   |      1 |      1 |      1 |00:00:00.01 |       5 |
|   2 |   TABLE ACCESS BY INDEX ROWID BATCHED   | DEPARTMENTS       |      1 |      1 |      1 |00:00:00.01 |       3 |
|*  3 |    INDEX RANGE SCAN                     | DEPT_LOCATION_IX  |      1 |      1 |      1 |00:00:00.01 |       2 |
|   4 |   VIEW PUSHED PREDICATE                 |                   |      1 |      1 |      1 |00:00:00.01 |       2 |
|*  5 |    FILTER                               |                   |      1 |        |      1 |00:00:00.01 |       2 |
|   6 |     SORT AGGREGATE                      |                   |      1 |      1 |      1 |00:00:00.01 |       2 |
|   7 |      TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |     10 |      2 |00:00:00.01 |       2 |
|*  8 |       INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |     10 |      2 |00:00:00.01 |       1 |
-----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=1800)
   5 - filter(COUNT(*)&amp;gt;0)
   8 - access(&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

31 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;아래 쿼리와 같이 쿼리 변환 수행&lt;/li&gt;
&lt;li&gt;group by 연산 안 함&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ avg(salary) from hr.employees where department_id = 20;

AVG(SALARY)
-----------
       9500

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2t81kahhgzg33, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ avg(salary) from hr.employees
where department_id = 20

Plan hash value: 1642965905

--------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
--------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                   |      1 |        |      1 |00:00:00.01 |       2 |
|   1 |  SORT AGGREGATE                      |                   |      1 |      1 |      1 |00:00:00.01 |       2 |
|   2 |   TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  3 |    INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |
--------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=20)

21 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;group by 연산을 수행했으면 실행 계획에 HASH/SORT GROUP BY 연산이 나타남&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;# hash group by 수행
select /*+ gather_plan_statistics */ department_id, avg(salary) avg_sal
from hr.employees
group by department_id;  2    3

DEPARTMENT_ID    AVG_SAL
------------- ----------
           50 3475.55556
           40       6500
          110      10154
           90      18000
           30       4150
           70      10000
                    7000
           10       4840
           20       9500
           60       5760
          100 8601.33333
           80 8955.88235

12 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5uqq0vrs0uvbm, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ department_id, avg(salary) avg_sal
from hr.employees group by department_id

Plan hash value: 1192169904

---------------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |           |      1 |        |     12 |00:00:00.01 |       6 |       |       |          |
|   1 |  HASH GROUP BY     |           |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2346K (0)|
|   2 |   TABLE ACCESS FULL| EMPLOYEES |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |          |
---------------------------------------------------------------------------------------------------------------------

15 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;# sort group by 수행
select /*+ gather_plan_statistics */ department_id, avg(salary) avg_sal
from hr.employees
where department_id = 20
group by department_id;

DEPARTMENT_ID    AVG_SAL
------------- ----------
           20       9500

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  ajm7xyr16ut6y, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ department_id, avg(salary) avg_sal
from hr.employees where department_id = 20 group by department_id

Plan hash value: 2036705853

------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |                   |      1 |        |      1 |00:00:00.01 |       2 |
|   1 |  SORT GROUP BY NOSORT        |                   |      1 |      2 |      1 |00:00:00.01 |       2 |
|   2 |   TABLE ACCESS BY INDEX ROWID| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  3 |    INDEX RANGE SCAN          | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |
------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=20)

21 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Bloom Filter&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;hash join 시 probe 집합에서 조인에 참여하는 건수를 줄임으로써 join 시간을 단축시키는 알고리즘&lt;/li&gt;
&lt;li&gt;즉 build(hash) 테이블에 있는 값만 probe 테이블에서 조인 참여할 수 있도록 하는 기능&lt;/li&gt;
&lt;li&gt;힌트 : &lt;code&gt;px_join_filter&lt;/code&gt; (bloom filter 기능 활성화), &lt;code&gt;no_px_join_filter&lt;/code&gt; (bloom filter 기능 비활성화)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ d.department_id, d.department_name, e.avg_sal
from hr.departments d, (select /*+ no_merge no_push_pred */ department_id, avg(salary) avg_sal
                        from hr.employees
                        group by department_id) e
where d.department_id = e.department_id
and d.location_id = 1800;

DEPARTMENT_ID DEPARTMENT_NAME                   AVG_SAL
------------- ------------------------------ ----------
           20 Marketing                            9500

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  9vjat8njdsxys, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ d.department_id,
d.department_name, e.avg_sal from hr.departments d, (select /*+
no_merge no_push_pred */ department_id, avg(salary) avg_sal       from
hr.employees       group by department_id) e where d.department_id =
e.department_id and d.location_id = 1800

Plan hash value: 1865666513

-----------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |                  |      1 |        |      1 |00:00:00.01 |       8 |   |        |          |
|*  1 |  HASH JOIN                            |                  |      1 |      1 |      1 |00:00:00.01 |       8 |  1651K|  1651K|  304K (0)|
|   2 |   JOIN FILTER CREATE                  | :BF0000          |      1 |      1 |      1 |00:00:00.01 |       2 |   |        |          |
|   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS      |      1 |      1 |      1 |00:00:00.01 |       2 |   |        |          |
|*  4 |     INDEX RANGE SCAN                  | DEPT_LOCATION_IX |      1 |      1 |      1 |00:00:00.01 |       1 |   |        |          |
|   5 |   VIEW                                |                  |      1 |     11 |      1 |00:00:00.01 |       6 |   |        |          |
|   6 |    HASH GROUP BY                      |                  |      1 |     11 |      1 |00:00:00.01 |       6 |  1106K|  1106K|  788K (0)|
|   7 |     JOIN FILTER USE                   | :BF0000          |      1 |    107 |      2 |00:00:00.01 |       6 |   |        |          |
|*  8 |      TABLE ACCESS FULL                | EMPLOYEES        |      1 |    107 |      2 |00:00:00.01 |       6 |   |        |          |
-----------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;E&quot;.&quot;DEPARTMENT_ID&quot;)
   4 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=1800)
   8 - filter(SYS_OP_BLOOM_FILTER(:BF0000,&quot;DEPARTMENT_ID&quot;))

31 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;3, 4번 연산을 수행해서 build table을 생성&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select /*+ gather_plan_statistics */ *
from hr.departments d
where d.location_id = 1800;  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           20 Marketing                             201        1800

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  1ttr1d6dzajm5, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.departments d where
d.location_id = 1800

Plan hash value: 2156672468

------------------------------------------------------------------------------------------------------------------
| Id  | Operation                           | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                    |                  |      1 |        |      1 |00:00:00.01 |       3 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS      |      1 |      1 |      1 |00:00:00.01 |       3 |
|*  2 |   INDEX RANGE SCAN                  | DEPT_LOCATION_IX |      1 |      1 |      1 |00:00:00.01 |       2 |
------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   2 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=1800)

20 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;6, 8번 연산에서 probe table 생성&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ department_id, avg(salary) avg_sal
from hr.employees
group by department_id;

DEPARTMENT_ID    AVG_SAL
------------- ----------
           50 3475.55556
           40       6500
          110      10154
           90      18000
           30       4150
           70      10000
                    7000
           10       4840
           20       9500
           60       5760
          100 8601.33333
           80 8955.88235

12 rows selected.

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5uqq0vrs0uvbm, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ department_id, avg(salary) avg_sal
from hr.employees group by department_id

Plan hash value: 1192169904

---------------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |           |      1 |        |     12 |00:00:00.01 |       6 |       |       |          |
|   1 |  HASH GROUP BY     |           |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2343K (0)|
|   2 |   TABLE ACCESS FULL| EMPLOYEES |      1 |    107 |    107 |00:00:00.01 |       6 |       |       |          |
---------------------------------------------------------------------------------------------------------------------

15 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;NO_PX_JOIN_FILTER&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics no_px_join_filter(e) */ d.department_id, d.department_name, e.avg_sal
from hr.departments d, (select /*+ no_merge no_push_pred */ department_id, avg(salary) avg_sal
                        from hr.employees
                        group by department_id) e
where d.department_id = e.department_id
and d.location_id = 1800;

DEPARTMENT_ID DEPARTMENT_NAME                   AVG_SAL
------------- ------------------------------ ----------
           20 Marketing                            9500

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5fjb4m0yc75gc, child number 0
-------------------------------------
select /*+ gather_plan_statistics no_px_join_filter(e) */
d.department_id, d.department_name, e.avg_sal from hr.departments d,
(select /*+ no_merge no_push_pred */ department_id, avg(salary) avg_sal
      from hr.employees       group by department_id) e where
d.department_id = e.department_id and d.location_id = 1800

Plan hash value: 1996550663

----------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                            | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                     |                  |      1 |        |      1 |00:00:00.01 |       8 |   |        |          |
|*  1 |  HASH JOIN                           |                  |      1 |      1 |      1 |00:00:00.01 |       8 |  1651K|  1651K|  688K (0)|
|   2 |   TABLE ACCESS BY INDEX ROWID BATCHED| DEPARTMENTS      |      1 |      1 |      1 |00:00:00.01 |       2 |   |        |          |
|*  3 |    INDEX RANGE SCAN                  | DEPT_LOCATION_IX |      1 |      1 |      1 |00:00:00.01 |       1 |   |        |          |
|   4 |   VIEW                               |                  |      1 |     11 |     12 |00:00:00.01 |       6 |   |        |          |
|   5 |    HASH GROUP BY                     |                  |      1 |     11 |     12 |00:00:00.01 |       6 |  1097K|  1097K| 2300K (0)|
|   6 |     TABLE ACCESS FULL                | EMPLOYEES        |      1 |    107 |    107 |00:00:00.01 |       6 |   |        |          |
----------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;E&quot;.&quot;DEPARTMENT_ID&quot;)
   3 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=1800)

28 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;조건절 pushdown&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;group by 절에 포함된 복합 뷰 merging 실패했을 경우 블록 밖에 있는 조건절을 쿼리 블록 안쪽으로 넣음으로써 group by 해야 할 데이터 양을 줄일 수 있음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from (select /*+ no_merge */ department_id, sum(salary) sum_sal 
        from hr.employees 
        group by department_id)
where department_id = 20;        

DEPARTMENT_ID    SUM_SAL
------------- ----------
           20      19000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gu6sgjmkf8wxz, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from (select /*+ no_merge */
department_id, sum(salary) sum_sal   from hr.employees   group by
department_id) where department_id = 20

Plan hash value: 537763860

-------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |                   |      1 |        |      1 |00:00:00.01 |       2 |
|   1 |  VIEW                         |                   |      1 |      2 |      1 |00:00:00.01 |       2 |
|   2 |   SORT GROUP BY NOSORT        |                   |      1 |      2 |      1 |00:00:00.01 |       2 |
|   3 |    TABLE ACCESS BY INDEX ROWID| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  4 |     INDEX RANGE SCAN          | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;DEPARTMENT_ID&quot;=20)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from (select /*+ no_merge */ department_id, sum(salary) sum_sal 
        from hr.employees 
        where department_id = 20 
        group by department_id);

DEPARTMENT_ID    SUM_SAL
------------- ----------
           20      19000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  0wydvbg7vvrvg, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from (select /*+ no_merge */
department_id, sum(salary) sum_sal   from hr.employees   where
department_id = 20   group by department_id)

Plan hash value: 537763860

-------------------------------------------------------------------------------------------------------------
| Id  | Operation                     | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT              |                   |      1 |        |      1 |00:00:00.01 |       2 |
|   1 |  VIEW                         |                   |      1 |      2 |      1 |00:00:00.01 |       2 |
|   2 |   SORT GROUP BY NOSORT        |                   |      1 |      2 |      1 |00:00:00.01 |       2 |
|   3 |    TABLE ACCESS BY INDEX ROWID| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  4 |     INDEX RANGE SCAN          | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |
-------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;DEPARTMENT_ID&quot;=20)

23 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;조건절 pullup&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조건절을 쿼리 블록 안으로 밀어 넣을 뿐만 아니라 안쪽에 있는 조건들을 바깥쪽으로 끄집어 내기도 함&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ a.department_id, a.sum_sal, b.avg_sal, b.max_sal
from (select department_id, sum(salary) sum_sal from hr.employees where department_id = 20 group by department_id) a,
(select department_id, avg(salary) avg_sal, max(salary) max_sal from hr.employees group by department_id) b
where a.department_id = b.department_id;

DEPARTMENT_ID    SUM_SAL    AVG_SAL    MAX_SAL
------------- ---------- ---------- ----------
           20      19000       9500      13000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8mbhc6fz18jmf, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ a.department_id, a.sum_sal,
b.avg_sal, b.max_sal from (select department_id, sum(salary) sum_sal
from hr.employees where department_id = 20 group by department_id) a,
(select department_id, avg(salary) avg_sal, max(salary) max_sal from
hr.employees group by department_id) b where a.department_id =
b.department_id

Plan hash value: 1932850082

-------------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                              | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |       OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                       |                   |      1 |        |      1 |00:00:00.01 |       4 |            |       |          |
|*  1 |  HASH JOIN                             |                   |      1 |      1 |      1 |00:00:00.01 |       4 |       1995K|  1995K|  702K (0)|
|   2 |   VIEW                                 |                   |      1 |      2 |      1 |00:00:00.01 |       2 |            |       |          |
|   3 |    HASH GROUP BY                       |                   |      1 |      2 |      1 |00:00:00.01 |       2 |       1200K|  1200K|  519K (0)|
|   4 |     TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |            |       |          |
|*  5 |      INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |            |       |          |
|   6 |   VIEW                                 |                   |      1 |      2 |      1 |00:00:00.01 |       2 |            |       |          |
|   7 |    HASH GROUP BY                       |                   |      1 |      2 |      1 |00:00:00.01 |       2 |        956K|   956K|  521K (0)|
|   8 |     TABLE ACCESS BY INDEX ROWID BATCHED| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |            |       |          |
|*  9 |      INDEX RANGE SCAN                  | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |            |       |          |
-------------------------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;A&quot;.&quot;DEPARTMENT_ID&quot;=&quot;B&quot;.&quot;DEPARTMENT_ID&quot;)
   5 - access(&quot;DEPARTMENT_ID&quot;=20)
   9 - access(&quot;DEPARTMENT_ID&quot;=20)

33 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;b 뷰에 department_id = 20 조건이 추가됨 &amp;rarr; 불필요한 집계값을 만드는 것을 막아줌&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ department_id, sum(salary) sum_sal, avg(salary) avg_sal, max(salary) max_sal
from hr.employees
where department_id = 20
group by department_id;

DEPARTMENT_ID    SUM_SAL    AVG_SAL    MAX_SAL
------------- ---------- ---------- ----------
           20      19000       9500      13000

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  75tgt8aux5bu6, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ department_id, sum(salary)
sum_sal, avg(salary) avg_sal, max(salary) max_sal from hr.employees
where department_id = 20 group by department_id

Plan hash value: 2036705853

------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |                   |      1 |        |      1 |00:00:00.01 |       2 |
|   1 |  SORT GROUP BY NOSORT        |                   |      1 |      2 |      1 |00:00:00.01 |       2 |
|   2 |   TABLE ACCESS BY INDEX ROWID| EMPLOYEES         |      1 |      2 |      2 |00:00:00.01 |       2 |
|*  3 |    INDEX RANGE SCAN          | EMP_DEPARTMENT_IX |      1 |      2 |      2 |00:00:00.01 |       1 |
------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=20)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <category>튜닝</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/231</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260211-TIL#entry231comment</comments>
      <pubDate>Fri, 13 Mar 2026 09:20:28 +0900</pubDate>
    </item>
    <item>
      <title>[아이티윌 오라클 DBA 과정 91기] 260210 TIL</title>
      <link>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260210-TIL</link>
      <description>&lt;h1&gt;JOIN 튜닝&lt;/h1&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Sort Merge Join&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인되는 건수가 많은 경우 건건이 버퍼 캐시를 거치면서 조인하는 NL 조인보다는 Sort Merge Join 또는 Hash Join 이 유리
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;random access 위주의 nested loop join은 대용량 처리에 한계&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;sort에 대한 성능 문제가 발생할 수 있음&lt;/li&gt;
&lt;li&gt;Sort Merge Join 단계
&lt;ol style=&quot;list-style-type: decimal;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;각각 조인 키 컬럼을 기준으로 양쪽 집합을 정렬&lt;/li&gt;
&lt;li&gt;정렬된 양쪽 결과 집합을 merge&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;조인 순서 제어 : &lt;code&gt;leading()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;소트 머지 조인 유도 : &lt;code&gt;user_merge()&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  ba604y0qcsz5z, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_merge(e) */
e.employee_id, e.last_name, e.salary, d.department_name from hr.emp e,
hr.dept d where e.department_id = d.department_id

Plan hash value: 4000064182

------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |          |      1 |        |    106 |00:00:00.01 |      15 |       |       |      |
|   1 |  MERGE JOIN                  |          |      1 |    106 |    106 |00:00:00.01 |      15 |       |       |      |
|   2 |   TABLE ACCESS BY INDEX ROWID| DEPT     |      1 |     27 |     27 |00:00:00.01 |      12 |       |       |      |
|   3 |    INDEX FULL SCAN           | DEPT_IDX |      1 |     27 |     27 |00:00:00.01 |       6 |       |       |      |
|*  4 |   SORT JOIN                  |          |     27 |    107 |    106 |00:00:00.01 |       3 | 15360 | 15360 |14336  (0)|
|   5 |    TABLE ACCESS FULL         | EMP      |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |      |
------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

25 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;OMem : Optimal Sort에 필요한 예상 정렬 작업 영역의 크기&lt;/li&gt;
&lt;li&gt;1Mem : One Pass Sort에 필요한 예상 정렬 작업 영역의 크기&lt;/li&gt;
&lt;li&gt;Used- Mem : 실제 사용된 정렬 작업 영역의 크기&lt;/li&gt;
&lt;li&gt;Used-Tem : 메모리가 부족하여 사용된 temporary space 공간 크기(kb단위)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;EMP &amp;rarr; DEPT &amp;rarr; LOC 순서로 조인&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(e,d,l) use_merge(d) use_merge(l) */ e.employee_id, e.last_name, e.salary, d.department_name, l.city, l.postal_code
from hr.emp e, hr.dept d, hr.loc l
where e.department_id = d.department_id
and d.location_id = l.location_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  d6pxbt9vxk3wy, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(e,d,l) use_merge(d)
use_merge(l) */ e.employee_id, e.last_name, e.salary,
d.department_name, l.city, l.postal_code from hr.emp e, hr.dept d,
hr.loc l where e.department_id = d.department_id and d.location_id =
l.location_id

Plan hash value: 21786486

-------------------------------------------------------------------------------------------------------------------
| Id  | Operation             | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |      |      1 |        |    106 |00:00:00.01 |       7 |       |       |          |
|   1 |  MERGE JOIN           |      |      1 |    106 |    106 |00:00:00.01 |       7 |       |       |          |
|   2 |   SORT JOIN           |      |      1 |    106 |    106 |00:00:00.01 |       5 | 11264 | 11264 |10240  (0)|
|   3 |    MERGE JOIN         |      |      1 |    106 |    106 |00:00:00.01 |       5 |       |       |          |
|   4 |     SORT JOIN         |      |      1 |    107 |    107 |00:00:00.01 |       3 | 15360 | 15360 |14336  (0)|
|   5 |      TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|*  6 |     SORT JOIN         |      |    107 |     27 |    106 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   7 |      TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
|*  8 |   SORT JOIN           |      |    106 |     23 |    106 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   9 |    TABLE ACCESS FULL  | LOC  |      1 |     23 |     23 |00:00:00.01 |       2 |       |       |          |
-------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   6 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   8 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=&quot;L&quot;.&quot;LOCATION_ID&quot;)
       filter(&quot;D&quot;.&quot;LOCATION_ID&quot;=&quot;L&quot;.&quot;LOCATION_ID&quot;)

33 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;LOC &amp;rarr; DEPT &amp;rarr; EMP 순서로 조인&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;메모리 사용량이 줄음&lt;/li&gt;
&lt;li&gt;작은 집합을 first table로 잡는 것이 좋음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(l,d,e) use_merge(d) use_merge(e) */ e.employee_id, e.last_name, e.salary, d.department_name, l.city, l.postal_code
from hr.emp e, hr.dept d, hr.loc l
where e.department_id = d.department_id
and d.location_id = l.location_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  6261b8mxfrrmg, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(l,d,e) use_merge(d)
use_merge(e) */ e.employee_id, e.last_name, e.salary,
d.department_name, l.city, l.postal_code from hr.emp e, hr.dept d,
hr.loc l where e.department_id = d.department_id and d.location_id =
l.location_id

Plan hash value: 2175329493

-------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                      | Name    | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT               |         |      1 |        |    106 |00:00:00.01 |       7 |       |       |      |
|   1 |  MERGE JOIN                    |         |      1 |    106 |    106 |00:00:00.01 |       7 |       |       |      |
|   2 |   SORT JOIN                    |         |      1 |     27 |     27 |00:00:00.01 |       4 |  2048 |  2048 | 2048  (0)|
|   3 |    MERGE JOIN                  |         |      1 |     27 |     27 |00:00:00.01 |       4 |       |       |      |
|   4 |     TABLE ACCESS BY INDEX ROWID| LOC     |      1 |     23 |     19 |00:00:00.01 |       2 |       |       |      |
|   5 |      INDEX FULL SCAN           | LOC_IDX |      1 |     23 |     19 |00:00:00.01 |       1 |       |       |      |
|*  6 |     SORT JOIN                  |         |     19 |     27 |     27 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   7 |      TABLE ACCESS FULL         | DEPT    |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |      |
|*  8 |   SORT JOIN                    |         |     27 |    107 |    106 |00:00:00.01 |       3 | 15360 | 15360 |14336  (0)|
|   9 |    TABLE ACCESS FULL           | EMP     |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |      |
-------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   6 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=&quot;L&quot;.&quot;LOCATION_ID&quot;)
       filter(&quot;D&quot;.&quot;LOCATION_ID&quot;=&quot;L&quot;.&quot;LOCATION_ID&quot;)
   8 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

33 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;쿼리 변환&lt;/h2&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;옵티마이저가 쿼리 변환 수행&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;내부적으로 뷰 생성&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics full(d) */ d.department_id, d.department_name, sum(e.salary) sum_sal
from hr.emp e, hr.dept d
where e.department_id = d.department_id
group by d.department_id, d.department_name;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  dnrxjgzjcgbj8, child number 0
-------------------------------------
select /*+ gather_plan_statistics full(d) */ d.department_id,
d.department_name, sum(e.salary) sum_sal from hr.emp e, hr.dept d where
e.department_id = d.department_id group by d.department_id,
d.department_name

Plan hash value: 2406677958

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |          |      1 |        |     11 |00:00:00.01 |      62 |       |       |          |
|*  1 |  HASH JOIN           |          |      1 |     11 |     11 |00:00:00.01 |      62 |  1995K|  1995K| 1432K (0)|
|   2 |   VIEW               | VW_GBC_5 |      1 |     11 |     12 |00:00:00.01 |       3 |       |       |          |
|   3 |    HASH GROUP BY     |          |      1 |     11 |     12 |00:00:00.01 |       3 |  1186K|  1186K| 2302K (0)|
|   4 |     TABLE ACCESS FULL| EMP      |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|   5 |   TABLE ACCESS FULL  | DEPT     |      1 |     27 |     27 |00:00:00.01 |       3 |       |       |          |
----------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;ITEM_1&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Sort Merge Join 유도&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(e,d) use_merge(d)*/ d.department_id, d.department_name, sum(e.salary) sum_sal
from hr.emp e, hr.dept d
where e.department_id = d.department_id
group by d.department_id, d.department_name;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  03cpgrcr9ur23, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(e,d) use_merge(d)*/
d.department_id, d.department_name, sum(e.salary) sum_sal from hr.emp
e, hr.dept d where e.department_id = d.department_id group by
d.department_id, d.department_name

Plan hash value: 862005045

------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |      |      1 |        |     11 |00:00:00.01 |       5 |       |       |          |
|   1 |  HASH GROUP BY       |      |      1 |    106 |     11 |00:00:00.01 |       5 |  1028K|  1028K| 1045K (0)|
|   2 |   MERGE JOIN         |      |      1 |    106 |    106 |00:00:00.01 |       5 |       |       |          |
|   3 |    SORT JOIN         |      |      1 |    107 |    107 |00:00:00.01 |       3 | 15360 | 15360 |14336  (0)|
|   4 |     TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|*  5 |    SORT JOIN         |      |    107 |     27 |    106 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   6 |     TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

27 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;인라인 뷰 사용&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;emp 테이블을 먼저 group by 하여 부서 별 salary 합계를 구하도록 인라인 뷰를 사용하여 조인 건수를 줄임
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;사원 : 부서 = M : 1&lt;/li&gt;
&lt;li&gt;이전에는 사원 수만큼 조인 후 부서 별로 group by 수행&lt;/li&gt;
&lt;li&gt;부서 별 사원의 salary 합계를 구하고자 하기 때문에 부서 별로 각 사원을 조인할 필요 없음&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics full(d) */ d.department_id, d.department_name, e.sum_sal
from (select department_id, sum(salary) sum_sal 
        from hr.emp 
        group by department_id) e, hr.dept d
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7x0sxzg48h3f4, child number 0
-------------------------------------
select /*+ gather_plan_statistics full(d) */ d.department_id,
d.department_name, e.sum_sal from (select department_id, sum(salary)
sum_sal   from hr.emp   group by department_id) e, hr.dept d where
e.department_id = d.department_id

Plan hash value: 2415981340

------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |      |      1 |        |     11 |00:00:00.01 |       7 |       |       |          |
|*  1 |  HASH JOIN           |      |      1 |     11 |     11 |00:00:00.01 |       7 |  1995K|  1995K| 1432K (0)|
|   2 |   VIEW               |      |      1 |     11 |     12 |00:00:00.01 |       3 |       |       |          |
|   3 |    HASH GROUP BY     |      |      1 |     11 |     12 |00:00:00.01 |       3 |  1186K|  1186K| 2302K (0)|
|   4 |     TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|   5 |   TABLE ACCESS FULL  | DEPT |      1 |     27 |     27 |00:00:00.01 |       3 |       |       |          |
------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;인라인 뷰 사용, Sort Merge Join 유도&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;hash group by 메모리 사용량이 많음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(e,d) use_merge(d) */ d.department_id, d.department_name, e.sum_sal
from (select department_id, sum(salary) sum_sal 
        from hr.emp 
        group by department_id) e, hr.dept d
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  89n7ujxmjdvnr, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(e,d) use_merge(d) */
d.department_id, d.department_name, e.sum_sal from (select
department_id, sum(salary) sum_sal   from hr.emp   group by
department_id) e, hr.dept d where e.department_id = d.department_id

Plan hash value: 3237044861

-------------------------------------------------------------------------------------------------------------------
| Id  | Operation             | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |      |      1 |        |     11 |00:00:00.01 |       5 |       |       |          |
|   1 |  MERGE JOIN           |      |      1 |     11 |     11 |00:00:00.01 |       5 |       |       |          |
|   2 |   SORT JOIN           |      |      1 |     11 |     12 |00:00:00.01 |       3 |  2048 |  2048 | 2048  (0)|
|   3 |    VIEW               |      |      1 |     11 |     12 |00:00:00.01 |       3 |       |       |          |
|   4 |     HASH GROUP BY     |      |      1 |     11 |     12 |00:00:00.01 |       3 |  1186K|  1186K| 2349K (0)|
|   5 |      TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|*  6 |   SORT JOIN           |      |     12 |     27 |     11 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   7 |    TABLE ACCESS FULL  | DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
-------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   6 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

28 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;인라인 뷰 안에 ORDER BY 추가&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;hash group by &amp;rarr; sort group by&lt;/li&gt;
&lt;li&gt;메모리 사용량이 줄음&lt;/li&gt;
&lt;li&gt;인라인 뷰 12건 읽고 dept 27건과 merge&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(e,d) use_merge(d) */ d.department_id, d.department_name, e.sum_sal
from (select department_id, sum(salary) sum_sal 
        from hr.emp 
        group by department_id
        order by department_id) e, hr.dept d
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5vpf3vu91bgg7, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(e,d) use_merge(d) */
d.department_id, d.department_name, e.sum_sal from (select
department_id, sum(salary) sum_sal   from hr.emp   group by
department_id   order by department_id) e, hr.dept d where
e.department_id = d.department_id

Plan hash value: 5777633

------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |      |      1 |        |     11 |00:00:00.01 |       5 |       |       |          |
|   1 |  MERGE JOIN          |      |      1 |     11 |     11 |00:00:00.01 |       5 |       |       |          |
|   2 |   VIEW               |      |      1 |     11 |     12 |00:00:00.01 |       3 |       |       |          |
|   3 |    SORT GROUP BY     |      |      1 |     11 |     12 |00:00:00.01 |       3 |  2048 |  2048 | 2048  (0)|
|   4 |     TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|*  5 |   SORT JOIN          |      |     12 |     27 |     11 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   6 |    TABLE ACCESS FULL | DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

28 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조인 순서 바꾸기&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;버퍼 수가 늘어남&lt;/li&gt;
&lt;li&gt;dept 27건을 읽고 인라인 뷰 12건과 merge&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  f9up6avff1bz4, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_merge(e) */
d.department_id, d.department_name, e.sum_sal from (select
department_id, sum(salary) sum_sal   from hr.emp   group by
department_id   order by department_id) e, hr.dept d where
e.department_id = d.department_id

Plan hash value: 3099070663

------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |          |      1 |        |     11 |00:00:00.01 |       7 |       |       |      |
|   1 |  MERGE JOIN                  |          |      1 |     11 |     11 |00:00:00.01 |       7 |       |       |      |
|   2 |   TABLE ACCESS BY INDEX ROWID| DEPT     |      1 |     27 |     27 |00:00:00.01 |       4 |       |       |      |
|   3 |    INDEX FULL SCAN           | DEPT_IDX |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |      |
|*  4 |   SORT JOIN                  |          |     27 |     11 |     11 |00:00:00.01 |       3 |  2048 |  2048 | 2048  (0)|
|   5 |    VIEW                      |          |      1 |     11 |     12 |00:00:00.01 |       3 |       |       |      |
|   6 |     SORT GROUP BY            |          |      1 |     11 |     12 |00:00:00.01 |       3 |  2048 |  2048 | 2048  (0)|
|   7 |      TABLE ACCESS FULL       | EMP      |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |      |
------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

29 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Hash Join&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;NL 조인은 대량 데이터에 대해서 random access가 부담스럽고, Sort Merger 조인은 정렬 작업에 대한 부담이 존재&lt;/li&gt;
&lt;li&gt;이러한 부담을 줄이고자 Hash Join 사용&lt;/li&gt;
&lt;li&gt;조인으로 수행하는 집합 중에 작은 집합을 build table(hash table)으로 생성하고 반대쪽 큰 집합은 probe해서 해시 테이블을 탐색하면서 조인하는 방식&lt;/li&gt;
&lt;li&gt;hash table로 생성되는 build table은 작은 것도 중요하지만 해시 키 값으로 사용되는 컬럼에 중복 값이 거의 없을 때 효과적&lt;/li&gt;
&lt;li&gt;hash key에 충돌이 발생하지 않는 것이 좋음&lt;/li&gt;
&lt;li&gt;연산자의 제약 존재 (= 조건만 가능)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) */ d.department_id, d.department_name
from hr.emp e, hr.dept d
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  d0adtmqvxv343, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) */
d.department_id, d.department_name from hr.emp e, hr.dept d where
e.department_id = d.department_id

Plan hash value: 2769118127

------------------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name         | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |              |      1 |        |    106 |00:00:00.01 |      10 |       |       |          |
|*  1 |  HASH JOIN         |              |      1 |    106 |    106 |00:00:00.01 |      10 |  1572K|  1572K| 1497K (0)|
|   2 |   TABLE ACCESS FULL| DEPT         |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
|   3 |   INDEX FULL SCAN  | EMP_DEPT_IDX |      1 |    107 |    106 |00:00:00.01 |       8 |       |       |          |
------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Build Table&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Hash Table&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select ora_hash(department_id, 10, 0), department_id, department_name
from hr.dept;  2

ORA_HASH(DEPARTMENT_ID,10,0) DEPARTMENT_ID DEPARTMENT_NAME
---------------------------- ------------- ------------------------------
                           8            10 Administration
                           2            20 Marketing
                           8            30 Purchasing
                           7            40 Human Resources
                           7            50 Shipping
                           1            60 IT
                           5            70 Public Relations
                           5            80 Sales
                           2            90 Executive
                           4           100 Finance
                           0           110 Accounting
                          10           120 Treasury
                           4           130 Corporate Tax
                           8           140 Control And Credit
                           9           150 Shareholder Services
                           5           160 Benefits
                           9           170 Manufacturing
                           0           180 Construction
                           6           190 Contracting
                           8           200 Operations
                           1           210 IT Support
                           7           220 NOC
                           2           230 IT Helpdesk
                           4           240 Government Sales
                           1           250 Retail Sales
                          10           260 Recruiting
                           8           270 Payroll

27 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;Probe Table&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select ora_hash(department_id, 10, 0), department_id, employee_id, last_name, salary
from hr.emp;

ORA_HASH(DEPARTMENT_ID,10,0) DEPARTMENT_ID EMPLOYEE_ID LAST_NAME                     SALARY
---------------------------- ------------- ----------- ------------------------- ----------
                           2            90         100 King                           20000
                           2            90         101 Kochhar                        17000
                           2            90         102 De Haan                        17000
                           1            60         103 Hunold                          9000
                           1            60         104 Ernst                           6000
                           1            60         105 Austin                          4800
                                                                       ...
                           8            10         200 Whalen                          4840
                           2            20         201 Hartstein                      13000
                           2            20         202 Fay                             6000
                           7            40         203 Mavris                          6500
                           5            70         204 Baer                           10000
                           0           110         205 Higgins                        12008
                           0           110         206 Gietz                           8300

107 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;큰 테이블을 build 테이블로 지정&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(e,d) use_hash(d) */ d.department_id, d.department_name
from hr.emp e, hr.dept d
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8zm3s98uw73f7, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(e,d) use_hash(d) */
d.department_id, d.department_name from hr.emp e, hr.dept d where
e.department_id = d.department_id

Plan hash value: 3132305350

------------------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name         | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |              |      1 |        |    106 |00:00:00.01 |       5 |       |       |          |
|*  1 |  HASH JOIN         |              |      1 |    106 |    106 |00:00:00.01 |       5 |  2546K|  2546K| 1426K (0)|
|   2 |   INDEX FULL SCAN  | EMP_DEPT_IDX |      1 |    107 |    106 |00:00:00.01 |       1 |       |       |          |
|   3 |   TABLE ACCESS FULL| DEPT         |      1 |     27 |     27 |00:00:00.01 |       4 |       |       |          |
------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;테이블 3개 조인&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(l,d,e) use_hash(d) use_hash(e) */ e.employee_id, e.last_name, e.salary, d.department_name, l.city, l.postal_code
from hr.emp e, hr.dept d, hr.loc l
where e.department_id = d.department_id
and d.location_id = l.location_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4sxjj4pcw9mqs, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(l,d,e) use_hash(d)
use_hash(e) */ e.employee_id, e.last_name, e.salary, d.department_name,
l.city, l.postal_code from hr.emp e, hr.dept d, hr.loc l where
e.department_id = d.department_id and d.location_id = l.location_id

Plan hash value: 166230492

-----------------------------------------------------------------------------------------------------------------
| Id  | Operation           | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |      |      1 |        |    106 |00:00:00.01 |      16 |       |       |          |
|*  1 |  HASH JOIN          |      |      1 |    106 |    106 |00:00:00.01 |      16 |  1222K|  1222K| 1282K (0)|
|*  2 |   HASH JOIN         |      |      1 |     27 |     27 |00:00:00.01 |       5 |  1449K|  1449K| 1493K (0)|
|   3 |    TABLE ACCESS FULL| LOC  |      1 |     23 |     23 |00:00:00.01 |       2 |       |       |          |
|   4 |    TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
|   5 |   TABLE ACCESS FULL | EMP  |      1 |    107 |    107 |00:00:00.01 |      10 |       |       |          |
-----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
   2 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=&quot;L&quot;.&quot;LOCATION_ID&quot;)

26 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;테이블 3개 조인, 큰 테이블을 build 테이블로 지정&lt;/h3&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(e,d,l) use_hash(d) use_hash(l) */ e.employee_id, e.last_name, e.salary, d.department_name, l.city, l.postal_code
from hr.emp e, hr.dept d, hr.loc l
where e.department_id = d.department_id
and d.location_id = l.location_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  65xw4kwrqbnuz, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(e,d,l) use_hash(d)
use_hash(l) */ e.employee_id, e.last_name, e.salary, d.department_name,
l.city, l.postal_code from hr.emp e, hr.dept d, hr.loc l where
e.department_id = d.department_id and d.location_id = l.location_id

Plan hash value: 1136838143

-----------------------------------------------------------------------------------------------------------------
| Id  | Operation           | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |      |      1 |        |    106 |00:00:00.01 |      12 |       |       |          |
|*  1 |  HASH JOIN          |      |      1 |    106 |    106 |00:00:00.01 |      12 |  1265K|  1265K|  839K (0)|
|*  2 |   HASH JOIN         |      |      1 |    106 |    106 |00:00:00.01 |       6 |  1449K|  1449K| 1406K (0)|
|   3 |    TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|   4 |    TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
|   5 |   TABLE ACCESS FULL | LOC  |      1 |     23 |     23 |00:00:00.01 |       5 |       |       |          |
-----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=&quot;L&quot;.&quot;LOCATION_ID&quot;)
   2 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

26 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;SWAP_JOIN_INPUTS&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;probe table을 build table로 바꿔주는 힌트&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e,l) use_hash(e) use_hash(l) swap_join_inputs(l) */ e.employee_id, e.last_name, e.salary, d.department_name, l.city, l.postal_code
from hr.emp e, hr.dept d, hr.loc l
where e.department_id = d.department_id
and d.location_id = l.location_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  3n6xrfadbcwtg, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e,l) use_hash(e)
use_hash(l) swap_join_inputs(l) */ e.employee_id, e.last_name,
e.salary, d.department_name, l.city, l.postal_code from hr.emp e,
hr.dept d, hr.loc l where e.department_id = d.department_id and
d.location_id = l.location_id

Plan hash value: 3715164367

-----------------------------------------------------------------------------------------------------------------
| Id  | Operation           | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |      |      1 |        |    106 |00:00:00.01 |      16 |       |       |          |
|*  1 |  HASH JOIN          |      |      1 |    106 |    106 |00:00:00.01 |      16 |  1449K|  1449K| 1507K (0)|
|   2 |   TABLE ACCESS FULL | LOC  |      1 |     23 |     23 |00:00:00.01 |       2 |       |       |          |
|*  3 |   HASH JOIN         |      |      1 |    106 |    106 |00:00:00.01 |      13 |  1449K|  1449K| 1571K (0)|
|   4 |    TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
|   5 |    TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |      10 |       |       |          |
-----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=&quot;L&quot;.&quot;LOCATION_ID&quot;)
   3 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

27 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;Outer Join&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;(+) 가 붙지 않은 테이블이 항상 Driving 테이블(outer, first, build)로 선택됨&lt;/li&gt;
&lt;li&gt;(+) 가 붙은 테이블이 항상 Driven 테이블(inner, second, probe)로 선택됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ e.employee_id, e.last_name, e.salary, d.department_name
from hr.emp e, hr.dept d
where e.department_id = d.department_id(+);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5bbn6t4qp0zqy, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.employee_id, e.last_name,
e.salary, d.department_name from hr.emp e, hr.dept d where
e.department_id = d.department_id(+)

Plan hash value: 3387915970

----------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |      |      1 |        |    107 |00:00:00.01 |      10 |       |       |          |
|*  1 |  HASH JOIN OUTER   |      |      1 |    107 |    107 |00:00:00.01 |      10 |  1399K|  1399K| 1214K (0)|
|   2 |   TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|   3 |   TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       7 |       |       |          |
----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

26 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;힌트로 제어 불가&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인 순서를 지정해도 조인 순서가 바뀌지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_hash(e) */ e.employee_id, e.last_name, e.salary, d.department_name
from hr.emp e, hr.dept d
where e.department_id = d.department_id(+);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2223s146a0w78, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_hash(e) */
e.employee_id, e.last_name, e.salary, d.department_name from hr.emp e,
hr.dept d where e.department_id = d.department_id(+)

Plan hash value: 3387915970

----------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |      |      1 |        |    107 |00:00:00.01 |      10 |       |       |          |
|*  1 |  HASH JOIN OUTER   |      |      1 |    107 |    107 |00:00:00.01 |      10 |  1399K|  1399K| 1210K (0)|
|   2 |   TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|   3 |   TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       7 |       |       |          |
----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

26 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;NL 조인으로 유도해도 NL 조인으로 바뀌지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  5xzw93qktzwyy, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_nl(e) */
e.employee_id, e.last_name, e.salary, d.department_name from hr.emp e,
hr.dept d where e.department_id = d.department_id(+)

Plan hash value: 3387915970

----------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |      |      1 |        |    107 |00:00:00.01 |      10 |       |       |          |
|*  1 |  HASH JOIN OUTER   |      |      1 |    107 |    107 |00:00:00.01 |      10 |  1399K|  1399K| 1214K (0)|
|   2 |   TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|   3 |   TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       7 |       |       |          |
----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

26 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Sort Merge 조인으로 유도해도 Sort Merge 조인으로 바뀌지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_merge(e) */ e.employee_id, e.last_name, e.salary, d.department_name
from hr.emp e, hr.dept d
where e.department_id = d.department_id(+);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  0d94z3374k1q5, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_merge(e) */
e.employee_id, e.last_name, e.salary, d.department_name from hr.emp e,
hr.dept d where e.department_id = d.department_id(+)

Plan hash value: 3387915970

----------------------------------------------------------------------------------------------------------------
| Id  | Operation          | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |      |      1 |        |    107 |00:00:00.01 |      10 |       |       |          |
|*  1 |  HASH JOIN OUTER   |      |      1 |    107 |    107 |00:00:00.01 |      10 |  1399K|  1399K| 1210K (0)|
|   2 |   TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|   3 |   TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       7 |       |       |          |
----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

26 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Outer Join의 조인 순서는 제어할 수 없으므로 leading 힌트를 제거하고 use_nl만 사용하면 NL 조인으로 변경됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  0t284jbyuwvs7, child number 0
-------------------------------------
select /*+ gather_plan_statistics use_nl(d) */ e.employee_id,
e.last_name, e.salary, d.department_name from hr.emp e, hr.dept d where
e.department_id = d.department_id(+)

Plan hash value: 387818061

---------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
---------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |          |      1 |        |    107 |00:00:00.01 |     128 |
|   1 |  NESTED LOOPS OUTER          |          |      1 |    107 |    107 |00:00:00.01 |     128 |
|   2 |   TABLE ACCESS FULL          | EMP      |      1 |    107 |    107 |00:00:00.01 |      11 |
|   3 |   TABLE ACCESS BY INDEX ROWID| DEPT     |    107 |      1 |    106 |00:00:00.01 |     117 |
|*  4 |    INDEX UNIQUE SCAN         | DEPT_IDX |    107 |      1 |    106 |00:00:00.01 |      11 |
---------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Outer Join의 조인 순서는 제어할 수 없으므로 leading 힌트를 제거하고 use_merge만 사용하면 Sort Merge 조인으로 변경됨&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4wf0w5p9zpm95, child number 0
-------------------------------------
select /*+ gather_plan_statistics use_merge(d) */ e.employee_id,
e.last_name, e.salary, d.department_name from hr.emp e, hr.dept d where
e.department_id = d.department_id(+)

Plan hash value: 2895827831

-----------------------------------------------------------------------------------------------------------------
| Id  | Operation           | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT    |      |      1 |        |    107 |00:00:00.01 |       5 |       |       |          |
|   1 |  MERGE JOIN OUTER   |      |      1 |    107 |    107 |00:00:00.01 |       5 |       |       |          |
|   2 |   SORT JOIN         |      |      1 |    107 |    107 |00:00:00.01 |       3 | 15360 | 15360 |14336  (0)|
|   3 |    TABLE ACCESS FULL| EMP  |      1 |    107 |    107 |00:00:00.01 |       3 |       |       |          |
|*  4 |   SORT JOIN         |      |    107 |     27 |    106 |00:00:00.01 |       2 |  2048 |  2048 | 2048  (0)|
|   5 |    TABLE ACCESS FULL| DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
-----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)
       filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

25 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;Hash Join은 &lt;code&gt;swap_join_inputs&lt;/code&gt; 힌트로 build 와 probe 변경 가능&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics swap_join_inputs(d) */ e.employee_id, e.last_name, e.salary, d.department_name
from hr.emp e, hr.dept d
where e.department_id = d.department_id(+);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2179s140axbdh, child number 0
-------------------------------------
select /*+ gather_plan_statistics swap_join_inputs(d) */ e.employee_id,
e.last_name, e.salary, d.department_name from hr.emp e, hr.dept d where
e.department_id = d.department_id(+)

Plan hash value: 4261033907

-------------------------------------------------------------------------------------------------------------------
| Id  | Operation             | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT      |      |      1 |        |    107 |00:00:00.01 |      13 |       |       |          |
|*  1 |  HASH JOIN RIGHT OUTER|      |      1 |    107 |    107 |00:00:00.01 |      13 |  1572K|  1572K| 1543K (0)|
|   2 |   TABLE ACCESS FULL   | DEPT |      1 |     27 |     27 |00:00:00.01 |       2 |       |       |          |
|   3 |   TABLE ACCESS FULL   | EMP  |      1 |    107 |    107 |00:00:00.01 |      11 |       |       |          |
-------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;쿼리 변환(Query Transformation)&lt;/h1&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;SQL문을 분석해 의미적으로 동일하면서도 더 나은 성능이 기대되는 형태로 재작성하는 것을 의미&lt;/li&gt;
&lt;li&gt;optimizer 가 실행 계획을 생성하기 전에 사용자가 작성한 SQL문 결과는 똑같은데 비용이 더 적게 발생한 것 같으면 쿼리를 변경&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;서브 쿼리 처리 방식(IN, EXISTS)&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;서브 쿼리(subquery)는 하나의 SQL 문장 내에서 괄호로 묶인 별도의 쿼리 블록(Query Block)&lt;/li&gt;
&lt;li&gt;Inline View(인라인 뷰)&lt;/li&gt;
&lt;li&gt;Nested Subquery(중첩 서브 쿼리)&lt;/li&gt;
&lt;li&gt;Correlated Subquery(상호 관련 서브 쿼리, 상관 서브 쿼리)&lt;/li&gt;
&lt;li&gt;Scalar Subquery(스칼라 서브 쿼리)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;1. FILTER 방식&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;메인 쿼리에서 읽은 행마다 서브 쿼리를 반복 수행하면서 조건에 맞는 데이터를 찾는 방식&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where department_id in (select /*+ no_unnest */ department_id from hr.departments);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  99g11np2tvacz, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where
department_id in (select /*+ no_unnest */ department_id from
hr.departments)

Plan hash value: 2979032901

-------------------------------------------------------------------------------------------
| Id  | Operation          | Name       | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |            |      1 |        |    106 |00:00:00.01 |      25 |
|*  1 |  FILTER            |            |      1 |        |    106 |00:00:00.01 |      25 |
|   2 |   TABLE ACCESS FULL| EMPLOYEES  |      1 |    107 |    107 |00:00:00.01 |      14 |
|*  3 |   INDEX UNIQUE SCAN| DEPT_ID_PK |     12 |      1 |     11 |00:00:00.01 |      11 |
-------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter( IS NOT NULL)
   3 - access(&quot;DEPARTMENT_ID&quot;=:B1)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;메인 쿼리에서 107건을 읽었는데 서브 쿼리를 12번만 수행함 &amp;rarr; 캐시 기능 작동
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;code&gt;3 - access(&quot;DEPARTMENT_ID&quot;=:B1)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;filter opertaion에 의해 수행되는 조건의 input 값(subquery)을 cache에 담아 놓고 동일한 input값이 사용되는 경우 추가적인 읽기 작업 없이 cache된 값을 사용&lt;/li&gt;
&lt;li&gt;이 기능을 filter optimization이라고 함&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;# 반복적으로 수행되는 동일 연산 결과를 캐싱하는 최대 메모리 크기
SYS@ora19c&amp;gt; select a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_query_execution_cache_max_size';  2    3    4

PARAMETER                                                                        VALUE
-------------------------------------------------------------------------------- ------------------------------
_query_execution_cache_max_size                                                  131072&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;exists 상호 관련 서브 쿼리 사용한 것과 동일&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees e
where exists (select /*+ no_unnest */ 'x'
                from hr.departments
                where department_id = e.department_id);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  gnr4zz9za2vv1, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees e where exists
(select /*+ no_unnest */ 'x'     from hr.departments     where
department_id = e.department_id)

Plan hash value: 2979032901

-------------------------------------------------------------------------------------------
| Id  | Operation          | Name       | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |            |      1 |        |    106 |00:00:00.01 |      25 |
|*  1 |  FILTER            |            |      1 |        |    106 |00:00:00.01 |      25 |
|   2 |   TABLE ACCESS FULL| EMPLOYEES  |      1 |    107 |    107 |00:00:00.01 |      14 |
|*  3 |   INDEX UNIQUE SCAN| DEPT_ID_PK |     12 |      1 |     11 |00:00:00.01 |      11 |
-------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter( IS NOT NULL)
   3 - access(&quot;DEPARTMENT_ID&quot;=:B1)

23 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;2. UNNEST&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;중첩된 상태를 풀어줌&lt;/li&gt;
&lt;li&gt;동일한 결과를 보장한다면 조인문으로 변환&lt;/li&gt;
&lt;li&gt;조인으로 변환하면 다양한 액세스 경로, 조인 방법, 조인 순서를 결정할 수 있음&lt;/li&gt;
&lt;li&gt;힌트 : &lt;code&gt;unnest&lt;/code&gt; (filter 방식 대신 조인 방식으로 실행 계획을 만듦), &lt;code&gt;no_unnest&lt;/code&gt; (filter 방식으로 실행계획을 만듦)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where department_id in (select department_id from hr.departments);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7nx2k4xf1bgm4, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where
department_id in (select department_id from hr.departments)

Plan hash value: 1445457117

--------------------------------------------------------------------------------------------------
| Id  | Operation         | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
--------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |      1 |        |    106 |00:00:00.01 |      13 |      4 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |      1 |    106 |    106 |00:00:00.01 |      13 |      4 |
--------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot; IS NOT NULL)

19 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;&lt;b&gt;unnest&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ e.*
from hr.employees e, hr.departments d
where e.department_id = d.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  cu66qq6rzujur, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ e.* from hr.employees e,
hr.departments d where e.department_id = d.department_id

Plan hash value: 1445457117

-----------------------------------------------------------------------------------------
| Id  | Operation         | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |      1 |        |    106 |00:00:00.01 |      13 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |      1 |    106 |    106 |00:00:00.01 |      13 |
-----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;E&quot;.&quot;DEPARTMENT_ID&quot; IS NOT NULL)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;emp, dept 테이블 사이에는 FK 제약 조건이 걸려 있지 않기 때문에 조인이 자동으로 제거되지 않음&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.emp
where department_id in (select department_id from hr.dept);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  2bdsyz23rqt66, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp where department_id
in (select department_id from hr.dept)

Plan hash value: 1684231142

-----------------------------------------------------------------------------------------
| Id  | Operation          | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |          |      1 |        |    106 |00:00:00.01 |      20 |
|   1 |  NESTED LOOPS      |          |      1 |    106 |    106 |00:00:00.01 |      20 |
|   2 |   TABLE ACCESS FULL| EMP      |      1 |    107 |    107 |00:00:00.01 |      10 |
|*  3 |   INDEX UNIQUE SCAN| DEPT_IDX |    107 |      1 |    106 |00:00:00.01 |      10 |
-----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENT_ID&quot;)

21 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot; data-ke-list-type=&quot;decimal&quot;&gt;
&lt;li&gt;&lt;b&gt;조인 제거&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;1:M 관계인 두 테이블을 조인하는 쿼리문에서 1쪽 테이블을 참조하지 않는다면 1쪽 테이블을 읽지 않아도 됨&lt;/li&gt;
&lt;li&gt;즉 조인 제거 기능이 작동됨&lt;/li&gt;
&lt;li&gt;단 조인 제거 기능이 작동하려면 primary key, foreign key 설정이 되어 있어야만 조인 제거 기능이 수행됨&lt;/li&gt;
&lt;li&gt;힌트 : &lt;code&gt;eliminate_join&lt;/code&gt; (조인 제거 활성화), &lt;code&gt;no_eliminate_join&lt;/code&gt; (조인 제거 비활성화)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select u.table_name, c.column_name, u.constraint_name, u.constraint_type,u.search_condition, u.r_constraint_name, u.index_name
from dba_constraints u, dba_cons_columns c
where u.constraint_name = c.constraint_name
and u.table_name in ('EMPLOYEES','DEPARTMENTS')
and u.owner = 'HR'
order by 1;  2    3    4    5    6

TABLE_NAME                     COLUMN_NAME                    CONSTRAINT_NAME       C SEARCH_CONDITION        R_CONSTRAINT_NAME              INDEX_NAME
------------------------------ ------------------------------ ------------------------------ - ------------------------------ ------------------------------ ------------------------------
DEPARTMENTS                    DEPARTMENT_NAME                DEPT_NAME_NN          C &quot;DEPARTMENT_NAME&quot; IS NOT NULL
DEPARTMENTS                    DEPARTMENT_ID                  DEPT_ID_PK            P                                                                DEPT_ID_PK
DEPARTMENTS                    MANAGER_ID                     DEPT_MGR_FK           R                                 EMP_EMP_ID_PK
DEPARTMENTS                    LOCATION_ID                    DEPT_LOC_FK           R                                 LOC_ID_PK
EMPLOYEES                      EMAIL                          EMP_EMAIL_NN          C &quot;EMAIL&quot; IS NOT NULL
EMPLOYEES                      HIRE_DATE                      EMP_HIRE_DATE_NN      C &quot;HIRE_DATE&quot; IS NOT NULL
EMPLOYEES                      JOB_ID                         EMP_JOB_NN            C &quot;JOB_ID&quot; IS NOT NULL
EMPLOYEES                      SALARY                         EMP_SALARY_MIN        C salary &amp;gt; 0
EMPLOYEES                      EMAIL                          EMP_EMAIL_UK          U                                                                EMP_EMAIL_UK
EMPLOYEES                      EMPLOYEE_ID                    EMP_EMP_ID_PK         P                                                                EMP_EMP_ID_PK
EMPLOYEES                      MANAGER_ID                     EMP_MANAGER_FK        R                                 EMP_EMP_ID_PK
EMPLOYEES                      JOB_ID                         EMP_JOB_FK            R                                 JOB_ID_PK
EMPLOYEES                      DEPARTMENT_ID                  EMP_DEPT_FK           R                                 DEPT_ID_PK
EMPLOYEES                      LAST_NAME                      EMP_LAST_NAME_NN      C &quot;LAST_NAME&quot; IS NOT NULL

14 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인 제거 기능 활성화 여부 조회&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gams&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_optimizer_join_elimination_enabled';  2    3    4

PARAMETER                                                                        VALUE
-------------------------------------------------------------------------------- ----------------------
_optimizer_join_elimination_enabled                                              TRUE&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인 제거 기능 비활성화&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter session set &quot;_optimizer_join_elimination_enabled&quot; = false;

Session altered.

SYS@ora19c&amp;gt; select a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_optimizer_join_elimination_enabled';  2    3    4

PARAMETER                                                                        VALUE
-------------------------------------------------------------------------------- ------------------------------
_optimizer_join_elimination_enabled                                              FALSE

select /*+ gather_plan_statistics */ *
from hr.employees
where department_id in (select department_id from hr.departments);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7nx2k4xf1bgm4, child number 1
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where
department_id in (select department_id from hr.departments)

Plan hash value: 169719308

-------------------------------------------------------------------------------------------
| Id  | Operation          | Name       | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |            |      1 |        |    106 |00:00:00.01 |      23 |
|   1 |  NESTED LOOPS      |            |      1 |    106 |    106 |00:00:00.01 |      23 |
|   2 |   TABLE ACCESS FULL| EMPLOYEES  |      1 |    107 |    107 |00:00:00.01 |      13 |
|*  3 |   INDEX UNIQUE SCAN| DEPT_ID_PK |    107 |      1 |    106 |00:00:00.01 |      10 |
-------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENT_ID&quot;)

21 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인 제거 기능 활성화&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;pgsql&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; alter session set &quot;_optimizer_join_elimination_enabled&quot; = true;

Session altered.

SYS@ora19c&amp;gt; select a.ksppinm parameter, b.ksppstvl value
from x$ksppi a, x$ksppcv b
where a.indx = b.indx
and a.ksppinm = '_optimizer_join_elimination_enabled';  2    3    4

PARAMETER                                                                        VALUE
-------------------------------------------------------------------------------- ------------------------------
_optimizer_join_elimination_enabled                                              TRUE

select /*+ gather_plan_statistics */ *
from hr.employees
where department_id in (select department_id from hr.departments);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7nx2k4xf1bgm4, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where
department_id in (select department_id from hr.departments)

Plan hash value: 1445457117

-----------------------------------------------------------------------------------------
| Id  | Operation         | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |      1 |        |    106 |00:00:00.01 |      13 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |      1 |    106 |    106 |00:00:00.01 |      13 |
-----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot; IS NOT NULL)

19 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인 제거 기능 비활성화 힌트로 제어&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where department_id in (select /*+ no_eliminate_join(d) */ department_id from hr.departments d);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  06v9tv5m0j9mt, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where
department_id in (select /*+ no_eliminate_join(d) */ department_id from
hr.departments d)

Plan hash value: 169719308

-------------------------------------------------------------------------------------------
| Id  | Operation          | Name       | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT   |            |      1 |        |    106 |00:00:00.01 |      23 |
|   1 |  NESTED LOOPS      |            |      1 |    106 |    106 |00:00:00.01 |      23 |
|   2 |   TABLE ACCESS FULL| EMPLOYEES  |      1 |    107 |    107 |00:00:00.01 |      13 |
|*  3 |   INDEX UNIQUE SCAN| DEPT_ID_PK |    107 |      1 |    106 |00:00:00.01 |      10 |
-------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   3 - access(&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENT_ID&quot;)

22 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;조인 제거 기능 활성화 힌트로 제어&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;asciidoc&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.employees
where department_id in (select /*+ eliminate_join(d) */ department_id from hr.departments d);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  8wa7bx96skn77, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.employees where
department_id in (select /*+ eliminate_join(d) */ department_id from
hr.departments d)

Plan hash value: 1445457117

-----------------------------------------------------------------------------------------
| Id  | Operation         | Name      | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |           |      1 |        |    106 |00:00:00.01 |      13 |
|*  1 |  TABLE ACCESS FULL| EMPLOYEES |      1 |    106 |    106 |00:00:00.01 |      13 |
-----------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter(&quot;DEPARTMENT_ID&quot; IS NOT NULL)

20 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;unnest 동작&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.emp
where department_id in (select department_id from hr.dept where location_id = 1500);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4u5n8fr3xckrq, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp where department_id
in (select department_id from hr.dept where location_id = 1500)

Plan hash value: 1642998879

----------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name         | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |              |      1 |        |     45 |00:00:00.01 |      11 |
|   1 |  NESTED LOOPS                         |              |      1 |     37 |     45 |00:00:00.01 |      11 |
|   2 |   NESTED LOOPS                        |              |      1 |     40 |     45 |00:00:00.01 |       6 |
|   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| DEPT         |      1 |      4 |      1 |00:00:00.01 |       2 |
|*  4 |     INDEX RANGE SCAN                  | DEPT_LOC_IDX |      1 |      4 |      1 |00:00:00.01 |       1 |
|*  5 |    INDEX RANGE SCAN                   | EMP_DEPT_IDX |      1 |     10 |     45 |00:00:00.01 |       4 |
|   6 |   TABLE ACCESS BY INDEX ROWID         | EMP          |     45 |     10 |     45 |00:00:00.01 |       5 |
----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;LOCATION_ID&quot;=1500)
   5 - access(&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENT_ID&quot;)

Note
-----
   - this is an adaptive plan

29 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;내부적으로 아래와 같이 조인으로 쿼리 변환&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics leading(d,e) use_nl(e) */ *
from hr.emp e, hr.dept d
where e.department_id = d.department_id
and d.location_id = 1500;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  7chah43ttsbjb, child number 0
-------------------------------------
select /*+ gather_plan_statistics leading(d,e) use_nl(e) */ * from
hr.emp e, hr.dept d where e.department_id = d.department_id and
d.location_id = 1500

Plan hash value: 1642998879

----------------------------------------------------------------------------------------------------------------
| Id  | Operation                             | Name         | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
----------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                      |              |      1 |        |     45 |00:00:00.01 |      12 |
|   1 |  NESTED LOOPS                         |              |      1 |     37 |     45 |00:00:00.01 |      12 |
|   2 |   NESTED LOOPS                        |              |      1 |     40 |     45 |00:00:00.01 |       7 |
|   3 |    TABLE ACCESS BY INDEX ROWID BATCHED| DEPT         |      1 |      4 |      1 |00:00:00.01 |       3 |
|*  4 |     INDEX RANGE SCAN                  | DEPT_LOC_IDX |      1 |      4 |      1 |00:00:00.01 |       2 |
|*  5 |    INDEX RANGE SCAN                   | EMP_DEPT_IDX |      1 |     10 |     45 |00:00:00.01 |       4 |
|   6 |   TABLE ACCESS BY INDEX ROWID         | EMP          |     45 |     10 |     45 |00:00:00.01 |       5 |
----------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   4 - access(&quot;D&quot;.&quot;LOCATION_ID&quot;=1500)
   5 - access(&quot;E&quot;.&quot;DEPARTMENT_ID&quot;=&quot;D&quot;.&quot;DEPARTMENT_ID&quot;)

26 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;no_unnest 힌트로 filter 방식으로 유도&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ *
from hr.emp
where department_id in (select /*+ no_unnest */ department_id from hr.dept where location_id = 1500);

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  4rtsfbyyxthhz, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ * from hr.emp where department_id
in (select /*+ no_unnest */ department_id from hr.dept where
location_id = 1500)

Plan hash value: 4186366752

---------------------------------------------------------------------------------------------------
| Id  | Operation                    | Name     | Starts | E-Rows | A-Rows |   A-Time   | Buffers |
---------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |          |      1 |        |     45 |00:00:00.01 |      29 |
|*  1 |  FILTER                      |          |      1 |        |     45 |00:00:00.01 |      29 |
|   2 |   TABLE ACCESS FULL          | EMP      |      1 |    107 |    107 |00:00:00.01 |       7 |
|*  3 |   TABLE ACCESS BY INDEX ROWID| DEPT     |     12 |      1 |      1 |00:00:00.01 |      22 |
|*  4 |    INDEX UNIQUE SCAN         | DEPT_IDX |     12 |      1 |     11 |00:00:00.01 |      11 |
---------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - filter( IS NOT NULL)
   3 - filter(&quot;LOCATION_ID&quot;=1500)
   4 - access(&quot;DEPARTMENT_ID&quot;=:B1)

25 rows selected.&lt;/code&gt;&lt;/pre&gt;
&lt;h2 data-ke-size=&quot;size26&quot;&gt;SEMI JOIN&lt;/h2&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;서브쿼리를 조인으로 바꿈&lt;/li&gt;
&lt;li&gt;조인으로 바뀐 서브쿼리는 항상 후행 처리(inner)&lt;/li&gt;
&lt;li&gt;메인 쿼리의 행이 서브 쿼리의 행과 매치되면 조인 조건에 만족되니 해당 행에 대해서 더이상 검색을 진행하지 않음&lt;/li&gt;
&lt;li&gt;exists : 조인에 성공하는 서브 쿼리 데이터를 만나는 순간 결과 집합에 담고 메인 쿼리 다음 행을 처리&lt;/li&gt;
&lt;li&gt;not exists : 조인에 성공하는 서브 쿼리 데이터를 만나는 순간 버리고 메인 쿼리 다음 행을 처리&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;소속 사원이 있는 부서 정보만 출력&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select *
from hr.departments d
where exists (select 'x' from hr.employees where department_id = d.department_id);  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           30 Purchasing                            114        1700
           40 Human Resources                       203        2400
           50 Shipping                              121        1500
           60 IT                                    103        1400
           70 Public Relations                      204        2700
           80 Sales                                 145        2500
           90 Executive                             100        1700
          100 Finance                               108        1700
          110 Accounting                            205        1700

11 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;조인으로 풀 경우 결과 건수가 맞지 않음&lt;/h3&gt;
&lt;pre class=&quot;angelscript&quot;&gt;&lt;code&gt;SYS@ora19c&amp;gt; select d.*
from hr.departments d, hr.employees e
where d.department_id = e.department_id;  2    3

DEPARTMENT_ID DEPARTMENT_NAME                MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
           10 Administration                        200        1700
           20 Marketing                             201        1800
           20 Marketing                             201        1800
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
           30 Purchasing                            114        1700
                                                                    ...
          100 Finance                               108        1700
          100 Finance                               108        1700
          100 Finance                               108        1700
          100 Finance                               108        1700
          100 Finance                               108        1700
          100 Finance                               108        1700
          110 Accounting                            205        1700
          110 Accounting                            205        1700

106 rows selected.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 data-ke-size=&quot;size23&quot;&gt;서브 쿼리에 distinct 사용&lt;/h3&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;HASH UNIQUE 작업으로 메모리 사용량이 증가&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;gherkin&quot;&gt;&lt;code&gt;select /*+ gather_plan_statistics */ d.*
from hr.departments d, (select distinct department_id from hr.employees) e
where d.department_id = e.department_id;

SYS@ora19c&amp;gt; select * from table(dbms_xplan.display_cursor(null, null, 'allstats last'));

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID  43r47ys7vb465, child number 0
-------------------------------------
select /*+ gather_plan_statistics */ d.* from hr.departments d, (select
distinct department_id from hr.employees) e where d.department_id =
e.department_id

Plan hash value: 3639742973

-------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation            | Name              | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
-------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT     |                   |      1 |        |     11 |00:00:00.01 |       9 |       |       |      |
|   1 |  VIEW                | VM_NWVW_1         |      1 |     11 |     11 |00:00:00.01 |       9 |       |       |      |
|   2 |   HASH UNIQUE        |                   |      1 |     11 |     11 |00:00:00.01 |       9 |  1028K|  1028K| 1035K (0)|
|   3 |    NESTED LOOPS SEMI |                   |      1 |     11 |     11 |00:00:00.01 |       9 |       |       |      |
|   4 |     TABLE ACCESS FULL| DEPARTMENTS       |      1 |     27 |     27 |00:00:00.01 |       6 |       |       |      |
|*  5 |     INDEX RANGE SCAN | EMP_DEPARTMENT_IX |     27 |     44 |     11 |00:00:00.01 |       3 |       |       |      |
-------------------------------------------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

   5 - access(&quot;D&quot;.&quot;DEPARTMENT_ID&quot;=&quot;DEPARTMENT_ID&quot;)

24 rows selected.
&lt;/code&gt;&lt;/pre&gt;</description>
      <category>Courses/아이티윌 오라클 DBA 과정</category>
      <category>oracle</category>
      <category>아이티윌</category>
      <category>오라클DBA과정</category>
      <category>튜닝</category>
      <author>DevJoy</author>
      <guid isPermaLink="true">https://joysdevlog.tistory.com/230</guid>
      <comments>https://joysdevlog.tistory.com/entry/%EC%95%84%EC%9D%B4%ED%8B%B0%EC%9C%8C-%EC%98%A4%EB%9D%BC%ED%81%B4-DBA-%EA%B3%BC%EC%A0%95-91%EA%B8%B0-260210-TIL#entry230comment</comments>
      <pubDate>Fri, 13 Mar 2026 07:57:09 +0900</pubDate>
    </item>
  </channel>
</rss>