You are on page 1of 5

SAP Business One Notes

2134959 - Schema Export and Import Guide for SAP Business One, version for SAP HANA
Component: SBO-HANA-IE (SAP HANA schema import and export), Version: 14, Released On: 15.06.2023

Symptom
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. As well, you
may want to reuse these customized objects. Instead of re-creating 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 guide introduces how to export and import schemas in the SAP HANA studio and provides some additional information (for example, troubleshooting). Nevertheless, please
note that schema export-import is not equivalent to full instance backup and recovery. Regular full instance backup must be performed to ensure system recoverability. This point is
further explained in SAP Note 2121486.

Image/data in this SAP Note is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Solution

Table of Contents
1. Export-Import Statements
2. Collecting SAP HANA Traces for Troubleshooting
3. Monitoring Import-Export Processes
4. Common Issues and Solutions
5. SAP Business One Backup Service
6. Recommendations on Transferring Schema Exports to SAP
7. More Information

1. Export-Import Statements


Execute the following statements in the 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 statement: 

  EXPORT "SCHEMA_NAME"."*" AS BINARY INTO 'export_path' WITH REPLACE THREADS 10;

  Example:

           EXPORT "SBODEMOUS"."*" AS BINARY INTO '/usr/backup' WITH REPLACE THREADS 10;

  Note: Make sure that you use an empty folder in the "export_path" before exporting the schema.

Export statement-Without Dependency:

        EXPORT "SCHEMA_NAME"."*" AS BINARY INTO 'export_path' WITH REPLACE NO DEPENDENCIES THREADS 10;

        Example: 

           EXPORT "SBODEMOUS"."*" AS BINARY INTO '/usr/backup' WITH REPLACE NO DEPENDENCIES THREADS 10;

Import statements:

1. 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;

              2. 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";
 Note: When importing a schema, use the "WITH IGNORE EXISTING" option (which is available as of SAP HANA 1.0 SPS 07).

Do NOT use the "WITH REPLACE" option for import on a productive environment. SAP Business One company schemas usually reference objects in the SBOCOMMON
system schema, or there could be dependencies on other schema objects because of hardcoded schema names within stored procedures. Using the "WITH REPLACE" option
would overwrite the contents of the referenced objects in SBOCOMMON or in any other dependent schema and could cause problems (possibly causing data overwrite).Refer
SAP Note 2404319.

If the target schema already exists, the option "IGNORE EXISTING" won't overwrite the existing schema. You can consider to drop it firstly by the SQL statement: drop schema
"SBODEMOUS" cascade.
2. Configuring SAP HANA Traces for Troubleshooting
For detailed investigation of import or export failure, configure the indexserver trace and then check the errors in the collected trace, as below:

1. Set the trace level to DEBUG for import-export in the indexserver traces, as below:
1. In the SAP HANA studio, open the administration console of your system.
2. On the Trace Configuration tab, click the

(Edit Configuration) icon to edit the database trace.


3. In the Trace Configuration window, select the Show All Components checkbox.
4. In the search bar, search for "import".
5. Scroll down to INDEXSERVER.
6. Set the system trace level of import-export to DEBUG for the indexserver service.

7. 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 import-export trace level back to ERROR.

Example of 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!

3. Monitoring Export-Import Processes


You can also monitor the export/import process using the following views:

For export: M_EXPORT_BINARY_STATUS


For import: M_IMPORT_BINARY_STATUS
4. Common Issues and Solutions
4.1 During Export of Schemas
4.1.1
Error:
"SAP DBTech JDBC: [2048]: column store error: table import failed: [30111] schema XXXX:XXXX out of memory"

Cause:
SAP HANA database services might be running out of memory.

Solution:

1. In the SAP HANA studio, in the administration console of your system, on the Diagnosis Files tab, check if there is any crash dump or out-of-memory dump, file name ending
with "XXXXXXXX.oom.trc".
2. Reboot the Linux server and attempt the import again.
3. If the problem persists, contact SAP Business One Global Support.

4.2 During Import of Schemas


4.2.1
Error: 
"Could not execute 'import "XXX"."*" as binary from '/Test' with replace threads 4' in 3:22.742 minutes.
SAP DBTech JDBC: [2048]: column store error: table import failed: [30111] "V_SQL" Text type in SQLScript: line 5 col 2 (at pos 84)"

Cause:
The SAP Business One database schema you are trying to import is incompatible with the version of the SAP HANA database. For example, an SAP Business One 8.82 database is
incompatible with Revision 67 of the SAP HANA database.

Solution:
Upgrade the SAP Business One schema to a compatible version before import.

4.2.2
Error:
"SAP DBTech JDBC: [2] general error: DE.ETL_S DE:xxx_tracking not found in the import directory.” (where “xxx” represents a particular table in SAP Business One, for example,
INV1).

