Please see my other blog for Oracle EBusiness Suite Posts - EBMentors

Search This Blog

Note: All the posts are based on practical approach avoiding lengthy theory. All have been tested on some development servers. Please don’t test any post on production servers until you are sure.

Saturday, December 01, 2012

Oracle TimesTen - Intro

TimesTen - What is it? 
 TimesTen is a memory-optimized, relational database management system with persistence and recover ability. Unlike traditional disk-optimized relational databases, all data within a TimesTen database is located in physical memory (RAM), which means no disk I/O is required for any data operation.

Monday, November 12, 2012

Subqueries: Nested & Corelated

Nested Subquery: A subquery is a query with in a query. It is nested in the where or having clause of another query. Subquery is executed first and then its results are provided to the main clause of the main query. 

Saturday, November 10, 2012

Installing 11gR2 RAC on Linux

Environment: OS Oracle Linux 5.4 32bit, Oracle 11gR2 (11.2.0.1) 32bit
See the overview

All the installation process already explained in the overview as mentioned above. Here all JPGs are being provided for the Linux which are self explanatory. Wherever any additional information would be required , it will be provided.

11gR2 on Linux: Create Database

11gR2 on Linux: RDBMS Software Install

11gR2 on Linux: Oracle Grid Infrastructure Install

Main Post: Installing 11gR2 RAC on Linux

Start the RAC1 and RAC2 virtual machines, login to RAC1 as the oracle user and start the Oracle installer.

11gR2 on Linux: Preparing second VM

Main Post: Installing 11gR2 RAC on Linux 

After fulfilling all the pre-reqs now we will shutdown the node1 (RAC1) and make its clone for Node2 (RAC2)

11gR2 on Linux: Prepare the shared storage/Prereq

Main Post: Installing 11gR2 RAC on Linux 

After installing the basic installation of linux there are certain requirments which need to be fulfilled for successful installation of RAC 11g.

11gR2 on Linux: Installing/configuring vmware tools

11gR2 on Linux: Installing OS (Linux)

11gR2 on Linux: Prepare the Virtual Machines

Main Post: Installing 11gR2 RAC on Linux

Two virtual machines will be prepared, first VM "RAC1" will be prepared , OS will be installed on it and then its copy ("RAC2")will be made. After copy the first VM , necessary modification for parameters will be made.

Wednesday, November 07, 2012

ORA-29270 Too Many Open HTTP Requests

Today one of the developer got the below error, i thought to write the details for him.

Saturday, November 03, 2012

Incomplete Recovery by RMAN from TAPE (ASM) to Single Instance.

-- Incomplete Recovery by RMAN from TAPE (ASM) to Single Instance.
Env. Windows 2008R2 64bit, backup is located at Netbackup (Tape media)
1-  first set ORACLE_SID and the DBID of the source DB
C:\> set ORACLE_SID=HOMEDB
RMAN> set dbid=1547250382

executing command: SET DBID

Monday, October 15, 2012

Adding service to single instance database

Database services (services) are logical abstractions for managing workloads in Oracle Database. Each service represents a workload with common attributes, service-level thresholds, and priorities.
In Real Application Clusters (RAC), a service can span one or more instances and facilitate real workload balancing based on real transaction performance.   RAC also enables you to manage a number of service features with Enterprise Manager, the DBCA, and the Server Control utility (SRVCTL).

Sunday, October 14, 2012

ORA-00304: requested INSTANCE_NUMBER is busy

Environment: 2 nodes Oracle RAC 11gR2, Linux 5
Scenario: Node1 has a single instance database named testdb, same testdb was restored to the Node2 (as single also) , while starting the instance on node2 for testdb (single instance) gave the error below:
ORA-00304: requested INSTANCE_NUMBER is busy

Wednesday, October 10, 2012

Setting up an NFS share

NFS (Network File System) is a protocol used by UNIX/Linux computers to share disks across a network. Similar to the Common Internet File Services (CIFS) protocol used by Windows, NFS is older and more light-weight, and performs much more efficiently on UNIX and Linux systems.

Monday, October 08, 2012

Adding vip resource (11gR2 Linux)

Enviroment: Oracle Linux 5 update 5 64bit, Oracle RAC 11gR2

While installing  RDBMS software on Oracle 11gR2 cluster following error was encountered.

Tuesday, October 02, 2012

ORA-12631: Username retrieval failed

