Extraction Tailles base et quotas

Forum destiné aux questions sur le développement : Formules, LotusScript, Java ...

Extraction Tailles base et quotas

Messagepar SISSI » 11 Sep 2003 à 09:44

Bonjour,Je voudrais extraire dans un fichier tabulaire TXT pour le récupérer dans Access ou Excel la liste de toutes mes bases sur le serveur avec leur taille et le quota attribué.... pour ensuite faire des requêtes ou des stats.J'ai bien réussi depuis le journal.log l'extraction des tailles mais je n'arrive pas à trouver le nom du champ quota pour me créer une vue privée contenant tailles + quotas.Quelqu'un a t-il une idée ?merci,Sissi
SISSI
 

Re: Extraction Tailles base et quotas

Messagepar Stephane Maillard » 11 Sep 2003 à 10:28

Bonjour,Il existe des fonctions sur la classe NotesDatabase qui permette de récupérer la taille.Voici un morceau de code pour récupérer le quota :(Options)Option PublicREM Need to include Option ExplicitOption Explicit(Déclarations)%REM 20July2000 -- the NSFdbOpen and NSFDbClose are really not needed here since the DBQuotaGet requires a string rather than a handle to the database%END REMREM This opens handle to the Notes databaseDeclare Function W32_NSFDbOpen Lib "nnotes.dll" Alias "NSFDbOpen" (Byval dbName As String, _hdb As Long) As IntegerREM This closes the handle to the Notes databaseDeclare Function W32_NSFDbClose Lib "nnotes.dll" Alias "NSFDbClose" (Byval hdb As Long) As Integer%REMCreate the structure for the returned DBQuotaInfo structure: (type definition of the structure is from the Notes C API User Reference guide found on Lotus website)------------------------------------------------------------------------------------------------ typedef struct { DWORD WarningThreshold; DWORD SizeLimit; DWORD CurrentDbSize; DWORD MaxDbSize; } DBQUOTAINFO;------------------------------------------------------------------------------------------------%END REMType DbQuotaInfo WarningThreshold As Long 'DWORD WarningThreshold -- Database size warning threshold in kbyte units SizeLimit As Long 'DWORD SizeLimit -- Database size limit in kbyte units CurrentDBSize As Long 'DWORD CurrentDBSize -- Current Size of database in kbyte units MaxDBSize As Long 'DWORD MaxDBSize -- Max database file size possible in kbyte unitsEnd TypeDeclare Function W32_NSFDbQuotaGet Lib "nnotes.dll" Alias "NSFDbQuotaGet" (Byval dbpath As String, _DbQInfo As DBQuotaInfo) As IntegerDans un agent :'(Options)Option PublicOption ExplicitUse "ClassDatabaseSizeLimit"Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Dim dbpath As String, rc As Integer Dim DbQInfo As DBQuotaInfo Dim strQInfo As String Set db = s.CurrentDatabase REM Build the path for this database If db.Server = "" Then REM if the server is local then we don't want the double bang (!!) in there dbpath = db.FilePath Else REM notice the double bang (!!) to separate the server from the database dbpath = db.Server & "!!" & db.FilePath End If REM Get the database quota information and put into the rc (Return Code) variable REM Return the quota info into the DBQInfo variable which has a type = DBQuotaInfo rc = W32_NSFDbQuotaGet( dbpath, DbQInfo) REM get one piece of the DBQInfo (MaxDBSize) using its type definition from the script library and put into a new variable for use in LotusScript strQInfo = Cstr(DbQInfo.MaxDbSize) Msgbox "The database maximum size of the current database is " & strQInfo & " kb"End Sub[%sig%]
Cordialement

Stéphane Maillard
Avatar de l’utilisateur
Stephane Maillard
Lord of DominoArea
Lord of DominoArea
 
Message(s) : 8695
Inscrit(e) le : 16 Déc 2004 à 01:10
Localisation : Bretagne

Re: Extraction Tailles base et quotas

Messagepar Raziel » 11 Sep 2003 à 12:04

Sinon plus simple, il existe la fonction "SizeQuota" de la classe notesdatabase qui te retourne le quotas
Raziel

L'administration est un lieu ou les gens qui arrivent en retard croisent dans l'escalier ceux qui partent en avance. [Georges Courteline]
Avatar de l’utilisateur
Raziel
Modérateur
Modérateur
 
Message(s) : 1795
Inscrit(e) le : 21 Déc 2004 à 11:06
Localisation : Roubaix

Re: Extraction Tailles base et quotas

Messagepar Stephane Maillard » 11 Sep 2003 à 15:23

Bonjour,Je ne m'en souvenais plus de celle la. Merci de l'info.[%sig%]
Cordialement

Stéphane Maillard
Avatar de l’utilisateur
Stephane Maillard
Lord of DominoArea
Lord of DominoArea
 
Message(s) : 8695
Inscrit(e) le : 16 Déc 2004 à 01:10
Localisation : Bretagne

Re: Extraction Tailles base et quotas

Messagepar SISSI » 12 Sep 2003 à 08:00

merci à tous je vais essayer !!!
SISSI
 


Retour vers Développement

cron