Creation Zone

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 23 August 2007

Cricket Flash Game

Posted on 21:32 by Unknown
The following is a little flash game for all those cricket buffs who like to hit 6s and 4s almost every ball.

Play the Game

Simply use the arrow keys of the keyboard or use the mouse buttons to hit the ball.

Courtesy: npower

_______________
Technorati Tag:
 Cricket |  Flash Game
Read More
Posted in | No comments

Friday, 10 August 2007

Oracle 10gR2/Solaris x64: Must Have Patches for E-Business Suite 11.5.10

Posted on 22:04 by Unknown

If you have an Oracle E-Business Suite 11.5.10 database running on Oracle 10gR2 (10.2.0.2) / Solaris x86-64 platform, make sure you have the following two Oracle patches to avoid concurrency issues and intermittent Oracle shadow process crashes.

Oracle patches

1) 4770693 BUG: Intel Solaris: Unnecessary latch sleeps by default
2) 5666714 BUG: ORA-7445 ON DELETE

Symptoms

1) If the top 5 database timed events look something similar to the following in AWR, it is very likely that the database is running into the bug 4770693 Intel Solaris: Unnecessary latch sleeps by default.

Top 5 Timed Events

EventWaitsTime(s)Avg
Wait(ms)
% Total
Call Time
Wait Class
latch: cache buffers chains 94,301 169,403 1,796 86.1Concurrency
CPU time
5,478
2.8
wait list latch free 247,466 4,756 19 2.4Other
buffer busy waits 14,928 1,382 93 .7Concurrency
db file sequential read 98,750 552 6 .3User I/O


Apply Oracle server patch 4770693 to get rid of the concurrency issue(s). Note that the fix will be part of 10.2.0.3.

2) If the application becomes unstable and if you notice core dumps in cdump directory, have a look at the corresponding stack traces generated in udump directory. If the call stack looks similar to the following stack, apply Oracle server patch 5666714 to overcome this problem.

Alert log will have the following errors:

Errors in file /opt/oracle/admin/VIS/udump/vis_ora_1040.trc:
ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [2168] [] [] []
Fri Jun 15 01:30:38 2007
Errors in file /opt/oracle/admin/VIS/udump/vis_ora_1040.trc:
ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [9] [] [] []
ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [2168] [] [] []
Fri Jun 15 01:30:38 2007
Errors in file /opt/oracle/admin/VIS/udump/vis_ora_1040.trc:
ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [9] [] [] []
ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [9] [] [] []
ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [2168] [] [] []

% more vis_ora_1040.trc
...
...
*** 2007-06-15 01:30:38.403
*** SERVICE NAME:(VIS) 2007-06-15 01:30:38.402
*** SESSION ID:(1111.4) 2007-06-15 01:30:38.402
Exception signal: 11 (SIGSEGV), code: 1 (Address not mapped to object), addr: 0x878
*** 2007-06-15 01:30:38.403
ksedmp: internal or fatal error
ORA-07445: exception encountered: core dump [SIGSEGV] [Address not mapped to object] [2168] [] [] []
Current SQL statement for this session:
INSERT /*+ IDX(0) */ INTO "INV"."MLOG$_MTL_SUPPLY" (dmltype$$,old_new$$,snaptime$$,change_vector$$,m_row$$) VALUES (:d,:o,to_
date('4000-01-01:00:00:00','YYYY-MM-DD:HH24:MI:SS'),:c,:m)

----- Call Stack Trace -----
calling call entry argument values in hex
location type point (? means dubious value)
-------------------- -------- -------------------- ----------------------------
ksedst()+23 ? 0000000000000001 00177A9EC 000000000 0061D0A60
000000000
ksedmp()+636 ? 0000000000000001 001779481 000000000 00000000B
000000000
ssexhd()+729 ? 0000000000000001 000E753CE 000000000 0061D0B90
000000000
_sigsetjmp()+25 ? 0000000000000001 0FDDCB7E6 0FFFFFD7F 0061D0B50
000000000
call_user_handler() ? 0000000000000001 0FDDC0BA2 0FFFFFD7F 0061D0EF0
+589 000000000
sigacthandler()+163 ? 0000000000000001 0FDDC0D88 0FFFFFD7F 000000002
000000000
kglsim_pin_simhp()+ ? 0000000000000001 0FFFFFFFF 0FFFFFFFF 00000000B
173 000000000
kxsGetRuntimeLock() ? 0000000000000001 001EBF830 000000000 005E5D868
+683 000000000
kksfbc()+7361 ? 0000000000000001 001FB60A6 000000000 005E5D868
000000000
opiexe()+1691 ? 0000000000000001 0029045D0 000000000 0FFDF9250
0FFFFFD7F
opiall0()+1316 ? 0000000000000001 0028E9FB9 000000000 000000001
000000000
opikpr()+536 ? 0000000000000001 00290B2DD 000000000 0000000B7
000000000
opiodr()+1087 ? 0000000000000001 000E7BE1C 000000000 000000001
000000000
rpidrus()+217 ? 0000000000000001 000E8058E 000000000 0FFDFA6B8
0FFFFFD7F
skgmstack()+163 ? 0000000000000001 003F611D0 000000000 005E5D868
000000000
rpidru()+129 ? 0000000000000001 000E808A6 000000000 005E6FAD0
000000000
rpiswu2()+431 ? 0000000000000001 000E7FD8C 000000000 0FFDFB278
0FFFFFD7F
kprball()+1189 ? 0000000000000001 000E86E6A 000000000 0FFDFB278
0FFFFFD7F
kntxslt()+3150 ? 0000000000000001 0030601F3 000000000 005F7C538
000000000
kntxit()+998 ? 0000000000000001 003058EBB 000000000 005F7C538
000000000
0000000001E4866E ? 0000000000000001 001E4864B 000000000 000000000
000000000
delrow()+9170 ? 0000000000000001 0032020B7 000000000 000000002
000000000
qerdlFetch()+640 ? 0000000000000001 0033545F5 000000000 0EF38B020
000000003
delexe()+909 ? 0000000000000001 0032034EA 000000000 005E6FC50
000000000
opiexe()+9267 ? 0000000000000001 002906368 000000000 000000001
000000000
opiodr()+1087 ? 0000000000000001 000E7BE1C 000000000 0FFDFCD10
0FFFFFD7F
ttcpip()+1168 ? 0000000000000001 003D031AD 000000000 0FFDFEDF4
0FFFFFD7F
opitsk()+1212 ? 0000000000000001 000E77C41 000000000 000E7BA00
000000000
opiino()+931 ? 0000000000000001 000E7B0D8 000000000 005E5B8F0
000000000
opiodr()+1087 ? 0000000000000001 000E7BE1C 000000000 000000000
000000000
opidrv()+748 ? 0000000000000001 000E76A11 000000000 0FFDFF6D8
0FFFFFD7F
sou2o()+86 ? 0000000000000001 000E73E6B 000000000 000000000
000000000
opimai_real()+127 ? 0000000000000001 000E3A7C4 000000000 000000000
000000000
main()+95 ? 0000000000000001 000E3A694 000000000 000000000
000000000
0000000000E3A4D7 ? 0000000000000001 000E3A4DC 000000000 000000000
000000000

--------------------- Binary Stack Dump ---------------------

