Oracle Find Table or View or MV References [duplicate] - oracle

This question already has an answer here:
Oracle query that will list of the database objects referenced by a view
(1 answer)
Closed 8 years ago.
Problem:
when I look at a table, or view or mv, I wonder where this table is being used within the database itself. it has the following possibilities:
update or manipulated through a package
update through a procedure
join or referenced with other tables, views or mvs
called by another database through a DB link
I Java, especially in IDEA like eclipse or netbeans, ctl+shift+g would give you all the
reference on a object.
how do we achieve this is Oracle.

You may try dba_dependencies (or all_dependecies depending on your privileges) for table references, or search the text field in dba_source for package details.

Related

Oracle migrate data from one database to another [duplicate]

This question already has answers here:
Copy database to the local machine - ORACLE
(2 answers)
Closed last month.
How to copy data from one data base to another database table using script like procedure, cursor etc.
I am using oracle-sql developer.
Doing it using a script like procedure, cursor etc. is not the way to do it. Oracle offers Data Pump export and import utilities which are designed to move data around, so I'd suggest you to use them.

Restore the truncated table data in Oracle [duplicate]

This question already has an answer here:
Use of FLASHBACK in Oracle
(1 answer)
Closed 6 years ago.
I am new to Oracle Advance concepts, In my application I have accidentally "truncate" the data. I am facing difficulty to
restore the truncated data. I googled about it alot, I found there is "FLASHBACK" command from oracle 10g. I tried it using timestamp approach in flashback
but I am getting the following error:
Error: The table definition has changed.
Could any body tell me how to get back my truncated table data?
Is it possible? If it is Please let me know the procedure to get back the data.
The error message is pretty clear. FLASHBACK is not available if you had DDL operations on the table (add or drop column, add or drop constraint, etc.) It's right there in the first paragraph in the documentation. http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9012.htm As Tim suggests - this is where backing up your data would have helped.
Edit: To be very precise, the wording in the Oracle documentation is (with my emphasis): Oracle Database cannot restore a table to an earlier state across any DDL operations that change the structure of the table. So adding or dropping a column will prevent the use of FLASHBACK since they change the structure of the table. TRUNCATE does not, so TRUNCATE by itself does not prevent FLASHBACK (although TRUNCATE is a DDL operation). I got carried away in the first paragraph with "add or drop constraint" - I actually don't know if that will prevent FLASHBACK; one can find out by experimenting.

Can EF6 use oracle database links?

We have a legacy app that I am rewriting in .net. All of our databases are oracle and make use of database links. Is there any way for Entity Framework 6 to generate models based on tables located on a different database?
Currently the legacy app gets data from table like this
SELECT * FROM emp#foo2;
where its db connection is to database foo that has a database link to the database foo2.
I would like to reproduce this using EF6. So far all I have found regarding this is this question.
You can do two things that EF 4 or higher will work with:
CREATE VIEW EMP as SELECT * FROM emp#foo2;
CREATE MATERIALIZED VIEW EMP as SELECT * FROM emp#foo2;
LOBS are not accessible across a database link without some contorted PL/SQL processing to read the LOB piece by piece.
I believe fast refresh does not work across database links so you must consider the size of the table on the linked database. If you are refreshing a million rows you may find the time to do this is an issue. Most large tables are full of tombstone data that never changes so a timestamp column with the last modified date could help you create a package that only picks out the changed data.
If you are doing complicated joins for either ensure that Oracle considers the column that would be the primary key as not null.
You can add a primary key on views and materialized view but it must be disabled. See here for details.

Generate upgrade script to ALTER TABLE based on CREATE TABLE statement in Oracle [duplicate]

This question already has answers here:
Automated Oracle Schema Migration Tool [closed]
(5 answers)
Closed 7 years ago.
Is it possible in Oracle to generate a bunch of ALTER TABLE statements based on existing table in schema plus CREATE TABLE statement with newer definition of that table?
Let's say I have a schema with some previous version of an application. I have an installation script for newest version of the application. The script creates all tables and sequences from scratch performing CREATE TABLE (and probably CREATE SEQUENCE) statements.
I'd like to update the schema to the newest version of the application without loosing any data (e.g. without performing DROP TABLE).
Is it possible with using of standard Oracle 11gR2 or third party components?
You can try CORT : www.cort.tech
https://github.com/cort-master/cort
It's free
You can create a procedure in PLSQL to:
create new table when it not exists in new DB
alter table when it exists, feeding it with ALL_TAB_COLUMNS

Oracle procedure to update multiple values in single instance [duplicate]

This question already has answers here:
displaying Oracle table's column names
(2 answers)
Closed 8 years ago.
Is there a procedure I can run to search all tables to see to search a particular column? I need to update a particular string present in that column in all tables whereever applicable. There are too many tables to open each one and do a find on the value(s) I'm looking for.
This should help you find the tables which contain your columns:
SELECT TABLE_NAME
FROM USER_TAB_COLUMNS
WHERE COLUMN_NAME='your_column_name';
After that you can execute updates for each table that you have.
I didn't understand your question completely, so I hope this helps you ;)

Resources