Case:
While attempting to connect to the database the following error occurs.

c:\temp\dig>sqlplus /@qanew as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 2 09:09:07 2012

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

ERROR:
ORA-12631: Username retrieval failed
 

Monday, October 01, 2012

Configuring Transparent Application Failover

Transparent Application Failover (TAF) is a client-side feature that allows for clients to reconnect to surviving databases in the event of a failure of a database instance. Notifications are used by the server to trigger TAF callbacks on the client-side.

Sunday, September 30, 2012

RAC on Windows: Oracle Clusterware Node Evictions a.k.a. Why do we get a Blue Screen (BSOD) Caused By Orafencedrv.sys? [ID 337784.1]

Applies to:

Oracle Server - Enterprise Edition - Version 10.2.0.1 to 11.2.0.3 [Release 10.2 to 11.2]
Microsoft Windows Itanium (64-bit)
Microsoft Windows x64 (64-bit)
Microsoft Windows 2000Microsoft Windows XPMicrosoft Windows Server 2003 (64-bit Itanium)Microsoft Windows Server 2003 (64-bit AMD64 and Intel EM64T)Microsoft Windows Server 2003 R2 (64-bit AMD64 and Intel EM64T)Microsoft Windows Server 2003 R2 (32-bit)
Oracle Server Enterprise Edition - Version: 10.2.0.1 to 11.1.0.7


Symptoms

While running RAC a blue screen is shown and a reboot takes place. Windows creates a coredump that shows that orafencedrv.sys is involved.

Wednesday, August 29, 2012

Configuring Ignite for Oracle Connections

For Ignite to connect to Oracle databases that are specified by a name (tnsnames or LDAP), the following Oracle Network configuration (.ora)  files are required
    tnsnames.ora (required for name TNSName resolution)
    ldap.ora (required for LDAP name resolution)
    sqlnet.ora (optional)

Sunday, July 08, 2012

Oracle Data Guard Configuration (DGMGRL) (11gR2 Windows 2008R2)

Brief:
Data Guard is the name for Oracle's standby database solution, used for disaster recovery and high availability. DG broker does not have the ability to create standby and is used for managing the dataguard configuration.

Task:  Create  physical standby database for an existing primary database. Both primary and standby would be on same physical machine.
PRM = primary db 192.168.26.11
STBL = local Standby 192.168.26.11

Tuesday, July 03, 2012

How to Restrict User from Connecting to Database Through Specific IP Address

Some of the DBA asked me to restrict the connection to DB from specific IPs. Its simple and you can use the logon trigger for this purpose.

Sunday, July 01, 2012

Enabling/Disable Archive Log mode in RAC (11gR2)

Whether a single instance or clustered database, Oracle tracks (logs) all changes to database blocks in online redolog files. In an Oracle RAC environment, each instance will have its own set of online redolog files known as a thread. Each Oracle instance will use its set (group) of online redologs in a circular manner. Once an online redolog fills, Oracle moves to the next one.

Wednesday, June 27, 2012

cluvfy Healthcheck

Normally we run cluvfy in preparation of the installation of Grid Infrastructure or a set of RAC binaries to ensure everything is ready for the next step in the RAC install process. Beginning with 11.2.0.3, there is another option  "healthcheck" 
Part of the “comp” checks, it takes the following options:

Tuesday, June 26, 2012

Datapump import gets ORA-600 [kpudpxcs_ctxConvertStream_ref_1] while importing Spatial data

Working for one of our client , just got the below error in impdp log for some tables, one example below.

ORA-31693: Table data object "GDB"."STREETS" failed to load/unload and is being
skipped due to error:
ORA-02354: error in exporting/importing data
ORA-00600: internal error code, arguments: [kpudpxcs_ctxConvertStream_ref_1],
 [SYS_TYPEID("SHAPE")], [], [], [], [], [], [], [], [], [], []

Send Message to Users by OS Command using PL/SQL

From one of my client ,it was required to send the message to application users (on Windows) for specific events by the database server. I used  the simple msg (Win command) for this purpose , example given below :

Wednesday, June 20, 2012

How To Connect database in sqlplus without tnsnames.ora

Many times we have requirement of connecting database to execute a sql script but we sometimes don't find the tnsnames.ora file and sometimes we don't have permission to edit (one of my client faced issue on Windows 2008 Server).

Sunday, May 27, 2012

OPatch failure issue while patching RAC (11.2.0.3)

