How to remove all log files at application end ?

I need to remove all log files from database dir.
Just the data file must be in database diretory after the application ends.
I´v tried:
1 - set_flags(DB_LOG_AUTOREMOVE, 1);
2 - txn_checkpoint(0, 0, DB_FORCE);
But ways one log file reminds.
Any bory nows how remove all log files at application end ?
I really need this. How can i do that in C++ ?
Thanks,
DelNeto

Here's how I solved it
// At end of app.
// Commit tables.
pdbParam     ->sync(0);
pdbUser     ->sync(0);
// Close tables.
pdbParam     ->close(0);
pdbUser     ->close(0);
// Delete table objects.
delete     m_pdbParam;
delete     m_pdbUser;
// Commit all changes to the database.
penvDbEnv->txn_checkpoint(0, 0, DB_FORCE);
penvDbEnv->close(0);
delete penvDbEnv;
// Remove all logs files comes here.
DbEnv *penvDbEnv;
penvDbEnv = new DbEnv(0);
ui32EnvFlags = DB_CREATE |
DB_PRIVATE |
DB_INIT_LOCK |
DB_INIT_LOG |
DB_INIT_MPOOL |
DB_THREAD |
DB_INIT_TXN;
// Open the environment with full transactional support.
iResult = penvDbEnv->open("..\\database", ui32EnvFlags, 0);
// Get the list of log files.
char **pLogFilLis;
char **pLogFilLisBegin;
iResult = penvDbEnv->log_archive(&pLogFilLis, DB_ARCH_ABS | B_ARCH_LOG);
// This line resets the log sequence numbers from the database file.
// No actual log file is associated with the database.
iResult = penvDbEnv->lsn_reset("..\\database\\DATABASE.db", 0);
// Remove the log files.
if(pLogFilLis!= NULL)
// I don´t now how put spaces and tabs here, sorry about the "___".;-).
__for(pLogFilLisBegin = pLogFilLis; *pLogFilLis != NULL; ++pLogFilLis)
____iResult = remove(*pLogFilLis);
__free(pLogFilLisBegin);
// At this point no more log files exists at database directory.
penvDbEnv->close(0);
delete penvDbEnv;
// If i need remove the environment files, do this.
penvDbEnv = new DbEnv(0);
penvDbEnv->remove(("..\\database", 0);
delete m_penvDbEnv;
Thanks to Bogdan Coman for show me the way
DelNeto.

Similar Messages

  • How to remove archive log files from ASM managed 11g R2 database?

    Hi,
    I am planning to automate deletion of older archive log files from my 11g R2 Production instance which is ASM managed.
    Also want to remove the archive log files files from standby database.
    Please provide your inputs on how can I remove the older archive log files.
    Regards,
    Avinash

    Greetings
    Did you check RMAN,
    RMAN>show all;
    CONFIGURE RETENTION POLICY . . . .
    CONFIGURE ARCHIVELOG DELETION POLICY TO [CLEAR | NONE | APPLIED ON STANDBY];
    DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
    DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-10';
    This will be part of your RMAN Backup scripts/process
    Check the urls below:
    11gRel2:
    http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmmaint.htm#BRADV90079
    http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmmaint.htm#BRADV89634
    10g:
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14193/toc.htm#sthref45
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmconc1.htm#i1008093
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/maint003.htm#sthref712
    Regards & Thanks
    BN

  • How to remove all the files in a directory

    hi all ,
    am new to unix.. i need to remove all the fine in the directory .
    how can i remove it.. can any one tel me the command..
    i have use rm -f logs(folder name).
    but it is not removing any file ..
    Thanks
    sreedahr

    Hi;
    What is your OS?Which user you are using for delete process, you have w/r permission for your delete process on files
    You can use man rm and can check manuel
    Did you see:
    http://en.wikipedia.org/wiki/Rm_(Unix)
    http://www.cyberciti.biz/faq/howto-linux-unix-delete-remove-file/
    http://www.cyberciti.biz/faq/delete-remove-a-directory-unix-command/
    Pelase check links
    Regard
    Helios

  • How to remove archive log files using Enterprise Manger

    Hi,
    I took backup of the archive log files and i deleted those files at OS level but it is not reflecting in the Enterprise Manager it is showing the same. Can any one help in how to delete the archive log files by using Enterprise Manger.
    version 10.2.0.1.0
    any help is appreciated.
    Regards,
    Ashraf

    I have the same problem. I have 10gr1 and 10gr2 on different servers. On 10gr1, under administration/manage current backup/image, I can see archivelog files, and can mange them. But on 10gr2, the image doesn't show archivelog files. I can only remove them using rman. I wonder if it's because the different design on 10gr2 or I missed something when setup the backup?

  • How to create different log files for each of web applications deployed in OC4J

    Hi All,
    I am using OC4J(from Oracle) v1.0.2.2 and Windows2000. Now I want to know
    1. how to create different log files for each of my deployed web applications ?
    2. what are the advantages in running multiple instances of oc4j and in what case we should run
    multiple instances of OC4J ?
    3. how to run OC4J as Windows2000 Service rather than Windows2000 Application ?
    Thanks and Regards,
    Kumar.

    Hi Avi,
    First of all I have given a first reading to log4j and I think there will some more easy way of logging debugging messages than log4j (If you could provide me a detailed explanation of a servlet,jsp,java bean that uses log4j and how to use log4j then it will be very helpful for me). The other easy ways (if I am not using log4j) to my problem i.e creating different log files for each of web applications deployed in oc4j are
    I have created multiple instances of OC4J that are configured to run on different ports and so on each instance I have deployed a single web application . And I started the 2 oc4j instances by transferring thier error/log messages to a file. And the other way is ..
    I have download from jakarta site a package called servhelper . This servhelper is a thread that is started in a startup servlet and stopped in the destroy method of that startup servlet. So this thread will automatically capture all the system.out.println's and will print those to a file. I believe that this thread program is synchronized. So in this method I need not run multiple instances of OC4J instead each deployed web application on single instance of oc4j uses the same thread program (ofcourse a copy of thread program is put in each of the deployed web applications directories) to log messages on to different log files.
    Can you comment on my above 2 approached to logging debugging messages and a compartive explanation to LOG4J and how to use LOG4J using a simple servlet, simple jsp is appreciated ...
    Thanks and Regards,
    Ravi.

  • How do I remove "All My Files" icons from the toolbar?

    Good Afternoon:
    I have A shiny new 15" MBPro that came preinstalled with Lion that I have updated to 10.7.1.
    If I open a finder window, there are two "All My Files" icons on either side of the toolbar. I asked a Genius about it and they said they had never seen that. I can remove "All My Files" from the list of Favorites on the left easily enough. I can open up the window to customize the ToolBar, but in that window there are no "All My Files" icons available to add or delete.
    How do I remove the "All My Files" icons from the toolbar?
    Any advice would be appreciated. Thanks.
    Below is a screenshot of the problem.

    Sort of surprised they didn't know. I'm lost as to why that even appeared on your computer unless you had put them there yourself which, clearly, you didn't if it was brand new out of the box.
    Glad it's sorted out.

  • File Dialog - How to remove all files pattern in LV 8.x

    How to remove "all files" pattern in LV 8.x in the file dialog.
    Is it possible?
    Thanks
    Dany
    Dany Allard

    If it is a security issue, you will probably need to implement a custom dialog and actively filter for file types.  No matter what pattern you have showing, the user can type a pattern into the dialog and get anything they want.  In addition, file extension is not sufficient to determine file type.  You should probably check the file itself to ensure it is an HTML file and does not have any embedded nastiness.
    Fortunately, custom dialogs are easy to make.  Using the event structure, you can filter inputs as well, so that only HTML files will be accepted.  Good luck.  Let us know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to create the log file?

    Hi,
    I am working with the transcation f-30, But this question is on technical area.
    So after complition of BDC program excution, if you go for this screen in ALL DISPLAY MODE , you will get one list of documents, which are POSTED or SIMULATED.
    So Now my question is,
    I want to save this records as a LOG FILE to application server. For this I am having selection screen parameter too.
    But how can I Transfer this list to the output file?
    Thanks,
    Naveen Inuganti

    Hi
    U need to "write" the log in the file instead of in the list.
    See the help for OPEN DATASET, TRANSFER DATASET statament
    Max

  • How to remove all hyperlinks at once?

    Hi guys,
    I want to know how to remove all hyperlinks in a text at once. I know how to remove one link at a time. But it's time consuming if you paste a text with a lot of hyperlinks.
    Thanks,
    Adriano.

    Duplicate your document for safe then drag and drop the icon of the copy of the icon of this script saved as an application.
    --[SCRIPT remove links]{code}
    Enregistrer le script en tant qu'Application ou Progiciel : remove links.app
    Déposez le sur le bureau par exemple.
    Glisser-déposer l'icône d'un document Pages sur celle du script
    va éliminer tous les Hyperliens et signets prédsents dans le document.
    On peut également qlisser déposer un fichier index.xml.
    +++++++
    Save the script as an Application or an Application Bundle: remove links.app
    Store it on the desktop for instance.
    Drag and drop the icon of a Pages document on the script's icon
    to remove the Hyperlinks and Bookmarks embedded in the document.
    We may also drag & drop an index.xml file.
    Yvan KOENIG (Vallauris, FRANCE)
    16 février 2009
    enhanced 17 février 2009
    --=====
    property removeBookmarks : true
    true = remove the bookmarks
    false = don't remove the bookmarks *)
    property removeLinks : true
    true = remove the Links
    false = don't remove the Links *)
    property liste : {}
    --=====
    on open (sel)
    set theDoc to (item 1 of sel) as text
    tell application "System Events" to tell disk item theDoc
    set nn to name
    set uti to type identifier
    set isPackage to package folder
    end tell
    if nn is "index.xml" then
    my traiteIndex(theDoc)
    else if uti is not in {"com.apple.iwork.Pages.Pages", "com.apple.iwork.pages.sffpages"} then
    error "Not a Pages document !"
    else if isPackage then
    -- here the document is a package
    if theDoc ends with ":" then set theDoc to text 1 thru -2 of theDoc
    tell application "Finder"
    set the_index to (theDoc & ":index.xml")
    set indexGzAvailable to exists file (the_index & ".gz")
    set indexAvailable to exists file the_index
    end tell -- Finder
    if indexGzAvailable then
    if indexAvailable then tell application "Finder" to delete file the_index
    my expandIndex(the_index & ".gz")
    my traiteIndex(the_index)
    else
    if indexAvailable then
    my traiteIndex(the_index)
    else
    error "No Index available !"
    end if
    end if -- indexGzAvailable
    else
    -- here the document is a flat one
    tell application "Finder"
    set cont to (container of file theDoc) as text
    set name of file theDoc to (nn & ".zip")
    end tell -- Finder
    set theDocZ to cont & nn & ".zip"
    my expandDoc(theDocZ, theDoc)
    tell application "Finder"
    set name of file theDoc to (nn & "yk")
    set theDocF to cont & nn & "yk"
    set the_index to (theDocF & ":index.xml")
    set indexAvailable to exists file the_index
    end tell -- Finder
    if indexAvailable then my traiteIndex(the_index)
    end if -- nn …
    end open
    --=====
    on traiteIndex(theIndex)
    local theKey1, theKey2, theKey3, theKey4, theKey5, itm, itm1, itm2, itm2
    my nettoie()
    (* Lis le contenu du fichier Index.xml *)
    set texte to read file theIndex from 1
    if removeBookmarks then
    (* supprime les descripteurs de signets *)
    set theKey1 to "<sf:bookmark sf:name"
    set theKey2 to "</sf:bookmark>"
    if texte contains theKey1 then
    set my liste to my decoupe(texte, theKey1)
    repeat with i from 2 to count of my liste
    set itm to my decoupe(item i of my liste, theKey2)
    set itm1 to item 1 of itm
    set itm1 to text (1 + (offset of ">" in itm1)) thru -1 of itm1
    set itm2 to my recolle(items 2 thru -1 of itm, theKey2)
    set item i of my liste to (itm1 & itm2)
    end repeat -- i
    set texte to my recolle(my liste, "")
    end if
    end if -- removeBookmarks
    Here are samples of Hyperlinks in the index.xml file
    --link to bookmark
    <sf:p sf:style="paragraph-style-32">
    <sf:bookmark sf:name="page 3" sf:ranged="true" sf:page="3">
    page 3
    </sf:bookmark>
    <sf:br/>
    --link to URL
    <sf:p sf:style="paragraph-style-32">
    <sf:link href="http://discussions.apple.com/thread.jspa?threadID=1905618&amp;tstart=0" sf:style="SFWPCharacterStyle-7">
    <sf:span sf:style="SFWPCharacterStyle-7">
    Change cell color if number is different from previous cell
    </sf:span>
    </sf:link>
    <sf:br/>
    --link to an other Pages document
    <sf:p sf:style="paragraph-style-32">
    <sf:link href="pages:///Users/yvan_koenig/Documents/Sans%20titre%20-%20copie.pages#un%20 signet%20externe">
    <sf:file-alias sf:file-alias="0000000001ae000200010c4d6163696e746f7368204844000000000000000000 000000000000c45c8cef482b00000008a77c1853616e73207469747265202d20636f7069652e7061 67657300000000000000000000000000000000000000000000000000000000000000000000000000 000000360f06c5c03419000000000000000000010002000009200000000000000000000000000000 0009446f63756d656e747300001000080000c45c70cf0000001100080000c5c0260900000001000c 0008a77c0008a76f00006bdf000200414d6163696e746f73682048443a55736572733a7976616e5f 6b6f656e69673a446f63756d656e74733a53616e73207469747265202d20636f7069652e70616765 7300000e0032001800530061006e00730020007400690074007200650020002d00200063006f0070 00690065002e00700061006700650073000f001a000c004d006100630069006e0074006f00730068 0020004800440012003455736572732f7976616e5f6b6f656e69672f446f63756d656e74732f5361 6e73207469747265202d20636f7069652e7061676573001300012f00001500020012ffff0000"/>
    <sf:span sf:style="SFWPCharacterStyle-7">
    vers autre document
    </sf:span>
    </sf:link>
    <sf:br/>
    if removeLinks then
    (* supprime les descripteurs de liens *)
    set theKey1 to "<sf:link href="
    set theKey3 to "<sf:span sf:style="
    set theKey4 to "</sf:link>"
    set theKey5 to "</sf:span>"
    if texte contains theKey1 then
    set my liste to my decoupe(texte, theKey1)
    repeat with i from 2 to count of my liste
    set itm to my decoupe(item i of my liste, theKey4)
    set itm1 to item 2 of my decoupe(item 1 of itm, theKey3)
    set itm1 to text (1 + (offset of ">" in itm1)) thru -1 of itm1
    set itm1 to item 1 of my decoupe(itm1, theKey5)
    set itm2 to my recolle(items 2 thru -1 of itm, theKey4)
    set item i of my liste to (itm1 & itm2)
    end repeat -- i
    set texte to my recolle(my liste, "")
    end if -- texte contains
    This piece of code takes care of a bug in the save as Pages '08 process.
    A link to an other document is not completely disabled so the 'disabled' link remains blue.
    The link is stored this way:
    <sf:p sf:style="paragraph-style-32">
    <sf:span sf:style="SFWPCharacterStyle-7">vers autre document</sf:span>
    <sf:br/>
    when it would be:
    <sf:p sf:style="paragraph-style-32">
    vers autre document
    <sf:br/>
    if texte contains theKey3 then
    set my liste to my decoupe(texte, theKey3)
    repeat with i from 2 to count of my liste
    set itm to my decoupe(item i of my liste, theKey5)
    set itm1 to item 1 of itm
    set itm1 to text (1 + (offset of ">" in itm1)) thru -1 of itm1
    set itm2 to my recolle(items 2 thru -1 of itm, theKey5)
    set item i of my liste to (itm1 & itm2)
    end repeat -- i
    set texte to my recolle(my liste, "")
    end if -- texte contains
    end if -- removeLinks
    set lineFeed to ASCII character 10
    if texte contains (lineFeed & lineFeed) then set texte to my recolle(my decoupe(texte, lineFeed & lineFeed), lineFeed)
    if texte contains (return & return) then set texte to my recolle(my decoupe(texte, return & return), return)
    set eof of file theIndex to 0
    write texte to file theIndex
    my nettoie()
    end traiteIndex
    --=====
    on decoupe(t, d)
    local l
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local t
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to ""
    return t
    end recolle
    --=====
    on nettoie()
    set liste to {}
    end nettoie
    --=====
    (* Expands the zip file z in the container d, z and d are pathnames as strings *)
    on expandDoc(z, d)
    do shell script "unzip " & quoted form of (POSIX path of (z)) & " -d " & quoted form of (POSIX path of (d))
    end expandDoc
    --=====
    on expandIndex(f)
    do shell script "gunzip " & quoted form of (POSIX path of (f))
    end expandIndex
    --=====
    on lisIndex_xml(f)
    local t
    try
    set t to ""
    set t to (read file f)
    end try
    return t
    end lisIndex_xml
    --=====
    on compactIndex(nDoc)
    local aliasNDoc
    set aliasNDoc to nDoc as alias
    write leTexte to aliasNDoc starting at 0
    do shell script "gzip " & quoted form of POSIX path of aliasNDoc
    end compactIndex
    --=====
    --[/SCRIPT](code}
    Yvan KOENIG (from FRANCE samedi 14 mars 2009 20:55:42)

  • How to rotate jserv log files?

    Hi all,
    We are using 9iAS 1.0.2.1, which has Apache 1.3.12/Jserv 1.1
    How to rotate jserv log files? We have 'rotatelog' to rotate httpds_access_log etc.., but no such program for jserv log.
    (Tomcat has extended rotatelog to jserv, but what about Jserv?)
    Thanks in advance,
    Rajidhar Etta

    798852 wrote:
    Hi i am trying to see the archive files location...here is how i did
    SQL> archive log list;
    Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination +LAWCRS_ARC1/lawcrsdb/
    Oldest online log sequence 37264
    Next log sequence to archive 37267
    Current log sequence 37267
    My question is how can I go to the location "+LAWCRS_ARC1/lawcrsdb/".....I am not able to find this location..can any one help...Perhaps you're looking for this...
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16102/asm_util001.htm#OSTMG01610
    I'm not clear on what you're looking for so it's just a best guess.

  • How To Generate Debug Log Files for ebs jsp?

    hi   How To Generate Debug Log Files for ebs r12 jsp?
    and where i get the log .please help me thanks!

    Please check following MOS Document
    Oracle Application Server Diagnostic Tools and Log Files in Applications Release 12 (Doc ID 454178.1)

  • How to remove all transitions?

    I used the automate to sequence with default transition. A few dozens of transitions were added to the sequence.
    How to remove all the transitions without deleting the sequence and starting from scratch please?
    Thanks in advance.

    The difference in file size you are seeing is because you are only using motionless stills in your movies. No motion, and no effects. Some codecs allows for file size reduction by writing first and last frame information for a still, regardless of the length in the video sequence. Why the transition increases file size is because the codec actually has to write info for each frame in the length of the transition.
    This is not going to be the case with anybody working with actual video clips, or if someone adds motion to their stills. The codec then has to write information for every frame, resulting in a larger file size. For most projects, transitions will not make any significant change in file size.

  • How to remove "all day" as the default setting in iCal?

    How to remove "all day" as the default setting in iCal? The iCloud calendar works by double-clicking but the local behaves differently.

    Hello Valerie,
    the default - "all day" or "time based" - depends on the view in iCal. In month view the default is "all day",
    in week view or day view it is a time interval, if you use "File -> New Event". If you add the event by double clicking into the calendar, it will depend on the section you are clicking - in the all day section you will add an all-day event, in the time-grid you will enter an event with start-end time.
    Regards
    Léonie

  • How to open glassfish log file?

    I go to Program File/glassfish/domains/domain1/ but I not found anything. It's empty folder. How to open glassfish log file . please help me.

    Then glassfish instance is either not configured yet or installed somewhere else. Try looking under your user's home directory like C:\Documents and Settings\<username>\Application Data\glassfish\domains\domain1\logs

  • Why can't anyone tell me how to remove all those little "!" in the left column all at once or at least sort them so I can mark them and then delete them?

    Why can't anyone tell me how to remove all those little "!" in the left column all at once or at least sort them so I can mark them and then delete them?

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes.
    If, on the otherhand, you've been cleaning up your media from Explorer rather than iTunes and just want to eliminate the now broken links, use Tunes Folder Watch with its option to check for dead tracks on startup.
    tt2

Maybe you are looking for