Log files can't be removed automatically in HA environment

Hi BDB experts,
I am writing db HA application based on bdb version 4.6.21. Two daemons run on two machines, one as master which will read/write db, one as client/backup will only read db. There is one thread in master daemon that run checkpoint every 1 second: dbenv->txn_checkpoint(dbenv, 1, 1, 0), and dbenv->log_archive(dbenv, NULL, DB_ARCH_REMOVE) will be called after runnng checkpoint each time. The env was open with flag: DB_CREATE | DB_INIT_TXN |  DB_INIT_LOCK | DB_INIT_LOG | DB_REGISTER | DB_RECOVER | DB_INIT_MPOOL | DB_THREAD  | DB_INIT_REP;   Autoremove flag was set by: envp->set_flags(uid_dbs.envp, DB_LOG_AUTOREMOVE, 1) before open env.
I found this thread https://forums.oracle.com/message/10945602#10945602 which discussed about non-ha environment, and I tested my code in a non-ha env without DB_INIT_REP, it worked. However in HA env those log files were never removed. Could you help on this issue? Does the client need to run checkpoint? May there be a bdb bug?
Thanks,
Min

There is one thread in master daemon that run checkpoint every 1 second: dbenv->txn_checkpoint(dbenv, 1, 1, 0), and dbenv->log_archive(dbenv, NULL, DB_ARCH_REMOVE) will be called after runnng checkpoint each time. The env was open with flag: DB_CREATE | DB_INIT_TXN |  DB_INIT_LOCK | DB_INIT_LOG | DB_REGISTER | DB_RECOVER | DB_INIT_MPOOL | DB_THREAD  | DB_INIT_REP;   Autoremove flag was set by: envp->set_flags(uid_dbs.envp, DB_LOG_AUTOREMOVE, 1) before open env.
I am not saying that this is causing a problem, but doing the DB_ENV->log_archive(DB_ARCH_REMOVE) in your thread and setting DB_ENV->set_flags(DB_LOG_AUTOREMOVE) is redundant. In your thread, you control the timing. The DB_ENV->set_flags(DB_LOG_AUTOREMOVE) option checks for and removes unneeded log files when we create a new log file.
Did you see in the documentation for DB_ENV->set_flags(DB_LOG_AUTOREMOVE) that we don't recommend doing automatic log file removal with replication? Although this warning is not repeated in DB_ENV->log_archive(DB_ARCH_REMOVE), it also applies to this option. You should reconsider using this option, particularly if it is possible that your client could go down for a long time.
But this is only a warning and automatic log removal should work. My first thought here is to ask whether your client has recently gone through a sync? Internally, we block archiving on the master during some parts of a client sync to improve the chances that we will keep around all logs needed by the syncing client. We block archiving for up to 30 seconds after the client sync.
I found this thread https://forums.oracle.com/message/10945602#10945602 which discussed about non-ha environment, and I tested my code in a non-ha env without DB_INIT_REP, it worked. However in HA env those log files were never removed.
This thread is discussing a different issue. The reason for our warning in BDB 4.6 against using automatic log removal with replication is that it doesn't take into account all the sites in your replication group, so we could remove a log from the master that a client still needs.
We added replication group-aware automatic log removal in BDB 5.3 Replication Manager, and this discussion is about a change of behavior from this addition. With this addition, we no longer need to recommend against using automatic log removal with replication in BDB 5.3 and later releases.
Could you help on this issue? Does the client need to run checkpoint? May there be a bdb bug?
I'm not sure the client needs to run its own checkpoints because it performs checkpoints when it receives checkpoint log records from the master.
But none of the log removal options on the master does anything to remove logs on the client. You will need to perform steps to archive logs separately on the client and the master.
Paula Bingham
Oracle