While patching the RAC/DB you may face different issues on Windows because of the .dll files being used. Here is the process how I got rid of such failure.
While performing the acfsroot install, it failed as below.

Applying Patch 6 on RAC 11gR2 (11.2.0.3)

Environment: 11gRAC/DB (11.2.0.3) , Windows Server 2008 R2 x64 Edition
Patch:13965211 - 11.2.0.3 Patch 6 for Windows 64 bit, download patch from metalink.
This patch is RAC rolling upgradable for GRID, and RDBMS homes.
You should administer one Oracle product, one Oracle home at a time, for its particular Bundle Patch Update.

Wednesday, May 23, 2012

CRS-4535: Cannot communicate with Cluster Ready Services

We have SCOM configured for Oracle Servers to know if some service crashes, today I got the following alert for one of our RAC node.
The OracleASMService+ASM1 service terminated unexpectedly.  
I started investigations and tried to get the status by crsctl as below 

Tuesday, May 22, 2012

SP2-1503: Unable to initialize Oracle call interface

Oracle Error :: SP2-1503

SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly

Cause

Indicates a library used by SQL*Plus to communicate with the database failed to initialize correctly.

Monday, May 21, 2012

ORA-01002: fetch out of sequence

"ORA-01002: fetch out of sequence" usually means that a SQL fetch has been issued after a prior commit has closed a server side cursor.
The current default behaviour of the Oracle JDBC driver is to autocommit SQL Statements. So it is possible that a commit has been issued which you did not expect. Eg if you are performing update statements inside the fetch loop, it is possible that an automatic commit has been issued after the update which has closed the fetch loop's cursor.

Monday, May 07, 2012

Enable block change tracking in oracle 11g

The block change tracking (BCT) feature for incremental backups improves incremental backup performance by recording changed blocks in each datafile in a block change tracking file. This file is a small binary file called block change tracking (BCT) file stored in the database area. RMAN tracks changed blocks as redo is generated.

Sunday, May 06, 2012

RMAN backup fails with Ora-00245 And Rman-08132


Symptoms

RMAN backups report errors like :

ORA-00245: control file backup operation failed

RMAN-08132: WARNING: cannot update recovery area reclaimable file list

Cause

Incorrect specification for the Snapshot Controlfile

ORA-19815: WARNING: DB_RECOVERY_FILE_DEST_SIZE 100.00% USED

Symptoms

ALERT LOG
-----------
ORA-19815: WARNING: db_recovery_file_dest_size of 3221225472 bytes is 100.00% used, and has 0 remaining bytes available.
************************************************************************
ARC0: Error 19809 Creating archive log file to '+DBFLASH'

Wednesday, May 02, 2012

How To Create a Connection With SQL Server In SQL*DEVELOPER

Ensure that the source database is accessible by the Microsoft SQL Server user and the system from where you are connecting that is used by SQL Developer for the source connection.You can test by creating the ODBC datasource to the SQLServer DB.

Access Control List for External Network Services (11g)

Starting with Oracle 11gR1 (11.1.0.6) so called "fine-grained access" was implemented to limit usage of packages like UTL_SMTP, UTL_HTTP connecting over the network to other services like mail server etc.

Tuesday, May 01, 2012

Log Files in RAC Environment

The Cluster Ready Services Daemon (crsd) Log Files

Log files for the CRSD process (crsd) can be found in the following directories:
ORA_CRS_HOME/log/hostname/crsd
the crsd.log file is archived every 10MB as crsd.101, crsd.102 ...
ORACLE_CRS_HOME/log//alert.log

Saturday, April 28, 2012

Oracle Event Tracing

Oracle provides various diagnostic tools for debugging the RDBMS. Certain events can be turned on to dump diagnstic information to trace files. Next, some INIT.ORA parameters are available that can be used while diagnosing memory and disk corruptions. There parameters are not set during normal operation of the database because they affect the performance. But in some circumstances it becomes necessary to turn them on to diagnose the issues with RDBMS, you can think it as extended SQL trace.

Monday, April 23, 2012

Health Check - RAC/DB

Running the following OS commands you can get the Health Check for your cluster and Database, all the output is redirected to one file to analyze.You can run it in a .bat file or separately on the command prompt.

Monday, April 16, 2012

RMAN Duplicate Database from RAC ASM to RAC ASM (11gR2)

