Page 1 sur 1

Extraction Tailles base et quotas

MessagePublié: 11 Sep 2003 à 09:44
par SISSI
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

Re: Extraction Tailles base et quotas

MessagePublié: 11 Sep 2003 à 10:28
par Stephane Maillard
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%]

Re: Extraction Tailles base et quotas

MessagePublié: 11 Sep 2003 à 12:04
par Raziel
Sinon plus simple, il existe la fonction "SizeQuota" de la classe notesdatabase qui te retourne le quotas

Re: Extraction Tailles base et quotas

MessagePublié: 11 Sep 2003 à 15:23
par Stephane Maillard
Bonjour,Je ne m'en souvenais plus de celle la. Merci de l'info.[%sig%]

Re: Extraction Tailles base et quotas

MessagePublié: 12 Sep 2003 à 08:00
par SISSI
merci à tous je vais essayer !!!