1 2 Previous Next 16 Replies Latest reply: Sep 26, 2013 7:40 AM by yxes2013 RSS

    Purging archivelogs on Primary and Standby

    yxes2013

      Hi all,

       

      11.2.0.1

      Aix 6.1

       

      I am monitoring space usage in our FRA for both DG primary and standby. I want to purge all archivelogs once they have been applied to standby. What is the use of it anyway?

       

      I checked google and I found this procedure,  kindly correct if this is wrong?

       

      At Primary:

      =========

      RMAN

      {

      CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

      }

       

      At Standby:

      ========

      RMAN

      {

      CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;

      }



      Where do I issue the command DELETE NOPROMPT OBSOLETE ARCHIVELOGS?


      Thanks a lot,

      zxy

        • 1. Re: Purging archivelogs on Primary and Standby

          You are really a tiresome lazy sloth and the worst DBA on the globe.

          Did you read documentation?

          So why are you asking this question?

          Oracle maintains all archivelogs in the FRA automatically.

          And YES, this is documented,

          and NO, you always are abusing this forum by asking doc questions.

           

          -------------

          Sybrand Bakker

          Senior Oracle DBA'

          • 2. Re: Purging archivelogs on Primary and Standby
            yxes2013

            Which tool in oracle dear maintains the FRA/achivelogs? is it RMAN or Dataguard. If it maintains

            them  auto, why is that I still have lots of archivelog at PRIMARY and STANDBY?

             

            primary:oracle[/backup/flash_recovery_area/PROD/archivelog] ls -lt

            total 200

            drwxr-x---    2 oracle   oinstall       4096 Sep 25 15:59 2013_09_25

            drwxr-x---    2 oracle   oinstall       4096 Sep 24 22:51 2013_09_24

            drwxr-x---    2 oracle   oinstall       4096 Sep 23 22:03 2013_09_23

            drwxr-x---    2 oracle   oinstall       4096 Sep 22 23:02 2013_09_22

            drwxr-x---    2 oracle   oinstall       4096 Sep 21 21:25 2013_09_21

            drwxr-x---    2 oracle   oinstall       4096 Sep 20 22:05 2013_09_20

            drwxr-x---    2 oracle   oinstall       4096 Sep 19 23:00 2013_09_19

            drwxr-x---    2 oracle   oinstall       4096 Sep 18 22:03 2013_09_18

            drwxr-x---    2 oracle   oinstall       4096 Sep 17 22:53 2013_09_17

            drwxr-x---    2 oracle   oinstall       4096 Sep 16 23:00 2013_09_16

            drwxr-x---    2 oracle   oinstall       4096 Sep 15 23:01 2013_09_15

            drwxr-x---    2 oracle   oinstall       4096 Sep 15 02:45 2013_09_01

            drwxr-x---    2 oracle   oinstall       4096 Sep 14 20:32 2013_09_14

            drwxr-x---    2 oracle   oinstall       4096 Sep 13 23:29 2013_09_13

            drwxr-x---    2 oracle   oinstall       4096 Sep 12 22:02 2013_09_12

            drwxr-x---    2 oracle   oinstall       4096 Sep 11 23:43 2013_09_11

            drwxr-x---    2 oracle   oinstall       4096 Sep 10 22:27 2013_09_10

            drwxr-x---    2 oracle   oinstall       4096 Sep 09 23:10 2013_09_09

            drwxr-x---    2 oracle   oinstall       4096 Sep 08 23:00 2013_09_08

            drwxr-x---    2 oracle   oinstall       4096 Sep 07 23:30 2013_09_07

            drwxr-x---    2 oracle   oinstall       4096 Sep 06 23:11 2013_09_06

            drwxr-x---    2 oracle   oinstall       4096 Sep 05 22:02 2013_09_05

            drwxr-x---    2 oracle   oinstall       4096 Sep 04 23:45 2013_09_04

            drwxr-x---    2 oracle   oinstall       4096 Sep 03 22:09 2013_09_03

            drwxr-x---    2 oracle   oinstall       4096 Sep 02 22:33 2013_09_02

             

             

            standby:oracle[/backup/flash_recovery_area/PRODDR/archivelog] ls -lt

            total 296

            drwxr-x---    2 oracle   oinstall       4096 Sep 25 15:59 2013_09_25

            drwxr-x---    2 oracle   oinstall       4096 Sep 24 23:24 2013_09_24

            drwxr-x---    2 oracle   oinstall       4096 Sep 23 22:13 2013_09_23

            drwxr-x---    2 oracle   oinstall       4096 Sep 22 23:02 2013_09_22

            drwxr-x---    2 oracle   oinstall       4096 Sep 21 21:39 2013_09_21

            drwxr-x---    2 oracle   oinstall       4096 Sep 20 22:08 2013_09_20

            drwxr-x---    2 oracle   oinstall       4096 Sep 19 23:01 2013_09_19

            drwxr-x---    2 oracle   oinstall       4096 Sep 18 22:23 2013_09_18

            drwxr-x---    2 oracle   oinstall       4096 Sep 17 22:53 2013_09_17

            drwxr-x---    2 oracle   oinstall       8192 Sep 16 23:01 2013_09_16

            drwxr-x---    2 oracle   oinstall       8192 Sep 16 00:46 2013_09_15

            drwxr-x---    2 oracle   oinstall       4096 Sep 15 01:34 2013_09_14

            drwxr-x---    2 oracle   oinstall       4096 Sep 14 01:03 2013_09_13

            drwxr-x---    2 oracle   oinstall       4096 Sep 13 01:48 2013_09_12

            drwxr-x---    2 oracle   oinstall       4096 Sep 12 03:29 2013_09_11

            drwxr-x---    2 oracle   oinstall       4096 Sep 11 01:19 2013_09_10

            drwxr-x---    2 oracle   oinstall       4096 Sep 10 01:54 2013_09_09

            drwxr-x---    2 oracle   oinstall       4096 Sep 09 01:44 2013_09_08

            drwxr-x---    2 oracle   oinstall       4096 Sep 08 01:59 2013_09_07

            drwxr-x---    2 oracle   oinstall       4096 Sep 07 03:30 2013_09_06

            drwxr-x---    2 oracle   oinstall       4096 Sep 06 02:05 2013_09_05

            drwxr-x---    2 oracle   oinstall       4096 Sep 05 03:40 2013_09_04

            drwxr-x---    2 oracle   oinstall       4096 Sep 04 01:48 2013_09_03

            drwxr-x---    2 oracle   oinstall       4096 Sep 03 01:22 2013_09_02

            drwxr-x---    2 oracle   oinstall       4096 Sep 02 02:31 2013_09_01

            drwxr-x---    2 oracle   oinstall       4096 Sep 01 00:08 2013_08_31

            drwxr-x---    2 oracle   oinstall       4096 Aug 31 03:18 2013_08_30

            drwxr-x---    2 oracle   oinstall       4096 Aug 30 00:28 2013_08_29

            drwxr-x---    2 oracle   oinstall       4096 Aug 29 03:51 2013_08_28

            drwxr-x---    2 oracle   oinstall       4096 Aug 28 02:34 2013_08_27

            drwxr-x---    2 oracle   oinstall        256 Aug 26 00:24 2013_08_26

            drwxr-x---    2 oracle   oinstall        256 Aug 25 00:24 2013_08_25

            drwxr-x---    2 oracle   oinstall        256 Aug 24 00:24 2013_08_24

            drwxr-x---    2 oracle   oinstall        256 Aug 23 00:21 2013_08_23

            drwxr-x---    2 oracle   oinstall        256 Aug 22 00:00 2013_08_22

            drwxr-x---    2 oracle   oinstall        256 Aug 21 00:20 2013_08_21

            drwxr-x---    2 oracle   oinstall        256 Aug 20 00:17 2013_08_20

            drwxr-x---    2 oracle   oinstall        256 Aug 19 00:16 2013_08_19

            drwxr-x---    2 oracle   oinstall        256 Aug 18 00:17 2013_08_18

            drwxr-x---    2 oracle   oinstall        256 Aug 17 00:14 2013_08_17

            drwxr-x---    2 oracle   oinstall        256 Aug 16 00:13 2013_08_16

            drwxr-x---    2 oracle   oinstall        256 Aug 15 00:12 2013_08_15

            drwxr-x---    2 oracle   oinstall       4096 Aug 14 10:53 2013_08_14

            drwxr-x---    2 oracle   oinstall       4096 Aug 13 23:34 2013_08_13

            drwxr-x---    2 oracle   oinstall       4096 Aug 12 23:10 2013_08_12

            drwxr-x---    2 oracle   oinstall       4096 Aug 11 21:25 2013_08_11

            drwxr-x---    2 oracle   oinstall       4096 Aug 10 22:44 2013_08_10

             

             

            All of the above dates have been applied already. Thanks.

            • 3. Re: Purging archivelogs on Primary and Standby
              yxes2013

              John Watson said:

              If you run

              delete archive log all;

              on the standby, that should delete all the applied logs. Otherwise, I think you'll have to wait until the FRA is full before any automatic deletion kicks in. But I think your recovery window will distort things, better get rid of it.


              Is there a danger for this command? If I delete all? Can I run this on primary too?


              Thanks

              • 4. Re: Purging archivelogs on Primary and Standby
                yxes2013

                Beefstu said:

                 

                If you want the archive logs deleted sooner, you would need to use rman to delete archive logs.

                 

                In this example archive logs would be deleted after they are 7 days old:

                delete archivelog until time 'trunc(sysdate-7)';

                • 5. Re: Purging archivelogs on Primary and Standby
                  JohnWatson

                  Assuming that you are not a lazy sloth, you will have no problem looking up the interactions of DELETE ARCHIVELOG, ARCHIVELOG DELETION POLICY, and FORCE in the Backup And Recovery Reference. Alternatively, you could attend a course on RMAN and/or Data Guard. Oracle Uni has pretty good ones, or there are partner offerings such as

                  Oracle 11g Data Guard Administration Workshop: Hands-On Training | SkillBuilders.com/Oracle

                  Oracle Backup and Recovery with Oracle 11g RMAN Hands-On Training | SkillBuilders.com/Oracle

                  • 6. Re: Purging archivelogs on Primary and Standby
                    yxes2013

                    Docs are very confusing, and im poor in reading comprehension .I am afraid that my brain interprets the otherway around. That is why is am confirming it here if what I understand is correct.

                    • 7. Re: Purging archivelogs on Primary and Standby
                      Richard Harrison .

                      Hi,

                      Your original question is the correct setup.

                       

                      When it is configured like that oracle takes care of the deletion itself based on the standard FRA rules (can't remember the exact percentages when it starts to delete things). These can;t be changed and if you do want to delete the files manually you need to use the rman command already provided.

                       

                      The reason it doesn;t just get rid of the files is that they could in theory be useful - particularly if you have flashback enabled on the standby - you could flashback your standby to use for some other purpose for example

                       

                      Regards,

                      Harry

                      • 8. Re: Purging archivelogs on Primary and Standby
                        yxes2013

                        Thanks Richard for the enlightenment

                        Can you  confirmed this please?

                         

                        ***Delete archivelog all> can be run on both Primary and Standby. It will not delete the archivelogs which are not yet applied on standby.

                         

                         

                        Thanks

                        • 9. Re: Purging archivelogs on Primary and Standby
                          Richard Harrison .

                          Hi,

                          According to the docs that is correct yes:

                           

                          http://docs.oracle.com/cd/B28359_01/backup.111/b28273/rcmsynta010.htm#CHDHCEEH

                           

                          delete archivelog all; will delete archivelogs from the FRA that are no longer needed (this would happen automatically when the used % of FRA was more than a certain size)

                          delete force archivelog all; will just delete everything regardless of any policies in place

                           

                          Personally i would do a test this actually behaves as documented... :-)

                           

                          Regards,

                          Harry

                          • 10. Re: Purging archivelogs on Primary and Standby
                            yxes2013

                            Thanks Rich

                             

                            So again to be clear > delete force archivelog all; will just delete everything regardless of any policies in place

                             

                            This means it would not delete archivelogs which are not yet applied yet to the Standby DB?

                            • 11. Re: Purging archivelogs on Primary and Standby
                              Richard Harrison .

                              Hi,

                              delete force archivelog all; just delete everything it finds regardless of if it is needed or not. It will delete files that haven;t been backed up and will also delete files not shipped/applied to the standby.

                               

                              Cheers,

                              harry

                              • 12. Re: Purging archivelogs on Primary and Standby
                                yxes2013

                                I thanks you all,

                                 

                                JUST A REMINDER FOLKS. In DATAGUARD, my impression of shipping of archivelogs from PRIMARY to STANDBY is wrong.

                                I am thinking all the while that the PRIMARY db sends/shipped its FRA/archivelogs (ftp) to PRIMARY db FRA/archivelogs. No its not. I creates another copy at database level and writes  it to standby FRA remotely using dblink.

                                • 13. Re: Purging archivelogs on Primary and Standby
                                  JohnWatson

                                  yxes2013 wrote:

                                   

                                  I thanks you all,

                                   

                                  JUST A REMINDER FOLKS. In DATAGUARD, my impression of shipping of archivelogs from PRIMARY to STANDBY is wrong.

                                  I am thinking all the while that the PRIMARY db sends/shipped its FRA/archivelogs (ftp) to PRIMARY db FRA/archivelogs. No its not. I creates another copy at database level and writes  it to standby FRA remotely using dblink.

                                  "using dbink". Oh dear.

                                  • 14. Re: Purging archivelogs on Primary and Standby
                                    yxes2013

                                    I mean something the likes of dblinks, utl_file, etc ....as opposite to OS ftp.

                                    Do you think also that if you deleted archivelogs at standby and you ftp manually the archivelog at Primary, you will see that they are a different file name.

                                    1 2 Previous Next