Duplicating RAC database is very simple, first duplicate RAC Database to a single instance using RMAN and convert the single instance into a RAC cluster.
Testing Environment:
- Two nodes RAC 11gR2 (11.2.0.3) on Windows 2008R2
- Source RAC Database: TESTRAC (testrac1,testrac2)
- Target RAC Database: DUPDB (dupdb1,dupdb2) on the same hosts where TESTRAC is running
- ASM instances with three diskgroups (DGDUP for dupdb)
- Backup took already (on Netbackup) for Source Database, We CONFIGURE DEFAULT DEVICE TYPE TO SBT_TAPE; for our environment

Wednesday, April 11, 2012

The clock on host is not synchronous with the mean cluster time (RAC 11g)

Symptoms
Cluster alert log on one of the nodes shows the following message

[ctssd(804)]CRS-2409:The clock on host or-21 is not synchronous with the mean cluster time. No action has been taken as the Cluster Time Synchronization Service is running in observer mode.
OR
[ctssd(9534)]CRS-2409:The clock on host   is not synchronous with the mean cluster time. No action has been taken as the Cluster Time Synchronization Service is running in observer mode.

Sunday, April 08, 2012

DG4MSQL - Where clause does not return data

Problem:
One of the customer was facing issue while querying to SQL Server Database using dblink through DG4MSQL.  They have a view on SQL Server side, when they were querying this view with where clause having string in arabic,it did not return data. Although data was available and it could be seen when using query without where clause.
Customer is using 11g (11.2.0.3) RAC - Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production runs on Microsoft Windows 2008, Gateway is running on same  Database machine.

Sunday, April 01, 2012

MSQL to MSQL Replication using GG

Prerequisite
Before attempting this post please review the other related GoldenGate posts on the page Other Cateogories for understanding GoldenGate concepts.
Goal
Testing the Oracle Golden Gate for SQLServer to SQLServer real time replication.

Monday, March 26, 2012

Gather Statistics

On SYS Objects
If your database encounters a lot of changes (DMLs) for SYS schema objects, then it is recommended to collect SYS schema statistics.  The collection of statistics on SYS Schema objects will optimize the performance of internal recursive queries and application queries on SYS schema objects.

Wednesday, March 21, 2012

Simple Network Tests



Some times there is slowness in network and end users face it but complaining about the database or application. We can use some initial testing for such network slowness.

Sunday, March 18, 2012

Using the SQL TUNING ADVISOR (STA)

SQL Tuning Advisor analyzes candidate SQL statements, and execute a complete 
analysis of the statement including: 
 - Determining stale or missing statistics
 - Determining better execution plan
 - Detecting better access paths and objects required to satisfy them (indexes, materialized views)
 - Restructuring SQL
 

How to use the Automatic Database Diagnostic Monitor

The Automatic Database Diagnostic Monitor (ADDM) is an integral part of the Oracle RDBMS capable of gathering performance statistics and advising on changes to solve any existing performance issues measured. For this it uses the Automatic Workload Repository (AWR), a repository defined in the database to store database wide usage statistics at fixed size intervals (60 minutes).

ORA-20000 on executing DBMS_STATS.GATHER_TABLE_STATS on table


Problem:
DBMS_STATS.GATHER_TABLE_STATS('HOME','T_temp')

ORA-20000: Unable to analyze TABLE "HOME"."T_TEMP", insufficient
privileges or does not exist

Wednesday, March 14, 2012

Exadata Database Machine - Intro

Oracle Exadata is a database appliance with support for both OLTP and OLAP workloads. It can be said as “cloud in a box” composed of database servers, Oracle Exadata Storage Servers, an InfiniBand fabric for storage networking and all the other components required to host an Oracle Database.

ORACLE EXALYTICS - Intro

Background
We live in the age of information and information is power. In the business enterprise, it is imperative that everyone has the information they need in order to accurately and effectively fulfill their business obligations.

Oracle DBConsole service failed to start on Windows

If you have a database control of any database version on WINDOWS Operating System, some times OracleDBConsole Service failed to start with the following error, cause is not determined .

Monday, March 05, 2012

CRSCTL Utility/Other Cluster Commands Reference (11g)

CRSCTL is an interface between you and Oracle Clusterware, parsing and calling Oracle Clusterware APIs for Oracle Clusterware objects.  You  can perform check, start, and stop operations on the cluster with CRSCTL. This utility is located in the Grid_home/bin directory.

