Tuesday, December 20, 2011

Flex: Cannot upload larger files

I had a very strange problem with my file upload in flex. While it was working for smaller files, it threw weird errors for large files ( files greater than 30MB or so)

I got "Error #2038: File I/O Error." some times, and then "SecurityError: Error #2000: No active security context." error.

After some wild google chase, figured out that the problem was coming from IIS Server and Flex is not reporting the error correctly.


By default, IIS rejects files larger than 4MB or so, In order to fix this I used to add the following.

<system.web>
<httpRuntime maxRequestLength="102400" executionTimeout="600" />    <!-- 100mb ,10 min-->
</system.web>


but for IIS 6 or IIS 7, You also need a new section to allow large file uploads (100MB in my case)


    <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits       maxAllowedContentLength="100000000"    />
      </requestFiltering>
    </security>   
  </system.webServer>

and this fixed it.

Monday, December 19, 2011

ORA-00600: internal error code, arguments: [kcratr_scan_lastbwr]

Launch SQL Plus from Oracle\bin folder ( not from Client folder)

SQL> conn sys/sys as sysdba
Connected to an idle instance.


SQL> startup mount;
ORACLE instance started.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [kcratr_scan_lastbwr], [], [], [],
[], [], [], [], [], [], [], []


SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.
Database mounted.

SQL> recover database;
Media recovery complete.

SQL> alter database open;
Database altered.

SQL> conn scott/tiger@orcldb
Connected.

Your database is good to go now, You better take a backup of your system.

Saturday, December 17, 2011

Plex Media Server: Unable to connect

Installed Plex Media server on Windows 7 Ultimate, and I always got unable to connect to localhost.

To fix, I just replaced Localhost in the URL with the IP Address as shown below, and it started working

So, I changed URL from

http://localhost:32400/manage

 to

http://127.0.1:32400/manage





Thursday, December 15, 2011

ORA-12560: TNS:protocol adapter error

ORA-12560: TNS:protocol adapter error

You get this error when the listeners port numbers dont match.

You have a port number (1521) specified in tnsnames.ora, There should be a correspondng listener running on the same port on the target database server. If the listener on the target database server is running on a different port, then you get this error.


ORA-12541: TNS:no listener

OK, Almost every body who have worked in Oracle would have seen this error message. This is one of most frustrating and most common error

What does "ORA-12541: TNS:no listener"  mean ?

This means, TNS Listener server is down on the target database server. Check if the listener is up and running.




If your database is running on a windows box, go to services on the database server and check the service is running.

ORA-12545: Connect failed because target host or object does not exist

OK, Almost everbody who has worked in Oracle would have seen this error message. This is one of most frustrating and most common error

What does "ORA-12545: Connect failed because target host or object does not exist"  mean ?


Say from SQLPlus, you are issuing the following command

SQL> Conn scott/tiger@orcldb;

SO, SQLPlus, looks for the entry "orcldb" in your client tnsnames.ora file.

In tnsnames.ora, you will find an entry something similar to this

orcldb=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <db_machine_name or ip address>)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = db_name)
    )
  )

so "ORA-12545: Connect failed because target host or object does not exist" means, either your db_machine_name/ip address is incorrect or your machine cannot connect to db_machinge_name/ip_address
for various reasons like network issues etc


ORA-12154: TNS:could not resolve the connect identifier specified

OK, Almost everbody who has worked in Oracle would have seen this error message. This is one of most frustrating and most common error

What does "ORA-12154: TNS:could not resolve the connect identifier specified"  mean ?


Say from SQLPlus, you are issuing the following command

SQL> Conn scott/tiger@orcldb;

SO, SQLPlus, looks for the entry "orcldb" in your client tnsnames.ora file.

If it cannot find orcldb in tnsnames.ora, then you get ORA-12154: TNS:could not resolve the connect identifier specified

 Fix your tnsnames.ora, and you should be fine.

Thursday, December 1, 2011

ORA-12638: Credential retrieval failed

Toad threw this error today, but I was able to connect to the database using SqlPlus.

