Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

TABLESPACE IN MEMORY OPTION

$
0
0
Managing Tablespace Setting Default InMemory Option

The Inmemory column store parameters setted for tablespace default means all tables and materialized views in that tablespace will use it.

Step .1 Check the PDB name

SQL> show con_name

CON_NAME
------------------------------
PRAM

Step .2 Check the other datafile desnation for the particulat PDB.
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ram/system01.dbf
/u01/app/oracle/oradata/ram/sysaux01.dbf
/u01/app/oracle/oradata/ram/undotbs01.dbf
/u01/app/oracle/oradata/ram/user01.dbf
/u01/app/oracle/oradata/ram/user02.dbf

Step 3. Create a Tablespace with using Default InMemory Parameter.

SQL> create tablespace tbs_im
  2  datafile '/u02/app/oracle/oradata/ram/imdata01.dbf' size 100m
  3  default inmemory;

Tablespace created.

Step 4. Check the Tablespace InMemory Features.
SQL>  select tablespace_name,def_inmemory,
  2  def_inmemory_priority,
  3  def_inmemory_distribute,
  4  def_inmemory_compression,
  5  def_inmemory_duplicate
  6  from dba_tablespaces
  7  order by 1;

TABLESPACE_NAME  DEF_INME DEF_INME DEF_INMEMORY_DI DEF_INMEMORY_COMP DEF_INMEMORY_
------------------------------ ------------------------ -------------- ---------------------------- -------------------- ------------------------------
RAMBS                          DISABLED
SYSAUX                         DISABLED
SYSTEM                         DISABLED
TBS_IM                         ENABLED     NONE     AUTO       FOR QUERY LOW     NO DUPLICATE
TEMP                           DISABLED
UNDOTBS1                       DISABLED
USERTBS2                       DISABLED

7 rows selected.

Step 5. Change the InMemory Memcompress for Capacity High
SQL> alter tablespace tbs_im
  2  default inmemory memcompress
  3  for capacity high;

Tablespace altered.

Step 6. Check the Tablespace InMemory Features.
SQL> select tablespace_name,def_inmemory,
  2  def_inmemory_priority,
  3  def_inmemory_distribute,
  4  def_inmemory_compression,
  5  def_inmemory_duplicate
  6  from dba_tablespaces
  7  order by 1;

TABLESPACE_NAME  DEF_INME DEF_INME DEF_INMEMORY_DI DEF_INMEMORY_COMP DEF_INMEMORY_
------------------------------ ------------------------ -------------- ---------------------------- -------------------- ------------------------------
RAMBS                          DISABLED
SYSAUX                         DISABLED
SYSTEM                         DISABLED
TBS_IM                         ENABLED  NONE     AUTO     FOR CAPACITY HIGH NO DUPLICATE
TEMP                           DISABLED
UNDOTBS1                       DISABLED
USERTBS2                       DISABLED

7 rows selected.

Step 7. Create a table for Default InMemory Tablespace.
SQL> create table u1.test_tab_im
  2  (id number(5), name varchar2(10),
  3  salary number(8))tablespace tbs_im;

Table created.

Step 8. Check the table InMemory Option
SQL> column table_name format a11
SQL> column column_name format a10
SQL> select table_name, segment_column_id,
  2  column_name, inmemory_compression
  3  from v$im_column_level
  4  where owner='U1' and
  5  table_name='TEST_TAB_IM'
  6  order by 2;

TABLE_NAME SEGMENT_COLUMN_ID COLUMN_NAM INMEMORY_COMPRESSION
---------- ----------------- ------------------------------ ----------------------- ------------------------------------------
TEST_TAB_IM                              1 ID                 DEFAULT
TEST_TAB_IM                              2 NAME               DEFAULT
TEST_TAB_IM                              3 SALARY             DEFAULT


Step 9. Modify the Tablespace to No InMemory Options.
SQL> alter tablespace tbs_im default no inmemory;

Tablespace altered.


Step 10. Check the Tablespace InMemory Features.
SQL> select tablespace_name,def_inmemory,
  2  def_inmemory_priority,
  3  def_inmemory_distribute,
  4  def_inmemory_compression,
  5  def_inmemory_duplicate
  6  from dba_tablespaces
  7  order by 1;

TABLESPACE_NAME  DEF_INME DEF_INME DEF_INMEMORY_DI DEF_INMEMORY_COMP DEF_INMEMORY_
------------------------------ ------------------------ -------------- ---------------------------- -------------------- ------------------------------
RAMBS                          DISABLED
SYSAUX                         DISABLED
SYSTEM                         DISABLED
TBS_IM                         DISABLED
TEMP                           DISABLED
UNDOTBS1                       DISABLED
USERTBS2                       DISABLED

7 rows selected.

Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>