========== FRAME [1] (ksedst()+23 -> 0000000000000001) ==========
Dump of memory from 0x00000000061D0910 to 0x00000000061D0920
0061D0910 061D0920 00000000 0177A9EC 00000000 [ .........w.....]
========== FRAME [2] (ksedmp()+636 -> 0000000000000001) ==========
Dump of memory from 0x00000000061D0920 to 0x00000000061D0A60
0061D0920 061D0A60 00000000 01779481 00000000 [`.........w.....]
0061D0930 0000000B 00000000 061D0EF0 00000000 [................]
0061D0940 05E5B96C 00000000 05E5C930 00000000 [l.......0.......]
0061D0950 05E5C930 00000000 FE0D2000 FFFFFD7F [0........ ......]
0061D0960 061D0A40 00000000 00000000 00000000 [@...............]
0061D0970 00000000 00000000 00000000 00000000 [................]
...
...

After installing the Oracle database patches, check the installed patches by running opatch lsinventory on your database server.

% opatch lsinventory
Invoking OPatch 10.2.0.1.0

Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..


Oracle Home : /oracle/product/10.1.0
Central Inventory : /export/home/oracle/oraInventory
from : /oracle/product/10.1.0/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /oracle/product/10.1.0/oui
Log file location : /oracle/product/10.1.0/cfgtoollogs/opatch/opatch-2007_Aug_10_21-56-03-PDT_Fri.log

Lsinventory Output file location : /oracle/product/10.1.0/cfgtoollogs/opatch/lsinv/lsinventory-2007_Aug_10_21-56-03-PDT_Fri.txt

--------------------------------------------------------------------------------
Installed Top-level Products (3):

Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Products 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 1 10.2.0.2.0
There are 3 products installed in this Oracle Home.


Interim patches (2) :

Patch 4770693 : applied on Thu Aug 02 15:27:23 PDT 2007
Created on 12 Jul 2006, 11:52:39 hrs US/Pacific
Bugs fixed:
4770693

Patch 5666714 : applied on Fri Jul 20 10:21:33 PDT 2007
Created on 29 Nov 2006, 04:52:58 hrs US/Pacific
Bugs fixed:
5666714

--------------------------------------------------------------------------------

OPatch succeeded.
_______________
Technorati Tags:
 Oracle |  Database |  E-Business Suite |  Oracle Applications |  Solaris
Read More
Posted in | No comments

Wednesday, 13 June 2007

Oracle 10gR2/Solaris x64: Fixing ORA-20000: Oracle Text errors

Posted on 22:17 by Unknown
First, some facts:

* Oracle Applications 11.5.10 (aka E-Business Suite 11i) database is now supported on Solaris 10 for x86-64 architecture.

* The database must be at least Oracle 10g Release 2 (10gR2)

* KOREAN_LEXER lexer type has been discontinued with the Oracle 10gR2 release.

Scenario:

Customer X is trying to migrate the Oracle Apps 11i database instance from Oracle 10gR1/Solaris SPARC to Oracle 10gR2/Solaris x64. During the data import process, creation of some of the text indexes fail with the following error message:
ORA-20000: Oracle Text error:
DRG-10502: index does not exist
DRG-13201: KOREAN_LEXER is desupported

Ignoring the above error message may lead to some dysfunctional modules. For example, creating a new service request (SR) fail with errors like:
ORA-29861: domain index is marked LOADING/FAILED/UNUSABLE in Package
CS_ServiceRequest_PVT Procedure Create_ServiceRequest

The following query confirms that the issue is indeed with failed indexes.
% sqlplus / as sysdba

SQL> Select INDEX_NAME, TABLE_NAME, DOMIDX_STATUS, DOMIDX_OPSTATUS
2 from ALL_INDEXES where TABLE_NAME like 'CS%INCIDENTS%ALL%' and INDEX_TYPE='DOMAIN';

INDEX_NAME TABLE_NAME DOMIDX_STATUS DOMIDX_OPSTATUS
----------------------------------- ------------------------------ ----------------- -----------------
SUMMARY_CTX_INDEX CS_INCIDENTS_ALL_TL VALID FAILED
CS_INCIDENTS_ALL_TL_N1 CS_INCIDENTS_ALL_TL VALID FAILED

Refer to Oracle Metalink Note 306854.1 Create Service Request: Ora-29861: Domain Index Is Marked Loading/Failed/Unusable for more.

Similarly searching for a Catalog item under Sales & Marketing module fails with error message similar to:
ORA-20000: Oracle Text error: DRG-10599: column is not indexed
java.sql.SQLException: ORA-20000: Oracle Text error: DRG-10599: column is not indexed at
oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at
oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289) at
oracle.jdbc.ttc7.Oall7.receive(Oall7.java:589) at
oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1972) at
oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:1231) at
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2607) at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2950) at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:656) at
oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:582) at
...
...

How to fix the above ORA-20000: Oracle Text errors?

Steps:

1. Execute the SQL script which was posted in Oracle Metalink Note 187905.1 bde_imt_index_status.sql - List all interMedia Text indexes by owner, to check the status of the Text indexes.

For your convenience, I'm reproducing the script here:
% cat textindexes.sql

ttitle -
center 'iMT Index Summary by Owner' skip 2
set pagesize 67
set linesize 95
column idx_owner heading 'Owner' format a8
column idx_name heading 'Index|Name' format a24;
column idx_table heading 'Table|Indexed' format a22
column idx_text_name heading 'Column|Indexed' format a21
column idx_docid_count heading 'Number|Rows|Indexed' format 99999
column idx_status heading 'Index|Status' format a8

break on idx_owner

spool bde_imt_index_status.lst

select idx_owner,idx_name,idx_table,idx_text_name,idx_docid_count,idx_status
from ctx_indexes
group by idx_owner,idx_name,idx_table,idx_text_name,idx_docid_count,idx_status
/

spool off;

Here's the sample output from a Oracle 10gR2/Solaris x64 system right after the data was imported with index errors:
% sqlplus ctxsys/ctxsys

SQL> @textindexes.sql

iMT Index Summary by Owner

Number
Index Table Column Rows Index
Owner Name Indexed Indexed Indexed Status
-------- ------------------------ ---------------------- --------------------- ------- --------
PA PA_PROJECT_CTX_SEARCH_C1 PA_PROJECT_CTX_SEARCH CTX_DESCRIPTION 159 INDEXED
HR IRC_SEARCH_CRITERIA_CTX IRC_SEARCH_CRITERIA KEYWORDS 0 INDEXED
JTF JTF_TASKS_TL_IM JTF_TASKS_TL TASK_NAME 4183 INDEXED
JTF_AMV_ITEMS_NAME_CTX JTF_AMV_ITEMS_TL ITEM_NAME 1394 INDEXED
CS CS_FORUM_MESSAGES_TL_N4 CS_FORUM_MESSAGES_TL COMPOSITE_ASSOC_COL 0 POPULATE
CS_KB_SETS_TL_N3 CS_KB_SETS_TL COMPOSITE_ASSOC_INDEX 0 POPULATE

JTF JTF_AMV_ITEMS_DESC_CTX JTF_AMV_ITEMS_TL DESCRIPTION 1394 INDEXED
HR PER_EMPDIR_PEOPLE_N1 PER_EMPDIR_PEOPLE PERSON_KEY 3258 INDEXED
CTXTEST QUICK_TEXT QUICK TEXT 0 NO_INDEX
HR PER_ADDRESSES_N4 PER_ADDRESSES DERIVED_LOCALE 0 INDEXED
CS SUMMARY_CTX_INDEX CS_INCIDENTS_ALL_TL SUMMARY 0 POPULATE
JTF JTF_AMV_ITEMS_URL_CTX JTF_AMV_ITEMS_B URL_STRING 0 INDEXED
JTF_AMV_ITEMS_TEXT_CTX JTF_AMV_ITEMS_TL TEXT_STRING 1394 INDEXED
ENI ENI_DEN_HRCHY_PAR_IM1 ENI_DENORM_HRCHY_PAREN CONCAT_CAT_PARENTAGE 143 INDEXED
TS

OKC OKC_ARTICLES_CTX OKC_ARTICLE_VERSIONS ARTICLE_TEXT 919 INDEXED
AR HZ_CUST_ACCT_SITES_ALL_T HZ_CUST_ACCT_SITES_ALL ADDRESS_TEXT 0 INDEXED
1

HR IRC_DOCUMENTS_CTX IRC_DOCUMENTS BINARY_DOC 13 INDEXED
AR HZ_STAGE_CONTACT_T1 HZ_STAGED_CONTACTS CONCAT_COL ###### INDEXED
CS CS_KB_SOLN_CAT_TL_N1 CS_KB_SOLN_CATEGORIES_ NAME 0 POPULATE
TL

HR IRC_POSTING_CON_TL_CTX IRC_POSTING_CONTENTS_T NAME 40 INDEXED
L

ICX ICX_CAT_ITEMS_CTX_DESC ICX_CAT_ITEMS_TLP CTX_DESC ###### INDEXED
IBC IBC_ATTRIBUTE_BUNDLES_CT IBC_ATTRIBUTE_BUNDLES ATTRIBUTE_BUNDLE_DATA 224 INDEXED
X

AMV AMV_C_CHANNELS_NAME_CTX AMV_C_CHANNELS_TL CHANNEL_NAME 56 INDEXED
ICX ICX_QUES_CTX ICX_QUESTIONS_TL QUESTION 1279 INDEXED
APPS IBE_CT_IMEDIA_SEARCH_IM IBE_CT_IMEDIA_SEARCH INDEXED_SEARCH 0 POPULATE
CTXSYS DEFAULT_POLICY_ORACONTAI DR$POLICY_TAB PLT_POLICY 0 NO_INDEX
NS

SYSTEM QUICK_TEXT QUICK TEXT 2 INDEXING
HR HR_LOCATIONS_N1 HR_LOCATIONS_ALL DERIVED_LOCALE 0 INDEXED
IRC_DOCUMENTS_CTX1 IRC_DOCUMENTS CHARACTER_DOC 13 INDEXED
AR HZ_STAGE_PARTIES_T1 HZ_STAGED_PARTIES CONCAT_COL ###### INDEXED
CS CS_KB_ELEMENTS_TL_N2 CS_KB_ELEMENTS_TL COMPOSITE_TEXT_INDEX 0 POPULATE
OKR OKR_IPS_TL_N1 OKR_IP_COMMON_TL KEYWORD_TEXT 7 INDEXED
OKC OKC_TERMS_TEMPLATES_CTX OKC_TERMS_TEMPLATES_AL TEMPLATE_NAME 70 INDEXED
L

APPLSYS FND_LOBS_CTX FND_LOBS FILE_DATA 0 POPULATE
AR HZ_CLASS_CODE_DENORM_T1 HZ_CLASS_CODE_DENORM CONCAT_CLASS_CODE_MEA 8154 INDEXED
NING

AMV AMV_C_CHANNELS_DESC_CTX AMV_C_CHANNELS_TL DESCRIPTION 56 INDEXED
CS CS_INCIDENTS_ALL_TL_N1 CS_INCIDENTS_ALL_TL TEXT_INDEX 0 POPULATE
AR HZ_STAGE_PARTY_SITES_T1 HZ_STAGED_PARTY_SITES CONCAT_COL ###### INDEXED
HZ_STAGE_CPT_T1 HZ_STAGED_CONTACT_POIN CONCAT_COL ###### INDEXED
TS

39 rows selected.

2. Note down the index names whose status is not 'INDEXED'.

From the output in step #1, the following are the offensive indexes.
APPLSYS.FND_LOBS_CTX
APPS.IBE_CT_IMEDIA_SEARCH_IM
CS.CS_FORUM_MESSAGES_TL_N4
CS.CS_INCIDENTS_ALL_TL_N1
CS.CS_KB_ELEMENTS_TL_N2
CS.CS_KB_SETS_TL_N3
CS.CS_KB_SOLN_CAT_TL_N1
CS.SUMMARY_CTX_INDEX

3. Depending on the indexes to be re-created, connect as CS or APPS user, drop all the indexes whose status is something other than 'INDEXED'.

Continuing with the example, drop the indexes shown in step #2 as follows:
% sqlplus apps/apps

SQL> drop index applsys.FND_LOBS_CTX;
Index dropped.

SQL> drop index IBE_CT_IMEDIA_SEARCH_IM;
Index dropped.

% sqlplus cs/cs

SQL> drop index CS_FORUM_MESSAGES_TL_N4;
Index dropped.

SQL> drop index CS_INCIDENTS_ALL_TL_N1;
Index dropped.

SQL> drop index CS_KB_ELEMENTS_TL_N2;
Index dropped.

SQL> drop index CS_KB_SETS_TL_N3;
Index dropped.

SQL> drop index CS_KB_SOLN_CAT_TL_N1;
Index dropped.

SQL> drop index SUMMARY_CTX_INDEX;
Index dropped.

4. Finally create the dropped indexes with the following syntax:

create index <index_name> on <table_name> (<column_name>) indextype is ctxsys.context;

Continuing with the example, create the indexes shown in step #2 as follows:
% sqlplus apps/apps

SQL> create index applsys.FND_LOBS_CTX on applsys.FND_LOBS (FILE_DATA)
2 indextype is ctxsys.context;

Index created.

SQL> create index IBE_CT_IMEDIA_SEARCH_IM on IBE_CT_IMEDIA_SEARCH (INDEXED_SEARCH)
2 indextype is ctxsys.context;

Index created.

% sqlplus cs/cs

SQL> create index CS_FORUM_MESSAGES_TL_N4 on CS_FORUM_MESSAGES_TL (COMPOSITE_ASSOC_COL)
2 indextype is ctxsys.context;

Index created.

SQL> create index CS_INCIDENTS_ALL_TL_N1 on CS_INCIDENTS_ALL_TL (TEXT_INDEX)
2 indextype is ctxsys.context;

Index created.

SQL> create index CS_KB_ELEMENTS_TL_N2 on CS_KB_ELEMENTS_TL (COMPOSITE_TEXT_INDEX)
2 indextype is ctxsys.context;

Index created.

SQL> create index CS_KB_SETS_TL_N3 on CS_KB_SETS_TL (COMPOSITE_ASSOC_INDEX)
2 indextype is ctxsys.context;

Index created.

SQL> create index CS_KB_SOLN_CAT_TL_N1 on CS_KB_SOLN_CATEGORIES_TL (NAME)
2 indextype is ctxsys.context;

Index created.

SQL> create index SUMMARY_CTX_INDEX on CS_INCIDENTS_ALL_TL (SUMMARY)
2 indextype is ctxsys.context;

Index created.

5. Repeat step #1 to check the status of text indexes.
                                   iMT Index Summary by Owner

Number
Index Table Column Rows Index
Owner Name Indexed Indexed Indexed Status
-------- ------------------------ ---------------------- --------------------- ------- --------
PA PA_PROJECT_CTX_SEARCH_C1 PA_PROJECT_CTX_SEARCH CTX_DESCRIPTION 159 INDEXED
HR IRC_SEARCH_CRITERIA_CTX IRC_SEARCH_CRITERIA KEYWORDS 0 INDEXED
CS CS_KB_SETS_TL_N3 CS_KB_SETS_TL COMPOSITE_ASSOC_INDEX 397 INDEXED
CS_FORUM_MESSAGES_TL_N4 CS_FORUM_MESSAGES_TL COMPOSITE_ASSOC_COL 10 INDEXED

JTF JTF_TASKS_TL_IM JTF_TASKS_TL TASK_NAME 4183 INDEXED
JTF_AMV_ITEMS_NAME_CTX JTF_AMV_ITEMS_TL ITEM_NAME 1394 INDEXED
JTF_AMV_ITEMS_DESC_CTX JTF_AMV_ITEMS_TL DESCRIPTION 1394 INDEXED
HR PER_EMPDIR_PEOPLE_N1 PER_EMPDIR_PEOPLE PERSON_KEY 3258 INDEXED
CTXTEST QUICK_TEXT QUICK TEXT 0 NO_INDEX
HR PER_ADDRESSES_N4 PER_ADDRESSES DERIVED_LOCALE 0 INDEXED
CS SUMMARY_CTX_INDEX CS_INCIDENTS_ALL_TL SUMMARY 3947 INDEXED
JTF JTF_AMV_ITEMS_URL_CTX JTF_AMV_ITEMS_B URL_STRING 0 INDEXED
JTF_AMV_ITEMS_TEXT_CTX JTF_AMV_ITEMS_TL TEXT_STRING 1394 INDEXED
ENI ENI_DEN_HRCHY_PAR_IM1 ENI_DENORM_HRCHY_PAREN CONCAT_CAT_PARENTAGE 143 INDEXED
TS

OKC OKC_ARTICLES_CTX OKC_ARTICLE_VERSIONS ARTICLE_TEXT 919 INDEXED
AR HZ_CUST_ACCT_SITES_ALL_T HZ_CUST_ACCT_SITES_ALL ADDRESS_TEXT 0 INDEXED
1

HR IRC_DOCUMENTS_CTX IRC_DOCUMENTS BINARY_DOC 13 INDEXED
AR HZ_STAGE_CONTACT_T1 HZ_STAGED_CONTACTS CONCAT_COL ###### INDEXED
HR IRC_POSTING_CON_TL_CTX IRC_POSTING_CONTENTS_T NAME 40 INDEXED
L

IBC IBC_ATTRIBUTE_BUNDLES_CT IBC_ATTRIBUTE_BUNDLES ATTRIBUTE_BUNDLE_DATA 224 INDEXED
X

ICX ICX_CAT_ITEMS_CTX_DESC ICX_CAT_ITEMS_TLP CTX_DESC ###### INDEXED
CS CS_KB_SOLN_CAT_TL_N1 CS_KB_SOLN_CATEGORIES_ NAME 60 INDEXED
TL

AMV AMV_C_CHANNELS_NAME_CTX AMV_C_CHANNELS_TL CHANNEL_NAME 56 INDEXED
ICX ICX_QUES_CTX ICX_QUESTIONS_TL QUESTION 1279 INDEXED
CS CS_KB_ELEMENTS_TL_N2 CS_KB_ELEMENTS_TL COMPOSITE_TEXT_INDEX 367 INDEXED
APPS IBE_CT_IMEDIA_SEARCH_IM IBE_CT_IMEDIA_SEARCH INDEXED_SEARCH ###### INDEXED

CTXSYS DEFAULT_POLICY_ORACONTAI DR$POLICY_TAB PLT_POLICY 0 NO_INDEX
NS

SYSTEM QUICK_TEXT QUICK TEXT 2 INDEXING
HR HR_LOCATIONS_N1 HR_LOCATIONS_ALL DERIVED_LOCALE 0 INDEXED
IRC_DOCUMENTS_CTX1 IRC_DOCUMENTS CHARACTER_DOC 13 INDEXED
AR HZ_STAGE_PARTIES_T1 HZ_STAGED_PARTIES CONCAT_COL ###### INDEXED
OKR OKR_IPS_TL_N1 OKR_IP_COMMON_TL KEYWORD_TEXT 7 INDEXED
OKC OKC_TERMS_TEMPLATES_CTX OKC_TERMS_TEMPLATES_AL TEMPLATE_NAME 70 INDEXED
L

APPLSYS FND_LOBS_CTX FND_LOBS FILE_DATA 61608 INDEXED
CS CS_INCIDENTS_ALL_TL_N1 CS_INCIDENTS_ALL_TL TEXT_INDEX 3947 INDEXED

AR HZ_CLASS_CODE_DENORM_T1 HZ_CLASS_CODE_DENORM CONCAT_CLASS_CODE_MEA 8154 INDEXED
NING

AMV AMV_C_CHANNELS_DESC_CTX AMV_C_CHANNELS_TL DESCRIPTION 56 INDEXED
AR HZ_STAGE_PARTY_SITES_T1 HZ_STAGED_PARTY_SITES CONCAT_COL ###### INDEXED
HZ_STAGE_CPT_T1 HZ_STAGED_CONTACT_POIN CONCAT_COL ###### INDEXED
TS

39 rows selected.

Read the Oracle Metalink Note 312640.1 Oracle Text: Re-installation of Applications 11i (11.5.10) Oracle Text Indexes, if the steps mentioned in the previous paragraphs didn't help fixing the Oracle Text errors.
__________________
Technorati Tags:
 Oracle |  Database |  E-Business Suite |  Oracle Applications |  Solaris
Read More
Posted in | No comments

Sunday, 10 June 2007

Java Web Console on Sun Solaris

Posted on 11:07 by Unknown
Have you ever noticed a java process running under noaccess user id on your Solaris 10 and later systems? It looks something similar to:
# prstat -u noaccess
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
7905 noaccess 110M 91M run 59 0 0:00:46 0.3% java/25

It is the Java Web Console whose responsibility is to provide a common location for users to access web-based system management applications. The Java Web Console is a web page where you can find the Sun system management web-based applications that are installed and registered on your system. Any compliant J2EETM web application can register with the web console to make itself available to authenticated and authorized users. Registration is automatically a part of an application's installation process.

The Java Web Console provides the following:
  • A single point of entry for login and the launching of browser-based system management applications

    The console provides a central location from which you can start browser-based management applications simply by clicking the application names. Note that Java Web Console and the Solaris Management Console are not compatible with each other.

  • Single sign-on through a secure https port


  • Dynamically organized and aggregated applications

    Applications are installed and displayed on the console launch page under the category of management tasks that is most applicable.




  • A common look and feel

  • Standard, extensible authentication, authorization, and auditing mechanisms

    The Java Web Console supports Pluggable Authentication Module (PAM), role-based access control (RBAC) roles, and Basic Security Module (BSM) auditing.

Check the 3. Working With the Sun Java Web Console (Tasks) section in Solaris 10 System Administration Guide: Basic Administration for the detailed steps to work with Java Web Console.

If you do not need the web console, it can be disabled by running the following command:
# svcadm -v disable webconsole
svc:/system/webconsole:console disabled.

To remove the web console software completely, run the following command:

Solaris 10 3/05, Solaris 10 1/06, Solaris 10 6/06:
# cd / ; /usr/lib/webconsole/setup -u

Solaris 10 11/06 and later releases:
# cd / ; /usr/share/webconsole/bin/setup -u

* Thanks to Prameet Chhabra for sharing the Java Web Console tip.
______________
Technorati tags:
 Solaris |  OpenSolaris
Read More
Posted in | No comments

Thursday, 31 May 2007

Solaris OS Solutions to 32-bit stdio's 256 File Descriptors Limitation

Posted on 19:12 by Unknown
.. technical article is up on Sun Developer Network (SDN) web site at http://developers.sun.com/solaris/articles/stdio_256.html. In order to comply with the SDN guidelines, the copy-editor at Sun made quite a number of changes to the original draft. But I still like the original draft "as is". I'm reproducing the draft that I submitted, in this blog post.

Sun Solaris Solution to 32-bit stdio's 256 File Descriptors Limitation


The following discussion is relevant only in the 32-bit world. 64-bit applications are immune to 256 file descriptors limitation.

Historic Background


A quick web search with keywords Solaris stdio open file descriptors results in numerous references to stdio's limitation of 256 open file descriptors on Sun Solaris. 1085341: 32-bit stdio routines should support file descriptors >255, a 15 year old RFE 1 explains the problem and the bug report links to handful of other bugs which are some how related to stdio's 256 file descriptors limitation.

The reason for this limitation on Solaris operating system is that an unsigned char is used to store the value of the file descriptor associated with a standard I/O stream. Have a look at the definition of the FILE structure that you will find in header, /usr/include/stdio_impl.h, on any Solaris system that does not have the solution under discussion.
struct __FILE_TAG       /* needs to be binary-compatible with old versions */
{
#ifdef _STDIO_REVERSE
unsigned char *_ptr; /* next character from/to here in buffer */
int _cnt; /* number of available characters in buffer */
#else
int _cnt; /* number of available characters in buffer */
unsigned char *_ptr; /* next character from/to here in buffer */
#endif
unsigned char *_base; /* the buffer */
unsigned char _flag; /* the state of the stream */
unsigned char _file; /* UNIX System file descriptor */
unsigned __orientation:2; /* the orientation of the stream */
unsigned __ionolock:1; /* turn off implicit locking */
unsigned __seekable:1; /* is file seekable? */
unsigned __filler:4;
};

__FILE_TAG is just an alias for FILE (see /usr/include/stdio_tag.h).

_file holds the file descriptor, which was declared as an unsigned char. An unsigned char occupies 8 bits in memory; hence _file can hold a maximum value of 2^8 = 256. In other words, _file restricts the access to 256 file descriptors per 32-bit process. This limitation was clearly documented in the man page of stdio(3C).

Sun didn't make changes from an 8-bit unsigned char to a 16-bit int to accomodate more file descriptors because this would break the much promised binary compatibility with earlier releases of Solaris, as it changes the size of the structure.

Solutions


Starting with the upcoming release of Solaris 10 8/07 2, Sun offers run-time and programming solutions in the form of extended FILE facility to alleviate stdio's 256 file descriptors limitation. Systems running Solaris Express (SX) or any OpenSolaris distribution after build 39 will have these solutions. Check Patches, Bugs section for instructions to get extended FILE facility installed on systems running any release of Solaris 10 3/05 through Solaris 10 11/06.

1) Run-time Solution


As the title suggests, a run-time solution does not require any source code changes or re-compilation of the objects to overcome the 256 file descriptors limitation with the stdio(3C) C library functions. However the default behavior of existing 32-bit applications won't change unless the extended FILE facility is enabled explicitly. Applications that enable this feature will be able to associate any valid file descriptor with a standard I/O (stdio) stream. Any value that lies within the range 3 3 and the value returned by ulimit -n from the shell used to launch the application is a valid file descriptor. The per process maximum number of file descriptors in a shell can be increased from the default 256 to any value that is less than or equal to the value returned by the command, echo 'rlim_fd_max/D' | mdb -k | awk '{ print $2 }'. To adjust the file descriptor limit in a shell, run ulimit -n <max_file_descriptors> in sh/ksh/bash or limit descriptors <max_file_descriptors> in csh, where max_file_descriptors is the maximum number of file descriptors desired.

65,536 is the default hard limit for the number of files a process can have opened at any time. This limit can be tuned with the system tunable rlim_fd_max. Although a very large number of files can be opened by tuning rlim_fd_max parameter, virtual memory space becomes the limit for 32-bit processes when there are hundreds of thousands of open files. When the process reaches the limits of virtual memory, stdio calls fail with Not enough space error.

Before running the 32-bit application, enable the extended FILE facility by:

  1. Raising the maximum number of file descriptors in a shell, and
  2. Pre-loading the extended FILE facility, /usr/lib/extendedFILE.so.1.


Note that extendedFILE.so.1 is not a library, but an enabler of the extended FILE facility.

Here is how you'd enable the extended FILE facility from ksh:

% ulimit -n
256

% echo 'rlim_fd_max/D' | mdb -k | awk '{ print $2 }'
65536

% ulimit -n 65537
ksh: ulimit: exceeds allowable limit

% ulimit -n 65536

% ulimit -n
65536

% export LD_PRELOAD_32=/usr/lib/extendedFILE.so.1
% application [arg1 arg2 .. argn]

The following example shows the behavior of a simple 32-bit process with and without the extended FILE facility enabled. The test case, a simple C program, tries to open 65536 files with fopen() interface.

% cat fopentestcase.c

#include <stdio.h>
#include <stdlib.h>

#define NoOfFILES 65536

int main()
{
char filename[10];
FILE *fds[NoOfFILES];
int i;

for (i = 0; i < NoOfFILES; ++i)
{
sprintf (filename, "/tmp/%d.log", i);
fds[i] = fopen(filename, "w");

if (fds[i] == NULL)
{
printf("\nNumber of open files = %d. fopen() failed with error: ", i);
perror("");
exit(1);
}
else
{
fprintf (fds[i], "some string");
}
}
return (0);
}

Reproduce the failure with the default maximum number of file descriptors in a shell.

% cc -o fopentestcase fopentestcase.c

% ulimit -a | grep descriptors
nofiles(descriptors) 256

% ./fopentestcase
Number of open files = 253. fopen() failed with error: Too many open files

Raise the file descriptor limit, enable extended FILE facility; and run the test case again to see the run-time solution at work.
% ulimit -n 5000

% ulimit -a | grep descriptors
nofiles(descriptors) 5000

% export LD_PRELOAD_32=/usr/lib/extendedFILE.so.1

% ./fopentestcase
Number of open files = 4996. fopen() failed with error: Too many open files

% ulimit -n 65536

% ulimit -a | grep descriptors
nofiles(descriptors) 65536

% ./fopentestcase
Number of open files = 65532. fopen() failed with error: Too many open files

Observe the shortage of one file descriptor (excluding 0, 1 and 2 for stdin, stdout and stderr respectively) in the above examples. When extended FILE facility is enabled, by default the file descriptor 196 will be made unallocatable to minimize silent data corruption. See the next section, Environment Variables, for more.

Here is the pfiles output to confirm the above proposition:
% pfiles `pgrep fopentestcase` | egrep "log|:"
...
195: S_IFREG mode:0644 dev:102,7 ino:7380 uid:209044 gid:1 size:0
/tmp/192.log
197: S_IFREG mode:0644 dev:102,7 ino:7381 uid:209044 gid:1 size:0
/tmp/193.log
...

Environment Variables

The following two environment variables control the behavior of the extended FILE facility:

  1. _STDIO_BADFD

    This variable takes any integer value in the range 3 - 255, which will be made unallocatable as file descriptor. Setting this environment variable will provide a protection mechanism to software with unknown behaviors such as 3rd party libraries without source code, so applications do not experience silent data corruption. In the absence of this environment variable, a default value of 196 will be marked as unallocatable file descriptor during run-time.

    It is apparent that object code built on Solaris in pre-extended FILE era will not be expecting any file descriptor that doesn't fit in an 8-bit unsigned char; and will not understand how to handle extended FILE pointers. For these reasons the range has been restricted to 3 - 255 so the code that retrieves the file descriptor value by de-referencing FILE -> _file rather than fileno(3C) function will receive the unallocatable (bad) file descriptor when the actual descriptor is indeed an extended file descriptor i.e., any value > 255. Another environment variable _STDIO_BADFD_SIGNAL has been introduced to specify the signal to be sent to the process when the uninspected code tries to modify the unallocatable file descriptor.

  2. _STDIO_BADFD_SIGNAL

    This variable takes an integer or string representing any valid signal. See signal.h(3HEAD) for valid values or strings for all supported signals on Solaris. This variable causes the specified signal to be sent to the application if certain exceptional cases are detected during the use of the extended FILE facility. The default signal is SIGABRT.

When Not To Use This Solution?

Do not enable extended FILE facility if the application:
  1. directly de-references the _file field of FILE structure, or
  2. uses the long removed fileno() macro 4 rather than the function fileno(FILE) to get the value of the underlying file descriptor.

When this feature is enabled, file descriptors > 255 will be stored in an auxiliary location unknown to the application, and an unallocatable (bad) file descriptor held by environment variable _STDIO_BADFD will be stored in FILE -> _file field. Improper access by the application to the FILE -> _file field will yield the unallocatable bad file descriptor when the actual underlying file descriptor is greater than 255, thus leading to silent data corruption.

Also data corruption can occur if the process truncates the value returned by the fileno(FILE) function. For example, if the 16-bit or 32-bit int value returned by fileno() function is stored in an 8-bit unsigned char variable, truncation occurs; and accessing the truncated file descriptor may yield errors.

The following error message during the run-time is a clear indication that the application is modifying the internal file descriptor field of the FILE structure from stdio.
Application violated extended FILE safety mechanism.
Please read the man page for extendedFILE.
Aborting

When confronted with such an error message, stop using extended FILE facility with the application; if possible, fix the source by replacing all references to FILE -> _file with calls to fileno(FILE). Ignoring the above run-time error could lead to data corruption.

Example

The following trivial example illustrates the usage of environment variables, _STDIO_BADFD and _STDIO_BADFD_SIGNAL; and shows the subsequent program crash when the code violates the extended FILE safety mechanism.

Compile the following code and build a library on any system running Solaris 5 without the extended FILE solutions.
% cat thirdpartysrc.c

#include <stdio.h>

void manipulatefd (FILE *fptr)
{
;
;
fprintf(stdout, "\n%s : manipulatefd(): underlying file descriptor = %d\n", \
__FILE__, fptr -> _file);
fptr -> _file = 123;
fprintf(fptr, "This call is gonna fail!\n");

;
;
}

% cc -G -o /tmp/libthirdparty.so thirdpartysrc.c

Compile the following code and build an executable by linking the object code with the library created in the above step,
on any system running Solaris with the extended FILE solutions.
% cat enableextfile.c

#include <stdio.h>
#include <stdlib.h>

#define NoOfFiles 500

void manipulatefd(FILE *);

int main ()
{
FILE *fptr;
int i;

for (i = 0; i < NoOfFiles; i++)
{
fptr = fopen("/tmp/enable_test.txt", "w");

if (fptr == NULL)
{
perror("fopen failed. ");
exit(1);
}

printf("\nfd = %d", fileno(fptr));

if (fileno(fptr) % 400 == 0)
{
manipulatefd(fptr);
}
}

return(0);
}

% export LD_LIBRARY_PATH=/tmp:$LD_LIBRARY_PATH
% cc -o enableextfile -lthirdparty enableextfile.c

Raise the maximum file descriptor limit per process to any number > 255, set the environment variables _STDIO_BADFD and _STDIO_BADFD_SIGNAL, enable the extended FILE facility by pre-loading /usr/lib/extendedFILE.so.1; and finally run the executable.
% ulimit -n
256

% ulimit -n 500

% ulimit -n
500

% export _STDIO_BADFD=196
% export _STDIO_BADFD_SIGNAL=SIGABRT
% export LD_PRELOAD_32=/usr/lib/extendedFILE.so.1

% ./enableextfile
fd = 3
fd = 4
fd = 5
...
...
fd = 398
fd = 399
fd = 400
thirdpartysrc.c : manipulatefd(): underlying file descriptor = 196
Application violated extended FILE safety mechanism.
Please read the man page for extendedFILE.
Aborting

Abort(coredump)

% /usr/bin/pstack core
core 'core' of 10172: ./enableextfile
d1f28e65 _lwp_kill (1, 6) + 15
d1ee2102 raise (6) + 22
d1ec0dad abort (0, 80677e0, d1f60000, 804638c, 804638c, 80463c4) + cd
d1f01d54 _file_get (80677e0) + b4
d1efeb21 _findbuf (80677e0) + 31
d1ef2f16 _ndoprnt (d1f70344, 80471d4, 80677e0, 0) + 46
d1ef669f fprintf (80677e0, d1f70344) + 9f
d1f702cb manipulatefd (80677e0) + 3b
0805097f main (1, 8047214, 804721c) + 9f
0805084a _start (1, 8047360, 0, 8047370, 8047382, 8047393) + 7a

If the application does not show any of the above mentioned patterns, it can take advantage of this run-time solution irrespective of its age i.e., even the applications built on Solaris 7 or prior versions may continue to work flawlessly.

See the manual page of extendedFILE(5) for more examples.

2) Programming Solution(s)


This section is intended for new applications and applications that can easily be modified.

There are two programmatic interfaces which will allow access to the larger than 256 file descriptor FILE pool provided the maximum file descriptors resource limit has been raised. Note that the default maximum file descriptors limit is still 256.

i) Enhanced Standard I/O Open Calls fopen(3C), fdopen(3C) and popen(3C)

In order to reduce the effort in modifying the existing sources to take advantage of the extended FILE feature, the existing mode string of stdio open calls like fopen(3C), fdopen(3C), popen(3C) have been augmented with a new flag 'F'.

eg.,
FILE *fptr = fopen("dummy.txt", "rF");

int fd = creat("dummy2.txt", S_IWUSR);
FILE *stream = fdopen(fd, "wF");

FILE *ptr = popen("/usr/bin/ls *.txt", "rF");

If the last character of the mode string is an 'F', 32-bit processes will be allowed to associate a stream with a file accessed by a file descriptor with a value greater than 255. In case of 64-bit applications, the character 'F' in the mode string will be silently ignored. Except for this minor enhancement, the existing semantics of stdio open calls haven't changed.

The 'F' in the mode string of stdio open calls is intended for code that doesn't:
  1. directly de-references fields in the FILE structure, and
  2. return a FILE pointer to the caller.

If the application exhibits any of the above mentioned patterns, the character 'F' must not be appended in the mode string to enable the extended FILE feature. Data corruption could occur, if the fields in the FILE structure are used directly by 32-bit applications when the last character of mode is 'F'. Also there is an equal chance of data corruption when the extended FILE pointer is returned to the binary code unknown to the user (uninspected code, that is), as the caller might not understand how to handle it. This interface does not provide any safe guards against misuse of extended FILE pointers. If a FILE pointer must be returned to any uninspected code consider using enable_extended_FILE_stdio(3C) at a higher level in the code.

Usage example:

Re-build the test case after changing the following line:

fds[i] = fopen(filename, "w");

to
fds[i] = fopen(filename, "wF");

Raise the file descriptor limit from the shell, and run the test case again to see the results.
% cc -o fopentestcaseF fopentestcase.c

% ulimit -n 10000

% ulimit -a | grep descriptors
nofiles(descriptors) 10000

% ./fopentestcaseF
Number of open files = 9996. fopen() failed with error: Too many open files

Note the absence of linking against any special libraries to make it work. All the stdio routines are still part of libc.

Have a look at the man pages of fopen(3C), fdopen(3C) and popen(3C) for more.

ii) New Programming Interface enable_extended_FILE_stdio(3C)

If the FILE pointer is not confined within the context of a single function, the new programming interface enable_extended_FILE_stdio() can be used to enable the extended FILE facility. This interface minimizes the data corruption by providing some protection mechanism to software with unknown behaviors such as 3rd party libraries without source code. For instance, by using this interface the user can choose any signal to be sent to the process during run-time when the application de-references FILE -> _file inappropriately.

This new interface was defined in /usr/include/stdio_ext.h header as follows:

int enable_extended_FILE_stdio(int, int);


The first argument, an integer, specifies the file descriptor in the range 3 - 255 that the application wants to be selected as the unallocatable file descriptor. Alternatively setting it to -1 will request enable_extended_FILE_stdio(3C) to select a reasonable unallocatable file descriptor. This is the equivalent of setting environment variable, _STDIO_BADFD, when enabling the run-time solution for extended FILEs.

The second argument, an integer, specifies the signal to be sent to the process when the unallocatable file descriptor is used as a file descriptor argument to any system call except close(2) or closefrom(3C). Some applications may attempt to close file descriptors that they did not open. This exception prevents application crash from such harmless calls. If -1 is passed, the default signal SIGABRT will be sent to the process. A value of 0 ignores any FILE -> _file de-references by disabling the sending of a signal. Otherwise, the specified signal will be sent to the process. See signal.h(3HEAD) for the complete list of signals on Solaris. This is the equivalent of setting environment variable, _STDIO_BADFD_SIGNAL, when enabling the run-time solution for extended FILEs.

The enable_extended_FILE_stdio(3C) function is available only in the 32-bit compilation environment.

For the extended FILE facility to be effective, raise the default maximum file descriptor limit for the process from 256 to any number less than or equal to the hard limit for the number of files a process can have opened at any time (see the kernel tunable, rlim_fd_max, for more). This can be done either from the shell with ulimit/limit commands or programmatically by using getrlimit(2)/setrlimit(2) functions defined in /usr/include/sys/resource.h header.

The following trivial programming example demonstrates:
  • setting the file descriptor limit through getrlimit(2)/setrlimit(2) interfaces
  • the usage of this new function to enable the extended FILE facility, and
  • the application crash when an uninspected code abuses the underlying file descriptor by directly changing the value of FILE -> _file.

Compile the following code and build an executable by linking the object code with the library, libthirdparty.so, created in the Run-time Solution section of this article.
% cat enableextfilestdio.c

#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <sys/resource.h>

#define NoOfFiles 500

void manipulatefd(FILE *);

int main ()
{
FILE *fptr;
struct rlimit rlp;
int i;

(void) getrlimit (RLIMIT_NOFILE, &rlp);
rlp.rlim_cur = NoOfFiles;
/* set the desired number of file descriptors */

if (setrlimit (RLIMIT_NOFILE, &rlp) == -1)
{
perror ("setrlimit(): ");
exit (1);
}

if (enable_extended_FILE_stdio (-1, -1) == -1)
{
perror ("enable_extended_FILE_stdio(3C): ");
exit (1);
}

for (i = 0; i < NoOfFiles; i++)
{
fptr = fopen ("/tmp/enable_test.txt", "w");

if (fptr == NULL)
{
perror("\nfopen failed. ");
exit (1);
}

printf ("\nfd = %d", fileno(fptr));

if (fileno (fptr) % 400 == 0)
{
manipulatefd (fptr);
}
}

return (0);
}

% export LD_LIBRARY_PATH=/tmp:$LD_LIBRARY_PATH
% cc -o enableextfilestdio -lthirdparty enableextfilestdio.c

% ./enableextfilestdio
fd = 3
fd = 4
fd = 5
...
...
fd = 398
fd = 399
fd = 400
thirdpartysrc.c : manipulatefd(): underlying file descriptor = 196
Application violated extended FILE safety mechanism.
Please read the man page for extendedFILE.
Aborting
Abort
(core dumped)

See the man page of enable_extended_FILE_stdio(3C) for more.

Alert: _file becomes _magic in the Next Major Customer Release of Solaris

The following alert does not apply to Solaris 10 including update releases.

In order to ensure the safety in using the extended FILE mechanism, _file in FILE structure has been intentionally renamed to _magic in Solaris Express (a monthly snapshot of the next major customer release of Solaris currently under development) and OpenSolaris after build 39. This change would break the compilation of source code containing any references to FILE -> _file.

The following diff output shows the changes introduced in the definition of FILE structure to accommodate the extended FILE facility.
-        unsigned char   _file;  /* UNIX System file descriptor */
+ unsigned char _magic; /* Old home of the file descriptor */
+ /* Only fileno(3C) can retrieve the value now */


- unsigned __filler:4;
+ unsigned __extendedfd:1; /* enable extended FILE */
+ unsigned __xf_nocheck:1; /* no extended FILE runtime check */

+ unsigned __filler:10;

Hence the compilation of code with references to FILE -> _file will fail with the following error message on systems running Solaris Express (SX) or any OpenSolaris distribution after build 39, and of course the next major customer release of Solaris when it is available.
"filename.c", line xx: undefined struct/union member: _file
cc: acomp failed for filename.c

The value found in the field formerly known as _file might no longer contain the FILE's file descriptor. If the code is simply reading the value of _file, replace all such references with the more appropriate fileno(FILE) function (see fileno(3C)). The developers should no longer assign a new value to _file.

Impact on Run-time Performance


When extended FILE facility is enabled, there is no performance impact when accessing file descriptors <= 255; but there will be a slight performance degradation in accessing file descriptors >= 256 due to the storage/retrieval of the file descriptor in an auxiliary location.

Patches, Bugs


If your system is running any existing version of the Solaris 10 OS -- that is, Solaris 10 3/05 through Solaris 10 11/06 -- you can install the extended FILE facility on the system with the following set of three patches (or later revisions) for your hardware platform:

SPARC platform:

125100-04 Kernel Update patch
120473-05 libc nss ldap PAM zfs patch
125800-01 Fault Manager Patch

x86/x64 platform:

125101-04 Kernel Update patch
120037-15 libc nss ldap PAM zfs patch
125801-01 Fault Manager Patch

If the application code links with STLport C++ standard library that was shipped with Sun Studio compiler suite {using -library=stlport4 compiler option}, make sure Sun Studio 11 is patched with 121017-07 or later on SPARC, and 121018-07 or later on x86/x64 platforms to take advantage of extended FILEs.

Report extended FILE bugs, if any, at bugs.opensolaris.org; and use OpenSolaris discussion forums for any clarifications.

References

  1. PSARC/2006/162 Extended FILE space for 32-bit Solaris processes
  2. Manual pages of stdio(3C), extendedFILE(5), enable_extended_FILE_stdio(3C), fopen(3C), fdopen(3C) and popen(3C).

Footnotes


  1. RFE stands for Request For Enhancement.
  2. Solaris 10 8/07 will informally be referred as 'Solaris 10 Update 4'.
  3. By default file descriptors 0, 1 and 2 are reserved for use as the default stdin, stdout and stderr I/O streams.
  4. fileno() macro was removed from the headers in Solaris release 2.7
  5. Unpatched systems running Solaris 10 releases 3/05 through 11/06 wouldn't have the extended FILE solutions. However it is possible to get the extended FILE facility installed on those systems by applying the latest kernel and libc patches. See Patches, Bugs section for instructions.

Acknowledgments


Craig Mohrman, Peter Shoults, Chien Yen, Tom Gould and HN.


Related Posts:
* Patches to get extendedFILE solution on Solaris 10
* Solaris: Workaround to stdio's 255 open file descriptors limitation
* Solaris: 32-bits , fopen() and max number of open files
_____________
Technorati Tags:
 Solaris |  OpenSolaris
Read More
Posted in | No comments

Sunday, 27 May 2007

Oracle HOW-TO: Get the Table/View Definition, Indexed Columns

Posted on 12:11 by Unknown
Q#1: Given a view name, how do we get the definition of the view? i.e., how to get the corresponding SQL statement stored in the database in the system tablespace?

A: Query the TEXT column of table DBA_VIEWS.

Syntax:
SQL> set long 10000

SQL> select TEXT
2 FROM DBA_VIEWS
3 where OWNER = '<owner_name>'
4 and VIEW_NAME = '<view_name>';

Here is an example:
% sqlplus fs890/fs890@fs890

SQL> create table PERSON (
2 SSN VARCHAR2(12),
3 FIRST_NAME VARCHAR2(25),
4 LAST_NAME VARCHAR2(25),
5 STREET VARCHAR2(40),
6 CITY VARCHAR2(30),
7 STATE VARCHAR2(30),
8 ZIP VARCHAR2(15),
9 COUNTRY VARCHAR2(35));

Table created.

SQL> create view PERSON_VW as
2 select SSN, FIRST_NAME, LAST_NAME from PERSON;

View created.

SQL> set long 1000
SQL> select TEXT
2 from DBA_VIEWS
3 where OWNER = 'FS890'
4 and VIEW_NAME = 'PERSON_VW';

TEXT
--------------------------------------------------------------------------------
SELECT SSN, FIRST_NAME, LAST_NAME FROM PERSON

Q#2: How to get the current {session} user and current schema name?

A: Run the following query:

select sys_context('USERENV', 'SESSION_USER') SESSION_USER, sys_context('USERENV', 'CURRENT_SCHEMA') CURRENT_SCHEMA from dual;

Alternatively run select USER from DUAL; to find the current {session} user name.

sys_context() function returns the value of parameter associated with the context namespace. USERENV is an Oracle provided namespace that describes the current session. Check the table Predefined Parameters of Namespace USERENV for the list of parameters and the expected return values.

eg.,
SQL> column SESSION_USER format A15
SQL> column CURRENT_SEHEMA format A15

SQL> select sys_context('USERENV', 'SESSION_USER') SESSION_USER,
2 sys_context('USERENV', 'CURRENT_SCHEMA') CURRENT_SCHEMA from dual;

SESSION_USER CURRENT_SCHEMA
--------------- ---------------
FS890 FS890

SQL> column USER format A6

SQL> select USER from DUAL;

USER
------
FS890

Q#3: How to extract the table definition (DDL statements) from an Oracle database without having to go through a stack of dictionary views?

A: By calling the GET_DDL() function of metadata package DBMS_METADATA.

Syntax:
select DBMS_METADATA.GET_DDL('TABLE','<table_name>') from DUAL;

eg.,
SQL> set long 1000
SQL> set pagesize 0

SQL> select DBMS_METADATA.GET_DDL('TABLE','PERSON') from DUAL;

CREATE TABLE "FS890"."PERSON"
( "SSN" VARCHAR2(12),
"FIRST_NAME" VARCHAR2(25),
"LAST_NAME" VARCHAR2(25),
"STREET" VARCHAR2(40),
"CITY" VARCHAR2(30),
"STATE" VARCHAR2(30),
"ZIP" VARCHAR2(15),
"COUNTRY" VARCHAR2(35)
)
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENT
S 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
)
TABLESPACE "PSDEFAULT"

Q#4: How to extract the index definition (DDL statements) from an Oracle database without having to go through a stack of dictionary views?

A: By calling the GET_DDL() function of metadata package DBMS_METADATA.

Syntax:
select DBMS_METADATA.GET_DDL('INDEX','<index_name>') from DUAL;

eg.,
SQL> create index PERSON_IDX on PERSON ( SSN ); 

Index created.

SQL> set long 1000
SQL> set pagesize 0

SQL> select DBMS_METADATA.GET_DDL('INDEX','PERSON_IDX') from DUAL;

CREATE INDEX "FS890"."PERSON_IDX" ON "FS890"."PERSON" ("SSN")
PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MA
XEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL
DEFAULT)
TABLESPACE "PSDEFAULT"

If the interest is only to get the indexed column names for an index, simply query COLUMN_NAME of table USER_IND_COLUMNS.

Syntax:
select COLUMN_NAME from USER_IND_COLUMNS where INDEX_NAME = '<index_name>';

eg.,
SQL> column COLUMN_NAME format A15
SQL> select COLUMN_NAME from USER_IND_COLUMNS where INDEX_NAME = 'PERSON_IDX';

COLUMN_NAME
---------------
SSN
________________
Technorati tags:
 Oracle |  Database |  SQL |  DBA
Read More
Posted in | No comments

Sunday, 13 May 2007

Patches to get extendedFILE solution on Solaris 10

Posted on 21:43 by Unknown
The issue is discussed in the blog post Solaris: Workaround to stdio's 255 open file descriptors limitation.

If the system is running any existing major customer releases of Solaris 10 i.e., Solaris 10 3/05 through Solaris 10 11/06, extended FILE facility can be installed on these systems by applying the kernel patch, 125100-04 or later & libc patch, 120473-05 or later.

Systems running Solaris Express (SX) or any OpenSolaris distribution after build 39 does not need the patches mentioned above to get the extended FILE solution for stdio's 256 open files limitation.

Do not forget to read the man pages of extendedFILE(5), enable_extended_FILE_stdio(3C), fopen(3C), fdopen(3C) and popen(3C) to enable the extended FILE solution by pre-loading /usr/lib/extendedFILE.so.1 (run-time solution) or by using the enhanced stdio's interfaces, fopen(), fdopen(), popen() or with the new interface enable_extended_FILE_stdio().

--
Acknowledgments:
Peter Shoults, Sun Microsystems
________________
Technorati Tags:
 Sun |  Solaris
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • UNIX/Linux: File Permissions (chmod)
    A file's permissions are also known as its 'mode'; so to change them we need to use the 'chmod' command (change mode). T...
  • C/C++/Java: ++ unary operator
    #include <stdio.h> int main() { int i = 5, j = 5; int total = 0; total = ++i + j++; printf("\ntotal o...
  • C++: Virtual Function
    A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacemen...
  • Achievement Award
    Got an Achievement Award/Certificate from Sun Microsystems, in recognition for my effort with Siebel Benchmark!! =:) Related post: http:...
  • C/C++: Structure Vs Union
    A structure is a collection of items of different types; and each data item will have its own memory location. Where as only one item withi...
  • Database: Oracle Server Architecture (overview)
    Oracle server consists of the following core components: 1) database(s) & 2) instance(s) 1) database consists of: 1) datafil...
  • Solaris/C/C++: Benefit(s) of Linker (symbol) Scoping
    Introduction By default, the static linker (ld) makes all ELF symbols global in scope. This means it puts the symbols into the dynamic symbo...
  • Linux: Frozen Xwindows
    If Xwindows seem frozen, the following simple key strokes may bring back the Xserver without the need for a reboot Two ways to kill the Xwi...
  • PHP: Memory savings with mysqlnd
    mysqlnd may save memory. In the best cases, it may consume only 50% memory as that of libmysql esp. when the client application does not mod...
  • Blast from the Past : The Weekend Playlist #3
    The 80s contd., The 80s witnessed the rise of fine talent - so, it is only fitting to dedicate another complete playlist for the 80s. Her...

Categories

  • 80s music playlist
  • bandwidth iperf network solaris
  • best
  • black friday
  • breakdown database groups locality oracle pmap sga solaris
  • buy
  • deal
  • ebiz ebs hrms oracle payroll
  • emca oracle rdbms database ORA-01034
  • friday
  • Garmin
  • generic+discussion software installer
  • GPS
  • how-to solaris mmap
  • impdp ora-01089 oracle rdbms solaris tips upgrade workarounds zombie
  • Magellan
  • music
  • Navigation
  • OATS Oracle
  • Oracle Business+Intelligence Analytics Solaris SPARC T4
  • oracle database flashback FDA
  • Oracle Database RDBMS Redo Flash+Storage
  • oracle database solaris
  • oracle database solaris resource manager virtualization consolidation
  • Oracle EBS E-Business+Suite SPARC SuperCluster Optimized+Solution
  • Oracle EBS E-Business+Suite Workaround Tip
  • oracle lob bfile blob securefile rdbms database tips performance clob
  • oracle obiee analytics presentation+services
  • Oracle OID LDAP ADS
  • Oracle OID LDAP SPARC T5 T5-2 Benchmark
  • oracle pls-00201 dbms_system
  • oracle siebel CRM SCBroker load+balancing
  • Oracle Siebel Sun SPARC T4 Benchmark
  • Oracle Siebel Sun SPARC T5 Benchmark T5-2
  • Oracle Solaris
  • Oracle Solaris Database RDBMS Redo Flash F40 AWR
  • oracle solaris rpc statd RPC troubleshooting
  • oracle solaris svm solaris+volume+manager
  • Oracle Solaris Tips
  • oracle+solaris
  • RDC
  • sale
  • Smartphone Samsung Galaxy S2 Phone+Shutter Tip Android ICS
  • solaris oracle database fmw weblogic java dfw
  • SuperCluster Oracle Database RDBMS RAC Solaris Zones
  • tee
  • thanksgiving sale
  • tips
  • TomTom
  • windows

Blog Archive

  • ▼  2013 (16)
    • ▼  December (3)
      • Blast from the Past : The Weekend Playlist #3
      • Measuring Network Bandwidth Using iperf
      • Blast from the Past : The Weekend Playlist #2
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (2)
    • ►  January (1)
  • ►  2012 (14)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ►  2011 (15)
    • ►  December (2)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (19)
    • ►  December (3)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (5)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2009 (25)
    • ►  December (1)
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (2)
    • ►  July (2)
    • ►  June (1)
    • ►  May (2)
    • ►  April (3)
    • ►  March (1)
    • ►  February (5)
    • ►  January (4)
  • ►  2008 (34)
    • ►  December (2)
    • ►  November (2)
    • ►  October (2)
    • ►  September (1)
    • ►  August (4)
    • ►  July (2)
    • ►  June (3)
    • ►  May (3)
    • ►  April (2)
    • ►  March (5)
    • ►  February (4)
    • ►  January (4)
  • ►  2007 (33)
    • ►  December (2)
    • ►  November (4)
    • ►  October (2)
    • ►  September (5)
    • ►  August (3)
    • ►  June (2)
    • ►  May (3)
    • ►  April (5)
    • ►  March (3)
    • ►  February (1)
    • ►  January (3)
  • ►  2006 (40)
    • ►  December (2)
    • ►  November (6)
    • ►  October (2)
    • ►  September (2)
    • ►  August (1)
    • ►  July (2)
    • ►  June (2)
    • ►  May (4)
    • ►  April (5)
    • ►  March (5)
    • ►  February (3)
    • ►  January (6)
  • ►  2005 (72)
    • ►  December (5)
    • ►  November (2)
    • ►  October (6)
    • ►  September (5)
    • ►  August (5)
    • ►  July (10)
    • ►  June (8)
    • ►  May (9)
    • ►  April (6)
    • ►  March (6)
    • ►  February (5)
    • ►  January (5)
  • ►  2004 (36)
    • ►  December (1)
    • ►  November (5)
    • ►  October (12)
    • ►  September (18)
Powered by Blogger.

About Me

Unknown
View my complete profile