Sunday, March 04, 2012

Oracle Database Firewall

Oracle Database Firewall is the first line of defense for databases, providing real-time monitoring of database activity on the network. Highly accurate SQL grammar-based technology blocks unauthorized transactions, helping prevent internal and external attacks from reaching the database. Oracle Database Firewall is easy to deploy, requiring no changes to existing applications or databases.

Sunday, February 26, 2012

Case Sensitive Passwords in 11g

Case sensitive passwords (and auditing) are a default feature of newly created Oracle 11g databases. The Database Configuration Assistant (DBCA) allows you to revert these settings back to the pre-11g functionality during database creation.

Wednesday, February 22, 2012

Disable Oracle's password expiry (11g)

 Unlike older releases, Oracle 11g sets password expiry by default. That's really annoying

  • for SYS and SYSTEM: nobody wants to regularly change (and forget) them.

Tuesday, February 21, 2012

Slow TNSPING time

TNSping's only function is to send a Connect Packet (NSPTCN) to the listener; the listener replies with a Refuse Packet (NSPTRF) and a round trip time is computed. TNSping should never be used to test network performance.

Monday, February 20, 2012

ORA-01017 May Cause ORA-3136 WARNING : Inbound Connection Timed Out in Alert Log

Goal
How to reproduce the error ORA-3136 WARNING : inbound connection timed out ?
This is the most common reason when you notice the warning message in the alert log.

Monday, February 06, 2012

DG4MSQL Installation/Configuration - 11g RAC

Oracle Database Gateways provide the ability to transparently access data residing in a non-Oracle system from an Oracle environment. This transparency eliminates the need for application developers to customize their applications to access data from different non-Oracle systems, thus decreasing development efforts and increasing the mobility of the application.

Sunday, February 05, 2012

Installing 11g RAC on Windows 2008

Overview of new concepts in 11gR2 Grid Infrastructure
The single client access name (SCAN) is the address used by all clients connecting to the cluster. The SCAN
name is a domain name registered to three IP addresses, either in the domain name service (DNS) or the Grid
Naming Service (GNS). The SCAN name eliminates the need to change clients when nodes are added to or

Create the database - RAC 11g

Run ASMCA to create diskgroups
Prior to creating a database on the cluster, the ASM diskgroups that will house the database must be created.
In an earlier chapter, the ASM disks for the database diskgroups were stamped for ASM usage. We will now

RDBMS Software Install -RAC 11g

Prior to installing the Database Software (RDBMS) it is highly recommended to run the cluster verification
utility (CLUVFY) to verify that Grid Infrastructure has been properly installed and the cluster nodes have

Oracle Grid Infrastructure Install

Basic Grid Infrastructure Install (without GNS and IPMI)
  • Shutdown all Oracle Processes running on all nodes (not necessary if performing the install on new servers)

Prepare the shared storage for Oracle RAC

This post describes how to prepare the shared storage for Oracle RAC
1. Shared Disk Layout
2. Enable Automounting of disks on Windows
3. Clean the Shared Disks
4. Create Logical partitions inside Extended partitions
5. Drive Letters

Prepare the cluster nodes for Oracle RAC

Before installation of RAC 11g R2 , you have to prepare the cluster nodes. Following must be performed.
User Accounts
The installation should be performed as the Local Administrator, the Local Administrator username and

SINGLE CLIENT ACCESS NAME (SCAN)

Single Client Access Name (SCAN) is s a new Oracle Real Application Clusters (RAC) 11g Release 2 feature that provides a single name for clients to access Oracle Databases running in a cluster. The benefit is that the client’s connect information does not need to change if you add or remove nodes in the cluster.

Tuesday, January 17, 2012

Direct printing to a default client printer in Oracle developer 10g


Purpose:  Steps how to print on a default client printer directly without previewing or displaying the report. (Oracle 10g)
Files Attached: The following files are required and can be downloaded from below.
orarrp.zip      orarrp folder that includes the printing tool.

Saturday, January 14, 2012

Oracle Hints

Note: The demos on this page are intended to show valid syntax but it is far easier to use a hint to make a mess
of things than it is to improve things. So many, if not most, of the demos will increase the cost.
Join methods:

Monday, January 02, 2012

How to grant on v$ views

If you face with an error when try to give permission on a v$view
SQL> grant select on v$session to hr;
grant select on v$session to hr
*
ERROR at line 1:
ORA-02030: can only select from fixed tables/views

