Replica tables are updated in real-time when the source table is updated. Real-time replication is only supported for remote sources that support real-time change data capture (CDC).
The replica table exists in the local SAP HANA Cloud system. It is an automatically generated table contained in the internal schema _SYS_TABLE_REPLICA_DATA, which is managed by the internal user _SYS_TABLE_REPLICA_DATA. You cannot change the definition of a replica table directly.
The following applies
Toggling Between Virtual Tables and Replication Tables The toggle feature lets you switch between virtual tables and replication tables. To use a replicated table rather than a virtual table, the virtual table must have a corresponding replica table added to it.
12--Data Replication: replica table
alter virtual table "VT_AZ_SALES" add shared replica;


12345678910select
C.CUSTOMER_LASTNAME "lastname",
C.CUSTOMER_FIRSTNAME "Firstname",
C.CUSTOMER_COUNTRY "Country",
C.CUSTOMER_REGIONNAME "Region",
S.PRODUCT_ID "ProductID",
S.QUANTITY "Quantity"
from GX_CUSTOMERS C, VT_AZ_SALES S
where C.CUSTOMER_ID = S.CUSTOMER_ID and S.QUANTITY > 1
order by S.QUANTITY DESC;
Replica Table performance results:

Compared to virtual table selection from previous virtual table lesson:

To replicate with a replica table, insert a new row into the source table (MS Azure SQLDB) via a virtual table.
12-- VT_AZ_SALES_DML for insert to proof replca (can't insert into replica table)
create virtual table "VT_AZ_SALES_DML" at "RSSQLserver"."<NULL>"."SDI_USER"."AZ_SALES";

1select count(*) from VT_AZ_SALES_DML;
123456789101112-- insert data
INSERT INTO VT_AZ_SALES_DML VALUES(
'S_{placeholder|userid}',
'2018-10-23',
'22:04:46',
'C_{placeholder|userid}',
'P_{placeholder|userid}',
1 ,
10.0,
1.5,
100
);
1select count(*) from VT_AZ_SALES_DML;

12-- remove table replica
alter virtual table "VT_AZ_SALES" drop replica;Well done!! This completes the lesson on the different options in SAP HANA Cloud for managing replica tables (real-time replication) with remote data sources.
Log in to track your progress & complete quizzes