Exception pad block corrupted using AESLight from BouncyCastle

Hi all!
I�m trying to encrypt and decrypt using AESLight from Bouncy Castle to provide cryptographi to my mobile application. I encrypt the text with no problems, and sometimes i decrypted with no problems to!
But, with some messages i got the follow exception:
org.bouncycastle.crypto.InvalidCipherTextException: pad block corrupted
     at org.bouncycastle.crypto.paddings.PKCS7Padding.padCount(Unknown Source)
     at org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher.doFinal(Unknown Source)
     at softcomex.sfw2go.server.seguranca.TranslatorAESLight.processMsg(TranslatorAESLight.java:40)
     at softcomex.sfw2go.server.Waiter.sendMessageToClient(Waiter.java:251)
     at softcomex.sfw2go.server.Waiter.run(Waiter.java:211)My class that uses AESLight:
public TranslatorAESLight (byte[] key, boolean cripto)
          this.keyAES = new byte[16];
          System.arraycopy(key, 0, this.keyAES, 0, key.length>16?16:key.length);
          this.cripto = cripto;
     }And, when I have to encrypt/decrypt i call the method processMsg:
public byte[] processMsg (String msg)
          byte[] msgReturn = null;
          int length = 0;
          BlockCipher engine = new AESLightEngine();
          BufferedBlockCipher cipher = new PaddedBufferedBlockCipher(new CBCBlockCipher(engine));
          KeyParameter key = new KeyParameter(keyAES);
          cipher.init(cripto, key);
          msgReturn = new byte[cipher.getOutputSize(msg.getBytes().length)];
          length = cipher.processBytes(msg.getBytes(), 0, msg.getBytes().length, msgReturn, 0);
          try {
               cipher.doFinal(msgReturn, length);
          } catch ( Exception e) {
               e.printStackTrace();
          return msgReturn;
     }Please, there is something wrong with this code?
Thanks.

I believe sabre150 has posted a good link in this
forum explaining why this doesn't work, but the
bottom line is that you cannot create a String from
an arbitrary byte array.I can't remember a single definitive reference (my memory is suspect these days) but I do have an example that shows why one should not try to convert bytes to a string using new String(bytes).
I got the basics of the Levenshtein algorithm on this forum somewhere but I can't find it. If anyone can give me the reference I will acknowledge it in the code.
import java.util.*;
import java.text.*;
import java.nio.charset.*;
public class BytesToStringErrorsDemonstration
    public static int levenshteinDistance( byte[] s, byte[] t)
        int n = s.length;
        int m = t.length;
        if (n == 0) return m;
        if (m == 0) return n;
        int[][] d = new int[n + 1][m + 1];
        for ( int i = 0; i <= n; d[0] = i++ );
for ( int j = 1; j <= m; d[0][j] = j++ );
for ( int i = 1; i <= n; i++ )
byte sc = s[ i-1 ];
for (int j = 1; j <= m;j++)
int v = d[i-1][j-1];
if ( t[ j-1 ] != sc ) v++;
d[i][j] = Math.min( Math.min( d[i-1][ j] + 1, d[i][j-1] + 1 ), v );
return d[n][m];
public static void main(String[] args)
// Create a set of random bytes
Random random = new Random();
byte[] originalBytes = new byte[2048];
random.nextBytes(originalBytes);
// Go through each supported character set
SortedMap<String,Charset> availableCharsets = Charset.availableCharsets();
for (String encoding : availableCharsets.keySet())
System.out.print(encoding);
// Turn the bytes into a String
String string;
try
string = new String(originalBytes, encoding);
catch (Exception e)
System.out.println(" - unable to convert bytes to String");
continue;
// Get back the bytes from the string
byte[] recoveredBytes;
try
recoveredBytes = string.getBytes(encoding);
catch (Exception e)
System.out.println(" - unable to convert String back to bytes");
continue;
// Test the original against the recovered
boolean areSame = Arrays.equals(originalBytes, recoveredBytes);
if (areSame)
System.out.println(" - no differences");
else
final DecimalFormat percentFormatter = new DecimalFormat("0.0");
int levenshteinCount = levenshteinDistance(originalBytes, recoveredBytes);
System.out.println(" - differences - Levenshtein count = " + levenshteinCount + " (" + percentFormatter.format(100.0 * levenshteinCount / originalBytes.length) + " %)");

