Tuesday, October 7, 2008

64 Bit or 32 Bit processor for my oracle database?

While recommending for Hardware Sizing, ensure that the Database servers the ct is going to procure is a 64-Bit processor (depending up on the number of users).

In 32-Bit processor the sga_max_size cannot be increased more than 1.78 Gb (even when /3g switch is enabled). This restriction leads to re-sizing of the hardware and could leads to loss in business.

In a 64-bit processor the above said incompatibility was overridden

How to check the ORACLE installed is 32-Bit or 64 Bit ?
cd $ORACLE_HOME/bin
file oracl*

This will display the file type of your oracle binaries. If you are running 64-bit binaries, the output should look like this:

oracle: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped
oracleO: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped

If your binaries are 32-bit, the output will look like this:

oracle: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped

Saturday, September 20, 2008

Oracle 11g New feature Case Sensitive Password

In the Password file,
orapwd file=orclpwd password=manager ignorecase=y

Password case sensitive by default, new init.ora parameter sec_case_sensitive_logon is introduce in 11g to switch on/off
## Init.ora parameter #sec_case_sensitive_logon = (TRUE FALSE)
## On system level you can switch off#
alter system set sec_case_sensitive_logon = false
##Find users who have case sensitive or case insensitive#passwords#

SQL> COL USERNAME form a19
SQL> SELECT USERNAME,PASSWORD_VERSIONS FROM DBA_USERS where rownum <>

USERNAME PASSWORD_VERSIONS

ABCXYZ12 10G 11G
ADKULABC 10G 11G
ORACLE12 10G 11G
ANAND 10G

Since password are case sensitive, so DB link created from pre-11G DB to 11G DB might not work. When you create database link in pre-11G DB by default password saved in upper case and when you use database link you will get error "ORA-01017: invalid username/password; logon denied"

When creating database link, use following work around to force case sensitive password
## Use quote " with password like "tiger"#create database link abc connect to scott identifiedby "tiger" using 'ORCL2';

Tuesday, June 17, 2008

Tracing a Oracle session

To trace a session
1) For tracing any session we require SID, SERIAL# of that session. Also SPID will help In finding out the session trace file in UDMP folder as trace files are named using SPID of that session.
2) Find out the SID, SERIAL from v$session.
select sid, serial#, machine, terminal from v$session order by logon_date;
Check the machine name for confirming the SID.
3) Login to the DB server as sys as sysdba and give password.
Issue the command
EXEC DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION (, , TRUE);
4) Only after issuing this command should the user perform the transaction. Before issuing the command in 3rd step the user should have only logged in by giving the details like user id etc. He should wait till the command in the 3rd step is issued.
5) Once the command is executed the user can start his/her transaction.
6) For stopping/disabling the trace issue:
EXEC DBMS_SYSTEM.SET_SQL_TRACE_IN_SESSION(,,FALSE);
7) After stopping the trace you can find the trace file in UDUMP folder.UDUMP will be located in C:\Ora9idb\admin\HDC\udump.The spid will be included in the trace file name hdcorion_8853.trc. 8853 is the spid here.
8) The trace file will not be in readable format. You have to convert that in readable format by issuing the following command for the command prompt
TKPROF explain = sort=(prsela,exeela,fchela).
EXAMPLE:
TKPROF c:\trace01.txt explain=kastle/kastle sort=(prsela,exeela,fchela)

Enable /3G Switch and PAE for Windows

Scope :
To Enable the /3G Switch and PAE for Windows based system.
Restrictions :
It requires a restart of the OS.
How to :
Edit the boot.ini file in the location c:\
Go to run ->type c:\boot.ini
It will open a notepad,
Add the text marked in bold and then restart the server,
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /fastdetect /NoExecute=OptIn /3G /PAE
Note:
boot.ini file is a invisible file.

Saturday, March 15, 2008

Performance tuning (how to start?)

5 steps to tune a sick database.

1] Understand: the customer expectation and severity. (eg. expected time to complete a txn).

2] Identify: the area to be tuned, it can be memory or SQL or network or OS/hardware)

3] Analyze: the problem area, prepare a solution and think the aftermath effect.

4] Test: the solution if the problem occurs for the first time or go by experience.

5] Implement: the solution and repeat from step2 if needed.