Tuesday, October 25, 2011

RAC Speedup

If you want to make the query response speed up, then alter table with parallel option

alter table tablename parallel;

VIP Concept

1- The system shown here is 2 node RAC

Wednesday, October 19, 2011

Create and configure a listener

The listener forwards client requests to supported services. These services can be configured statically in the listener.ora file or they can be dynamically registered with the listener. This dynamic registration feature is called service registration. The registration is performed by the PMON process.

Tuesday, October 18, 2011

Create and manage multiple network configuration files

LISTENER.ORA

If you have a server that is running multiple versions of Oracle software (multiple Oracle homes, each home has one or more database instances). You can use multiple listener.ora files.

Transparent Data Encryption (TDE) & LogMiner



1- Change in sqlnet.ora
######################SQLNET.ORA###############################

NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)
SQLNET.EXPIRE_TIME= 10
sqlnet.authentication_services= (NTS)

Monday, October 17, 2011

Create and Manage a tablespace that uses NFS mounted file system file

Direct NFS
Direct NFS is a new feature introduced with Oracle 11g and  is an optimized NFS (Network File System) client that provides faster and more scalable access to NFS storage located on NAS storage devices (accessible over TCP/IP). Direct NFS is built directly into the database kernel - just like ASM which is mainly used when using DAS or SAN storage.

Create and manage bigfile tablespaces

Bigfile Tablespaces
- a tablespace with a single, but very large (up to 4G blocks) datafile.
-A bigfile tablespace with 8K blocks can contain a 32 terabyte datafile.A bigfile tablespace with 32K blocks can contain a 128 terabyte datafile.

Create and manage database configuration files

Write alert to alert log

execute sys.dbms_system.ksdwrt(2,to_char(sysdate)|| ' Test alert ');

Sunday, October 16, 2011

Configure the database environment to support optimal data access performance

The Symptoms and the Problems
A common pitfall in performance tuning is to mistake the symptoms of a problem for the actual problem itself. It is important to recognize that many performance statistics indicate the symptoms, and that identifying the symptom is not sufficient data to implement a remedy. For example:

Stripe data files across multiple physical devices and locations

Goal of striping data is simple:-
To avoid I/O bottlenecks during parallel processing, all tablespaces  accessed by parallel operations should be striped.  Many current OS's support disk striping hence DBA's need not stripe data  across the disk.

Saturday, October 15, 2011

Create and manage temporary, permanent, and undo tablespaces

Using Multiple Tablespaces
Using multiple tablespaces allows you more flexibility in performing database operations.Some operating systems set a limit on the number of files that can be open simultaneously. Such limits can affect the number of tablespaces that can be simultaneously online. To avoid exceeding your operating system limit, plan your tablespaces efficiently.

Determine and set sizing parameters for database structures

You can determine/set parameter sizes using Enterprise Manager's Server Tab-> Storage section. This is first section of configuration of database structure, and second is parameters form parameter file.

Create the database


Note: Practice performed on 11g Rel 1 (APPS DB)

Considerations Before Creating the Database
Database Planning Tasks
- Plan the database tables and indexes and estimate the amount of space they will require.
- Plan the layout of the underlying operating system files your database will comprise. To greatly simplify this planning task, consider using Oracle
Managed Files and Automatic Storage Management to create and manage the operating system files that comprise your database storage.

Tuesday, October 11, 2011

Error: Procedure entry point longjmp could not be located in dynamic link library orauts.dll

If you get "Procedure entry point longjmp could not be located in dynamic link library orauts.dll" while connecting the SQL Plus, your environment variables are not set properly.

Tuesday, October 04, 2011

Spell the numbers - Examples

Using JSP format

SELECT TO_CHAR(TO_DATE(123.50,'J'),'JSP') to_words FROM   dual;

SELECT    TO_CHAR (TO_DATE (TRUNC (&num), 'J'), 'JSP')
       || ' Point '
       || TO_CHAR (TO_DATE (TO_NUMBER (SUBSTR (&num, INSTR (&num, '.') + 1)),'J'),'JSP')
  FROM DUAL;

Collect Full DML Statements for specific user without AUDIT

Use a logon trigger for the specific user to enable SQL tracing : it  generates a  trace file in the USER_DUMP_DEST location.The trace file contains all the SQL statements executed by the user after logon.
Create the following trigger in SYS schema:

