Oracle 21版Database In-Memory LivaLabs实验(上)

Posted dingdingfish

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle 21版Database In-Memory LivaLabs实验(上)相关的知识,希望对你有一定的参考价值。

概述

目前Oracle LiveLabs上关于Oracle Database In-Memory的内容已更新,主要变化为:

  • 数据库使用21c
  • 增加了对21c原生JSON的实验
  • 增加了21c AIM HIGH级别的实验

这个实验的名称为Boost Analytics Performance with Oracle Database In-Memory

实验帮助在这里

实验环境描述

实验环境的生成需要约8分钟。这是一个2 OCPU(4 vCPU), 32G内存的机器。如果自己搭建环境,只需要16GB的内存就够了。

[oracle@dbhol:~]$ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Vendor ID:           AuthenticAMD
CPU family:          25
Model:               1
Model name:          AMD EPYC 7J13 64-Core Processor
Stepping:            1
CPU MHz:             2445.406
BogoMIPS:            4890.81
Virtualization:      AMD-V
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           64K
L1i cache:           64K
L2 cache:            512K
L3 cache:            16384K
NUMA node0 CPU(s):   0-3
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core invpcid_single ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves nt_good clzero xsaveerptr wbnoinvd arat npt nrip_save umip pku ospke vaes vpclmulqdq rdpid arch_capabilities

[oracle@dbhol:~]$ free -g
              total        used        free      shared  buff/cache   available
Mem:             31           3          17           6          10          21
Swap:             7           0           7

尽管提供了图形化VNC远程连接的方式,但也可以用putty直接登录虚机,这样更方便。方法请参见“Lab 1: Environment Setup”,此不赘述。

数据库版本为21.7,数据库是PDB1,用到了SSB和AIM两个schema:

Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.7.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO

SQL> select username from all_users where ORACLE_MAINTAINED != 'Y';

USERNAME
--------------------------------------------------------------------------------
PDBADMIN
AIM
SSB

SSB schema中的5张标准表均启用了压缩,以下命令只是说明,无需运行:

alter table lineorder move compress basic;
alter table part move compress basic;
alter table date_dim move compress basic;
alter table supplier move compress basic;
alter table customer move compress basic;
alter table storage(buffer_pool keep);

同时也都放在了指定的buffer pool中,以下命令只是说明,无需运行:

alter table lineorder storage(buffer_pool keep);
alter table part storage(buffer_pool keep);
alter table date_dim storage(buffer_pool keep);
alter table supplier storage(buffer_pool keep);
alter table customer storage(buffer_pool keep);

这5张表的数据生成可用以下命令:

./dbgen -s 10 -T c
./dbgen -s 10 -T s
./dbgen -s 10 -T p
./dbgen -s 10 -T l
./dbgen -s 1 -T d

然后导入数据后,将lineorder变为分区表,并删除2个分区:

alter table lineorder modify partition by range(lo_orderdate)
(
    partition part_1992 values less than ('19930101'),
    partition part_1993 values less than ('19940101'),
    partition part_1994 values less than ('19950101'),
    partition part_1995 values less than ('19960101'),
    partition part_1996 values less than ('19970101'),
    partition part_1997 values less than ('19980101'),
    partition part_1998 values less than ('19990101')
);

alter table lineorder drop partition part_1992;
alter table lineorder drop partition part_1993;

实验2:初始化环境

任务 1:为内存中用例初始化数据库

首先,需要用oracle用户下载实验脚本:

