cancel
Showing results for 
Search instead for 
Did you mean: 

​Why sometimes we cannot see the tenant database item via M_DATABASE under the SYSTEMDB mode

former_member635540
Participant
0 Kudos

a) This output of the m_databases was normal after stop the tenant BK2:

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=> alter system stop database BK2;

0 rows affected (overall time 16.255817 sec; server time 16.248228 sec)

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=> SELECT * from m_databases; DATABASE_NAME,DESCRIPTION,ACTIVE_STATUS,ACTIVE_STATUS_DETAILS,OS_USER,OS_GROUP,RESTART_MODE,FALLBACK_SNAPSHOT_CREATE_TIME

"SYSTEMDB","SystemDB-BK2-20","YES","","","","DEFAULT",?

"BK2","BK2-20","NO","Stopped by user via ALTER SYSTEM STOP DATABASE","","","DEFAULT",?

2 rows selected (overall time 2016.008 msec; server time 1163 usec)

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=>

b) This output of the m_databases was abnormal after stop the tenant BK2:

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=> alter system stop database BK2;

0 rows affected (overall time 15.252442 sec; server time 15.247724 sec)

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=> SELECT * FROM SYS.M_DATABASE; SYSTEM_ID,DATABASE_NAME,HOST,START_TIME,VERSION,USAGE "BK2","SYSTEMDB","hanabktest2","2020-07-02 04:19:55.163000000","2.00.041.00.1560320256","TEST" 1 row selected (overall time 1792.450 msec; server time 1657 usec)

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=>

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

In the first query you select from system view M_DATABASES which lists all databases. In the second query you select from system view M_DATABASE which provides only information about the database on which you logged in. As you are logged in to SYSTEMDB you just get the information for the system db.

I don't see any problem, you just query from different sources and therefore get different resuts.

0 Kudos

Hi Florian,

There is an inconsistency in M_DATABASES which is a bit difficult to understand. This is during the recovery from snapshot backup.

I've restored the data, recovered the SYSTEMDB. Now if I query the M_DATABASES on the destination, it still gives the list of tenant databases prior to starting the recovery.

Ex:

Source SID:

SRC

SYSTEMDB

SRC

Destination SID:

DST

SYSTEMDB

DST.

Now I have restored a snapshot backup from the source and recovered the SYSTEMDB.

I now need to recover the tenant database. Now, if I query M_DATABASES, it still gives me SYSTEMDB, DST. Idealy, once the SYSTEMDB is recovered, shouldn't it list SYSTEMDB, SRC?

Answers (0)