PLCS.net - Interactive Q & A

PLCS.net - Interactive Q & A (http://www.plctalk.net/qanda/index.php)
-   LIVE PLC Questions And Answers (http://www.plctalk.net/qanda/forumdisplay.php?f=2)
-   -   Citect V 5.21 and MySQL 0.9.4 beta. (http://www.plctalk.net/qanda/showthread.php?t=112919)

rahilansari November 16th, 2017 12:51 AM

Citect V 5.21 and MySQL 0.9.4 beta.
 
Hi all,

I have a Citect SCADA V 5.21 and MySQL 0.9.4 beta installed on my Server (Windows Server 2003). All process events are logging in a data base file with an extension events.MYD. Everything was working fine but since last 2 weeks events are not looging into that file and I can only see the events occur before 2 weeks. I am not expert on MySQL and don't know how to fix this. I have restarted the system, compiled the Citect projects and run but still same condition. Can anyone guide me if we assume the problem is from MySQL then how should I fix this.

Any type of support is highly appreciable.
Thanks
Rahil

rahilansari November 16th, 2017 01:04 AM

4 Attachment(s)
I have attached some screenshot for reference.

sigmadelta November 16th, 2017 01:25 AM

A quick glance makes me think your database is too large for MSQL 0.9.4 beta (4 GB).

rahilansari November 16th, 2017 01:34 AM

Hi, Thanks for your reply.

The system logged the events of 1 year then reset. However if the size is too large what should I do to fix it? Do I need to copy the events.MYD file and delete from that directory and system will regenerate it again? or do I need to follow some specific procedure or use some tools? please advise.

sigmadelta November 16th, 2017 03:49 AM

The quickest solution is to backup the events database, and delete all the data inside the database.

If you can open a command line window in MySQL, do this:

mysqldump mstw_db > mstw_db_2017-11-16.sql

Then from a MySQL query window:

USE mstw_db
DELETE from events

https://www.tutorialspoint.com/mysql...lete-query.htm

rahilansari November 16th, 2017 06:02 AM

Hi, Thanks for the reply. while doing this do I need to Shutdown the runtime of my Citect SCADA? By above method am I deleting the complete file or just contents of the file?

sigmadelta November 16th, 2017 06:04 AM

You should be able to backup and delete the contents of the database while Citect is running.

rahilansari November 20th, 2017 10:16 PM

Hi Sigmadelta,

As per your suggestion I tried but couldn't find an option to open command line in MySQL to write that command. However I am able to find MySQL query. I have gone through manuals and internet documents but not sure. Can you please guide me in a little more depth. Also I want to inform you that I have events.MYD file from my old ghost backup so if I copy and replace directly from the directory then will it work fine because its size is around 1 GB. Please advise.

sigmadelta November 21st, 2017 12:45 AM

If that's the case then you could do this, but you should stop Citect Runtime.

1) Stop Citect Runtime
2) Copy your current events.myd to a backup location
3) In a query window do this:

USE mstw_db
DELETE from events


4) Start Citect Runtime

Then you should have an empty events.myd to work with. The file size might remain the same, but it should be able to write data again since it should overwrite information instead of adding new information.

Alternatively, you could to this for Step 3:
3) copy your backup events.myd from your ghost backup, and run this in the query window, to start with a file size of 1GB instead of 4GB:

USE mstw_db
DELETE from events


What is the file format of your hard disk? FAT32 or NTFS? In FAT32, the maximum file size is 4GB. This could be your problem. NTFS file system does not have this limitation.

rahilansari November 21st, 2017 12:51 AM

Ok, I will copy the current events.MYD file from directory then write this command. So basically my understandin is my events.MYD file will reset to zero bytes and start logging the events again from that point of time. If yes then it is okay for me because I have the backup file with me to see my old events in future I required.

sigmadelta November 21st, 2017 01:04 AM

The file might not resize at all, but it will for sure overwrite existing data if all of it is deleted. I edited my answer. Please read it.

rahilansari November 25th, 2017 04:16 AM

Hi Sigmadelta, the file system is NTFS!!!

sigmadelta November 25th, 2017 05:58 AM

OK then the 4GB limitation is in MySQL.

rahilansari February 7th, 2018 06:29 AM

Hi sigmadelta,

I am trying to execute delete query but it fails with an error. do I need to change something in preferences? please advise

sigmadelta February 7th, 2018 08:01 AM

You have to make sure that applications that are accessing the database are not running.


All times are GMT -5. The time now is 04:30 PM.

.