Similar Messages

  • What log files can delete in RAC?

    Hi,
    I have a little question, what log files can delete?
    $ORA_CRS_HOME/log/hostname/client ?
    And what others?
    Miguel

    Some logs are automatically purged and some not: see http://download.oracle.com/docs/cd/B19306_01/rac.102/b14197/appsupport.htm#BEHJHGJD.
    Trace files (.trc) that can be created in same directories are not purged automatically.

  • Log files can be applied after an offline backup is restored?

    When reading the Admin Guide I see above possibility.
    I guess in that case the offline backup must be done in the Database Maintenance Mode: QUIESCE.
    I think if the offline backup is done after the DB is shutdown, no log files can be applied.
    Would you please confirm and share your experience on this?
    Thanks a lot!

    Hi Jennifer,
    only to complete the answer of Jens, or "say" it less complex:
    1.) Yes you could roll forward an offline backup. DB2 always end in rollforward pending state after a restore independent of the backup type (online | offline). In case of an offline backup you could complete the restore without logs, otherwise not.
    2.) The offline backup is done in a special mode, it is neither online nor quiesced. Nobody can log on to the database as long the offline backup is running. To start the offline backup, you have to deactivate the database as described by Jens.
    Best regards
    Ralph

  • The comment block in the XML file, can it be removed?

    Hello together,
    Ive created a form to be submitted via email and it all works great.
    In the XML file that is created, there is a huge comment block (from adobe) and I was wondering how I can go about removing it? Or better, how I can edit it.
    Any input on this is greatly appreciated.
    All the best,
    Kevin

    Anybody?

  • Java icon is on all PDF files, can you help remove it?

    Hi From Jomar1952. I cant open PDF files anymore Java is on all PDF files.      Action taken: Remove Java files, which now open with A/Reader Java Icon is off  all files now. Files open without "open with" actions. thank you

    This forum is to discuss the forums, not products
    You need to ask your question in the forum for the Adobe product you are using
    How to Select a Forum http://forums.adobe.com/docs/DOC-1015

  • Which log file can be removed safely?

    The directory /private/var/log uses about 4.5 Gig of disk space, about half of which is used by /private/var/log/asl.
    My question now is: which of these can I delete?
    I assume, I can't delete the files *.log.
    But what about *.log.bz2 - they should be OK to delete, shouldn't they?
    And what about the files in /private/var/log/asl ?
    Thanks a lot in advance for all insights.
    Best regards,
    Gabriel.

    GabrielZ wrote:
    Ah, that is good to know.
    Yes, indeed, I always put my laptop to sleep during the night.
    Is there any way I can make these scripts also run, say, once a week during the day?
    Best regards,
    Gabriel.
    You're welcome. If the computer is not shut down, they are set to run in the middle of the night, or when the computer next wakes up. It's really easy to run the scripts in Terminal. Look in Activity Monitor (Applications>Utilities) for that runaway process.

  • Deleted mysql binary log files - can't start mysql

    Hi all,
    I had mysql running and used it for quite a while.
    Since my disk ran out of space, I deleted all the mysql-bin.0000* files in the mysql data folder and configured that mysql should not use binary logs anymore.
    Quite a mistake I assume; since now I can't start mysql(d) anymore.
    I've tried a lot by now:
    - re-installed mysql
    - deleted everything in the mysql data folder
    But I'm a bit stuck - and can't repair it anymore.. (there is not data loss, everything is backed up - that's not the problem).
    Can someone please guide me in a good direction?
    Running Arch Linux (systemd).
    systemctl status mysqld:
    Mar 08 13:12:34 arch systemd[1]: mysqld.service: control process exited, code=exited status=203
    Mar 08 13:12:34 arch systemd[1]: Failed to start MySQL database server.
    Mar 08 13:12:34 arch systemd[1]: Unit mysqld.service entered failed state
    Mar 08 13:12:34 arch systemd[1]: mysqld.service holdoff time over, scheduling restart.
    Mar 08 13:12:34 arch systemd[1]: Stopping MySQL database server...
    Mar 08 13:12:34 arch systemd[1]: Starting MySQL database server...
    Mar 08 13:12:34 arch systemd[1]: mysqld.service start request repeated too quickly, refusing to start.
    Mar 08 13:12:34 arch systemd[1]: Failed to start MySQL database server.
    Mar 08 13:12:34 arch systemd[1]: Unit mysqld.service entered failed state
    Mar 08 14:32:24 arch systemd[1]: Stopped mysqld.service.
    The data folder /var/lib/mysql is totally empty (which is - I assume - not good...).
    Thanks in advance
    Disclaimer: I tried for many hours now, but since I'm quite new - I don't have a clue anymore what to do.

    These are systemd, not mysql errors, and are quite useless as such -- you already know that mysql does not work Look for /var/log/mysqld.log or $datadir/<hostname>.err -- next time, of course, 'cos there's just one thing to do now: restore your mysql data folder, as there should be much more than binary logs Or, should you prefer to start from scratch, try to use mysql_install_db and then start mysql again.
    For future reference, you can safely delete old binary logs from inside mysql using PURGE MASTER LOGS command, and/or consider using expire_logs_days config option.

  • Outlook 2003 old Data File can't be removed and can't set up up iCloud sync with Outlook

    I had an issue with Google Calendar Sync after installing iCloud so I tried to remove my iCloud install.  When I go into Outlook 2003 it shows a Data File that exists with the iCloud name, but when I click on remove it comes back with "Äre You Sure....", I click yes and then an error states "The Requested Operation Failed." Then I try to click on the Settings Tab and I get the error "Än Unknown Error Occured, error code 0x8004011c".  The Open Folder tab is grayed out.  If I click on the E-mail tab, no iCloud email exists.  Hence something is lingering but I cannot get rid of it.
    When I go into the iCloud Control Panel the Mail, Contacts, Calendar and Tasks with Outlook is not ticked.  If I try to tick it and then apply the changes, it goes through the set-up for a few seconds and then returns an error box entitled Outlook Setup for iCloud with an error message Outlook Setup Error with a yellow triangle with an exclamation mark inside of it.  The options are "report", "try again" and "cancel" - all which are useless and don't do anything.
    Anyone have any ideas on how I can remove this Data File that supposedly exists within Outlook.  I have searched the c: drive and there is nothing by the name it states.

    Sorry...I have been looking at this for too long.  It is actually Outlook 2007.
    I actually have already removed the calendar, tasks, etc from Outlook as your last paragraph outlines, but it doesn't help.
    I have hoping to avoid the uninstall / reinstall, but I was leaning the same way.
    Thanks for your response.  Let me know if you think of anything else.

  • Which archivelog files can be safely removed from OS

    Hi,
    I didn't used "delete input" option when backup the archivelog files. So all archivelog files still remain on the file system. How can I identily which archivelog files I can delete using the command
    "RMAN>change archivelog '/u04/arch/arch_xxx.arc' delete; "
    where xxx is the seq I need to make sure it's safe to be removed.
    I need to make sure "restore archivelog all validate" command will still report successful afterward. The total size of archivelog files is over 20GB and I'm running out of space now. Thanks.

    The only way to delete your archlog is do not do a cross check archivelog all. Bec that will invalidate your archlogs. We have a rentetion of 28 days and we dlete archlogs after everybackup using delete input. While doing cross check we use "cross check completed before 'xxx'" and then it still keeps active in repo.
    Regards,
    http://askyogesh.com

  • What can I do when I'm trying to reinstall iTunes and I'm being told that the old bonjour file can't be removed eventhough I managed to remove the bonjour folder?

    Ok - I'm using MS Vista. I wanted to update iTunes for a long time but it always failed because it said something about missing access to the Network where Bonjour is stored. I figured that I wanted to solve this now once and for all by reinstalling the current version of iTunes. This didn't work, because I was being told that the old version of Bonjour could not be removed. Therefore I tried to remove Bonjour and after a long quest I found a way to (seemingly) remove it. There's no more Bonjour folder in my Programm Files. Anyway - I tried to install iTunes again and it didn't work. It told me that there was still the old Bonjour that could not be removed.
    I'm at my witts end. I'd really like to use iTunes, especially since I also own an iPhone.
    I'm thankful for your replies and send you many greetings from Switzerland!
    Marco

    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center on June 25. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any Bonjour entries and click "Remove".
    Quit out of CleanUp, restart the PC and try installing iTunes again. Does the install go through properly now?
    (If you do find a clean download site for the correct version of CleanUp, please don't tell me where it is. Without wishing to sound paranoid (although I grant it does sound paranoid), there is a non-zero chance that posting links to download locations for the utility here at Discussions leads to that download location being shut down.)

  • I am getting a message that my startup disk is full, what files can be safely removed to open up space or can I use an external HD for my startup disk?

    Converted  a FCP X movie into a quicktime .mov file and tried to burn to DVD, message came up that I needed 26.8 GB to burn this movie. I am not sure how I used so much memory. I was not creating Blu-ray movie just a standard DVD. Anyone have any suggestions for what I did to creat such a large file?

    It needs free unfragmented space on your boot drive.
    So just what and how large and how full is it?
    And it isn't 'memory' (ie, RAM), storage is never referred to as memory.
    Your system is likely running something later than the 10.6.6 shown.
    Clone your system to another hard drive adn then try, or clean it up after backing up with CCC
    While at it, move all your home data and media folders off the boot drive (leave a mini ~/Library only)
    System
    Media and data folders and libraries
    scratch
    projects
    backup partition(s)
    etc
    more efficient and runs better.
    never let the system drive get to less than 30% free, even more.

  • Auto remove of log files on the client-side is not working

    Hi,
    I have a setup for one-to-one client/server replication database. Everything is replicated ok.
    But on the client side, I see the log.00000000xx files are not removing at all,
    while the server has only 2 last log.00000000xx files left. But if I switch the role of the client/server,
    the newly server will eventually removed the unused log.00000000xx file, and have two last log file left.
    Both client and server database environment setup has called dbenvp->log_set_config(dbenvp, DB_LOG_AUTO_REMOVE, 1).
    Is there any additional setting for the client-side to auto remove the unused log files?
    Thanks,
    Sandra

    Hi.
    First, what version are you running? We created a test to confirm that this feature is
    working as expected on both a master and a client site. What flags do you have set
    for replication? I think we need to have you run with replication verbose messages
    set on the client site and possibly other diagnostics in order to determine what is different
    about your setup. We should take that level offline. Verbose messages can generate
    a large amount of output.
    You can contact me at the typical [email protected] and we'll move it
    forward that way. Thanks.
    Sue LoVerso
    Oracle

  • Cannot remove 2nd log file on AlwaysOn database

    Hi all,
    I have a database, member of an availability group. This database has 2 log file, I want to remove the unsed secondary log file, I try to run this command to empty the second lofg file:
    USE [TEST-AG]
    GO
    DBCC SHRINKFILE (N'TEST-AG_log_2' , EMPTYFILE)
    GO
    the command completes successfully, the I run the command to remove the file:
    USE [TEST-AG]
    GO
    ALTER DATABASE [TEST-AG]  REMOVE FILE [TEST-AG_log_2]
    GO
    But this command fails with the following message:
    Error 5042: The
    file 'TEST-AG_log_2' cannot
    be removed because it is not empty.
    If I remove the database from availability group the command to remove the 2nd file works, so I can't remove a secondary log file on a database member
    of an alwayson availability grup?

    Hi all,
    I have a database, member of an availability group. This database has 2 log file, I want to remove the unsed secondary log file, I try to run this command to empty the second lofg file:
    USE [TEST-AG]
    GO
    DBCC SHRINKFILE (N'TEST-AG_log_2' , EMPTYFILE)
    GO
    the command completes successfully, the I run the command to remove the file:
    USE [TEST-AG]
    GO
    ALTER DATABASE [TEST-AG]  REMOVE FILE [TEST-AG_log_2]
    GO
    But this command fails with the following message:
    Error 5042: The file 'TEST-AG_log_2' cannot
    be removed because it is not empty.
    If I remove the database from availability group the command to remove the 2nd file works, so I can't remove a secondary log file on a database member of an alwayson
    availability grup?
    Remove the database from availability group, then remove 2nd file.  You have been successfully. Then add back database to the availability group, then create regular backup jobs of the database.

  • How do I setup RMAN not to delete archive log files on the source database so GoldenGate can process DDL/DML changes?

    I want to setup RMAN not to delete any archive log files that will be used by GoldenGate.   Once GoldenGate is completed with the archive log file, the archive log file can be backup and deleted by RMAN.   It's my understanding that I can issue the following command "REGISTER EXTRACT <ext_name>, LOGRETENTION" to enable to functionally.   Is this the only thing I need to do to execute to enable this functionally?

    Hello,
    Yes this is the rigth way  using clasic capture.
    Using the command : REGISTER EXTRACT Extract_name LOGRETENTION.
    Create a Oracle Streams Group Capture (Artificial)  that prevent RMAN archive deletion if these are pending to process for Golden Gate capture process.
    You can see this integration doing a SELECT * FROM DBA_CAPTURE; after execute the register command.
    Then, when RMAN try to delete a archive file pending to process for GG this warning appear AT RMAN logs:
    Error:     RMAN 8317 (RMAN-08317 RMAN-8317)
    Text:     WARNING: archived log not deleted, needed for standby or upstream capture process.
    Then , this is a good manageability feature. I think is a 11.1 GG new feature.
    Tip. To avoid RMAN backup multiples times a archive pending to process, there is a option called BACKUP archivelog not backed 1 times.
    If you remove a Capture process that is registered with the database you need to use this comand to remove the streams capture group:
    unREGISTER EXTRACT extract_name LOGRETENTION;
    Then if you query dba_capture, the artificial Streams group is deleted.
    I hope help.
    Regards
    Arturo

  • Slapd database environment corrupt; wrong log files removed

    When our OSX 10.4.10 server boots up, slapd crashes out with a fatal error, followed by an unsuccessful attempt to recover the database. This is from the log:
    Sep 22 22:41:49 xyz123 slapd[428]: @(#) $OpenLDAP: slapd 2.2.19 $\n
    Sep 22 22:41:49 xyz123 slapd[428]: bdbbackinitialize: Sleepycat Software: Berkeley DB 4.2.52: (December 3, 2003)\n
    Sep 22 22:41:49 xyz123 slapd[428]: bdbdbinit: Initializing BDB database\n
    Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->logflush: LSN of 3/2806706 past current end-of-log of 1/2458\n
    Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment\n
    Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): gidNumber.bdb: unable to flush page: 0\n
    Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): txn_checkpoint: failed to flush the buffer cache Invalid argument\n
    Sep 22 22:41:49 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): PANIC: Invalid argument\n
    Sep 22 22:41:50 xyz123 slapd[428]: bdbdbopen: dbenv_open failed: DB_RUNRECOVERY: Fatal error, run database recovery (-30978)\n
    Sep 22 22:41:50 xyz123 slapd[428]: backend_startup: bidbopen failed! (-30978)\n
    Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lockid interface requires an environment configured for the locking subsystem\n
    Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lockid interface requires an environment configured for the locking subsystem\n
    Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lockid interface requires an environment configured for the locking subsystem\n
    Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lockid interface requires an environment configured for the locking subsystem\n
    Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): DBENV->lock_idfree interface requires an environment configured for the locking subsystem\n
    Sep 22 22:41:50 xyz123 slapd[428]: bdb(dc=xyz123,dc=mydomain,dc=com): txn_checkpoint interface requires an environment configured for the transaction subsystem\n
    Sep 22 22:41:50 xyz123 slapd[428]: bdbdbdestroy: txn_checkpoint failed: Invalid argument (22)\n
    Sep 22 22:41:50 xyz123 slapd[428]: slapd stopped.\n
    We are able to get it running by deleting the log file at /var/db/openldap/openldap-data/log.0000000001 and then rebooting. Thereafter the slapd.log complains:
    Sep 23 20:30:30 xyz123 slapd[58]: bdb(dc=xyz123,dc=dc=mydomain,dc=com): DBENV->logflush: LSN of 1/467990 past current end-of-log of 1/226654\n
    Sep 23 20:30:30 xyz123 slapd[58]: bdb(dc=xyz123,dc=dc=mydomain,dc=com): Database environment corrupt; the wrong log files may have been removed or incompatible database files imported from another environment\n
    Sep 23 20:30:30 xyz123 slapd[58]: bdb(dc=xyz123,dc=dc=mydomain,dc=com): sn.bdb: unable to flush page: 0\n
    We've tried running db_recover -c but that hasn't worked, or at least, we perhaps didn't do it right. We don't have a backup database that predates the existence of this problem.
    I'd appreciate if anyone has help or could point us to a resource explaining what to do to get our slapd working right.

    thank you for giving us a test program. This helped tremendously to fully understand what you are doing. In 5.3 we fixed a bug dealing with the way log files are archived in an HA environment. What you are running into is the consequences of that bug fix. In the test program you are using DB_INIT_REP. This is the key to use that you want an HA environment. With HA, there is a master and some number of read only clients. By default we treat the initiating database as the master. This is what is happening in our case. In an HA (replicated) environment, we cannot archive log files until we can be assured that the clients have applied the contents of that log file. Our belief is that you are not really running in an HA environment and you do not need the DB_INIT_REP flag. In our initial testing where we said it worked for us, this was because we did not use the DB_INIT_REP flag, as there was no mention of replication being needed in the post.
    Recommendation: Please remove the use of the DB_INIT_REP flag or properly set up an HA environment (details in our docs).
    thanks
    mike

Maybe you are looking for