clear
cd ~oracle/labs
rm -rf ~oracle/labs/*
wget -O novnc-inmemory-21c.zip https://objectstorage.us-ashburn-1.oraclecloud.com/p/7lzqJmKirEWwAc-e4XbZhV0A9ZYzqv7jU6HRhADWpR5zbhHb3x3rKjZV3m5ktDD0/n/c4u04/b/livelabsfiles/o/labfiles/novnc-inmemory-21c.zip
unzip -qo novnc-inmemory-21c.zip
rm -f novnc-inmemory-21c.zip
cd inmemory
ls -ltrh

由于此环境的模板有2个CDB,CDB1和CDB2。而我们只需要CDB1,因此需要停掉CDB2:

sudo systemctl stop oracle-database
sudo sed -i -e 's|CDB2.*$|CDB2:/opt/oracle/product/21c/dbhome_1:N|g' /etc/oratab 
sudo systemctl start oracle-database
ps -ef|grep ora_|grep pmon|grep -v grep

而方法是在oratab中将CDB2的条目改为N:

$ cat /etc/oratab
CDB1:/opt/oracle/product/21c/dbhome_1:Y
CDB2:/opt/oracle/product/21c/dbhome_1:N

修改~/labs/inmemory目录下,以下两个文件中ssb和aim用户的口令:

$ ls *login.sql
aim_login.sql  imlogin.sql

任务 2:启用In-Memory

运行以下脚本,初始化环境变量:

. ~/.set-env-db.sh CDB1

我们来研究下这个脚本,其中有很多值得学习之处,详见其中的中文注释:

#!/bin/bash
# Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.

################################################################################
#
# Name:set-env-db.sh
#
# Description: Script to set the database environment (single instance) in multiple
#             Oracle homes setup
#
#
#  Pre-requisite: This should be executed as the user that owns Oracle DB binaries.
#
#  AUTHOR(S)
#  -------
#  Rene Fontcha, Oracle LiveLabs Platform Lead
#
#  MODIFIED        Date                 Comments
#  --------        ----------           -----------------------------------
#  Rene Fontcha    10/18/2021           Initial Creation
#  Rene Fontcha    05/19/2022           Replaced Public IP lookup routine
#  Rene Fontcha    07/19/2022           Added "Oracle LiveLabs" branding banner
#
###############################################################################
PRIVATE_IP=$(cat /etc/hosts | grep $(hostname) | grep -v grep |tail -1 | awk 'print $1')
HOSTNAME=$(hostname)

## 如果有多个私网IP地址,以下会得到所有列表
if [ -z $PRIVATE_IP ]; then
  PRIVATE_IP=$(oci-metadata -g privateIp | sed -n -e 's/^.*Private IP address: //p')
fi

export PRIVATE_IP
## 得到公网地址,这个命令不错
export PUBLIC_IP=$(curl -s ifconfig.me)
unset ORACLE_SID

if [ -f /etc/oratab ]; then
  OTAB=/etc/oratab
  oratab_exist=Y
elif [ -f /var/opt/oracle/oratab ]; then
  OTAB=/var/opt/oracle/oratab
  oratab_exist=Y
else
  oratab_exist=N
  echo 'oratab file not found.'
fi
load_env_header() 
  clear
  echo "================================================================================"
## figlet 需 yum安装,类似于banner,-c表示居中  
##  figlet -c Oracle LiveLabs
  echo "================================================================================"
  echo "                       ENV VARIABLES                                            "
  echo "--------------------------------------------------------------------------------"


load_db_env() 
  export ORAENV_ASK=NO
  . oraenv >/dev/null
  export ORAENV_ASK=YES
  export OH=$ORACLE_HOME
## 这个确定TNS_ADMIN的方法不错,即21c增加的orabasehome
  if [ -f $OH/bin/orabasehome ]; then
    export ORACLE_BASE_HOME=$(orabasehome)
    export TNS_ADMIN=$ORACLE_BASE_HOME/network/admin
  else
    export TNS_ADMIN=$OH/network/admin
  fi
  export LD_LIBRARY_PATH=$OH/lib
  export PATH=$OH/bin:$OH/OPatch:$JAVA_HOME/bin:/bin:/usr/ccs/bin:/usr/sfw/bin:/usr/bin:/usr/sbin:/usr/ucb:/etc:/usr/local/bin:/usr/dt/bin:/usr/openwin/bin:/opt/sfw/bin/:.:~:/sbin:/usr/X11R6/bin:$PATH
  alias ssql="$OH/bin/sql / as sysdba"

  echo " . ORACLE_BASE         = $ORACLE_BASE"
  if [ -f $OH/bin/orabasehome ]; then
    echo " . ORACLE_BASE_HOME    = $ORACLE_BASE_HOME"
  fi
  echo " . ORACLE_HOME         = $OH"
  echo " . ORACLE_SID          = $ORACLE_SID"
  echo " . PRIVATE_IP          = $PRIVATE_IP"
  echo " . PUBLIC_IP           = $PUBLIC_IP"
  echo " . HOSTNAME            = $HOSTNAME"
  echo "--------------------------------------------------------------------------------"
  echo "                       Database ENV set for $ORACLE_SID                       "
  echo "                                                                                "
  echo " Run this to reload/setup the Database ENV: source /usr/local/bin/.set-env-db.sh"
  echo "--------------------------------------------------------------------------------"
  echo "================================================================================"
  echo " "

#
#############################################################################
# Display Info
# ---------------------------------------------------------------------------

case $oratab_exist in
Y)
  if [ -z $1 ]; then
    SIDLIST=$(egrep -v -e '^$|#|\\*' $OTAB | cut -f1 -d:)
    echo ""
    echo "List of Database Instances"
    printf "\\n%-2s %-15s \\n" "#" "ORACLE_SID"
    echo "-- ----------"
    PS3=$'\\n'"Select a number from the list (1-n): "
    select sid in $SIDLIST; do
      echo ""
      if [ -n $sid ]; then
        ORACLE_SID=$sid
        load_env_header
        load_db_env
        break
      fi
    done
  else
    load_env_header
    if egrep -v '#|\\*' $OTAB | grep -w "$1:" >/dev/null; then
      ORACLE_SID=$1
      load_db_env
    else
      echo " . PRIVATE_IP          = $PRIVATE_IP"
      echo " . PUBLIC_IP           = $PUBLIC_IP"
      echo " . HOSTNAME            = $HOSTNAME"
      echo "--------------------------------------------------------------------------------"
      echo "                       Database ENV is not set                                  "
      echo "                       Supplied ORACLE_SID ($1) not found in $OTAB.             "
      echo "                                                                                "
      echo " Run this to reload/setup the Database ENV: source /usr/local/bin/.set-env-db.sh"
      echo "--------------------------------------------------------------------------------"
      echo "================================================================================"
      echo " "
    fi
  fi
  ;;
*)
  load_env_header
  echo " . PRIVATE_IP          = $PRIVATE_IP"
  echo " . PUBLIC_IP           = $PUBLIC_IP"
  echo " . HOSTNAME            = $HOSTNAME"
  echo "--------------------------------------------------------------------------------"
  echo "================================================================================"
  echo " "
  ;;
esac

这个脚本里还有一个figlet命令,类似于banner:

$ figlet "Oracle LiveLabs"
  ___                 _        _     _           _          _
 / _ \\ _ __ __ _  ___| | ___  | |   (_)_   _____| |    __ _| |__  ___
| | | | '__/ _` |/ __| |/ _ \\ | |   | \\ \\ / / _ \\ |   / _` | '_ \\/ __|
| |_| | | | (_| | (__| |  __/ | |___| |\\ V /  __/ |__| (_| | |_) \\__ \\
 \\___/|_|  \\__,_|\\___|_|\\___| |_____|_| \\_/ \\___|_____\\__,_|_.__/|___/

$ banner  "Oracle LiveLabs"

#######  ######      #      #####   #        #######        #        ###  #     #  #######  #           #     ######    #####
#     #  #     #    # #    #     #  #        #              #         #   #     #  #        #          # #    #     #  #     #
#     #  #     #   #   #   #        #        #              #         #   #     #  #        #         #   #   #     #  #
#     #  ######   #     #  #        #        #####          #         #   #     #  #####    #        #     #  ######    #####
#     #  #   #    #######  #        #        #              #         #    #   #   #        #        #######  #     #        #
#     #  #    #   #     #  #     #  #        #              #         #     # #    #        #        #     #  #     #  #     #
#######  #     #  #     #   #####   #######  #######        #######  ###     #     #######  #######  #     #  ######    #####

接下来设置数据库参数:

connect / as sysdba
alter system set heat_map=ON scope=spfile;
alter system set sga_max_size=8G scope=spfile;
alter system set sga_target=8G scope=spfile;
alter system set db_keep_cache_size=3000M scope=spfile;
alter system set pga_aggregate_target=2500M scope=spfile;
alter system set inmemory_size=3300M scope=spfile;
alter system set inmemory_max_populate_servers=4 scope=spfile;
alter system set inmemory_virtual_columns=enable scope=spfile;
alter system set "_inmemory_64k_percent"=5 scope=spfile;
alter system set "_inmemory_small_segment_threshold"=0 scope=spfile;
alter system set "_optimizer_use_feedback"=FALSE scope=spfile;
alter system set "_imado_enable_coloptim"=FALSE scope=spfile;

查看隐含参数的脚本如下,详见MOS How To Query And Change The Oracle Hidden Parameters In Oracle 10g and Later (文档 ID 315631.1):

set lines 150
col parameter for a40
col "Session Value" for a20
col "Instance Value" for a20
SELECT a.ksppinm "Parameter", b.KSPPSTDF "Default Value",
       b.ksppstvl "Session Value", 
       c.ksppstvl "Instance Value",
       decode(bitand(a.ksppiflg/256,1),1,'TRUE','FALSE') IS_SESSION_MODIFIABLE,
       decode(bitand(a.ksppiflg/65536,3),1,'IMMEDIATE',2,'DEFERRED',3,'IMMEDIATE','FALSE') IS_SYSTEM_MODIFIABLE
FROM   x$ksppi a,
       x$ksppcv b,
       x$ksppsv c
WHERE  a.indx = b.indx
AND    a.indx = c.indx
AND    a.ksppinm LIKE '/&1' escape '/'
/

以下是一些关键隐含参数的默认值和说明:

-- _inmemory_small_segment_threshold默认值为64K,表示小于此值的segment不会考虑发布到IMCS
-- _inmemory_64k_percent表示 in-memory area中元数据和数据的分配比例,默认为3比7
-- _imado_enable_coloptim没找到说明,
Parameter                                Default V Session Value        Instance Value       IS_SE IS_SYSTEM
---------------------------------------- --------- -------------------- -------------------- ----- ---------
_inmemory_small_segment_threshold        FALSE     65536                65536                FALSE IMMEDIATE
_inmemory_64k_percent                    FALSE     30                   30                   FALSE FALSE
_optimizer_use_feedback                  FALSE     TRUE                 TRUE                 TRUE  IMMEDIATE
_imado_enable_coloptim                   FALSE     TRUE                 TRUE                 TRUE  IMMEDIATE

_optimizer_use_feedback是11g引入的特性,详见以下文章:

重启使其生效:

shutdown immediate
startup
exit

实验 3:设置 In-Memory Column Store

此实验的主要脚本执行序列如下,后面会详述:

@01_show_parms.sql
@02_show_sga.sql
@03_im_usage.sql
@04_im_alter_table.sql
@05_im_attributes.sql

每次实验前,都需要执行以下:

. ~/.set-env-db.sh CDB1

进入setup目录,登录数据库:

cd /home/oracle/labs/inmemory/setup
sqlplus ssb/Ora_DB4U@localhost:1521/pdb1

先去除inmemory属性,原文中少了SUPPLIER表:

alter table SSB.DATE_DIM no inmemory;
alter table SSB.PART no inmemory;
alter table SSB.CUSTOMER no inmemory;
alter table SSB.SUPPLIER no inmemory;
alter table SSB.LINEORDER modify partition PART_1996 no inmemory;
alter table SSB.LINEORDER modify partition PART_1998 no inmemory;
alter table SSB.LINEORDER modify partition PART_1995 no inmemory;
alter table SSB.LINEORDER modify partition PART_1997 no inmemory;
alter table SSB.LINEORDER modify partition PART_1994 no inmemory;

查看内存设置:

SQL> @01_show_parms.sql
Connected.
SQL>
SQL> -- Shows the SGA init.ora parameters
SQL>
SQL> show parameter sga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
allow_group_access_to_sga            boolean     FALSE
lock_sga                             boolean     FALSE
pre_page_sga                         boolean     TRUE
sga_max_size                         big integer 8G
sga_min_size                         big integer 0
sga_target                           big integer 0
SQL>
SQL> show parameter db_keep_cache_size

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_keep_cache_size                   big integer 3008M
SQL>
SQL> show parameter heat_map

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
heat_map                             string      ON
SQL>
SQL> show parameter inmemory_size

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
inmemory_size                        big integer 3312M
SQL>
SQL> set echo off

可以看到我们修改了以下的默认参数:

  • INMEMORY_SIZE由0改为3300M
  • HEAT_MAP由OFF改为ON
  • DB_KEEP_CACHE_SIZE由0改为3000M,以便行式内存和列式内存的性能差异。

查看SGA设置,SGA设置为8G,输出显示In-Memory Area已配置:

SQL> @02_show_sga.sql
Connected.
SQL> set numwidth 20
SQL>
SQL> -- Show SGA memory allocation
SQL>
SQL> show sga

Total System Global Area           8589933480 bytes
Fixed Size                            9706408 bytes
Variable Size                       486539264 bytes
Database Buffers                   4613734400 bytes
Redo Buffers                          7069696 bytes
In-Memory Area                     3472883712 bytes
SQL>
SQL> set echo off

SGA 由固定大小、可变大小、数据库缓冲区和重做缓冲区组成。 由于我们设置了 INEMMORY_SIZE 参数,我们还可以看到在 SGA 中分配的 In-Memory Area。

In-Memory 区域被细分为两个池:一个 1MB 的池用于存储填充在 IM 列存储中的实际列格式数据,一个 64KB 的池用于存储有关填充在 IM 列存储中的对象的元数据。 V$INMEMORY_AREA 视图显示了在 IM 列存储中分配和使用的总内存。

SQL> @03_im_usage.sql
Connected.
SQL> column pool format a10;
SQL> column alloc_bytes format 999,999,999,999,999
SQL> column used_bytes format 999,999,999,999,999
SQL>
SQL> -- Show total column store usage
SQL>
SQL> SELECT pool, alloc_bytes, used_bytes, populate_status, con_id
  2  FROM   v$inmemory_area;

POOL                ALLOC_BYTES           USED_BYTES POPULATE_STATUS                          CON_ID
---------- -------------------- -------------------- -------------------------- --------------------
1MB POOL          3,252,682,752                    0 DONE                                          3
64KB POOL           201,326,592                    0 DONE                                          3

SQL>
SQL> set echo off

可以看到这两个池的比例为95比5:

SQL> select 3252682752/(3252682752+201326592) from dual;

3252682752/(3252682752+201326592)
---------------------------------
             .9417122040072859745

为SSB schema中的5张表设置inmemory属性:

SQL> @04_im_alter_table.sql
Connected.
SQL>
SQL> -- Enable tables for in-memory
SQL>
SQL> alter table LINEORDER inmemory;

Table altered.

SQL> alter table PART inmemory;

Table altered.

SQL> alter table CUSTOMER inmemory;

Table altered.

SQL> alter table SUPPLIER inmemory;

Table altered.

SQL> alter table DATE_DIM inmemory;

Table altered.

SQL>
SQL> set echo off

显示属性:

SQL> @05_im_attributes.sql
Connected.
SQL>
SQL> -- Show table attributes
SQL>
SQL> select table_name, NULL as partition_name, buffer_pool, compression, compress_for, inmemory,
  2         inmemory_priority, inmemory_distribute, inmemory_compression
  3  from   user_tables
  4  where  table_name in ('DATE_DIM','PART','SUPPLIER','CUSTOMER')
  5  UNION ALL
  6  select table_name, partition_name, buffer_pool, compression, compress_for, inmemory,
  7         inmemory_priority, inmemory_distribute, inmemory_compression
  8  from   user_tab_partitions
  9  where  table_name = 'LINEORDER';

                                         DISK                              INMEMORY   INMEMORY     INMEMORY
TABLE_NAME   PARTITION_NAME  BUFFER_POOL COMPRESSION COMPRESS_FOR INMEMORY PRIORITY   DISTRIBUTE   COMPRESSION
------------ --------------- ----------- ----------- ------------ -------- ---------- ------------ --------------
CUSTOMER                     KEEP        ENABLED     BASIC        ENABLED  NONE       AUTO         FOR QUERY LOW
DATE_DIM                     KEEP        ENABLED     BASIC        ENABLED  NONE       AUTO         FOR QUERY LOW
PART                         KEEP        ENABLED     BASIC        ENABLED  NONE       AUTO         FOR QUERY LOW
SUPPLIER                     KEEP        ENABLED     BASIC        ENABLED  NONE       AUTO         FOR QUERY LOW
LINEORDER    PART_1994       KEEP        ENABLED     BASIC        ENABLED  HIGH       AUTO         FOR QUERY LOW
LINEORDER    PART_1995       KEEP        ENABLED     BASIC        ENABLED  HIGH       AUTO         FOR QUERY LOW
LINEORDER    PART_1996       KEEP        ENABLED     BASIC        ENABLED  HIGH       AUTO         FOR QUERY LOW
LINEORDER    PART_1997       KEEP        ENABLED     BASIC        ENABLED  HIGH       AUTO         FOR QUERY LOW
LINEORDER    PART_1998       KEEP        ENABLED     BASIC        ENABLED  HIGH       AUTO         FOR QUERY LOW

9 rows selected.

SQL>
SQL> set echo off

通过全表扫描发布到IMCS:

SQL> @06_im_start_pop.sql
Connected.
SQL>
SQL> -- Access tables enabled for in-memory to start population
SQL>
SQL> select /*+ full(LINEORDER) noparallel(LINEORDER) */ count(*) from LINEORDER;

            COUNT(*)
