Tuesday, September 14, 2010

Install Oracle 10g R2 on Linux

Oracle 10g R2 on Linux

vi /etc/sysctl.conf

#add the following line in the end of file
kernel.core_uses_pid = 1
kernel.shmmni=4096
kernel.shmall=2097152
kernel.shmmax=2147483648
kernel.sem=250 32000 100 128
fs.file-max=65536
net.ipv4.ip_local_port_range=1024 65000
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144

vi /etc/security/limits.conf
#add the following line in the end of file
oracle soft nofile 63536
oracle hard nofile 63536
oracle soft nproc 16384
oracle hard nproc 16384

groupadd dba
groupadd oinstall
mkdir /u01
useradd -d /home/oracle -g oinstall -G dba oracle
passwd oracle
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/

#Open a new terminal
su oracle
cd
pwd
vi .bash_profile
#add the following lines in the end of the file
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Now reboot the machine

Before starting installation, log in as root, and switch to oracle user by command
su - oracle

#During installation open a terminal a root, run the following scripts and press ok
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh

Now log in as oracle and run
dbca

emctl stop dbconsole
emctl start dbconsole

sqlplus
user= sys/oracle as sysdba
shutdown immediate
startup;

Monday, August 23, 2010

Retrieve the Password of any User in Oracle Applications.

How to get the Pass word of a User with out the help of a BDA in Oracle Apps

–Create the Following Package

CREATE OR REPLACE PACKAGE get_pwd
AS
FUNCTION decrypt (
KEY IN VARCHAR2
,VALUE IN VARCHAR2
)
RETURN VARCHAR2;
END get_pwd;
/

CREATE OR REPLACE PACKAGE BODY get_pwd
AS
FUNCTION decrypt (
KEY IN VARCHAR2
,VALUE IN VARCHAR2
)
RETURN VARCHAR2
AS
LANGUAGE JAVA
NAME ‘oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String’;
END get_pwd;
/


/** Run Login Apps User on Toad/Oracle– Will get apps password */
SELECT (SELECT get_pwd.decrypt (UPPER ((SELECT UPPER (fnd_profile.VALUE (‘GUEST_USER_PWD’))
FROM DUAL)), usertable.encrypted_foundation_password)
FROM DUAL) AS apps_password
FROM fnd_user usertable
WHERE usertable.user_name LIKE UPPER ((SELECT SUBSTR (fnd_profile.VALUE (‘GUEST_USER_PWD’)
,1
, INSTR (fnd_profile.VALUE (‘GUEST_USER_PWD’), ‘/’)
- 1
)
FROM DUAL))


–Run this on toad will get all the usernames and passwords

SELECT usertable.user_name
, (SELECT get_pwd.decrypt (UPPER ((SELECT (SELECT get_pwd.decrypt (UPPER ((SELECT UPPER (fnd_profile.VALUE (‘GUEST_USER_PWD’))
FROM DUAL)), usertable.encrypted_foundation_password)
FROM DUAL) AS apps_password
FROM fnd_user usertable
WHERE usertable.user_name LIKE
UPPER ((SELECT SUBSTR (fnd_profile.VALUE (‘GUEST_USER_PWD’)
,1
, INSTR (fnd_profile.VALUE (‘GUEST_USER_PWD’), ‘/’)
- 1
)
FROM DUAL))))
,usertable.encrypted_user_password)
FROM DUAL) AS encrypted_user_password
FROM fnd_user usertable
WHERE usertable.user_name LIKE UPPER (‘&username’)


Once you run this select statement on sql or Toad after entering username in where condition, you will get the password instantly

Saturday, April 24, 2010

How To Pin Oracle Packages

To prevent paging, you can mark packages as non-swappable, telling the database that after their initial load they must always remain in memory. This is called pinning, or memory fencing. Oracle provides the procedure dbms_shared_pool.keep for pinning a package. You can unpin packages by using dbms_shared_pool.unkeep. In addition to pinning packages at database startup time, you can call the dbmspool.keep procedure at runtime to pin a package of stand-alone stored procedures.

The choice of whether to pin a procedure in memory is a function of the size of the object and the frequency in which it is used.

Very large Oracle stored procedures that are called frequently might benefit from pinning, but you might never notice any difference in that case, because the frequent calls to the procedure will have kept it loaded into memory anyway.

In an ideal world, the init.ora shared_pool_size parameter would be large enough to accept every package, stored procedure, and trigger your applications might invoke. Reality, however, dictates that the shared pool cannot grow indefinitely, and you need to make wise choices regarding which objects you pin. You can query the sharable_mem column of the v$db_object_cache table to see how much memory each package consumes in the library cache.

Oracle Corporation recommends that you always pin the STANDARD, DBMS_STANDARD, DBMS_UTILITY, DBMS_DESCRIBE, and DBMS_OUTPUT packages in the shared pool. You can use the following code:

connect internal;
@/usr/oracle/rdbms/admin/dbmspool.sql
execute dbms_shared_pool.keep('sys.standard');

You can write a standard procedure to pin all of the recommended Oracle packages into the
shared pool. Here is the script:
execute dbms_shared_pool.keep('DBMS_ALERT');
execute dbms_shared_pool.keep('DBMS_DDL');
execute dbms_shared_pool.keep('DBMS_DESCRIBE');
execute dbms_shared_pool.keep('DBMS_LOCK');
execute dbms_shared_pool.keep('DBMS_OUTPUT');
execute dbms_shared_pool.keep('DBMS_PIPE');
execute dbms_shared_pool.keep('DBMS_SESSION');
execute dbms_shared_pool.keep('DBMS_SHARED_POOL');
execute dbms_shared_pool.keep('DBMS_STANDARD');
execute dbms_shared_pool.keep('DBMS_UTILITY');
execute dbms_shared_pool.keep('STANDARD');

Source www.rampant-books.com