Shrinking database file

Hi experts,
According to the reference guide(4.9 Diskspace Requirements), BDB does not return the freed space to underlying file system by deleting entries. And it also says that we need to create a new database and copy the records from the old one into it.
Followings are my questions...
Q1. In case of BTree, there is 'compact' api. Which one is better in performance of other view points between using 'compact' and copying into new DB?
Q2. Is it the only way for Hash?
Q3. The guide also saying that pages that key/data pairs are deleted from, can be reused where possible. Is there any criteria or rule for reusing it or not? Can we control it?
Q4. What about with in-memory configuration? Are these same?
Thank you.

Hello,
First SQL server 2000 is totally outdated and is no longer supported in any kind by Microsoft.
>>However, in the Recovery option if I switch it to simple and then shrink the database it will shrink
Shrinking of database  is most evil operation you can do in SQL Server it  causes massive fragmentation so please don't do it.You can go for data file shrink IF THERE IS GRAVE  requirement  to shrink it.SQL server data file might not
always respond to shrink command as release space.From what you posted seems like you are trying to shrink log file .You cannot shrink log file if last Virtual Log file( VLF) is still required by some transaction.To make sure it is marked as reusable you need
to take log backups at frequent interval ONLY LOG backup can truncate the logs and make VLF reusable and then you can shrink( A long running transaction can still hold VLF hostage and wont allow it to be marked as reusable).
When yo change recovery model to simple you force checkpoint which causes VLF to truncate and thus you can free space.
Further reading
http://technet.microsoft.com/en-us/magazine/2009.02.logging.aspx
http://technet.microsoft.com/en-us/library/ms178037%28v=sql.90%29.aspx
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

