"A script that will delete perfstat snapshots older than 90 days with SPPURGE..."

Hello to all my fine Oracle related friends...We are all one large extended Family...
I want to create a script that will execute SPPURGE on Perfstat for snapshots that are older than 90 days.
Now, I have Grid 12c Cloud Control up and running for all the Databases that we have...
Should I use Grid 12c to execute the SPPURGE and just pass the parameters in like that?
Or should I go "Old School" and make a Shell Script and schedule it in the crontab?
What would you guys do?
I want implement this for 41 "Standard Edition" Databases....some are "Data Guard".....
Thanks,
Xevv.

Xevv Bellringer wrote:
Hi Ed,
I tried executing this manually and it's not deleting the snapshots at all.
begin
statspack.purge(trunc(sysdate-90),true);
end;
I even let it for an entire day and then altered the code like this...But when I execute it, it doesn't deleted the data..
begin
statspack.purge(trunc(sysdate-1),true);
end;
When I do a select sysdate -1 from dual; it gives the correct date?
Could there be a "NLS Setting" some where causing this?
How do you determine that it is not deleteding data?  (please show evidence)
How, and how often, are you collecting a statspack snapshot?  (please show evidence)

Similar Messages

  • Will the backup metadata older than 10 days be deleted automatically?

    If the CONTROL_FILE_RECORD_KEEP_TIME parameter is set to 10, will the backup metadata older than 10 days be deleted automatically?----No.151

    http://download-east.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmarchi003.htm#sthref58

  • Powershell Command to permanently delete items in ALL users Deleted Items folder older than X days.

    Does anyone know a powershell command that can be run on Exchange 2010 SP1 that will permanently delete mail in the deleted items folder older than X days for ALL users in a specific database? This should include any user created subfolders in deleted items
    also.
    I know that seems bizarre to have user created subfolders in deleted items but we have found that users have discovered that if they create subfolders then their deleted items dont get purged at the regular retention period time.
    Thank You.

    Hi,
    For Exchange 2010 SP1, we can use search-mailbox and new-mailboxexportrequest to delete message in certain folder.
    Understanding Exchange Search
    http://technet.microsoft.com/en-us/library/bb232132.aspx
    Xiu Zhang
    TechNet Community Support

  • ICM 7.5.9 deletes DD records older than 15 days

    Hi guys,
    I have a strange thing happening with our ICM 7.5.9 installation...
    The Dialer Detail table for the Outbound Option deletes the records older than 15 days...
    I checked the purge jobs and they all reference registry keys which have a value of 1000 + days...
    This only happens with the DD table... all the other historical tables retain the data as set in the reg keys...
    I have no clue where to start troubleshooting this... anyhelp is wellcome.

    Below is the link to check the logs if the purge cycle on HDS was successful.
    http://www.cisco.com/en/US/products/sw/custcosw/ps1001/products_qanda_item09186a008020f1e2.shtmlSo turn on the EMSTraceMask to ffff for rpl process on the AW and check the logs around mid night it should give you some clue.
    Use the ICMDBA to check the size of your hds db if it is 80%+ full it will start purging
    the tables.
    eg trace would look like,
    09:52:39 dis-rpl Trace: 80% of the available free space is used in
    XX_hds database.
    09:56:39 dis-rpl Trace: 80% of the available free space is used in
    XX_hds database.
    If you see similar messages expand the HDS db using the below link
    http://www.cisco.com/en/US/products/sw/custcosw/ps1001/products_tech_note09186a0080094927.shtml
    Hope this helps.
    Shirish

  • Need a script for archive/copy IMAP Emails older than 25 days to local mailbox

    Hi there,
    I am really troubling with archiving my IMAP mails. So far I was using standard rules, which have a major drawback - they only work on incoming mails. But I want to copy only mails to my local mailbox that are older than 25 days. The reason is that by copying all incoming mails, mail also copies all spam and unimportant mails into the local mailbox. However I only want to copy the mails that I was able to read and consider to be important, which I am able to do within a couple of days. However, I am not able to to that on a daily basis and that is why I chose the 25 days window, because my hoster deletes them automatically after 30 days. I read in a lot of forums that rules wont help, since they only work for incoming mails, therefore I am guessing that I would need a script because I want this to be automated and only applied to mails that passed the 25 day timeframe. Is the anybody that could help me out? Thank you so much in advance.

    Hi adayzdone,
    thanks for your reply but I am not a Gmail user, I am using Strato. Therefore the handy Google Scripts won't help.
    I need a script in Apple, that only copies or moves the mail from my inbox to a local mailbox once they are past the 25 days line. Within those 25 day I have deleted all unnessecary mails, marks or higlighted the important once and know only the remaining once are worth keeping. But I still want them to be available in Mail and none of those archiving solutions that create pdfs or import them into their one database will help.

  • Automatically Delete Calendar Events Older Than a Day old.

    I am trying to have SharePoint automatically delete any events that are a day old.  I have a vacation calendar that needs to remove any older dates and only keep up to date with the new ones.  I have tried to search for the solution and cant
    find anything.  I don't want to filter the events it needs to be removed.

    function Calendarcleanup() 
    #Get Site
    $Web=Get-SPWeb  "Site url" 
    Write-Host $Web.url 
    #Get the Target Calendar List
    $list = $web.Lists["XXXX"] 
    Write-host $list.title 
    #Query the list items based on your requirement
    $query=new-object Microsoft.SharePoint.SPQuery 
    $query.Query='<Where>
    <Lt>
         <FieldRef Name="Created"/><Value Type="DateTime">Today</Value>
    </Lt>
    </Where>' 
    $query.RowLimit = $list.Itemcount 
    #Get the itemcollection for processing
    $Items=$list.GetItems($query) 
    Write-Host $Items.count 
    #Loop through the items and delete them
    foreach($item in $Items) 
    Write-Host "Deleting" $item.Title 
    #Deleting items
    $list.GetItemById($item.ID).Delete() 
    Write-Host "Deleted" $item.Title 
    Calendarcleanup

  • I am trying to transfer files from my PowerBook G4 (OSX 10.4.11) to my new iMac (Mountain Lion).  Migration assistant tells me I need to upgrade migration assistant on the G4, but I can't find a download that will work for anything older than OSX 10.5.

    Yes, my PowerBook G4 is still trucking along.  It is running OSX 10.4.11, but I just bought a new iMac that is running Mountain Lion.  I just tried to use Migration Assistant.  It told me to update Migration Assistant on the G4, but I can't find an update for anything earlier than 10.5.  Is there a way to get my files transfered, or am I going to need to update the OS on my computer I was getting ready to retire?
    Thanks!

    You never know, someone might remember. What happens in detail when you try to use it, and HOW are you trying to use it?

  • I need a script that will find the computer a user last logged into.

    I am still learning scripting, I need a script that will allow me to pull in usernames from a csv file. Find what computer they last logged into and output that to an csv file.
    I have looked all over and can't find exactly what I need.
     I found the following script but I need  to add the resuitsize unlimited but can not figure out where to put it we have a large environment. Also I need to be able to grab username from a csv file. Any assistance you can provide is appreciated.
    ##  Find out what computers a user is logged into on your domain by running the script
    ##  and entering in the requested logon id for the user.
    ##  This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ##  snapin  http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null){
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username}
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null){
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username}
    get-username resultsize unlimited
    $computers = Get-QADComputer | where {$_.accountisdisabled -eq $false}
    foreach ($comp in $computers)
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
      $Reply = $null
      $Reply = $ping.send($Computer)
      if($Reply.status -like 'Success'){
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username){
    write-host "$Username is logged on $Computer"

    If you are querying by user "resultset size" will be of no use.
    You also have functions that are never used and the body code doe snot look for users.
    Here is what you scrip looks like if printed well.  It is just a jumble of pasted together and unrelated items.
    ## Find out what computers a user is logged into on your domain by running the script
    ## and entering in the requested logon id for the user.
    ## This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ## snapin http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null) {
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null) {
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username
    get-username resultsize unlimited
    $computers = Get-QADComputer | where { $_.accountisdisabled -eq $false }
    foreach ($comp in $computers) {
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
    $Reply = $null
    $Reply = $ping.send($Computer)
    if ($Reply.status -like 'Success') {
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username) {
    write-host "$Username is logged on $Computer"
    I suggest finding the original code then use the learning link at the top of this page to help you understand how it works in Powershell.
    ¯\_(ツ)_/¯

  • I am looking to find out if it is possible in Adobe Muse to have a section on a webpage that will update every 30 seconds or 30 minutes with a snapshot URL From a live webcam stream

    I am looking to find out if it is possible in Adobe Muse to have a section on a webpage that will update every 30 seconds or 30 minutes with a snapshot URL From a live webcam stream

    You can do this via insert HTML , you would need to use the live feed code in Muse page.
    Thanks,
    Sanjit

  • IDCS6(MAC) 10.9.4 - a script that will make an anchored object and paste in clipboard contents

    I'm trying to create a script that will create an anchored object that will paste in clipboard contents.
    So far I have:
    var frameRef = app.selection[0];
        var parentObj = frameRef.insertionPoints.item(0);
        var anchorFrame = parentObj.rectangles.add();
    And this works fine, creating an inline object, that can further be defined (with anchor point settings etc).
    However, it is when I go to use app.paste() or app.pasteInto() that all hell breaks loose.
    The line of code I added was:
    anchorFrame.content = app.pasteInto();
    and the error I get is:
    What am I doing incorrectly?
    Colin

    @Colin – For the paste command you like to use, you have to:
    1. First select an object, in your case the added rectangle object
    2. Then use the pasteInto() method from the app object
    3. There is no content property for a rectangle object
    Watch out what is selected after you added the rectangle.
    What you have is a selection of the text frame when you start your code in line one.
    Adding a rectangle will not change that selection.
    The following code will do the job.
    However, if you use pasteInto() the pasted objects could be only partly visible inside the frame.
    Depends on the size and position of the added rectangle relative to the original copied page items.
    Make sure that you give the rectangle a proper size after or while you are adding it:
    var frameRef = app.selection[0];
    var parentObj = frameRef.insertionPoints.item(0);
    //Will add a rectangle sized 40 x 40 mm
    var anchorFrame = parentObj.rectangles.add({geometricBounds:[0,0,"40mm","40mm"]});
    app.select(null); //Optional
    app.select(anchorFrame);
    app.pasteInto();
    Uwe

  • Had to remove itunes from my computer to reset the computer. Now I'm having problems syncing my iphone with the computer. Computer is saying it wants to download updates to the phone but that will delete things I downloaded straight from the phone. Help!

    Had to remove itunes from my computer to reset the computer. Now I'm having problems syncing my iphone with the computer. Computer is saying it wants to download updates to the phone but that will delete things I downloaded straight from the phone. Help!

    iTunes thinks you have a new computer because you restored the OS. Open iTunes and authorize it to the same account you have on the iPhone. Did you restore your iTunes content from a backup after resetting your computer? Have you been syncing regularly with the computer, and does the iTunes library on the computer contain your apps, music and videos? If so just sync and your content will be removed then restored.
    If you have not hopefully you have now learned something. You can recover apps and purchased songs by connecting the phone, without syncing, and choose "Transfer purchases..." from the File menu.

  • Script that will help validate if there is any data loss after a DB restore

    Hi,
    I need to write a single script that will perform the following
    operations:
    1)return me the highy accessed tables across all databases.
    2)List the count, Min and Max system date of the highy accessed tables returned from step 1.
    The idea is to validate if there is any data loss to the highly transactional tables after a database restore operation has been performed.
    Thanks.

    Hello,
    I would also like you to see nice blog by Aron,you can modify the script a bit to change according to your need
    http://sqlblog.com/blogs/aaron_bertrand/archive/2008/05/06/when-was-my-database-table-last-accessed.aspx
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    Hello Shanky,
    The post would not be helpful too much for OP's requirement. The post was talking about when was the database last accessed. DMLs are not capturing in the script and also there will be many variant forms that can be applied for DML. Hence, I do not think,
    the script would help too much. 
    Or Am I missing something? 
    Latheesh as i mentioed OP has to modify the script little bit may be add User_seek,user_update,user_scans.Still IMO there is no *perfect* way to actually analyze this.So I pointed out point in my original post.Also unless he has some timestamp he cannot
    see min time when it was accessed ,max time can be taken from last user seek,scan,lookup time. Motive was to lethim know what he was trying to achieve cannot be axactly obtained by using sys.dm_index_usage_stats.Below query will give most accessed table
    : Source (Query)
    SELECT
    t.name AS 'Table',
    SUM(i.user_seeks + i.user_scans + i.user_lookups)
    AS 'Total accesses',
    SUM(i.user_seeks) AS 'Seeks',
    SUM(i.user_scans) AS 'Scans',
    SUM(i.user_lookups) AS 'Lookups'
    FROM
    sys.dm_db_index_usage_stats i RIGHT OUTER JOIN
    sys.tables t ON (t.object_id = i.object_id)
    GROUP BY
    i.object_id,
    t.name
    ORDER BY [Total accesses] DESC
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Simple script that will export the coordinates (layer bounds - top left x,y)

    Hi,
    I'm looking for a simple script that will export the coordinates (layer bounds - top left x,y) of the layers to an seperate xml/txt file.

    Your screen capture looks like it's from Photoshop.
    In InDesign sub layers are page items, the containing layer has no dimension. So you could get all the page item's x, y, width, height. But you might have to consider groups and then the layering could be very complex. The stacking order could also get complex. Page items have an index, but it's relative to its parent container.

  • Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Frank and All,
    The following answer to your question above is complicated, but I hope it explains why my question was formed with so much frustration in it.
    I have an OpenOffice(OO) Macro that was launched with Calendar at 6pm each business night. It ran properly in all Apples operating systems until I Hit Maverick(OSX10.9). From then on, the AppleScript would run from one to 3 days, then would disappear from the Calendar entry. The Calendar alert would still run, but the "OpenFile" section of the alert would disappear. I also was running elgato EyeTV HD during the day, so I would use energy saver to put my MacBook Pro to sleep at 12 Midnight and wake it again at 9am. I picked up a used Mac Mini to do the EyeTV stuff, provide AppleTV the files in H264 format through iTunes' media share, and found it had plenty of power to do the 6pm automated stuff simultaneously as well. Because I still wanted to run the OpenOffice Macro on my MacBook Pro at 6pm, and wanted to use it for a host of other things when I was on the road, I wanted it to sleep most of the time and only wake up automatically to run the 6pm OO Macro. When I called Apple about the issue I was having with Maverick and Calendar loosing the OpenFile command as part of the Alert Message, they told me the no longer supported answering AppleScript Questions but they now would support Automator questions. I pointed out that the OpenFile would also fail after one to three days if I used a Calendar Alert to launch an Automator App. At first, I did not like Automator, but now I see why Apple is pushing us to use it. Automator adds a TIME STAMP ID to the Apps developed in Automator so the first time you launch the App after a change to it, you must reply to a dialog message saying that this is the first time you are running this version of the App. If a Scammer has replaced your app with one that can reek havoc on your computer, the replacement app will not run unless you are there to agree that you know where the modified app came from and click the OK button to continue (BRILLIANT, Enhanced Security idea on Apples part). I also noticed that after Mountain Lion, the Applescript delay timing was all screwed up as well. Well I tried to use LaunchD Task Scheduler to circumvent the Calendar Problem and that worked until I upgraded to Yosemite Last week. Then LaunchD no longer worked and I am only into a few days of using The Calendar Launched Automator App to see if it will continue to run.
    But I think I solved the dilemma I was having with opening an Automator App in a Sleeping Mac. I Googled up the following question, "AppleScript to wake up computer".  I went thru several complex responses until I found this on that is INCREDIBLE EASEY! What came back was a brettterpstra.com  response from Feb 20th,2014. What it said, in a Quick Tip: caffeinated your Terminal Article,  if you wanted to wake a Mac from sleep, use the Terminal command named "Caffeine -u -t 1". I placed it in an Automator Most Used Action called "Run Shell Script -- Caffeine -u -t 1" and it worked!  Now, I can put my Mac to Sleep but at 6pm, the Automator App will launch, run the "Caffeine -u- -t 1" command and proceed to work as if I had awakened the Mac From Sleep mode by pressing a keyboard key and had run the Automator Script with a double click.
    Sorry for the long, drawn-out reply, but maybe this will help others.

  • How can I set up a rule to delete all messages older than 6 months left in Apple Mail's main inbox?

    How can I set up a rule to delete all messages older than 6 months left in Apple Mail's main inbox?
    I have created other rules to move some of my daily messages into specific folders and I don't wish to auto-delete those.
    Just the general stuff that keeps piling up in my me.com main email box.  Mail such as FB announcements and other low priority stuff I want to look at before deleting but don't want to keep longer than a week or month.
    TIA
    thokitts

    Thanks, but I am looking for a more automated solution than hand marking emails as junk. I might as well move them to the trash myself.
    Again, these are emails I want to receive and quickly read, but not keep longer than a week or month or so. By setting a rule to toss any older than 30 days back then my Mail program (and thus my hard drive) won't be wasting so much space. For example, currently I have over 6000 read messages, with their attachments, in my main email box. I'd rather not have to physically attend to sorting the one I don't want out.
    The one I do keep for other reasons get moved into other folders.
    It seems this should be possible.
    thokitts

Maybe you are looking for