--------------------
            41760941

SQL> select /*+ full(PART) noparallel(PART) */ count(*) from PART;

            COUNT(*)
--------------------
              800000

SQL> select /*+ full(CUSTOMER) noparallel(CUSTOMER) */ count(*) from CUSTOMER;

            COUNT(*)
--------------------
              300000

SQL> select /*+ full(SUPPLIER) noparallel(SUPPLIER) */ count(*) from SUPPLIER;

            COUNT(*)
--------------------
               20000

SQL> select /*+ full(DATE_DIM) noparallel(DATE_DIM) */ count(*) from DATE_DIM;

            COUNT(*)
--------------------
                2556

SQL>
SQL> set echo off

注意 FULL 和 NOPARALLEL 提示。 他们可确保表数据也被读入定义的 KEEP 池。 这仅针对本实验进行,以便我们可以向您展示基于内存的数据库内存列格式与传统行格式的性能比较。 这不是启动 Database In-Memory 填充所必需的。

populate_wait是同步发布的PL/SQL过程,但此处也可以用于查询发布状态:

SQL> @07_populate_wait.sql
Connected.
SQL>
SQL> -- Show populate_wait query
SQL>
SQL> -- Return code:
SQL> --   -1 = POPULATE_TIMEOUT
SQL> --    0 = POPULATE_SUCCESS
SQL> --    1 = POPULATE_OUT_OF_MEMORY
SQL> --    2 = POPULATE_NO_INMEMORY_OBJECTS
SQL> --    3 = POPULATE_INMEMORY_SIZE_ZERO
SQL>
SQL> select dbms_inmemory_admin.populate_wait(priority=>'NONE',percentage=>100,timeout=>60) pop_status from dual;

          POP_STATUS
