14/07/2005


X (size matters!)

Sono giorni che non mi faccio vivo e qualcuno penserà che sono andato in vacanza.
Diciamo allora che ero in vacanza-studio.
Ho passato due giorni a studiare come recuperare qualche striminzito gigabyte di disco da un vecchio (4 anni) server.
Qualcuno dirà che sono un fesso, che oggi con duecento euro ti porti a casa un disco da 500 gigabyte che lo attacchi in rete e non ci pensi più.
In generale è vero, che sono fesso intendo, però questa era ormai una questione d'onore e, comunque, nel caso specifico, questa soluzione non avrebbe potuto funzionare.
Perchè ?
Perchè la lotta per conquistare 10 striminziti giga era fra me ed il mitico sql server di microsoft, che il disco lo pretende dentro al server: delle unità di rete, per quanto capienti e veloci possano essere, non sa proprio che farsene, quindi o gli trovavo lo spazio o rinunciavo al mio caro database.
Ma come ho potuto costruire un database in un server con un disco così limitato ?
Primo perchè sono fesso, secondo perchè a quel server ci sono affezionato, terzo perchè il database, file di log incluso, non dovrebbe superare i 600 megabytes, quindi, con una scorta di 9,4 giga, avrei potuto stare tranquillo.
Ma non avevo considerato il fattore "X".
Tempo fa avevo impostato una replica schedulata per essere eseguita ogni notte.
Questa replica avrebbe copiato tutti i dati di una certa categoria, salvo le categorie da escludere (da contrassegnare con una X in un certo campo).
Ebbene, due mesi fa, avrei dovuto mettere una X su una di queste categorie (che vale circa 100.000 righe) per smettere di replicarla.
Invece ho dimenticato di farlo poi, siccome la categoria era superata, non l'ho più guardata.
E ieri il disco si è riempito, dopo che le 100.000 righe, ricopiate ogni notte per 60 notti di seguito, sono diventate 6.000.000 di righe.
A questo punto ho passato due giorni a provare tutte le tecniche messe a disposizione da Microsoft con nomi promettenti come "truncate log" (il vero mangiadisco è, infatti il log, più che il file dati) oppure "shrink database".
Tutto è stato inutile: lui pretendeva, prima di eliminare il log, di salvarlo, anche se a me non avrebbe potuto fregare di meno di questo inutile log.
Ma come avrei potuto salvarlo se questo beneamato log occupava 7 gb e, a fatica, pulendo di qua e di là, ero riuscito a metterne insieme solo 2 ?
Una funzione semplice ed efficace del tipo: "butta il log nel cestino e non preoccuparti, che il database poi si aprirà comunque" ancora non mi pare esista (forse nella prossima release di sql).
Alla fine, come in ogni koan che si rispetti, oggi è arrivata l'illuminazione: creare un nuovo database copiando dal vecchio solo le cose utili.
In un'ora avevo finito ed avevo liberato ben 10,6 gigabytes.

Buonanotte (e scusate l'argomento pallosetto) !
5am

PS: a proposito di dischi, questa sera al centro lame c'è stato un concerto delle vibrazioni (vedi foto all'inizio). Standomene a letto me li sono ascoltati molto bene (complici i discreti amplificatori e la notte estiva che sconsiglia di chiudere le finestre): tutto sommato il loro stile neo-70 non mi dispiace affatto.

4 comments:

Massimo said...

Probabilmente già lo sai, ma se non sei molto interessato alle caratteristiche transazionali del database, ti conviene impostare il logging come "semplice". Il default è "completo", il che rende le operazioni che hai fatto molto più space consuming.
Ciao
PS: non riusciamo mai a bere quel caffè

Frank Morris said...

Ti capisco, quando uno si interstardisce nell'informatica ci sta anche settimane ma non molla,a me capita coi programmi C. ciao e grazie della visita. Io alle 5 sono nel mondo dei sogni di solito vado a dormire molto tardi.

5 del Mattino said...

massimo ! Il tuo consiglio era d'oro: il log si è praticamente azzerato. Meriti molto più di un caffè.