Similar Messages

  • Javax.crypto.BadPaddingException: pad block corrupted  when using Java 1.4

    I'm getting a javax.crypto.BadPaddingException: pad block corrupted Exception while working on converting our existing java jdk 1.2 to java 1.4. Any suggestions would be great. Here are the specifics:
    We have a web application that been running for 3+ years under java jdk 1.2 & jce_1_2.jar. Within the application we are exchanging data (XML) with a customer using the following encryption scheme:
    1) We create a one time DESede key through the KeyGenerator class passing in ("DESede", "BC")
    2) We encrypt the data with this one time key using ("DESede/ECB/PKCS5Padding", "BC")
    3) This one time key is then encrypted using ("RSA/ECB/PKCS1Padding", "BC") and customer's public key
    4) We create a signature with our private key, which they have the public key for.
    This is process/api that we required to use for their API's and its worked fine under 1.2, with "ABA" as the provider. Now moving to 1.4, I'm using BouncyCastle as the provider.
    Other differences, the keystore was created under 1.2 and in 1.2 it was defined as "JCEKS" provider "SunJCE" under 1.4 I changed them to "JKS" and "SUN" . I would get bad header exceptions when reading from the keystore until I changed it. I don't think its the BouncyCastle since I was able to download the 1.2 version of BC and get the existing app to work and I also got the 1.4 version of BC to work under the existing 1.2 application.
    So something seems to be different with the algorithms/padding, but I can't seem to find it. I tried the following: "RSA" "RSA/ECB" "RSA//PKCS1Padding" "NoPadding" also changed the DESede algorithm with no luck. All I know is that its failing on the decryption of the one time key, since its failing on the customer side, I don't have much other insight into it, other then the exception that they sent me.
    More info: getting error on Java: build 1.4.2_02-b03 on Solaris 5.8
    Existing application running: Java JDK_1.2.2_10 on Solaris 5.8
    BouncyCastle: bcprov-jdk14-124.jar
    Thanks

    Here is the stackTrace that I was sent:
    20040804;10:29:37: javax.crypto.BadPaddingException: pad block corrupted
    20040804;10:29:37: at org.bouncycastle.jce.provider.JCEBlockCipher.engineDo
    Final(JCEBlockCipher.java:460)
    20040804;10:29:37: at javax.crypto.Cipher.doFinal(Cipher.java:1129)
    20040804;10:29:37: at com.customer.crypto.SymmetricCryptor.decrypt(SymmetricCryptor.java:105)
    20040804;10:29:37: at com.customer.crypto.SymmetricCryptor.decryptToStr
    ing(SymmetricCryptor.java:95)
    20040804;10:29:37: at com.customer.api.Data.DataServlet doPost(DataServlet.java:88)

  • BadPaddingException: pad block corrupted when using Java 1.4

    I'm getting a javax.crypto.BadPaddingException: pad block corrupted Exception while working on converting our existing java jdk 1.2 to java 1.4. Any suggestions would be great. Here are the specifics:
    We have a web application that been running for 3+ years under java jdk 1.2 & jce_1_2.jar. Within the application we are exchanging data (XML) with a customer using the following encryption scheme:
    1) We create a one time DESede key through the KeyGenerator class passing in ("DESede", "BC")
    2) We encrypt the data with this one time key using ("DESede/ECB/PKCS5Padding", "BC")
    3) This one time key is then encrypted using ("RSA/ECB/PKCS1Padding", "BC") and customer's public key
    4) We create a signature with our private key, which they have the public key for.
    This is process/api that we required to use for their API's and its worked fine under 1.2, with "ABA" as the provider. Now moving to 1.4, I'm using BouncyCastle as the provider.
    Other differences, the keystore was created under 1.2 and in 1.2 it was defined as "JCEKS" provider "SunJCE" under 1.4 I changed them to "JKS" and "SUN" . I would get bad header exceptions when reading from the keystore until I changed it. I don't think its the BouncyCastle since I was able to download the 1.2 version of BC and get the existing app to work and I also got the 1.4 version of BC to work under the existing 1.2 application.
    So something seems to be different with the algorithms/padding, but I can't seem to find it. I tried the following: "RSA" "RSA/ECB" "RSA//PKCS1Padding" "NoPadding" also changed the DESede algorithm with no luck. All I know is that its failing on the decryption of the one time key, since its failing on the customer side, I don't have much other insight into it, other then the exception that they sent me.
    More info: getting error on Java: build 1.4.2_02-b03 on Solaris 5.8
    Existing application running: Java JDK_1.2.2_10 on Solaris 5.8
    BouncyCastle: bcprov-jdk14-124.jar
    Here is the stackTrace that I was sent:
    20040804;10:29:37: javax.crypto.BadPaddingException: pad block corrupted
    20040804;10:29:37: at org.bouncycastle.jce.provider.JCEBlockCipher.engineDo
    Final(JCEBlockCipher.java:460)
    20040804;10:29:37: at javax.crypto.Cipher.doFinal(Cipher.java:1129)
    20040804;10:29:37: at com.customer.crypto.SymmetricCryptor.decrypt(SymmetricCryptor.java:105)
    20040804;10:29:37: at com.customer.crypto.SymmetricCryptor.decryptToStr
    ing(SymmetricCryptor.java:95)
    20040804;10:29:37: at com.customer.api.Data.DataServlet doPost(DataServlet.java:88)
    Thanks

    Well from what I read about this issue, seems the biggest issue is using the wrong keys. Well since this data exchange has been in production for 3+ years, I pretty certain its not the keys. To verify this i did:
    1) From a server running JDK 1.2 and ran this process successfully, so I copied the keystore from this server to the server I was running 1.4 and reran the same data through. I still got the exception.
    2) From another post I read about the difference in keys between older versions of Java and 1.4, so modifying the code listed and then exported my private key while running under 1.2 and created a new 1.4 keystore and imported this key & certificate. I'm still getting the exception.
    Any ideas would be great.
    Thanks

  • Javax.crypto.BadPaddingException: pad block corrupted with 1.4

    I'm getting a javax.crypto.BadPaddingException: pad block corrupted Exception while working on converting our existing java jdk 1.2 to java 1.4. Any suggestions would be great. Here are the specifics:
    We have a web application that been running for several years under java jdk 1.2 & jce_1_2.jar. Within the application we are exchanging data (XML) with a customer using the following encryption scheme:
    1) We create a one time DESede key through the KeyGenerator class passing in ("DESede", "BC")
    2) We encrypt the data with this one time key using ("DESede/ECB/PKCS5Padding", "BC")
    3) This one time key is then encrypted using ("RSA/ECB/PKCS1Padding", "BC") and customer's public key
    4) We create a signature with our private key, which they have the public key for.
    This is process/api that we had to use for their API's and its worked fine under 1.2, with "ABA" as the provider. Now moving to 1.4, I'm using BouncyCastle as the provider.
    Other differences, the keystore in 1.2 was defined as "JCEKS" provider "SunJCE" under 1.4 I changed them to "JKS" and "SUN" . I would get bad header exceptions from keystore until I changed it. I don't think its the BouncyCastle since I was able to download the 1.2 version of BC and get the existing app to work and I also got the 1.4 version of BC to work under the existing 1.2 application.
    So something seems to be different with the algorithms/padding, but I can't seem to find it. I tried the following: "RSA" "RSA/ECB" "RSA//PKCS1Padding" "NoPadding" also changed the DESede algorithm with no luck. All I know is that its failing on the decryption of the one time key.
    Thanks

    http://forum.java.sun.com/forum.jsp?forum=60 is probably a better place to post this.

  • Wrap/Unwrap error InvalidKeyException: pad block corrupted...???

    get this error:
    java.security.InvalidKeyException: pad block corrupted
            at org.bouncycastle.jce.provider.WrapCipherSpi.engineUnwrap(WrapCipherSpi.java:298)
            at javax.crypto.Cipher.unwrap(DashoA6275)
            at Slave$1.onArrival(Slave.java:329)
            at com.ibm.aglet.Aglet.processMobilityEvent(Unknown Source)
            at com.ibm.aglet.Aglet.dispatchEvent(Unknown Source)
            at com.ibm.aglets.LocalAgletRef.dispatchEvent(Unknown Source)
            at com.ibm.aglets.EventMessage.handle(Unknown Source)
            at com.ibm.aglets.AgletThread.run(Unknown Source)
    when trying to execute this code:
    KeyGenerator keyGen = KeyGenerator.getInstance("DES", "BC");
    Key unWrapKey = keyGen.generateKey();                                                                    
    Cipher keyCipher = Cipher.getInstance("Blowfish", "BC");
    keyCipher.init(Cipher.UNWRAP_MODE, unWrapKey);
    Key key = keyCipher.unwrap(encryptedKeyBytes, "DES", Cipher.SECRET_KEY);Anyone know what the problem might be?
    Thanks,
    blake

    Ok...I'm running into a problem here. What could be causing this "empty key" problem?? Line 335 is the last line in the code I have given...
    Here's the section of code:
    KeyStore keyStore = KeyStore.getInstance("jks");
    InputStream in = new BufferedInputStream(new FileInputStream("C:\\Documents and Settings\\user\\.keystore"));
    keyStore.load(in, local_pass.toCharArray());
    in.close();
    //get private key
    PrivateKey RSAPrivKey = (PrivateKey)keyStore.getKey("rsacryptokey", local_pass.toCharArray());
    //unwrap secret key                                                                                                                                            
    Cipher RSAKeyCipher = Cipher.getInstance("RSA", "BC");
    RSAKeyCipher.init(Cipher.UNWRAP_MODE, RSAPrivKey);
    Key key = RSAKeyCipher.unwrap(encryptedKeyBytes, "DESede", Cipher.SECRET_KEY);Here?s the error:
    java.lang.IllegalArgumentException: Empty key
           at javax.crypto.spec.SecretKeySpec.<init>(DashoA6275)           
           at org.bouncycastle.jce.provider.WrapCipherSpi.engineUnwrap(WrapCipherSpi.java:307)
            at javax.crypto.Cipher.unwrap(DashoA6275)
            at Slave$1.onArrival(Slave.java:335)
            at com.ibm.aglet.Aglet.processMobilityEvent(Unknown Source)

  • Block corruption - cant restore from backup

    Hi,
    we have development database 11.2.0.1. There was problem with storage, and as a result there are two corrupted blocks in data files.
    SQL> select * from V$DATABASE_BLOCK_CORRUPTION;
    FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO
    6 2359942 1 0 FRACTURED
    25 1855622 1 0 FRACTURED
    I have scheduled weekly full backup and daily incremental backup using EM so now I want to use rman to perform media recovery on corrupted blocks. However rman says there is no backup for affected data files (see below)
    RMAN> RECOVER CORRUPTION LIST;
    Starting recover at 03-NOV-12
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    using channel ORA_DISK_3
    using channel ORA_DISK_4
    using channel ORA_DISK_5
    channel ORA_DISK_1: restoring block(s)
    channel ORA_DISK_1: specifying block(s) to restore from backup set
    restoring blocks of datafile 00006
    channel ORA_DISK_1: reading from backup piece /opt/oraBackup/rman/i2npb3o9_1_1
    channel ORA_DISK_1: piece handle=/opt/oraBackup/rman/i2npb3o9_1_1 tag=BACKUP_FULL_110212103009
    channel ORA_DISK_1: restored block(s) from backup piece 1
    channel ORA_DISK_1: block restore complete, elapsed time: 00:42:35
    channel ORA_DISK_1: restoring block(s)
    channel ORA_DISK_1: specifying block(s) to restore from backup set
    restoring blocks of datafile 00025
    channel ORA_DISK_1: reading from backup piece /opt/oraBackup/rman/i9npbd5e_1_1
    channel ORA_DISK_1: piece handle=/opt/oraBackup/rman/i9npbd5e_1_1 tag=BACKUP_FULL_110212103009
    channel ORA_DISK_1: restored block(s) from backup piece 1
    channel ORA_DISK_1: block restore complete, elapsed time: 00:16:35
    failover to previous backup
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of recover command at 11/03/2012 11:59:29
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 25 found to restore
    RMAN-06023: no backup or copy of datafile 6 found to restore
    I dont understand this, because the backups are performed weekly and daily and all files are at their proper location. When I check the EM backup reports, I see COMPLETED for every weekly and daily backup.
    Anyone please could suggest how to repair the blocks from backups ?

    Hi people, I am back to this issue. I have found this in the database
    SQL> select * from v$backup_corruption;
         RECID      STAMP  SET_STAMP  SET_COUNT     PIECE#      FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# MAR CORRUPTIO
             1  796949262  796948233       9293          1          6    2359942          1                  0 NO  CORRUPT
             2  796953328  796949174       9300          1         25    1855622          1                  0 NO  CORRUPT
             3  797035604  797034635       9318          1          6    2359942          1                  0 NO  CORRUPT
             4  797039692  797035556       9325          1         25    1855622          1                  0 NO  CORRUPT
             5  797134390  797121030       9343          1          6    2359942          1                  0 NO  CORRUPT
             6  797137228  797134397       9368          1         25    1855622          1                  0 NO  CORRUPT
             7  797739951  797725854       9590          1          6    2359942          1                  0 NO  CORRUPT
             8  797744507  797739957       9597          1         25    1855622          1                  0 NO  CORRUPT
             9  798340269  798330633       9794          1          6    2359942          1                  0 NO  CORRUPT
            10  798343497  798340270       9801          1         25    1855622          1                  0 NO  CORRUPTSo the backup contains corrupted blocks. Right ? Older backups are already gone because of retention policy.
    I have set up the backup using Enterprise Manager - Schedule Backup.
    What I need to know is how to avoid taking backup with corrupted blocks in future. I need such backup to fail.
    Thank you for advices and regards.

  • Help: Jbo Exception non blocking when using table cell renderer?

    Hi,
    JClient 9.5.2.
    When using Table Cell Renderer on an table cell attribute that is defined mandatory and activating the insert button, the (oracle.jbo.AttrValException) JBO-27014 exception is caught but it is not blocking and a new row is still inserted.
    The JClient component demo, table attribute list, has the same behaviour.
    You can add multiple rows even if not all required attributes have been documented.
    Can a Swing specialist help me on this one?
    Example of Table Cell Renderer:
    public class TableBasicStatusRenderer extends DefaultTableCellRenderer
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
    int row, int column)
    JLabel lb = new JLabel((String) StaticData.getStatusName(value)); // retrieves label from Map
    return lb;
    Regards
    Frederic

    Hi,
    I found something interesting, it could be a WORKAROUND!
    I noticed that in another detail panel with table layout the JBO exception was blocking and adding another row before completing the row was NOT possible.
    In the create method of the entity object of the displayed View Object I iterate over the detail row iterator to retrieve a maximum value.
    By the end of the method the pointer is positionned after the last row.
    So I added to the detail panel that doesn't block following code:
    In create method of detail Entity Object Impl (only one entity object involved for this View)
    // Retrieve master EntityObjectImpl from association:
    PostalTariffImpl postalTariffImpl = getPostalTariffAssoc();
    // Retrieve detail default row iterator
    RowIterator ri = postalTariffImpl.getPostalDetailGroupAssoc();
    // Position pointer after last row
    ri.last();
    ri.next();
    Question: Why does this solve the problem?
    Regards
    Frederic
    PS Les mysteres de l'informatique!

  • How to overcome Block corruption using RMAN

    Hi All,
    How to overcome bolck corruption using RMAN. What is the procedure to do so.
    Thanks & Regards
    J.Venugopal

    Hi all,
    I´ve performed the following command on RMAN:
    RMAN> BACKUP VALIDATE CHECK LOGICAL DATABASE ARCHIVELOG ALL;After, I query the V$DATABASE_BLOCK_CORRUPTION table, and the below records
    was returned:
         FILE#     BLOCK#     BLOCKS CORRUPTION_CHANGE# CORRUPTIO
            67       4670          1         1202832866 LOGICAL
            68     154131        338         1175601952 LOGICAL
            68     155329         60         1174783128 LOGICAL
            68     155409         60         1174783132 LOGICAL
            68     155471         78         1174783135 LOGICAL
            68     155551         78         1174783139 LOGICAL
            68     155631         18         1174783143 LOGICAL
            68     155651         18         1174783144 LOGICAL
            68     155671         18         1174783145 LOGICAL
            68     155691         18         1174783146 LOGICAL
            68     155711         18         1174783147 LOGICAL
            68     155731         18         1174783148 LOGICAL
            68     155751         18         1174783149 LOGICAL
            68     155771         78         1174783150 LOGICAL
            68     155851         78         1174783154 LOGICAL
            68     155931         49         1174783158 LOGICAL
            73     165758          1         1180191676 LOGICALSo, when I try to recover these blocks by using blockrecover command, I got the error:
    RMAN> blockrecover corruption list;
    Starting blockrecover at 27-SEP-07
    using channel ORA_DISK_1
    using channel ORA_DISK_2
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of blockrecover command at 09/27/2007 10:22:10
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 73 found to restore
    RMAN-06023: no backup or copy of datafile 68 found to restore
    RMAN-06023: no backup or copy of datafile 67 found to restoreWhat can I do in this case?
    Thank U very much!
    []´s

  • I have iPad, my wife's iPone 4 and my new iPhone 4s all on iOS 5 and using the same Apple account. That is convenient in many ways except I can't use iMessage from my iPad and iPhone to my wife's iPhome. Any solution?

    When iMessage is enabled on all 3 devices, they just seem to mirror all iMessage conversations on all of them. Can I configure iMessage for my wife's iPhone such that it becomes a separate entity with that respect while staying on the same Appte account with other our devices?

    Actually, there is a solution, and it sounds to go against what you want until you realize how well it works.
    Seperate Apple IDs is the solution, but you can granularly sign into different things with different IDs.  Now, I'm in the exact same situation as you and saw the exact same problem.  Here was our solution:
    1) Create new Apple IDs for everyone that didn't already have one.  This meant my wife and daughter needed new IDs.
    2) Go into Settings -> Message and select "Receive At..."
    3) Change the Apple ID in iMessage on a per-device basis to the new ID for who ever owns that device.  For example, the new ID for my wife went on her phone, same with my daughter.
    Apple IDs are free, and you don't have to change the ID on every part of your phone.  For example, we still have the generic family ID on iCloud and the store, but we have our own unique ones signed in on iMessage and Game Center.  From what I can tell, this is the best of both worlds.

  • Checking block corruption, why in alert it is saying Error in trace file

    Hi,
    I am using Oracle 10g 10.2.0.1 with linux 32 bit
    I wanted to check block corruption using RMAN by following statement
    backup validate check logical database;
    when i executed the statement, following was the output
    Starting backup at 09-MAY-08
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=91 devtype=DISK
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    input datafile fno=00004 name=/u01/app/oracle/oradata/test/users01.dbf
    input datafile fno=00008 name=/u01/app/oracle/oradata/test/workflowuser
    input datafile fno=00001 name=/u01/app/oracle/oradata/test/system01.dbf
    input datafile fno=00003 name=/u01/app/oracle/oradata/test/sysaux01.dbf
    input datafile fno=00010 name=/u01/app/oracle/oradata/test/ifan
    input datafile fno=00002 name=/u01/app/oracle/oradata/test/undotbs01.dbf
    input datafile fno=00007 name=/u01/app/oracle/oradata/test/taker
    input datafile fno=00009 name=/u01/app/oracle/oradata/test/testing1
    input datafile fno=00005 name=/u01/app/oracle/oradata/test/brokerdb
    input datafile fno=00006 name=/u01/app/oracle/oradata/test/moneio
    input datafile fno=00011 name=/u01/app/oracle/oradata/test/web1
    input datafile fno=00012 name=/u01/app/oracle/oradata/test/e1
    input datafile fno=00013 name=/u01/app/oracle/oradata/test/ind1
    channel ORA_DISK_1: backup set complete, elapsed time: 00:06:57
    channel ORA_DISK_1: starting full datafile backupset
    channel ORA_DISK_1: specifying datafile(s) in backupset
    including current control file in backupset
    including current SPFILE in backupset
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
    Finished backup at 09-MAY-08
    and when i do the following query
    select * from v$database_block_corruption in sqlplus
    then there was no row
    so it means there is no logical corruption, but when i am looking at alert log file it is giving following lines
    Fri May 9 10:14:04 2008
    Errors in file /u01/app/oracle/admin/test/udump/test_ora_6606.trc:
    Fri May 9 10:14:04 2008
    Errors in file /u01/app/oracle/admin/test/udump/test_ora_6606.trc:
    Fri May 9 10:14:04 2008
    Errors in file /u01/app/oracle/admin/test/udump/test_ora_6606.trc
    and in above trace file following contents
    /u01/app/oracle/admin/test4/udump/test_ora_6606.trc
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1
    System name: Linux
    Node name: test
    Release: 2.6.18-5-686
    Version: #1 SMP Wed Oct 3 00:12:50 UTC 2007
    Machine: i686
    Instance name: test
    Redo thread mounted by this instance: 1
    Oracle process number: 61
    Unix process pid: 6606, image: oracle@test (TNS V1-V3)
    *** 2008-05-09 10:14:04.093
    *** ACTION NAME:(0000040 STARTED19) 2008-05-09 10:14:04.071
    *** MODULE NAME:(backup full datafile) 2008-05-09 10:14:04.071
    *** SERVICE NAME:(SYS$USERS) 2008-05-09 10:14:04.071
    *** SESSION ID:(91.40318) 2008-05-09 10:14:04.071
    Is it normal, why the in alert file it is saying that Error in.
    And it did not create any backupset in folder of flash recovery but in Enterprise manager it is showing last backup on 09-may-2008, why ?
    Regards,

    See logical corruption is normally termed as the internal inconsistancy within the block which is not caused by Oracle but by the user.So if you find internal inconsistancy than the best option is to look at the user and ask him to get the values sorted out.If the internal inconsistancy is some thig like index fragmentation sort of things or index entry pointing to a null rowid than they are termed as the logical corruption and they should not impact your normal as he data is already there and there is no issue in reading the block as such.
    The term "corrupted blocks" I would call both in the tables and backup for those data blocks which are unreadable by Oracle which actualy is Physical corruption.
    If i am doing the checking at 2:00 am, does it take more than two hours.I didnt understand this.
    what can we do for Physical corruptionThis will need the block to be recovered with the Block Recover command of RMAN and a good backup.Read about it here,
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta010.htm
    About the Logical and Physical corruption checks , check here
    http://download-west.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmconc1012.htm
    Aman....

  • Use of raise in exception handling block

    what is the use of raise in exception handling block for eg.
    declare
    a number;
    b emp.empno%type;
    begin
    begin
    SELECT empno INTO a FROM emp where 1=2;
    exception
    when others then
    dbms_output.put_line('inner');
    raise;
    end;
    exception
    when no_data_found then
    dbms_output.put_line('outer');
    end;
    output will be like below ..
    inner
    outer
    PL/SQL procedure successfully completed.
    my question is wht is the use of using raise in exception handing part, is there any specific reason we use in the development ????
    Regards,
    AAK.

    In the first block, you do not raise you user-defined exception WHEN_NO_DATA_FOUND, but the predefined one, which is raised to the WHEN OTHERS exception handler.
    Consider:
    SQL> declare
      2     a number;
      3     my_err exception;
      4     no_data_found exception;
      5  begin
      6     begin
      7        select 1 into a from dual where 1=2;
      8     exception
      9     when no_data_found then
    10        dbms_output.put_line(' In system defined');
    11        raise my_err;
    12     end;
    13  exception
    14     when my_err then
    15        dbms_output.put_line('In User Defined');
    16     when others then
    17        declare
    18           v_sqlerrm varchar2(100);
    19        begin
    20           v_sqlerrm := sqlerrm;
    21        dbms_output.put_line(' In when others '||sqlerrm);
    22        end;
    23  end;
    24  /
    In when others ORA-01403: no data found
    PL/SQL procedure successfully completed.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2     a number;
      3     my_err exception;
      4     --no_data_found exception;
      5  begin
      6     begin
      7        select 1 into a from dual where 1=2;
      8     exception
      9     when no_data_found then
    10        dbms_output.put_line(' In system defined');
    11        raise my_err;
    12     end;
    13  exception
    14     when my_err then
    15        dbms_output.put_line('In User Defined');
    16     when others then
    17        declare
    18           v_sqlerrm varchar2(100);
    19        begin
    20           v_sqlerrm := sqlerrm;
    21        dbms_output.put_line(' In when others '||sqlerrm);
    22        end;
    23* end;
    SQL> /
    In system defined
    In User Defined
    PL/SQL procedure successfully completed.
    SQL>Note that in the second block, I deleted the declaration of the user defined exception NO_DATA_FOUND.
    This is taken from the documentation:
    Redeclaring Predefined Exceptions
    Remember, PL/SQL declares predefined exceptions globally in package STANDARD, so you need not declare them yourself. Redeclaring predefined exceptions is error prone because your local declaration overrides the global declaration. For example, if you declare an exception named invalid_number and then PL/SQL raises the predefined exception INVALID_NUMBER internally, a handler written for INVALID_NUMBER will not catch the internal exception. In such cases, you must use dot notation to specify the predefined exception, as follows:
    EXCEPTION
      WHEN invalid_number OR STANDARD.INVALID_NUMBER THEN
        -- handle the error
    END;You can read yourself :
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14261/errors.htm
    Regards,
    Gerd

  • Oracle giving Block corruption errors when using CDC for sending the data to SQL Server 2012

    Hello Friends,
    We are facing an error while using CDC with Oracle. It is a "Block corruption" error, which indicates at some level of data corruption. We ran RMAN validate command to scan the database for corruption but it returned with no errors, however he
    Alert Log in Oracle is still coming up with the following error. Has anyone experienced this error when using Oracle Standard Edition and SQL 2012 ?
    Trace file e:\app\pulse-ad\diag\rdbms\orcl\orcl\trace\orcl_ora_5992.trc
    Oracle Database 11g Release 11.1.0.7.0 - 64bit Production
    Windows Server 2003 Version V5.2 Service Pack 2
    CPU                 : 4 - type 8664, 4 Physical Cores
    Process Affinity    : 0x0000000000000000
    Memory (Avail/Total): Ph:6782M/24575M, Ph+PgF:12203M/30844M
    Instance name: orcl
    Redo thread mounted by this instance: 1
    Oracle process number: 151
    Windows thread id: 5992, image: ORACLE.EXE (SHAD)
    *** 2013-12-12 03:04:33.655
    *** SESSION ID:(1281.3832) 2013-12-12 03:04:33.655
    *** CLIENT ID:() 2013-12-12 03:04:33.655
    *** SERVICE NAME:(orcl) 2013-12-12 03:04:33.655
    *** MODULE NAME:(xdbcdcsvc.exe) 2013-12-12 03:04:33.655
    *** ACTION NAME:() 2013-12-12 03:04:33.655
    Lost-write detected for sequence 70856. The lost-write starts occurring in block 11193. The current block being validating is 12930.
    Block dump of the first lost-write block:
    Flag: 0x1 Format: 0x22 Block: 0x00002bb9 Seq: 0x000114bf Beg: 0x94 Cks:0x68ee
    Dump of memory from 0x0000000598D06C00 to 0x0000000598D06E00
    598D06C00 00002201 00002BB9 000114BF 68EE8094  [."...+.........h]
    598D06C10 00085BF1 0023BDA1 000DE19C 000DE19C  [.[....#.........]
    598D06C20 0000000C 00000000 2209160A 5BF10000  [..........."...[]
    598D06C30 3EB10502 00C0F5CA 0031BDA1 00010205  [...>......1.....]
    598D06C40 02B22C6A 038A6D69 00000001 00000000  [j,..im..........]
    598D06C50 4D554407 30373230 35BB0206 001100AE  [.DUM0270...5....]
    598D06C60 0001040A 000D000E 038A6D69 56B25735  [........im..5W.V]
    598D06C70 729C0003 E19C0001 000C0006 000D0006  [...r............]
    598D06C80 02BB0502 00C0F5CD 0023BDA1 000A0002  [..........#.....]
    598D06C90 00C00013 000000D0 00030201 56B25736  [............6W.V]
    598D06CA0 03890001 00000000 00000000 002E0105  [................]
    598D06CB0 FFFF0003 00C0F5CD 56B25736 3EB10003  [........6W.V...>]
    598D06CC0 FFFF0024 0014000C 000C0018 00120014  [$...............]
    598D06CD0 09CC0058 E75B0022 0009000F 00085BF1  [X...".[......[..]
    598D06CE0 0024BDA1 000DE19D 000DE19D 0000000C  [..$.............]
    598D06CF0 00000000 2309160A 5BF10000 3EB10502  [.......#...[...>]
    598D06D00 00C0F5CD 0020BDA1 00010205 02B22C72  [...... .....r,..]
    598D06D10 03900974 00000019 00000000 3030300A  [t............000]
    598D06D20 33303030 06323132 AE35BB02 0B441100  [0003212...5...D.]
    598D06D30 0001040A 000D000E 03900974 56B25736  [........t...6W.V]
    598D06D40 729C0003 E19D0011 000C0006 000D0006  [...r............]
    598D06D50 02BB0502 00C0F5CD 0024BDA1 00EA0002  [..........$.....]
    598D06D60 00270016 000001FC 00032C01 56B25736  [..'......,..6W.V]
    598D06D70 00000001 00000000 30393007 002E0105  [.........090....]
    598D06D80 FFFF0003 00C0F5CD 56B25736 00000003  [........6W.V....]
    598D06D90 FFFF0025 00140052 000C0018 00070035  [%...R.......5...]
    598D06DA0 0003000A 00070003 0001001D 00030001  [................]
    598D06DB0 00010001 00010001 00010001 00010001  [................]
    598D06DC0 00010001 00010001 00010001 00010001  [................]
    598D06DD0 00010001 00000001 00010001 00010001  [................]
    598D06DE0 00010001 00000014 09720174 00000022  [........t.r."...]
    598D06DF0 0009000F 00085BF1 0025BDA1 000DE19A  [.....[....%.....]
    Block dump of the current block being validating:
    Flag: 0x1 Format: 0x22 Block: 0x00003282 Seq: 0x000114c8 Beg: 0x0 Cks:0x312a
    Dump of memory from 0x0000000598DDFE00 to 0x0000000598DE0000
    598DDFE00 00002201 00003282 000114C8 312A8000  [."...2........*1]
    598DDFE10 50424703 31303607 34353335 69745319  [.GBP.6015354.Sti]
    598DDFE20 6E696C72 72502067 6375646F 4C207374  [rling Products L]
    598DDFE30 4E206474 C3025650 0380013D 0457454E  [td NPV..=...NEW.]
    598DDFE40 4E1E09C2 1E09C204 10C2024E 1E09C204  [...N....N.......]
    598DDFE50 09C2044E C2024E1E 03C30510 021B0929  [N....N......)...]
    598DDFE60 C3053DC3 0F192602 2602C305 C3050F19  [.=...&.....&....]
    598DDFE70 0C1A6203 5102C105 C2041F4E 044E1E09  [.b.....QN.....N.]
    598DDFE80 4E1E09C2 0410C202 4E1E09C2 1E09C204  [...N.......N....]
    598DDFE90 10C2024E 2903C305 78071B09 011D0B71  [N......)...xq...]
    598DDFEA0 BF020101 1FBF0215 4E018001 53014E01  [...........N.N.S]
    598DDFEB0 0723002C 0B0C7178 0A3C3C18 30303030  [,.#.xq...<<.0000]
    598DDFEC0 33373030 4D033337 47034255 36075042  [007373.MUB.GBP.6]
    598DDFED0 38333936 4E113331 2065776B 74616C50  [693813.Nkwe Plat]
    598DDFEE0 6D756E69 56504E20 0B0AC303 4E038001  [inum NPV.......N]
    598DDFEF0 C2045745 0459512E 59512EC2 5253C203  [EW...QY...QY..SR]
    598DDFF00 512EC204 2EC20459 C2035951 C3055253  [...QY...QY..SR..]
    598DDFF10 1B092903 0B0AC303 3C04C305 C3053239  [.).........<92..]
    598DDFF20 32393C04 4F08C305 C105114F 1F4E5102  [.<92...OO....QN.]
    598DDFF30 512EC204 2EC20459 C2035951 C2045253  [...QY...QY..SR..]
    598DDFF40 0459512E 59512EC2 5253C203 2903C305  [.QY...QY..SR...)]
    598DDFF50 78071B09 01190A71 C0030101 C0034709  [...xq........G..]
    598DDFF60 8001330A 4E014E01 002C5301 71780723  [.3...N.N.S,.#.xq]
    598DDFF70 3C180B0C 30300A3C 30303030 33373337  [...<<.0000007373]
    598DDFF80 42554D03 50424703 31304207 344C5131  [.MUB.GBP.B011QL4]
    598DDFF90 6F725020 63657073 614A2074 206E6170  [ Prospect Japan ]
    598DDFFA0 646E7546 64724F20 44535520 30302E30  [Fund Ord USD0.00]
    598DDFFB0 04C30331 03800133 0557454E 5B1603C3  [1...3...NEW....[]
    598DDFFC0 03C30521 04215B16 1F4004C3 1603C305  [!....[!...@.....]
    598DDFFD0 C305215B 215B1603 4004C304 03C3051F  [[!....[!...@....]
    598DDFFE0 031B0929 043304C3 4D245AC2 245AC204  [).....3..Z$M..Z$]
    598DDFFF0 02C3054D 040A1A18 494002C1 1603C305  [M.........@I....]
    *** 2013-12-12 03:05:07.984
    ** LOGMINER WARNING - Invalidated 6 LCRs **
    Complete dump of first invalid START LCR follows:
    ++  LCR Dump Begin: 0x0000000532C004E0 - CANNOT_SUPPORT
         op: 255, Original op: 3, baseobjn: 0, objn: 233316, objv: 1
         DF: 0x00000002, DF2: 0x00000000, MF: 0x00000000, MF2: 0x00000000
         PF: 0x40000001, PF2: 0x00002000
         MergeFlag: 0x00, FilterFlag: 0x00
         Id: 0, iotPrimaryKeyCount: 3, numChgRec: 4
         NumCrSpilled: 0
         RedoThread#: 1, rba: 0x0114c8.0001c6ce.00d4
         scn: 0x0003.56b593be, xid: 0x0008.00c.00100d85, pxid: 0x0008.00c.00100d85
         ncol: 0newcount: 0, oldcount: 0
         LUBA: 0x3.c109c0.c.15.38f64
    Thanks
    Dee

    Hi Dee,
    Thank you for your question.
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
    Thank you for your understanding and support.
    Regards,
    Mike Yin
    TechNet Community Support

  • I pad Blocked.. can i still wifi from another device?

    Hi.
    so my i pad is apparently going to have the imei blocked (even though i pay for the device, the supplier want to block it) can anyone tell me if even if the device is blocked to using sim etc, can i wifi to it from another device? i dont see why i cant.

    so i CAN link the ipad to another device that is connected to the internet and use it that way, still check emial, download apps etc.
    they can only block the device from directly linking to the internet??

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • I plan on buying a new  I Pad wit wifi and cell from Apple. But  I don't want to select a cell carrier right now. Q 1: Do I have to select a carrier at purchase? and Q 2, In the meantime will I be able to get on line at home using my Cox Internet wi fi co

    I plan on buying a new  I Pad wit wifi and cell from Apple. But  I don't want to select a cell carrier right now. Q 1: Do I have to select a carrier at purchase? and Q 2, In the meantime will I be able to get on line at home using my Cox Internet wi fi? Thanks. 

    Thanks for the help. Now I can feel comfortable in not having to sign up for cellular when I buy, esp. Since I'll be using my new IPad mostly at home on my Cox wi fi. Then I can see, in using the i pad, how often I'd actually use the cellular, and where. This can help decide which type of cell plan I get. Small problem it may seem, but a very helpful answer. Thanks.

Maybe you are looking for

  • Work Outlook mail to my Mac

    I work on Windows at work (ARGHH!) and have an Outlook account. I want my Outlook mail to go to my Mac at home b/c I work from home quite a bit and aparently I cannot connect my Mac to our work server remotely. How do I do this? Should I set it up to

  • Edit Icon button grayed out.

    When I go to edit the icon picture for some, but not all, of my Keyword Tags, the Edit Icon button is grayed out and unavailable. Did I do something incorrect when creating these Keyword Tags? Other Tags can be changed but not all of them.

  • Unable to save over existing photoshop cs6 file using smb file share

    The issue has been noted in 10.7 and 10.8. As a test, SMB did the same thing running from OSX Server but worked fine using AFP on OSX Server. The shared directory being used is on Windows Server 2008 R2.

  • Error installing shared technologies

    When installing PE-12, unable to install shared technologies. Error reported and installation is rolled back. I've tried all hints I could find online. Still looking for one that works.

  • Flash Player interactive buttons not working

    I have been having this issue for months as far as I can tell. Multiple websites have this problem where I click on a button (not a link) such as a "play" or "share" button and nothing happens. These same buttons work on other computers however. I we