Similar Messages

  • Shrink Log file in log shipping and change the database state from Standby to No recovery mode

    Hello all,
    I have configured sql server 2008 R2 log shipping for some databases and I have two issues:
    can I shrink the log file for these databases: If I change the primary database from full to simple and shrink the log file then change it back to full recovery mode the log shipping will fail, I've seen some answers talked about using "No
    Truncate" option, but as I know this option will not affect the log file and it will shrink the data file only.
          I also can't create maintenance to reconfigure the log shipping every time I want to shrink the log file because the database size is huge and it will take time to restore in the DR site, so the reconfiguration
    is not an option :( 
    how can I change the secondary database state from Standby to No recovery mode? I tried to change it from the wizard and wait until the next restore for the transaction log backup, but the job failed and the error was: "the step failed". I need
    to do this to change the mdf and ldf file location for the secondary databases.
    can any one help?
    Thanks in advance,
    Faris ALMasri
    Database Administrator

    1. can I shrink the log file for these databases: If I change the primary database from full to simple and shrink the log file then change it back to full recovery mode the log shipping will fail, I've seen some answers talked about using "No Truncate"
    option, but as I know this option will not affect the log file and it will shrink the data file only.
          I also can't create maintenance to reconfigure the log shipping every time I want to shrink the log file because the database size is huge
    and it will take time to restore in the DR site, so the reconfiguration is not an option :( 
    2. how can I change the secondary database state from Standby to No recovery mode? I tried to change it from the wizard and wait until the next restore for the transaction log backup, but the job failed and the error was: "the step failed". I need to do
    this to change the mdf and ldf file location for the secondary databases.
    can any one help?
    Thanks in advance,
    Faris ALMasri
    Database Administrator
    1. If you change recovery model of database in logshipping to simple and back to full Logshipping will break and logs wont be resored on Secondary server as log chain will be broken.You can shrink log file of primary database but why would you need that
    what is schedule of log backup. Frequent log backup is already taking care of log files why to shrink it and create performance load on system when log file will ultimately grow and since because instant file initilaization is not for Log files it takes time
    to grow and thus slows performace.
    You said you want to shrink as Database size is huge is it huge or does it have lots of free space. dont worry about data file free space it will eventually be utilized by SQL server when more data comes
    2. You are following wrong method changing state to no recovery would not even allow you to run select queries which you can run in Standby mode. Please refer below link to move Secondary data and log files
    http://www.mssqltips.com/sqlservertip/2836/steps-to-move-sql-server-log-shipping-secondary-database-files/
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Shrinking a database file

    Hello everybody,
    I want to shrink a database file (temporary file from temporary tablespace). How can I do that either with SQL Plus either with Oracle DBA Studio. I have Oracle 8i.
    Thanks.

    I would say "Yes" for shrinking unless space is your major constraint.
    Definitely you can shrink the files but emptying a file requires lot of page movement, Its going to halt your database for a while. This is going to cause the issue.
    If you check the extent usage of each file using
    dbcc showfilestats
    and then use the corresponding file where it requires shrinking
    DBCC shrinkfile(fileid,target_size)
    This is going to online operation and you can stop the process whenever you want.
    --Prashanth

  • Shrink Log File on High Availability

    Dear support
    good day for you,
    i using SQL server 2012 and using AlwaysON High Availability (server_SQL1 = Primary & Server_SQL2=Secondary), when i try to shrink the log files he told me you must alter the database to simple recovery mode first but i cant coz using AlwaysON !
    thats mean:
    remove the DB's from AlwaysON (Server_SQL1)
    Shrink Files
    remove DB's from Server_SQL2
    add again DB's to AlwaysON
    any other solution for shrink logs without add/remove DB from AlwaysON
    Regards,

    The link that Uri has is correct, but let me expand on it for anyone else that runs across this issue:
    You don't actually need to be in the simple recovery model to shrink a file or the log. The reason why some people make the switch is because changing to the simple recovery model lets the database automatically clear the logs. This *generally* puts the
    VLF in use at the very beginning of the log. Since shrinking a log file works differently from data files (log only works from the end of the log until the first used vlf) it allows for a fast shrink and grow operation to fix up the log.
    In the full recovery model it is still possible, the difference being that you'll need to check to see which VLF the database is currently using and you may have to manually cause the log to circle around (by log backups, etc) to get a good shrink so
    that you can grow at a proper size.
    Sean Gallardy | Blog |
    Twitter

  • Shrink Log File on MS sql 2005

    Hi all,
    My DB has a huge logfile, with more than 100gb.
    The idea is to shrink it, but the good way.
    I was trying this way:
    use P01
    go
    backup log P01 TO DISK = 'D:\P01LOG1\P01LOG1.bak'
    go
    dbcc shrinkfile (P01LOG1,250) with no_infomsgs
    go
    The problem is that the backup file is getting bigger and bigger each backup.
    So, my question is, how to shrink the logfile, correctly, with backup, but that backup should not increase but stay at the same level, overwriting the backups.
    I have full dayly backup with data protector from HP, but it doesn't clean the log, and it isn't possible to shrink it.

    What you want to do with the log backups depends on how you are going to recover the database in case the system/database loss and your backup schedule.
    1. If you are not going to do point in time recovery then there is no point in taking a tran log backup to a backup file. You can change the recovery model of the database to "simple". If your recovery model is "simple" you don't have to take transaction log backups at all. The inactive transactions are flushed from the log automatically. You should still be taking full and differential backups so that you can atleast recover your database to last full backup and apply the latest differential backup.
    2. If this is a production system then you should definitly be on "full" recovery mode and should be taking regular transaction log backups and storing them in a safe place so that you can use them to recover your system to any point in time. Storing the transaction log backup on the same server kind of defeats the purpose because if you lost the server and disks you will not have the backups either.
    3. If you are in full recovery mode and lets assume that you run your transaction log backups every 30 mins then you need your log file to be of the size that can handle the transactions that happen in any given 30 to 60 mins.
    There shouldn't be a need to constantly shrink log files if you configure things right.
    Edited by: Neeraj Nagpal on Aug 20, 2010 2:48 AM

  • Cannot shrink log file 2 because the logical log file located at the end of the file is in use ?

    HI,
    I am getting this error frequently.. any recomendations :
    Executed as user: DB0\sqlservices. Processing database: dbin [SQLSTATE 01000] (Message 0) 
    Cannot shrink log file 2 (DB_log) because the logical log file located at the end of the file is in use. [SQLSTATE 01000] (Message 9008) 
    Processing database: DB_ [SQLSTATE 01000] (Message 0)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) 
    Cannot shrink log file 2 (DB_log) because the logical log file located at the end of the file is in use. [SQLSTATE 01000] (Message 9008) 
    Processing database: DB [SQLSTATE 01000] (Message 0) 
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528) 
    Backup, file manipulation operations (such as ALTER DATABASE ADD FILE) and encryption changes on a database must be serialized. Reissue the statement after the current backup or file manipulation operation is completed. [SQLSTATE 42000] (Error 3023) 
    Processing database: DB_AC [SQLSTATE 01000] (Error 0)  
    [SQLSTATE 01000] (Error 0)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Error 2528). 
    The step failed.
    Please give any receomendations to avoid this error in future :
    Yangamuni Prasad M

     
    Hi Yangamuni,
    Are there any progress?
    Please have a look on the below threads with the similar issues as yours:
    http://www.sqlservercentral.com/Forums/Topic652579-146-1.aspx
    http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/ae4db890-c15e-44de-a2af-e85c04260331
    The solution is change the recovery mode to SIMPLE, shrink log files and then change to the FULL recovery mode.
    Thanks,
    Weilin Qiao
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

  • MS_SQL Shrinking Log Files.

    Hi Experts,
    We have checked the documentation which have been received from SAP (SBO_Customer portal), Based on the Early Watch Alert.
    AS per SAP requsition we have minimized the size of 'Test Database Log' file  through MS_SQL Management Studio.(Restricted file size 10 percent, size 10 MB)
    Initially it was 50 Percent, 1000 MB
    Doubt is:
    Is that any problem will occur in future regarding this changes of 'LOG FILES'.
    Kindly help me.
    Based on your reply ...
    i will update in live production database....
    By
    kart

    The risk to shrink log file is fairly small.  Current hardware and software has much better reliability than before.  When you shrink your log file, you just lose some history which nobody even know there is any value in it.
    On the contrary, if you keep very large log file, it may cause more troubles than doing anything good.
    Thanks,
    Gordon

  • How to shrink database for the Oracle

    Hi,
    As you know, in the Sql server database there is a "shrink database" for the shrink the database space, but how to do that for the Oracle9i?
    Any comments would be appreciated.
    Thanks a lot

    You will have to resize ur datafiles to shrink ur db. Here are the steps
    1) select file_name,file_id,bytes from dba_data_files;
    This will give u the current size of datafiles.
    2) select file_id,sum(bytes) from dba_free_space group by file_id;
    This will give u the free space in the datafiles. If the file_id is not listed in this query that means the file is fully occupied/used.
    (used space = bytes col from query 1 - sum(bytes) col from query 2)
    3) alter database datafile file_id resize ### ;
    Enter the value you wanna resize based upon ur req. You cannot shrink the datafiles below the used space.
    Regards,
    http://askyogesh.com

  • Does shrinking LDF file have any impact on restoration?

    Right now my LDF file is almost 50GB. My database is only of 10 GB size.
    Here are my questions:
    1. Why is the LDF file so huge?
    2. Is there any way to avoid the LDF file to grow so big?
    3. If I use shrink, will I have any issue while I am restoring the database in the future.

    Hi,
    1. Can be many reason , do you take frequent transaction log backups.
    2. yes by taking proper transaction log backup and putting correct and reasonable value of autogrwth  for data and log file
    3. No, not at all. Shrinking log file only removes free space.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • How to reduce unused/available space in database file

    our database is partitioned on monthly basis and i am seeing large amount (nearly 50-70%) of space available in the data files. These files are not expected to grow(in large amount) in future. So i want to remove the unused space. What is the reason for
    that large amount of unused space and how to eliminate it? I tried shrinking the file which decresed the unused space to decent size but that resulted in fragmentation. To avoid fragmentation I rebuilded the indexes which again brought the unused space to
    the original size.
    Is there any way to find which table (which field ) is causing this.
    thanks in advance,

    hi Kalen,
      I am using sql server 2008 . I ran the following query [borrowed from other online sources]to get used,unused space for the files.
    --================query======================
    select
    [FileSizeMB]
    =
    convert(numeric(10,2),sum(round(a.size/128.,2))),
    [UsedSpaceMB]
    =
    convert(numeric(10,2),sum(round(fileproperty(
    a.name,'SpaceUsed')/128.,2)))
    [UnusedSpaceMB]
    =
    convert(numeric(10,2),sum(round((a.size-fileproperty(
    a.name,'SpaceUsed'))/128.,2)))
    [Type]
    =
    case
    when a.groupid
    is
    null
    then
    when a.groupid
    = 0
    then
    'Log'
    else
    'Data'
    end,
    [DBFileName]
    =
    isnull(a.name,'***
    Total for all files ***')
    from
    sysfiles a
    group
    by
    groupid,a.name
    with
    rollup having
    a.groupid
    is
    null
    or
    a.name
    is
    not
    null
    order
    by
    case
    when a.groupid
    is
    null
    then 99
    when a.groupid
    = 0
    then 0
    else 1
    end,
    a
    .groupid,
    case
    when a.name
    is
    null
    then 99
    else 0
    end,
    a
    .name
    --===========end of the query======================
    When I ran the query sugested by you, i observed that there is no much difference[less than 10] between row_reserved and row_used value and all the reamining columns are 0.
    Any suggestion is appreciated
    thanks,
    mp

  • While generating a crystal report can we edit database files in field explorer ?

    Hi,
    while generating a crystal report can we edit database files in field explorer (at middle can we edit database fields)
    Regards,
    Mahendra

    Wrong forum to post the question, try to post the question in crystal reports community.
    Its not possible to edit the database fields while creating the reports, its only used to call the rows of values in it. Can you explain me in detail what are you actually looking for .
    --SumanT

  • SQL and database file

    Hello.(sorry for my english)
    I have a legacy system , ported to opencobol that uses Berkeley DB. I can successfully open the database files using java both in windows and linux. However i want to create a web front end for the application.
    Data is stored using strange cobol structures (most numbers are stored as text or 4 bits per digit) and other fancy stuff.. so custom parsers should be written. (dont rember BDB classes name for that)
    I have been reading the documentation of Berkeley DB 12 hours totaly today but couldnt find answers to some questions...
    Is it possible to attach the database to dbsql.exe (sqlite) server ?? I tried to do "attach "..pathtofile" as NULL ,but i get multiple databases specified and not supported and other stupid messages....
    I think that what i tried propably doesnt make sense as collumns arent specified and nothing is in order this thing to work ..It is a simple Key value database.
    So i am a little stucked here.
    The only solution i can think is to synchronize with a relational Database. But i dont have triggers or nothing that helps....
    Note that i want one way synchronization. The "other way" will have very limited tasks.
    It seems to me that checking every x minutes if something changed using a cursor is a demanding task. So i am wondering.. Is there a way to track changes???
    Thank you :)
    Edited by: 843912 on 12 Μαρ 2011 7:13 μμ

    Hello,
    I am not sure I completely understand your question. If you are asking about importing
    and exporting data from a Berkeley DB database into an Oracle DB Table in Berkeley DB
    releases prior to 5.*, then this can be done with the Oracle OCI interface. If I am
    misunderstanding the question, please let me know.
    Thanks,
    Sandra

  • Finding whole mapping from database file - filesystems - logical volume manager - logical partitions

    Hello,
    Trying to make reverse engeneering of database files and their physical carriers on logical partitions ( fdisk ).
    And not able to make whole path from filesystem down to partitions with intermediate logical volumes.
    1. select from dba_data_files ...
    2. df -k
    to get the listing of filesystems
    3. vgdisplay
    4. lvdisplay
    5. cat /proc/partitions
    6. fdisk /dev/sda -l
       fdisk /dev/sdb -l
    Problem I have is that not able to determine which partitions are consisten in logical volumes. And then which logical volumens are consisted in filesystem.
    Thank you for hint or direction.

    Hello Wadhah,
    Before start the discussion let me explain I am newcommer to Oracle Linux. My genetic with dba experience of Oracle is from IBM UNIX ( AIX 6.1 ) and Oracle 11gr2.
    First task is to get the complete picture of one database on Oracle Linux for future maintenance tasks and make database more flexible and
    preparing for more intense work:
    -adding datafiles,
    -optimize/replace archive redolog files on separated filesystem from ORACLE_BASE
    - separating auditing log files from $ORACLE_BASE to own filesystem
    - separating diag directory on separated file system ( logging, tracing )
    - adding/enlarging TEMP ts
    - adding/enlarging undo
    - enlarging redo for higher transaction rate ( to reduce number of switched per time perceived in alert_SID.log )
    - adding online redo and control files mirrors
    So in this context try to inspect content of the disk space from the highest logical level in V$, DBA views down to fdisk partitions.
    The idea was to go in these steps:
    1. select paths of present online redo groups, datafiles, controlfiles, temp, undo
       from V$, dba views
    2. For the paths got from the step 1
       locate filesystems and for those filesystems inspect which are on logical volumens and which are directly on partitions.
    3. For all used logical volumes locate the logical partitions and their disks /dev/sda, /dev/sdb, ...

  • How to query a database file on my hard drive?

    Hi,
    I have a filer called "server.dbs" on my hard drive. It is a database file. I use a simple program that allows you to view databases, and it loads up and I can traverse the database and see all the entries as any standard database.
    So I figured that Java's ability to handle SQL would allow me to make a standard SQL statement querying the database, and be able to get the results. The software stores servers in SID fields, and the value is the port the server runs on. I want to make a simple query to select a server by SID, and print the port in which that server is running on.
    So is there any way to, via my java application, load a database from a file (rather than a url) which has no authentication required, and simply make my queries directly to that file? If so, how?
    Thanks!
    -Josh

    Normal database access is via JDBC.
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    To use that JDBC driver is needed to access the database. Databases in wide usage all have one. It isn't clear from your posting that you have a common database though.

  • ORA-01122: database file 8 failed verification check

    trc file: "dev_w0", trc level: 1, release: "700"
    *  ACTIVE TRACE LEVEL           1
    *  ACTIVE TRACE COMPONENTS      all, MJ

    B Tue Apr 29 17:57:51 2014
    B  create_con (con_name=R/3)
    B  Loading DB library 'D:\usr\sap\DEV\DVEBMGS00\exe\dboraslib.dll' ...
    B  Library 'D:\usr\sap\DEV\DVEBMGS00\exe\dboraslib.dll' loaded
    B  Version of 'D:\usr\sap\DEV\DVEBMGS00\exe\dboraslib.dll' is "700.08", patchlevel (0.73)
    B  New connection 0 created
    M sysno      00
    M sid        DEV
    M systemid   560 (PC with Windows NT)
    M relno      7000
    M patchlevel 0
    M patchno    75
    M intno      20050900
    M make:      multithreaded, Unicode, optimized
    M pid        2816
    M
    M  kernel runs with dp version 217000(ext=109000) (@(#) DPLIB-INT-VERSION-217000-UC)
    M  length of sys_adm_ext is 572 bytes
    M  ***LOG Q0Q=> tskh_init, WPStart (Workproc 0 2816) [dpxxdisp.c   1299]
    I  MtxInit: 30000 0 0
    M  DpSysAdmExtCreate: ABAP is active
    M  DpSysAdmExtCreate: VMC (JAVA VM in WP) is active
    M  DpShMCreate: sizeof(wp_adm) 18304 (1408)
    M  DpShMCreate: sizeof(tm_adm) 3994272 (19872)
    M  DpShMCreate: sizeof(wp_ca_adm) 24000 (80)
    M  DpShMCreate: sizeof(appc_ca_adm) 8000 (80)
    M  DpCommTableSize: max/headSize/ftSize/tableSize=500/8/528056/528064
    M  DpShMCreate: sizeof(comm_adm) 528064 (1048)
    M  DpFileTableSize: max/headSize/ftSize/tableSize=2600/8/208056/208064
    M  DpShMCreate: sizeof(file_adm) 208064 (72)
    M  DpShMCreate: sizeof(vmc_adm) 18720 (1440)
    M  DpShMCreate: sizeof(wall_adm) (38456/34360/64/184)
    M  DpShMCreate: sizeof(gw_adm) 48
    M  DpShMCreate: SHM_DP_ADM_KEY (addr: 08750040, size: 4880152)
    M  DpShMCreate: allocated sys_adm at 08750040
    M  DpShMCreate: allocated wp_adm at 08751E40
    M  DpShMCreate: allocated tm_adm_list at 087565C0
    M  DpShMCreate: allocated tm_adm at 087565F0
    M  DpShMCreate: allocated wp_ca_adm at 08B25890
    M  DpShMCreate: allocated appc_ca_adm at 08B2B650
    M  DpShMCreate: allocated comm_adm at 08B2D590
    M  DpShMCreate: allocated file_adm at 08BAE450
    M  DpShMCreate: allocated vmc_adm_list at 08BE1110
    M  DpShMCreate: allocated gw_adm at 08BE1150
    M  DpShMCreate: allocated vmc_adm at 08BE1180
    M  DpShMCreate: allocated ca_info at 08BE5AA0
    M  DpShMCreate: allocated wall_adm at 08BE5AA8
    M  DpSesCreateTable: attached session table at 06440040 (len=138424)
    X  EmInit: MmSetImplementation( 2 ).
    X  MM global diagnostic options set: 0

    X Tue Apr 29 17:57:52 2014
    X  <ES> client 0 initializing ....
    X  Using implementation flat
    M  <EsNT> Memory Reset disabled as NT default
    X  ES initialized.
    M  DpVmcInit2: o.k.

    M Tue Apr 29 17:57:53 2014
    M  ThInit: running on host sapecc6

    M Tue Apr 29 17:57:54 2014
    M  calling db_connect ...
    C  Prepending D:\usr\sap\DEV\DVEBMGS00\exe to Path.
    C  Oracle Client Version: '10.2.0.1.0'
    C  Client NLS settings: AMERICAN_AMERICA.UTF8
    C  Logon as OPS$-user to get SAPSR3's password
    C  Connecting as /@DEV on connection 0 (nls_hdl 0) ... (dbsl 700 110706)
    C  Nls CharacterSet                 NationalCharSet              C      EnvHp      ErrHp ErrHpBatch
    C    0 UTF8                                                      1   06C34308   06C398A4   06C3912C
    C  Attaching to DB Server DEV (con_hdl=0,svchp=06C39078,svrhp=06C4A944)
    C  Starting user session (con_hdl=0,svchp=06C39078,srvhp=06C4A944,usrhp=06C979A8)

    C Tue Apr 29 17:57:55 2014
    C  Now '/@DEV' is connected (con_hdl 0, nls_hdl 0).
    C  Got SAPSR3's password from OPS$-user
    C  Disconnecting from connection 0 ...
    C  Closing user session (con_hdl=0,svchp=06C39078,usrhp=06C979A8)
    C  Now I'm disconnected from ORACLE
    C  Connecting as SAPSR3/<pwd>@DEV on connection 0 (nls_hdl 0) ... (dbsl 700 110706)
    C  Nls CharacterSet                 NationalCharSet              C      EnvHp      ErrHp ErrHpBatch
    C    0 UTF8                                                      1   06C34308   06C398A4   06C3912C
    C  Starting user session (con_hdl=0,svchp=06C39078,srvhp=06C4A944,usrhp=06C979A8)
    C  Now 'SAPSR3/<pwd>@DEV' is connected (con_hdl 0, nls_hdl 0).
    C  Database NLS settings: AMERICAN_AMERICA.UTF8
    C  Database instance DEV is running on SAPECC6 with ORACLE version 10.2.0.2.0 since 20140429
    B  Connection 0 opened (DBSL handle 0)
    B  Wp  Hdl ConName          ConId     ConState     TX  PRM RCT TIM MAX OPT Date     Time   DBHost         
    B  000 000 R/3              000000000 ACTIVE       NO  YES NO  000 255 255 20140429 175754 SAPECC6        
    M  db_connect o.k.
    M  ICT: exclude compression: *.zip,*.cs,*.rar,*.arj,*.z,*.gz,*.tar,*.lzh,*.cab,*.hqx,*.ace,*.jar,*.ear,*.war,*.css,*.pdf,*.js,*.gzip,*.uue,*.bz2,*.iso,*.sda,*.sar,*.gif
    M  ThVmcSetParam: switch vmcj/vm_auto_restart 0 -> 0 sec

    J Tue Apr 29 17:57:57 2014
    J  extMemCheck is set to disp+work.ThVmcMemCheck(thxxvmemu.c:2756)
    J  extGcMemReserve is set to disp+work.ThVmcGcMemReserve(thxxvmemu.c:2587)
    J  extGcMemCommit is set to disp+work.ThVmcGcMemCommit(thxxvmemu.c:2624)
    J  extGcMemFree is set to disp+work.ThVmcGcMemFree(thxxvmemu.c:2643)
    J  extCreateSharedCodeCache is set to disp+work.ThVmcSharedCodeCacheCreate(thxxvmemu.c:1941)
    J  extSetSharedCodeCachePerm is set to disp+work.ThVmcSharedCodeCacheSetPerm(thxxvmemu.c:2019)
    J  extMalloc is set to disp+work.ThVmcMallocDispatcher(thxxvmemu.c:2070)
    J  extCalloc is set to disp+work.ThVmcCallocDispatcher(thxxvmemu.c:2097)
    J  extRealloc is set to disp+work.ThVmcReallocDispatcher(thxxvmemu.c:2124)
    J  extFree is set to disp+work.ThVmcFreeDispatcher(thxxvmemu.c:2149)
    J  extAddResourceToHeap is set to disp+work.ThVmcAddResourceToHeap(thxxvmemu.c:2662)
    J  extRemoveResourceFromHeap is set to disp+work.ThVmcRemoveResourceFromHeap(thxxvmemu.c:2688)
    J  extGetLocalMemory is set to disp+work.ThJGetLocalMemory(thxxvmemu.c:2833)
    J  extGetLocalMemoryPeak is set to disp+work.ThJGetLocalMemoryPeak(thxxvmemu.c:2845)
    J  extGetLocalAllocatedMemory is set to disp+work.ThJGetLocalAllocatedMemory(thxxvmemu.c:2857)
    J  extGetGlobalMemory is set to disp+work.ThJGetGlobalMemory(thxxvmemu.c:2902)
    J  extGetGlobalMemoryPeak is set to disp+work.ThJGetGlobalMemoryPeak(thxxvmemu.c:2914)
    J  extGetGlobalAllocatedMemory is set to disp+work.ThJGetGlobalAllocatedMemory(thxxvmemu.c:2926)
    J  extGetUsedBytes is set to disp+work.ThVmcGetUsedBytes(thxxvmemu.c:2710)
    J  extGetGuardInfo is set to disp+work.ThVmcGetGuardInfo(thxxvmemu.c:1410)
    J  extWriteMemoryDump is set to disp+work.ThJWriteMemoryDump(thxxvmemu.c:1437)
    J  extGetPid is set to disp+work.ThJGetPid(thxxjava.c:7663)
    J  extRegPtr is set to disp+work.ThJRegPtr(thxxvmemu.c:1178)
    J  extGetPtr is set to disp+work.ThJGetPtr(thxxvmemu.c:1190)
    J  extDeregPtr is set to disp+work.ThJDeregPtr(thxxvmemu.c:1202)
    J  extAbort is set to disp+work.ThVmcJAbortHandler(thxxjava.c:6095)
    J  extExit is set to disp+work.ThVmcJExitHandler(thxxjava.c:5994)
    J  extSaveExit is set to disp+work.ThVmcJExitHandler(thxxjava.c:5994)
    J  extSaveErrTxt is set to disp+work.ThVmcJSetVmErrTxt(thxxjava.c:6065)
    J  extSemLock is set to disp+work.ThJSemLock(thxxvmemu.c:545)
    J  extSemUnlock is set to disp+work.ThJSemUnlock(thxxvmemu.c:551)
    J  extMtxOpen is set to disp+work.ThJMtxOpen(thxxvmemu.c:641)
    J  extMtxClose is set to disp+work.ThJMtxClose(thxxvmemu.c:665)
    J  extMtxLock is set to disp+work.ThJMtxLock(thxxvmemu.c:685)
    J  extMtxTrylock is set to disp+work.ThJMtxTrylock(thxxvmemu.c:780)
    J  extMtxUnlock is set to disp+work.ThJMtxUnlock(thxxvmemu.c:853)
    J  extMtxForceUnlock is set to disp+work.ThJMtxForceUnlock(thxxvmemu.c:928)
    J  extMtxLockCount is set to disp+work.ThJMtxLockCount(thxxvmemu.c:975)
    J  extMtxLocked is set to disp+work.ThJMtxLocked(thxxvmemu.c:981)
    J  extMtxLocking is set to disp+work.ThJMtxLocking(thxxvmemu.c:1013)
    J  extMtxWaitingVms is set to disp+work.ThJMtxWaitingVms(thxxvmemu.c:1046)
    J  extMtxIAmOwner is set to disp+work.ThJMtxIAmOwner(thxxvmemu.c:1101)
    J  extOpen is set to disp+work.ThIoJavaOpen(thxxfile.c:381)
    J  extReopen is set to disp+work.ThIoJavaReopen(thxxfile.c:535)
    J  extClose is set to disp+work.ThIoJavaClose(thxxfile.c:665)
    J  extSeek is set to disp+work.ThIoJavaSeek(thxxfile.c:750)
    J  extSetLength is set to disp+work.ThIoJavaSetLength(thxxfile.c:882)
    J  extSync is set to disp+work.ThIoJavaSync(thxxfile.c:910)
    J  extIoAvailable is set to disp+work.ThIoJavaAvailable(thxxfile.c:937)
    J  extFileSizeFd is set to disp+work.ThIoJavaFileSizeFD(thxxfile.c:965)
    J  extPread is set to disp+work.ThIoJavaPRead(thxxfile.c:1074)
    J  extPwrite is set to disp+work.ThIoJavaPWrite(thxxfile.c:1111)
    J  extReadv is set to disp+work.ThIoJavaReadV(thxxfile.c:994)
    J  extWritev is set to disp+work.ThIoJavaWriteV(thxxfile.c:1038)
    J  extFDataSync is set to disp+work.ThIoJavaDataSync(thxxfile.c:1145)
    J  extFixVmToProcess is set to disp+work.ThIoFixVmToWp(thxxfile.c:1230)
    J  extReleaseVmFromProcess is set to disp+work.ThIoRelVmFromWp(thxxfile.c:1239)
    J  extGetOSDescriptor is set to disp+work.ThIoJavaGetOsFd(thxxfile.c:1249)
    J  extDetachIo is set to disp+work.ThIoJavaDetach(thxxfile.c:1273)
    J  extSocket is set to disp+work.ThSoSocketVmc(thxxsock.c:798)
    J  extRecvMsg is set to disp+work.ThSoRecvmsg(thxxsock.c:1147)
    J  extSendMsg is set to disp+work.ThSoSendmsg(thxxsock.c:1569)
    J  extCloseSocket is set to disp+work.ThSoCloseSocket(thxxsock.c:985)
    J  extConnect is set to disp+work.ThSoConnect(thxxsock.c:809)
    J  extBind is set to disp+work.ThSoBind(thxxsock.c:1804)
    J  extAccept is set to disp+work.ThSoAccept(thxxsock.c:1985)
    J  extListen is set to disp+work.ThSoListen(thxxsock.c:2230)
    J  extPoll is set to disp+work.ThSoPoll(thxxsock.c:2381)
    J  extShutdown is set to disp+work.ThSoShutdown(thxxsock.c:2633)
    J  extGetSockOpt is set to disp+work.ThSoGetsockopt(thxxsock.c:2787)
    J  extSetSockOpt is set to disp+work.ThSoSetsockopt(thxxsock.c:2963)
    J  extGetSockName is set to disp+work.ThSoGetsockname(thxxsock.c:3122)
    J  extGetRecvLength is set to disp+work.ThSoGetrecvlength(thxxsock.c:3305)
    J  extSetNonBlocking is set to disp+work.ThSoSetnonblocking(thxxsock.c:3464)
    J  extCreateControlArea is set to disp+work.ThJCreateControlArea(thxxvmemu.c:3099)
    J  extGetControlArea is set to disp+work.ThJGetControlArea(thxxvmemu.c:3113)
    J  extNotifyAboutControlFlagChange is set to disp+work.ThJControlFlagChange(thxxjava.c:6147)
    J  extVmRunningInWp is set to disp+work.ThJVmRunningInWp(thxxjava.c:7500)
    J  extVmRunningOnJavaStack is set to disp+work.ThJVmRunningOnJavaStack(thxxjava.c:7508)
    J  extGetJavaMainStack is set to disp+work.ThJGetJavaMainStack(thxxjava.c:7513)
    J  extAlarm is set to disp+work.ThJAlarm(thxxjava.c:6215)
    J  setGlobalsHook is set to disp+work.ThJSetGlobals(thxxjava.c:6386)
    J  getGlobalsHook is set to disp+work.ThJGetGlobals(thxxjava.c:6374)
    J  getWpIdHook is set to disp+work.ThGetWpId(thxxtool.c:2002)
    J  getWpNoHook is set to disp+work.DpWpAdmEntry(dpxxtool.c:3215)
    J  getVmCount is set to disp+work.ThJGetVmcCount(thxxjava.c:3154)
    J  getEvtConnHdl is set to disp+work.ThJGetEvtConnHdl(thxxjava.c:1099)
    J  selNextHdl is set to disp+work.ThVmcSelNextHdl(thxxvmio.c:335)
    J  rollOut is set to disp+work.ThJRollOut(thxxjava.c:5737)
    J  sleepFunc is set to disp+work.ThJSleep(thxxjava.c:6901)
    J  selTimeout is set to disp+work.ThJSelTimeout(thxxjava.c:7292)
    J  proxyWakeup is set to disp+work.ThJHandleProxyWakeup(thxxjava.c:7610)
    J  extGetProxyActivatedHook is set to disp+work.ThJGetSapProxyActivated(thxxjava.c:7423)
    J  getVmcFlavour is set to disp+work.ThJGetVmcFlavour(thxxjava.c:7675)
    J  getVmType is set to disp+work.ThJGetVmType(thxxjava.c:7687)
    J  getVmMaxNo is set to disp+work.ThJGetVmMaxNo(thxxvmemu.c:3049)
    J  getVmId is set to disp+work.ThJGetActVmc(thxxjava.c:9681)
    J  isValidVmId is set to disp+work.ThJisValidVmId(thxxvmemu.c:3075)
    J  getVmUuid is set to disp+work.ThJGetVmUuid(thxxvmemu.c:3059)
    J  createUniqueId is set to disp+work.ThJCreateUniqueId(thxxvmemu.c:3084)
    J  statisticActive is set to disp+work.ThJStatisticsActive(thxxjava.c:7830)
    J  openStatInterval is set to disp+work.ThJOpenStatInterval(thxxjava.c:7852)
    J  closeStatInterval is set to disp+work.ThJCloseStatInterval(thxxjava.c:7868)
    J  intervalStatActive is set to disp+work.ThJIntervalStatActive(thxxjava.c:7885)
    J  extTrace is set to disp+work.ThJTrace(thxxvmemu.c:3129)
    J  extGetBuiltinLibs is set to disp+work.ThJGetBuiltinLibs(thxxjava.c:6250)
    J  extFindNative is set to disp+work.ThJFindNative(thxxvmemu.c:3150)
    J  extPreloadNativeOpen is set to disp+work.ThJPreloadNativeOpen(thxxjava.c:6264)
    J  extPreloadNativeSym is set to disp+work.ThJPreloadNativeSym(thxxjava.c:6276)
    J  extGetDebugFlags is set to disp+work.ThVmcGetBitmasks(thxxvmc.c:2500)
    J  extStartExternalTimer is set to disp+work.ThJStartExternalTimer(thxxjava.c:6288)
    J  extStopExternalTimer is set to disp+work.ThJStopExternalTimer(thxxjava.c:6309)
    J  extCheckForCleanup is set to <null>
    J  extJvmxInit2 is set to <null>
    J  extJvmxCleanup is set to <null>
    M  ThVmcInitWaitForVm: th_maxWaitForVmTime=30

    I Tue Apr 29 17:58:05 2014
    I  MtxInit: 0 0 0
    M  SHM_PRES_BUF (addr: 0BD30040, size: 4400000)
    M  SHM_ROLL_AREA (addr: 59250040, size: 61440000)
    M  SHM_PAGING_AREA (addr: 0C7D0040, size: 32768000)
    M  SHM_ROLL_ADM (addr: 0C170040, size: 615040)
    M  SHM_PAGING_ADM (addr: 0C210040, size: 525344)
    M  ThCreateNoBuffer allocated 544152 bytes for 1000 entries at 0C2A0040
    M  ThCreateNoBuffer index size: 3000 elems
    M  ThCreateVBAdm allocated 12160 bytes (50 server) at 0C330040
    X  EmInit: MmSetImplementation( 2 ).
    X  MM global diagnostic options set: 0
    X  <ES> client 0 initializing ....
    X  Using implementation flat
    X  ES initialized.

    C Tue Apr 29 17:58:06 2014
    C  *** ERROR => ORA-376 occurred when executing SQL statement (parse error offset=0)
    [dbsloci.c    12548]
    C  sc_p=06198094,no=1,idc_p=06B97F38,con=0,act=1,slen=66,smax=256,#vars=0,stmt=06C5E6B8,table=DDNTT                        
    C  SELECT COUNT(*) FROM DDNTT WHERE TABFORM <> 'J' AND TABFORM <> 'V';
    C  sc_p=06198094,no=1,idc_p=06B97F38,con=0,act=1,slen=66,smax=256,#vars=0,stmt=06C5E6B8,table=DDNTT                        
    C  prep=0,lit=0,nsql=0,lobret=0,#exec=1,dbcnt=0,upsh_p=00000000,ocistmth_p=06C51FC0
    C  IN : cols=0,rmax=0,xcnt=0,rpc=0,rowi=0,rtot=0,upto=-1,rsize=0,vmax=0,bound=0,iobuf_p=00000000,vda_p=00000000
    C       lobs=0,lmax=0,lpcnt=0,larr=00000000,lcurr_p=00000000,rret=0
    C  OUT: cols=1,rmax=1,xcnt=1,rpc=0,rowi=0,rtot=0,upto=-1,rsize=4,vmax=32,bound=1,iobuf_p=05637578,vda_p=06C5DB68
    C       lobs=0,lmax=0,lpcnt=0,larr=00000000,lcurr_p=00000000,rret=0
    C  SELECT COUNT(*) FROM DDNTT WHERE TABFORM <> 'J' AND TABFORM <> 'V';
    B  ***LOG BYL=> DBQ action required because of database error            [dbsh#2 @ 1100] [dbsh    1100 ]
    B  SQL code: 376, SQL text: ORA-00376: file 8 cannot be read at this time
    B  ORA-01110: data file 8: 'D:\ORACLE\DEV\SAPDATA1\SR3_5\SR3.DATA5'
    B  ***LOG BY4=> sql error 376    performing SEL on table DDNTT      [dbstat#4 @ 693] [dbstat  0693 ]
    B  ***LOG BY0=> ORA-00376: file 8 cannot be read at this time
    ORA-01110: data file 8: 'D:\ORACLE\DEV\SAPDATA1\SR3_5\SR3.DATA5' [dbstat#4 @ 693] [dbstat  0693 ]
    B  init: Got no entries from DDNTT !
    B  init failed
    B  db_stinit failed
    M  *** ERROR => ThCallHooks: event handler db_init for event CREATE_SHM failed [thxxtool3.c  260]
    M  *** ERROR => ThIPCInit: hook failed [thxxhead.c   2047]
    M  ***LOG R19=> ThInit, ThIPCInit ( TSKH-IPC-000001) [thxxhead.c   1494]
    M  in_ThErrHandle: 1
    M  *** ERROR => ThInit: ThIPCInit (step 1, th_errno 17, action 3, level 1) [thxxhead.c   10156]

    M  Info for wp 0

    M    stat = 4
    M    reqtype = 1
    M    act_reqtype = -1
    M    rq_info = 0
    M    tid = -1
    M    mode = 255
    M    len = -1
    M    rq_id = 65535
    M    rq_source = 255
    M    last_tid = 0
    M    last_mode = 0
    M    semaphore = 0
    M    act_cs_count = 0
    M    control_flag = 0
    M    int_checked_resource(RFC) = 0
    M    ext_checked_resource(RFC) = 0
    M    int_checked_resource(HTTP) = 0
    M    ext_checked_resource(HTTP) = 0
    M    report = >                                        <
    M    action = 0
    M    tab_name = >                              <
    M    vm = V-1

    M  *****************************************************************************
    M  *
    M  *  LOCATION    SAP-Server sapecc6_DEV_00 on host sapecc6 (wp 0)
    M  *  ERROR       ThInit: ThIPCInit
    M  *
    M  *  TIME        Tue Apr 29 17:58:06 2014
    M  *  RELEASE     700
    M  *  COMPONENT   Taskhandler
    M  *  VERSION     1
    M  *  RC          17
    M  *  MODULE      thxxhead.c
    M  *  LINE        10354
    M  *  COUNTER     1
    M  *
    M  *****************************************************************************

    M  PfStatDisconnect: disconnect statistics
    M  Entering TH_CALLHOOKS
    M  ThCallHooks: call hook >ThrSaveSPAFields< for event BEFORE_DUMP
    M  *** ERROR => ThrSaveSPAFields: no valid thr_wpadm [thxxrun1.c   720]
    M  *** ERROR => ThCallHooks: event handler ThrSaveSPAFields for event BEFORE_DUMP failed [thxxtool3.c  260]
    M  Entering ThSetStatError
    M  ThIErrHandle: do not call ThrCoreInfo (no_core_info=0, in_dynp_env=0)
    M  Entering ThReadDetachMode
    M  call ThrShutDown (1)...
    M  ***LOG Q02=> wp_halt, WPStop (Workproc 0 2816) [dpnttool.c   327]
    sql>select status from v$datafile;
    status
    One of my datafile status is 'RECOVER'
    SQL>recover datafile 8;
    ora_00283 recover session cancelled due to errors
    ora_01110:datafile 8:'d:\oracle\sid\sapdata1\sr3_5\sr3.data5'
    ora_01122:database file 8 failed cerification check
    ora_01110:datafile 8:d:\oracle\sid\sapdata1\sr3_5\sr3.data5'
    ora_01251:unknown file header version read for file number 8
      Please give me the suggestion..
    Best regards
    nani

    Hi K Nani,
    From your error message
    ora_01122:database file 8 failed cerification check
    ora_01110:datafile 8:d:\oracle\sid\sapdata1\sr3_5\sr3.data5'
    ora_01251:unknown file header version read for file number 8
    Looks like Data file is corrupted.
    You may refer SAP note 696141 - Composite SAP Note: ORA-01122
    10. ORA-01251: Unknown File Header Version read for file number <file_id>
    Reason: The file header cannot be correctly read.
    Solution: If you use Oracle 9.2 on WINDOWS and if you already installed the database with Oracle 7.2 or lower, see Note 636466.
               Otherwise: Restore/recovery
    Only solution here is restore the database from backup.
    Alternate solution If it is a non-production system.
    If the file is corrupted, then take the datafile offline and open the database.
    Hope this helps
    Regards,
    Deepak Kori

Maybe you are looking for