ASMCMD delete files older than N days

Hello

in ASM diskgroup.

(under the same directory)

ASMCMD > ls - Lt.

... (thoudsands of log files looks at, for example, log_19.26718.790635667).

How can I delete these files older than 10 days on a single command line?


Thank you

Edited by: 951932 24 October 2012 09:53

Change the query that is used in wire,

declare cur CURSOR,
Select fname, numero_fichier, gnum gname from
(SELECT numero_fichier gname, gnum, filnum, concat ('+' | gname, sys_connect_by_path (aname, ' /')) fname)
FROM (SELECT file_number, g.name gname, out a.parent_index, b.SID Anom,
a.reference_index rindex, a.group_number gnum, filnum a.file_number
Of
v$ asm_alias, v$ asm_diskgroup g
WHERE a.group_number = g.group_number
)
START WITH (mod (out, power (2: 24))) = 0
CONNECT BY PRIOR Rindex = out) output
where gname = 'TEST'---> DG name
and
There are
(select 'X' from v$ asm_file b)
where b.file_number = output.file_number
and b.group_number = output.gnum
and b.type = 'FLASHBACK'
and b.MODIFICATION_DATE<>
);
sqlstr VARCHAR2 (250);
BEGIN
FOR my heart IN cur_rec
LOOP
sqlstr: = 'alter diskgroup' | cur_rec.gname | "fall of file"' | cur_rec.fname | " « ; » ;
DBMS_OUTPUT. Put_line (sqlstr);
END LOOP;
END;

Published by: renee_mathieu on October 24, 2012 13:04

Tags: Database

