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_db_link
CONNECT TO scott IDENTIFIED BY tiger
USING '192.168.128.135:1521/db11g'; ---(use ip address or host_name which you specified in listener file)
SQL>select * from test@test_link;
COUNT(*)
----------
10
********END*************
Subscribe to:
Post Comments (Atom)
The instance '****.**.**:3306' cannot be added to an InnoDB cluster because it has asynchronous (source-replica) replication channel(s) configured. MySQL InnoDB Cluster
Error : MySQL JS > dba.checkInstanceConfiguration("root@192.*.*.*") NOTE: Found unexpected replication channel '...
-
WARNING: 2019-06-15 06:40:03 WARNING OGG-02045 Database does not have streams_pool_size initialization parameter configured. Solut...
-
Error : ERROR: trailing junk after numeric literal at or near Solution: Enter/specify the parameter value in "" Example: pos...
-
error Details : SQL> alter user C##GGATE default tablespace GGUSER; alter user C##GGATE default tablespace GGUSER * ERROR at line ...
No comments:
Post a Comment