Database Chain Application Instance: Import the data in the Oracle7 database of a machine to another machine Oracle9i?

xiaoxiao2021-03-06  61

Two database servers: 192.168.16.38 Oracle7 192.168.16.34 with Oracle9i is now imported into the database on 16.38 to go to the database on 16.34, without IMP and EXP, how to do?

1. The base table structure on 16.38 is exported in PowerDesigner 7.5, including views, functions, triggers, sequences, and the like. Tools -> EXPORT User Objects -> EXPORT2, the exported script runs in SQLPLUS of 16.34, establishing a base table structure. 3, VI $ Oracle_Home / Network / Admin / TNSNames.ora Configuring the TNSNames.ora file on 16.34, enabling SQLPlus on 16.34 to link to Oracle7 databases on 16.38, assuming link to 16.38 TNS Name is CTGPC1638, plus the following code : Ctgpc1638 = (description = (address_list = (pecol = tcp) (host = 192.168.16.38)) (connect_data = (sID = orcl))) 4, run SQLPLUS on 16.34, establish Database Chain: CREATE DATABASE LINK FROM1638 // from1638: DB chain name, use it when using it, you need to set the global-name = true in the init.ora file first. Connect To UserName Identified by Password // UserName and Password are user names and passwords for remote databases Using 'CTPGC8834' // Connecting strings, TNS Name / 5 configured in tnsnames.ora in 16.34, type: SQLPLUS in 16.38: SELECT 'INSERT INTO' || TNAME || 'SELECT * from' || TNAME || '@ from1638;' from Tab; 6, put the screen results below, put it in UltraEdit, and organize into a pure script, as shown below : INSERT INTO CODE_TABLES SELECT * from code_tables @ from1638; 7, you can insert the data in SQLPLUS generated on 16.34. You can insert data. 8. The above script may contain a data insert statement with a view, this time you don't have to import the view structure with another script, because it is a view without inserting data. 9. Some descriptions about the database chain: 1) When using a database chain, you should establish a database chain first. 2) When using, the DB chain name should be used instead of the connection string. 3) When using the DB chain name, the "@" symbol should be added before. 4) When an ORA-02085 error occurs, set the global-name = false in the init.ora file, which is available. Global-names = TRUE will have the same name as the original DB, that is, the above database chain name cannot be set to the FROM1638, and should be the same as the SID of 16.38.

转载请注明原文地址:https://www.9cbs.com/read-112770.html

New Post(0)