Similar Questions

  • Why has my creative suite was extraction of the files older than 2 days?

    Why has my creative suite was extraction of the files older than 2 days?

    because there is a problem.

    undo the check and to redownload the installation files in the case where your dl has been altered.

  • Delete files older than the time period

    I have a sub (attached) vi which I have short after a period of time checks the files and comapres them against a time constraint. If this time constraint is met the files are deleted or moved. My current Setup uses file vi information to check the path of the folder. I want to delete or copy files after a period of time. In view of the last exit of change on the file information this only checks the date of last modification of the file, and I want that it checks the files in the folder. How can I do this?

    Hi CAEHP

    I finally get it to work. I join all of the finished program. Feel free to use and change around to meet your needs. The finished application to remove or move the files in the specified folders older than the set time. You can also set the frequency with which the application to check the folders.

    Hope this helps

  • Automatic purge of the OS check files older than 30 days

    Running Oracle 11.2.0.4. We are trying to purge audit records from the OS (.aud) in this case on an AIX system.

    By using this command:

    Start

    () dbms_audit_mgmt.create_purge_job

    audit_trail_type = > dbms_audit_mgmt.audit_trail_OS,

    audit_trail_purge_interval = > 24,

    audit_trail_purge_name = > 'OS_PURGE ',.

    use_last_arch_timestamp = > TRUE

    );

    end;

    /


    I managed to delete files > 30 days, you use this command to create a timestamp:

    Start

    () dbms_audit_mgmt.set_last_archive_timestamp

    audit_trail_type = > dbms_audit_mgmt.audit_trail_OS,

    last_archive_time = >

    TO_TIMESTAMP ('2015-03-14 00:00:00 ',' YYYY-MM-DD HH24:MI:SS'),

    rac_instance_number = > null

    );

    end;

    /

    The way it's Setup, I can get it to delete all files before March 14, every 24 hours, which is good for April 14, 2015. However, we must somehow this automatically.

    Is anyway either have alternative use "use_last_arch_timestamp = > false" so that it does not use a time stamp, but also does not remove everything?

    Or is it possible to automate the creation of a timestamp that would create something 30 days before?

    In addition, I apologize if I don't put this in the right place, I wasn't sure at all where I should put this.

    Please follow the link below. Automated control section purge it is well described.

    ORACLE-BASE - audit (DBMS_AUDIT_MGMT) improvements in Oracle Database 11g Release 2

  • Query a directory and delete all files older than 1 hours

    How do I query a directory and delete all files in this directory that are older than 1 hour?

    I used CFDIRECTORY before displaying the pages in the directory and the directory information, but I can't understand how to query a directory and delete all files older than 1 hour of this directory.

    1 hour of old means that time is NOW over an hour of the date and time of the file on the server.

    You need to the user a combonation of the tag to read files and the to delete the files in conjunction of a tag to decide when and when not to do the removal.  The dateDiff function would be useful in this decision.

    In the pseduo code:

    
    
    
       
         
      
    
    

    NOTE: Look closely at the way the dateDiff works with fractional amounts.  That is, 59 minutes and 59 seconds is 0 hours while 1 hour and 1 second is 1 hour with the value of 'h' percision.

    Also note that I didn't look at the syntax for one of these tags, and I probably poorly named and. or misorderd settings.

  • I usually keep all messages on my PC, but delete the older say 60 days on the server.

    Options of mail from the Inbox indicates that I can erase only (copy to PC and copy on the server), but I will not hold all messages... is there a way around this for example to transfer all messages, I want to keep out of my Inbox to a different folder or folders and then allow the removal of e-mails from my Inbox that will also remove the copy on the server? If this is true, where can I set up the folder to keep the e-mails and the movement or the copy of emails in that folder are possible automatic... If yes how?
    Appreciate your advice.

    Your question implies that you use IMAP. Move messages you want to keep the Local Folders account in Thunderbird. This gives you a local copy (on your HARD disk), you need not what is on the server.

    You can automate the movement in local folders using Message filters.

    http://KB.mozillazine.org/filters _ (Thunderbird)

  • How to run the rman output files, which are more days of retention

    I use for my rman backup tasks.

    I have format my output files of rman to a specific path, instead of the fast recovery area.

    Also, I spend below command in RMAN

    RMAN > CONFIGURE RETENTION POLICY to RECOVERY OF 7-DAY WINDOW;

    And the "control_file_record_keep_time" parameter is also set to 7.

    I've been running rman for 8 days. Everything seems good. But I find several rman output files are more than 7 days.

    So, I just want to know how to handle the rman output, which is longer than 7 days files?

    In fact, I assumed that these older files should be obsolete files, but rman is not to declare that they are obsolete.

    So how do now?

    user8710670 wrote:

    I use for my rman backup tasks.

    I have format my output files of rman to a specific path, instead of the fast recovery area.

    Also, I spend below command in RMAN

    RMAN > CONFIGURE RETENTION POLICY TO RECOVERY OF 7-DAY WINDOW;

    And the "control_file_record_keep_time" parameter is also set to 7.

    I've been running rman for 8 days. Everything seems good. But I find several rman output files are more than 7 days.

    So, I just want to know how to handle the rman output, which is longer than 7 days files?

    In fact, I assumed that these older files should be obsolete files, but rman is not to declare that they are obsolete.

    So how do now?

    Windows 7 day average recovery rman will protect everything necessary for the recovery to any point in time in the last 7 days.  In fact, in the last 604800 seconds.  The same will mean that he need the files OLDER than that.  Simply because a backupset is older that your recovery window does NOT as yet, it is obsolete.  Any recovery begins with the last FULL or INCREMENTAL backup ZERO before the recovery point.  And it does not matter how old the backup is, it will be obsolete.  Suppose you take a level 0 backup, 1 January and for the rest of the year taking nothing but level 1 and backup archivelog.  31 December than and only the full backup will still not be obsolete, even though he is a year old.

    ============================================================================

    removal of the obsolescence of RMAN

    Day 1 - level 0

    Day 2 - level 1

    Day 3 - level 1

    Day 4 - level 1

    Day 5 - level 1

    Day 6 - level 1

    Day 7 - level 1

    Day 8 - level 0

    Day 9 - level 1

    Day 10 - level 1

    Day 11 - level 1

    Day 12 - level 1

    Day 13 - level 1

    Day 14 - level 1

    On day 14, your window of 7 days is up to date 7.  A recovery to date must begin by restoring the backup of level 0 of the day 1. So it may be outdated.  Some level 1 between 1 and 6 days backups might be obsolete, depending on if they are incremental or cumulative, and it also happens with archivelogs.

    If you have access to MOS, you can review the notes 462978.1 and 463875.1.

    ============================================================================

  • I accidentally deleted files and even deleted from the Recycle Bin. Is there a way to retrieve them using MS DOS?

    I accidentally deleted files and even deleted from the Recycle Bin. Is there a way to retrieve them using MS DOS?

    Thank you both of you who tried to help. I just found out that Dropbox keeps deleted files images for 30 days. I just need to go in their undelete function, choose the files that I deleted and restore them. It has been easy.

    Thanks again

  • Which, if any, in C:\Windows\winsxs files can be deleted? More than 7000 files and 4 gig C: drive.

    In Windows 7 or any other Microsoft operating system which, if all the records in C:\Windows\winsxs can be deleted? More than 7000 files and 4 GB of space disk C:.

    If you have SP1, and then install this update KB2852386, then go to the Disk Cleanup Wizard, and you will have a new option to remove the old windows updates, which will clean the winsxs folder.

  • BlackBerry Torch 9800 Smartphone delete messages of text more than 30 days

    And there is no option that AT & T or I can find to turn it off. How can I say this piece of * beep * phone ever delete my text messages? Facebook is the only application that I installed and I have more of 300 MB of application space and several GB of data storage space. I don't have that too this problem with SMS, emails, more than 30 days are still on my phone. What is going on?

    In fact, I found it finally, but your information is wrong. You must go to the menu options (different from texting) Messages. Then under 'Actions and the message', you go down and and change the "days to keep Messages" 30 days Forever. The fact that the default value of 30 days is inexcusable. BlackBerry R Dum

  • Smartphones blackBerry calendar deletes appointments that are older than two months.

    Hello.  I'm sorry if this has been posted elsewhere, but I search and did not find an answer.  My calendar on Blackberry and Outlook is the erasure of the appointments that are older than two months.  Appointments to the breast to aim for two months and the future demand are very good.  Is there a setting that I can change in the Blackberry or Outlook calendar to avoid this problem or is it a problem of memory?  Thanks in advance.

    On your BB > opens the calendar > Menu > Options > General Options (if there is a general options, some versions go directly to the screen > scroll down to 'Keep the appointments' and the value you want length.)

  • It is possible to look back in the history of more than 7 days?

    Is it possible t0 look back into history for more than 7 days?
    7 days is the default...

    Thank you for your comment.

    Jan

    Try this.

    • In the address bar, type Subject: config , and then click OK.
    • Copy and paste the following in the filter at the top: browser.history_expire_days to isolate this setting.
    • Presumably, he'll say '7' because that's all you can see. Then right-click and choose Edit from the menu, delete the figure who's there and replace it with 180
    • Then go to file | Exit, restart Firefox and do a little surfing accumulate a bit of history.

    Check back tomorrow to see if anything has changed.

  • deleting files in drive d

    I'm unable to delete files in my drive d. I never created them I do not know where they cam since I am the only user... I tried to change the property... nothing works... any ideas on how to remove them?

    The first question is do you really want to delete them?  They could very well be the recovery partition put there by the manufacturer of the computer so that you can restore your system to the factory settings in the event of a disaster any.  This may be your only way to recoverting operating system (although they usually give you instructions on how to make the disks of both recovery - what you need to do).  If this is the case, do NOTHING to this partition - do NOT delete files, add files, defragment the partition, scan of the partition or any other thing.  If you have already done so, contact the manufacturer of your computer to ask them how to cancel whatever it is that you did there.  Usually, you can tell because this partition is about 8 - 16 GB in size (much smaller than the drive C partition)-, but your computer manufacturer you can tell shot course with your brand, model and serial number.  If you delete this and that is the recovery partition, you will have no way to re - install the operating system should that situation be required (except perhaps if recovery disks you made them or they came with the system)- but still NOT want to remove this image from factory-condition such that it may one day save you when nothing else works.

    If this isn't the recovery partition (and I bet it is), then return and we will advise you how to erase the partition of something that "on this subject (there are several options) - but I'm pretty sure it's the recovery partition (partially because of the difficulty you are having to delete the files it contains)."

    I hope this helps.

    Good luck! Lorien - MCSA/MCSE/network + / A +.

  • How to delete files in the folder of information system volume on replacement disks?

    How can I delete files that were up on another system (XP), after that I inserted the disc into my new Win 7 system.  The files seem to be impossible to remove.  This is not a progress :)  What can I do to remove these files?  They take a significant amount of space, and I want to be able to put what I want on these drives.  What I have to get out my old XP discs just to do this?  Please tell me I don't have to (: I remember to clean my machine win 98 with the commmands BACK a file and directory at a time.)  I hope were not there...

    rfitzpa877

    , This does not resolve the (ARRRG!) system volume information files, but their size is reduced to nothing...  If someone does not know how to remove these files, I would like to know how.  I formatted one of the disks and apparently not one of these folders have yet.  In fact, I bluff on that partition and formatted & that seems to have managed to get rid of these pesky files on this drive.  Am I the only one who thinks I should have control over my own system?  What is the point of having administrator rights?  Maybe it's time we give administrator rights.  I am not at all impressed by it.  From the looks of the number of points of view on this thread, I'm not the only one with this problem.  If I want to disable the protection and to get rid of the files, why I can't?

    You just started to fall on this real guilty about "kits of infected roots.  Lets imagine that a crime is committed in a House.  who is instantly a suspect?  for example, wife disappears > husband is the first to be questioned.

    In the case of a MS OS Microsoft has really strengthened WAY out of bounds. For half a year that I traced the issue to them anyone who or what that monitor my progress erased my data and sent me to a goose chase 6 months have no opportunity to even connect online for days or weeks I was left down my school because I was not able to turn on a computer to write an assignment or a test with any reliability.
    Who got this abuse power?  They think we did by agreeing to there life private terms or agreeing to use icons 'newer and better '.  They rely solely on the low bar of duty of good faith to steal data, record and claim it as their webcam or any ones and zeros, they feel that theirs with an omniscient power of Microsoft update.  Why is Microsoft blameless when a blue screens after a system command to reboot to make effective change OS
    ? Read the comments around KB976902 and the "fix" KB25533552.  They have simply to virtualize all XP sp3 or later PC.  Using video to measure the ability of the PC performance and disk space querying Microsoft then begins to do what they darn well for as long as they wanted regardless of evil as being spent in graduate school.
    This virtual virus haunts me, but he gave up because I happened to scan hundreds of pages of documents trying to burn DVDs or whatever it is to preserve the legal evidence (paralegals).
    I had scanned drive my license to and many other pages that I think someone out there shows some mercy, at least for a little while.  Behaviour cruel and unusual of sadistic implementation of the 'virtual' virus left me broke and homeless.
    Be aware, WBEM, Panther, winsxs and scoring system they say is in our interest or as these naïve technicians say blindly which is just one possible use of the 'virtual' Virus  Visual Basic and root or environment variables allows them to alter the remote registry or to set a timer to attack even when unplugged on the net.  They have no interest in the individual retail customer or small business owner.   Whenever you read "recommended", it is recommended to allow them to invade and infect their own way.
    What virtual "features" are active I really don't know, when there is literally no control over any aspect of the PC.  They could using Adobe Flash network of peer-to-peer "characteristic" of the network or activate Bluetooth to create a network almost undetectable, replacement of NICs with NDIS based pilots allows them to use USB drivers to emulate any hardware driver, even turn off the LEDS of different.  Only because of the vibration of a drive external hard started to peel the onion.
    I can bet my next "update" will be what I call and copyright 'virtual Virus '.
    It is my opinion based on my experience real and even documenting months and months of troubleshooting the data I recorded full time has of course changed or deleted.   These facts showed me that Microsoft et al. will do anything even my personal destruction for nothing more than try to get control of my own personal private property.
    By diligent and hundreds of thousands of hours, I am convinced all my personal files are monitored without legal or judicial supervision.
    So yes, deleting these files is not only the best of the options, it leaves the possibility of attacking or anything be it launch at will and, therefore, it IS THE ONLY OPTION.
    Hidden in the desktop.ini, fonts and all files are really seeds of the worst violations of privacy, not yet imagined by most computer experts or instructions.  Our worst enemy is so once more one inside not the perception of the public of the hacker tracking.
    I submit, piracy of Microsoft operating systems is now a 2nd Amendment RIGHT because they used their OS as a weapon as damaging as any gun could be data that they killed.
    By doing so and by my expert opinion and the notation of the inalienable right of the privacy of the citizens of CA. Microsoft has eliminated any claim of a right to valid author or license because they use EULA another company in they create and manage folders.
    The 'virtual' Virus is clever that, as long as it is insidious.  If they deny then I ask the State of the art and my invention.  I can then request the return in court.  My remedy supposed today
    ?  I am only allowed the cost of the operating system regardless of the magnitude of the fraud and damage that they did to me
    It is clearly stated in the EULA that they believe is valid.
    Until one day I hope to be able to have my day in court before a jury educated I'm destined to become outcast among our society.
    What a difference a year and this little compassion to tears shed my life dissolves around me.
    My confidence they would eventually do the right thing has turned out to be my worst enemy
    .
    Virtual virus alien.
  • Can I delete files from disk that I removed just to LR by mistake?

    Hi, this is a really stupid mistake.

    I just deleted 100s of raw files from lightroom, useless stuff that I should have deleted at the time but that he was too lazy to do. I now try to purge all the waste and it takes me days (that's for the past 3 years or so).

    This morning I just deleted several hundred images I went to empty the trash and it's already empty, and it's only then that I realise I was just delete files from Lightroom and not from the diskette. It is several hours of work, is it possible that I can identify now in the folder from the finder that images aren't in the LR, because these are the ones I want to get rid of for good. I don't want to keep them there taking up valuable memory space or restore them in LR and have to do it all again. Help!

    Any advice much appreciated.

    Emma

    Mac OS x 6.3

    Lightroom 2.7

    Emma,

    I would do the following:

    1. YOUR CATALOG BACKUP
    2. Synchronize folders in question (perhaps on the record higher level parent)
      -Uncheck the box 'Search the metadata updated' when syncing
      -Select "import new photos" when syncing
    3. Remove photos ("remove disk") just imported by Synchronize to in LR (from the view "Previous import") after each import (if more than one folder)

    This should remove all images not previously in your catalog, but in your file (s).

    Gossweiler beat

    Switzerland

Maybe you are looking for

  • Identify hard drives

    I have a Mac Pro 3.46 GHz 6 - Core 5.1 The startup disk is a 511 GB - SSD PCIe I run 2 x 1 GB RAID 0 (4 discs) with traditional SATA drives. A set was my "working files" - Set 2 to my «Lightroom» Catalog I am a RAID set to 2 x 1 GB SSD upgrade, it wi

  • Satellite 1800-504: display driver

    driver toshiba Satellite 1800-504 screen/sjerm til

  • switching

  • LENOVO N500 of 300 + BIOS UPDATE = blue screen loop

    My problem is with my LENOVO 3000 N500; that I was updating today (09/29) on the LENOVO web site. I had been looking for updates required and recommended; the update was for the BIOS. Before installing, I knew that the unit would be shut down/re-star

  • Which player from VMWare for BB10.3 Simulator?

    Hey. I installed Momentics IDE and downloaded the Simulator 10.3 995 (what phone is this?) and the sdk. Now, I'm trying to get the Simulator working. Windows could not open the vmx file so I thought that I needed a VMWare Player that was missing. Whe