Dưới đây là tóm tắt ngắn gọn nguyên nhân và giải pháp cho vấn đề các view DV% tạm thời đang tồn đọng trong SAP Business One:
Sự cố & Cách tái hiện
-
Hiện tượng: Xuất hiện nhiều view DV% lỗi thời/dư thừa trong cơ sở dữ liệu (DB) của khách hàng.
-
Cách phát sinh: Các view DV% tạm thời này được dùng cho báo cáo/chức năng trong phần mềm. Nếu bị tắt đột ngột (người dùng tắt ngang, ngừng hệ thống đột ngột) hoặc do lỗi ứng dụng (ví dụ lỗi trong SAP Note 3540375), hệ thống sẽ không tự xóa (drop) các view này.
Nguyên nhân
-
Số lượng lớn các view DV% tích tụ theo thời gian gây giảm hiệu năng hệ thống (đặc biệt là khi nâng cấp DB) và gây khó khăn khi thao tác với các view khác trong DB.
Giải pháp
-
Cách kiểm tra số lượng view hiện có:
-
MS SQL Server:
SELECT * FROM sys.views WHERE name LIKE 'DV%' AND type = 'v'; -
SAP HANA:
SELECT * FROM sys.views WHERE view_name LIKE 'DV%' AND view_type = 'ROW' and "SCHEMA_NAME" = current_schema;
-
-
Xử lý tự động (Từ phiên bản SAP B1 10.0 FP 2508 trở đi): Khi nâng cấp lên phiên bản này, hệ thống sẽ tự động xóa sạch tất cả các view DV% lỗi thời, giúp cải thiện hiệu năng và trải nghiệm người dùng.
-
Giải pháp tạm thời (Workaround): Nếu chưa nâng cấp lên phiên bản trên, người dùng cần xóa các view DV% tạm thời này bằng cách thủ công hoặc chạy câu lệnh truy vấn xóa trực tiếp trong DB.
Symptom
There are multiple obsolete DV% views in the customer DB.
Reproducing the issue
Temporary DV% views are used by various reports and functionalities in SAP Business One. If the process is terminated unexpectedly (for example, intentionally by the user or due to a system crash), the DV% views are not dropped and remain in the customer database. Similarly, redundant DV% views can remain in the database as a result of an application bug (for example, as described in SAP Note 3540375 – Temporary SQL Views persist after using ‘Country of Origin – Assignment’).
Cause
Multiple DV% views can lead to performance degradation, for example, during the upgrade process or usability issues when working with DB views.
Solution
Scenario:
Use a database with thousands of obsolete DV% views. Check the number of DV% views in the database:
For MS SQL Server:
SELECT * FROM sys.views WHERE name LIKE ‘DV%’ AND type = ‘v’;
For SAP HANA:
SELECT * FROM sys.views WHERE view_name LIKE ‘DV%’ AND view_type = ‘ROW’ and “SCHEMA_NAME” = current_schema;
System behavior prior to SAP Business One 10.0 2508:
Thousands of DV% views cause performance degradation, slowing down processes like database upgrade or leading to usability issues when working with DB views.
System behavior after upgrade to SAP Business One 10.0 2508:
All obsolete DV% views are removed automatically by the upgrade process, improving overall performance and simplifying user interactions when working with DB views.
Workaround:
Delete temporary SQL views, such as DV%, manually or by executing a database query.