oracle10g

TransactionScope - The underlying provider failed on EnlistTransaction. MSDTC being aborted

一笑奈何 提交于 2019-12-03 11:42:21
Our team have got a problem that manifests as: The underlying provider failed on EnlistTransaction; Cannot access a disposed object.Object name: 'Transaction'. which seemed to appear as soon as we began using TransactionScope to handle our applications' transactions. The top part of the stacktrace is captured as: at System.Data.EntityClient.EntityConnection.EnlistTransaction(Transaction transaction) at System.Data.Objects.ObjectContext.EnsureConnection() at System.Data.Objects.ObjectContext.ExecuteStoreCommand(String commandText, Object[] parameters) at Reconciliation.Models.BillLines

How to query the permissions on an Oracle directory?

試著忘記壹切 提交于 2019-12-03 11:17:00
I have a directory in all_directories, but I need to find out what permissions are associated with it, i.e. what has been granted on it? This should give you the roles, users and permissions granted on a directory: SELECT * FROM all_tab_privs WHERE table_name = 'your_directory'; --> needs to be upper case And yes, it IS in the all_TAB_privs view ;-) A better name for that view would be something like "ALL_OBJECT_PRIVS", since it also includes PL/SQL objects and their execute permissions as well. You can see all the privileges for all directories wit the following SELECT * from all_tab_privs

Update materialized view when urderlying tables change

流过昼夜 提交于 2019-12-03 07:32:17
问题 I have a materialized view defined this way: CREATE MATERIALIZED VIEW M_FOO REFRESH COMPLETE ON COMMIT AS SELECT FOO_ID, BAR FROM FOO WHERE BAR IS NOT NULL GROUP BY FOO_ID, BAR / COMMENT ON MATERIALIZED VIEW M_FOO IS 'Foo-Bar pairs'; I wrote as a sort of cache: the source table is huge but the number of different pairs is fairly small. I need those pairs to get them JOINed with other tables. So far so good: it absolutely speeds queries. But I want to make sure that the view does not contain

Get total count of rows in pagination query

半腔热情 提交于 2019-12-03 07:16:57
I have the following query for record pagination SELECT * FROM (SELECT e.*, ROWNUM row_num FROM (SELECT emp_no, emp_name, dob from emp) outr WHERE ROWNUM < ( (pagenum * row_size) + 1)) WHERE row_num >= ( ( (pagenum - 1) * row_size) + 1) I would like to get the count of rows as well in same query and for this I have tried using COUNT(*) OVER () however I am not getting accurate results when I am paginating to next set of page and rows. How can I use COUNT(*) OVER () efficiently? A typical pagination query with the total number of rows would be: SELECT * FROM (SELECT outr.*, ROWNUM row_num FROM

How do I find out when a stored procedure was last modified or compiled in Oracle?

我的梦境 提交于 2019-12-03 06:55:31
问题 I'm preferably looking for a SQL query to accomplish this, but other options might be useful too. 回答1: SELECT LAST_DDL_TIME, TIMESTAMP FROM USER_OBJECTS WHERE OBJECT_TYPE = 'PROCEDURE' AND OBJECT_NAME = 'MY_PROC'; LAST_DDL_TIME is the last time it was compiled. TIMESTAMP is the last time it was changed. Procedures may need to be recompiled even if they have not changed when a dependency changes. 回答2: SELECT name, create_date, modify_date FROM sys.procedures order by modify_date desc 回答3:

PL/SQL - Optional conditions in where-clause - without dynamic sql?

自作多情 提交于 2019-12-03 06:16:10
I have a query where not all conditions are necessary. Here's an example of what it looks like when all conditions are used: select num from (select distinct q.num from cqqv q where q.bcode = '1234567' --this is variable and q.lb = 'AXCT' --this is variable and q.type = 'privt' --this is variable and q.edate > sysdate - 30 --this is variable order by dbms_random.value()) subq where rownum <= 10; --this is variable The parts marked as --this is variable are the parts that, well, vary! If a condition is NOT specified, then there is no default value. For example, if the input specifies "*" for q

Oracle 10g: Extract data (select) from XML (CLOB Type)

假如想象 提交于 2019-12-03 05:45:17
I'm new in Oracle and I've - maybe trivial - a problem in a select. (I'm using Oracle 10g Express Edition). I've a DB with a field CLOB: mytab.xml This column have an XML like this: <?xml version="1.0" encoding="iso-8859-1"?> <info> <id> 954 </id> <idboss> 954 </idboss> <name> Fausto </name> <sorname> Anonimo </sorname> <phone> 040000000 </phone> <fax> 040000001 </fax> </info> I'm trying to do a 'simple' select to get, for example, the value of 'fax' tag. But I've a bit of problem and I'm not able to understand my error. For example: select extract(xml, '//fax').getStringVal() from mytab; ORA

Types of Index in oracle?

你。 提交于 2019-12-03 05:40:48
What are the type of indexes in oracle? How to identify the index need to create? Oracle Database provides several indexing schemes that provide complementary performance functionality. These are: B-tree indexes: the default and the most common B-tree cluster indexes: defined specifically for cluster Hash cluster indexes: defined specifically for a hash cluster Global and local indexes: relate to partitioned tables and indexes Reverse key indexes: most useful for Oracle Real Application Clusters applications Bitmap indexes: compact; work best for columns with a small set of values Function

ORA-28000: the account is locked error getting frequently

十年热恋 提交于 2019-12-03 05:30:33
问题 I am getting the error : ORA-28000: the account is locked Is this a DB Issue? When I unlock user account using the command ALTER USER username ACCOUNT UNLOCK temporarily it will be OK. Then after some time the same account lock happens again. The database using is oracle XE Does anybody else have the same issue? 回答1: One of the reasons of your problem could be the password policy you are using. And if there is no such policy of yours then check your settings for the password properties in the

How does contains() in PL-SQL work?

无人久伴 提交于 2019-12-03 05:28:23
Have a lot of unnecessary results using contains() method in my query. Don't tell me to use like or something else. It is hardcoded and couldn't be changed. Contains is used on text fields that have a 'CONTEXT Index', which indexes a text field for searching. The standard usage is like this (using the score operator to display what is returned from the contains clause based on the 1 in contains matching the 1 in score ): SELECT score(1), value FROM table_name WHERE CONTAINS(textField, 'searchString', 1) > 0; For data like this in table table_name value | textField -------|---------------------