Tuesday, January 13, 2009

Disabling OS-Authentication

On the server where that host the database, edit the file $ORACLE_HOME/network/admin/sqlnet.ora

Set SQLNET.AUTHENTICATION_SERVICES=(NONE)

The second way will be remove oracle OS user from dba group or ORA_DBA on Windows.

Auto statistics collection in 10gR1 and 10gR2

We all know that Oracle Database 10g introduces the new automatic optimizer-statistics collection feature. Oracle automatically creates a database job, GATHER_STATS_JOB, and Oracle Scheduler automatically schedules the job to run during the maintenance window.
The Scheduler runs this job when the maintenance window is opened. By default, the maintenance window opens every night from 10 P.M. to 6 A.M. and all day on weekends.

But do you know there is something different between Oracle Database 10gR1 and 10gR2 ?
In 10gR1, the GATHER_STATS_JOB continues until it finishes, even if it exceeds the allocated time for the maintenance window.
http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10752/stats.htm#40674

In 10gR2, the GATHER_STATS_JOB stops when the maintenance window closes.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#i41282

Friday, January 2, 2009

Customize 10g sqlplus prompt

Edit the file $ORACLE_HOME/sqlplus/admin/glogin.sql and add in line as below.
set sqlprompt "_USER'@'_CONNECT_IDENTIFIER> "

When perform sqlplus,
[localhost.localdomain]oracle:> sqlplus user1/user1@ORCL

SQL*Plus: Release 10.2.0.4.0 - Production on Sat Jan 3 15:27:23 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options


user1@ORCL>


This setting can be overwritten if you have login.sql file in the directory where you run sqlplus.
Eg. On my windows client, I have D:\> login.sql and the contents of the file is as below:
set sqlprompt "_USER'@'_CONNECT_IDENTIFIER _DATE> "

When I run sqlplus from D:\ I get output below.
D:\>sqlplus user1/user1@ORCL

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jan 3 15:31:38 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options

user1@ORCL 03-JAN-09>