Friday, January 19, 2018

Change database JDBC URL from deployed ear file

When i would like to change database JDBC URL of deployed application in weblogic from console , it gave below error 

Console encountered the following error java.lang.IllegalArgumentException: [J2EE Deployment SPI:260140]Unable to remove descriptor bean 
weblogic.j2ee.descriptor.wl.JDBCPropertyBeanImpl@179efc1([MYAPP]/JDBCDriverParams/Properties/Properties[user]) due to 'Unable to remove bean since not defined in plan'. The remover should first check to see if the bean is removable in the deployment plan prior to removing it.

Of course there is a way to solve this issue at weblogic side , but i prefered changing database url from ear file directly changing related jdbc.xml file

Action Plan,


  • Stop WebLogic
  • Locate ear file of application 
  • Backup ear file 
  • Unzip ear file
    • unzip XXXX_myapp.ear
  • Change url entitiy in META-INF/MYAPP-jdbc.xml to desired url
  • Save MYAPP-jdbc.xml file
  • Using jar , update relate ear file
    • jar uvf XXXX_myapp.ear META-INF/MYAPP-jdbc.xml 
  • Start Weblogic
You can observe the change from weblogic console 

Friday, January 12, 2018

Capture DDL of Dumpfile

Sometimes dump files are wanted to import your system . But if you do not know source system structure import process can be trouble.Without knowing source tablespace , schema knowledge  import will produce errors .

In order to solve this issue and do successful import , impdp are called with sqlfile parameter to get all DDL statements . Output contains all DDL statements and all necessary statements can be captured .

impdp $DBUSER directory=$DIRECTORY dumpfile=$DUMPFILE.dmp sqlfile=impfile.sql

After executing above statement impfile.sql generated.For example tablespaces can be seen with ,

grep TABLESPACE impfile.sql

command which lists all "TABLESPACE" statements . You can create tablespaces according to output or "remap_tablespace" parameter for impdp is used to reconfigure tablespaces according to your system.

Thursday, January 4, 2018

ORA-01378 The logical block size error

For some reason client asked me to open production database in another environment until specific time.After successfull restore and recover process , clear logfile gave the below error ,

ORA-01378: The logical block size (4096) of file +RECO is not compatible with the disk sector size (media sector size is 512 and host sector size is 512)

Production system 's redo log files have 4K sector size and clearing log file on 512 byte is not possible.

Recreating controlfiles without redo logs statements which are 4K size has solved our issue.I have added new redo logfiles to system before recreating controlfile which area group 11,12,13

create controlfile reuse database "testdb" noresetlogs force logging archivelog
  maxlogfiles 
  max...
  ...
logfile2
   group 2('+RECO/TESTDB/log2a','+RECO/TESTDB/log2b') size 100M blocksize 4096,
   group 11('+RECO/TESTDB/log11a','+RECO/TESTDB/log11b') size 100M blocksize 512,
   group 12('+RECO/TESTDB/log12a','+RECO/TESTDB/log12b') size 100M blocksize 512
   group 13('+RECO/TESTDB/log13a','+RECO/TESTDB/log13b') size 100M blocksize 512
datafile
...
...


New Controlfile script : 

create controlfile reuse database "testdb" noresetlogs force logging archivelog
  maxlogfiles 
  max...
  ...
logfile2
   group 11('+RECO/TESTDB/log11a','+RECO/TESTDB/log11b') size 100M blocksize 512,
   group 12('+RECO/TESTDB/log12a','+RECO/TESTDB/log12b') size 100M blocksize 512
   group 13('+RECO/TESTDB/log13a','+RECO/TESTDB/log13b') size 100M blocksize 512
datafile
...
...