Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Schedule Script on an Encrypted DB

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Schedule Script on an Encrypted DB

    Hello A5 veterans and gurus,

    I have an idea and would like thoughts/suggestions before I invest too much time testing/implementing.

    Brief overview of our setup: Running A5 over network share (\\DedicatedSvr\LiveA5NetSharedDB\) from a dedicated server. DB encrypted using A5 encryption. Using A5 security for individual user logins.

    I would like to run some maintenance scripts / reports after hours using script_play / script_schedule(). It is my understanding an A5 user account needs to be logged in to the DB to unlock the encryption so tasks such as script_play() or script_schedule() function/execute. So what I need is an A5 account that is always logged in and preferably one that can automatically log in.

    So here is my idea:

    Copy the workspace on the dedicated a5 server from C:\LiveA5NetSharedDB\ to C:\MaintDB\
    Drop all the tables from the MaintDB
    Add all tables from the Live DB (C:\LiveA5NetSharedDB\) as "foreign folder" tables to the MaintDB
    In the A5 security frame work of the maintDB enable "use Windows Logon"
    make a matching Windows and A5 user account (AlphaMaintUser) so the A5 "use windows logon" feature automatically logs in the user
    add the MaintDB workspace to the Windows User account "startup" folder

    All I would need to do is make sure the AlphaMaintUser Windows user account is logged into after sever reboots (I am thinking I'll use PRTG to monitor the server to ensue the user is logged in and a5 is running under that account).

    From there it would be a matter of adapting the batch schedule_scripts() solution from the A5 documentation to run on the MaintDB after hours.

    Caveats/Roadblocks I am anticipating:
    I have read it is not recommended to run A5 runtime/full version on the server that is actively sharing the DB files but I assume this precaution only applies if other users are in DB at the same time. Is this correct?

    I will have to keep a watchful eye on my code when I reference tables, I may need to use fully qualified names in the MaintDB code.


    What do you guys think? Is there a simpler way? Are there security risks that raise red flags for you? Security is a concern for us since we have HIPPA/Hitech Act concerns with our data.

    Thanks!

    - Marco

    #2
    Re: Schedule Script on an Encrypted DB

    A simpler approach might be to create the MaintDB in the same workspace as your application. Add all the tables/sets/libraries etc to that database. Put all your maintenance activities into xbasic that is run from the autoexec of MaintDB or into a script that can be run from the app startup command line. Then use the Windows Task Scheduler to run that application nightly using the "Start a program" option.
    Finian

    Comment


      #3
      Re: Schedule Script on an Encrypted DB

      We do a significant amount of "maintenance" nightly against numerous production tables. We use the method that Finian has described. As the users are NOT signed into the system (Hopefully) at some odd hour of the pre-dawn morning, there is no issue with bumping into users and open tables.

      Tom

      Comment


        #4
        Re: Schedule Script on an Encrypted DB

        Thanks for the suggestions and replies. I'll give that a shot! Simpler is better!

        Ya, we should have no issues with users as we have scripts that kick users off after-hours. hmm. It might be prudent to write a powershell script to kill any open connections, just in case the alpha scripts fail or a users session is locked up and never releases the files.

        Comment


          #5
          Re: Schedule Script on an Encrypted DB

          This may not be practical in all situations but we restart the server at 1:30 am and run the maintenance at 2:00 AM. Consequently there is almost zero chance of a production table being in use during maintenance.
          Finian

          Comment


            #6
            Re: Schedule Script on an Encrypted DB

            I'm curious - how would you write a script to "kill any open connections"?

            ~ Tom

            Comment


              #7
              Re: Schedule Script on an Encrypted DB

              Let me check...

              I believe this should do the trick:

              Code:
              Openfiles /disconnect /ID *
              that would kill all open files.

              huh, I somehow expected it to be a little more involved than a single command. All the better!

              Comment


                #8
                Re: Schedule Script on an Encrypted DB

                Originally posted by mgallardo View Post
                Let me check...

                I believe this should do the trick:

                Code:
                Openfiles /disconnect /ID *
                that would kill all open files.

                huh, I somehow expected it to be a little more involved than a single command. All the better!
                You are referring to this?

                https://technet.microsoft.com/en-us/.../bb490961.aspx
                Al Buchholz
                Bookwood Systems, LTD
                Weekly QReportBuilder Webinars Thursday 1 pm CST

                Occam's Razor - KISS
                Normalize till it hurts - De-normalize till it works.
                Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                When we triage a problem it is much easier to read sample systems than to read a mind.
                "Make it as simple as possible, but not simpler."
                Albert Einstein

                http://www.iadn.com/images/media/iadn_member.png

                Comment


                  #9
                  Re: Schedule Script on an Encrypted DB

                  Indeed I am.

                  Thanks for clarifying! I forgot to mention it was a windows command.

                  Comment


                    #10
                    Re: Schedule Script on an Encrypted DB

                    Originally posted by mgallardo View Post
                    Indeed I am.

                    Thanks for clarifying! I forgot to mention it was a windows command.
                    Does this change with newer windows versions? ie win 10
                    Al Buchholz
                    Bookwood Systems, LTD
                    Weekly QReportBuilder Webinars Thursday 1 pm CST

                    Occam's Razor - KISS
                    Normalize till it hurts - De-normalize till it works.
                    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                    When we triage a problem it is much easier to read sample systems than to read a mind.
                    "Make it as simple as possible, but not simpler."
                    Albert Einstein

                    http://www.iadn.com/images/media/iadn_member.png

                    Comment


                      #11
                      Re: Schedule Script on an Encrypted DB

                      I have not tested the /disconnect argument and, until today, was largely unaware of it however I believe it should work fine in windows 10. I am currently on windows 10 and I have a few powershell scripts that use the openfiles command. I inherited a database that suffers from a set that constantly has one of its children locked up so I made some scripts to track down which users have a specified file open on the server(OS: Server 2008 R2). I run it from my local machine against the server using the /s argument.

                      As an example here is the script I mentioned. The code is a bit of a hack/sloppy (slapped it together really quick) and sometimes it errors out the first time I run it (not sure why. haven't had time to investigate) but subsequent executions are fine.

                      Code:
                      #powershell -executionpolicy bypass -file .\TableAccess_ByTable.ps1 TABLE
                      #TABLE optional - omit for all tables, separate multiple tables with a comma
                      Param([String[]]$tables
                      )
                      
                      if ($tables.count -eq 0){
                      $tables = @(".")
                      }
                      
                      $Reuslt = [B]openfiles.exe[/B] /query [B]/S SERVERNAME[/B] /fo CSV /v | 
                      foreach-object {if ($_ -match '","'){$_}} | 
                      convertFrom-csv |
                      where-object {$_."Open File (Path\executable)" -like "C:\PATH\TO\DATABASE\ON\SERVER\?*"} 
                      
                      Foreach ($table in $Tables){
                      
                      	$Reuslt | where-object {$_."Open File (Path\executable)" -match $table } |
                      	sort-object "Open File (Path\executable)","Accessed By"|
                      	format-table -auto -property "Accessed By","#Locks","Open Mode","Open File (Path\executable)" -groupby "Open File (Path\executable)"
                      
                      }

                      Comment


                        #12
                        Re: Schedule Script on an Encrypted DB

                        I keep meaning to dive into Powershell but keep not doing it. However, whatever I learned years ago about batch files is now running out of steam. So question, how do you call a Powershell script? Can it run from a cmd file?
                        Finian

                        Comment


                          #13
                          Re: Schedule Script on an Encrypted DB

                          I hear ya. I am trying to force myself to use .vbs / powershell over batch but sometimes batch script is so quick and easy.

                          What I usually do is to open up a powershell shell "as administrator" navigate to the script location using CD then launch the script with .\

                          e.g.

                          Code:
                          PS C:\scripts> .\script.ps1
                          You'll have to dive into some windows settings to be able to just double click on a .ps1 file for it to launch. Microsoft seems to have implemented lots of security measures presumably because of the damage powershell can dish out by either by accident or maliciously.

                          I was going to send you a link to the technet / scripting guy videos I used to learn some basics.. but it looks as if MS took them down :( videos are too old I'm guessing.

                          Comment

                          Working...
                          X