欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

How to Remote Access Oracle DB

程序员文章站 2024-02-14 20:49:58
...

When you install Oracle DB, the default hostname is localhost. However, we cannot access this DB by other hosts. So how to config to help the remote visitors to access the ODB. What we need to do is to change the hostname of ODB in Linux.

When you install Oracle DB, the default hostname is localhost. However, we cannot access this DB by other hosts. So how to config to help the remote visitors to access the ODB.

What we need to do is to change the hostname of ODB in Linux.

So first, we need to login our host and go to the path of Oracle DB home.

How to Remote Access Oracle DB

Under the path of DB, go to the network / admin, we can find listener.ora and tnsnames.ora these two files. The host info is stored in these files.

Go into these two files to change the value of hostname and value of service name.

How to Remote Access Oracle DB

After do --- vim listener.ora, we need to modify HOST value from localhost to your host address.

How to Remote Access Oracle DB

After do -- vim tnsnames.ora, the value of HOST and SERVICE_NAME.

How to Remote Access Oracle DB

After we exit from vim, we have to open the DB server listener.

Go to the bin folder under dbhome_1, do-- setenv ORACLE_HOME (dbhome_1 pwd)

-- setenv ORACLE_SID orcl

How to Remote Access Oracle DB

Under bin folder, we can run sqlplus and lsnrctl to verify the DB listener is open.

How to Remote Access Oracle DB

How to Remote Access Oracle DB

When the status of listener is open, that means other host can access this host DB. Right now you can use sql developer to try it. GOOD LUCK!!