Configure Oracle 11g Database in Oracle Linux 6 - database

For the last 2 days I've been trying to configure Oracle DB 11g in Oracle Linux 6. It has successfully installed but I can't create a database.
I have created the listener and tnsnames and tried to startup the database with the following commands:
sqlplus /nolog
connect / as sysdba
startup
And I'm getting the following errors:
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=beta)(PORT=1521))'
Here my listener and tnsnames config:
listener.ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/oracle)
)
)
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_ORCL = /home/oracle/app/oracle
tnsnames.ora:
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
Any ideas?

Did you set your environment variables up per the installation instructions? In particular, you'll need ORACLE_SID, ORACLE_BASE, ORACLE_UNQNAME, ORACLE_HOME (remember that case is significant on Linux). Also, if you didn't create a database as part of the installation, you'll need to run the database creation assistant (dbca).

I only need an environment for development purposes so I've download a template VM from Oracle site's and instantiated using Virtual Box. The template is configured and it's database is running ok.

Oracle looks for the "beta" hostname, and all your settings pinpoint to localhost. Try adding an entry in
/etc/hosts
with the following line:
127.0.0.1 beta
and try starting it up again

Related

ERROR 12545 : Connect failed because target host or object doesn't exist while trying to connect sqlplus

I want to install oracle instant client but I have been stuck while I was trying to remote DB. I always got error ORA-12545, but my oracle DB is active and works fine.. i already started listener and config /etc/host on both side.
Here's my tnsnames.ora configuration on Oracle Database server:
ROLFSAN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ullabritta)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rolf)
)
)
and here's my tnsname.ora configuration on oracle instant :
SVEN = -- i give this name as i wish, there's no sven on oracle database
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ullabritta)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = rolf)
)
)
did i do something wrong? or there's specific configuration on oracle database server??
Use the IP address, not the hostname. Oracle client uses DNS to resolve the name, and may not use the hosts file.
You can put the connect description in one line and verify
sqlplus user/pass#(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ullabritta)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=rolf)))
Next, make sure your client is picking up the tnsnames.ora file utilizing strace. strace will output all system-calls your client is doing.
strace sqlplus user/pass#TNS_ALIAS
You can place the tnsnames.ora file anywhere you like on the filesystem. The environment variable TNS_ADMIN overrides any default location.
cat > tnsnames.ora <<EOF
MY_ALIAS=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ullabritta)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=rolf)))
EOF
export TNS_ADMIN=./
sqlplus user/pass#MY_ALIAS
Best of luck!

Cannot access table in oracle after creating dblink

I am trying to create a dblink in oracle but,it is showing me error.
I have a databas orcl1 and I want to connect to another database etlsr which I created next database.
Inside this etlsr database I created a simple table name person inside sys and inserted a data.
Now,i again connect to orcl1 and wanted to connect to etlsr database but it was not happening as I tried
select * from person#ETLSR;
But it throwed me error as:
*
Error at line 1
ORA-02019: connection description for remote database not found
So,i think to create a db link so,I tried :(I tried these from orcl1)
CREATE DATABASE LINK sales
CONNECT TO sys IDENTIFIED BY ashwin
USING 'SALES';
I added in tnsname file as:
SALES =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SALES_PRD)
)
)
So,when I tried :
select * from person#SALES;
I got error:
ORA-12154: TNS:could not resolve the connect identifier specified
Why is this error coming? Is there any solution for this dblink creation? Can I also access the tables of another database without using dblinks?
Tnsnames.ora
# tnsnames.ora Network Configuration File: E:\oracle\app\AshwinPC\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
TEST=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.6)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
sqlnet.ora
# sqlnet.ora Network Configuration File: E:\oracle\app\AshwinPC\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
Saying that you have multiple databases on the same computer (and, possibly, some other Oracle software), note that most of them have their own TNSNAMES.ORA file. If you don't pay attention what you're doing, you might be actually using the wrong file. In order to make everything work, you'd have to maintain all those TNSNAMES.ORA files which is a tedious job.
Therefore, create a TNS_ADMIN environment variable which will point to some directory (doesn't even have to be part of the \oracle\ directories but, e.g. c:\my_ora_lib). Put one copy of TNSNAMES.ORA file in there and make sure it contains references to ALL databases you use.
Doing so, you'll make every Oracle software product use exactly this TNSNAMES.ORA file.
As of database link being created "properly" doesn't mean much. You can do it for any non-existent database, but you won't be able to use it:
SQL> create database link dbl_wrong
2 connect to asfasdfj
3 identified by asldfkj234l
4 using 'laskjfoiwe';
Database link created.
SQL> select * from dual#dbl_wrong
2 /
select * from dual#dbl_wrong
*
ERROR at line 1:
ORA-12154: TNS:could not resolve the connect identifier specified
SQL>
Therefore, make sure you used username, password and database that really exist.

Oracle Database 12c tnsnames.ora file

I am new in Oracle 12c. In installation steps I need to add service orclpdb in tnsnames.ora file. Why I need to add this service?
ORCLPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orclpdb)
)
)
Actually there is no need for any tnsnames.ora file.
However, writing sqlplus #ORCLPDB is just much simpler than writing sqlplus #(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orclpdb))) for example. tnsnames.ora provides easy alias instead of using the full name which is rather complicated.

