Error unable to allocate 4160 bytes of shared memory

This note apply to Oracle Database Enterprise Edition – Version 11.2.0.1 to 11.2.0.3

Symptoms:
The system appears to be running very slowly and defunct processes can appear.

Errors are seen in the alert log or Trace log :

1. ORA-04031
ORA-04031: unable to allocate 4160 bytes of shared memory (“shared pool”,”unknown object”,”sga heap(1,0)”,”modification “)
Incident details in: /u01/app/oracle/diag/rdbms/prod/prod1/incident/incdir_1080893/prod1_m000_26285_i1080893.trc
Errors in file /u01/app/oracle/diag/rdbms/prod/prod1/trace/prod1_m000_26285.trc (incident=1080894):
ORA-04031: unable to allocate ORA-04031: unable to allocate 4160 bytes of shared memory (“shared pool”,”unknown object”,”sga heap(1,0)”,”modification “) bytes of shared memory (“”,””,””,””)
Incident details in: /u01/app/oracle/diag/rdbms/prod/prod1/incident/incdir_1080894/prod1_m000_26285_i1080894.trc

2. PGA getfail
AUTO MEM: PGA getfail 13 for 38, 11, 1, 67108864, 13555990528, 2550136832, 38, 16106127360, 2
AUTO MEM: backup fail a, 0, 67108864, 202, 202, 0, 86

3. ORA-00445
ORA-00445: background process “m001” did not start after 120 seconds
Incident details in: /opt/u01/app/oracle/diag/rdbms/incident/incdir_3721/db1_mmon_7417_i3721.trc
ERROR: Unable to normalize symbol name for the following short stack (at offset 2):
Tue Jun 21 03:03:06 2011
ORA-00445: background process “J003” did not start after 120 seconds

4. Waited for process W002
Waited for process W002 to initialize for 60 seconds

CAUSE:
Recent linux kernels have a feature called Address Space Layout Randomization (ASLR).
ASLR is a feature that is activated by default on some of the newer linux distributions.
It is designed to load shared memory objects in random addresses.
In Oracle, multiple processes map a shared memory object at the same address across the processes.

With ASLR turned on Oracle cannot guarantee the availability of this shared memory address.
This conflict in the address space means that a process trying to attach a shared memory object to a specific address may not be able to do so, resulting in a failure in shmat subroutine.

However, on subsequent retry (using a new process) the shared memory attachment may work.
The result is a “random” set of failures in the alert log.

You can verify whether ASLR is being used as follows:

# /sbin/sysctl -a | grep randomize
kernel.randomize_va_space = 1

If the parameter is set to any value other than 0 then ASLR is in use.

SOLUTION:

On Redhat 5 to permanently disable ASLR:

Add/modify this parameter in /etc/sysctl.conf

kernel.randomize_va_space=0
kernel.exec-shield=0

You need to reboot for kernel.exec-shield parameter to take effect.

Note that both kernel parameters are required for ASLR to be switched off.

There may be other reasons for a process failing to start, however, by switching ASLR off, you can quickly discount ASLR being the problem. More and more issues are being identified when ASLR is in operation.

Good Luck !

How to create textual index with phoneme

 

First of all you need create one user (schema to test), in this example the user is scott and the language example is PORTUGUESE.

1. Grant permissions to scott with sys user :

GRANT EXECUTE ON CTXSYS.CTX_ADM TO SCOTT;
GRANT EXECUTE ON CTXSYS.CTX_CLS TO SCOTT;
GRANT EXECUTE ON CTXSYS.CTX_DDL TO SCOTT;
GRANT EXECUTE ON CTXSYS.CTX_OUTPUT TO SCOTT;

 

2. Create Preference LEXER :

Login with user scott and run :

BEGIN
 ctx_ddl.create_preference ('SCOTT_LEXER', 'BASIC_LEXER');
 ctx_ddl.set_attribute ('SCOTT_LEXER', 'base_letter', 'YES');
 ctx_ddl.set_attribute('SCOTT_LEXER', 'printjoins', '_-');
 ctx_ddl.set_attribute('SCOTT_LEXER', 'base_letter_type', 'GENERIC');
 ctx_ddl.set_attribute ('SCOTT_LEXER', 'index_themes', 'NO');
 ctx_ddl.set_attribute ('SCOTT_LEXER', 'index_themes', 'YES');
 ctx_ddl.set_attribute ('SCOTT_LEXER', 'theme_language', 'PORTUGESE');
 END;

