Skip to main content

patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long

Following error occurs while running patchsets.sh supplied by Metalink Document Oracle Applications Current Patchset Comparison Utility - patchsets.sh [ID 139684.1]

patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long.
patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long.
patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long.
patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long.
patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long.
patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long.
patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long.
patchsets.sh[295]: /usr/bin/grep: 0403-027 The parameter list is too long.
Error is thrown not only for grep but even for all the OS utilities(sed,date,awk,tr,cp, rm) that are used in the script.

This happens because by default the ouput files are created under /tmp and if and only if /tmp has way too many files in it.

Easy workaround is as follows:

Oracle provides an option to set the output directory by setting a env variable called CUST_TEMP.

Set CUST_TEMP to a empty directory or clear all the files under /tmp and patchsets.sh should work fine.

Other way round

#getconf ARG_MAX
  12345

This means that ARG_MAX is low.  Set ARG_MAX to a higher value and this should solve your issue.

Check ncargs as well,

 lsattr -El sys0 -a ncargs

ARG_MAX can be increased by increasing ncargs.

ON AIX, YOU CAN USE THE FOLLOWING COMMAND AS ROOT,
/usr/sbin/chdev -l sys0 -a ncargs='128'

Comments

deepak said…
Hi Mithun,
You have shared a excellent info. Many thanks to you.

Regards,
Deepak
deepak said…
Hi Mithun,

Is there any option to know the job status of the patch being applied? I am looking for an option to find patch activity log if the original log is not being updated during patching.

Regards,
Deepak.
hemasingamsetty said…
hi sir ,
1)what is a function in oracle?
2)difference b/w rowid & rownum
3)what is sql*loader
4)what is diff b/w sql&sql*plus
5)how to select only odd rows,even
rows(not based on salfor eg1,3,5
and 2,4,6 etc...)
6)how to select a particular row
for eg 7th row
select a.* from emp a where rownum=7
hemasingamsetty said…
hi sir
what is d diff b/w translate &replace


Regards,
Hema
hema said…
hi sir,
1 create table temp(A number primary key,
2 B number unique,
3 C number check > 0,
4 D number not null
5* )
SQL> /
C number check > 0,
*
ERROR at line 3:
ORA-00906: missing left parenthesis
pls correct this
regards
hema
Mithun Ashok said…
1)what is a function in oracle?

Refer to my presentation below for details on Function in oracle. (Includes definition and examples)

http://www.mithunashok.com/2011/02/sql-basics-presentation.html


2)difference b/w rowid & rownum
Both rowid and rownum are pseudocolumns.

Rowid stores address information for each row in a table and it is always static.

Rownum always returns a number for each row indicating the order in which the row is selected by oracle and it is always dynamic.

Consider following examples,

SELECT rowid,rownum,ename FROM emp;

SELECT rowid, rownum,ename FROM emp ORDER BY ename;

SELECT rowid, rownum, ename FROM emp WHERE ename LIKE 'A%';

SELECT rowid, rownum, ename FROM emp WHERE ename LIKE 'M%';

Compare the results from all the querries. Notice that rowid never changes but rownum changes in the way in which oracle selects the record.



3)what is sql*loader

SQL*Loader is a utility/program used to load data from any text file to the database. Usually used to migrate the data from one schema to another or from one database to another. It is also called as bulk loader.


4)what is diff b/w sql&sql*plus

Refer to slide 23 of my presentation below,

http://www.mithunashok.com/2011/03/sql-basics-basic-select-statement.html


5)how to select only odd rows,even
rows(not based on salfor eg1,3,5
and 2,4,6 etc...)

SELECT rownum,ename FROM emp;

To SELECT only odd numbered rows,

SELECT ename, rownum FROM emp GROUP BY rownum, ename HAVING MOD(rownum,2) = 1 ORDER BY rownum;

To SELECT even numbered rows,

SELECT ename, rownum FROM emp GROUP BY rownum, ename HAVING MOD(rownum,2) = 0 ORDER BY rownum;

6)how to select a particular row
for eg 7th row
select a.* from emp a where rownum=7

SELECT ename, rownum FROM emp GROUP BY rownum, ename HAVING rownum = 7;

OR

