Tango database
- ← previous page
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- next page →
|
|
---|---|
OK, this means that the package tango_db does not use the script create_db.sql as is. Cheers Manu |
|
|
---|---|
Manu, No. It use the script create_db.sql as it is (copying it from the tango sources) and that's the problem. One have to change the script either in the debian package or in the tango sources. Cheers, Jan |
|
|
---|---|
Jan, I am lost! How is it possible to run this script several times if the MySQL tango database is not dropped between each run? This script aborts after its first line if the database is already there and therefore could not add entries in XXX_id tables. Cheers Manu |
|
|
---|---|
Manu, Ah, yes. You are right. In the package script from debian (tango-db 8.1.2c+dfsg-4~bpo70+1) this two first lines are missing.
Cheers, Jan |
|
|
---|---|
Jan, OK, I understand now. This morning I have sent a mail to Fred (Our Soleil colleague who did the debian packaging) to ask him his opinion on this subject. May be there is may be a good reason why these two lines have been removed Cheers Manu |
|
|
---|---|
Hi, I attach the current state plot from my PC with all my patches. I can correlate groups of the highest spikes with some processes (which e.g. use my harddisk) Top 5 are:
What I've learnt is that it is better to keep tango DB separately on dedicated host with big amounts of memory and a large number of cores where no other program is using host resources. Cheers, Jan |
|
|
---|---|
Hello, you are right, I am using the create_db.sql script but not only and with some modifications. here the patch applyed to the diff –git a/cppserver/database/create_db.sql.in b/cppserver/database/create_db.sql.in index 210a335..292d005 100644 — a/cppserver/database/create_db.sql.in +++ b/cppserver/database/create_db.sql.in @@ -1,12 +1,8 @@ - -CREATE DATABASE @TANGO_DB_NAME@; -USE @TANGO_DB_NAME@; - # # Create all database tables # -source create_db_tables.sql +source /usr/share/tango-db/create_db_tables.sql # # Init the history identifiers @@ -126,5 +122,5 @@ INSERT INTO property_class VALUES ('TangoAccessControl','AllowedAccessCmd',6,'Ge # Load the stored procedures # -source stored_proc.sql +source /usr/share/tango-db/stored_proc.sql In fact this script is used during the package installation so I fixed the path. Now If I remember correctly (I did this years ago with almost zero knowledge about databases…), I removed the first line of the script in order to be able to re-install the package wihtout error during the installation. On Debian/Ubuntu/Mint… I am using the dbconfig-common[1] system to deal with all the database creation and upgrade from one version to the other. In the debian/rules file you will see an sql target which create the script used by dbconfig-common to do the database upgrade. sql: ./configure $(CONFIGURE_OPTS) # use this target to generate the dbconfig-common upgrade script once the debian/changelog is ok cat cppserver/database/stored_proc.sql\ cppserver/database/update_db.sql > debian/mysql/$(FULLDEBVERSION) $(MAKE) distclean this way during an upgrade the upgrade script take care to create the right tables and fill them with the default values. I regenerate also the stored_proc in the same time. Now I need your help to rethink all this and tune the tango sources script in order to make it work properly. the ideal solution for the packaging woud be to have by default the right scripts expected by dbconfig-common in the tango source. I also need your help to propose a script which fix the databases generated with the Debian packages. In order to sanitize them. Let's speak about all this. cheers Fred [1] https://people.debian.org/~seanius/policy/dbconfig-common.html/ |
|
|
---|---|
Hello Fred, I see your problem. The dbconfig tool creates DB by itself so "two first lines" are executed by dbconfig and you cannot check if DB was created or it was before. Therefore, you have to check in the sql sript if the rows from tango tables exist. (For creating of tables it is done inside create_db_tables.sql so create_db_tables.sql is safe). My first solution I've send in one of my previous posts (about a revision counter from NeXus Configuraton Server). Then, one has to add into each insert query a check if row was already inserted. The second solution is to group all insert queries into one sql block with an if statement in front of it. The if command can check whether one of the table rows was added or not. Unfortunately, the if statement in sql scripts can be only used in an sql procedure or a function so one has to create a procedure with insert queries and call it after. One has to remember that an sql procedure cannot contain any 'source' command ( which is executed by an sql client interpreter). So createdb.sql could look like
Actually, such a procedure could be put into the stored_proc.sql file. To avoid changing of paths in the source commands you can put create_db.sql into /usr/share/tango-db/ and in your 'mysql' file source it as
Finally, also those "two first lines" could be put into a separate file, i.e.
If none of the changes are performed in the tango sources the second solution is easier to perform (INSERT statments stay as there are). Cheers, Jan |
|
|
---|---|
Hi, I've found a bug in my innodb-patch which causes a memory leak. To fix it This fix improves a situation on the second part of my last plot. One can only see a spike caused by TSM. Bests, Jan |
|
|
---|---|
Getting better and better! Nice result - well done Jan! |
- ← previous page
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- next page →