The problem is coming from your sqlnet.ora

Check if your SQLNET.AUTHENTICATION_SERVICES.  It should be set to NONE instead of NTS

Old entry
SQLNET.AUTHENTICATION_SERVICES= (NTS)

Correct Entry
SQLNET.AUTHENTICATION_SERVICES= (NONE)

Monday, November 14, 2011

Flex: Disable button in Togglebuttonbar

say, you defined your toggle button bar as below

<mx:ToggleButtonBar id="tbbModule" itemClick="tbbModule_Click(event)">
          <mx:Array>
          <mx:String>Home</mx:String>
          <mx:String>Module 1</mx:String>
          <mx:String>Module 2</mx:String>
          </mx:Array>
      </mx:ToggleButtonBar>

If you want to disable the first button, then


mx.controls.Button(tbbModule.getChildAt(0)).enabled =false;

Wednesday, August 3, 2011

Oracle: Regular expression to extract text from rtf string

After few trial and errors, figured out a way to extract text from rtf string format.

with rtf as ( select
'{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}{\f1\fswiss\fcharset0 Arial;}{\f2\froman\fcharset0 Times New Roman;}}
{\colortbl ;\red0\green0\blue255;}
\viewkind4\uc1\pard\lang1033\f0\fs17 This is first line of rtf string with 01/02/1950 and some $10.20 with +ive sign
\par
\par e-mail second line rtf@rtf.com
\par \pard\sb100\sa100\cf1\lang1036\f1\fs24 Yes, Third line of rtf. \cf0\f2
\par \f1\fs20 some text \f2\fs24
\par \f1\fs20 123 456 abc 7890\f2\fs24
\par \pard\lang1033\f0\fs17
\par }' str from dual)
select str, regexp_replace(str, '({\\)(.*)(})|(\\[^ ]*)|(})') from rtf;

Here is the break down of Regular expression. It has 3 parts
({\\)(.*)(}) | (\\[^ ]*) | (})

Replace
1) Anything that starts with {\ followed by any any character(s) and ends with }
or
2) Any thing that starts with \ and not followed by a space
or
3) Replace the last }

Friday, July 22, 2011

Flex: Workspace in use or cannot be created

I have seen this annoying message more often in Flex Builder 3. It looks like the locks are not properly released when you quit Flex Builder.

If you get this error, You have 2 options

Option 1

  1. Go to Task Manager
  2. Kill FlexBuilder.exe
  3. Kill Javaaw.exe

Option 2
Restart your pc

Either option will resolve this for you.

Thursday, July 21, 2011

Data pump: Import multiple dump files

If the size of the dump file is large, usually they will be split into smaller chunks for easier ftp upload/download.

If you are trying to import a dump file that is split into many chunks, then you need to modify the DUMPFILE paratermeter to include %U

If the dump files are named EXP_PROD_1.dmp, EXP_PROD_2.dmp etc , then

DUMPFILE=EXP_PROD_%U.DMP

Tuesday, July 19, 2011

Dropbox: How to get shareable links

I was trying to embed some of my pictures onto craigslist and couldn't get a shareable link.

To activate shareable link

1) log onto your dropbox account

2) Click on the link Enable Share

Friday, June 17, 2011

Merge dll into exe

1) Download ILMerge
2) Install ILMerge
3) Go to command prompt and type the command

ilmerge.exe /target:winexe /out:combined_exename.exe orig_exe_name.exe orig_dll.dll

Say you have your program ( test.exe) and dll (someDllName.dll) built into c:\temp

"C:\Program Files\Microsoft\ILMerge\ilmerge.exe" /target:winexe /out:"C:\Temp\Combined.exe" "C:\Temp\Test.exe" "C:\Temp\somDllName.dll"

To make things easier, Copy the above 2 lines into a new file and name it combine.bat. Double click the batch file, and it should generate the output for you.

Monday, May 23, 2011

Location of Alert.log and trace files in Oracle 11g

There are 2 options.

From SQLPlus

Show Parameter dump_dest