SELECT * FROM ( SELECT rownum rownumber, ename FROM emp) WHERE rownumber = 7;

7) what is d diff b/w translate &replace

REPLACE and TRANSLATE are similar functions. Using REPLACE you can replace a string with another single string. Otherwise TRANSLATE lets you make multiple single one to one substitution in a single statement. Look at the example below.

SELECT TRANSLATE('Qspiders students rock', ' s', '_1') TRANS,REPLACE('Qspiders students rock','s','x') REP FROM DUAL;

Here in the example TRANSLATE function replaces both ' '(space) with '_' and 's' with '1'. REPLACE function can replace only 1 string that 's' with 'x'.

8) create table temp(A number primary key,
B number unique,
C number check > 0,
D number not null )
SQL> /
C number check > 0,
*
ERROR at line 3:
ORA-00906: missing left parenthesis
pls correct this


You should always use check condition with a comparission value inside brackets. Use the statement as,

CREATE TABLE temp(A NUMBER PRIMARY KEY,
B NUMBER UNIQUE,
C NUMBER CHECK (c > 0),
D NUMBER NOT NULL);

Hope this answers all your questions.
Anonymous said…
What a great web log. I spend hours on the net reading blogs, about tons of various subjects. I have to first of all give praise to whoever created your theme and second of all to you for writing what i can only describe as an fabulous article. I honestly believe there is a skill to writing articles that only very few posses and honestly you got it. The combining of demonstrative and upper-class content is by all odds super rare with the astronomic amount of blogs on the cyberspace.

Popular posts from this blog

SQL Interview Questions on Subqueries

SUB Queries:
1. List the employees working in research department 2. List employees who are located in New York and Chicago
3. Display the department name in which ANALYSTS are working
4. Display employees who are reporting to JONES
5. Display all the employees who are reporting to Jones Manager
6. Display all the managers in SALES and ACCOUNTING department
7. Display all the employee names in Research and Sales Department who are having at least 1 person reporting to them
8. Display all employees who do not have any reportees
9. List employees who are having at least 2 reporting
10. List the department names which are having more than 5 employees
11. List department name having at-least 3 salesman
12. List employees from research and accounting having at-least 2 reporting
13. Display second max salary
14. Display 4th max salary
15. Display 5th max salary  -- Answer for nth Max Salary
Co-Related Subqueries:
16. Write a query to get 4th max salary from EMP table
17. Write a query to get 2nd…

Answers for SUB Queries

1. SQL> select empno, ename from emp where deptno=(select deptno from dept where dname='RESEARCH');


2. SQL> select empno, ename from emp where deptno in (select deptno from dept where loc in ('NEW YORK','CHICAGO'));

3. SQL> select dname from dept where deptno in ( select deptno from emp where job ='ANALYST');

4. SQL> select empno, ename, mgr from emp where mgr = (select empno from emp where ename='JONES');

5. SQL> select empno, ename, mgr from emp where mgr = (select mgr from emp where ename='JONES')

6. SQL> select empno, ename, job from emp where deptno in ( select deptno from dept where dname in ('SALES','ACCOUNTING'))

7. SQL> select empno, ename, job from emp where deptno in ( select deptno from dept where dname in ('SALES','RESEARCH')) and empno in (select mgr from emp)

8. SQL> select empno, ename from emp where empno not in ( select mgr from emp where mgr is not null)

9. select…

'Linux-x86_64 Error: 28: No space left on device' While trying to start the database -- Error

SQL> startup mount pfile='/tmp/initdlfasp12.ora'
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device


This as you can see is on Linux x86 with 64 bit processor. We got this error after we changed SGA on 10gR2 database. So was sure that this is something to do with the OS.

Parameters to check for this are shmall.

shmall is the total amount of shared memory, in pages, that the system can use at one time.

$cat /proc/sys/kernel/shmmax
53687091200

$ getconf PAGE_SIZE
4096

As per Oracle SHMALL should be set to the total amount of physical RAM divided by page size.

Our system has 64GB memory, so change kernel.shmall = 1024 * 1024 * 1024 * 64 / 4096 = 16777216


Once this value is calculated you can modify Linux system configuration file directly.

$ su - root
vi /etc/sysctl.conf file:
kernel.shmall=16777216

and

# sysctl -p

Once this is done the database was started without any problem.