Oracle - Invalid service name in Repository Creation Utility - oracle

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

Related

How to get username/password/hostname/port/SID to establish connection in SQL developer

I installed Oracle database 21c and sqldeveloper. During the installation of oracle database 21c I inputted my password upon the prompt. I tried to key in the password and the given username SYS to create connection in sqldeveloper but I got the error
Status : Failure -Test failed: IO Error: The Network Adapter could not
establish the connection (CONNECTION_ID=9mv7VkLpQniPUhJwegf7OQ==)
I'm trying to create a local database to practice SQL and I'm not looking to connect to an external database. What should I do in order to achieve my goal?
Ok, just do this instructions to connect to the database via sql developer:
1- Startup database (if you do not starttup database yet);
2- In OS prompt execute:
lsnrctl start
The command start your listener up.
3- In OS prompt execute (If you are using linux OS):
echo $ORACLE_SID
ifconfig
The first shows your database sid and the second shows your OS IP. The port is usually 1521.
4- In sql developer inter connection name for example Oracle_conn, username and password and set role for the user.
Then you should enter Ip,Port and Sid you obtained in step 4.
5- Press Test or Connect and Enjoy!

ORDS 3.0.12 could not be installed along with Database 11G XE

I tried to install latest ORDS (not standalone) by following steps but could not succeed as Database 11g XE could not connect.
When i tried to login with sysdba in 5 number steps then says invalid logon.
NOTE: Still also i can not login with XE in browser like localhost:1521/xe.
but in command prompt i can login with database.
I also checked tnsnames.ora , listener.ora where everything was correct.
1. go to cd e:\apex
login as sysdba:
alter user apex_public_user account unlock;
alter user apex_public_user identified by Database#1;
2.rename file ords.war to apex.war
3. Install APEX Listener : (e:\ords)
java -jar apex.war
location for configuration data = e:\ords
hostname: localhost
DB port: 1521
database SID [1] 2
SID[XE] xe
username [APEX_PUBLIC_USER]:
password [APEX_PUBLIC_USER]: Database#1
**5.Please login with SYSDBA privileges to verify Oracle REST Data Services schema.**

Set Specific Database for EXPDP - Two Oracle Databases

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

pgAgent fails to connect database :'fe_sendauth: no password supplied' (in Windows7)

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

How to find Oracle database connection details

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

Resources