Hiddle parameter values can not be accessed using v$parameter view. Use the following script:
SELECT
x.ksppinm name,
y.ksppstvl VALUE,
decode(ksppity,
1, 'BOOLEAN',
2, 'STRING',
3, 'INTEGER',
4, 'PARAMETER FILE',
5, 'RESERVED',
6, 'BIG INTEGER',
'UNKNOWN') typ,
decode(ksppstdf,
'TRUE', 'DEFAULT VALUE',
'FALSE', 'INIT.ORA') isdefault,
decode(bitand(ksppiflg / 256, 1),
1, 'IS_SESS_MOD(TRUE)',
'FALSE') isses_modifiable,
decode(bitand(ksppiflg / 65536, 3),
1, 'MODSYS(NONDEFERED)',
2, 'MODSYS(DEFERED)',
3, 'MODSYS(*NONDEFERED*)',
'FALSE') issys_modifiable,
decode(bitand(ksppstvf, 7),
1, 'MODIFIED_BY(SESSION)',
4, 'MODIFIED_BY(SYSTEM)',
'FALSE') is_modified,
decode(bitand(ksppstvf, 2),
2, 'ORA_STARTUP_MOD(TRUE)',
'FALSE') is_adjusted,
ksppdesc description,
ksppstcmnt update_comment
FROM x$ksppi x,
x$ksppcv y
WHERE x.inst_id = userenv('Instance')
AND y.inst_id = userenv('Instance')
AND x.indx = y.indx
AND x.ksppinm LIKE '%pga%';
Sunday, December 6, 2009
Wednesday, November 18, 2009
Configure DBD::ODBC on AIX 5.3
DBD::ODBC perl module helps connecting to various datasources using ODBC. In order to get this module working, one needs to install unixodbc on aix platform.
1.Download unixODBC-2.2.11
- Version 2.2.14 has some issues causing installation to fail.
2.
export CC=xlc_r
export CCC=xlC_r
3. For 64 bit OS
export OBJECT_MODE=64
export CFLAGS=-q64
It is possible to install 32 bit binaries on 64 bit OS. Just do not set the above two variables.
4 Execute configure
./configure --prefix=/opt/unixODBC --disable-gui CC=xlc_r CXX=xlC_r
make
make install
5. Generate shared object libraries (/opt/unixODBC/lib)
ar -x libodbc.a
ar -x libodbcinst.a
ar -x libodbccr.a
5. Set the following environment variables
export ODBCINI=/usr/scratch/odbc.ini
export ODBCHOME=/opt/unixODBC
export LIBPATH=/opt/unixODBC/lib:${LIBPATH}
If perl is already installed, install module DBI and then DBD::ODBC. For new install follow the procedure mentioned below:
1. Download perl 5.10.1
2 If OS is 64 bit use flag -Duse64bitall
sh Configure -Duse64bitall -Dprefix=/opt/perl -des
make
make install
To install 32 bit perl binaries, do not use flag -Duse64bitall
3. Configure CPAN. First configure it in default mode. Then make changes to the proxy settings
cpan> o conf init /proxy/
--specify ftp_proxy and http_proxy to be used
cpan> 0 conf commit
4. Install DBI module
cpan> install DBI
5. install DBD::ODBC
cpan> install DBD::ODBC
you should be all set to use perl DBD::ODBC module !!!
1.Download unixODBC-2.2.11
- Version 2.2.14 has some issues causing installation to fail.
2.
export CC=xlc_r
export CCC=xlC_r
3. For 64 bit OS
export OBJECT_MODE=64
export CFLAGS=-q64
It is possible to install 32 bit binaries on 64 bit OS. Just do not set the above two variables.
4 Execute configure
./configure --prefix=/opt/unixODBC --disable-gui CC=xlc_r CXX=xlC_r
make
make install
5. Generate shared object libraries (/opt/unixODBC/lib)
ar -x libodbc.a
ar -x libodbcinst.a
ar -x libodbccr.a
5. Set the following environment variables
export ODBCINI=/usr/scratch/odbc.ini
export ODBCHOME=/opt/unixODBC
export LIBPATH=/opt/unixODBC/lib:${LIBPATH}
If perl is already installed, install module DBI and then DBD::ODBC. For new install follow the procedure mentioned below:
1. Download perl 5.10.1
2 If OS is 64 bit use flag -Duse64bitall
sh Configure -Duse64bitall -Dprefix=/opt/perl -des
make
make install
To install 32 bit perl binaries, do not use flag -Duse64bitall
3. Configure CPAN. First configure it in default mode. Then make changes to the proxy settings
cpan> o conf init /proxy/
--specify ftp_proxy and http_proxy to be used
cpan> 0 conf commit
4. Install DBI module
cpan> install DBI
5. install DBD::ODBC
cpan> install DBD::ODBC
you should be all set to use perl DBD::ODBC module !!!
Monday, November 16, 2009
setting root prompt with sudo access
If you have sudo access to a machine, it is convenient to set root prompt and then execute commands instead of using "sudo command " everytime.
"sudo su -" would get you the root prompt.
"sudo su -" would get you the root prompt.
Wednesday, October 7, 2009
Removing Oracle 11gR2 software
To clean up the installed Oracle 11gR2 software, execute the deinstall script. It is present in $ORACLE_HOME/deinstall directory.
$ORACLE_HOME/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /scratch/Oracle/OraInventory/logs/
############ ORACLE DEINSTALL & DECONFIG TOOL START ############
######################## CHECK OPERATION START ########################
Install check configuration START
Checking for existence of the Oracle home location /scratch/Oracle11gr2/product/11.2.0/dbhome_1
Oracle Home type selected for de-install is: SIDB
Oracle Base selected for de-install is: /scratch/Oracle11gr2
Checking for existence of central inventory location /scratch/Oracle/OraInventory
$ORACLE_HOME/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /scratch/Oracle/OraInventory/logs/
############ ORACLE DEINSTALL & DECONFIG TOOL START ############
######################## CHECK OPERATION START ########################
Install check configuration START
Checking for existence of the Oracle home location /scratch/Oracle11gr2/product/11.2.0/dbhome_1
Oracle Home type selected for de-install is: SIDB
Oracle Base selected for de-install is: /scratch/Oracle11gr2
Checking for existence of central inventory location /scratch/Oracle/OraInventory
Sunday, June 7, 2009
Informatica : Setting codepage
Informatica integration service sometimes fails with the following error when trying to startup:
LM_36011
Code page mismatch. Service process is running in code page [ISO 8859-1 Western European] whereas the service is configured in the Admin Console to run in code page [UTF-8 encoding of Unicode]
Set the following environment variables on the server hosting Informatica nodes:
setenv LANG en_US.utf8
setenv LC_ALL en_US.utf8
setenv INFA_CODEPAGENAME UTF-8
Re-start the node service.
Now, integration service can be stated with codepage set to UTF-8.
Set the following environment variables on the server hosting Informatica nodes:
setenv LANG en_US.utf8
setenv LC_ALL en_US.utf8
setenv INFA_CODEPAGENAME UTF-8
Re-start the node service.
Now, integration service can be stated with codepage set to UTF-8.
Sunday, April 26, 2009
Oracle : Using WITH Clause for improving performance
Many times using inline views destroy the execution plans. This is mainly because the execution plan of inline view interfere with the overall execution plan of the query.
To counter this, inline view can be taken to the top inside WITH clause. But this alone will not help. We need to incorporate hint /*+ materialize */ , as only then database treats the view as a physical table. Database creates a temporary table out of the view which is then used in the query. Execution plan is found far improved than before.
Query with following structure showed nested loop join between tables tab1 and tab2. This mainly was influenced by the inline view. Specifying USE_HASH hint also does not work.
SELECT col1,
col2,
Sum(col4)
FROM tab1,
tab2,
(SELECT DISTINCT Last_day(To_date(dates,'DD-MM-YYYY')) end_dt,
Add_months(Last_day(To_date(dates,'DD-MM-YYYY')) + 1,
-1) strt_dt,
To_char(To_date(dates,'DD-MON-YYYY'),'MMYYYY') mon_dt
FROM (SELECT To_char(Add_months(SYSDATE,-10) + (LEVEL - 1),'DD-MON-YYYY') AS dates
FROM dual
CONNECT BY To_number(To_char((Add_months(SYSDATE,-10) + (LEVEL - 1)),'YYYYMMDD')) <= To_number(To_char(SYSDATE,'YYYYMMDD')))) tim
WHERE tab1.assign_dt <= tim.end_dt
AND tab1.assign_dt >= tim.strt_dt
AND tab1.col3 = tab2.col3
GROUP BY col1,
col2
Changing the query to the following using WITH caluse leads to perfect execution plan using HASH join .
WITH TIM as (
(SELECT /*+ materialize */ DISTINCT Last_day(To_date(dates,'DD-MM-YYYY')) end_dt,
Add_months(Last_day(To_date(dates,'DD-MM-YYYY')) + 1,
-1) strt_dt,
To_char(To_date(dates,'DD-MON-YYYY'),'MMYYYY') mon_dt
FROM (SELECT To_char(Add_months(SYSDATE,-10) + (LEVEL - 1),'DD-MON-YYYY') AS dates
FROM dual
CONNECT BY To_number(To_char((Add_months(SYSDATE,-10) + (LEVEL - 1)),'YYYYMMDD')) <= To_number(To_char(SYSDATE,'YYYYMMDD'))))
)
SELECT col1,
col2,
Sum(col4)
FROM tab1,
tab2,
tim
WHERE tab1.assign_dt <= tim.end_dt
AND tab1.assign_dt >= tim.strt_dt
AND tab1.col3 = tab2.col3
GROUP BY col1,
col2
To counter this, inline view can be taken to the top inside WITH clause. But this alone will not help. We need to incorporate hint /*+ materialize */ , as only then database treats the view as a physical table. Database creates a temporary table out of the view which is then used in the query. Execution plan is found far improved than before.
Query with following structure showed nested loop join between tables tab1 and tab2. This mainly was influenced by the inline view. Specifying USE_HASH hint also does not work.
SELECT col1,
col2,
Sum(col4)
FROM tab1,
tab2,
(SELECT DISTINCT Last_day(To_date(dates,'DD-MM-YYYY')) end_dt,
Add_months(Last_day(To_date(dates,'DD-MM-YYYY')) + 1,
-1) strt_dt,
To_char(To_date(dates,'DD-MON-YYYY'),'MMYYYY') mon_dt
FROM (SELECT To_char(Add_months(SYSDATE,-10) + (LEVEL - 1),'DD-MON-YYYY') AS dates
FROM dual
CONNECT BY To_number(To_char((Add_months(SYSDATE,-10) + (LEVEL - 1)),'YYYYMMDD')) <= To_number(To_char(SYSDATE,'YYYYMMDD')))) tim
WHERE tab1.assign_dt <= tim.end_dt
AND tab1.assign_dt >= tim.strt_dt
AND tab1.col3 = tab2.col3
GROUP BY col1,
col2
Changing the query to the following using WITH caluse leads to perfect execution plan using HASH join .
WITH TIM as (
(SELECT /*+ materialize */ DISTINCT Last_day(To_date(dates,'DD-MM-YYYY')) end_dt,
Add_months(Last_day(To_date(dates,'DD-MM-YYYY')) + 1,
-1) strt_dt,
To_char(To_date(dates,'DD-MON-YYYY'),'MMYYYY') mon_dt
FROM (SELECT To_char(Add_months(SYSDATE,-10) + (LEVEL - 1),'DD-MON-YYYY') AS dates
FROM dual
CONNECT BY To_number(To_char((Add_months(SYSDATE,-10) + (LEVEL - 1)),'YYYYMMDD')) <= To_number(To_char(SYSDATE,'YYYYMMDD'))))
)
SELECT col1,
col2,
Sum(col4)
FROM tab1,
tab2,
tim
WHERE tab1.assign_dt <= tim.end_dt
AND tab1.assign_dt >= tim.strt_dt
AND tab1.col3 = tab2.col3
GROUP BY col1,
col2
Subscribe to:
Posts (Atom)
