script to read database size?

koronkoron Member Posts: 3
edited 2009-01-19 in Navision Attain
hi there :D

iam woking at a company that have shops around the country.
all the shops have their own database/server
and now and then the database runds up around 100%
and when this hapends wh extend the database.

question 1
are there ar way to have navision attatin automaticly make a file with info on database size?
or can run some kind of external command "parameters" that gives me database size.

question 2 :)
can i somehow extend the database with a script


hope this make sense :oops:
.....annd oohhh BTW happy newyear :P

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Answer to question 1: How To calculate database usage?

    Answer to question 2: it's a bit dangerous to do this automatically. You could try using SendKeys to automate the keystrokes needed. Better is to calculate the database size, and generate a mail to someone in charge when the used amount reaches some limit.

    Happy new year too :P
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • koronkoron Member Posts: 3
    Answer to question 1: How To calculate database usage?

    Answer to question 2: it's a bit dangerous to do this automatically. You could try using SendKeys to automate the keystrokes needed. Better is to calculate the database size, and generate a mail to someone in charge when the used amount reaches some limit.

    Happy new year too :P

    ohhh the email part sounds really nice!!
    can i make navision send a mail when its near the like....90%??
    couldt you give me a little hint abour how to do this?

    i dont know how how to program in navision thats why i where looking for a standalone script but....
    som guys at work are programming in attain so if you could give a litlle hint ille show it to them =)

    thank you so mouch for this really nice information :)
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You 'll have to write some C/AL code to get the job done.

    Search the forum for "smtp mail" and you find lots of postings how to send mails through code.

    Here is one for example: How to Send Emails through Code Unit

    You could write the code (to check the database usage and send the mail) in codeunit 1, function LoginStart, so it gets executed everytime someone logs into NAV. To prevent numerous mails being send (if for example 10 people login to NAV and your database usage has reached 99%), you need to store in a setup-field if a mail has already been send.

    Hope this gets you started.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • ckck Member Posts: 6
    Is there anyone who has an exampel of the code cu 1
Sign In or Register to comment.