0

I'm completely newbie to the database.

I successfully installed instant client for Mac, and now can use sqlplus /nolog in the terminal, but I can't log in any database because I don't have any except for some txt files, nor can I create any user.

After a lot of search, I have tried these codes to create a new user, however, none of them can do.

SQL> create user t1 identified by tiger;

SP2-0640: Not connected

SQL> conn t1/tiger

ERROR: ORA-12545: Connect failed because target host or object does not exist


SQL> create user t1@localhost identified by tiger;

SP2-0640: Not connected

SQL> conn t1/tiger@localhost

ERROR: ORA-12541: TNS:no listener


SQL> conn scott/tiger@orcl

ERROR: ORA-12154: TNS:could not resolve the connect identifier specified

Here are my settings

tsnnames.ora file

ORALOCAL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )

listener.ora file

LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) ) ) ) )

The software requirement in my lab class is Oracle XE on Windows, but I don't feel like to run VM on my Mac, and I saw what they did was just login the user that created when they installed XE, then create, connect, start the txt file to build a database, and all done. I feel really weird that it is so difficult for Mac users.

Ethan Sun
  • 3
  • 3
  • When you have only the Oracle Instant **Client** installed you cannot create a local database (server) Install the full Oracle database for it. – Wernfried Domscheit Mar 25 '17 at 08:18

2 Answers2

0

To connect oracle database using oracle client, you have to add proper database name and description in clinet tnsname.ora file.

Once you install oracle client on any server. please check it is possible to prompt sqlplus command or not? If not then please set environment variable on client machine.

SamDPatel
  • 1
  • 1
0

"Anything wrong in my tsnnames.ora?"

Yes. It points to a database which doesn't exist.

Instant Client is software for connecting to a database. It is not a database nor can it create one. It's the difference between a browser and the internet. You need to install Oracle database server to create a database.

"The software requirement in my lab class is Oracle XE on Windows"

XE is not and never has been available on Mac. There's never been an official explanation of this; my personal theory says it's to do with chip architecture as XE was available for x86 - Windows, Linux - and Mac used PowerPC. (This matters because Oracle enforces one instance of XE per machine).

So now that Apple uses Intel chips too why not port XE to MacOS? Because everybody uses VMs these days.

"I don't feel like to run VM on my Mac"

Why not? Oracle provide full fledged images for Oracle VirtualBox, although not Oracle XE 11g. Find them here.

" I feel really weird that it is so difficult for Mac users."

Education has always favoured Windows OS because it was most likely to be the OS students knew from home, because it was - and is - the prevailing desktop OS. And Windows machines cost much less than Macs, which is also a consideration for the many students.

APC
  • 144,005
  • 19
  • 170
  • 281