My advice; by all means restructure your archive table and schema as 
required to suit but don't try manually adjusting the daily summary tables. 
Far easier and safer to use wee_database to drop and then rebuild them - 
almost certain to get yourself tied in knots one way or another otherwise. 
300k of records is not much and will not take too long at all to rebuild on 
any half way decent machine.

Gary

On Friday, 17 July 2020 at 09:44:20 UTC+10 cl...@n7qnm.net wrote:

> Hi!    My day job was (Oracle) DBA for a number of years and I have what’s 
> probably a stupid question about modifying the WeeWx database.  
>
>  
>
> Specifically, I want to add some data around solar power generation (watts 
> consumed, watts generated, panel efficiency) and possibly rename some of 
> the “extraTemp” columns to be more descriptive (like 
> “SolarCollectorTemp”).    I get the idea of modifying the schema file and 
> then using wee_database to create a new archive table; but, I have over 
> 300K archive records, and that takes a while.   Then there’s the whole 
> daily summary process.
>
>  
>
> So – my question is:
>
> Instead of taking weewx down while doing all of the “data movement”, why 
> not:
>
>    1. Change the schema files (for documentation and in case a rebuild IS 
>    required)
>    2. Back up the database, which could be done “live
>    3. Use a database ALTER TABLE command to add the column(s) – which 
>    could be done “live”.
>    4. Stop weewx
>    5. Do any ALTER TABLEs that might be required to RENAME columns
>    6. Add/change “collectors” required for the new/changed columns
>    7. Restart weewx
>
>  
>
> Seems to me the only possible downsides to this would be:
>
>    1. Forgetting to change the schema files (“Bad DBA, no cookie!”)
>    2. The columns would eventually not be organized alphabetically (but 
>    this could be fixed by periodically, perhaps once/release, doing the 
>    wee_database thing.
>
>  
>
> Comments?
>
>  
>
> Clay Jackson
>
>  
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-development+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/c453ccaf-8c70-41dd-87e8-a66b556c14a2n%40googlegroups.com.

Reply via email to