Tuesday, October 23, 2018

ORA-02096: specified initialization parameter is not modifiable with this option

Since version 11g must use the DEFERRED clause. It means it takes effect in subsequent sessions.

You must exit from current session to get the new settings

Wednesday, April 11, 2018

SQL Profile

When you run SQL Tuning Advisor, sometimes you can see findings for SQL Profile:
1- SQL Profile Finding (see explain plans section below)
--------------------------------------------------------
  A potentially better execution plan was found for this statement.


  Recommendation (estimated benefit: 99.99%)
  ------------------------------------------
  - Consider accepting the recommended SQL profile.
    execute dbms_sqltune.accept_sql_profile(task_name => 'staName61543', task_owner => 'PWRLINE', replace => TRUE);

Tuesday, April 10, 2018

12c Query Against Dictionary Views slow

Doc ID 1292253.1

SQL> purge recyclebin; --if you have DBA access, purge dba_recyclebin;
SQL> EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME =>'SYS', TABNAME => '$KTFBUE',ESTIMATE_PERCENT=>100);
SQL> EXEC DBMS_STATS.GATHER_SCHEMA_STATS('SYS');
SQL> EXEC DBMS_STATS.GATHER_FIXED_OBJECTS_STATS(NO_INVALIDATE => FALSE);

Wednesday, January 25, 2017

Rman Duplicate database from Active database



From 11g above, you can use rman to duplicate database from an active database instead of from a backup.
Two big disadvantages of the ACTIVE database duplication method are:
·         Negative performance impact on the source database. This impact applies to the whole duplication time.
·         High network traffic on the connection between the source and target databases.
Test envorinment:
Source
     SID: testprd
     host:192.168.96.3
Target
     SID: testrman
      host: 192.168.96.4

Monday, December 5, 2016

Oracle 10/11 install on Centos 7

For 10.2.0.1:

If you get error
“Error in invoking target 'collector' of makefile '/orasw/app/oracle/product/10.2.0/sysman/lib/ins_emdb.mk'” at 83% can be ignored (Metalink 957982.1)

For 11.2.0.4:


If you get the following error:

PRVF-7532 : Package "pdksh" is missing on node "Hostname"
You can install ksh package (yum install ksh)then safely ignore it and  continue.


When getting error “Error in invoking target 'agent nmhs' of makefile '/orasw/app/oracle/product/11.2.0/sysman/lib/ins_emagent.mk'.”
vi $ORACLE_HOME/sysman/lib/ins_emagent.mk
Search for the line
$(MK_EMAGENT_NMECTL)
Change it to:
$(MK_EMAGENT_NMECTL) -lnnz11
And retry.



RAC: ORA-01410: invalid ROWID

Can try flushing the cache:
alter system flush buffer_cache;

Thursday, August 25, 2016

ORA-03114 and ORA-03137

Oracle Version: 11.2.0.1
Client sessions disconnected due to error "ORA-03114: Not Connected to Oracle".
In Alert log ORA-03137 is detected: "ORA-03137: TTC protocol internal error : [12333] [8] [57] [48] [] [] [] [] ".

Friday, October 9, 2015

optimizer_index_cost_adj hint

Sometimes you want to use alter session set optimizer_index_cost_adj=<value> to change the parameter, but you can also use hint for the purpose, for example:
select /*+ opt_param('optimizer_index_cost_adj',20) */ col1, col2 . .
  
And optimizer_mode hint:
select /*+ opt_param('optimizer_mode','first_rows_10') */ col1, col2 . . .  

Monday, September 28, 2015

Session hang because 'gc cr request' and 'cr request retry'

In 11g Rac, during datapump import, session hangs at step of importing indexes or constraints.

If you check v$session_wait for the sid, you may notice  'gc cr request' and 'cr request retry':



SQL> select event from v$session_wait where sid=405;

EVENT
----------------------------------------------------------------
gc cr request

SQL> select event from v$session_wait where sid=405;

