Wednesday, November 28, 2012

Error related to /dev/shm while oracle installation

Error
Using Automatic Memory Management requires ...... .The current available space in "" is only MB.If you want to use Automatic Memory Management you should either free up some space in /dev/shm or reduce the memory allocated to oracle.
or
sql>startup pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/*.ora'

ORA-00845: MEMORY_TARGET not supported on this system

Cause:
lesser amount of available space in /dev/shm .

Solution:
increase the size of /dev/shm (tmp directory in linux)
to increase the size do as below:

temporary increase in size :
# mount -o remount,size=8G /dev/shm
Verify the size
# df -h


permanent changes:
1. vim /etc/fstab (made change w.r.t. tmpfs), add this ",size=8g"
tmpfs     /dev/shm          tmpfs   defaults,size=8g        0 0

2. mount -o remount tmpfs

3. df -h      (check the changes

Tuesday, November 27, 2012

Uninstall Oracle from Linux Operating System

Remove Oracle from Linux O.S.
  • Stop any outstanding processes using the appropriate utilities.
    # oemctl stop oms user/password
    # agentctl stop
    # lsnrctl stop
    Alternatively you can kill them using the kill -9 pid command as the root user.
  • Delete the files and directories below the $ORACLE_HOME.
    # cd $ORACLE_HOME
    # rm -Rf *
  • Delete the /etc/oratab file. If using 9iAS delete the /etc/emtab file also.
    # rm /etc/oratab /etc/emtab

sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied

or

sqlplus: error while loading shared libraries: /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied


problem :

SELinux is enable

Solution:

two ways to overcome this

First  : Disable the SELinux

Second : (i prefer this)

Configure SELinux to allow /u0/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1 using below command


chcon -t textrel_shlib_t '/u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1'

Note: change path as per your present directory structure 

Monday, November 26, 2012

SQLCMD error

Sqlcmd: Error: Internal error at ReadText (Reason: No mapping for the Unicode character exists in the target multi-byte code page).

comment at page:
http://connect.microsoft.com/SQLServer/feedback/details/549363/internal-error-in-sqlcmd-utility

Posted by Microsoft on 10/24/2011 at 6:43 PM
This bug has been fixed and will be available in the next release.

Thanks again for reporting this.

Microsoft SQL Server.

Friday, November 23, 2012

SQLCMD not working


HResult 0x2, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.

SOLVED:
1.Enable the named pipes

2. change the properties as below
 3.Restart the SQLServer services.
 4. Run> SQLCMD

Tuesday, November 6, 2012

Fulltext Index SqlServer

1. create catalog
2. Fulltext Index
3. Warning: Table or indexed view 'Documents' has full-text indexed columns that are of type image, text, or ntext. Full-text change tracking cannot track WRITETEXT or UPDATETEXT operations performed on these columns.

1. create catalog
-- Create a fulltext catalog
CREATE FULLTEXT CATALOG ft_catalog_database1
GO

-- Create a table to contain the poems
CREATE TABLE poems
(
 id INTEGER NOT NULL IDENTITY(1,1) PRIMARY KEY,
 author VARCHAR(50) NOT NULL,
 title VARCHAR(100) NOT NULL,
 poem TEXT NOT NULL
);



-- Insert some data
INSERT INTO poems
(
 author, title, poem
)
SELECT
 
 'Johann Wolfgang von Goethe',
 'Night Thoughts',
 'Stars, you are unfortunate, I pity you,
Beautiful as you are, shining in your glory,
Who guide seafaring men through stress and peril.'
UNION ALL
SELECT
 'Nikki Giovanni',
 'I Love You',
 'I love you
because the Earth turns round the sun
because the North wind blows north.'
UNION ALL
SELECT
 'Lord Byron',
 'She Walks In Beauty',
 'She walks in beauty, like the night
Of cloudless climes and starry skies;
And all that''s best of dark and bright
Meet in her aspect and her eyes'
UNION ALL
SELECT
 'Christopher Marlowe',
 'Come Live With Me',
 'Come live with me, and be my love;
And we will all the pleasures prove
That valleys, groves, hills, and fields,
Woods or steepy mountain yields.'
UNION ALL
SELECT
 'Thomas Campbell',
 'Freedom and Love',
 'How delicious is the winning
Of a kiss at love''s beginning,
When two mutual hearts are sighing
For the knot there''s no untying!.';

-- Create a fulltext index on title and poem
CREATE FULLTEXT INDEX ON database1.dbo.poems
(
 title
 Language 0X0,
 poem
 Language 0X0
)
KEY INDEX PK__poems__00551192 ON ft_catalog_database1
WITH CHANGE_TRACKING AUTO;
 
*note - PK__poems__00551192 (primary key name)


It will populate error
Warning: Table or indexed view 'Documents' has full-text indexed columns that are of type image, text, or ntext. Full-text change tracking cannot track WRITETEXT or UPDATETEXT operations performed on these columns.
--it will return result
SELECT * 
FROM poems
WHERE CONTAINS(title, '"I love you"');
 
error is here
because it does not support writetext/updatetext as below:
 
UPDATETEXT
 Following is the code snippet to update portion of the string of the column. We will replace ‘I love you’ with ‘hello’ so that result will be ‘hello...’

DECLARE @ptr varbinary(16)
SELECT @ptr = textptr(poem)  FROM poems  WHERE id = 1
UPDATETEXT poems.poem @ptr 0 10 'hello'
 
 
--RESOLUTION 
--it will not return any result 
SELECT * 
FROM poems
WHERE CONTAINS(poem, 'hello');

web stats