Thursday, 4 July 2013

Too large for the destination file system usb

I got new pen drive, getting the below error while copying the file to the pen drive. File size is 4.3 GB.


Reason for the below error message:
File size was 4.3 GB in size and my pen drive was formatted in FAT32 format. The max file size for FAT32 is 4GB. The max file size for FAT16 is only 2GB!

How to fix the issue:
 Run this command in command prompt:
        convert d: /fs:ntfs

d => D drive.

This commnad will covert FAT file system in NTFS. 

Enjoy to copy !!

Monday, 10 June 2013

Failed to get Database connection and its hangin with OracleDriver - Linux

Issue:
          Failed to get database connection from Oracle DriverManager. Its hanging with Linux Layer.

Code for creating the connection:
  Class.forName("oracle.jdbc.driver.OracleDriver");
        String url = getJDBCUrl(credentials.getDbServer());

        final Connection con = DriverManager.getConnection(url, credentials.getUserName(), credentials.getPassword());
        con.setAutoCommit(autoCommit);


Observed Error message from the Java:
java.sql.SQLRecoverableException: IO Error: Connection reset
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:428)
        at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:536)
        at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)

Root cause of the issue:
          The URL string is encoded and passed by the Oracle driver for security reason. For encoding the url string they are using some random number. In Linux, the random number is generated by the Oracle Driver with the help of /dev/random.

          The /dev/random is the default one to get the random number. The is a possibility of blocking the /dev/random access when entropy pool is full. Entropy pool might be full for the heavy loaded machine.

          The interesting thing is, we can’t find the root cause of this issue easily since some time block might be there and its gets freed in short span of time. Here is the man output as per Unix for random.
          When read, the /dev/random device will only return random bytes within the estimated number of bits of noise in the entropy pool. /dev/random should be suitable for uses that need very high quality randomness such as one-time pad or key generation. When the entropy pool is empty, reads from /dev/random will block until additional environmental noise is gathered.

Fix of the issue:
          We have expose JVM to use /dev/urandom instead of /dev/random. The /dev/urandom is an non-blocking queue. Here is the man pages details as per Unix for urandam.

A read from the /dev/urandom device will not block waiting for more entropy. As a result, if there is not sufficient entropy in the entropy pool, the returned values are theoretically vulnerable to a cryptographic attack on the algorithms used by the driver. Knowledge of how to do this is not available in the current non-classified literature, but it is theoretically possible that such an attack may exist. If this is a concern in your application, use /dev/random instead.

          Add the following JVM option to fix this issue:
                        -Djava.security.egd=file:///dev/urandom

ORA-19606: Cannot copy or restore to snapshot control file

Error:
      ORA-19606: Cannot copy or restore to snapshot control file

Cause for the Error Code from Oracle:
      A control file copy or restore operation specified the name of the snapshot control file as the output file. It is not permitted to overwrite the snapshot control file in this manner. Other methods are available to create the snapshot control file. 

Action to fix the error as per Oracle:
      Specify a different file name and retry the operation. If this is a restore, then the restore conversation remains active and more files may be specified.

Issue faced and exact Error observed in my system:
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     25     16-MAR-12          ~/oracle/base/product/11.2.0/dbhome_1/dbs/snapcf_wcs.f
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 06/06/2013 07:49:40
ORA-19606: Cannot copy or restore to snapshot control file

Solution to resolve the issue:

Solution -1:

Execute the below command before calling Command "DELETE NOPROMPT EXPIRED BACKUP":
“configure snapshot controlfile name to '/opt/oracle/base/product/11.2.0/dbhome_1/dbs/snapcf_wcs.f';".

Solution-2:


1) Run command “delete obsolete” in RMAN mode. This command will return snapfile

  RMAN> delete obsolete;                                                                                                                                                                                         
  Type                 Key    Completion Time    Filename/Handle
  -------------------- ------ ------------------ --------------------
  Control File Copy     40     30-11-2009 18:41:15 ~/oracle/product/11.2.0/dbhome_1/dbs/snapcf_tetris.f

  Do you really want to delete the above objects (enter YES or NO)? y                                                                                                                                           

  RMAN-06207: WARNING: 1 objects could not be deleted for DISK channel(s) due
  RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
  RMAN-06210: List of Mismatched objects
  RMAN-06211: ==========================
  RMAN-06212:   Object Type   Filename/Handle
  RMAN-06213: --------------- ---------------------------------------------------
  RMAN-06214: Datafile Copy   ~/oracle/product/11.2.0/dbhome_1/dbs/snapcf_tetris.f

2) Crosscheck the file. Like below

RMAN> crosscheck datafilecopy '~/oracle/product/11.2.0/dbhome_1/dbs/snapcf_tetris.f';                                                                                                                  

  using target database control file instead of recovery catalog

  allocated channel: ORA_DISK_1
  channel ORA_DISK_1: SID=148 device type=DISK
  allocated channel: ORA_DISK_2
  channel ORA_DISK_2: SID=140 device type=DISK

  RMAN-00571: ===========================================================
  RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  RMAN-00571: ===========================================================
  RMAN-03002: failure of crosscheck command at 11/30/2009 19:09:43
  RMAN-20230: datafile copy not found in the repository
  RMAN-06015: error while looking up datafile copy name: ~/oracle/product/11.2.0/dbhome_1/dbs/snapcf_tetris.f

3) Cross check the controlfile

  RMAN> crosscheck controlfilecopy '~/oracle/product/11.2.0/dbhome_1/dbs/snapcf_tetris.f';                                                                                                               

  released channel: ORA_DISK_1
  released channel: ORA_DISK_2
  allocated channel: ORA_DISK_1
  channel ORA_DISK_1: SID=148 device type=DISK
  allocated channel: ORA_DISK_2
  channel ORA_DISK_2: SID=140 device type=DISK

  validation failed for control file copy
  control file copy file name=~/oracle/product/11.2.0/dbhome_1/dbs/snapcf_tetris.f

  RECID=40 STAMP=704313675
  Crosschecked 1 objects