I'am trying to setup a new database on oracle 12c. I did this many times and in my opinion, there's nothing I did wrong.
Important thing - I have also 11g installation in same folder (product) so to run f.e. sqlplus or oradim for security I run from /BIN directory with ".exe" on the end.
First:
set ORACLE_SID=testdb
set LOCAL=testdb
new service - oradim.exe -new -sid %ORACLE_SID% -intpwd system -startmode M
in services.msc there's everything ok - service showed up and run.
Next: initdb.ora & tnsnames.ora-
testdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = testdb) //here i also try (SID = testdb)
)
)
init:
control_files = (C:\app\oracle\product\12.1.0\dbhome_1\dbs\control01.ora,
C:\app\oracle\product\12.1.0\dbhome_1\dbs\control02.ora,
C:\app\oracle\product\12.1.0\dbhome_1\dbs\control03.ora)
undo_management = auto
db_name = ora10
db_block_size = 8192
then
from cmd line with Admin rights i tried
sqlplus "/as sysdba"
sqlplus sys/system#testdb
sqlplus sys/system
sqlplus /nolog -> connect sys/system as sysdba --since local and ORACLE_SID are set
and I always get an "unkown service or sid" error.
So I checked lsnrctl.exe status and my testdb isn't there.
Why? :|
try to restart the listener and register your sid dynamically with listener.
alter system set local_listener=testdb
Related
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!
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'
/
I am a new one who started to use Oracle Database and faced the problem during installation the last verstion of Oracle XE 11g x64 to the Microsoft Windows 7 x64 Enterprise.
During installation were not any errors and Windows Services (OracleXETNSListener and OracleServiceXE) were successfully created and started.
However, when I try to get the list of available databases I receive an error
ORA-01034: ORACLE not available
For some reason the XE database was not created into %ORACLE_BASE%\oradata\XE.
The content of my listener.ora with localhost:
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 = 127.0.0.1)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
I fixed tnsnames.ora by setting localhost IP address:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
sqlnet.ora contains both services:
SQLNET.AUTHENTICATION_SERVICES = (NONE;NTS)
The log file from '%ORACLE_HOME%\server\log\myhost\client' contains this error:
Oracle Database 11g Clusterware Release 11.2.0.2.0 - Production
Copyright 1996, 2010 Oracle. All rights reserved. 2016-01-20
19:51:43.920: [ default][5096]ut_read_reg:2:ocr registry key
SOFTWARE\Oracle\olr cannot be opened. error 2 [
CLSE][5096]clse_get_crs_home: Error retrieving OLR configuration [0]
[Error opening olr registry key. Не удается найти указанный файл. ]
How can I find what goes wrong and fix the problem?
After struggling with this problem for almost a week I found a solution, how to make XE database available from this source. It is in Russian, I provide the solution right here in English.
Install the last version of Oracle XE 11gR2 from the Oracle site to the default location c:\oraclexe with default password admin. If not default, then you should edit scripts below (paths and pwd) before use them.
Run cmd command line under administrator privileges and use it until the end of reconfiguration. First of all, set environment variables for your DB:
set ORACLE_SID=XE
set ORACLE_BASE=c:\oraclexe\app\oracle
set ORACLE_HOME=c:\oraclexe\app\oracle\product\11.2.0\server
Delete the XE database by command:
oradim -delete -sid XE
Delete PWDXE.ORA file:
del %ORACLE_HOME%\database\PWDXE.ORA
Copy init.ora from %ORACLE_HOME%\config\scripts to %ORACLE_HOME%\database, instead of existing, rename it to initXE.ora and add the configuration below:
open_cursors=300
db_name=XE
control_files=("C:\oraclexe\app\oracle\oradata\XE\control.dbf")
job_queue_processes=4
compatible=11.2.0.0.0
diagnostic_dest=C:\oraclexe\app\oracle\.
memory_target=1G
sessions=100
audit_file_dest=C:\oraclexe\app\oracle\admin\XE\adump
remote_login_passwordfile=EXCLUSIVE
dispatchers="(PROTOCOL=TCP) (SERVICE=XEXDB)"
shared_servers=4
undo_management=AUTO
undo_tablespace=UNDOTBS1
DB_RECOVERY_FILE_DEST_SIZE = 10G
DB_RECOVERY_FILE_DEST=C:\oraclexe\app\oracle\fast_recovery_area
#optional
nls_language="RUSSIAN"
nls_territory="RUSSIA"
From the previous cmd line with admin previleges run the command to create Oracle services and file %ORACLE_HOME%\database\PWDXE.ORA:
oradim -new -sid %ORACLE_SID% -intpwd admin -startmode auto -srvcstart system
Run commands below to stop Windows Oracle XE services, delete them and additional XE files:
sqlplus /nolog
connect sys/admin as sysdba;
shutdown immediate;
exit;
del %ORACLE_BASE%\oradata\XE\CONTROL.DBF
del %ORACLE_BASE%\fast_recovery_area\XE\ONLINELOG\*.LOG
Create two files into one directory:
createXE.cmd
set ORACLE_SID=XE
set NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251
set ORACLE_BASE=C:\oraclexe\app\oracle
sqlplus /nolog #createXE.sql
createXE.sql
spool %ORACLE_BASE%\admin\XE\CreateXE.log;
connect sys/admin as sysdba;
startup nomount;
CREATE DATABASE XE
LOGFILE GROUP 1 SIZE 51200K,
GROUP 2 SIZE 51200K
MAXINSTANCES 8
MAXLOGHISTORY 1
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
CHARACTER SET CL8MSWIN1251
NATIONAL CHARACTER SET AL16UTF16
DATAFILE 'c:\oraclexe\app\oracle\oradata\XE\system.dbf' SIZE 300M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE 'c:\oraclexe\app\oracle\oradata\XE\sysaux.dbf' SIZE 120M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
SMALLFILE DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE 'c:\oraclexe\app\oracle\oradata\XE\temp.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED
SMALLFILE UNDO TABLESPACE UNDOTBS1 DATAFILE 'c:\oraclexe\app\oracle\oradata\XE\undotbs1.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;
CREATE SMALLFILE TABLESPACE USERS DATAFILE 'c:\oraclexe\app\oracle\oradata\XE\users.dbf' SIZE 300M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
-- catalog
#%ORACLE_HOME%\rdbms\admin\catalog.sql;
#%ORACLE_HOME%\rdbms\admin\catblock.sql;
#%ORACLE_HOME%\rdbms\admin\catproc.sql;
#%ORACLE_HOME%\rdbms\admin\catoctk.sql;
connect system/manager
-- sqlplus profile
#%ORACLE_HOME%\sqlplus\admin\pupbld.sql;
#%ORACLE_HOME%\sqlplus\admin\help\hlpbld.sql helpus.sql;
connect sys/admin as sysdba;
-- xdb protocol
#%ORACLE_HOME%\rdbms\admin\catqm.sql change_on_install SYSAUX TEMP NO;
#%ORACLE_HOME%\rdbms\admin\catxdbj.sql;
#%ORACLE_HOME%\rdbms\admin\catrul.sql;
-- compiling invalid objects
#%ORACLE_HOME%\rdbms\admin\utlrp.sql;
spool off;
exit;
Run createdXE.cmd from command line with admin privileges.
Done.
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
I'm trying to use oracle's hsodbc generic database link driver to access a postgresql database from my oracle 10gr2 database server. I think I have everything configured but I'm receiving this error from the sqlplus promt after trying a remote query.
SQL> select * from temp_user#intranet;
select * from temp_user#intranet
*
ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from INTRANET
If I use "isql" from the linux command line (in other words test just the odbc connection) the query works.
I enter in "isql intranet" (intranet is the name of the odbc connection)
I get the prompt I type select * from temp_user and I receive back my 157 records on screen.
So I know the odbc configuration is setup correctly. Here is what I do for oracle.
%oracle_home/hs/admin/inithsodbc.ora
HS_FDS_CONNECT_INFO = intranet
HS_FDS_TRACE_LEVEL = OFF
HS_FDS_SHAREABLE_NAME = /usr/bin/ODBCConfig
%oracle_home/network/admin/tnsnames.ora
INTRANET =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.1)(PORT = 5432))
)
(CONNECT_DATA =
(SID = INTRANET)
)
(HS = OK)
%oracle_home/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = INTRANET)
(PROGRAM = hsodbc)
(SID_NAME = INTRANET)
(ORACLE_HOME = /home/oracle/app/OraHomeTEST)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracledb.andersen-const.com)(PORT = 5432))
)
)
I have restarted the listener. It's status is as follows.
Services Summary...
Service "INTRANET" has 1 instance(s).
Instance "INTRANET", status UNKNOWN, has 1 handler(s) for this service...
I then go into sqlplus from the database server command line and do the following.
drop database link intranet;
create database link intranet connect to auser identified by apassword using 'intranet';
This is successful.
However when I run
select * from temp_user#intranet
I receive the error
ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from INTRANET
I've spend atleast a good day going back over the configures and trying things and I always get this error.
Anybody have any good ideas,
What does "tnsping intranet" report?
Are you sure your hsodbc prorgram is in the Oracle_home/bin directory of the your gateway installation? Also, is your LD_LIBRARY_PATH set properly?
I believe your LD_LIBRARY_PATH should be $ORACLE_HOME/lib. Sorry, not sure since I don't do much with *Nix these days.