Using a Query

select * from v$diag_info

Friday, May 20, 2011

Hindu Trinitiy

ஹிந்து மதத்தின் அடிப்படை கடவுள்கள் மொத்தம் முன்று. சுருக்கமாக மும்மூர்த்திகள்

பிரம்மா: இவரின் தொழில் படைப்பது, இதில் உலகம் முதல் உயிர் வாழும் அணைத்து ஜீவன்களும் அடக்கம்

விஷ்ணு: இவரின் தொழில் காப்பது.

சிவன் : இவரின் தொழில் அழிப்பது.

இதில் ஆச்சிரியம் என்னவென்றால், காக்கும் தொழிலும் , அழிக்கும் தொழிலையும் செய்யும் விஷ்ணுவையும், சிவனையும் வணங்கும் மக்கள், படைக்கும் தொழில் செய்யும் பிரம்மாவை வணங்குவது இல்லை

Types of Land defined in Tamil Literature

முன்னுரை:

பள்ளி நாட்களில் விவரம் தெரிந்தோ தெரியாமலோ படித்த தமிழ் இலக்கியங்கள், செய்யுள்கள், ஹிந்து மத கதைகள் பற்றி ஒரு சிறிய தொகுப்பு.

Tamil literature classifies Land types into 5 types.

நம் தமிழ் இலக்கியத்தில் நிலம் ஐவகைகளாய் பகுக்கப்பட்டுள்ளது. அவை:

குறிஞ்சி :  மலையும் மலை சார்ந்த பகுதிகளும்.
முல்லை: காடும் காடு சார்ந்த பகுதிகளும்.
மருதம்: வயலும் வயல் சார்ந்த பகுதிகளும்.
நெய்தல: கடலும் கடல் சார்ந்த பகுதிகளும்.
பாலை: நீரற்ற வற‌ண்ட பகுதி. உதாரணம்  பாலைவனம்

Tuesday, March 29, 2011

Oracle: How to convert LONG to CLOB

It is very simple to convert a LONG column to CLOB.

Create table test( col1 long);

Alter table test modify col1 clob;

That's it.

Tuesday, March 1, 2011

ORA-30004: when using SYS_CONNECT_BY_PATH function, cannot have seperator as part of column value

SYS_CONNECT_BY_PATH is used in hierarchial queries. It returns the path of column value from a root node

example: SYS_CONNECT_BY_PATH(column_name, '/') where '/' is the seperator.

If the column_name contains the separator character, then you get the above error
"ORA-30004: when using SYS_CONNECT_BY_PATH function, cannot have seperator as part of column value"

In my example below, foldername had values like "Tree for Case/Document". Since the foldername has "/" which matches your seperator, you get the error.

select f.foldername, sys_connect_by_path(f.foldername,'/') dir
from folder f
connect by parentfolderkey = prior folderkey
start with casekey = 7457950


To remove the error, make sure that your seperator is unique, The error disappeared when I replaced the seperator "/" with "//"

select f.foldername, sys_connect_by_path(f.foldername,'//') dir
from folder f
connect by parentfolderkey = prior folderkey
start with casekey = 7457950

Monday, February 14, 2011

ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr]

I have an Oracle 11g R2 database on a Vista box. I got this error twice, and in both occasions, it was due to Vista crashing (ran out of battery, blue screen)

Here are the steps I performed to resolve this error

Launch SQL Plus from Oracle\bin folder ( not from Client folder)

SQL> conn sys/sys as sysdba
Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

SQL> alter database recover;
Database altered.

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1],
[136], [65730], [65738], [], [], [], [], [], [], []

SQL> shutdown immediate;
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

SQL> alter database recover until cancel using backup controlfile;
alter database recover until cancel using backup controlfile
*
ERROR at line 1:
ORA-00279: change 3997604 generated at 02/11/2011 21:08:59 needed for thread 1
ORA-00289: suggestion :
C:\APP\RMANNI\RECOVERY_AREA\ORCLDB11G\ARCHIVELOG\2011_02_14\O1_MF_1_136_%U_.ARC
ORA-00280: change 3997604 for thread 1 is in sequence #136