Solution:
Please refer to SAP Note 1944485.

4.2.3
Error:
"SAP DBTech JDBC: [2]: general error: <> not found in the import directory"

Causes:

You provided an incorrect name for the exported schema or an incorrect directory.
You transferred the schema export to a Windows machine without compressing the export in an archive package.

Solution:

1. Be sure to provide the correct schema name and the correct directory, which contains an "export" folder and an "index" folder. In the "export" folder, you can find a folder
named after the schema.
2. Always zip an exported schema before transferring it to another machine, especially when transferring between Windows and Linux machines.

4.2.4
Error:
"SAP DBTech JDBC: [2048]: column store error: table import failed: [30149] Found lob container reference with no entry in the provided mapping."

Cause:
You have activated hybrid LOBs. The issue described above is a known error with this LOB storage type. For more information, see SAP Note 1994962.

Solution:
Please refer to SAP Note 2051378.
4.2.5
Error:
"SAP DBTech JDBC: [2048]: column store error: table import failed: [30111] Could not find table/view OGAR_TMP in schema XXXX: line 14 col 8 (at pos 293)."

Solution:
Please refer to SAP Note 1951219.

4.2.6
Error:
"* 2048: column store error: table import failed: [30111] Binary import failed (could not execute create statement);object=
<SCHEMA_NAME>:PAL_TRIPLE_SMOOTH_WRAPPERen,invalid table name: Could not find table/view PAL_TRIPLE_SMOOTH_ORIGINAL_INPUT in schema
<SCHEMA_NAME> at ptime/query/catalog/catalog.cc:5259 SQLSTATE: HY000"

Solution:
Please refer to SAP Note 2122157.

4.2.7
Error:
Could not execute 'IMPORT "A1"."*" FROM '/usr/sap/JY2/HDB30/work/export' WITH RENAME SCHEMA A1 TO A2' in 243 ms 419 µs .
SAP DBTech JDBC: [2048]: column store error: table import failed: [30138] No such schema in the import path.
Solution:
Make sure the import path is to the directory containing the "export" and the "index" folders. Here in the example, it should be
‘/usr/sap/JY2/HDB30/work’.

5. 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 backup and recovery processes for your company schemas. An introduction video clip is available on YouTube.

Enhancements of the backup service are gradually introduced in different patches. For best practices and known limitations, please refer to SAP Note 2072868.

Caution: The schema backup function provided by the backup service is based on the same SQL statements as manual export-import. You must be aware of the limitation of
schema backup, as outlined in SAP Note 2121486 and 2404319. Regular full instance backup is required for system recoverability - the backup service provides the instance backup
function as of release 9.1 PL05.

6. Transferring Schema Exports to SAP


After reporting an incident to SAP Support, you may be required to transfer your database schema to SAP. Here are some recommendations on schema export and transfer:

Before performing an import or export operation, always grant full authorization to the <sid>adm user on the specified directory.
Always export the schema to a Linux directory/disk and not to a Windows directory/drive.
The export directory must already exist with requisite permissions.
Compress the schema export on a Linux machine in the .tar.gz format.
You can use the following command to compress your schema export:
      tar -zcvf archive_name.tar.gz /<Export Location>/export /<Export Location>/index
e.g. tar -zcvf archive_name.tar.gz /usr/sap/HA0/HDB000/work/test_export
For more information, please refer to SAP Note 1936989 (How to back up HANA database and transfer it to SAP Business One Support).

7. More Information


For more information, please refer to the following materials:

SAP Business One Administrator's Guide, version for SAP HANA


This guide is updated for each release and patch level. You can find it in the product package: \Documentation\SystemSetup\.
SAP HANA SQL and System Views Reference at http://help.sap.com/hana_platform.

Attributes

Key Value

Other Components SBO-BC-DB-HANA (SAP HANA database-related issues)

Database SAP HANA Platform Edition 1.0

Database SAP HANA Platform Edition 2.0

Products
Products

SAP B1 VERSION FOR SAP HANA all versions

This document refers to

SAP Note/KBA Title


2027458 Collective Consulting Note for SAP HANA-Related Topics of SAP Business One, version for SAP HANA

1969397 Troubleshooting Guide for SAP Business One, version for SAP HANA

This document is referenced by


SAP Note/KBA Title

2930245 Upgrade Wizard Schema Backup Fails

2742889 Schema Import Error: "Could not find table/view DB_CHAN"

2713616 Import Error: "SAP DBTech JDBC: [2048]: column store error: table import failed: [0] No error"

2693454 Import With Rename Error: "index out of range"

1936989 How to Backup HANA Database for SAP Business One Support

1302201 Transfer Database to SAP Business One Support

2212872 No value for time dimensions in schemas exported from an SAP HANA version lower than SPS08

2121486 SAP HANA instance backup ensures data consistency while schema export does not

You might also like