Skip to Content
0
Jan 06, 2017 at 10:46 AM

backup and restore readonly user dbspace

222 Views

Hello all,

we have an SAP IQ 16 SP 10 at an Linux System with VLDB licenses.

  • We create for each user a separate user dbspace incl. tables.

CREATE DBSPACE USERNAME_1 USING FILE USERNAME_1 '/PATH/USERNAME_1.iq' SIZE 500MB RESERVE 100MB IQ STORE;

CREATE DBSPACE USERNAME_2 USING FILE USERNAME_2 '/PATH/USERNAME_2.iq' SIZE 500MB RESERVE 100MB IQ STORE;

Then create the user her tables. (1 to 100).

CREATE TABLE USERNAME_1.SAMPLE_1 (id integer) IN USERNAME_1;

  • Then we backup the DB.

ALTER DBSPACE USERNAME_1 READONLY;

BACKUP DATABASE READONLY DBSPACES USERNAME_1 to '/PATH/USERNAME_1.dmp';

ALTER DBSPACE USERNAME_1 READWRITE;

  • The user create more tables.(1 to 100)

CREATE TABLE USERNAME_1.SAMPLE_2 (id integer) IN USERNAME_1;

  • After this, we would like to restore only one user dbspace USERNAME_1

ALTER DBSPACE USERNAME_1 READONLY;

ALTER DBSPACE USERNAME_1 OFFLINE;


Connect to the DB as user DBA or

dbisql -c "uid=dba;pwd=PASS;eng=our_engine" -nogui

dbisql -c "uid=dba;pwd=PASS;eng=our_utility;dbn=utility_db" -nogui

RESTORE DATABASE '/PATH_TO/OUR_DB.db' READONLY DBSPACES

USERNAME_1 FROM '/PATH/USERNAME_1.dmp';


The error message ...

Could not execute statement.
The backup no longer matches the version of the dbspace/dbfile in the
database and, therefore, cannot be restored.
--
(dblib/db_backupCmds.cxx 2219)
SQLCODE=-1012041, ODBC 3 State="HY000"


Best regards