Framework:Database on SQL Server

From CoPlanner 10
Jump to navigationJump to search

Tables

You need to distinguish between system tables and data tables.

Data tables are created via the object management. They have a COPSYS_ID as their name.

System tables are tables pre-defined by the CoPlanner and start with “tb_”. These are:

  • tb_AggMskConfig
  • tb_Formeln
  • tb_FrmlFelder
  • tb_FrmlParameters
  • tb_FrmlVerb
  • tb_ImpFeldzuordnung
  • tb_ImpObject
  • tb_ImpTabzuordnung
  • tb_InpMskCnfg
  • tb_MakroAction
  • tb_MakroActionDetails
  • tb_MakroActionParam
  • tb_MakroActionParamDetails
  • tb_ObDetails
  • tb_ObjektRechte
  • tb_ObTypes
  • tb_OlapStructure
  • tb_PlanBenutzer
  • tb_Planverwaltung
  • tb_TabDetails
  • tb_tabdim
  • tb_VersionInfo
  • tb_zeit


Views

The only CoPlanner view is the “time” view. This results from:

Create View [time] As SELECT dbo.[tb_time].* FROM dbo.[tb_time]

This is used in the OLAP for the time dimension.

It is possible to create the CoPlanner data tables as a view which then is given the corresponding name as in the CoPlanner object management.

For this purpose, there is a specific menu item in the CoPlanner under Administration – Create views. Existing views are not deleted thereby, but if there exist already views with a name that is to be created such views are overwritten.

If required, you can delete all views (except for the “time” view) and have all CoPlanner data tables newly created as views.


Stored Procedures

The CoPlanner does not use any stored procedures.

Backup / Restore

From within the developer menu you can backup and restore the entire database as well as all definitions of the server directories. The following data is saved:

  • The entire SQL database which is set in the connection string in SvrConfig.xml.
  • The “Agg Masks”, “Reports” “Report” and “Transfer” server directories as well as their sub-directories.

Please note:

  • Any existing content in the saved directories will be overwritten during the restoring process.
  • Configuration data (SvrConfig.xml, CopServer.exe.config, ClientConfig.xml and coplanner.exe.config) are not saved.
  • The database contained in the backup will be restored with the name which is defined in the SvrConfig.xml in the connection string – irrespective of the name of the originally saved database.
  • OLAP data is not saved.
  • In case of doubt, carry out a backup before the restoring process.

In order to backup a database, proceed as follows:


Backup database

Error creating thumbnail: File missing
Framework, Backup database
  1. Drücken Sie auf den Button und wählen sie ein Verzeichnis auf Ihrem lokalen Client-Rechner.
  2. Drücken Sie "Start". Es wird jetzt am Coplanner-Server ein Backup der Datenbank im definierten Verzeichnis erstellt. Zu beachten ist, dass in der Datei svrConfig.xml, welche sich im Server-Verzeichnis befindet, die Zeile <Backuppath> richtig definiert ist. Es muss ein Pfad angegeben werden, auf welchen der SQL-Server Schreibrechte hat. Das Backup wird nach einiger Zeit (bitte geduldig sein – die Datei wird am Server komprimiert und anschließend auf den Client übertragen) im angegebenen Verzeichnis gespeichert.


Datenbank wiederherstellen

File:Datenbank wiederherstellen.jpg
Framework, Datenbank wiederherstellen
  1. Überprüfen sie, ob in SvrConfig.xml im connectionstring die Datenbank definiert ist, welche Sie mit dem Wiederherstellen überschreiben möchten.

Zu beachten ist hierbei wieder die richtige Konfiguration von <Backuppath>. Weiters wichtig ist, dass im Connectionstring der Teil pooling=false; vorhanden ist. Weiters darf auf den SQL-Server kein Query-Analyzer, Enterprise Manager o.ä. verbunden sein. Weiters sollte kein weiterer Client mit dem CoPlanner Server verbunden sein. Wenn nicht, ändern Sie bitte die Parameter entsprechend und starten Sie Server und Client neu.

  1. Drücken sie den Button und wählen sie eine Backup-Datei.
  2. Drücken Sie Start. Nach einiger Zeit erscheint eine Meldung, dass das Backup eingespielt wurde. Der Server wird anschließend neu gestartet und man kann mit den neuen Daten weiterarbeiten. (Es empfiehlt sich, bestehende Masken vor einem Restore zu schließen, da die zugrunde liegenden Daten nicht mehr vorhanden sein müssen.)