English (Español a continuación)
When working with databases, it is essential to establish a back-up protocol that allows us to recover the database or the information in the event the database becomes corrupted.
There are several back-up options:
1.- Back-up of the database
Essbase allows to make a copy of the database on the server.
This copy can be done using Maxl or through the console (EAS). In both cases, while back-up Essbase:
- Places the database in «read-only» mode to prevent updates during the process that could even corrupt the database.
- When the back-up is finished, it returns the base to “read-write” mode.
Using Maxl:
- alter database ‘Application name’. ’Database name’ [force] archive to file ‘path and name of the back-up file’;
- The [force] parameter is used if we are going to overwrite a backup file that already exists.
Through the console:
- Right-click on the database and in the window opened we select «Archive database».
- If we already have a copy of the database when trying to archive it an error message will appear warning that there is already a copy with this name: if we want to overwrite it we will click on “Force archive”; we can also record it with another name.
With these instructions, the basic files of the database are copied, but there are a series of files that must be copied manually:
- essbase.sec (security file)
- essbase_timestamp.bak (backup of the security file)
- essbase.cfg (configuration file)
- essbase.app (file with the application parameters)
- .otl
- .csc
- .rul
- .rep
- .eqd
- .sel
In case of corruption of the database we can recover it from the copy made.
- Before recovering the database, see if Essbase is trying to recover it (you can see in the log if it shows that Essbase is recovering free space; in this case, you should wait to see if Essbase manages to recover the database).
- If we finally proceed to restore the base, we must start by stopping it (if we don’t, it will give an error message).
Restoring the database can be done by:
Maxl:
- alter.database “Application name”.”Database name” [force] restore from file “path and name of the back-up file”.
- The [force] parameter is used if we want to restore it with a different name than the one used in the backup.
Using the console:
- Right-click on the database and select «Restore database».
- If we want to restore the database with a different name than the one used in the backup, we select the new database (stopped), right-click and select «Restore database”, we will write the name with which we saved it and we will mark the option “Force restoration”.
We retrieve the outline and the data, but not the calculation scripts, the rules files, or the report scripts….
- It is necessary to restore those other files that we copied manually.
When a copy is restored, the information is recovered up to the moment in which the back-up was made, although transactions executed after the back-up can also be recovered.
- To do this, the “Transaction logging” option must be enabled through the configuration file “essbase.cfg”.
Recovery of these transactions can be done using Maxl:
- alter.database «Application name». «Database name» replay transactions.
Or from the console:
- With the option «Play transactions» / «Show transactions».
2.- Copy the database
You can make a copy of the database:
- On another server (where you have access permission).
- On the same server: in the same application or in another application.
It can be done from the console (EAS):
- Right-click on the database and select «Copy»; A window opens in which you can select the server and the application into which the database will be copied, as well as the name that it will be given.
- It can be copied to the same server, to another server on the platform, or to another server on another platform (depending on the permissions).
- It is advisable to make the copy in an different application because if the original application is corrupted, it will render both the original database and the back-up copy useless.
3.- Replicated partition
A copy of the database can be made using a replicated partition:
- A copy of the database is made in a different application.
- The two databases are connected through a replicated partition in which all members of all dimensions are selected.
- Periodically the partition must be executed to keep the information updated.
- The outlines must be kept synchronized so that the changes made in the original database are replicated in the copy.
This system can be very useful, for example, when you have developed a database in Planning and you want to have a copy in Essbase, since the Planning databases do not offer the possibility of copying them to Essbase through the console (EAS).
- We create a new database in Essbase with an empty outline.
- We edit the outline of the Planning database and export it (click on «File»; select «Save as» and we save it to disk).
- We select the new database and open the outline we have saved («File» / «Open» / «File system») and save it as the outline of the new database: («File «/» Save As «/» Essbase Server «).
- Once the outline is copied, we create a replicated partition and move the data from the Planning database to the copy database.
If information is lost in the original database, we can recover it from this copy database: we can recover all the information or part of it if the loss has been partial.
4.- Copy the data
4.1.- Export data
We can also export the data to the database’s own server. It offers the advantage:
- Allows to use the data on other platforms.
- It allows exporting only a section of the data (all data, level 0 data, or input data).
- Allows to create a file in text format instead of binary format.
We have to consider:
- Essbase exports files up to 2 Gb; if the size of the data exceeds this limit, Essbase creates successive files of this size which it names sequentially with the assigned name followed by the prefix «_1», «_2», «_3» …
- This process exports store members and dynamic calc and store members that have previously been calculated, but not the dynamic calc members.
It can be done by:
Maxl:
- export database «Application name».»Database name» data to data file «path of the copy file».
Console:
- Right-click on the database and select «Export»: a window opens in which we have to indicate the name of the file with its path (Application \ Database \ file.txt).
- It also gives us the option to export all the data, only the level 0 data, or the input data.
- It offers us the possibility of exporting it:
- With column format:
- It allows to transfer the data between platforms.
- It allows to manipulate the data (through a load file) and load it into another database.
- With a non-column format (default option) that offers the advantage that it takes up less space so loading is faster.
- With column format:
To import the information:
- The database into which it is imported must contain all the members found in the file to be loaded; otherwise it would give an error.
- If they contain all members but have undergone changes, the upload will succeed but the upload time may be significantly longer.
It can be done by:
Maxl:
- import database «Application name».»Database name» data from data file «path of the copy file».
Console:
- Right-click on the database and select «Load data»; In the window opened, we select the file on the Essbase server and accept (there is no need to select rule file).
- The problem with exporting is that if the database is big it can take a long time.
- During the export process, users can only access the database in «reading» mode.
4-2.- Report script
We can use a report script to generate a text file with all the data, or with a selection of them (for example, levels 0), which we save to disk; In case of accidental deletion, we can load this text file into the database.
Depending on the size of the database, and to avoid that the text file weighs too much, we can exclude all those values that are zeros, #missing, or both.
With the report script we can export, if we are interested, a segment of the database.
- If we want to recover only part of the information (the lost one) bringing the information from a report script, we must start by back-up the database just in case in the load operation we accidentally overwrite data that we do not want to modify.
5.- Copy the artifacts to disk
The different elements of the database (outline, calculation scripts, rules files, report scripts, partitions …) can be copied to disk:
With the artifact open, «File» / «Save as» is selected and a copy is saved to disk.
In the event of a database failure, a new database can be created and the different artifacts imported.
- We select the new database and open the different artifacts we have copied to disk and save them in the new database: («File» / «Save as» / «Essbase Server»).
Any question, please send an email to: essbaseeasy@gmail.com
Español
Cuando se trabaja con bases de datos es fundamental establecer un protocolo de back-ups que nos permita recuperar la base de datos o la información en caso de que la base se llegase a corromper.
Existen diversas opciones de back-ups:
1.- Back-up de la base de datos
Essbase permite hacer una copia de la base de datos en el servidor.
Esta copia se puede realizar mediante Maxl o a través de la consola (EAS). En ambos casos, mientras realiza el back-up Essbase:
- Sitúa a la base de datos en modo “solo lectura” para evitar que pueda haber actualizaciones durante el proceso que podrían incluso llegar a corromper la base.
- Cuando finaliza el back-up vuelve a situar la base en modo “lectura-escritura”.
Mediante Maxl:
- alter database ‘Nombre aplicación’.’Nombre base’ [force] archive to file ‘ruta y nombre del archivo back-up’;
- El parámetro [force] se utiliza si vamos a sobrescribir sobre un archivo back-up que ya existe.
A través de la consola:
- Hacemos click con el botón derecho sobre la base de datos y en la ventana que se abre seleccionamos “Archivar base de datos”.
- Si ya tenemos una copia de la base al tratar de archivar saldrá un mensaje de error avisando de que ya existe una copia con este nombre: si queremos sobrescribir haremos click en “Forzar archivo”; también podemos grabarla con otro nombre.
Con estas instrucciones se hace copia de los ficheros básicos de la base de datos, pero hay una serie de archivos de los que hay que hacer copia manualmente:
- essbase.sec (fichero de seguridad)
- essbase_timestamp.bak (back-up del fichero de seguridad)
- essbase.cfg (fichero de configuración)
- essbase.app (fichero con los parámetros de la aplicación)
- .otl
- .csc
- .rul
- .rep
- .eqd
- .sel
En caso de corrupción de la base podemos recuperarla de la copia realizada.
- Antes de recuperar la base hay que ver si Essbase está tratando de recuperarla (se puede ver en el log si recoge que Essbase está recuperando espacio libre; en este caso conviene esperar para ver si Essbase consigue recuperar la base).
- Si finalmente procedemos a restaurar la base hay que comenzar por detenerla (si no lo hacemos dará un mensaje de error).
La restauración de la base se puede realizar mediante:
Maxl:
- alter.database “Nombre aplicación”.”Nombre base” [force] restore from file “ruta del archivo copia”.
- El parámetro [force] se utiliza si la vamos a restaurar con un nombre diferente a aquel con el que hicimos el back-up.
Mediante la consola:
- Hacemos click con el botón derecho sobre la base de datos y seleccionamos “Restaurar base de datos”.
- Si vamos a restaurar la base de datos con un nombre diferente a aquel con el que hicimos la copia, nos situamos en la nueva base de datos (detenida), hacemos click con el botón derecho sobre la base de datos y seleccionamos “Restaurar base de datos”, escribiremos el nombre con el que la guardamos y marcaremos la opción “Forzar restauración”.
Recuperamos el outline y los datos, pero no los scripts de cálculos, los archivos de reglas, ni los scripts de informe….
- Hay que restaurar aquellos otros ficheros que copiamos manualmente.
Cuando se restaura una copia la información se recupera hasta el momento en el que se realizó el back-up, aunque también se pueden recuperar aquellas transacciones ejecutadas después de realizar el back-up.
- Para ello hay que tener habilitada la opción “Transaction logging” a través del fichero de configuración essbase.cfg.
La recuperación de estas transacciones se puede realizar mediante Maxl:
- alter.database “Nombre aplicación”.”Nombre base” replay transactions.
O desde la consola:
- Con la opción “Reproducir transacciones” / “Mostrar transacciones”.
2.- Copiar la base
Se puede hacer una copia de la base:
- En otro servidor (en el que se tenga permiso de acceso).
- En el mismo servidor: en la misma aplicación o en otra aplicación.
Se puede realizar desde la consola (EAS):
- Se hace click con el botón derecho sobre la base y se selecciona “Copiar”; se abre una ventana en la que se puede seleccionar el servidor y la aplicación en la que se va a copiar la base, así como el nombre que se le va a dar.
- Se puede copiar en el mismo servidor, en otro servidor de la plataforma, o en otro servidor de otra plataforma (en función de los permisos).
- Conviene hacer la copia en una aplicación diferente a la original porque en caso de que la aplicación se corrompa inutilizaría tanto la base original como la copia back-up.
3.- Partición replicada
Se puede realizar una copia de la base de datos utilizando una partición replicada:
- Se hace una copia de la base de datos en una aplicación diferente.
- Se conectan las dos bases de datos mediante una partición replicada en la que se seleccionan todos los miembros de todas las dimensiones.
- Periódicamente se va ejecutando la partición para tener actualizada la información.
- Hay que mantener sincronizados los outlines para que los cambios que se realicen en la base original se repliquen en la copia.
Este sistema puede ser muy útil, por ejemplo, cuando se ha desarrollado una base de datos en Planning y se quiere tener una copia en Essbase, ya que a través de la consola (EAS) las bases Planning no ofrecen la posibilidad de copiarlas en Essbase.
- Creamos una base en Essbase con un outline vacio.
- Editamos el outline de la base Planning y lo exportamos (hacemos click en “Archivo”; seleccionamos “Guardar como” y lo llevamos al disco),
- Seleccionamos la base de copia que hemos creado y abrimos el outline de la base Planning que hemos guardado (“Archivo” / “Abrir” / “Sistema de archivos”) y lo guardamos como outline de la base que hemos creado: (“Archivo” / “Guardar como” / “Servidor de Essbase”).
- Una vez copiado el outline creamos una partición replicada y llevamos los datos de la base Planning a la base copia.
Si se pierde información en la base original la podemos recuperar de esta base copia: podemos recuperar toda la información o una parte de ella si la pérdida ha sido parcial.
4.- Copiar los datos
4.1.- Exportar datos
También podemos exportar los datos al propio servidor de la base. Ofrece la ventaja:
- Permite utilizar los datos en otras plataformas.
- Permite exportar solo una sección de los datos (todos los datos, los datos nivel 0, o los datos inputs).
- Permite crear un fichero en formato texto en lugar del formato binario.
Hay que considerar:
- Essbase realiza la exportación en ficheros de hasta 2 Gb; si el tamaño de los datos excede este límite Essbase va creando sucesivos ficheros de este tamaño a los que va denominando secuencialmente con el nombre asignado seguido del prefijo “_1”, “_2”, “_3”…
- Este proceso exporta los miembros almacenados y los miembros de cálculo y almacenamiento dinámico que previamente se hayan calculado, pero no los miembros de almacenamiento dinámico.
Se puede realizar mediante:
Maxl:
- export database “Nombre aplicación”.”Nombre base” data to data_file “ruta del archivo copia”.
Consola:
- Hacemos click con el botón derecho sobre la base de datos y seleccionamos “Exportar”: se abre una ventana en la que tenemos que indicar el nombre del fichero con su ruta (Aplicación\Base de datos\fichero.txt).
- También nos da la opción de exporta todos los datos, solo los de nivel 0, o los datos input.
- Nos ofrece la posibilidad de exportarlo:
- Con formato de columnas:
- Nos termite transferir los datos entre plataformas.
- Nos permite manipular los datos (mediante un archivo de carga) y cargarlos en otra base de datos.
- Con formato de no-columna (opción por defecto) que ofrece la ventaja de que ocupa menos espacio por lo que la carga es más rápida.
- Con formato de columnas:
Para importar la información:
- La base en la que se importa debe contener todos los miembros que se encuentran en el fichero que se va a cargar; en caso contrario daría error.
- Si contienen todos los miembros pero ha sufrido cambios, la carga se realizará correctamente pero el tiempo de carga puede ser significativamente mayor.
Se puede realizar mediante:
Maxl:
- import database “Nombre aplicación”.”Nombre base” data from data_file “ruta del archivo copia”.
Consola:
- Hacemos click con el botón derecho sobre la base y seleccionamos “Cargar datos”; en la ventana que se abre seleccionamos el fichero en el servidor de Essbase y aceptamos (no hay que seleccionar archivo de regla).
- El problema de exportar es que si la base es grande puede requerir mucho tiempo.
- Durante el proceso de exportación los usuarios sólo pueden acceder a la base en modo “lectura”.
4-2.- Report script
Podemos generar mediante un report script un fichero de texto con todos los datos, o con una selección de ellos (por ejemplo, los niveles cero), que guardamos en el disco; en caso de borrado accidental podemos cargar en la base este fichero de texto.
Según el tamaño de la base, y para evitar que el fichero de texto pese mucho, podemos excluir todos aquellos valores que sean ceros, #missing, o ambos.
Con el report script podemos exportar, si nos interesa, un segmento de la base.
- Cuando vamos a recuperar parte de la información perdida de una base de datos trayendo la información de un report script, hay que empezar por hacer un back-up de la base por si en esta operación de carga accidentalmente sobrescribimos datos que no queremos modificar.
5.- Copiar los artefactos en el disco
Los diferentes elementos que integran una base de datos (outline, scripts de cálculos, archivos de reglas, scripts de informes, particiones…) se pueden copiar en el disco:
Con el artefacto abierto se selecciona “Archivo” / “Guardar como” y se genera una copia en el disco.
En caso de fallo de la base, se puede crear una base nueva e ir importando los distintos artefactos.
- Seleccionamos la base de copia que hemos creado y vamos abriendo los diferentes artefactos que hemos copiado en el disco y lo vamos guardando en la nueva base: (“Archivo” / “Guardar como” / “Servidor de Essbase”).
Cualquier consulta envía, por favor, un correo a: essbaseeasy@gmail.com