Updating an Oracle Database from another. [message #858] |
Fri, 08 March 2002 20:52 |
AbySmith
Messages: 2 Registered: March 2002
|
Junior Member |
|
|
Hi,
I have an application which has a database of it's own.
This app maintains certain details in a certain table.
I would like to write a trigger which would insert all records inserted into this table to be inserted into a similar table in another database.
Is this possible ?. if so how ?
Regards,
Aby
|
|
|
Re: Updating an Oracle Database from another. [message #869 is a reply to message #858] |
Sun, 10 March 2002 15:27 |
seng
Messages: 191 Registered: February 2002
|
Senior Member |
|
|
This method is using database link and synonym.
1. Create a public database link to other database.
e.g
CREATE PUBLIC DATABASE LINK dbname
CONNECT TO username IDENTIFIED BY password
USING 'hostname';
2. Create a public synonym on this table from database link .
e.g
CREATE PUBLIC SYNONYM synonymname
FOR tablename@dbname;
3. Create the trigger. The database is select,insert and update into this synonym.
Note:
- makesure database link is not caused some security problem because all the user can used this database link. The solution is to create database link under a user and create a public synonym by user.
Hope this is helping.
|
|
|