3. Create Preference WORDLIST :

Login with user scott and run :

begin
  ctx_ddl.create_preference('SCOTT_LEXER_FUZZY', 'BASIC_WORDLIST');
  ctx_ddl.set_attribute('SCOTT_LEXER_FUZZY','FUZZY_MATCH','AUTO');
  ctx_ddl.set_attribute('SCOTT_LEXER_FUZZY','FUZZY_SCORE','60');
  ctx_ddl.set_attribute('SCOTT_LEXER_FUZZY','FUZZY_NUMRESULTS','100');
  ctx_ddl.set_attribute('SCOTT_LEXER_FUZZY','SUBSTRING_INDEX','TRUE');
  ctx_ddl.set_attribute('SCOTT_LEXER_FUZZY','STEMMER','AUTO');
end;

 

4. Create Preference STOPLIST :

The stop list you can found in the database machine :
$ORACLE_HOME/ctx/admin/defaults
For Portuguese-Brazil the file is drdefptb.sql. Search your language.

Login with user scott and run :

declare
  db_charset VARCHAR2(500);

  procedure add_utf8_stopword(hexstring in VARCHAR2) is
  begin
    CTX_DDL.add_stopword('SCOTT_LEXER_STOPLIST', UTL_RAW.cast_to_varchar2(
      UTL_RAW.convert(HEXTORAW(hexstring), db_charset,
                                           'AMERICAN_AMERICA.UTF8')));
  end add_utf8_stopword;

begin
  SELECT 'AMERICAN_AMERICA.' || value
    INTO db_charset
    FROM v$nls_parameters
    WHERE parameter = 'NLS_CHARACTERSET';

  /* Why the extra spaces around the comments?  If the client character set
   * (as identified by NLS_LANG) is AL32UTF8 (or possibly others as well)
   * then the accented characters in the comments, which are in ISO8859-1,
   * are interpreted as multibyte characters.  Thus up to 3 characters after
   * the accented character are mis-interpreted.  If one of these characters
   * happens to be the end comment marker, then the following line or lines
   * is commented out, which leads to missing stopwords and/or PL/SQL parse
   * errors.  End result - the extra spaces before the end comment markers
   * are necessary to ensure that the marker is processed correctly.
   */
  ctx_ddl.create_stoplist('SCOTT_LEXER_STOPLIST');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','a');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','abaixo');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','adiante');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','agora');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','ali');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','antes');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','aqui');
  add_utf8_stopword('6174C3A9'); /* até   */
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','atras');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','bastante');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','bem');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','com');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','como');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','contra');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','debaixo');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','demais');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','depois');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','depressa');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','devagar');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','direito');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','e');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','ela');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','elas');
  add_utf8_stopword('C3AA6C65'); /* êle   */
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','eles');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','em');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','entre');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','eu');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','fora');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','junto');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','longe');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','mais');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','menos');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','muito');
  add_utf8_stopword('6EC3A36F'); /* não   */
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','ninguem');
  add_utf8_stopword('6EC3B373'); /* nós   */
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','nunca');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','onde');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','ou');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','para');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','por');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','porque');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','pouco');
  add_utf8_stopword('7072C3B378696D6F'); /* próximo   */
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','qual');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','quando');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','quanto');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','que');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','quem');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','se');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','sem');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','sempre');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','sim');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','sob');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','sobre');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','talvez');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','todas');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','todos');
  ctx_ddl.add_stopword('SCOTT_LEXER_STOPLIST','vagarosamente');
  add_utf8_stopword('766F63C3AA'); /* você   */
  add_utf8_stopword('766F63C3AA73'); /* vocês   */
end;
/

 

5. Create Index :

To see the preferences :

