Hello,
We have found one workflow where we can trigger ASE error 14545:
ASE message 14545 : Cannot locate the logical page 3273216 for database 'dxu3vGfrtUPzEus9uf_ODS_R', dbid=4, on the device 'dx2vn91tu9cvrffeO1f00r_3_dat'. The page on the device is logical page 3273216 for dbid 10.'ASE message 14547 : The device '/delphix_toolkit/toolkit/4233acbb-a581-d09a-c500-bf4ff24e0deb-vdb-66/datafile/dx2vn91tu9cvrffeO1f00r_3.dat' does not correspond to the device 'dx2vn91tu9cvrffeO1f00r_3_dat' in the manifest file.ASE message 14519 : MOUNT DATABASE: Failed to validate the devices. The device allocations are not consistent with the descriptions in the manifest file.
Essentially we do the following:
To reproduce this problem:
# Create a database of any size on it’s own device:
1> DISK INIT name='device', physname='/home/sybase/device', size='50M'
2> go
1> CREATE DATABASE db ON device='30M' LOG ON device='10M' WITH OVERRIDE
2> go
CREATE DATABASE: allocating 7680 logical pages (30.0 megabytes) on disk ‘device' (7680 logical pages requested).
CREATE DATABASE: allocating 2560 logical pages (10.0 megabytes) on disk 'device' (1560 logical pages requested).
Caution: You have set up this database to include space on disk 4 for both data and the transaction log. This can make recovery impossible if that disk fails.
Database 'db' is now online.
Note: After creation, suppose this database was created with dbid = 4
# Unmount this database into some manifest file :
1> UNMOUNT DATABASE db TO '/home/sybase/manifest'
2> go
# Create another database not specifying the dbid. For this database it doesn’t matter which device it goes on.
1> DISK INIT name='device2', physname='/home/sybase/device2', size='20M'
2> go
1> CREATE DATABASE db2 ON device2='10M' LOG ON device2='5M' WITH OVERRIDE
2> go
CREATE DATABASE: allocating 2560 logical pages (10.0 megabytes) on disk 'device2' (2560 logical pages requested). CREATE DATABASE: allocating 1280 logical pages (5.0 megabytes) on disk 'device2' (1280 logical pages requested).
Caution: You have set up this database to include space on disk 4 for both data and the transaction log. This can make recovery impossible if that disk fails.
Database 'db2' is now online.
Note: After create, this database (db2) will have the same dbid as previous db (dbid also = 4)
# Mount old database
1> MOUNT DATABASE db FROM '/home/sybase/manifest'
2> go
Started estimating recovery log boundaries for database 'db'.
Database 'db', checkpoint=(7685, 13), first=(7685, 13), last=(7685, 13).
Completed estimating recovery log boundaries for database 'db'.
Started ANALYSIS pass for database 'db'.
Completed ANALYSIS pass for database 'db'.
Started REDO pass for database 'db'. The total number of log records to process is 1.
Completed REDO pass for database 'db'.
Recovery of database 'db' will undo incomplete nested top actions.
Started recovery checkpoint for database 'db'.
Completed recovery checkpoint for database 'db'.
Started filling free space info for database 'db'.
Completed filling free space info for database 'db'.
Started cleaning up the default data cache for database 'db'.
Completed cleaning up the default data cache for database 'db'.
MOUNT DATABASE: Completed recovery of mounted database 'db'.
MOUNT DATABASE: A new database id was required for database 'db' in order to mount it. DBCC CHECKALLOC must be run on this database to make corrections.
Note: mount still worked, database can still be put online, we could still query tables in the database.
# Add a fragment to the first database (db, dbid is now 5)
1> ALTER DATABASE db ON device='10M'
2> go
Extending database by 2560 pages (10.0 megabytes) on disk device
# Unmount database and then try to mount it again
1> UNMOUNT DATABASE db TO '/home/sybase/manifestbroken'
2> go
1> MOUNT DATABASE db FROM '/home/sybase/manifestbroken'
2> go
Msg 14545, Level 16, State 1:
Server 'RH65_ASE16_TGT_S1', Line 1:
Cannot locate the logical page 10240 for database 'db', dbid=4, on the device 'device'. The page on the device is logical page 10240 for dbid 5.
Msg 14547, Level 16, State 1:
Server 'RH65_ASE16_TGT_S1', Line 1:
The device '/home/sybase/device' does not correspond to the device 'device' in the manifest file.
Msg 14519, Level 16, State 1:
Server 'RH65_ASE16_TGT_S1', Line 1:
MOUNT DATABASE: Failed to validate the devices. The device allocations are not consistent with the descriptions in the manifest file.
I've been trying numerous other workflows like:
- Create a new database (let's say we get assigned dbid=15).
- Create a table, insert some data.
- Unmount the database.
- Create a new database (so that it gets assigned the previously used dbid=15).
- Mount the original database (so that it gets assigned a new dbid=16). This triggers the "MOUNT DATABASE: A new database id was required for database 'db' in order to mount it. DBCC CHECKALLOC must be run on this database to make corrections." message.
- Online my original database and start using it (without doing DBCC CHECKALLOC).
There do not seem to be any ill effects.
- Why isn't error 14545 always triggered?
- Are there other workflows to trigger this message?
- Is it dangerous to not do "DBCC CHECKALLOC" as suggested? I issued "dbcc buffer (14, "mytable")".
- I understand DBCC CHECALLOC will get a new option 'fixdbid' that only fixes the dbid via CR #798271. Are there any details you can share with us about 798271? I could not find any knowledge base articles on it.