r/SQL • • Sep 24 '26

Oracle I’m getting ORA-12261

Post image

I’m trying to create a new connection but it won’t let me. Im even testing my other connection and it gives me the same message even thought it’s fully operational, anybody knows why?

0 Upvotes

23 comments sorted by

4

u/sacninja Sep 24 '26

Host name and also need a service name

0

u/Finanz_minister Sep 24 '26

The first time I didn’t put a service name and it worked fine, is the service name supposed to be something specific or should I make it up? Sorry if it sounds too dumb, I’m new to this

1

u/VladDBA SQL Server DBA Sep 24 '26

Either XE or FREE, depending on which version of Oracle you're using. Anything before 23 is Express Edition (XE), 23 and 26ai is Free.

Implying you're not working with SE or EE, in which case the service name can either be Oracle or something custom.

2

u/Noone90909090 Sep 24 '26

can you ping your hostname? mayhaps there's a dns problem. or maybe use the ip address as hostname, rather than server name?

0

u/Finanz_minister Sep 24 '26

Lemme try that

2

u/lolcrunchy Sep 24 '26

"Syntax error in Easy Connect connection string"

This means it is failing to parse the connection instructions you have provided, and has not yet attempted to connect.

0

u/Finanz_minister Sep 24 '26

How do I make it attempt it again? 😅

3

u/lolcrunchy Sep 24 '26

Just to be clear, it has not YET attempted.

You have to figure out what is causing the syntax error.

It's kinda like you hop into a taxi and you say "go to 1002 New York 77 Main 912 Street 88800", then the driver says "idk how to understand that address". You shouldn't ask "how do I convince this driver to start driving?", you should ask "what address do I need to give the driver?"

1

u/Finanz_minister Sep 24 '26

Oooooh that makes more sense thank you. everybody is saying my host name is wrong and that it should be an address, but I don’t really know what address within my computer it should be so it understands it, should I put a file address?

1

u/lolcrunchy Sep 24 '26

Uhhhh I doubt it would be a file address. Do YOU know what database you're trying to connect to? Is it YOUR database on your own computer? Or is it someone else's?

1

u/Finanz_minister Sep 24 '26

I’m trying to create one for my own computer

1

u/lolcrunchy Sep 24 '26

So you haven't created one YET? You need to have a database up and running before you can use the application in your photo.

1

u/Finanz_minister Sep 24 '26

Yo I didn’t think about it before, I’m stupid, let me try that rq

2

u/Traditional-Unit-274 Sep 24 '26

try selecting “sid” instead of “service name” and hit “connect” again

1

u/Finanz_minister Sep 24 '26

It says “SID xe is not registered with the listener at host Locho port 1521”

2

u/Traditional-Unit-274 Sep 24 '26

your host name should be an address

1

u/Finanz_minister Sep 24 '26

When I first created my first connection I put in that exact host name and it worked. Sorry for my lack of knowledge, but how do I find out the proper address within my computer?

2

u/Traditional-Unit-274 Sep 24 '26

is this just something you installed locally? usually when someone expects you to connect to a db they give you the connection info you need

1

u/Finanz_minister Sep 24 '26

Yeah it’s local, rn im learning how to do stuff so I was just playing around with queries and pre-made databases my professor gave me, the thing is I want to create a separate connection because the default connection came with a bunch of tables that are useless and kinda bother me😅

1

u/Traditional-Unit-274 Sep 24 '26

the thing is the connection info, it has to be right. all that, the hostname, the sid, the username, password, you can’t guess you have to know what it is to get in. if you can log in at all you can google and query the db for the correct values. but it sounds like maybe your professor had a database and you tried to replicate at home by spinning up your own?

1

u/Legitimate-Pin-8619 Sep 24 '26

ORA-12261 is almost always “client can’t resolve / parse the connect identifier,” not “Oracle rejected your password.”

Checklist that usually finds it:

  1. Exact Easy Connect string you’re using (host:port/service vs host:port:SID). Mixing service name and SID syntax is a common 12261.
  2. Can the client resolve the host? ping / nslookup the hostname from the same machine as the SQL tool.
  3. Is the listener up and advertising that service? On the DB host: lsnrctl status and confirm the SERVICE_NAME matches what you typed (case / underscores matter).
  4. If an old connection that used to work now fails the same way, something changed outside the app: DNS, VPN, tnsnames.ora / sqlnet.ora path, Oracle Instant Client version, or the listener config — not your SELECT.

Paste (redact secrets): full connection string shape, client tool + Instant Client version, and whether you’re on VPN. The screenshot alone rarely has enough to distinguish DNS vs bad Easy Connect vs listener.

-2

u/spez_eats_nazi_ass Sep 24 '26

Talk to one of the 200k support guys they let go since March. Fck Oracle.

-4

u/mtutty Sep 24 '26

Switch to Postgres, you'll never see that error again!!