September 23 2013

su: cannot set user id: Resource temporarily unavailable

Hi there,
I’m getting following error when I use root to “su – oracle” in Linux. Finally, I found the solution as shown below 🙂

# uname -srm
Linux 2.6.18-308.11.1.el5 x86_64

# su – oracle
su: cannot set user id: Resource temporarily unavailable

# ps -eLF | grep “^oracle” | wc -l
2068

Increase value “nproc soft limit” for oracle:
#– /etc/security/limits.conf –#

#oracle soft nproc 2047
oracle soft nproc 4095

# su – oracle
$ whoami
oracle

February 22 2013

How to relink Oracle binaries after OS upgrade in 11gR2 with Grid Infra?

Tagged Under : , ,

(1) Shutdown DB, DBconsole (if any), Cluster, ASMlib (if any in Linux)

As RDBMS owner id “oracle”:
$ srvctl stop database -d -o immediate #– run once in any node
$ emctl stop dbconsole #– run on all nodes

As UNIX/Linux “root”:
# /bin/crsctl stop crs #– run on all nodes
# /bin/crsctl disable crs #– run on all nodes
# /etc/init.d/oracleasm stop #– run on all nodes
# /etc/init.d/oracleasm disable #– run on all nodes

(2) Backup filesystem for GI ORACLE_HOME & RDBMS ORACLE_HOME

(3) O/S upgrade

(4) Upgrade ASMlib (if any in Linux, run on all nodes)
# rpm -Uvh oracleasm-support-xxx
# rpm -Uvh oracleasm-2.6.xxx
# rpm -Uvh oracleasmlib-xxx
# /etc/init.d/oracleasm enable
# /etc/init.d/oracleasm lisdisks

(5) Relink RDBMS ORACLE_HOME Binary
Note: complete full steps in onde node, then proceed to next

As RDBMS owner id “oracle”:
$ /bin/relink all

(6) Relink GI ORACLE_HOME Binary
Note: complete full steps in onde node, then proceed to next

As UNIX/Linux “root”:
# cd /crs/install
# ./rootcrs.pl -unlock

As RDBMS owner id “oracle”:
$ cd /bin
$ ./relink all

As UNIX/Linux “root”:
# cd /rdbms/install
# ./rootadd_rdbms.sh
# cd /crs/install
# ./rootcrs.pl -patch

(7) Enable CRS auto-startup and start CRS on all nodes
Note: complete full steps in onde node, then proceed to next

As UNIX/Linux “root”:
# /bin/crsctl start crs
# /bin/crsctl enable crs

(8) Double check if DB, instances and all resrouces are ONLINE.

As RDBMS owner id “oracle”:
$ crsctl stat res -t

Gentle reminder:
Please read the following known bug before you plan for relinking Grid Infra 11.2.0.3.

Bug 16038046 : FAILED TO WRITE THE CHECKPOINT:” WITH STATUS:FAIL.ERROR CODE IS 256

November 09 2011

How to test INSERT/UPDATE in Informix BYTE column?

Tagged Under : , , , , , , ,

Question:
How to test INSERT/UPDATE in Informix BYTE column?

Preparation:
1. Informix IDS is online and running

2. Informix Client-SDK installed

3. Prepare 2 object files (image1.pdf, image2.pdf)

4. create table testbyte1 (num integer,
file byte);
create unique index byte_idx1 on testbyte1(num) ;

5. Compile “blobload” utility.
– set environment variable $INFORMIXDIR
(where CSDK installed)

– set environment variable PATH=$INFORMIXDIR/bin:$PATH
– you may find “blobload.ec” in $INFORMIXDIR/demo/esqlc
– compile “esql -o blobload blobload.ec”, will get executable binary “blobload”

Test INSERT/UPDATE BYTE column:

6. To get syntax on usage, just type “./blobload”

Usage: blobload {-i | -u} — choose insert or update
-f filename — file containing the blob data
-d database_name — database to open
-t table_name — table to modify
-b blob_column — name of target column
-k key_column key_value — name of key column and a value
-v — verbose documentary output

All parameters except -v are required.
Parameters may be given in any order.
As many as 8 -k parameter pairs may be specified.

7. INSERT BYTE testing.

$ ./blobload -i -f ./image1.pdf -d mytestdb -t testbyte -b file -k num 1001 -v

prepared stmt =
INSERT INTO testblob1( file, num) VALUES( ?, “1001”);

1 row(s) inserted.

8. UPDATE BYTE testing.

$ ./blobload -u -f ./image2.pdf -d mytestdb -t testbyte -b file -k num 1001 -v

prepared stmt =
UPDATE testblob1 SET file = ? WHERE num = “1001”;

1 row(s) updated.

9. Check number of rows:

SQL> select * from testbyte1;

num 1001
file

1 row(s) retrieved.