--------------------
                   0

SQL>
SQL> set echo off

确认发布已完成,并且没有内存不够的现象:

SQL> @08_im_populated.sql
Connected.
SQL>
SQL> -- Query the view v$IM_SEGMENTS to shows what objects are in the column store
SQL> -- and how much of the objects were populated. When the BYTES_NOT_POPULATED is 0
SQL> -- it indicates the entire table was populated.
SQL>
SQL> select owner, segment_name, partition_name, populate_status, bytes,
  2         inmemory_size, bytes_not_populated
  3  from   v$im_segments
  4  order by owner, segment_name, partition_name;

                                                                                        In-Memory            Bytes
OWNER      SEGMENT_NAME         PARTITION_NAME  POPULATE_STATUS        Disk Size             Size    Not Populated
---------- -------------------- --------------- --------------- ---------------- ---------------- ----------------
SSB        CUSTOMER                             COMPLETED             24,928,256       23,199,744                0
SSB        DATE_DIM                             COMPLETED                122,880        1,179,648                0
SSB        LINEORDER            PART_1994       COMPLETED            563,609,600      478,281,728                0
SSB        LINEORDER            PART_1995       COMPLETED            563,470,336      478,281,728                0
SSB        LINEORDER            PART_1996       COMPLETED            565,018,624      480,378,880                0
SSB        LINEORDER            PART_1997       COMPLETED            563,322,880      479,330,304                0
SSB        LINEORDER            PART_1998       COMPLETED            329,015,296      280,690,688                0
SSB        PART                                 COMPLETED             56,893,440       16,973,824                0
SSB       

以上是关于Oracle 21版Database In-Memory LivaLabs实验(上)的主要内容,如果未能解决你的问题,请参考以下文章

Oracle 21版Database In-Memory LivaLabs实验(下)

Oracle 21版Database In-Memory LivaLabs实验(下)

Oracle Database 12c 第 1 版 与Oracle Database 11g 第 2 版 有啥区别 啊!???

[译] Oracle Database 21c 中的 Attention 日志

[译] Data Guard:Oracle Database 21c 中的 PREPARE DATABASE FOR DATA GUARD 命令

Oracle Database 11g For Windows7 旗舰版的安装