SQL> CONNECT / as SYSDBA ERROR: ORA-24314: service handle not initialized - oracle

I just installed Oracle 9i in my PC. For initial login I'm using following to unlock user.
Connect SQLPLUS using /nolog
Then when I use following command in SQLPLUS
SQL> CONNECT / as SYSDBA
I'm getting following error
ERROR: ORA-24314: service handle not initialized
Can anyone suggest where things are not going right?
Also I've noticed that SQLPLUS is not working from windows command prompt. I'm using windows 8.1 and oracle 9i (9.0.1.0.1)

Did you .oraenv to your database?
cat /etc/oratab
to get the dbname (if not already known).
edit: Also why not just issue:
sqlplus / as sysdba
?

Related

Oracle sqlplus / as sysdba not work in Windows Server 2016

I recreated oracle database again on my windows machine. However i can not connect sqlplus / as sysdba. it gives TNS-12560 error. However i can connect with sqlplus /#mysid as sysdba.
The service is working.
And I see Registry keys are entered.
lsnrctl status works and i can see my services are OK.
on cmd, I set ORACLE_SID=mysid
What should i do more?

ORA-12514 TNS:listener does not currently know of service requested in connect descriptor in oracle 11g

Already read all the question related to this error, but couldnt resolve the issue.
As of yesterday, the oracle SMALLWORLD service has stopped working and the error is
ORA-12514 TNS:listener does not currently know of service requested in connect descriptor
the following are the system information to better understand the situation:
LISTENER.ORA content :Listener.ora
TNSNAMES.ORA content :TNSNAMES.ORA
SQLNET.ORA content :SQLNET.ORA CONTENT
the following is the result of
LSNRCTL SERVICES
command.
LSNRCTL.SERVICES result
as you can see the service name ATTACHMENTDB is recognisable, but service SMALLWORLD is not.
while trying to logon with sysdba, the result is
ORA-01017 invalid user name/password; logon denied
while trying to logon with SYSTEM user, the result is
ORA-01034 : ORACLE not available
and
ORA-27101 : shared memory realm does not exist
below image, is the result of SQLPLUS /NOLOG command
SQLPLUS /NOLOG
i already tried stopping and starting the ORACLE services and the Listener in the SERVICES.MSC, but nothing worked.
i don't understand why ATTACHMENTDB service works but not the SMALLWORLD service.
any hint appreciated.
I have this problem in windows 10 and Oracle19C.
You should try the following ways and one of them may work for you.
Way-1: In windows: use this video: restart services OracleOraDB19Home1TNSListener then OracleServiceORCL.
Way-2: connect with system user password to sql plus as shown as:
Enter user-name: system/ as sysdba
Enter password: your_password
SQL> shutdown
SQL> startup nomount
SQL> alter system set db_recovery_file_dest_size=4G scope=both;
SQL> alter database mount;
SQL> alter database open;
And now check your problem fixed? If no set below code then check again.
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=127.0.0.1) (PORT=1521)))';
This work for me.

Running SQL file in command line using sqlplus result with an error

Using ORACLE 12.0c and SQL Developer.
I try to run a SQL file (myfile.sql) in command line using sqlplus:
sqlplus username/password#schema #myfile.sql resulted with an error.
I run only sqlplus with connection parameters sqlplus username/password#schema and still receive an error (see screenshot).
Typing the username and password didn't help as well.
Only running sqlplus and supply the database domain, port and database name I managed to connect and run the file.
The database is defined in SQL Developer, but I don't see it in TNSNames.ora.
What am I missing?
I give credit to #thatjeffsmith and the answer is... see screenshot:

Error while restoring oracle 10g .dmp file in oracle database 12c

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. :)

Unable to log in to database as SYS with Oracle SQL Developer

I've worked with Oracle for some time but very much a noob with the Admin side of things and am learning, so bear with me.
I cannot log on to my database (orcl_test) with SQL Developer with the SYS username. I can log on just fine in SQLPlus with SYS as SYSDBA - when I try with SQL Developer I get an error:
ORA-01017: invalid username/password; logon denied.
Logging on as SYS as SYSDBA in SQLPlus, I created a test table within the database and granted the test user SCOTT with SELECT permissions. The Scott user can log on through SQL Developer w/o problem and access the allowed tables.
I have checked that the Scott user and SYS are logging in using the same settings -
Hostname: (ip address)
Port: 1521
SID: orcl_test
For SYS I flag the role SYSDBA - but otherwise the settings are the same.
Any thoughts on why I can't log on using SYS? Am I just overlooking something or have I configured my db incorrectly?
Not sure if this is relevant but I cannot use 'localhost' for the hostname, I have to enter the IP address. Where do I configure Oracle to recognize localhost?
This is a new installation of Oracle 11.2.0.1.0 on a standalone test box running Windows XP. Running Oracle SQL Developer 1.5.5.
From the The SYSDBA System Privilege and (Logging In and Connecting to the Database as SYSDBA:
1--Connecting AS SYSDBA invokes the SYSDBA privilege. If you omit the AS
SYSDBA clause when logging in as user SYS, the SQL Command Line
rejects the login attempt.
2--Using SQL Developer, open a database connection to the SYS user AS SYSDBA.
So - if this works for you:
sqlplus sys/Oracle_1#pdborcl as sysdba;
Try: "SYS AS SYSDBA" as below:
Alternatively:
you can type in: "SYS" and select from dropdown-menu ROLE: SYSDBA.
If I understand correctly the database is on the same host as the SQL Developer installation? Are you fully qualifying the connection when testing with SQLPlus:
sqlplus "sys/password#database as sysdba"
It may be the case that the error is correct. Make sure you've created a password file.
The sys password that you are using is not valid.
But because you are connecting to oracle by command on an Oracle machine, Oracle does not check your password even though your password is not right.
Just change the sys password and try again.
su - oracle
orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=Euro2016 entries=5
which means: write to a file $ORACLE_HOME/dbs/orapw$ORACLE_SID a password Euro2016 which is used by SYSDBA
Now you can connect with sqldeveloper: username sys, password Euro2016 with chosen SYSDBA , hostname, port, sid from $ORACLE_SID

Resources