I have installed 2 oracle databases (i.e) 2 different instances in a server. From Username, Password, SID, Listener everything is different. Like Mentioned Below.
Instance 1:
Username : TEST
Password : TEST123
Port : 1111
SID : ForTest
Instance 2:
Username : NEW
Password : NEW123
Port : 2222
SID : ForNew
I am trying to export a table from Instance 1, by giving the following EXPDP command.
EXPDP TEST/TEST123#ForTest DIRECTORY=EXP_DIREC DUMPFILE=MAP_TABLE.DMP version=11.1 TABLES=MAP_TABLE
I am getting the exception like,
UDE-12154: operation generated ORACLE error 12154
ORA-12154: TNS:could not resolve the connect identifier specified
Where can i specify, that the export should use specific instance.
You already specified the instance
Try login to it
sqlplus is/pass#sid
and note error
check tnsnames and listener file
Cheers
Brian
Related
I get this error message "Invalid service name" when submitting the Database Connection Details form in Repository Creation Utility. I have put the required information as below:
Host Name : localhost
Port : 1521
Service Name : orcl
Username : sys
The version of the database I have installed is 19c.
Any idea how to fix that?
I have fixed it!
I should have connected to a pluggable database instead of the container database. In order to do that, I ran the command-lines below:
sqlplus user/password as sysdba
ALTER PLUGGABLE DATABASE orclpdb OPEN;
ALTER SESSION SET CONTAINER = ORCLPDB;
Afterwards, I put the service name as orclpdb.lan instead of orcl in the Database Connection Details form. So, the relevant required information should be as below:
Host Name : localhost
Port : 1521
Service Name : orclpdb.lan
Username : sys
Help me please.. I have some questions about pgAgent.
[Environment]
DB : PostgreSQL 9.3
OS : Window 7
OS login ID : someid#mail.com
pgAdmin login ID : postgres
pgAgent user : postgres
pgAgent schema belongs to: postgres DB
DB that I'll treat : testDB (In Step configuration, I specified 'testDB' as Database.
Connection type is 'local'. Connection string is empty.)
DB server : local machine (my laptop computer)
I scheduled pgAgent job, but it fails to connect database.
Output message ( pgAdmin>Statistics )
[Warning] Couldn't get a connection to the database (pgAgent)
(What database? There are 2 DBs. 'postgres' and 'testDB'. And I'll treat 'testDB'. Then couldn't get a connection to which database?)
windows event viewer
Failed to create new connection to database 'testDB':'fe_sendauth: no password supplied'
My pgpass.conf
localhost:5432:postgres:postgres:[pgAdmin password for postgres]
localhost:5432:testDB:postgres:[pgAdmin password for postgres]
My pg_hba.conf
#remove-line-for-nolocal## "local" is for Unix domain socket connections only
#remove-line-for-nolocal#local all all #authmethodlocal#
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 #authmethodhost#
# Allow replication connections from localhost, by a user with the
# replication privilege.
#remove-line-for-nolocal##local replication #default_username# #authmethodlocal#
#host replication #default_username# 127.0.0.1/32 #authmethodhost#
#host replication #default_username# ::1/128 #authmethodhost#
My pgAgent command option ( Service>pgAgent>Property>General tab )
C:\Program Files (x86)\pgAgent\bin\pgagent.exe RUN pgAgent host=localhost port=5432 user=postgres dbname=postgres
pgAgent service Logon ID ( Service>pgAgent>Property>Logon tab )
id : someid#mail.com
pwd : [ someid#mail.com's password ]
[Conclusion]
Password setting in pgpass.conf seems wrong for anything I know.
Or pg_hba.conf Or logon ID in Services>pgAgent>Logon
Actually.. I really don't understand what's wrong.^^
Thank you for your help in advance ^^
Beautiful day... I solved it ^^
[Solution]
I made other OS login ID. (NOT need to be 'postgres' !!)
And put pgpass.conf in that ID's AppData\Roaming\postgresql
[Reason]
pgAgent could not find pgpass.conf in login ID's directory.
I said my OS login ID is someid#mail.com.
But someid#mail.com's real name(folder name in C:\Users) was 'SOME NAME TEST'.
That's DIFFERENT !!
When I checked logon ID in services, pgAgent's logon ID was '.\someid#mail.com'.
I guess pgAgent tried to find pgpass.conf in 'C:\Users\someid#mail.com\AppData\Roaming\postgresql'.
But there was no such directory.!!
My pgpass.conf was in 'C:\Users\SOME NAME TEST\AppData\Roaming\postgresql'
I made a other OS ID 'anyname' in casual way. (control panel>account management.)
login ID : anyname
real name : anyname ( C:\Users\anyname )
That's SAME !! ^^
And placed pgpass.conf in 'C:\Users\anyname\AppData\Roaming\postgresql'
Then changed the pgAgent's logon ID to '.\anyname' in services.
Now it works well ^^
SET PGPASSWORD=<PassWord>
pg_dump -h <HostName> -p 5432 -U <UserName> -F c -b -v -f %BACKUP_FILE% <DATABASENAME>
Source: https://wiki.postgresql.org/wiki/Automated_Backup_on_Windows
I am new to Oracle DB and have created a new Oracle 12c database. I am creating a new connection through SQLDeveloper and where can I get the connection details? HostName? Port? SID?
I tried connecting using default details given in documentation but got the below error
Test failed: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor>
You really need to give more info if you need help :)
What Server are you using? Linux? Windows?
Post your oratab file (/etc/oratab)
Post your TNS file ($ORACLE_HOME/network/admin/tnsnames.ora)
Post your Listener file ($ORACLE_HOME/network/admin/listener.ora)
Assuming you're using Linux :D
You need to look at the file "/etc/oratab" if you're on Linux.
This will contain your SID.
Your TNS (located in $ORACLE_HOME/network/admin/) should contain the TNS Entry with SID as per your oratab file.
This is an example entry you will find in the oratab file:
orcl:/opt/oracle/product/10.2.0/db_1:Y
The let hand side "orcl" is your SID, and you will use this for your SID in the Oracle TNS.
If you find that your TNS is configured correctly, then the error message you provided may also indicate that your Database was not registered to the Listener.
You may connect to the sql database as follows:
Set your Oracle Environment
$ . oraenv
Prompts for SID: Enter the value "orcl" (if this is your SID?)
now login:
$ sqlplus / as sysdba
This will log you into oracle as a sysdba.
Execute the follwing:
SQL> Alter System Register;
You should notice a confirmation message that the system is altered.
now exit SQLplus, and try again
SQL> exit
On Windows ISTR, to get the SID, look at the running processes and you should see something called "oracleXXX.exe" or similar. The XXX will be your SID.
You should also see a "TNS" or "Listener" process, probably with the same "XXX".
To get the port number, (usually 1521-1526), find the folder where Oracle was installed to "the "Oracle Home") and in there go to the "network\admin" folder. You should see a "listener.ora" file in there, and if you view this is notepad you should be able to figure out what the port is set to.
This file should also tell you what host/network address the listener is attaching to - you use this IP as the "Hostname" in you connection. Sometimes (again I'm a bit cloudy with Oracle on Windows) the listener.ora might be named listnereXXX.ora, with XXX matching the value you will have seen in SID the checks above.
Obviously if you are new to Oracle, do not amend these files.
If you have netstat/wireshark or similar you can see what the port is attached to the TNS/Listener process.
If you have installed it on same machine on which you are running sql-developer then
host: 127.0.0.1
port: 1521
username and password same as you put while installing oracle datatabse.
keep sid blank
I've got a .dmp file created with Oracle 10g containing the database of one of my clients. I can't for the life of me get it set up with my 12c installation. I can connect to my db using https://localhost:5500/em
I've created a user 'BOB' in my desired PDB and granted import, read and write permissions. Next I try to import using the following command:
impdp BOB/password#//localhost:1521/pdbname full=y directory=dpdump_dir dumpfile=BOB.dmp
However this gives me the following errors:
UDI-12541: operation generated ORACLE error 12541
ORA-12541: TNS:listener does not currently know of service requested in connect descriptor
In the listener.ora and tnsnames.ora i have EZCONNECTOR and ports 1521. Does anyone know how to get this to work?
Many thanks in advance,
Bob
First ensure that you can do tnsping for pdbname to ensure db connect :- $ tnsping bdbname
If you get details of connection string by tnsping, you can try command with following format:
impdp bob/password#127.0.0.1:1521/pdbname directory=dpdump_dir dumpfile=BOB.dmp
I have removed "full=y" as it's not required if you are not restoring full database, specially it used apply with imp/exp utility.
You should remember that pdbname is being specified as a dbname/service_name in your example. You can confirm service_name by following command:
$ lsnrctl services; /* You can get service name and put it on your impdp command. */
In addition, you can try without specifying ip,port and dbname as you are working in localhost itself:
$ impdp bob/password directory=dpdump_dir dumpfile=BOB.dmp
First of all, you should check the connection
sqlplus> BOB/password#localhost:1521/pdbname
If you cannot connect, please connect with sys / as sysdba
Then using command:
SQL> alter session set container=pdbname
SQL> alter pluggable database pdbname open
Then quit and try to your command again. :)
I'm trying to define a database link on oracle 10.2 with connection identifier that throws the error in the question header.
I have the connection identifier (service name) in my tnsnames.ora file.
I can connect with sqlplus using this service name. no problem.
This is the creation sql:
create database link dev1.REGRESS.RDBMS.DEV.US.ORACLE.COM
connect to user1 identified by pass1
using 'dev1';
select using the link:
select * from t_users#dev1;
I get: ORA-12154: TNS:could not resolve the connect identifier specified
connecting to oracle with sqlplus to the 'unidentified' service (with no problem):
sqlplus user1/pass1#dev1
I defined another link to the same database I'm woking in (loopback) - works OK.
I read and tried anything I could find about the subject but did not solve this.
Any suggestions?
Try:
create database link dev1 connect to user1 identified by pass1 using 'dev1';
Also note that a tnsnames.ora entry for dev1 has to exist on the database server that you're linking from.