#!/bin/ksh
# Check passed parameters
if [ $# -ne 2 ]
then
echo "Please provide parameters"
echo "Parameter 1 - Domain"
echo "Parameter 2 - start or stop"
exit
fi
Monday, December 17, 2012
Wednesday, July 11, 2012
Upgrade - Oracle Database 10.2.0.4 to 11.2.0.3
Oracle Database software uses 2 files (1 and 2) of the 11.2.0.3 patchset.SQL> select name from v$database;
NAME
---------
TEST11G
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 – Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 – Production
NLSRTL Version 10.2.0.4.0 – Production
Wednesday, July 4, 2012
11gR2 Rac install on Centos 6.2 without Oracle ASMLib
Oracle ASMlib is available for linux prior to OL6 or RedHat 6. However, starting from 6, you can only use asmlib for UEK kernel.
On Linux, the built in udev is definitely a better solution to handle persistent device naming and permissions.
Without ASMLib, you don't need to worry about the raw disks everytime when there's a kernel update.
Tuesday, June 19, 2012
What are cvutrace.log.* files
I was looking to clear some space recently and ran across a 21G directory (<grid_infrastructure_home>/cv/log). Inside there were a lot of files like “cvutrace.log.0_20100720015347″. These files are log files related to a RAC installation. They can safely be deleted.
To stop the files from being generated is add the following at the top of the cluvfy script in the <grid_infrastructure_home>/bin directory.
Windows:
set SRVM_TRACE=false
AIX:
export SRVM_TRACE=false
I was looking to clear some space recently and ran across a 21G directory (<grid_infrastructure_home>/cv/log). Inside there were a lot of files like “cvutrace.log.0_20100720015347″. These files are log files related to a RAC installation. They can safely be deleted.
To stop the files from being generated is add the following at the top of the cluvfy script in the <grid_infrastructure_home>/bin directory.
Windows:
set SRVM_TRACE=false
AIX:
export SRVM_TRACE=false
Monday, June 18, 2012
An example of logon trigger
By user and by Module:
CREATE OR REPLACE TRIGGER SET_OPTIMIZER_ONLOGIN AFTER LOGON ON DATABASE
DECLARE
uname VARCHAR2(30);
app VARCHAR2(30);
cmmd VARCHAR2(64);
BEGIN
cmmd:='ALTER SESSION SET optimizer_index_cost_adj=20';
uname:=SYS_CONTEXT('USERENV','SESSION_USER');
app := upper(SYS_CONTEXT('USERENV','MODULE'));
IF uname = '*****' and app like 'SQLPLUS.EXE' then
EXECUTE IMMEDIATE cmmd;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/
By module only:
CREATE OR REPLACE TRIGGER SET_OPTIMIZER_ONLOGIN AFTER LOGON ON DATABASE
DECLARE
app VARCHAR2(30);
cmmd VARCHAR2(64);
BEGIN
cmmd:='ALTER SESSION SET optimizer_index_cost_adj=20';
app := upper(SYS_CONTEXT('USERENV','MODULE'));
IF app like 'RUNBATCH.EXE' then
EXECUTE IMMEDIATE cmmd;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/
By user and by Module:
CREATE OR REPLACE TRIGGER SET_OPTIMIZER_ONLOGIN AFTER LOGON ON DATABASE
DECLARE
uname VARCHAR2(30);
app VARCHAR2(30);
cmmd VARCHAR2(64);
BEGIN
cmmd:='ALTER SESSION SET optimizer_index_cost_adj=20';
uname:=SYS_CONTEXT('USERENV','SESSION_USER');
app := upper(SYS_CONTEXT('USERENV','MODULE'));
IF uname = '*****' and app like 'SQLPLUS.EXE' then
EXECUTE IMMEDIATE cmmd;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/
By module only:
CREATE OR REPLACE TRIGGER SET_OPTIMIZER_ONLOGIN AFTER LOGON ON DATABASE
DECLARE
app VARCHAR2(30);
cmmd VARCHAR2(64);
BEGIN
cmmd:='ALTER SESSION SET optimizer_index_cost_adj=20';
app := upper(SYS_CONTEXT('USERENV','MODULE'));
IF app like 'RUNBATCH.EXE' then
EXECUTE IMMEDIATE cmmd;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/
Wednesday, May 30, 2012
Regular Expression in Ultraedit to replace Non ASCII characters
Find Non ASCII characters:
[~^t^r^n -~]+
Find Non ASCII characters following with space and ASCII characters:
[~^t^r^n -~]+ [-,."^?0-9a-z]
To replace the space with CR/LF:
search ^([~^t^r^n -~]+^) ^([-,."^?0-9a-z]+^)
and replace to ^1^p^2
Here ^1 = ^([~^t^r^n -~]+^)
^2 = ^([-,."^?0-9a-z]+^)
space is going to be replaced by ^p(CR/LF)
Find Non ASCII characters:
[~^t^r^n -~]+
Find Non ASCII characters following with space and ASCII characters:
[~^t^r^n -~]+ [-,."^?0-9a-z]
To replace the space with CR/LF:
search ^([~^t^r^n -~]+^) ^([-,."^?0-9a-z]+^)
and replace to ^1^p^2
Here ^1 = ^([~^t^r^n -~]+^)
^2 = ^([-,."^?0-9a-z]+^)
space is going to be replaced by ^p(CR/LF)
Thursday, May 17, 2012
How to Resume a Failed RMAN Duplicate Due to Missing Backups or ArchiveLogs
It is relatively easy to resume the rman restore and recovery process if it has failed due to missing backups or archivelogs. You most often see the following error messages complaining that something is missing. RMAN-00571: ===========================================================RMAN-03002: failure of Duplicate Db command at 05/24/2010 12:52:44
RMAN-03015: error occurred in stored script Memory Script
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 6253 lowscn 1663211060 found to restore
You may have forgotten to copy them over to the same local disk location and/or failed to restore due to tape issues. After you are sure that you have everything you need in the location RMAN expects them, shutdown the database that is being duplicated (this is assumed that the controlfile has been restored and the database mounted), start it backup in nomount mode and just rerun the same commands.
RMAN automatically (tested using Oracle RDBMS Enterprise Edition 10.2.0.4) runs through the commands and continues the restore and recovery process from where it left off.
For example: There was a gap in the archive logs in the flash recovery area. I have an alternate archive destination that contains the missing log.
After the first duplicate command failed, I used RMAN to catalog the existence of the missing log:
CATALOG ARCHIVELOG '/u01/arc/ORACLE_SID/1_6253_DBID.arc';see MOS Document: How To Catalog Backups / Archivelogs / Datafile Copies / Controlfile Copies [ID 470463.1] Then shutdown, startup nomount the database being duplicated. Reran the exact same duplicate command:
archive log thread 1 sequence 6251 is already on disk as file /backup/flash_recovery_area/ORACLE_SID/archivelog/2010_05_22/o1_mf_1_6251_5zk173bs_.arc
archive log thread 1 sequence 6252 is already on disk as file /backup/flash_recovery_area/ORACLE_SID/archivelog/2010_05_22/o1_mf_1_6252_5zkhfw99_.arc
archive log thread 1 sequence 6253 is already on disk as file /u01/arc/ORACLE_SID/1_6253_DBID.arc
archive log thread 1 sequence 6254 is already on disk as file /backup/flash_recovery_area/ORACLE_SID/archivelog/2010_05_23/o1_mf_1_6254_5zl68htc_.arc
As you can see from the above output…that it applies the archive logs
including the single cataloged piece in the alternate location. This
may save someone else time and trouble when they have the same issue.Monday, May 7, 2012
TDPO for TSM setup on AIX
1. make sure oracle id has full access to tsm installation folder and files.
2. vi /usr/tivoli/tsm/client/ba/bin64/dsm.sys:
SErvername your TSM server name, for example, TSM_ORA
COMMmethod TCPIP
TCPPort 1500
TcpServerAddress tsm server IP
NODENAME client_node registered on your TSM server(for example, client_ora)
3. vi /usr/tivoli/tsm/client/ba/bin64/dsm.opt:
SErvername your TSM server name, for example, TSM_ORA
4. su - oracle
5. ln -s /usr/lib/libobk64.a $ORACLE_HOME/lib/libobk.a
6. vi /usr/tivoli/tsm/client/oracle/bin64/tdpo.opt:
DSMI_ORC_CONFIG (location of dsm.opt, for example, /usr/tivoli/tsm/client/oracle/bin64/dsm.opt)
DSMI_DIR (location for dsm.sys,for example, /usr/tivoli/tsm/client/oracle/bin64)
TDPO_FS (Space name for backup on TSM, for example, adsmorc)
TDPO_NODE (Nodename for client, usually the servername of client)
TDPO_OWNER (TDPO owner, for example, oracle)
TDPO_PSWDPATH (tdpoconf password file location)
DSMI_LOG (Log file location, for example, /home/oracle)
7. tdpoconf password -tdpo_optfile=<full path of tdpo.opt file>
It will create a password file TDPO.nodename
You should get the password from the TSM admin
8. ln -s /usr/tivoli/tsm/client/lang/EN_US /usr/tivoli/tsm/client/oracle/bin64/EN_US
9. make sure user oracle has full access to all files under /usr/tivoli/tsm/client/oracle/bin64
10. test: $ORACLE_HOME/bin/sbttest test
if you see:
The sbt function pointers are loaded from libobk.a(shr.o) library.
-- sbtinit succeeded
Means the tdpo for oracle are configured successfully.
1. make sure oracle id has full access to tsm installation folder and files.
2. vi /usr/tivoli/tsm/client/ba/bin64/dsm.sys:
SErvername your TSM server name, for example, TSM_ORA
COMMmethod TCPIP
TCPPort 1500
TcpServerAddress tsm server IP
NODENAME client_node registered on your TSM server(for example, client_ora)
3. vi /usr/tivoli/tsm/client/ba/bin64/dsm.opt:
SErvername your TSM server name, for example, TSM_ORA
4. su - oracle
5. ln -s /usr/lib/libobk64.a $ORACLE_HOME/lib/libobk.a
6. vi /usr/tivoli/tsm/client/oracle/bin64/tdpo.opt:
DSMI_ORC_CONFIG (location of dsm.opt, for example, /usr/tivoli/tsm/client/oracle/bin64/dsm.opt)
DSMI_DIR (location for dsm.sys,for example, /usr/tivoli/tsm/client/oracle/bin64)
TDPO_FS (Space name for backup on TSM, for example, adsmorc)
TDPO_NODE (Nodename for client, usually the servername of client)
TDPO_OWNER (TDPO owner, for example, oracle)
TDPO_PSWDPATH (tdpoconf password file location)
DSMI_LOG (Log file location, for example, /home/oracle)
7. tdpoconf password -tdpo_optfile=<full path of tdpo.opt file>
It will create a password file TDPO.nodename
You should get the password from the TSM admin
8. ln -s /usr/tivoli/tsm/client/lang/EN_US /usr/tivoli/tsm/client/oracle/bin64/EN_US
9. make sure user oracle has full access to all files under /usr/tivoli/tsm/client/oracle/bin64
10. test: $ORACLE_HOME/bin/sbttest test
if you see:
The sbt function pointers are loaded from libobk.a(shr.o) library.
-- sbtinit succeeded
Means the tdpo for oracle are configured successfully.
Wednesday, May 2, 2012
ORA-20005: object statistics are locked (stattype = ALL) after database clone
After database clone or datapump import, you may get the error: "ORA-20005: object statistics are locked (stattype = ALL)":
SQL> exec dbms_stats.gather_table_stats(ownname=>'cisadm',tabname=>'c0_installation',ESTIMATE_PERCENT => 30);
BEGIN dbms_stats.gather_table_stats(ownname=>'cisadm',tabname=>'c0_installation',ESTIMATE_PERCENT => 30); END;
*
ERROR at line 1:
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at "SYS.DBMS_STATS", line 13437
ORA-06512: at "SYS.DBMS_STATS", line 13457
ORA-06512: at line 1
After database clone or datapump import, you may get the error: "ORA-20005: object statistics are locked (stattype = ALL)":
SQL> exec dbms_stats.gather_table_stats(ownname=>'cisadm',tabname=>'c0_installation',ESTIMATE_PERCENT => 30);
BEGIN dbms_stats.gather_table_stats(ownname=>'cisadm',tabname=>'c0_installation',ESTIMATE_PERCENT => 30); END;
*
ERROR at line 1:
ORA-20005: object statistics are locked (stattype = ALL)
ORA-06512: at "SYS.DBMS_STATS", line 13437
ORA-06512: at "SYS.DBMS_STATS", line 13457
ORA-06512: at line 1
Tuesday, May 1, 2012
Check the value of ESTIMATE_PERCENT:
The default value of estimate is AUTO_SAMPLE_SIZE.
10g
SQL> select
DBMS_STATS.GET_PARAM ('AUTOSTATS_TARGET'),
DBMS_STATS.GET_PARAM ('CASCADE'),
DBMS_STATS.GET_PARAM ('DEGREE'),
DBMS_STATS.GET_PARAM ('ESTIMATE_PERCENT'),
DBMS_STATS.GET_PARAM ('METHOD_OPT'),
DBMS_STATS.GET_PARAM ('NO_INVALIDATE'),
DBMS_STATS.GET_PARAM ('GRANULARITY')
from dual;
11g
SQL> select
DBMS_STATS.GET_PREFS ('AUTOSTATS_TARGET'),
DBMS_STATS.GET_PREFS ('CASCADE'),
DBMS_STATS.GET_PREFS ('DEGREE'),
DBMS_STATS.GET_PREFS ('ESTIMATE_PERCENT'),
DBMS_STATS.GET_PREFS ('METHOD_OPT'),
DBMS_STATS.GET_PREFS ('NO_INVALIDATE'),
DBMS_STATS.GET_PREFS ('GRANULARITY'),
DBMS_STATS.GET_PREFS ('PUBLISH'),
DBMS_STATS.GET_PREFS ('INCREMENTAL'),
DBMS_STATS.GET_PREFS ('STALE_PERCENT')
from dual;
The default value of estimate is AUTO_SAMPLE_SIZE.
10g
SQL> select
DBMS_STATS.GET_PARAM ('AUTOSTATS_TARGET'),
DBMS_STATS.GET_PARAM ('CASCADE'),
DBMS_STATS.GET_PARAM ('DEGREE'),
DBMS_STATS.GET_PARAM ('ESTIMATE_PERCENT'),
DBMS_STATS.GET_PARAM ('METHOD_OPT'),
DBMS_STATS.GET_PARAM ('NO_INVALIDATE'),
DBMS_STATS.GET_PARAM ('GRANULARITY')
from dual;
11g
SQL> select
DBMS_STATS.GET_PREFS ('AUTOSTATS_TARGET'),
DBMS_STATS.GET_PREFS ('CASCADE'),
DBMS_STATS.GET_PREFS ('DEGREE'),
DBMS_STATS.GET_PREFS ('ESTIMATE_PERCENT'),
DBMS_STATS.GET_PREFS ('METHOD_OPT'),
DBMS_STATS.GET_PREFS ('NO_INVALIDATE'),
DBMS_STATS.GET_PREFS ('GRANULARITY'),
DBMS_STATS.GET_PREFS ('PUBLISH'),
DBMS_STATS.GET_PREFS ('INCREMENTAL'),
DBMS_STATS.GET_PREFS ('STALE_PERCENT')
from dual;
GATHER_STATS_JOB
To check the job status in 10g:
select * from dba_scheduler_jobs where job_name = 'GATHER_STATS_JOB';
select * from dba_scheduler_job_run_details where job_name = 'GATHER_STATS_JOB';
select * from dba_scheduler_job_log where job_name = 'GATHER_STATS_JOB';
To Check the scheduler for this job:
EXEC DBMS_SCHEDULER.ENABLE ('GATHER_STATS_JOB');
if the window is not enabled:
EXEC DBMS_SCHEDULER.ENABLE ('SYS.WINDOWNAME');
You can also create the job on different user and execute it:
BEGIN
dbms_scheduler.create_Job (job_name=>'Gather_Stats_Job',
job_type=>'PLSQL_BLOCK',
job_action=>'BEGIN Dbms_Stats.gather_database_stats(cascade=>true); end;',
start_date => sysdate,
repeat_interval => 'freq=daily',
enabled=>true);
end;
/
BEGIN
DBMS_SCHEDULER.RUN_JOB(
job_name => 'GATHER_STATS_JOB'
);
END;
/
To disable gather_stats_job in 10g:
To check the job status in 10g:
select * from dba_scheduler_jobs where job_name = 'GATHER_STATS_JOB';
select * from dba_scheduler_job_run_details where job_name = 'GATHER_STATS_JOB';
select * from dba_scheduler_job_log where job_name = 'GATHER_STATS_JOB';
To Check the scheduler for this job:
select OWNER,JOB_NAME,STATE,SCHEDULE_NAME from dba_scheduler_jobs where job_name='GATHER_STATS_JOB';
SELECT * FROM DBA_SCHEDULER_WINGROUP_MEMBERS;If the state is not "Scheduled":
EXEC DBMS_SCHEDULER.ENABLE ('GATHER_STATS_JOB');
if the window is not enabled:
EXEC DBMS_SCHEDULER.ENABLE ('SYS.WINDOWNAME');
You can also create the job on different user and execute it:
BEGIN
dbms_scheduler.create_Job (job_name=>'Gather_Stats_Job',
job_type=>'PLSQL_BLOCK',
job_action=>'BEGIN Dbms_Stats.gather_database_stats(cascade=>true); end;',
start_date => sysdate,
repeat_interval => 'freq=daily',
enabled=>true);
end;
/
BEGIN
DBMS_SCHEDULER.RUN_JOB(
job_name => 'GATHER_STATS_JOB'
);
END;
/
To disable gather_stats_job in 10g:
BEGIN
DBMS_SCHEDULER.DISABLE('GATHER_STATS_JOB');
END;
/
To drop the job, login as creator and run:EXEC DBMS_SCHEDULER.DROP_JOB (JOB_NAME=>'GATHER_STATS_JOB', force => true);
Friday, April 27, 2012
oradebug
In Oracle database version 9i there is no way to determine the IP address through a database view. The only way to determine this IP address is with the oradebug command (Please keep in mind oradebug is not a supported product from Oracle, so if there are problems/crashes you are on your own). The oradebug ipc command creates a trace file. The example shows the process:
SQL> oradebug setmypid
SQL> oradebug ipc
SQL> oradebug tracefile_name
The last command will show the name of the created trace file. The next step is opening the trace file and looking for the string SKGXPCTX. The following is a typical example.
SKGXPCTX: 0xcd1e730 ctx
admno 0x7a0be402 admport:
SSKGXPT 0xcd1e884 flags SSKGXPT_READPENDING info for network 0
socket no 8 IP 140.87.79.67 UDP 9152
sflags SSKGXPT_WRITESSKGXPT_UP
info for network 1
The cluster interconnect IP address is shown in bold. In the example above
it is 140.87.79.67.
In Oracle database version 9i there is no way to determine the IP address through a database view. The only way to determine this IP address is with the oradebug command (Please keep in mind oradebug is not a supported product from Oracle, so if there are problems/crashes you are on your own). The oradebug ipc command creates a trace file. The example shows the process:
SQL> oradebug setmypid
SQL> oradebug ipc
SQL> oradebug tracefile_name
The last command will show the name of the created trace file. The next step is opening the trace file and looking for the string SKGXPCTX. The following is a typical example.
SKGXPCTX: 0xcd1e730 ctx
admno 0x7a0be402 admport:
SSKGXPT 0xcd1e884 flags SSKGXPT_READPENDING info for network 0
socket no 8 IP 140.87.79.67 UDP 9152
sflags SSKGXPT_WRITESSKGXPT_UP
info for network 1
The cluster interconnect IP address is shown in bold. In the example above
it is 140.87.79.67.
Modify the attribute AUTO_START to “always”
With Oracle 11.2 database auto start
policy in the clusterware is restore, which means that clusterware will
remember the last state of the database. If the database was stopped
normally then on the next restart of clusterware it won’t be started. Otherwise
if the server crashes or by some reason the OS is rebooted then clusterware
will start the database because last state was ONLINE (running).
Monday, April 23, 2012
hibernate.jdbc.fetch_size and hibernate.jdbc.batch_size
Two important settings for hibernate java application, affecting hibernate CRUD performance.
C = create, R = read, U = update, D = delete
Fetch Size determines when JDBC Statement read data, how many records are going to be read per fetch.
Recommend setting for Oralce JDBC application:
hibernate.jdbc.fetch_size 100
hibernate.jdbc.batch_size 25
Two important settings for hibernate java application, affecting hibernate CRUD performance.
C = create, R = read, U = update, D = delete
Fetch Size determines when JDBC Statement read data, how many records are going to be read per fetch.
Recommend setting for Oralce JDBC application:
hibernate.jdbc.fetch_size 100
hibernate.jdbc.batch_size 25
Friday, April 20, 2012
Disable Microsoft Office Upload Center
For starters, if you don't want it, don't run Microsoft SharePoint Workspace 2010 (what used to be called Groove). Workspace also loads the Upload Center, even if you simply start it, then cancel before doing anything. It also sets some values in the Windows registry that cause Upload Center to load again every time you restart Windows.
For starters, if you don't want it, don't run Microsoft SharePoint Workspace 2010 (what used to be called Groove). Workspace also loads the Upload Center, even if you simply start it, then cancel before doing anything. It also sets some values in the Windows registry that cause Upload Center to load again every time you restart Windows.
Thursday, April 19, 2012
Windows DBConsole internal stop. No OC4J admin passwd hence
hard stop
Enterprise manager cannot be started. The status shows
dbconsole is already started:
C:\>emctl status dbconsole
Oracle
Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright
(c) 1996, 2010 Oracle Corporation. All
rights reserved.
https://JDEORA01:5500/em/console/aboutApplication
Oracle
Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs
are generated in directory
C:\APP\ORACLE\product\11.2.0\se1/jdeora01_e1prod/sysman/log
Install EM grid 11.1.0.1.0 on Linux
- Software
Downloads the following software:
opatch - Latest version (26M)
(There’s a known issue with installing Enterprise Grid Control on Weblogic 10.3.3)
Tuesday, April 17, 2012
Toad hangs when retrieving User Script
When using the Schema Browser, user selects select a User and the User Script tab. Toad hangs (or taking a long time) on a 10g db. When user uses 9.2.0.5 database, User script works as it should.
Does not appear to matter which user is selected . Toad does not return script and it hangs. Changing the Optimize hint does not address issue.
Also, right-clicking a user then clicking Create Script does not work no matter to File, to Screen, or to Clipboard.
When using the Schema Browser, user selects select a User and the User Script tab. Toad hangs (or taking a long time) on a 10g db. When user uses 9.2.0.5 database, User script works as it should.
Does not appear to matter which user is selected . Toad does not return script and it hangs. Changing the Optimize hint does not address issue.
Also, right-clicking a user then clicking Create Script does not work no matter to File, to Screen, or to Clipboard.
Cannot connect to database from OBIEE 2.4 BI Admin Tool
If
you have connection issue, modify bi_init.bat under BI install folder\oraclebi\orahome\bifoundation\server\bin, replace all ORACLE_HOME to
OBIEE_HOME, and add new ORACLE_HOME for the actual oracle installation path:
@echo off
set OBIEE_HOME=C:\Program Files\Oracle Business Intelligence Enterprise Edition Plus Client\oraclebi\orahome
set ORACLE_HOME=D:\oracle\product\11.2.0.3\owb
set ORACLE_INSTANCE=C:\Program Files\Oracle Business Intelligence Enterprise Edition Plus Client\oraclebi\orainst
set ORACLE_BI_APPLICATION=coreapplication
rem call %ORACLE_INSTANCE%\bifoundation\OracleBIApplication\%ORACLE_BI_APPLICATION%\setup\user.cmd
if NOT "%1" == "" set COMPONENT_NAME=%1
set PATH=%OBIEE_HOME%\bifoundation\server\bin;%OBIEE_HOME%\bifoundation\web\bin;%OBIEE_HOME%\bin;C:\Program Files\Oracle Business Intelligence Enterprise Edition Plus Client\jre\bin;%ORACLE_HOME\bin%;%windir%;%windir%\system32;%PATH%
if NOT "%2" == "" %2
set OBIEE_HOME=C:\Program Files\Oracle Business Intelligence Enterprise Edition Plus Client\oraclebi\orahome
set ORACLE_HOME=D:\oracle\product\11.2.0.3\owb
set ORACLE_INSTANCE=C:\Program Files\Oracle Business Intelligence Enterprise Edition Plus Client\oraclebi\orainst
set ORACLE_BI_APPLICATION=coreapplication
rem call %ORACLE_INSTANCE%\bifoundation\OracleBIApplication\%ORACLE_BI_APPLICATION%\setup\user.cmd
if NOT "%1" == "" set COMPONENT_NAME=%1
set PATH=%OBIEE_HOME%\bifoundation\server\bin;%OBIEE_HOME%\bifoundation\web\bin;%OBIEE_HOME%\bin;C:\Program Files\Oracle Business Intelligence Enterprise Edition Plus Client\jre\bin;%ORACLE_HOME\bin%;%windir%;%windir%\system32;%PATH%
if NOT "%2" == "" %2
Oracle Workflow ORA-24247
If you see the following errors:
ORA-24247:Network access denied by access control list(ACL) ORA-06512 at......
ORA-29532 when starting OWB Service
Run $ORACLE_HOME/owb/rtp/sql/start_service.sql with OWBSYS user.
If you have the following error:
Not Available
Diagnostics:
service startup failure using command "$ORACLE_HOME/owb/b
in/unix/run_service.sh -manual 1 $ORACLE_HOME OWBSYS 10.8
4.80.186:1521:bidev" reason ORA-29532: Java call terminated by uncaught Java ex
ception: java.io.IOException: service early exit: code=1 : err=JVMJ9VM015W Init
ialization error for library j9gc23(2): Failed to instantiate heap; 768M reques
ted
Could not create the Java virtual machine.
: out=
please invoke [owbhome]/owb/rtp/sql/service_doctor.sql for more information
PL/SQL procedure successfully completed.
[nQSError: 46029] for OBIEE 2.3.2
If OBIEE is unabled to be started because of Error: [nQSError:
46029] Failed to load the DLL $BIHOME/server/Bin64/libnqsdbgatewayoci10g64.so. Check if 'Oracle
OCI 10G' database client is installed.
- Make sure export LD_LIBRARY_PATH=$ORACLE_HOME/lib/ and export SHLIB_PATH=$ORACLE_HOME/lib is in the profile.
- Also make changes in $BIHOME/setup/user.sh:
ORACLE_HOME=/orasw/app/oracle/product/11.2.0.3
export ORACLE_HOME
TNS_ADMIN=/orasw/app/oracle/product/11.2.0.3/network/admin
export TNS_ADMIN
PATH=$ORACLE_HOME/bin:/opt/bin:$PATH
export PATH
LIBPATH=$ORACLE_HOME/lib:$LIBPATH:/opt/j2se/jre/lib/sparc
export LIBPATH
export ORACLE_HOME
TNS_ADMIN=/orasw/app/oracle/product/11.2.0.3/network/admin
export TNS_ADMIN
PATH=$ORACLE_HOME/bin:/opt/bin:$PATH
export PATH
LIBPATH=$ORACLE_HOME/lib:$LIBPATH:/opt/j2se/jre/lib/sparc
export LIBPATH
OBIEE Catalog Manager Cannot be launched
When getting Java error from OBIEE Catalog Manager lauching:
When getting Java error from OBIEE Catalog Manager lauching:
Modify C:\OracleBI\web\catalogmanager\catalogmanager.ini:
-Xmx1440M
Change to-Xmx512M
Change to-Xmx512M
Purging Cache via OBIEE analytics
page
- Log into OBIEE using an Admin account (as weblogic)
- a) Go to Administration Page –
- Select “Issue SQL” under “Maintenance and Trouble Shooting”
gather_system_stats
SQL> exec dbms_stats.gather_system_stats (gathering_mode => 'noworkload');
PL/SQL procedure successfully completed.
SQL> select sname, pname, pval1 from sys.aux_stats$;
SQL> exec dbms_stats.gather_system_stats (gathering_mode => 'noworkload');
PL/SQL procedure successfully completed.
SQL> select sname, pname, pval1 from sys.aux_stats$;
Resize undo table space
1. define a new temporary undo tablespace
CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE '/ccbprod/oradata/ccbprod/UNDOTBS2.dbf' SIZE 100M
AUTOEXTEND ON NEXT 10240K MAXSIZE 32767M ;
1. define a new temporary undo tablespace
CREATE UNDO TABLESPACE "UNDOTBS2" DATAFILE '/ccbprod/oradata/ccbprod/UNDOTBS2.dbf' SIZE 100M
AUTOEXTEND ON NEXT 10240K MAXSIZE 32767M ;
Monday, April 16, 2012
Convert UNIX to DOS format using sed command
Type the following command if you are using bash shell:
$ sed 's/$'"/`echo \\\r`/" input.txt > output.txt
Convert DOS newlines (CR/LF) to Unix format using sed command
If you are using BASH shell type the following command (press Ctrl-V then Ctrl-M to get pattern or special symbol)
$ sed 's/^M$//' input.txt > output.txt
Type the following command if you are using bash shell:
$ sed 's/$'"/`echo \\\r`/" input.txt > output.txt
Convert DOS newlines (CR/LF) to Unix format using sed command
If you are using BASH shell type the following command (press Ctrl-V then Ctrl-M to get pattern or special symbol)
$ sed 's/^M$//' input.txt > output.txt
NCARGS value configuration for AIX 5.1
NCARGS
value configuration (5.1.0)
In AIX 5L Version 5.1, the option has been added to allow the super user or
any user belonging to the system group to dynamically change the value of
the NCARGS parameters. In previous releases of AIX, these values were
permanently defined as 24576, which resulted in a problem similar to that
shown below when a large number of arguments are parsed to a command:
# rm FILE*
ksh: /usr/bin/rm: 0403-027 The parameter list is too long.
In AIX 5L Version 5.1, the option has been added to allow the super user or
any user belonging to the system group to dynamically change the value of
the NCARGS parameters. In previous releases of AIX, these values were
permanently defined as 24576, which resulted in a problem similar to that
shown below when a large number of arguments are parsed to a command:
# rm FILE*
ksh: /usr/bin/rm: 0403-027 The parameter list is too long.
The
value of NCARGS can be increased to overcome this problem. The value
can be tuned anywhere within the range of 24576 to 524288 in 4 KB page
size increments. To display the value, use the following command.
can be tuned anywhere within the range of 24576 to 524288 in 4 KB page
size increments. To display the value, use the following command.
Typical production init file (10g)
#####################################################################
# Common parms
#####################################################################
ifile = ?/dbs/orabase-dg.ora
#####################################################################
# Structural Parms
#####################################################################
db_domain = psoug
db_block_size = 8192
db_writer_processes = 8
#####################################################################
# Common parms
#####################################################################
ifile = ?/dbs/orabase-dg.ora
#####################################################################
# Structural Parms
#####################################################################
db_domain = psoug
db_block_size = 8192
db_writer_processes = 8
Thread 1 cannot allocate new log
Sometimes, you can see in your alert.log file, the following corresponding
messages:
Thread 1 advanced to log sequence 248
Current log# 2 seq# 248 mem# 0: /prod1/oradata/logs/redologs02.log
Thread 1 cannot allocate new log, sequence 249
Checkpoint not complete
Sometimes, you can see in your alert.log file, the following corresponding
messages:
Thread 1 advanced to log sequence 248
Current log# 2 seq# 248 mem# 0: /prod1/oradata/logs/redologs02.log
Thread 1 cannot allocate new log, sequence 249
Checkpoint not complete
Resize Redo log
If the redo logs need to be resized, the following steps can be taken.
1. Create new log group members with the following command:
ALTER DATABASE ADD LOGFILE
GROUP 4 ( '/ccbprod/oradata/ccbprod/REDO04A.LOG',
'/ccbprod/oradata/ccbprod/REDO04B.LOG') SIZE 1280M reuse,
GROUP 5 ( '/ccbprod/oradata/ccbprod/REDO05A.LOG',
'/ccbprod/oradata/ccbprod/REDO05B.LOG') SIZE 1280M reuse,
GROUP 6 ( '/ccbprod/oradata/ccbprod/REDO06A.LOG',
'/ccbprod/oradata/ccbprod/REDO06B.LOG') SIZE 1280M reuse;
If the redo logs need to be resized, the following steps can be taken.
1. Create new log group members with the following command:
ALTER DATABASE ADD LOGFILE
GROUP 4 ( '/ccbprod/oradata/ccbprod/REDO04A.LOG',
'/ccbprod/oradata/ccbprod/REDO04B.LOG') SIZE 1280M reuse,
GROUP 5 ( '/ccbprod/oradata/ccbprod/REDO05A.LOG',
'/ccbprod/oradata/ccbprod/REDO05B.LOG') SIZE 1280M reuse,
GROUP 6 ( '/ccbprod/oradata/ccbprod/REDO06A.LOG',
'/ccbprod/oradata/ccbprod/REDO06B.LOG') SIZE 1280M reuse;
Resize Redo log for RAC
In RAC, you have seperate log groups for each instance (called threads). You can see which group belongs to which thread by querying v$log. When you add new loggroups, you specify which thread it should belong to. The syntax is
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 5 ('firstlocation','secondlocation') SIZE 1280M;
In RAC, you have seperate log groups for each instance (called threads). You can see which group belongs to which thread by querying v$log. When you add new loggroups, you specify which thread it should belong to. The syntax is
ALTER DATABASE ADD LOGFILE THREAD 1 GROUP 5 ('firstlocation','secondlocation') SIZE 1280M;
Enable/Disable Archive logs in a RAC environment
on node 1:
set oracle_sid=racdb1
-------------Noarchivelog
sqlplus / as sysdba
alter system set cluster_database=false scope=spfile sid='racdb2';
quit
on node 1:
set oracle_sid=racdb1
-------------Noarchivelog
sqlplus / as sysdba
alter system set cluster_database=false scope=spfile sid='racdb2';
quit
Configure rsh for CentOS
1. check if rsh-server is installed:
[root@rac1 ~]# rpm -qa|grep -i ^rsh-server
2. make sure no disable = no in /etc/xinetd.d/rlogin :
1. check if rsh-server is installed:
[root@rac1 ~]# rpm -qa|grep -i ^rsh-server
2. make sure no disable = no in /etc/xinetd.d/rlogin :
1. [root@rac1 ~]# cat /etc/xinetd.d/rlogin
2. # default: on
3. # description: rlogind is the server for the rlogin(1) program. The server
4. # provides a remote login facility with authentication based on
5. # privileged port numbers from trusted hosts.
6. service login
7. {disable = no
8. socket_type = stream
9. wait = no
10. user = root
11. log_on_success += USERID
12. log_on_failure += USERID
13. server = /usr/sbin/in.rlogind}
Configure for oracle Single Instance install with ASM on centos
Create VM:
Create VM:
Oracle Checkpoint
A checkpoint performs the following three operations:
Every dirty block in the buffer cache is written to the data files. That is, it synchronizes the datablocks in the buffer cache with the datafiles on disk.
It's the DBWR that writes all modified databaseblocks back to the datafiles.
A checkpoint performs the following three operations:
Every dirty block in the buffer cache is written to the data files. That is, it synchronizes the datablocks in the buffer cache with the datafiles on disk.
It's the DBWR that writes all modified databaseblocks back to the datafiles.
To change DBIO_EXPECTED for EM
SELECT parameter_value,is_default FROM dba_advisor_def_parameters WHERE advisor_name = 'ADDM' AND parameter_name ='DBIO_EXPECTED';
EXECUTE DBMS_ADVISOR.SET_DEFAULT_TASK_PARAMETER('ADDM', 'DBIO_EXPECTED', 20000);
select * from aux_stats$;
EXECUTE IMMEDIATE option for Dynamic SQL
and PL/SQL
EXECUTE
IMMEDIATE is the replacement for DBMS_SQL package from Oracle 8i onwards. It
parses and immediately executes a dynamic SQL statement or a PL/SQL block
created on the fly. Dynamically created and executed SQL statements are
performance overhead, EXECUTE IMMEDIATE aims at reducing the overhead and give
better performance. It is also easier to code as compared to earlier means. The
error messages generated when using this feature are more user friendly. Though
DBMS_SQL is still available, it is advisable to use EXECUTE IMMEDIATE calls
because of its benefits over the package.
Tuesday, March 13, 2012
To re-create "enq: RO – fast object reuse" problem
create 3 sessions.
Session 1:
SQL> select count(*) from mchbas;
COUNT(*)
----------
5943314
Session 1:
SQL> select count(*) from mchbas;
COUNT(*)
----------
5943314
Friday, March 9, 2012
CREATING A PHYSICAL STANDBY ON ASM 11gR2
Task 1: Gather Files and Perform Back Up
1. On the primary node, create a staging directory. For example: [testasm] /home/oracle >mkdir -p /u02/stage
2. Create the same exact path on one of the standby hosts: [testdb] /home/oracle >mkdir -p /u02/stage
3. On the primary node, connect to the primary database and create a PFILE from the
SPFILE in the staging directory. For example: SQL> create pfile='/u02/stage/inittestasm.ora' from spfile;
File created.
SQL>
1. On the primary node, create a staging directory. For example: [testasm] /home/oracle >mkdir -p /u02/stage
2. Create the same exact path on one of the standby hosts: [testdb] /home/oracle >mkdir -p /u02/stage
3. On the primary node, connect to the primary database and create a PFILE from the
SPFILE in the staging directory. For example: SQL> create pfile='/u02/stage/inittestasm.ora' from spfile;
File created.
SQL>
Oracle 11gR2 RAC on Windows 2008 using VMWARE
Oracle 11gR2 RAC on Windows 2008 R2 using VMWARE
Network Configuration
Name the network connection as “public” and “private”
Amend the C:\windows\system32\drivers\etc\hosts file to contain the following information.
127.0.0.1 localhost.localdomain localhost
# Public
192.168.96.3 rac1.localdomain rac1
192.168.96.4 rac2.localdomain rac2
#Private
192.168.40.2 rac1-priv.localdomain rac1-priv
192.168.40.3 rac2-priv.localdomain rac2-priv
#Virtual
192.168.96.111 rac1-vip.localdomain rac1-vip
192.168.96.112 rac2-vip.localdomain rac2-vip
# SCAN
192.168.96.201 rac-scan.localdomain rac-scan
Addition changes:First, ensure the public interface is first in the bind order:
Network Configuration
Name the network connection as “public” and “private”
Amend the C:\windows\system32\drivers\etc\hosts file to contain the following information.
127.0.0.1 localhost.localdomain localhost
# Public
192.168.96.3 rac1.localdomain rac1
192.168.96.4 rac2.localdomain rac2
#Private
192.168.40.2 rac1-priv.localdomain rac1-priv
192.168.40.3 rac2-priv.localdomain rac2-priv
#Virtual
192.168.96.111 rac1-vip.localdomain rac1-vip
192.168.96.112 rac2-vip.localdomain rac2-vip
# SCAN
192.168.96.201 rac-scan.localdomain rac-scan
Addition changes:First, ensure the public interface is first in the bind order:
Start and stop owb service
1. Stop:
local_service_login.sh -closedown $OWB_ORACLE_HOME
(Case sensitive)
How to find Cluster name on RAC instance
Soemtimes you need to check your cluster name on your RAC instance. Here is the steps:
Move index or table to another tablespace
A) Tip :- How to move index from one tablespace to another ?
B) Tip :- How to move Table from one tablespace to another ?
B) Tip :- How to move Table from one tablespace to another ?
Adding and removing disks in ASM
Adding and removing disks in ASM
A first for me. I had seen asm in the past but never had hands on experience with it. A client needed some disks moved from 1 diskgroup to the other and so started my journey into ASM. :)
A first for me. I had seen asm in the past but never had hands on experience with it. A client needed some disks moved from 1 diskgroup to the other and so started my journey into ASM. :)
Subscribe to:
Posts (Atom)