select a.*
from CTXSYS.CTX_PREFERENCES a
where a.pre_name like '%SCOTT%';

Login with user scott and run :

CREATE INDEX SCOTT.IX_TXT_TABLE ON SCOTT.TB_TABLE
 (TXT_NAME)
 INDEXTYPE IS CTXSYS.CONTEXT
 PARAMETERS('LEXER SCOTT_LEXER Wordlist SCOTT_LEXER_FUZZY Stoplist SCOTT_LEXER_STOPLIST')
 NOPARALLEL;

To see the index :

select a.*
from ctxsys.dr$index a
where a.idx_name like '%IX_TXT%'

 

6. How to use the index :

6.1 Score :

SELECT SCORE(1) score,TXT_NAME
from scott.TB_TABLE
where CONTAINS(TXT_NAME, 'fuzzy(WANDERLEI, 0, , weight)',1) > 0
order by score desc, TXT_NAME asc

 

6.2 Filter for 70% :

SELECT SCORE(1) score,TXT_NAME
from scott.TB_TABLE
where CONTAINS(TXT_NAME, 'fuzzy(WANDERLEI, 70, , weight)',1) > 0
order by score desc, TXT_NAME asc

 

6.3 Only exact 100% :

SELECT SCORE(1) score,TXT_NAME
from scott.TB_TABLE
where CONTAINS(TXT_NAME, 'fuzzy(WANDERLEI, 0, 1, weight)',1) > 0
order by score desc, TXT_NAME asc

 

Good Luck !

 

How to test Multicast CLUSTER INTERCONNECT on Oracle Database 11g R2

This note apply to Oracle Database 11.2.0.2.0 .

 

Sometimes the Interconnect latency is high.

If one instance is down and when try to restart this instance, the CSS daemon can’t start, and when ran the “crsctl stat res -t -init” the status showed forever “starting”.

The error of CSSD :

2010-09-16 23:13:15.839: [ CSSD][1087465792]clssnmvDHBValidateNCopy: node 1, node1, has a disk HB, but no network HB, DHB has rcfg 180134562, wrtcnt, 8627, LATS 9564064, lastSeqNo 8624, uniqueness 1284701023, timestamp 1284703995/10564774

 

How to know if you have a problem on Multicast Cluster Interconnect ?

 

1. Download the tool :

The mcasttest.pl-tool give you an indication whether or not multicasting has been disabled on the network switches, if it fails to use multicast on either the 230.0.1.0 or 224.0.0.251 multicast address for example. In general, work with your network administrator, if you suspect multicasting has been disabled on the network switches, affecting the private interconnect communication accordingly.

Download on the Oracle WebSite: mcasttest.pl-tool

 

2. Extract mcasttest :

tar -xzvf mcasttest.tgz

OR

gunzip mcasttest.tgz
tar xvf mcasttest.tar

 

3. Verify your hostname:

[oracle@server-01 mcasttest]$ hostname
server-01.commerce.com

 

4. Identify the network interface that run interconnect:

run with grid user :

[grid@server-01 ~]$ $GRID_HOME/bin/oifcfg getif
bond0  10.253.10.0  global  public
bond1  192.168.200.0  global  cluster_interconnect

The network interface is bond1

 

5. Run mcasttest:

The mcasttest.pl program requires two arguments:
The node list (specified with -n)
The list of interfaces to be used for the private interconnect (specified with -i).

Put the hostname first in the list.

See bellow when the multicast is ok :

[oracle@server-01 mcasttest]$ perl mcasttest.pl -n server01.commerce.com,server-02.commerce.com -i bond1
########### Setup for node server01.commerce.com ##########
Checking node access 'server01.commerce.com'
Checking node login 'server01.commerce.com'
Checking/Creating Directory /tmp/mcasttest for binary on node 'server01.commerce.com'
Distributing mcast2 binary to node 'server01.commerce.com'
########### Setup for node server02.commerce.com ##########
Checking node access 'server02.commerce.com'
Checking node login 'server02.commerce.com'
Checking/Creating Directory /tmp/mcasttest for binary on node 'server02.commerce.com'
Distributing mcast2 binary to node 'server02.commerce.com'
########### testing Multicast on all nodes ##########

