when we want to access data from different database that time we use database link through service name to access particular data.so my this post is for to create database link without change in to tnsname.ora file that means without using service name.
Example:-
Targate Database: orcl
Source Database : test
1)target database
SQL>create user test
identified by test
default tablespace test;
SQL>grant connect,resource to test;
SQL> connect scott/tiger;
SQL> create table test(id number);
SQL>begin
for i in 1..10 loop
insert into test values(i);
end loop;
end;
/
SQL> commit;
SQL> select count(*) from test;
COUNT(*)
----------
10
SQL>
2)Source Database
SQL> create database link test_link
connect to test identified by test
using using
'(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.128.135)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = db11g)
)
)' ;
SQL>select * from test@test_link;
COUNT(*)
----------
10
********END*************
Subscribe to:
Post Comments (Atom)
Login to the database as user C##GGUSER failed because of error Error while trying to retrieve text for error ORA-01804.
Error : 2026-09-19 11:28:18 ERROR OGG-00303 Unable to connect to database using user C##GGUSER@CDB. Ensure that the necessary privileg...
-
OS Details: [oracle@target ~]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.6 (Maipo) [oracle@target ~]$ ...
-
error Details : SQL> alter user C##GGATE default tablespace GGUSER; alter user C##GGATE default tablespace GGUSER * ERROR at line ...
-
Error Details: OGG-14054 Lag from heartbeat table requires DBLOGIN . GGSCI (source.example.com) 5> lag EXTRACT0 2019-07-31 0...
No comments:
Post a Comment