php - How to do monthly refresh of large DB tables without interrupting user access to them -


In the Oracle Database I have four DB tables which need to be rewritten / refreshed every week or every month. I am using this script standard PHP OCI functions in PHP, which reads new data from XML and refreshes these four tables. The four tables have the following properties

Table A - up to 2mil rows, one primary key (one row can contain up to 2K data)

Table B - up to 10mil rows, a table A foreign key indicating A (the data can take up to 1100 bytes in a row)

Table C - Up to 10 millimeter rows, a foreign key indicating Table A (Maximum of one line data 1100 bytes may take)

Table D - 10mil row To the extent, a foreign key leading to Table A (maximum 120 bytes in a row)

So I need recapitalization without damaging these tables User Experience I can not explicitly remove the tables and only offer them again because it is a somewhat long process.

I have only considered a big transaction where I remove from all the tables and rebuild them. I am a bit worried about the length of the transaction (I do not know yet, but it has an hour or so May take longer)

I wanted to create temporary table replicas of all tables. Then I could remove the main tables and rename the temporary tables. Although you can not make DROP and optional table descriptions within the transaction because they always auto commit. It can be done quickly (four DROP and four optional table descriptions), but can not guarantee that the user will not get any errors in that short time.

Now, a combination of two ideas, I am considering floating tables, then to reconstruct the main tables, all the four basic tables from the floating tables and later a delete from INSERT Since there is no DDL statement here, it will work within all transactions. Again, however, I am thinking that there are some 60 million records processing mechanisms within the transaction (I think this would be a concern for the first consideration).

It would be a normal scenario, is there a standard or recommended way of doing this? Any tips would be appreciated. Thank you.

Am I the only one (except Vincent) that would be possible first possible solution , i.e. Daily / INSERT, before trying to make something more advanced?

Again, I am thinking that if the memory processing process of some 60 million records within the transaction is causing me trouble (this would be a concern for the first thought).

Oracle manages memory very well, it has not been written by a group of Java novices (oops, it came out of my mouth!). So the real question is whether you need to worry about the performance penalties of the RDO and UNDO log files ... In other words, make a demonstration test case and run it on your server and see how long it takes is. During DELETE / INSERT the system will not be normally liable, but other sessions can still be selected without fear of deadlock, memory leaks or system crashes. Indications: DB servers are usually disk-bound, so getting a proper RAID orange is usually a very good investment.

On the other hand, if performance is important, you can choose one of the alternate methods described in this thread:

  • Partitions if you have a license
  • Changing the name of the table if you do not, but be careful that DDL on the flight can cause some side effects object invalid, ORA-06508 ...

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -