Priveleges needed select from sys.seq$ s, sys.obj$ o, sys.user$ u
I have the following problem:
I do a full import from a 9.2.0.6 db in to a 10.2.0.3 db. Some of the package bodies will not compile. One of them produces
104/5 PL/SQL: SQL Statement ignored
108/11 PL/SQL: ORA-00942: table or view does not exist
That statement does a select from sys.seq$ s, sys.obj$ o, sys.user$ u. The package is owned by the user boo. If I try to run the select statement from sql plus as sys it's executed ok.
I thought that a full import would include the granted rights for all the users, and therefore assume that its not a grant that is missing. Is there a parameter that allows other users access to select from these tables? (I do not have access to the parameter file of the original base, so I can not go and check).
You must grant user "boo" the required privileges because they have not been exported: see Re: Missing grant with full export/full import.
Similar Messages
-
I have a db, call it xyz.mdb
It suddenly is that SSMS is not listing the table objects nor the Views. SELECT * FROM sys.Tables and SELECT * FROM sys.Views work very fine. But when I click on the tables node, on Objects Explorer, Only the Systems Tables and File Tables folders
show.
Other DBs on same SQL instance do not show same problem. They are all working very fine.
I have backed up and restored this db on other computers and the behaviour is the same. Incidentally right-clicking the db and clicking Properties throws up this error message.
-------------------------------------------------------------------------Error!
Cannot show requested dialog.
Property Size is not available for Database '[Pliny E DB - NOA 2014]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.PropertyCannotBeRetrievedExceptionText&EvtID=Size&LinkId=20476
--------------------------------------------------------------------------------End>
When I try to Refrresh the Tables node on Object Explorer, I get this other:
------------------------------Error!
SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x9090d9b7; actual: 0x909001b4). It occurred during a read of page (1:1173) in database ID 21 at offset 0x0000000092a000 in file 'c:\Databases\Clients\NOA\Pliny E DB -
NOA 2014.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check
(DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (Microsoft SQL Server, Error: 824)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=824&LinkId=20476
------------------------------End>
The Help link of course is not valid any more.
Many thanks
Vie
@Abuja
VieYour database is corrupted and you need to run.
DBCC CHECKDB
You already have a backup so do it...
This link will provide you with more information:
http://msdn.microsoft.com/en-us/library/ms176064.aspx -
Error in renaming the table from SYS user
Hi
I am in Schema by name jc
and I have a table by name tab1
now i logged as sys user
then I give a command
rename jc.tab1 to tab2 ;
getting the following error
rename jc.tab1 to tab2
ERROR at line 1:
ORA-01765: specifying table's owner name is not allowed
Query is
Is it notpossible to rename a table of other schema by logging as sys user ?
is there any other alternate method of doing so??
Thanks and Regards
JCSorry Guido,
I have not stolen anything from anywhere :)
All are mine ...I have created some normal users and some users with DBA privileges....
I use this schemas for testing purpose....
Also if I give command like from SYS user
Alter table jc.tab1 rename to tab2 ;
It will create tab2 in jc schema only and not in SYS schema.
So there is no question of poluting the SYS schema.
Also whatever I ask in this forum is a part of my application related,
I never give the entire program, which may be useless for others and time taking in understanding.
I just simulate whatever I require in as simplae format as I can
The person who is very perfect in this forumn can find such queries rubbish. But in learning process no question is rubbish, but there can be a rubbish answer to every intelligent question too... :)
Regards
JC -
Select from sys.all_ind_columns works in sql*plus but not in stored proc
I'm writing a query to find duplicate rows in a temporary table which has no unique index defined before I insert the data into the real table. I'm trying to query the sys.all_ind_columns view for the target table which belongs to a different schema:
SELECT column_name colnm
FROM sys.all_ind_columns i
WHERE i.table_owner = 'SUSDB'
AND i.index_name LIKE '%LUK'
AND i.table_name = &tbnm
ORDER BY i.column_position;
This works from my GUI interface and returns five rows but when I put it into a stored procedure I get now data returned. I have granted my userid SELECT ANY DICTIONARY authority. What else do I need?CREATE OR REPLACE FUNCTION bog_elsa2_leslie.diag_msg_1000_cursor(i_rept_inst IN VARCHAR2,
i_rept_time_frame IN VARCHAR2,
i_table_name IN VARCHAR2,
i_column_name IN VARCHAR2,
i_domain_table IN VARCHAR2,
i_domain_column IN VARCHAR2,
i_domain_code IN VARCHAR2,
i_trace_flg IN NUMBER := 0)
RETURN VARCHAR2 IS
cursor_stg VARCHAR2(4000);
|| File name: diag_msg_1000_cursor.fnc
|| Created by: ELSA.LESLIE
|| Created on: 20071215 4:08:20 AM
|| Purpose: Build the string that will retrieve PRIKEY and CONTENTS
|| from the target table, university, time frame, submission
|| and table passed as parameters for the 1000 dignostic.
|| Diagnostic 1000:
|| Validate that the table's logical unique key constraint
|| is not violated.
|| In: ***
|| *** ALL INPUT VARIABLES MUST BE DECLARED EVEN IF THEY ARE
|| *** NOT USED IN THIS PARTICULAR FUNCTION BECAUSE THE
|| *** EDIT_ANY_TABLE PROCEDURE CALLS THE FUNCTION IN AN
|| *** EXECUTE IMMEDIATE STATEMENT THAT REQUIRES THE 'USING'
|| *** PHRASE BE PART OF THE CALLING PROGRAM RATHER THAN BEING
|| *** INCLUDED IN THE RETURNED CURSOR_STG.
|| ***
|| i_rept_inst = reporting institution (eg. UF, FSU)
|| i_rept_time_frame = reporting time frame (eg., 200608, 20062007)
|| i_table_name = target table to be edited (eg. BUILDINGS, ENROLLMENTS)
|| i_trace_flg is optional and is used for debugging (values: TRUE/FALSE)
|| [not used] i_column_name = eg. ALTER_YR, BASE_YR
|| [not used] i_domain_table = the name of the domain table containing valid values
|| [not used] (eg. DOMAIN_MAIN_VALUES, DOMAIN_UNIV)
|| [not used] i_domain_column = the name of the column in the domain table that
|| [not used] contains the valid values (eg. CODE, OPEID_CD)
|| [not used] i_domain_code = the 5-digit domain code (eg. 10021, 01045)
|| Out: cursor_stg = executable SQL to return error row information
|| Dependencies: Logical Unique Key for tables must be have the string 'LUK'
|| postpended to it's name.
|| Exceptions: none
|| Copyright: BOG 2007
|| ***************************************************
|| Modifications:
|| Userid - Date - Modification description
-- Constants and special assignments
rept_inst VARCHAR2(4) := upper(i_rept_inst);
rept_time_frame VARCHAR2(8) := i_rept_time_frame;
table_name VARCHAR2(30) := upper(i_table_name);
column_name VARCHAR2(30) := upper(i_column_name);
domain_table VARCHAR2(30) := upper(i_domain_table);
domain_column VARCHAR2(30) := upper(i_domain_column);
domain_code VARCHAR2(5) := upper(i_domain_code);
trace_flg NUMBER := i_trace_flg;
file_name VARCHAR2(100) := 'diag_msg_1000_cursor: ';
unq_cols VARCHAR2(1000) := NULL;
unq_contents VARCHAR2(4000) := NULL;
unq_where VARCHAR2(4000) := NULL;
-- Accounting of process n/a all contained in the for loop
row_num NUMBER := 0;
-- Object types - n/a
-- Cursors
CURSOR ix_cols_curr(tbnm VARCHAR2 := table_name) IS
SELECT column_name colnm
FROM sys.all_ind_columns i
WHERE i.table_owner = 'SUSDB'
AND i.index_name LIKE '%LUK'
AND i.table_name = tbnm
ORDER BY i.column_position;
-- Cursor variables n/a
-- errors and exceptions
sql_code NUMBER;
sql_errm VARCHAR2(255);
BEGIN
-- output trace information if requested
IF trace_flg = 1
THEN
dbms_output.put_line(file_name || 'rept_inst = ' || rept_inst);
dbms_output.put_line(file_name || 'rept_time_frame = ' || rept_time_frame);
dbms_output.put_line(file_name || 'table_name = ' || table_name);
dbms_output.put_line(file_name || 'column_name = ' || column_name);
dbms_output.put_line(file_name || 'domain_table = ' || domain_table);
dbms_output.put_line(file_name || 'domain_column = ' || domain_column);
dbms_output.put_line(file_name || 'domain_code = ' || domain_code);
END IF;
-- ix_cols_loop builds a string of the columns contain in the
-- logical unique key which is then later incorporated into the
-- select cursor returned to the calling program.
FOR this_col IN ix_cols_curr(table_name)
LOOP
<<ix_cols_loop>>
-- output trace information if requested
IF trace_flg = 1
THEN
row_num := ix_cols_curr%ROWCOUNT;
dbms_output.put_line(file_name || 'row=' || row_num ||
'column_name=' || this_col.colnm);
END IF;
IF unq_cols IS NOT NULL
THEN
unq_cols := unq_cols || ', ';
unq_contents := unq_contents || ', ';
END IF;
unq_cols := unq_cols || this_col.colnm;
unq_contents := unq_contents || q'[']' || this_col.colnm ||
q'['=]' || this_col.colnm;
unq_where := unq_where || 'AND tbl.' || this_col.colnm ||
' = dups.' || this_col.colnm;
END LOOP ix_cols_loop;
IF trace_flg = 1
THEN
dbms_output.put_line(file_name || 'unq_cols =' || unq_cols);
dbms_output.put_line(file_name || 'unq_contents =' || unq_contents);
dbms_output.put_line(file_name || 'unq_where =' || unq_where);
END IF;
cursor_stg := 'SELECT prikey, ' || unq_contents || ' AS contents ' ||
'FROM univdb.' || table_name || ' tbl, (SELECT ' ||
unq_cols || ', COUNT(*) FROM univdb.' || table_name ||
q'[ WHERE rept_inst = ']' || rept_inst || q'[']' ||
q'[AND rept_time_frame = ']' || rept_time_frame || q'[']' ||
' GROUP BY ' || unq_cols || ' HAVING COUNT(*) > 1) dups' ||
q'[ WHERE tbl.rept_inst = ']' || rept_inst || q'[']' ||
q'[ AND tbl.rept_time_frame = ']' || rept_time_frame ||
q'[']' || unq_where;
-- output trace information if requested
IF trace_flg = 1
THEN
dbms_output.put_line(file_name || 'cursor_stg = ' || cursor_stg);
END IF;
RETURN(cursor_stg);
EXCEPTION
-- block exception
WHEN OTHERS THEN
sql_code := SQLCODE;
sql_errm := SQLERRM;
IF trace_flg = 1
THEN
dbms_output.put_line(file_name || ' ROW NUM ' || row_num || ' sql code ' ||
sql_code || ' sql message ' || sql_errm);
END IF;
END diag_msg_1000_cursor; -
Select from sys table in package procedure
Is it possible to use a table in the SYS schema in a procedure defined in a package?
Right now, these errors are raised:
SQL> SHOW ERRORS PACKAGE BODY App_security_context;
Errors for PACKAGE BODY APP_SECURITY_CONTEXT:
LINE/COL ERROR
17/3 PL/SQL: SQL Statement ignored
18/8 PLS-00201: identifier 'SYS.DBA_ROLE_PRIVS' must be declared
eg)
CREATE OR REPLACE PACKAGE App_security_context IS
PROCEDURE Set_restrictions;
END App_security_context;
CREATE OR REPLACE PACKAGE BODY App_security_context IS
PROCEDURE Set_restrictions
IS
data_code VARCHAR2(16);
BEGIN
SELECT MD_SYS_USER_DATA_CODE.code_id INTO data_code
FROM
MD_SYS_USER_DATA_CODE
, SYS.DBA_ROLE_PRIVS
WHERE SYS.DBA_ROLE_PRIVS.grantee = SYS_CONTEXT('USERENV', 'SESSION_USER')
AND SYS.DBA_ROLE_PRIVS.granted_role = MD_SYS_USER_DATA_CODE.role_id;
DBMS_SESSION.SET_CONTEXT('app_entry', 'data_code', data_code);
END Set_restrictions;
END App_security_context;You need the select grant on the SYS view granted directly to you - not through a role. See here for more details:
http://osi.oracle.com/~tkyte/Misc/RolesAndProcedures.html -
Hi all,
Help me here when i try am unable to get a data,Can some one help me with a query to get.
If it cant be done can i know why..
select * from Sys.databases
where owner_sid='0x01'
What am trying is to get a login
names from syslogin
table with respect to Sid.
Select a.name,b.name,a.owner_sid from Sys.databases a
Join Syslogins b
on a.owner_sid = b.sid
where owner_sid like '0x01'
Thanks all in Advance.....Below are a couple of examples of how to accomplish the task. Note that SID is varbinary so the literal should not be enclosed in quotes.
SELECT
a.name AS DatabaseName
,b.name AS OwnerName
,a.owner_sid AS OwnerSID
FROM sys.databases a
JOIN sys.server_principals b ON
a.owner_sid = b.sid
WHERE owner_sid = 0x01;
SELECT
a.name AS DatabaseName
,SUSER_SNAME(owner_sid) AS OwnerName
,a.owner_sid AS OwnerSID
FROM sys.databases a
WHERE a.owner_sid = 0x01;
Dan Guzman, SQL Server MVP, http://www.dbdelta.com -
Need definition of table sys.user$
I have looked webwide, did search here... no luck....
SQL> set pages 500
SQL> set long 5000
SQL> select text from dba_views
2 where VIEW_NAME = 'DBA_USERS';
TEXT
select u.name, u.user#, u.password,
m.status,
decode(u.astatus, 4, u.ltime,
5, u.ltime,
6, u.ltime,
8, u.ltime,
9, u.ltime,
10, u.ltime, to_date(NULL)),
decode(u.astatus,
1, u.exptime,
2, u.exptime,
5, u.exptime,
6, u.exptime,
9, u.exptime,
10, u.exptime,
decode(u.ptime, '', to_date(NULL),
decode(pr.limit#, 2147483647, to_date(NULL),
decode(pr.limit#, 0,
decode(dp.limit#, 2147483647, to_date(NULL), u.ptime +
dp.limit#/86400),
u.ptime + pr.limit#/86400)))),
dts.name, tts.name, u.ctime, p.name,
nvl(cgm.consumer_group, 'DEFAULT_CONSUMER_GROUP'),
u.ext_username
from sys.user$ u left outer join sys.resource_group_mapping$ cgm
on (cgm.attribute = 'ORACLE_USER' and cgm.status = 'ACTIVE' and
cgm.value = u.name),
sys.ts$ dts, sys.ts$ tts, sys.profname$ p,
sys.user_astatus_map m, sys.profile$ pr, sys.profile$ dp
where u.datats# = dts.ts#
and u.resource$ = p.profile#
and u.tempts# = tts.ts#
and u.astatus = m.status#
and u.type# = 1
and u.resource$ = pr.profile#
and dp.profile# = 0
and dp.type#=1
and dp.resource#=1
and pr.type# = 1
and pr.resource# = 1
SQL> desc dba_users
Name Null? Type
USERNAME NOT NULL VARCHAR2(30)
USER_ID NOT NULL NUMBER
PASSWORD VARCHAR2(30)
ACCOUNT_STATUS NOT NULL VARCHAR2(32)
LOCK_DATE DATE
EXPIRY_DATE DATE
DEFAULT_TABLESPACE NOT NULL VARCHAR2(30)
TEMPORARY_TABLESPACE NOT NULL VARCHAR2(30)
CREATED NOT NULL DATE
PROFILE NOT NULL VARCHAR2(30)
INITIAL_RSRC_CONSUMER_GROUP VARCHAR2(30)
EXTERNAL_NAME VARCHAR2(4000)
SQL>
[pre] -
Can't select from view even though it appears in ALL_VIEWS
Oracle's documentation states that all_views "describes the views accessible to the user":
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2117.htm
DBA_OBJECTS appears in the ALL_VIEWS, yet I get a "table or view does not exist" error when I try to select from it.
Any thoughts on why this is happening?
SQL> SELECT COUNT(1)
FROM all_views
WHERE owner = 'SYS'
AND view_name = 'DBA_OBJECTS'
COUNT(1)
1
1 row selected.
SQL> SELECT *
FROM sys.dba_objects
SELECT *
FROM sys.dba_objects
Error at line 2
ORA-00942: table or view does not existThat's not standard behaviour:
DBA >create user u1 identified by u1;
Utente creato.
DBA >grant connect to u1;
Concessione riuscita.
DBA >conn u1/u1
Connesso.
DBA >select count(0) from all_views;
COUNT(0)
856
DBA >select view_name from all_views
2 where view_name like 'DBA%'
3 or view_name like 'V$%';
VIEW_NAME
DBA_PROCEDURES
DBA_PUBLISHED_COLUMNS
V$OBJECT_USAGE
DBA >select 'select count(*) from '||owner||'.'||view_name||';'
2 from all_views
3 where view_name like 'DBA%'
4 or view_name like 'V$%';
'SELECTCOUNT(*)FROM'||OWNER||'.'||VIEW_NAME||';'
select count(*) from SYS.DBA_PROCEDURES;
select count(*) from SYS.DBA_PUBLISHED_COLUMNS;
select count(*) from SYS.V$OBJECT_USAGE;
DBA >select count(*) from SYS.DBA_PROCEDURES;
COUNT(*)
6793
DBA >select count(*) from SYS.DBA_PUBLISHED_COLUMNS;
COUNT(*)
0
DBA >select count(*) from SYS.V$OBJECT_USAGE;
COUNT(*)
0All the DBA* or V$ visible are also accessible, DBA_OBJECTS is not present in ALL_VIEWS.
There's something strange on your user's priviledges...
Max
[My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/01/02/query-gerarchiche/] -
ORA-01017: invalid username/password through dblink when select from view
Hello all,
I work on 2 databases :
- One is a 10g (let's call it db_10 )
- The second one is a 11g (let's call it db_11 )
I created a view V_PROTOCOLES in schema SCHEMA_1 on db_11.
The FROM clause of this view call 4 tables :
- table1 : owner is SCHEMA_1
- table2 : owner is SCHEMA_2 (schema on db_11 )
- table3 : owner is SCHEMA_3 (schema on db_10 )
- table4 : owner is SCHEMA_4 (schema on db_10 )
When I simply run SELECT * FROM V_PROTOCOLES on db11 with user X, I can have a result.
The problem occurs when I connect on db10 also with user X. The V_PROTOCOLES view has a public synonym using the dblink DBDOC_LINK (without explicitly specify a user, so it connects with the X user).
But here I can't run the SELECT * FROM V_PROTOCOLES. I Have the following error :
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from DBDOC_LINKThe passwords for user X are obviously the same on both 10g and 11g databases.
Thanks for the help !On 10g :
select password from dba_users where username = 'U872574';
PASSWORD
30811840BC618B77On 11g :
select password from sys.user$ where name='U872574';
PASSWORD
30811840BC618B77I dropped and recreated the dblink but the problem always occurs...
(By the way, curiously when I dropped the dblink I have no invalid objects although it is used in different packages or triggers) -
Callback function is called with sys user context.
1. Create AQ Queue table
2. Create AQ Queue "MyQueue"
3. Start Queue "MyQueue"
4. Register "Subscriber1"
5. Register "MyQueue"."Subscriber1" with Notification URL : PLSQL:\\Mypackage.SP_Callback
Till here everything is fine...
6. Enqueue message into "MyQueue" with "Subscriber1" as recipient.
7. Now AQ notification is fired and as a result Its calling "Mypackage.SP_Callback".
Here the problem is "Mypackage.SP_Callback" is called from SYS user context. i.e if i capture the dbuser its "SYS" who is invoking the AQ notification call back method, "Mypackage.SP_Callback".
Do i have any settings so that "Mypackage.SP_Callback" is called with a specific user account instead of "SYS".
Please help me...
Edited by: user13421038 on Jun 30, 2011 5:06 AMHello,
From what is mentioned in this thread this issue is the same as that discussed in Note 552771.1. The issue should be resolved in 10.2.0.4 and 11.1.0.6 onwards.
Thanks
Peter -
Modify an text area on selecting from the cfselect
Hi,
New to CF.
How to modify an text area on selecting from the cfselect?
In fact, geting what user selected and displaying in the text
area.
Thanks.solved.
<script type="text/javascript">
function addText(text){
document.getElementById('idofthetextarea').value = text;
</script>
<select name="combo" id="combo"
onchange="JavaScript:addText(combo.value)">
hope it helps for others.
Thanks for your support. Really appreciate it.
"Adrian C." <[email protected]> wrote in message
news:ejvmk2$b5q$[email protected]..
> Hi,
>
> New to CF.
>
> How to modify an text area on selecting from the
cfselect?
> In fact, geting what user selected and displaying in the
text area.
> Thanks.
> -
Blocking Session - blocked SQL - SELECT SYSDATE FROM SYS.DUAL
Oracle 10.0.0.4g
When database execute some big and long queries/operations my system is slow and some users wait, can’t work (they work with some Oracle forms applications ) because I often have blocking session.
I found up that this blocking sessions block only this query of another user:
SELECT SYSDATE FROM SYS.DUAL
Or:
+10-АВГ-2009 08:51:10 User X1 ( SID= 222 ) with the statement: SELECT ... is blocking the SQL statement on Y1 ( SID=333 ) blocked SQL -> SELECT SYSDATE FROM SYS.DUAL+
When I kill one of the blocking session another session take his place and do the same:
+10-АВГ-2009 08:53:10 User X2 ( SID= 444 ) with the statement: SELECT ... is blocking the SQL statement on Y2 ( SID=555 ) blocked SQL -> SELECT SYSDATE FROM SYS.DUAL+
When long queries finished everything is OK.
Please Help Me!!!I create ASH report:_
Top User Events
Avg Active
Event Event Class % Activity Sessions
enq: TM - contention Application 55.87 0.96
db file sequential read User I/O 18.87 0.32
CPU + Wait for CPU CPU 16.33 0.28
db file scattered read User I/O 3.02 0.05
Top Event P1/P2/P3 Values
Event % Event P1 Value, P2 Value, P3 Value % Activity
Parameter 1 Parameter 2 Parameter 3
enq: TM - contention 55.87 "xxxxxxxxxxxxxxxxxxxx" 38.35
name|mode object # table/partition
"1111111111","xxxxxxx","0" 17.44
db file sequential read 19.21 "xxxxxxxxxxxxxxx’’ 0.00
file# block# blocks
db file scattered read 3.03 "xxxxxxxxxxxxxxxxxxxxxx’’ 0.01
file# block# blocks
Top SQL Statements …………..
SQL ID Planhash % Activity Event % Event
fnxxxxxxxxx N/A 25.09 enq: TM - contention 23.47
** SQL Text Not Available **
N/A 25.09 db file sequential read 1.19
** SQL Text Not Available **
byxxxxxxxxxxxxx 1111111 10.11 enq: TM - contention 7.43
SELECT SYSDATE FROM SYS.DUAL
db file sequential read 2.10
fnxxxxxxxxx 11111111111 2.57 enq: TM - contention 2.16
** SQL Text Not Available **
Top DB Objects
Object ID % Activity Event % Event
Object Name (Type) Tablespace
11111 10.33 enq: TM - contention 10.30
XXXXXXXXXXXXXXXXXXXXXXXX (INDEX) CC
99999 10.18 enq: TM - contention 10.16
XXXXXXXXXXXXXXXXXXXXXXXXX (INDEX) IND
933333 6.67 enq: TM - contention 6.55
FFFFFFFFFFFFFFFF (TABLE) T3
114545 3.88 enq: TM - contention 3.85
RRRRRRRRRRRRRRRRRRRRRR (INDEX) JJJ
1136664 2.96 enq: TM - contention 2.93
FFFFFFFFFFFFFFFFFFFFFFFFF (INDEX) G
How to found sql text that is not available ** SQL Text Not Available **?
What to do whit this Top DB Objects that have enq: TM - contention event?
And how to solve this problem? -
Select 'x' from sys.trigger$ t
HI all,
I am running adadmin and it's failed on worker01 and checking the log file I saw
and not exists ( select 'x' from sys.trigger$ t
ERROR at line 25:
ORA-00942: table or view does not exist
this error.can some one help me how to fix this.
Regards
AJust wonder If you have sorted out the issue?
If not you can try to run the script assigned to the particular worker manualy in morder to reproduce the problem, then try to understand that is wrong by analizing the script.
If yes can you please update as what was the problem?
Yury
Check this out:
A.
http://www.freelists.org/archives/ora-apps-dba/05-2006/msg00000.html
B.
- Users can subscribe to your list by sending email to
ora-apps-dba-request_at_freelists.org with 'subscribe' in the Subject field
C.
http://www.freelists.org/archives/ora-apps-dba/05-2006/threads.html -
Selecting from a function that returns a sys refcursor or an alternative
I have a query that returns a resultset of three columns, namely SSN,PAID_YEAR and PAID_TOTAL. From this query I can:
Create a view and then query it.
Create a function and return resultset
If I go the first way a simple query like the following takes more than 20 seconds:
SELECT PAID_YEAR,PAID_TOTAL FROM VIEW_1 WHERE SSN=12345678912882;
I know that is because when I query a view the engine first brings all the rows of the view and then it filters the rows for the criteria supplied.
If I go the second way I can send a parameter and make the engine look only for those rows that match the condition and return the recordset. But I do not know how to then SELECT from that returned resultset. I took a look at pipelined tables but didn't quite get how to benefit them. So my ultimate question is if it's somehow possible to select from the resultset that is returned from a function like this:
SELECT * FROM FUNCTION_1(12132323232).
If yes, then how, if no, what would be an alternative way?I know that is because when I query a view the engine first brings all the rows of the view and then it filters the rows for the criteria supplied.
No - you don't 'know that' because it isn't true. Just check the explain plan for yourself. Oracle can still use any appropriate indexes so that only the rows needed are returned.
So my ultimate question is if it's somehow possible to select from the resultset that is returned from a function like this:
SELECT * FROM FUNCTION_1(12132323232).
No - you can't do it like that. You have to use the TABLE function to treat the function result set as a table:
'SELECT * FROM TABLE(FUNCTION_1(12132323232)).
-- type to match emp record
create or replace type emp_scalar_type as object
(EMPNO NUMBER(4) ,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7, 2),
COMM NUMBER(7, 2),
DEPTNO NUMBER(2)
-- table of emp records
create or replace type emp_table_type as table of emp_scalar_type
-- pipelined function
create or replace function get_emp( p_deptno in number )
return emp_table_type
PIPELINED
as
TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
emp_cv EmpCurTyp;
l_rec emp%rowtype;
begin
open emp_cv for select * from emp where deptno = p_deptno;
loop
fetch emp_cv into l_rec;
exit when (emp_cv%notfound);
pipe row( emp_scalar_type( l_rec.empno, LOWER(l_rec.ename),
l_rec.job, l_rec.mgr, l_rec.hiredate, l_rec.sal, l_rec.comm, l_rec.deptno ) );
end loop;
return;
end;
select * from table(get_emp(20)) -
0
SELECT O.Name as ProcName
,M.Definition as CreateScript
,O.Create_Date
,O.Modify_Date
FROM sys.sql_modules as M INNER JOIN sys.objects as O
ON M.object_id = O.object_id
WHERE O.type = 'P'
--Procedure
--WHERE O.type = 'V' View
--WHERE O.type = 'FN' Function
How can I join this to sys.dm_exec_query_stats to
get the execution_count?You can join to sys.dm_exec_procedure_stats using object_id for procedures in cache and get execution count
http://msdn.microsoft.com/en-in/library/cc280701(v=sql.110).aspx
for ones not in cache you need to use logic like below
SELECT O.Name as ProcName
,M.Definition as CreateScript
,O.Create_Date
,O.Modify_Date
,QS.execution_count
FROM sys.dm_exec_query_stats AS QS
CROSS APPLY sys.dm_exec_sql_text(QS.sql_handle) t
INNER JOIN sys.sql_modules as M
ON M.object_id = t.objectid
INNER JOIN sys.objects as O
ON M.object_id = O.object_id
WHERE O.type = 'P'
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Maybe you are looking for
-
Do I have spyware on my iMac?
I'm wondering if my computer has been infected with spyware. I had McAfee on my pc but no protection on my Mac as I was told Macs don't need it. I read about Clamxav on this site yesterday and installed it and scanned my hard drive but it didn't unco
-
Downloading completed materials to store on another server
Hi - I want to know if I can download completed materials from the Adobe cloud and post them on a server behind our business firewall to share with employees. I am specifically interested in an InDesign document that has embedded video converted to a
-
I Need Help In Deleting Table row by clicking on "Delete" button inside the
Dear all, first i'm new to Swing i have created table with customized table model, i fill this table using 2d array, this table rows contains JButtons rendered using ButtonRenderer.java class and action listeners attached by the AbstractButtonEditor.
-
N95 Wifi WPA connection problem
I recently bought the Nokia N95 and everything is working except the wifi WPA part. I DL the latest firmware (v20.0.015) but that didn't help. Everytime i connect with my home wifi lan it asks for a password. It doesn't matter what password i try it
-
How can I add the iPad cover lock option to the iPad 2?
The iPad cover lock option doesn't come up on my settings on my iPad 2. How can I add it?