Do you need to know about Schema Export and Import for SAP Business One, version for SAP HANA? SAP Business One Support are happy to share!
Depending on your specific needs, you may need to create information models, tables, or stored procedures on a schema. This is usually done in a development system or you may want to reuse these customized objects. Instead of recreating everything in a different system, you can simply export the schema from the original system and then import the schema into the target system.
This article explains how to export and import schemas in the SAP HANA Studio as well as some additional information on troubleshooting and SAP Business One Backup Service. Most importantly, please note, that schema import-export is not the equivalent to a full instance backup and recovery. A regular full instance backup must be performed. This point is further explained in SAP Note 2121486 (S-User login required).
SAP Business One Support recommend using the SAP Business One Backup Service for schema export and import. However, if the source and target servers are different, the following statements can be executed via SAP HANA Studio to export and import a schema. You may choose to import a schema directly or import the schema with a different name:
- EXPORT “SCHEMA_NAME”.“*” AS BINARY INTO ‘export_path’ WITH REPLACE THREADS 10; Example: EXPORT “SBODEMOUS”.”*” AS BINARY INTO ‘/usr/backup’ WITH REPLACE THREADS 10;
- IMPORT “SCHEMA_NAME”.“*” AS BINARY FROM ‘import_path’ WITH IGNORE EXISTING THREADS 10; Example: IMPORT “SBODEMOUS”.”*” AS BINARY FROM ‘/usr/backup’ WITH IGNORE EXISTING THREADS 10;
- IMPORT “SCHEMA_NAME”.“*” AS BINARY FROM ‘import_path’ WITH IGNORE EXISTING THREADS 10 RENAME SCHEMA “SCHEMA_NAME” TO “NEW_SCHEMA_NAME”; Example: IMPORT “SBODEMOUS”.”*” AS BINARY FROM ‘/usr/backup’ WITH IGNORE EXISTING THREADS 10 RENAME SCHEMA “SBODEMOUS” TO “SBOTEST”;
Recommendation: Use “WITH IGNORE EXISTING” clause in the import command. Using “WITH REPLACE” clause may lead to data loss for dependent objects as it might overwrite/erase any existing dependencies in target system.
Configure database traces in debug mode for detailed investigation regarding the error if you encounter any during the import process. Configure the indexserver trace and then check the errors in the collected trace, as below:
1. Set the trace level to DEBUG for importexport in the indexserver traces, as below:
- In the SAP HANA Studio, open the administration console of your system.
- On the Trace Configuration tab, click the pencil icon (Edit Configuration) to edit the database trace.
- In the Trace Configuration window, select the Show All Components checkbox. In the search bar, search for “import”.
- Scroll down to the “INDEXSERVER” service.
- Set the system trace level of “importexport” to “DEBUG” for the indexserver service.
- To save the configuration, choose the Finish button.
2. Perform the import or export again.
3. In the SAP HANA Studio, in the administration console of your system, on the Diagnosis File tab, find the latest indexserver or indexserver_alert trace.
4. Open the trace file and look for the error message at the end.
5. After completing the investigation, change the importexport trace level back to ERROR.
Example trace entries for a failed import from an indexserver trace file:
446678 i ImportExport ImportExport.cpp(02099) : Scanning import path /DVD_HANA/test/SBO_TEST/: found 0 objects
446732 e ImportExport ImportExport.cpp(02112) : No objects to import found at location /DVD_HANA/test/SBO_TEST/
446753 i ImportExport ImportExport.cpp(06619) : Getting dependencies for 0 objects
451946 i ImportExport ImportExport.cpp(06870) : Creating 0 objects
458774 i ImportExport ImportExport.cpp(07043) : Building import list from 0 objects
458817 i ImportExport ImportExport.cpp(07336) : importing 0 items with flags 4 using 10 threads
458857 w ImportExport ImportExport.cpp(07382) : Data import skipped!
You can also monitor the export/import process using the following views:
For export: M_EXPORT_BINARY_STATUS
For import: M_IMPORT_BINARY_STATUS
SAP Business One Backup Service
As of release 9.0 PL14 and 9.1 PL04, SAP Business One, version for SAP HANA provides a backup service with a graphical user interface in the System Landscape Directory (SLD). This backup service automates and simplifies the export and import processes for your company schemas. An introduction video clip is available on YouTube. SAP Business One Support recommend using SAP Business One Backup Service over the manual export and import commands.
Enhancements of the backup service are gradually introduced in different patches. For best practices and known limitations, please refer to SAP Note 2072868 (S-User login required).
Caution: The schema import-export function provided by the backup service is based on the same SQL statements as manual import-export. You should be aware of the limitation of schema import-export, as outlined in SAP Note 2121486 (S-User login required). Regular full instance backup is required for system recoverability – the backup service provides the instance backup function as of release 9.1 PL05.
RSP for SAP Business One, version for SAP HANA: In Remote Support Platform for SAP Business One, version for SAP HANA 3.1 patch level 07, you can setup backup scheduling for schema import-export and instance level backup. For more information please refer to SAP Note 2157386 (S-User login required).