Test for Multicast address 230.0.1.0

Apr 10 09:17:20 | Multicast Succeeded for bond1 using address 230.0.1.0:42000

Test for Multicast address 224.0.0.251

Apr 10 09:17:21 | Multicast Succeeded for bond1 using address 224.0.0.251:42001

 

6. Problem solution :

If test has failed for the 230.0.1.0 address, but succeeded for the 224.0.0.251 multicast address, restart the interface bond and try again:

 ifconfig bond1 down
 ifconfig bond1 up

In case not solve the patch: 9974223 must be applied to enable Oracle Grid Infrastructure to use the 224.0.0.251 multicast address.

 

Good Luck !

 


Workaround to Grid Agent Restart Problem Due to a Daylight Savings Change

This note apply to Enterprise Manager Grid Control Version 10 to 11g

 

Oracle Management Agent does not start and show this error:

Starting agent …… failed.
The agentTZRegion value in /u01/app/oracle/product/grid11g/agent11g/sysman/config/emd.properties is not in agreement with what agent thinks it should be.Please verify your environment to make sure that TZ setting has not changed since the last start of the agent.
If you modified the timezone setting in the environment, please stop the agent and exectute ’emctl resetTZ agent’ and also execute the script mgmt_target.set_agent_tzrgn(<agent_name>, <new_tz_rgn>) to get the value propagated to repository.
Consult the log files in: /u01/app/oracle/product/grid11g/agent11g/sysman/log

When you run emctl resetTZ agent show :

tzOffset for US/Pacific is -480(min), but agent is runnning with tzOffset -420(min)

 

How to solve this problem ?

1. Verify and correct the date/timezone in O.S. and Hardware :
1.1 Verify O.S. using date :

$ date
Fri Oct 21 10:33:10 BRST 2011

1.2 Verify if hardware clock is syncronized using hwclock :

$ hwclock
Fri 21 Oct 2011 10:37:01 AM BRST  -0.497492 seconds

1.3 If you need correct the date use  “date MMDDhhmm”
1.4 If you need correct the hardware clock run with root  “hwclock –systohc” to syncronize.

 

2. Find in file  $AGENT_HOME/sysman/admin/supportedtzs.lst  your actual timezone and change to ETC :

E.g:  Find   “US/Pacific”   and verify that   “Etc/GMT+8”   is the same timezone “-08:00”
Follow bellow to change:

 

3. Edit emd.properties and modify the agent TZ at the end of the file :

E.g.:  agentTZRegion=Etc/GMT+8

 

4. Modify the timezone  of agent at database :

4.1 Login at database with sysdba :    sqlplus / as sysdba

