SELECT INDEX_NAME, TABLE_OWNER, TABLE_NAME, STATUS, ITYP_OWNER, ITYP_NAME, DOMIDX_STATUS, DOMIDX_OPSTATUS
FROM user_indexes
WHERE ITYP_NAME IS NOT NULL;
Saturday, December 27, 2008
How to Check Spatial Index???
How to Rebuild Spatial Index???
When I excute "truncate table ..." or "delete from ...", sometimes I encounter ORA-29859 or ORA-29861 error. In most cases, I just rebuild the spatial index on the geometry column and the problem will be fixed.
For Example:
DROP INDEX GEO_PS_POSITION_SX;
CREATE INDEX GEO_PS_POSITION_SX ON GEO_PS_POSITION (ROUTE) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
How to compile invalid objects???
Operations such as upgrades, patches and DDL changes can invalidate schema objects. Provided these changes don't cause compilation failures the objects will be revalidated by on-demand automatic recompilation, but this can take an unacceptable time to complete, especially where complex dependencies are present. For this reason it makes sense to recompile invalid objects in advance of user calls. It also allows you to identify if any changes have broken your code base. This article presents several methods for recompiling invalid schema objects.
1. Identifying Invalid Objects
2. The Manual Approach
3. Custom Script
4. DBMS_UTILITY.compile_schema
5. UTL_RECOMP
6. utlrp.sql and utlprp.sql
7. Magic Script
1. Identifying Invalid Objects:
The DBA_OBJECTS view can be used to identify invalid objects using the following query:
COLUMN object_name FORMAT A30
SELECT owner,object_type,object_name,status
FROM dba_objects
WHERE status = 'INVALID'
ORDER BY owner, object_type, object_name;
With this information you can decide which of the following recompilation methods is suitable for you.
2. The Manual Approach:
For small numbers of objects you may decide that a manual recompilation is sufficient.
The following example shows the compile syntax for several object types:
ALTER PACKAGE my_package COMPILE;
ALTER PACKAGE my_package COMPILE BODY;
ALTER PROCEDURE my_procedure COMPILE;
ALTER FUNCTION my_function COMPILE;
ALTER TRIGGER my_trigger COMPILE;
ALTER VIEW my_view COMPILE;
Notice that the package body is compiled in the same way as the package specification, with the addition of the word "BODY" at the end of the command.
An alternative approach is to use the DBMS_DDL package to perform the recompilations:
This procedure is equivalent to the following SQL statement:
ALTER PROCEDUREFUNCTIONPACKAGE [.] COMPILE [BODY]
Syntax
Exec dbms_ddl.alter_compile ( type , schema, name);
Type : Must be either PROCEDURE, FUNCTION, PACKAGE, PACKAGE BODY or TRIGGER.
Schema : Database Username
Name : Objects name
Example
SQL> exec dbms_ddl.alter_compile ('PROCEDURE','SCOTT','TEST');
PL/SQL procedure successfully completed
For more detail see below.
EXEC DBMS_DDL.alter_compile('PACKAGE', 'MY_SCHEMA', 'MY_PACKAGE');
EXEC DBMS_DDL.alter_compile('PACKAGE BODY', 'MY_SCHEMA', 'MY_PACKAGE');
EXEC DBMS_DDL.alter_compile('PROCEDURE', 'MY_SCHEMA', 'MY_PROCEDURE');
EXEC DBMS_DDL.alter_compile('FUNCTION', 'MY_SCHEMA', 'MY_FUNCTION');
EXEC DBMS_DDL.alter_compile('TRIGGER', 'MY_SCHEMA', 'MY_TRIGGER');
This method is limited to PL/SQL objects, so it is not applicable for views.
3. Custom Script:
In some situations you may have to compile many invalid objects in one go. One approach is to write a custom script to identify and compile the invalid objects.
The following example identifies and recompiles invalid packages and package bodies.
SET SERVEROUTPUT ON SIZE 1000000
BEGIN
FOR cur_rec IN (SELECT owner, object_name,object_type,
DECODE(object_type, 'PACKAGE', 1,'PACKAGE BODY', 2, 2)
AS recompile_order
FROM dba_objects
WHERE object_type IN ('PACKAGE', 'PACKAGE BODY')
AND status != 'VALID'
ORDER BY 4)
LOOP
BEGIN
IF cur_rec.object_type = 'PACKAGE' THEN
EXECUTE IMMEDIATE 'ALTER ' cur_rec.object_type ' "' cur_rec.owner '"."' cur_rec.object_name '" COMPILE';
ElSE EXECUTE IMMEDIATE 'ALTER PACKAGE "' cur_rec.owner '"."' cur_rec.object_name '" COMPILE BODY';
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.put_line(cur_rec.object_type ' : ' cur_rec.owner ' : ' cur_rec.object_name);
END;
END LOOP;
END;
/
This approach is fine if you have a specific task in mind, but be aware that you may end up compiling some objects multiple times depending on the order they are compiled in. It is probably a better idea to use one of the methods provided by Oracle since they take the code dependencies into account.
4. DBMS_UTILITY.compile_schema:
The COMPILE_SCHEMA procedure in the DBMS_UTILITY package compiles all procedures, functions, packages, and triggers in the specified schema.
Syntax
Exec dbms_utility.compile_schema ( schema,compile all)
Schema : Database Username
Compile All : Object type ( procedure, function, packages,trigger)
The example below shows how it is called from SQL*Plus:
EXEC DBMS_UTILITY.compile_schema(schema => 'SCOTT');
5. UTL_RECOMP:
This script is particularly useful after a major-version upgrade that typically invalidates all PL/SQL and Java objects.
The UTL_RECOMP package contains two procedures used to recompile invalid objects. As the names suggest, the RECOMP_SERIAL procedure recompiles all the invalid objects one at a time, while the RECOMP_PARALLEL procedure performs the same task in parallel using the specified number of threads.
Their definitions are listed below:
PROCEDURE RECOMP_SERIAL( schema IN VARCHAR2 DEFAULT NULL, flags IN PLS_INTEGER DEFAULT 0);
PROCEDURE RECOMP_PARALLEL( threads IN PLS_INTEGER DEFAULT NULL, schema IN VARCHAR2 DEFAULT NULL, flags IN PLS_INTEGER DEFAULT 0);
The usage notes for the parameters are listed below:
•schema - The schema whose invalid objects are to be recompiled. If NULL all invalid objects in the database are recompiled.
•threads - The number of threads used in a parallel operation. If NULL the value of the "job_queue_processes" parameter is used. Matching the number of available CPUs is generally a good starting point for this value.
•flags - Used for internal diagnostics and testing only.
The following examples show how these procedures care used:
-- Schema level.
EXEC UTL_RECOMP.recomp_serial('SCOTT');
EXEC UTL_RECOMP.recomp_parallel(4, 'SCOTT');
-- Database level.
EXEC UTL_RECOMP.recomp_serial();
EXEC UTL_RECOMP.recomp_parallel(4);
-- Using job_queue_processes value.
EXEC UTL_RECOMP.recomp_parallel();
EXEC UTL_RECOMP.recomp_parallel(NULL, 'SCOTT');
There are a number of restrictions associated with the use of this package including:
•Parallel execution is perfomed using the job queue. All existing jobs are marked as disabled until the operation is complete.
•The package must be run from SQL*Plus as the SYS user, or another user with SYSDBA.
•The package expects the STANDARD, DBMS_STANDARD, DBMS_JOB and DBMS_RANDOM to be present and valid.
•Runnig DDL operations at the same time as this package may result in deadlocks.
6.utlrp.sql and utlprp.sql:
The utlrp.sql and utlprp.sql scripts are provided by Oracle to recompile all invalid objects in the database. They are typically run after major database changes such as upgrades or patches. They are located in the $ORACLE_HOME/rdbms/admin directory and provide a wrapper on the UTL_RECOMP package. The utlrp.sql script simply calls the utlprp.sql script with a command line parameter of "0". The utlprp.sql accepts a single integer parameter that indicates the level of parallelism as follows:
•0 - The level of parallelism is derived based on the CPU_COUNT parameter.
•1 - The recompilation is run serially, one object at a time.
•N - The recompilation is run in parallel with "N" number of threads.
Both scripts must be run as the SYS user, or another user with SYSDBA, to work correctly.
7. Magic Script
Now last but not the least,below is the query which i use to compile the invalid objects at one go:
SELECT CASE object_type
WHEN 'PACKAGE' THEN
'ALTER 'object_type' 'owner'.'object_name' COMPILE;'
ELSE
'ALTER PACKAGE 'owner'.'object_name' COMPILE BODY;'
END
FROM dba_objects
WHERE STATUS = 'INVALID'
AND object_type IN ('PACKAGE','PACKAGE BODY','FUNCTION','PROCEDURE');
Hope this helps....
Monday, December 22, 2008
Steps to configure Webutil
What is WebUtil???
"WebUtil is a pre-packaged set of components that can be used to add a great deal of extra functionality to Web-deployed Forms applications. WebUtil addresses common challenges faced by Oracle Forms developers who wish to build applications which integrate tightly with the client browser - the computer at which the end user is actually located."
Configuration :
1- Downlaod the file from oracle site or from the attachments as I've attached the version 1.0.6 also Jacob files.
2- Extract the webutil_106.zip file in the ( ORACLE_HOME\forms90 or [forms in 10g] )You've to get direcotries like this inside forms folder:
■ doc
■ java
■ server
■ webutil
■ Webutil.pll, Webutil.olb and the create_webutil_db.sql exist in the Forms directory
--> Also extract jacov.dll into webutil directory and jacob.jar into java directory from Jacob_18.zip
3- Create user named webutil in your database and give appropiate privilge.
4- conenct with the user and run the file create_webutil_db.sql5- Create public synonym for webutil_db
Please see this example :
C:\>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Sat May 17 14:51:55 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn / as sysdbaConnected.
SQL> create user webutil identified by webutil default tablespace users;
User created.
SQL> grant connect,resource to webutil;
Grant succeeded.
SQL> conn webutil/webutil
Connected.
SQL> @C:\Dev10g\forms\create_webutil_db.sql
Package created.
Package body created.
SQL> conn / as sysdba
Connected.
SQL> create public synonym webutil_db for webutil.webutil_db;
Synonym created.
SQL> grant execute on webutil_db to public;
Grant succeeded.
SQL> revoke connect,resource from webutil;
Revoke succeeded.
6- Configuring the files :
a- Create virtual directory :
Add the following code in : forms/server/forms.conf
# Virtual path for webutil
AliasMatch ^/forms/webutil/(..*) "C:\Dev10g/forms/webutil/$1"
Check if the above line is not there, then add it else leave.
b- in forms/server/default.env file add this line :
# webutil config file path
WEBUTIL_CONFIG=C:\Dev10g\forms\server\webutil.cfg
Also append the following to CLASSPATH variable which reside in the same file
;C:\Dev10g\forms\java\frmwebutil.jar
it will look like this :
CLASSPATH=C:\Dev10g\j2ee\OC4J_BI_Forms\applications\formsapp\formsweb\WEB-INF\lib\frmsrv.jar;C:\Dev10g\jlib\repository.jar;C:\Dev10g\jlib\ldapjclnt10.jar;C:\Dev10g\jlib\debugger.jar; C:\Dev10g\jlib\ewt3.jar;C:\Dev10g\jlib\share.jar;C:\Dev10g\jlib\utj.jar;C:\Dev10g\jlib\zrclient.jar; C:\Dev10g\reports\jlib\rwrun.jar;C:\Dev10g\forms\java\frmwebutil.jar
c- Configuring formsweb.cfg :
Please insure that these files are in server directory : webutilbase.htm,webutiljini.htm,webutiljpi.htm,webutil.cfg
Open formsweb.cfg
:-- Add these lines to your application configuration which will use Webutil :
WebUtilArchive=frmwebutil.jar,jacob.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
or add this config to your file if you want to run seperate FMX against it :
[webutil]
WebUtilArchive=frmwebutil.jar,jacob.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
archive_jini=frmall_jinit.jar
archive=frmall.jar
lookAndFeel=oracle
7-Please add the below to archive_jini=frmall_jinit.jar in formsweb.cfg file like
archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
8- Siging the JAR files :
a- Open a Command window and change to the ORACLE_HOME\forms\webutil directory.
b- Check that ORACLE_HOME/jdk/bin is in the path. If it is not, add it by runing this :
C:\Dev10g\forms\webutil>set path=c:\Dev10g\jdk\bin;%path%
c- call the sign batch file :
C:\Dev10g\forms\webutil>sign_webutil.bat c:\dev10g\forms\java\frmwebutil.jar
=> Also sign the jacob file
C:\Dev10g\forms\webutil>sign_webutil.bat c:\dev10g\forms\java\jacob.jar
you can test your configuration by calling like this :
http://yourserver/forms/frmservlet?config=webutil&form=testwebutil.fmx
To download jacob_18.zip click on the below link.
http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
To download webutil_106.zip click on the below link.
http://www.oracle.com/technology/software/products/forms/files/webutil/webutil_106.zip
To download webutil_demo.zip click on the below link.
http://www.oracle.com/technology/products/forms/htdocs/webutil/Webutil_demo.zip
To see webutil demo click on below link.
http://www.oracle.com/technology/sample_code/products/forms/demo/9i/javabeans_pjc_samples/webutil/viewlet/WebUtil_Simple_viewlet_swf.html
Please post comment if you need any help.
Monday, December 8, 2008
SALAAM
It is an NDTV initiative.
You will also receive a textback for this. I tried it and it works.
Jai Hind!!!
Monday, December 1, 2008
Anti terror Squad Helpline
DEAR ALL,
In case you come across any suspicious activity, any suspicious movement
or have any information to tell to the Anti-Terror Squad (ATS),
please take a note of the new
ALL INDIA TOLL-FREE Terror Help-line "1090".
Your city's Police or Anti-Terror squad will take action as quickly as possible.
Remember that this single number 1090 is valid all over India
This is a toll free number and can be dialed from mobile phones also.
Moreover, the identity of the caller will be kept a secret.
Let us make each and every citizen of India aware about this facility.
Friday, November 21, 2008
Please give a serious look..!!
Please read it carefully and prove yourself a true indain.
U CAN MAKE A HUGE DIFFERENCE TO THE INDIAN ECONOMY BY FOLLOWING FEW SIMPLE STEPS.
Please spare a couple of minutes here........for the sake of India ... our country..I got this article from one of my friend, but it's true, I can see this from day to day life,Small example,
Before 5 months 1 CAN $ = IND Rs 32
After 5 months. Now it is 1 CAN $ = IND Rs 37
Do you think Canadian Economy is booming?
No, but Indian Economy is Going Down.
Our Economy is in u'r handsINDIAN economy is in a crisis.
Our country like many other ASIAN countries is undergoing a severe economic crunch. Many INDIAN industries are closing down. The INDIAN economy is in a crisis and if we do not take proper steps to control those, we will be in a critical situation.
More than 30000 crore rupees of foreign exchange are being siphoned out of our country on products such as cosmetics, snacks, tea, beverages...etc which are grown, produced and consumed here . A cold drink that costs only 70 / 80 paisa to produce is sold for NINE rupees, and a major chunk of profits from these are sent abroad. This is a serious drain on INDIAN economy.
"COCA COLA "and" SPRITE" belong to the same multinational company, "COCA COLA"?
Coke advertisements says ' JO CHAHO HOJAYE, COCACOLA ENJOY'(Whatever the hell, let it happen, you drink coke) What can you do?
You can consider some of the better alternatives to aerated drinks. You can drink LEMON JUICE, FRESH FRUIT JUICES, CHILLED LASSI (SWEET OR SOUR), BUTTER MILK, COCONUT WATER, JALJEERA, ENERJEE, MASALA MILK..........
Everyone deserves a healthy drink, including you!Over and above all this, economic sanctions have been imposed on us.
We have nothing against Multinational companies, but to protect our own interests we request everybody to use INDIAN products only for next two years. With the rise in petrol prices, if we do not do this, the rupee will devalue further and we will end up paying much more for the same products in the near future.
What you can do about it?
1. Buy only products manufactured by WHOLLY INDIAN COMPANIES.
2. ENROLL as many people as possible for this cause.
Each individual should become a leader for this awareness. This is the only way to save our country from severe economic crisis. You don't need to give-up your lifestyle. You just need to choose an alternate product.
All categories of products are available from WHOLLY INDIAN COMPANIES.
LIST OF PRODUCTS
BATHING SOAP:
USE - CINTHOL & OTHER GODREJ BRANDS, SANTOOR, WIPRO SHIKAKAI, MYSORE SANDAL, MARGO, NEEM, EVITA, MEDIMIX, GANGA , NIRMA BATH & CHANDRIKA
INSTEAD OF - LUX, LIFEBOY, REXONA, LIRIL, DOVE, PEARS, HAMAM, LESANCY, CAMAY, PALMOLIVE
TOOTH PASTE:
USE - NEEM, BABOOL, PROMISE, VICO VAJRADANTI, PRUDENT, DABUR PRODUCTS, MISWAK
INSTEAD OF - COLGATE, CLOSE UP, PEPSODENT, CIBACA, FORHANS, MENTADENT. TOOTH BRUSH: USE - PRUDENT, AJANTA , PROMISEINSTEAD OF - COLGATE, CLOSE UP, PEPSODENT, FORHANS, ORAL-B
SHAVING CREAM:
USE - GODREJ, EMANI
INSTEAD OF - PALMOLIVE, OLD SPICE, GILLETE
BLADE:
USE - SUPERMAX, TOPAZ, LAZER, ASHOKA
INSTEAD OF - SEVEN-O -CLOCK, 365, GILLETTE
TALCUM POWDER:
USE - SANTOOR, GOKUL, CINTHOL, WIPRO BABY POWDER, BOROPLUS
INSTEAD OF - PONDS, OLD SPICE, JOHNSON BABY POWDER, SHOWER TO SHOWER
MILK POWDER:
USE - INDIANA, AMUL, AMULYA
INSTEAD OF - ANIKSPRAY, MILKANA, EVERYDAY MILK, MILKMAID.
SHAMPOO:
USE - LAKME, NIRMA, VELVET
INSTEAD OF - HALO, ALL CLEAR, NYLE, SUNSILK, HEAD AND SHOULDERS, PANTENE
MOBILE CONNECTIONS
USE - BSNL, AIRTEL
INSTEAD OF - HUTCH
Every INDIAN product you buy makes a big difference. It saves INDIA . Let us take a firm decision today.
BUY INDIAN TO BE INDIAN we are not against of foreign products.
WE ARE NOT ANTI-MULTINATIONAL.
WE ARE TRYING TO SAVE OUR NATION.
EVERY DAY IS A STRUGGLE FOR A REAL FREEDOM.
WE ACHIEVED OUR INDEPENDENCE AFTER LOSING MANY LIVES.
THEY DIED PAINFULLY TO ENSURE THAT WE LIVE PEACEFULLY.
THE CURRENT TREND IS VERY THREATENING.
MULTINATIONALS CALL IT GLOBALISATION OF INDIAN ECONOMY.
FOR INDIANS LIKE YOU AND ME IT IS RECOLONISATION OF INDIA ....
THE COLONIST'S LEFT INDIA THEN.
BUT THIS TIME THEY WILL MAKE SURE THEY DON'T MAKE ANY MISTAKES.
WHO WOULD LIKE TO LET A" GOOSE THAT LAYS GOLDEN EGGS" SLIP AWAY.
PLEASE REMEMBER: POLITICAL FREEDOM IS USELESS WITHOUT ECONOMIC INDEPENDENCE .. RUSSIA , S.KOREA , MEXICO ..........
THE LIST IS VERY LONG!!LET US LEARN FROM THEIR EXPERIENCE AND FROM OUR HISTORY.
LET US DO THE DUTY OF EVERY TRUE INDIAN.FINALLY: IT'S OBVIOUS THAT U CAN'T GIVE UP ALL OF THE ITEMS MENTIONED ABOVE, SO GIVE UP ATLEAST ONE ITEM TO FOR THE SAKE OF OUR COUNTRY.