Since my database is not running in archive log mode, I couldn't find the file specified in the above error message. I proceeded with the following

SQL> alter database recover continue default;
alter database recover continue default
*
ERROR at line 1:
ORA-00308: cannot open archived log
'C:\APP\RMANNI\RECOVERY_AREA\ORCLDB11G\ARCHIVELOG\2011_02_14\O1_MF_1_136_%U_.ARC'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) The system cannot find the file specified.


SQL> alter database recover cancel;
Database altered.

If the above step errored out, then proceed with the lines shown below inbetween the dotted lines, if not

SQL> alter database open resetlogs;
Database altered.

SQL> Your database is good to go, You should now be able to connect


-----------If Alter database recover cancel Failed ------------------

SQL> alter database recover cancel;
alter database recover cancel
*
ERROR at line 1:
ORA-10879: error signaled in parallel recovery slave
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'C:\APP\RMANNI\ORADATA\ORCLDB\SYSTEM01.DBF'

SQL> recover database using backup controlfile until cancel;
ORA-00275: media recovery has already been started

SQL> shutdown immediate;
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

Now, when you try to recover, Oracle will provide a suggestion,provide the path for your REDO log files. One of the log files will fix your database. I started with Redo03, but Redo01 fixed my database. You probably don't need to shutdown and restart the database for each Redo log flies.

SQL> recover database using backup controlfile until cancel;

ORA-00279: change 2448238 generated at 11/16/2010 22:05:53 needed for thread 1
ORA-00289: suggestion :
C:\APP\RMANNI\FLASH_RECOVERY_AREA\ORCLDB\ARCHIVELOG\2011_02_14\O1_MF_1_67_%U_.ARC
ORA-00280: change 2448238 for thread 1 is in sequence #67

Specify log: {=suggested | filename | AUTO | CANCEL}
C:\app\rmanni\oradata\ORCLDB\REDO03.LOG
ORA-00310: archived log contains sequence 66; sequence 67 required
ORA-00334: archived log: 'C:\APP\RMANNI\ORADATA\ORCLDB\REDO03.LOG'
ORA-10879: error signaled in parallel recovery slave
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'C:\APP\RMANNI\ORADATA\ORCLDB\SYSTEM01.DBF'

SQL> shutdown immediate;
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.

SQL> recover database using backup controlfile until cancel;
ORA-00279: change 2448238 generated at 11/16/2010 22:05:53 needed for thread 1
ORA-00289: suggestion :
C:\APP\RMANNI\FLASH_RECOVERY_AREA\ORCLDB\ARCHIVELOG\2011_02_14\O1_MF_1_67_%U_.ARC
ORA-00280: change 2448238 for thread 1 is in sequence #67

Specify log: {=suggested | filename | AUTO | CANCEL}
C:\app\rmanni\oradata\ORCLDB\REDO02.LOG
ORA-00310: archived log contains sequence 65; sequence 67 required
ORA-00334: archived log: 'C:\APP\RMANNI\ORADATA\ORCLDB\REDO02.LOG'
ORA-10879: error signaled in parallel recovery slave
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: 'C:\APP\RMANNI\ORADATA\ORCLDB\SYSTEM01.DBF'

SQL> Shutdown immediate;
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

SQL> recover database using backup controlfile until cancel;
ORA-00279: change 2448238 generated at 11/16/2010 22:05:53 needed for thread 1
ORA-00289: suggestion :
C:\APP\RMANNI\FLASH_RECOVERY_AREA\ORCLDB\ARCHIVELOG\2011_02_14\O1_MF_1_67_%U_.ARC
ORA-00280: change 2448238 for thread 1 is in sequence #67

Specify log: {=suggested | filename | AUTO | CANCEL}
C:\app\rmanni\oradata\ORCLDB\REDO01.log
Log applied.
Media recovery complete.

SQL> alter database open resetlogs;
Database altered.

-----------If Alter database recover cancel Failed ------------------