English (Español a continuación)
1. Introduction
When loading data in ASO databases, Essbase only loads data that points to cells of level 0 (the members of all dimensions are level 0) in which there are no formulas.
- The load of the database can be done from the console, from Maxl or from Smart View.
- If there are aggregated views, Essbase automatically updates the values at the top levels of these aggregations when the values loaded into the level 0 cells change (no calculations need to be executed). Therefore:
- The existence and size of aggregated views can affect load time.
a) Console
Right-click on the database and select «Load data».
- The load buffer (that we will analyze in the next section) is activated.
In the window that opens you can select different options: it determines how the data is loaded from the load files into the buffer.
- Ignore missing values (default option).
- Ignore zero values (default option).
- The 2 options above speed up the loading process.
- Create new portion (disabled by default).
- Last aggregate (deactivated by default): if more than 2 values coincide in the same cell, the last data is loaded (by default they are added).
- Activating this option slows down the loading.
- Resource usage: refers to the percentage of the aggregate storage cache used by the buffer (if not reported, the default applies 20%).
In the “Data load values” option: determines how the values are loaded from the buffer in the database.
- Add to existing values (default option).
- Subtract from existing values.
- Overwrite existing values.
- Replace all database data.
These different options will be analyzed in the following section “2.- Buffer”.
b) Maxl
With the instruction:
- Import database ‘Application name’.’Base name’ data from data_file ‘xxxx’ using server rules_file ‘xxxx’ on error append to ‘xxxx’;
Let’s look at an example:
- Import database ‘Sales’.’Markets’ data from data_file ‘C:\Files\Data.txt’ using server rules_file ‘Load’ on error append to ‘C:\Files\Errors.txt’;
2.- Buffer
When loading data from an ASO database, a temporary buffer can be used.
- The data is loaded and sorted in this buffer; once all data is loaded into the buffer, Essbase writes it to the database.
- Speed up loading time.
- This capability can be used through Maxl or from the console and is especially useful when multiple files are to be loaded.
- From the console it is activated automatically.
An example of loading data from Maxl would include the following phases:
- Start the load buffer:
- alter database ‘Application name’. ‘Base name’ initialize load_buffer with buffer_id xxx;
- Load the information in the load buffer:
- import database ‘Application name’.’Base name’ data from data_file ‘xxxx’ using server rule file ‘xxxx’ to load_buffer with buffer_id xxx on error append to ‘xxxx’;
- Get the data from the buffer to the database:
- Import database ‘Application name’.’Base name’ data from load_buffer with buffer_id xxx;
Let’s look at an example:
- alter database ‘Sales’.’Markets’ initialize load_buffer with buffer_id 1;
- import database ‘Sales’.’Markets’ data from data_file ‘C:\Files\Data.txt’ using server rule file ‘Load’ to load_buffer with buffer_id 1 on error append to ‘C:\Files\Errors.txt’;
- Import database ‘Sales’. ‘Markets’ data from load-buffer with buffer_id 1;
You can also load different files into the buffer before loading them into the database.
- The buffer is initialized first.
- Next, the information is loaded into the buffer:
- import database ‘Application name’.’Base name’ data from data_file ‘xxxx_1’ using server rule file ‘xxxx_1’ to load_buffer with buffer_id 1 on error append to ‘xxxx’;
- import database ‘Application name’.’Base name’ data from data_file ‘xxxx_2’ using server rule file ‘xxxx_2’ to load_buffer with buffer_id 1 on error append to ‘xxxx’;
- import database ‘Application name’.’Base name’ data from data_file ‘xxxx_3’ using server rule file ‘xxxx_3’ to load_buffer with buffer_id 1 on error append to ‘xxxx’;
- …
- Once the data is loaded into the buffer, it is taken to the database:
- import database ‘Application name’.’Base name’ data from load_buffer with buffer_id 1;
When the buffer is initialized, the following properties can be defined:
a) The “Resource Usage” option controls the percentage of the aggregate storage cache that the load buffer can use: Essbase uses this cache to sort data.
- A percentage is assigned that can range between 0.01 and 1 (maximum 2 decimals). By default. Essbase assigns the value 1.0
- If several load buffers are used, the sum of the different percentages assigned to the different buffers cannot be greater than 1.
Maxl: Example;
- alter database ‘Application name’.’Base name’ initialize load_buffer with buffer_id xxx recourse_usage .75;
b) You can specify not to load missing values, zeros or both in the buffer, which improves the loading efficiency:
Example:
- alter database ‘Application name’.’Base name’ initialize load_buffer with buffer_id xxx 1 resource_usage .5 property ignore_missing_values, ignore_zero_values;
c) Once all the information has been loaded into the buffer, Essbase analyzes if different values have been imputed to the same cell:
- By default, Essbase adds these values.
- You can specify the option to use the last loaded value: Although this option slows down the loading:
- alter database ‘Application name’. ‘Base name’ initialize load_buffer with buffer_id xxx property aggregate_use_last;
d) When Essbase writes the values from the buffer to the database it can:
- Replace the existing values with the new values.
- Add the new values to the existing values.
- Subtract the new values from the existing values.
Maxl:
- import database ‘Application name’. ‘Base name’ data from load_buffer with buffer_xxx 1 add values / subtract values / override values;
The selected option is applied to all data loaded into the buffer.
- In the BSO cubes when the data is loaded through load rules, for each data source it can be specified if the data adds, subtracts or replaces the existing ones.
- In ASO cubes that use load buffering, this selection is made at the buffer level for all data sources that are loaded into it.
While the load buffer is active (exists in memory), the database is blocked from performing aggregations or merging slices.
- But data can be loaded into another buffer or queries can be made.
The buffer is deleted once the information has been transferred to the database or when the application is restarted.
Through a Maxl you can request information about the buffers that exist in an ASO base:
- query database ‘Application name’.’Base name’ list load_buffers;
Provide the following information:
- Buffer ID
- Internal: whether the buffer was created internally by Essbase (TRUE) or by a user (FALSE).
- Active: whether or not the buffer is currently in use in a data load operation.
- Resources Allocated: the % of the aggregate storage cache allocated to this buffer.
- Aggregation method: in case of concurring different values to the same cell, if they are added or the last uploaded value prevails.
- Whether or not missing values / zeros are ignored.
3.- Incremental load
A complete incremental load process would include the following phases:
- Delete the information in the loading area.
- Load data into the buffer.
- Load data from the buffer into the new database slice.
- Merge slices.
Partial loads can be performed on additional slices without impacting the main slice.
- This option speeds up the loading time: this will depend on the size of the information that is uploaded to the incremental slice and not on the size of the database.
- Essbase creates all the necessary views on the new slices (such as aggregate views): when a query is made, the different slices are accessed, collecting the information from all the cells.
This allows users to continue to interact with the database while these partial loads are taking place.
This can be executed via the console / Maxl:
Console:
- When right-clicking on the base and selecting “Load data”, one of the options is “Create new slice” (disabled by default).
Maxl:
- import database ‘Application name’.’Base name’ data from load_buffer with buffer_id 1 create slice;
In addition to loading new data, you can also replace existing data via the console / Maxl:
- All the content of a database or exclusively the data of the incremental slices.
- If the “override data” option is used, the missing values are replaced with zeros. The «override» option makes the load slower than if the add / subtract option is used.
Console: In the “Data load values” option: determines how the values are loaded from the buffer in the database.
- Overwrite existing values.
- Replace all database data.
Maxl:
- import database ‘Application name’.’Base name’ data from load_buffer with buffer_id 1 override all data;
- import database ‘Application name’.’Base name’ data from load_buffer with buffer_id 1 override incremental data;
In this second case, Essbase replaces the information in all the incremental slices, creating a new incremental slice with the new information loaded.
- This distinction allows the static information to be placed in the main slice (the data that doesn’t change: for example, the data of the last years already closed), and the volatile information to be placed in the incremental slices (the data that change: for example, the data of the last few months that are still being updated).
When the data for a new slice is in the buffer, Essbase scans the list of existing incremental slices and decides whether or not to merge them (all or some of them) automatically with the new slice.
Automatically merge those slices when:
- The slice has less than 100,000 cells.
- The slice is less than twice the size of the new slice.
- Slices with more than 5 million cells are never automatically merged.
By default, Essbase merges incremental slices after every four loads, although this can be modified in the essbase.cfg configuration file with the AUTOMERGE command: it offers three possibilities:
- ALWAYS: Essbase automatically merges the incremental slice created in the load process with the main slice (this is the default option when using this command).
- NEVER: Essbase never automatically merges the incremental slice created during the upload process.
- SELECTIVE: Essbase automatically merges the incremental slice created in the loading process with the main slice when a certain number of incremental slices is reached (this number is set in the essbase.cfg configuration file with the AUTOMERGEMAXSLICENUMBER command).
When queries are made, a dynamic aggregation of the different slices is performed.
- When a query is made, Essbase accesses all the slices to collect all the information.
- When creating a slice, Essbase generates the aggregated views so that the information loaded in the slice is visible when performing a query.
When loading data from Smart View (or Add-in) it is equivalent to an incremental load with the option replace.
4.- Parallel charging
Parallel load is also possible.
Data can be loaded into different buffers in parallel which speeds up loading. This loading is done by opening different Maxl sessions:
- In each of them a different load buffer is activated and a load is carried out.
- Only one buffer is used via console, so a parallel load cannot be carried out through it.
Once the data has been loaded in the different buffers, in the same action the data from the different buffers are written into the database.
- It is faster than individually write into the database the data of each buffer.
Let’s look at an example:
Max Session 1
- alter database ‘Application name’.’Base name’ initialize load_buffer with buffer_id 1 resource_usage xxx;
- import database ‘Application name’.’Base name’ data from data_file «xxx.txt» using server rule file ‘xxxx’ to load_buffer with buffer_id 1 on error abort;
Max Session 2
- alter database ‘Application name’.’Base name’ initialize load_buffer with buffer_id 2 resource_usage xxx;
- import database ‘Application name’.’Base name’ data from data_file «xxx.txt» using server rule file ‘xxxx’ to load_buffer with buffer_id 2 on error abort;
Maxl Session 3
- alter database ‘Application name’.’Base name’ initialize load_buffer with buffer_id 3 resource_usage xxx;
- import database ‘Application name’.’Base name’ data from data_file «xxx.txt» using server rule file ‘xxxx’ to load_buffer with buffer_id 3 on error abort;
Maxl Session x
- …
Once the information is loaded in the different buffers, a single Maxl command is used to bring all the information to the database.
- import database ‘Application name’.’Base name’ data from load_buffer with buffer_id 1, 2, 3;
Español
1.- Introducción
En la carga de datos en bases ASO Essbase únicamente carga aquellos datos que apuntan a celdas de niveles 0 (los miembros de todas las dimensiones son nivel 0) en las que no hay fórmulas.
- La carga de la base se puede realizar desde la consola, desde Maxl o desde Smart View.
- Si hay vistas agregadas, Essbase actualiza de forma automática los valores de los niveles superiores de estas agregaciones cuando cambian los valores cargados en las celdas de nivel 0 (no hace falta lanzar ningún cálculo). Por lo tanto:
- La existencia y tamaño de vistas agregadas puede afectar al tiempo de la carga.
a) Consola
Se hace click con el botón derecho sobre la base de datos y se selecciona “Cargar datos”.
- Se activa el buffer de carga que veremos en el siguiente apartado.
En la ventana que se abre se pueden seleccionar diferentes opciones: determina como se cargan los datos desde los ficheros de carga en el buffer.
- Omitir valores que faltan (opción por defecto): no se cargan los valores missing.
- Omitir valores ceros (opción por defecto).
- Las 2 opciones anteriores aceleran el proceso de carga.
- Crear nueva porción (desactivada por defecto).
- Último uso de agregado (desactivada por defecto): en caso de coincidir más de 2 valores en la misma celda se carga el último dato (por defecto se suman).
- Activar esta opción ralentiza la carga.
- Uso de recurso: hace referencia al porcentaje del caché de almacenamiento agregado que utiliza el buffer (si no se informa por defecto aplica un 20%).
En la opción “Valores de carga de datos”: determina como se cargan los valores desde el buffer en la base de datos.
- Agregar a valores existentes (opción por defecto).
- Restar de valores existentes.
- Sobrescribir valores existentes.
- Reemplazar todos los datos de la base.
Estas diferentes opciones las analizaremos en el siguiente apartado “2.- Buffer”.
b) Maxl
Con la instrucción:
- Import database ‘Nombre aplicación’.’Nombre base’ data from data_file ‘xxxx’ using server rules_file ‘xxxx’ on error append to ‘xxxx’;
Veamos un ejemplo:
- Import database ‘Ventas’.’Mercados’ data from data_file ‘C:\Ficheros\Datos.txt’ using server rules_file ‘Carga’ on error append to ‘C:\Ficheros\Errores.txt’;
2.- Buffer
En la carga de datos de una base ASO se puede utilizar un buffer temporal.
- En este buffer se van cargando y ordenando los datos; una vez cargados todos los datos en el buffer Essbase los graba en la base de datos.
- Acelera el tiempo de carga.
- Esta capacidad se puede utilizar a través de Maxl o desde la consola y es especialmente útil cuando se van a cargar varios ficheros.
- Desde la consola se activa de forma automática.
Un ejemplo de carga de datos desde Maxl incluiría las siguientes fases:
- Iniciar el buffer de carga:
- alter database ‘Nombre aplicación’.’Nombre base’ initialize load_buffer with buffer_id xxx;
- Cargar la información en el buffer de carga:
- import database ‘Nombre aplicación’.’Nombre base’ data from data_file ‘xxxx’ using server rule file ‘xxxx’ to load_buffer with buffer_id xxx on error append to ‘xxxx’;
- Llevar los datos desde el buffer a la base de datos:
- Import database ‘Nombre aplicación’.’Nombre base’ data from load_buffer with buffer_id xxx;
Veamos un ejemplo:
- alter database ‘Ventas’.’Mercados’ initialize load_buffer with buffer_id 1;
- import database ‘Ventas’.’Mercados’ data from data_file ‘C:\Ficheros\Datos.txt’ using server rule file ‘Carga’ to load_buffer with buffer_id 1 on error append to ‘C:\Ficheros\Errores.txt’;
- Import database ‘Ventas’.’Mercados’ data from load-buffer with buffer_id 1;
También se pueden cargar diferentes ficheros en el buffer antes de cargarlos en la base.
- Primero se inicia el buffer.
- A continuación se carga la información en el buffer:
- import database ‘Nombre aplicación’.’Nombre base’ data from data_file ‘xxxx_1’ using server rule file ‘xxxx_1’ to load_buffer with buffer_id 1 on error append to ‘xxxx’;
- import database ‘Nombre aplicación’.’Nombre base’ data from data_file ‘xxxx_2’ using server rule file ‘xxxx_2’ to load_buffer with buffer_id 1 on error append to ‘xxxx’;
- import database ‘Nombre aplicación’.’Nombre base’ data from data_file ‘xxxx_3’ using server rule file ‘xxxx_3’ to load_buffer with buffer_id 1 on error append to ‘xxxx’;
- …
- Una vez cargados los datos en el buffer se llevan a la base de datos:
- import database ‘Nombre aplicación’.’Nombre base’ data from load_buffer with buffer_id 1;
Cuando se inicializa el buffer se pueden definir las siguientes propiedades:
a) La opción “Uso de recursos” controla el porcentaje del cache de almacenamiento agregado que el buffer de carga puede utilizar: Essbase utiliza este caché para ordenar los datos.
- Se asigna un porcentaje que puede oscilar entre 0,01 y 1 (máximo 2 decimales). Por defecto Essbase le asigna el valor 1.0
- Si se utilizan diversos buffers de carga la suma de los diferentes porcentajes asignados a los distintos buffers no puede ser mayor que 1.
Maxl: Ejemplo;
- alter database ‘Nombre aplicación’.’Nombre base’ initialize load_buffer with buffer_id xxx recourse_usage .75;
b) Se puede especificar no cargar en el buffer los valores missing, ceros o ambos, con lo que mejora la eficiencia de la carga:
Ejemplo:
- alter database ‘Nombre aplicación’.’Nombre base’ initialize load_buffer with buffer_id xxx 1 resource_usage .5 property ignore_missing_values, ignore_zero_values;
c) Una vez toda la información ha sido cargada en el buffer, Essbase analiza si diferentes valores han sido imputados a una misma celda:
- Por defecto Essbase suma estos valores.
- Se puede especificar la opción de que utilice el último valor cargado: Si bien esta opción ralentiza la carga:
- alter database ‘Nombre aplicación’.’Nombre base’ initialize load_buffer with buffer_id xxx property aggregate_use_last;
d) Cuando Essbase lleva los valores del buffer a la base de datos puede:
- Reemplazar los valores existentes con los nuevos valores.
- Añadir los nuevos valores a los valores existentes.
- Restar los nuevos valores a los valores existentes.
Maxl:
- import database ‘Nombre aplicación’.’Nombre base’ data from load_buffer with buffer_xxx 1 add values / subtract values / override values;
La opción seleccionada se aplica a toda la información cargada en el buffer.
- En los cubos BSO cuando se realiza la carga de datos a través de reglas de carga, para cada fuente de datos se puede especificar si los datos, suman, restan o reemplazan a los existentes.
- En los cubos ASO que utilizan buffer de carga, esta selección se realiza a nivel buffer para todas las fuentes de datos que se cargan en el mismo.
Mientras el buffer de carga está activo (existe en memoria), la base de datos está bloqueada para realizar agregaciones o fusionar slices.
- Sí se puede cargar información en otro buffer o realizar consultas.
El buffer se elimina una vez la información ha sido traspasada a la base de datos o si se reinicia la aplicación.
Mediante un Maxl se puede solicitar información sobre los buffers que existen en una base ASO:
- query database ‘Nombre aplicación’.’Nombre base’ list load_buffers;
Facilita la siguiente información:
- Buffer ID
- Internal: si el buffer fue creado internamente por Essbase (TRUE) o por un usuario (FALSE).
- Activo: si el buffer está o no actualmente en uso en una operación de carga de datos.
- Recursos asignados: el % del caché de almacenamiento agregado asignado a este buffer.
- Método de agregación: en caso de concurrir diferentes valores a la misma celda, si se suman o prevalece el último valor subido.
- Si se ignoran o no los valores missings / ceros.
3.- Carga incremental
Un proceso completo de carga incremental incluiría las siguientes fases:
- Borrar la información en la zona de carga.
- Cargar datos en el buffer.
- Cargar datos del buffer en la nueva slice de la base de datos.
- Fusionar slices.
Se puede realizar cargas parciales en slices adicionales sin impactar en la slice principal.
- Esta opción acelera el tiempo de carga: este va a depender del tamaño de la información que se sube a la slice incremental y no del tamaño de la base de datos.
- Essbase crea todas las vistas necesarias sobre la slice (tales como vistas agregadas): cuando se hace una consulta se accede a las diferentes slices, recogiendo la información de todas las celdas.
Esto permite que los usuarios puedan seguir interactuando con la base de datos mientras se realizan estas cargas parciales.
Esto se puede seleccionar en la consola o mediante Maxl:
Consola:
- Cuando se hace click con el botón derecho sobre la base y se selecciona “Cargar datos”, una de las opciones es “Crear nueva porción” (desactivada por defecto).
Maxl:
- import database ‘Nombre aplicación’.’Nombre base’ data from load_buffer with buffer_id 1 create slice;
Además de cargar nuevos datos, también a través de la consola / Maxl se puede reemplazar datos ya existentes:
- Todo el contenido de una base de datos o exclusivamente los datos de las slices incrementales.
- Si se utiliza la opción “override data” los valores missings son reemplazados con ceros. La opción “override” hace la carga más lenta que si se utiliza la opción sumar / restar.
Consola: En la opción “Valores de carga de datos”: determina como se cargan los valores desde el buffer en la base de datos.
- Sobrescribir valores existentes.
- Reemplazar todos los datos de la base.
Maxl:
- import database ‘Nombre aplicación’.’Nombre base’ data from load_buffer with buffer_id 1 override all data;
- import database ‘Nombre aplicación’.’Nombre base’ data from load_buffer with buffer_id 1 override incremental data;
En este segundo caso Essbase reemplaza la información en todas las slices incrementales, creando una nueva slice incremental con la nueva información cargada.
- Esta distinción permite situar en la slice principal la información estática (aquella que no se mueve: por ejemplo, los datos de los últimos años ya cerrados), y en la slice incremental la información volátil que sí se mueve (por ejemplo, los datos de los últimos meses que se siguen actualizando).
Cuando los datos para una nueva slice están en el buffer, Essbase escanea la lista de slices incrementales ya existentes y decide si fusionarlas o no (todas o algunas de ellas) de forma automática con la nueva slice.
Fusiona de forma automática aquellas slices cuando:
- La slice tiene menos de 100.000 celdas.
- La slice es menor que dos veces el tamaño de la nueva slice.
- Slices con más de 5 millones de celdas nunca se fusionan de forma automática.
Por defecto, Essbase fusiona las slices incrementales tras cada cuatro cargas, si bien esto se puede modificar en el fichero de configuración essbase.cfg con el comando AUTOMERGE: ofrece tres posibilidades:
- ALWAYS: Essbase fusiona de forma automática la slice incremental creada en el proceso de carga con la slice principal (es la opción por defecto cuando se utiliza este comando).
- NEVER: Essbase nunca fusiona de forma automática la slice incremental creada durante el proceso de carga.
- SELECTIVE: Essbase fusiona de forma automática la slice incremental creada en el proceso de carga con la slice principal cuando se alcanza un número determinado de slices incrementales (este número se fija en el fichero de configuración essbase.cfg con el comando AUTOMERGEMAXSLICENUMBER).
Cuando se realizan consultas de realiza una agregación dinámica de las diferentes slices.
- Cuando se realiza una consulta Essbase accede a todas las slices para recoger toda la información.
- Al crear una slice Essbase genera las vistas agregadas para que la información cargada en la slice sea visible al realizar una consulta.
Cuando se cargan datos desde Smart View (o Add-in) equivale a una carga incremental con la opción reemplazar-
4.- Carga en paralelo
También se puede realizar una carga en paralelo.
Se pueden cargar datos en diferentes buffers de forma paralela lo que acelera la carga. Esta carga se realiza abriendo diferentes sesiones Maxl:
- En cada una de ellas se activa un buffer diferente de carga y se realiza una carga.
- A través de la consola tan sólo se utiliza un buffer por lo que no se puede realizar una carga en paralelo.
Una vez realizada la carga en los diferentes buffers, en una misma acción se llevan los datos de los diferentes buffers a la base de datos.
- Es más rápido que llevar individualmente los datos cargados en cada buffer.
Veamos un ejemplo:
Maxl Sesión 1
- alter database ‘Nombre aplicación’.’Nombre base’ initialize load_buffer with buffer_id 1 resource_usage xxx;
- import database ‘Nombre aplicación’.’Nombre base’ data from data_file “xxx.txt» using server rule file ‘xxxx’ to load_buffer with buffer_id 1 on error abort;
Maxl Sesión 2
- alter database ‘Nombre aplicación’.’Nombre base’ initialize load_buffer with buffer_id 2 resource_usage xxx;
- import database ‘Nombre aplicación’.’Nombre base’ data from data_file “xxx.txt» using server rule file ‘xxxx’ to load_buffer with buffer_id 2 on error abort;
Maxl Sesión 3
- alter database ‘Nombre aplicación’.’Nombre base’ initialize load_buffer with buffer_id 3 resource_usage xxx;
- import database ‘Nombre aplicación’.’Nombre base’ data from data_file “xxx.txt» using server rule file ‘xxxx’ to load_buffer with buffer_id 3 on error abort;
Maxl Sesión x
- …
Una vez cargada la información en los diferentes buffers se utiliza un único comando Maxl para llevar toda la información a la base de datos.
- import database ‘Nombre aplicación’.’Nombre base’ data from load_buffer with buffer_id 1, 2, 3;