Why trigger name is showing some object name [duplicate] - oracle

This question already has answers here:
How to delete trigger in oracle that contain special character?
(1 answer)
What are the BIN$... tables in Oracle's ALL_TAB_COLUMNS table?
(1 answer)
How to remove a strange table named "BIN$c+eOnMB3RbKSEfg/rsxtAQ==$0" from oracle database?
(1 answer)
Closed 3 years ago.
I have some trigger in a table but the trigger name is showing some object name instead of original trigger name:
select * from user_triggers where table_name='NVT_VEHICLE';
Trigger name:
BIN$j1ygh/CFFDXgVWVB5LsGMg==$1
BIN$j1ygh/CEFDXgVWVB5LsGMg==$1
NVT_LOG_TRIG

These weird names are the name of the objects which are dropped by the user. You can get the original names of the objects from a table: USER_RECYCLEBIN
USER_RECYCLEBIN displays information about the recycle bin owned by the current user.
It contains ORIGINAL_NAME and OBJECT_NAME of the recycled objects.
In your case, you can try this query
SELECT
*
FROM
USER_RECYCLEBIN
WHERE
NAME IN (
'BIN$j1ygh/CFFDXgVWVB5LsGMg==$1',
'BIN$j1ygh/CEFDXgVWVB5LsGMg==$1'
);
Cheers!!

Related

Schema permission giving on all tables in Oracle [duplicate]

This question already has answers here:
Grant Select on all Tables Owned By Specific User
(5 answers)
Closed 5 years ago.
I am trying to give schema permissions on all tables in a single instance.
For example, I am in Schema A, and I need to access the tables in Schema A from Schema B.
I tried to grant select on A. * to B and I am getting an invalid table name.
Any idea why I'm getting this error?
Afaik, there's not a direct way to do this. The easiest shortcut I know is to run something like
select 'grant select on A.' || table_name || ' to B;'
from user_tables;
And then copy/paste the results and run that.

Oracle Metadata - How can I get table create date? [duplicate]

This question already has answers here:
How to find out when a particular table was created in Oracle?
(5 answers)
Closed 6 years ago.
Is there any Oracle metadata table that show me the created date from a specific table?
Try this:
select object_name, created
from user_objects
where object_type = 'TABLE'
and object_name = '...'
You can user all_objects or dba_objects instead of user_objects, depending on your privileges and on the users you are interested in

how to see function body through dblink using select text from all_source query [duplicate]

This question already has answers here:
How can I create a table as a select from another database in Oracle?
(4 answers)
Closed 8 years ago.
I am using following query to get details of function (which is on another database) through dblink
SELECT text
FROM all_source
where name = 'FUN_INSERT_XXDETAIL#XXDBLINK'
order by line;
You are using the database link at the wrong place.
SELECT text
FROM all_source#XXDBLINK
WHERE NAME = 'FUN_INSERT_INTERFACEDETAIL'
order by line;

ORA-01537. i want to search where the file is included, again [duplicate]

This question already has an answer here:
ORA-01537. i want to search where the file is included
(1 answer)
Closed 8 years ago.
i asked this question. but i can't solve. i want to ask again.
SQL> alter tablespace java add datafile 'd:/programming/java.dbf';
*
ERROR at line 1:
ORA-01537: cannot add file 'd:/programming/java.dbf' - file already part of database
SQL> select TABLESPACE_NAME, FILE_NAME,STATUS
from dba_data_files
where UPPER(FILE_NAME) like '%JAVA.DBF';
no rows selected.
i just want to know the statement searching where the file is included.
my oracle is 11g.
Do you have a temporary tablespace using a tempfile with the name java.dbf?
Check with:
select file_name, tablespace_name, status from dba_temp_files;
If the datafile resides within temporary tablespace, it on show up when you query dba_data_files, therefore yes, the file may already exists.

How to retrieve the last inserted record in Oracle [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to get the last row in a table - Oracle 11g?
I would like to know how we can get the last inserted record values back as I want to retrieve and see the details that are inserted at last in the table
insert into mytable (...) values (...)
returning id into v_id;
If you have a primary key:
select * from YOURTABLE
where primary_key=(select max(primary_key) from YOURTABLE)

Resources