How can I move the data from all fields (*) and all tables from db1 to db2 with Oracle ?
You have two choices:
use exp and imp (or, if using 10g or later, expdp and impdp);
use a database link.
As you don't tell much about your environment etc, this is as close an answer as it gets...
Related
Let say, I am connected to two different databases (one SQLite and one Oracle) over ODBC in one program. Is it possible to execute a query on one database and insert the resultset as a new table in the second database directly by just passing something like a data cursor, i.e. without the hurdle to create insert statements with explicit values from the result set and executing those on the destination database?
As far as I am aware you cannot do that. You can use something like a join engine to do it (e.g., http://www.easysoft.com/products/data_access/odbc_odbc_join_engine/index.html) but it might be overkill if you are doing it just the once.
If you use Oracle then you can use Oracle Heterogeneous Services which can work with ODBC sources. Have a look at: http://www.dba-oracle.com/t_heterogeneous_database_connections_sql_server.htm
I have a local (read and write) sqlite database and a remote (read-only) oracle database. I use ODBC to access both DBs (I use an application to access the DBs by ODBC and query as such: EXECUTE-QUERY SQLITE "SELECT ..." or EXECUTE-QUERY ORACLE "SELECT ...") . I tried searching the net for a way to be able to perform one query joining tables from the 2 databases, but all I find is how to create a database link from oracle to other DBs but that doesn't help me because I have no write priviledges for the Orcale DB so creations of database links, databases, tables, views are not allowed in ORACLE, all I can do is query there. Is there an efficient way to do this with the restraints that I have?
How big are the tables in oracle? Given the limits of the access you have and the technology you are working with ( sqlite and oracle are worlds apart ), your best bet would probably be to export the tables from oracle into sqlite, then do your queries all within that.
Finally I installed Oracle express edition and created a database link to the other (read-only) oracle database. That worked great.
I have 2 databases and want to implement triggers on table update of database1 to do do some updates on database2's tables.
Example:
db1 has a table 1t1
db2 has a table 2t1
on inserting a touple into 1t1 i want to insert corresponding touple into 2t1
As of now Im using postgresql, but I dont mind switching to other free databases.
How to achieve this?
I suggest to use database link to establish a connection between two remote DB.
Take a look to this page:
http://www.postgresql.org/docs/current/static/contrib-dblink-connect.html
There is also a good tutorial here:
http://www.postgresonline.com/journal/archives/44-Using-DbLink-to-access-other-PostgreSQL-Databases-and-Servers.html
bye,
Andrea
If you could replace databases with schemas everything becomes easy.
Possibility of such replacement depends on why you have chosen databases as organisational units.
Postgresql 9.1 has a new feature called "foreign table":
http://www.postgresql.org/docs/9.1/static/sql-createforeigntable.html
Does that help maybe?
All, is there any means by which it is possible to connect to two separate MySQL databases and execute SQL statements to interact with both?
The aim would be to query DB 1 on connection 1 and insert the results into DB 2 on connection 2.
Is it possible to do this using the MySQL query browser?
I suppose there are two ways how to do this.
the first is manual : DB dump : " SELECT * INTO OUTFILE 'authors090308.sql' FROM authors; " and then "LOAD DATA INFILE 'authors090308.sql' INTO TABLE authors;" (you also need to specify some other parameters as to delimiting columns etc.) or by some other "database dump", where data goes into file the way you want. In between you must switch database manually to the second one.
the second is programmatic : with programming language : Then you need to just open two connections to the databases and realize the statements you need. I don't know if it is what you mean, you'd need to be more specific.
Anyway, you need a connection to a DB server, either via mysql client, oracle sql developer, mysql workbench or via mysql adapter/driver of a programming language. What you need, is the "glue" between 2 connections, which is the programming language. It's either a programming language or a file data is dumped into and back again.
I'm sorry but I don't thing there are any other ways of doing this...as to the first way, you can only get the output from a database and either use mysql pager and pipe the output somewhere (a file perhaps), or SELECT * INTO OUTFILE, mysqldump, mysqlhotcopy etc.
I would like to copy parts of an Oracle DB to a SQL Server DB. I need to move the data because the Oracle box is being decommissioned. I only need the data for reference purposes so don't need indexes or stored procedures or contstaints, etc. All I need is the data.
I have a link to the Oracle DB in SQL Server. I have tested the following query, which seemed to work just fine:
select
*
into
NewTableName
from
linkedserver.OracleTable
I was wondering if there are any potential issues with using this approach?
Using SSIS (sql integration services) may be a good alternative especially if your table names are the same on both servers. Use the import wizard via and it should create the destination tables for you and let you edit any mappings.
The only issue I see with that is you will need to execute that of course for each and every table you need. Glad you are decommissioning the oracle server :-). Otherwise if you are not concerned with indexes or any of the existing sprocs I don't see any issue in what you are doing.
The "select " approach could be very slow if tables are large. Consider writing pro*C in that case or use Fastreader http://www.wisdomforce.com/products-FastReader.html
A faster and easier approach might be to use the Data Transformation Services, depending on the number of objects you're trying to copy over.