4.2 Run MGMT_TARGET.SET_AGENT_TZRGN(‘<host>.<domain>:<port of agent>’,'<TZRegion>’)

alter session set current_schema = SYSMAN;
exec MGMT_TARGET.SET_AGENT_TZRGN(‘srv01.oracle.com:3872′,’Etc/GMT+8’);
commit;

 

5. Secure, clear and start agent :

cd $AGENT_HOME/bin
./emctl secure agent <password of sysman>
./emctl clearstate agent
./emctl start agent

 

6. Verify if agent is ok and try to upload data:

./emctl status agent
./emctl upload agent

Some times the agent stop and can not upload data because the agent is blocked, then you must login in grid enterprise and re-sync the agent and unblock it.

 

Good Luck !

How to uninstall Oracle database 11g

This note apply to linux version and Oracle Database RAC or Standalone.

 

1. First of all uninstall the database and after grid:

To uninstall the database run as oracle user :

$ORACLE_HOME/deinstall/deinstall

This script will require at the end of process, to run other script as root user.

 

 

2. After uninstall the database uninstall the grid:

To uninstall the grid infrastructure, run as oracle user :

$ORACLE_HOME/deinstall/deinstall

This script will require at the end of process, to run other script as root user.

 

3. Remove trash’s :

3.1  TMP:

cd /tmp
rm -rf *
3.2 Oracle Base

cd $ORACLE_BASE
rm -rf *
3.3 ETC

cd /etc
rm -rf /etc/ora*

 

Good Luck !

 

 

How to install PHP5, OCI8, GD, LDAP, ZEND on linux

This note apply to Red-Hat linux 64, but it’s close for all linux version.

 

1. Download and install RPM’s from Oracle Site :  http://oss.oracle.com/projects/php/files/EL5/x86_64

oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
php53-5.3.8-1.el5.x86_64.rpm
php53-cli-5.3.8-1.el5.x86_64.rpm
php53-common-5.3.8-1.el5.x86_64.rpm
php53-gd-5.3.8-1.el5.x86_64.rpm
php53-ldap-5.3.8-1.el5.x86_64.rpm
php53-oci8-11gR2-5.3.8-1.el5.x86_64.rpm
install using :   rpm -ivh

 

2. Create log dir :
mkdir -p /etc/php.d/logs

 

3. Modify the php.ini :  (/etc/php.ini)

3.1 Enable “<?"  :
short_open_tag = On

3.2 Enable Error Log  :

error_log = "/etc/php.d/logs/php.log"

 

4. Put the tnsnames.ora in :

/usr/lib/oracle/11.2/client64/network/admin

 

5.  Add config to run php (/etc/httpd/conf.d/php.conf) :

AddType application/x-httpd-php .php .phtml

 

6. Add config in  (/etc/sysconfig/http)  and put your charset country:

LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
ORACLE_HOME=/usr/lib/oracle/11.2/client64
NLS_LANG=”BRAZILIAN PORTUGUESE_BRAZIL.WE8ISO8859P1″
export LD_LIBRARY_PATH TNS_ADMIN ORACLE_HOME NLS_LANG

 

7. Add config in (/etc/httpd/conf/httpd.conf) and put your charset country :

7.1 Add:
#AddDefaultCharset UTF-8   (comment)
AddDefaultCharset ISO-8859-1
AddCharset ISO-8859-1  .iso8859-1  .latin1

7.2 Add at the of file :
PassEnv ORACLE_HOME
PassEnv LD_LIBRARY_PATH
PassEnv TNS_ADMIN
PassEnv NLS_LANG

 

8. To install the Framework Zend (with lucene search), download the file :  ZendFramework-1.11.10-minimal  from site:  http://www.zend.com/en/downloads

8.1 Uncompress the file :
gunzip ZendFramework-1.11.10-minimal.tar.gz
tar -xvf ZendFramework-1.11.10-minimal.tar

8.2 Create dir:
mkdir -p /usr/lib64/php/include

8.3 Copy the dir “zend” from ZendFramework to include

 cp  ZendFramework-1.11.10-minimal/ZendFramework-1.11.10-minimal/library/Zend  /usr/lib64/php/include

8.4 Modify in php.ini :

include_path = "/usr/lib64/php/include"

 

Good Luck !

How to modify search lexer preferences in Oracle Portal

This note apply to Oracle Portal 10.1.4.

 

OracleAS Portal includes a set of built-in features tuned for searching content stored and managed within the OracleAS Portal Repository.
The OracleAS Portal search feature is installed with default and the Oracle Text index is used.
Oracle Text indexes use a number of Lexer preferences to control the linguistic aspects of the indexing, if you need custom the “OracleAS Portal search” using the lexer preferences different of default, follow bellow:

 

You will need the portal user password. Run this in MidTier to see :

$ORACLE_HOME/bin/ldapsearch -h machineofOID.domain -p 389 -D cn=orcladmin -w &lt;password> -b "cn=IAS,cn=Products,cn=OracleContext" -s sub -v OrclresourceName=PORTAL| grep orclpasswordattribute

Return:
orclpasswordattribute=welcome1

 

1. First of all, check the preferences sets (log-in with portal user in database infra-structure) :

select * from ctx_user_preferences

 

2. Drop the existent indexes using script “ctxdrind.sql” from MidTier ($ORACLE_HOME/portal/admin/plsql/wws)

connect into database with portal user and run @ctxdrind.sql;

 

3. Edit the preferences using script “sbrimtlx.sql” from MidTier ($ORACLE_HOME/portal/admin/plsql/wws)

Please backup the file sbrimtlx.sql.

The preferences must change according the language, some languages is explicit like “GERMAN,KOREAN,CHINESE” and other languages is grouped in “GENERIC_BASIC_LEXER”.

Example for setting the lexer preferences:

3.1 German language, using “mixed case” and “base letter” :

After:
ctx_ddl.create_preference(GERMAN_LEXER, ‘BASIC_LEXER’ );

Add:
ctx_ddl.set_attribute (GERMAN_LEXER, ‘mixed_case’, ‘YES’);
ctx_ddl.set_attribute (GERMAN_LEXER, ‘base_letter’, ‘YES’);

 

3.2 Generic language grouped, using “mixed case” and “base letter” :

After:
ctx_ddl.create_preference( GENERIC_LEXER, ‘BASIC_LEXER’ );

Add:
ctx_ddl.set_attribute (GENERIC_LEXER, ‘mixed_case’, ‘YES’);
ctx_ddl.set_attribute (GENERIC_LEXER, ‘base_letter’, ‘YES’);

What is mixed_case ?
Specify whether the lexer leaves the tokens exactly as they appear in the text or converts the tokens to all uppercase. The default is NO (tokens are converted to all uppercase).

What is base_letter ?
Specify whether characters that have diacritical marks (umlauts, cedillas, acute accents, and so on) are converted to their base form before being stored in the Text index.

 

4. Re-create the indexes using script “ctxcrind.sql” from MidTier ($ORACLE_HOME/portal/admin/plsql/wws)
This script will drop the preferences and re-create using sbrimtlx.sql script.

connect into database with portal user and run @ctxcrind.sql;

 

5. It’s recomended set some indexes to refresh on commit (set true) and others indexes to manual refresh (set false):

WWSBR_CORNER_CTX_INDX – Page Index          – true
WWSBR_DOC_CTX_INDX    – Document Index      – false
WWSBR_PERSP_CTX_INDX  – Perspective Index   – true
WWSBR_THING_CTX_INDX  – Item Index          – true
WWSBR_TOPIC_CTX_INDX  – Category Index      – true
WWSBR_URL_CTX_INDX    – URL Index           – false

5.1  Connect into database with portal user and run:

exec wwv_context.commit_sync(‘WWSBR_CORNER_CTX_INDX’, true);
exec wwv_context.commit_sync(‘WWSBR_DOC_CTX_INDX’, false);
exec wwv_context.commit_sync(‘WWSBR_PERSP_CTX_INDX’, true);
exec wwv_context.commit_sync(‘WWSBR_THING_CTX_INDX’, true);
exec wwv_context.commit_sync(‘WWSBR_TOPIC_CTX_INDX’, true);
exec wwv_context.commit_sync(‘WWSBR_URL_CTX_INDX’, false);

5.2 Put in crontab linux the refresh of all indexes marked to false (manual):

exec wwv_context.sync();

 

5.3 Check if indexes is marked :

@textstat.sql;

 

 

List of language agrouped in GENERIC_BASIC_LEXER :

*    ar ARABIC
*    bn BENGALI
*    bg BULGARIAN
*    ca CATALAN
*    cs CZECH
*    e SPANISH
*    eg EGYPTIAN
*    el GREEK
*    esa LATIN AMERICAN SPANISH
*    esm MEXICAN SPANISH
*    et ESTONIAN
*    f FRENCH
*    frc CANADIAN FRENCH
*    hr CROATIAN
*    hu HUNGARIAN
*    i ITALIAN
*    in INDONESIAN
*    is ICELANDIC
*    iw HEBREW
*    lt LITHUANIAN
*    lv LATVIAN
*    ms MALAY
*    pt PORTUGUESE
*    ptb BRAZILIAN PORTUGUESE
*    pl POLISH
*    ro ROMANIAN
*    ru RUSSIAN
*    sk SLOVAK
*    sl SLOVENIAN
*    th THAI
*    tr TURKISH
*    uk UKRAINIAN
*    vn VIETNAMESE

 

Good Luck !

 

How To Setup ASM & ASMLIB On Native Linux Multipath Mapper disks

This note apply to Oracle Database using ASM and linux S.O.

 

After installed and configured the Multipath, follow bellow:

1. Download and Install ASMLIB :
http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html

 

2. Check the disks :

ls -l /dev/mapper
brw-rw---- 1 root disk 253, 46 Jul 27 17:19 Prod_Orcl01
brw-rw---- 1 root disk 253, 67 Jul 27 17:59 Prod_Orcl02
brw-rw---- 1 root disk 253, 36 Jul 27 17:19 Prod_Orcl03
brw-rw---- 1 root disk 253, 58 Jul 27 18:00 Prod_Orcl04

 

3. Create the ASMLIB disks on mapper partitions as follow:

/etc/init.d/oracleasm createdisk DSKORA1  /dev/mapper/Prod_Orcl01
/etc/init.d/oracleasm createdisk DSKORA2  /dev/mapper/Prod_Orcl02

After create the disks, the ASM put a mark on the disks to know which are your own.

 

4. If this is a RAC configuration, then from each node execute:

/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks

 

5. Configure ASMLIB to use multipath  (from each node on RAC environments):

By any path the ASMLIB can found the disks, but, the best path is using the multipath :

Modify in /etc/sysconfig/oracleasm :
ORACLEASM_SCANORDER=”dm”
ORACLEASM_SCANEXCLUDE=”sd”

note: The Oracle ASMLib configuration file is located at /etc/sysconfig/oracleasm. It is a link to file /etc/sysconfig/oracleasm-_dev_oracleasm.

Restart ASMLIB (from each node on RAC environments):
/etc/init.d/oracleasm stop
/etc/init.d/oracleasm start

 

6. Verify if the configuration is correct:

6.1 During the disk discovery, ASMLIB uses file /proc/partitions, see :

# cat /proc/partitions
   8     0  877264896 sda
   8     1     104391 sda1
   8     2  877157032 sda2
   8    16  209715200 sdb
   8    32  382730240 sdc
   8    48  379596800 sdd
   8    64    2097152 sde
   8    80    2097152 sdf
   8    96 1169776640 sdg
 253     6  209715200 dm-6
 253     7  382730240 dm-7
 253     8  379596800 dm-8
 253     9    2097152 dm-9
 253    10    2097152 dm-10

6.2 The ASMLIB mount disks at /dev/oracleasm/disks, see:

# ls -la /dev/oracleasm/disks
brw-rw---- 1 grid asmadmin 2536 Ago 16 16:33 DSKORA1
brw-rw---- 1 grid asmadmin 2537 Ago 16 16:33 DSKORA2

6.3 Check if major and minor of disks “dm” not “sd”, is the same in /proc/partitions  and /dev/oracleasm/disks , see “253” and “6” bellow:

/proc/partitions 253     6  209715200 dm-6
/dev/oracleasm/disks
brw-rw---- 1 grid asmadmin 2536 Ago 16 16:33 DSKORA1

You can check using querydisk too :

# /etc/init.d/oracleasm querydisk -d DSKORA1
Disk "DSKORA1" is valid ASM disk on device [253, 6]

 

 

Good Luck !

 

 

ORA-00845 When starting Up an 11g Instance with AMM

This note apply to Oracle Database 11g and linux S.O.

 

On a Linux system, trying to start up an 11g instance could fail with the following error:
ORA-845: MEMORY_TARGET not supported on this system

In the alert log, you could or could not see the below messages:
ORA-04031 errors.

 

The problem occur when use AMM (Automatic Memory Management) and the initialization parameter MEMORY_TARGET or MEMORY_MAX_TARGET, is greater than the shared memory filesystem (/dev/shm) on your operating system.

 

Solution:

Mount filesystem (/dev/shm) :
mount -t tmpfs shmfs -o size=16g /dev/shm

Add in (/etc/fstab) :
tmpfs   /dev/shm  tmpfs  defaults   0 0

See the filesystem :
df -h
tmpfs  16G   13G  2.9G  82% /dev/shm

 

 

Good Luck !