Wednesday, March 28, 2012

ORA-22858: invalid alteration of datatype, ORA-22858: invalid alteration of datatype

When we try to modify a datatype from varchar2(400) to Clob in a Oracle table, we’ll get the following error:

 

The following steps is the work-around to solve this issue:

 

ALTER TABLE SCHEMANAME.TABLENAME ADD NEWCOLUMN CLOB;

 

UPDATE SCHEMANAME.TABLENAME SET NEWCOLUMN = OLDCOLUMN;

 

ALTER TABLE SCHEMANAME.TABLENAME drop COLUMN OLDCOLUMN;

 

ALTER TABLE SCHEMANAME.TABLENAME rename COLUMN NEWCOLUMN TO OLDCOLUMN;

 

 

To Search for a text in All the files in a folder in Windows 7

Hello,

 

In windows 7 - I want to search for all files containing "A word or phrase in the file". The standard XP search box, But I was not able to get the result until I did the following steps.

 

Hope it is helpful for people who is looking for the same feature.

 

http://answers.microsoft.com/en-us/windows/forum/windows_7-files/in-windows-7-i-want-to-search-for-all-files/aadfe1f1-4a33-406b-8e72-bb920efa4f30

 


 

Monday, March 26, 2012

ORA-01461: can bind a LONG value only for insert into a LONG column

Salam,

         

To this issue showed me stars!

 

We are using Devart dotconnect to connect to oracle database.

 

In the Dataset, in the Table adapter the max length is set to -1 by default. And in the Auto generated Abstract class the string datatype length is set to 1024 by default. Now to fix this if we change the max length column alone will not be sufficient. We need the rebuild the method again and then move the DataSet to production to make the changes come into effect!

 

Best Regards

 

Thursday, March 22, 2012

List tables and their corresponding tablespace name and data file [Oracle]

SELECT T.TABLE_NAME,T.TABLESPACE_NAME,DF.FILE_NAME FROM DBA_TABLES T, DBA_DATA_FILES DF

 

SELECT T.TABLE_NAME,T.TABLESPACE_NAME,DF.FILE_NAME FROM DBA_TABLES T, DBA_DATA_FILES DF WHERE T.TABLESPACE_NAME = DF.TABLESPACE_NAME AND T.OWNER LIKE 'USER';

 

Wednesday, March 21, 2012

Grants for a User in Oracle Database

SELECT owner, table_name, select_priv, insert_priv, delete_priv, update_priv, references_priv, alter_priv, index_priv  
 
FROM table_privileges 
 
WHERE grantee = <theUser> 
 
ORDER BY owner, table_name;

Oracle: Search for column names in Oracle DataBase

I am looking for a SQL to find in tables in which a Column is present. The following SQL was helpful:

 

SELECT TABLE_NAME, COLUMN_NAME FROM ALL_TAB_COLUMNS WHERE COLUMN_NAME LIKE '%COL X%'

Sunday, March 18, 2012

Oracle: How to get All Schemas size in Server

The Following SQL is helpful to list the size of All Schemas present in Oracle Database

 

select owner, sum(bytes)/1024/1024 tsize

from dba_segments

group by owner

order by tsize desc

 

Trust its helpful…

 

Regards

Fauzi