How to configure SQL Server database into TNSNAME.ora?

I have created a DB Link into an Oracle Database, pointing to a SQL Server Database.
ODBC if properly configured for this SQL Server Database.
I have also installed Oracle Gateways for SQL Server, on the Oracle Database Server.
When I try to execute this SQL request on my Oracle database :
SELECT * FROM obbud#qualiactst
(qualiactst is my DBLink :
-- PROMPT CREATE DATABASE LINK qualiactst
CREATE DATABASE LINK qualiactst
CONNECT TO iac IDENTIFIED BY ***** USING 'RIATST';
)
the error message is displayed as below :
ORA-12154: TNS : could not resolve the connect identifier specified
I have configured the tnsname.ora file of my Oracle Database Server with this :
RIATST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = grensql2k12R2-1)(PORT = 14539))
)
(CONNECT_DATA = (SID = RIATST))
(HS=OK)
)
(but I don't really know if i have to add a non-oracle database into a tnsname.ora)
I don't understand what i have done wrong, and if some things are missing.
Can you help me ?
Thank you so much
Jeanne
It looks like you don't set up listener onto the target host (grensql2k12R2-1) or don't configure HS initialization file.
Generally, try to follow this guide. There are too many details to check every of it in one answer.
For communication with a heterogeneous MSSQL database. There are two options.
1) Use of specialized Oracle Database Gateway for SQL Server.
Configuring Oracle Database Gateway for SQL Server
2) Oracle Database Gateway for ODBC.
Configuring Oracle Database Gateway for ODBC
Simple example configure Oracle Database Gateway for SQL Server
ORACLE_HOME\dg4msql\admin\initdg4msql.ora
HS_FDS_CONNECT_INFO=host_name:port_name//database_name
ORACLE_HOME\network\admin\listener.ora
SID_LIST_LISTENER=
############# MS SQL ####################
(SID_LIST=
(SID_DESC=
(SID_NAME=dg4msql)
(ORACLE_HOME=oracle_home_directory)
(PROGRAM=dg4msql)
)
)
##########################################
Restart listener
lsnrctl stop
lsnrctl start
ORACLE_HOME\network\admin\tnsnames.ora
connect_descriptor_mssql=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=host_name_oracle_gateway_host)
(PORT=port_number_listener_1521)
)
(CONNECT_DATA=
(SID=dg4msql))
(HS=OK))
SQL> CREATE PUBLIC DATABASE LINK name_dblink CONNECT TO "user" IDENTIFIED BY "password" USING 'connect_descriptor_mssql';
SQL> SELECT * FROM DUAL#dblink;
Example from production server Oracle 11.2.0.4
/home/oracle/app/oracle/product/11.2.0/dbhome_1/dg4msql/admin/inittch7.ora
HS_FDS_CONNECT_INFO=[10.89.250.87]:1433/
/home/oracle/app/oracle/product/11.2.0/dbhome_1/dg4msql/admin/inittch7.ora
HS_FDS_CONNECT_INFO=[10.89.250.88]:1433/
/home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1525))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.89.251.242)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = ssps)
(ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = ssps)
)
(SID_DESC=
(SID_NAME=tch8)
(ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM=dg4msql)
)
(SID_DESC=
(SID_NAME=tch7)
(ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM=dg4msql)
)
)
ADR_BASE_LISTENER = /home/oracle/database
/home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
SSPS_1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.89.251.242)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ssps)
)
)
atch7 =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST= 10.89.251.242)(PORT=1521))
(CONNECT_DATA=(SID=tch7))
(HS=OK)
)
atch8 =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=10.89.251.242)(PORT=1521))
(CONNECT_DATA=(SID=tch8))
(HS=OK)
)
CREATE DATABASE LINK ATCH7.GIFT.KRSK.MPS
CONNECT TO "asuzm_link" IDENTIFIED BY <ENTER USER PASSWORD HERE>
USING 'atch7'
/
CREATE DATABASE LINK ATCH8.GIFT.KRSK.MPS
CONNECT TO "asuzm_link" IDENTIFIED BY <ENTER USER PASSWORD HERE>
USING 'atch8'
/

Oracle SQL not working on localhost after changing domain of PC and host name (PC name)

I am having some problems with my Oracle SQL Server 11g.
So this is what happened:
My boss told me to add my PC to our domain in our company and change the name of my PC as it was not following the convention we have. So I changed it and then when I opened SQL developer, I discover that all my connections to localhost were not working, but databases stored somewhere else in the network were perfectly accessible.
I already checked all services, restarted them and also tried to restart the computer, but nothing.
What may be the problem? Any ideas?
Thank you very much!!
(Update: I realised that the service OracleXETNSListener does not start properly)
I found the solution.
Apparently when we install Oracle, there are some files which take the name of the host and use it in some scripts.
So well, in my case, there is a file C:/oraclexe/app/oracle/product/11.2.0/server/network/ADMIN/listener.ora with this content:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = HOST-NAME)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
So the solution is quite easy, just change the value of HOST = MY-NEW-HOSTNAME and restart the service, should work!!
BTW, question for the experts, I would like to know why this value is not stored in a environment variable... Then we would not experience this problem!

Resources