svdh0grin60lyqk said...

Hot News From The Automotive Lending Industry!!

+++++++++Current Profile+++++++++
InterFinancial Holdings, Corp (IFLH)
Current Price $0.036
+++++++++++++++++++++++++++++

Is this an undiscovered gem priced to go higher!!
Please read the following Announcement in its Entirety and Consider the Possibilities?
Watch this One to Trade!

IFLH announces Senator David Cain has joined its Board of Directors!!

IFLH volume trading is beginning to surge with landslide Announcement. The value of this
stock appears poised for growth! This one should not remain on the ground floor for long.

BREAKING NEWS!!
InterFinancial Holdings, Corp. (OTC Pink Sheets: IFLH - News) announced that they have added
David Cain to their board of directors. David Cain is currently the Chairman of the advisory
board to TTI (Texas Transportation Institute). Senator Cain represented Senate District 2 for
eight years in the Texas Senate and Chaired the Senate State Affairs Subcommittee on
Transportation and served nine terms in the Texas House of Representatives for District 107.

During his twelve years as Chairman of the House Committee on Transportation, Senator Cain?s
efforts on behalf of the people of Texas have been widely recognized. He was named to Texas
Monthly Magazine?s list of Ten Best Legislators, the Dallas Morning News said he was one of
the outstanding legislators of the 73rd session, and the Texas Department of Transportation
awarded him the Russell H. Perry Award in 1995 for his efforts to gain public awareness of
the need for and benefits of transportation facilities in the State of Texas.

Jeffrey C. Bruteyn, Managing Director, stated, We at InterFinancial are proud to have such a
widely recognized Senator join our board and oversee out automotive lending division. His
affiliations and connections to the automotive industry will be invaluable to our company.
Senator Cain will be instrumental in expediting our approval to use a government issued Seller
Finance License.

Seller Finance Licenses are very difficult to obtain and are usually reserved for the Big Boys
with heavy lobbyists. These licenses are highly coveted because it allows the finance company
to collect the entire down payment, instead of paying a portion of it to the taxing authority.
This dramatically helps a finance company?s bottom line if the buyer defaults on the loan.

With the new GPS tracking systems being installed on every car to dramatically improve
repossessions and with Senator Cain on the Board of Directors, InterFinancial Holdings
is ready to take their business to the next level.

Conclusion:

The examples above show the Awesome, Earning Potential of little known Companies
That Explode onto Investor?s Radar Screens. This stock will not be a Secret for long.
Then You May Feel the Desire to Act Right Now! And Please Watch This One Trade!!
GO IFLH!

All statements made are our express opinion only and should be treated as such. We may own,
take position and sell any securities mentioned at any time. Any statements that express or
involve discussions with respect to predictions, goals, expectations, beliefs, plans,
projections, objectives, assumptions or future events or performance are not statements of
historical fact and may be "forward looking statements." Forward looking statements are based
on expectations, estimates and projections at the time the statements are made that involve a
number of risks and uncertainties which could cause actual results or events to differ materially
from those presently anticipated. This newsletter was paid four thousand dollars from a party
(IR Marketing). Forward looking statements in this action may be identified through the use of
words such as: "projects", "foresee", "expects". in compliance with Section 17(.b), we disclose
the holding of IF LH shares prior to the publication of this report. Be aware of an inherent
conflict of interest resulting from such holdings due to our intent to profit from the liquidation
of these shares. Shares may be sold at any time, even after positive statements have been made
regarding the above company. Since we own shares, there is an inherent conflict of interest in
our statements and opinions. Readers of this publication are cautioned not to place undue reliance
on forward-looking statements, which are based on certain assumptions and expectations involving
various risks and uncertainties that could cause results to differ materially from those set forth
in the forward- looking statements. This is not solicitation to buy or sell stocks, this text is
for informational purpose only and you should seek professional advice from registered financial
advisor before you do anything related with buying or selling stocks, penny stocks are very high
risk and you can lose your entire investment.