EVENT
----------------------------------------------------------------
cr request retry


Mostly it's caused by Redo log IO performance or the interconnect performance.

You can try:
1) Improve the interconnect performance.
2) Improve the Redo log I/o performance.
3) Set undersore parameter "_cr_server_log_flush" =false.

Monday, June 15, 2015

SqlDeveloper 4.0 or later freezes

Starting from version 4.0, you may notice SqlDeveloper "freezes" quite regularly; it simply does nothing and does not accept keyboard input or mouse clicks. It remains in that state for 20 or 30 seconds, then continues to work normally. No error message or log entry.

It seems to be a java bug. Updating NVIDIA video driver can improve the performance. The recommended workaround from the Java Bug DB -- set this property by adding a line in sqldeveloper.conf:

AddVMOption -Dsun.awt.nopixfmt=true

Monday, April 13, 2015

windows process perl.exe Consumes High CPU

  • The Database Control (DB Control) Consumes High CPU - BEGIN EMD_NOTIFICATION.QUEUE_READY (Doc ID 734536.1)
  • Grid Control Agent Consumes High CPU when Executing parse-log1.pl / Log File Monitoring Metric (Doc ID 757877.1)

Friday, March 13, 2015

Aix get last day of current month

cal | awk '($0 != "") {F=$NF} END {print F}'
or
cal |grep .|fmt -1|tail -1

You can also find out the last day of any month by providing month and year to cal. for example:
cal 2 2012|awk '($0 != "") {F=$NF} END {print F}'
29
cal 10 2011|awk '($0 != "") {F=$NF} END {print F}'
11

Thursday, April 3, 2014

Save Excel to CSV with different delimitor

By default if converting Excel (.xls or .xlsx)  to CSV the result is comma delimited. This is because setting list separator in your control panel.

If we want to convert excel to csv with different delimitor, for example, semicolon delimited, the easy way is the changing list separator in control panel.
In Windows 7:
1. Control Panel
2. Region and Language
3. Additional settings
4. List separator, change from comma (,) to semicolon (;)
5. Ok, -Finish-

Monday, July 15, 2013

OEM not working after windows patch KB2661254

See the following for more details:
http://blogs.technet.com/b/pki/archive/2012/07/13/blocking-rsa-keys-less-than-1024-bits-part-2.aspx
The above update will block the use of cryptographic keys that are less than 1024 bits. OEM uses a cryptographic key of 512.

The above article shows a workaround as follows:

1. open a CMD prompt,

2. enter the following command:
  Certutil -setreg chain\minRSAPubKeyBitLength 512

Alternatively, use Firefox instead of Internet Explorer.

Wednesday, February 6, 2013

SID_XDB service and SID_XPT Service 

In oracle 10g, when you check the listener service, you may notice two particular services registered:
[ccbqa] /orasw/app/oracle/admin/ >lsnrctl status|grep ccbqa
Service "ccbqa" has 1 instance(s).
  Instance "ccbqa", status READY, has 1 handler(s) for this service...
Service "ccbqaXDB" has 1 instance(s).
  Instance "ccbqa", status READY, has 1 handler(s) for this service...
Service "ccbqa_XPT" has 1 instance(s).
  Instance "ccbqa", status READY, has 1 handler(s) for this service...


Thursday, January 31, 2013

ORA-01200


Sometimes when you try to start a database, you may get ORA-01200 error like:

ORA-01122: database file 8 failed verification check
ORA-01110: data file 8: '/bitest/oradata/bitest/cists02.dbf'

ORA-01200: actual file size of 64000 is smaller than correct size of 416256 blocks



The best solution is restore if you have a backup.
However if you don't have a backup, you can try to make the datafile have same block sizes registered in the control file to cheat oracle, but you may face data loses.

Steps as below (Caution: use at your own risk!!)

Monday, December 17, 2012

AIX - a sample script to start/stop OBIEE

#!/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

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