create or replace trigger SCOTTLOG
after logon
on scott.schema
begin
   -- optionally add a tag to the trace file name to make the files discernable:
   execute immediate ' ALTER SESSION SET TRACEFILE_IDENTIFIER =''SCOTT''';
   -- enable sql_trace for this session:
   execute immediate 'ALTER SESSION SET SQL_TRACE TRUE';
end;
/

Note that all the SQLs of SCOTT user after logon will be traced and if the required collection is sufficient, disable the trigger to stop the collection and generation of trace files.
SQL> alter trigger scottlog disable;
Note
 i) Overhead involved is trace file generation in user_dump_dest.
 ii) Grant the CREATE SESSION system privilege to the user account rather than granting the CONNECT role. This is necessary  because in the versions older than 10gR2 the CONNECT role includes the ALTER SESSION system privilege and the user can disable sql tracing after logon. To avoid this, do not grant the CONNECT and RESOURCE roles , but grant the necessary privileges explicitly.

Ref: 309798.1


How to check if the IO of the Database is Slow

We will outline some of the thresholds whereby RDBMS Support may consider IO to be slow and thus a potential reason for a performance problem. If the underlying cause for slow performance is found to be a result of slow IO at the OS level, then the appropriate vendor responsible for the IO subsystem (hardware and software) should be engaged to diagnose and correct the situation

How To Configure Anti-Virus On Windows Server Running Oracle Database

When an Anti-virus performs a scan on a file it holds a lock on it. This lock interrupts the normal functioning of the database. To prevent any disaster situation such as database crash/hang, we recommend the following files to be excluded from online anti-virus scanning.

DCD & TCP Keep Alive (Windows)

KNOWN PROBLEMS OR LIMITATIONS  for DCD
1- Of the few reported problems, perhaps the most significant is DCD's poor performance on Windows NT. Dead connections are cleaned up only when the server is rebooted and the database is restarted. Exactly how well DCD works on NT depends on the client's proto implementation.

All Users with Client side Info

Create Or Replace Force View Sys.Av_users_all (Logon_time,
                                               Sid,
                                               Serial#,

Monday, October 03, 2011

Calling External Procedure (DLL) from PL/SQL

If Oracle has been configured for the external procedures , you can call any DLL from your PL/SQL. How to configure for EXTPROC please click on the link below

Configuring SQL*Net for External Procedures

External procedures are functions written in a third-generation language  
(3GL) such as C, and callable from within PL/SQL or SQL as if they were a 
PL/SQL procedure or function.  External procedures enable you to take  
advantage of the strengths and capabilities of a 3GL programming language  
in a PL/SQL environment.

Saturday, October 01, 2011

Restricting user to change the password

If for some reason you want to restrict the user to change the password ,
Use the event trigger AFTER ALTER with the attribute function ora_des_encrypted_password 
specific for ALTER USER events:
CREATE or REPLACE TRIGGER pass_change 
    AFTER ALTER on database
          BEGIN
               IF ora_sysevent='ALTER' and ora_dict_obj_type = 'USER' and ora_des_encrypted_password is not null
               THEN
                  RAISE_APPLICATION_ERROR(-20003,  'You are not allowed to alter password user.');
               END IF;
          END;
/
Note:
In the trigger, instead of raising the error, you may want to insert a row into a custom audit table.
 

How To Audit Application Username Using Trigger

With default auditing Oracle stores Oracle username but not the application username. In order to store application username you need to set CLIENT IDENTIFIER for the application session which is connecting to the database.

Wednesday, September 28, 2011

Copying Files Over Remote Desktop

Start up a remote desktop dialog and set the local resources as desired using options button. After this you will be able to use the clipboard of local system on remote machine.

How To Use PROFILES To Limit User Resources

You have a group of users that do not always disconnect from the database when they are done, or, they leave their connection idle for long periods of time. You want to eliminate these connections to make more connections available to other users.

How to Audit Connect AS SYSDBA Using Oracle Server

Windows Systems
---------------
On Windows Systems, you can monitor audited connects to Oracle as an administrative
user (former connect INTERNAL as of 8.1.7 connections ' as sysdba ') in the
event viewer. 

Tuesday, September 27, 2011

Application Tuning using Explain

The EXPLAIN facility can be used quickly and easily to
determine how the data is accessed (known as the access path) for
any given SQL statement, namely queries.  The ability to modify
this access path can yield an incredible performance benefit.