Cannot log into Oracle database after restart - oracle

I'm experiencing a reoccurring issue daily with my Oracle Database. I connected it recently and now when I restart, it seems to lose it. By lose it, I mean I receive an ORA-01034 error, as well as ORA-27101 error when I try to log in as a regular user. If I try my SYS user, I get an insufficient error (ORA-01031).
I found that if I remove the service and recreate it, I can log back in. However, this is not feasible as it is my local environment and I tend to shutdown for the night typically. I could keep my box up and weekly do it, but that still doesn't seem like a feasible idea.
Below is my TNSNames and Listener files.
tnsnames.ora
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
BRACMIS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.x.xx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = BRACMIS)
(INSTANCE_NAME = BRACMIS)
)
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\chad.johnson\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\chad.johnson\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(ORACLE_HOME = C:\app\chad.johnson\product\11.2.0\dbhome_1)
(SID_NAME = BRACMIS)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.x.xx)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = C:\app\chad.johnson\product\11.2.0\dbhome_1\log
)
I did notice that my Oracle service for 11g and OracleInstanceBRACMIS service both were off when I started up this morning. Not sure if it is something to do with that or not either. Thanks.
EDIT: I found a way to force my DB to start up. In a command prompt, I input the command:
oradim -STARTUP -SID BRACMIS
This allowed me to start my database, which in turn allowed me to log into it at long last. This doesn't solve the overall issue of not being able to log in initially when I come on after a restart, but it does give me a way to jumpstart the DB at the very least rather than remove the Oracle Service Instance and add it back.

It appears that when you restart, oracle service is not starting. (which basically means that your Oracle Database was not started.)
Goto your windows services, and locate your Oracle Service and change the startup type of your service as Automatic . This will ensure that the Oracle Database starts after a restart.
Meanwhile open your command prompt ...do the following..
C:\> set oracle_sid=your_sid
C:\>sqlplus / as sysdba
SQL>Startup;
This will start your instance...

Related

TNS:listener times out every 2 hours on VPN

I have a locally installed Oracle XE instance I use, but it times out every 2 hours on our corporate VPN. It's like clockwork, 2 hours after connecting I get:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
If I reconnect the VPN it starts working again, 2 more hours then reconnect. Any way to avoid this? Any way even to refresh it without reconnecting the VPN, as that in itself is a total pain.
Update
listener.ora looks like:
DEFAULT_SERVICE_LISTENER = XE
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\Oracle\dbhomeXE)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\dbhomeXE\bin\oraclr.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <FQDN>)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
Where is the fully qualified domain name of my machine.

How do I solve error 12505 in Oracle SQL?

I'm a programming student and I just began learning databases and SQL. When I try to connect to the databse in SQL Developer it says
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor.
I tried to install it on my PC tower at home and everything works fine it just doesn't work with my laptop. Even the teacher said he couldn't help me because he doesn't know what to do so I try here because I really don't know what to do.
I tried uninstalling et reinstalling the database multiple times and I made sure every Oracle services were running. My SID is set to XE. My connection is set to basic. The host is 'localhost', the port is '1521' and the SID is 'xe'
Heres is the tnsnames.ora file
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-62JIG0N)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
Heres is the ouput of lsnrctl status in the cmd
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Production
Start Date 03-F╔VR.-2020 12:04:38
Uptime 0 days 4 hr. 53 min. 38 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\diag\tnslsnr\DESKTOP-62JIG0N\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DESKTOP-62JIG0N)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Here's the listener.ora file
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-62JIG0N)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
What is the 'connection' type of your SQL Dev connection properties? (basic? TNS?) There is a discconect between the error message ("NS:listener does not currently know of SID") while your tnsnames says to connect by service name rather than by SID. This would indicate that your SQL Dev connection type is 'basic' . . . which doesn't use tnsnames.ora at all. Since you are using a 'basic' connection, you need to show us the values used. Also, since it is the listener complaining that he doesn't know of the sid you are requesting, you need to show us the output of the command 'lsnrctl status', so that we can see what the listener does know about.
This really a pretty basic problem, so the fact that your instructor doesn't know how to solve it leaves me with a lot of questions about his qualifications to be teaching anything involving oracle.

Connect Directly to Pluggable Database

How I can connect to Pluggable Database Directly?
I'm trying this.
sqlplus scott/tiger#pdborcl;
But I'm getting ORA-12154: TNS:could not resolve the connect identifier specified
After that I tried to add localhost.
sqlplus scott/tiger#localhost/pdborcl;
Then I got
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
But when I connected as System, then I can easily connect using.
sqlplus scott/tiger#pdborcl;
Please help me I really want to get rid of System login again and again.
#TNSNAMES.ora File
# tnsnames.ora Network Configuration File: C:\app\OracleHome\product\12.1.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
PDBORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdborcl)
)
)
SQLNET
# sqlnet.ora Network Configuration File: C:\app\OracleHome\product\12.1.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
tnsping pdborcl
You basically need a couple of items to be in place before a direct connection to a pluggable database can be established.
Ensure the pluggable database is started and open, there is a tnsnames.ora entry for the pdb, confirm the listener has picked up the tnsnames entry for the pdb after you added it, reload the listener configuration if already running.
If you have issues connecting to the pdb using different users, check for permission differences between them.

Connecting to Oracle database installed on one pc to the java application from another machine

I've installed Oracle 12c (desktop class) on my machine, and I can use it via sql developer on the same machine. Now how can I use the same database from another machine (for java application) in the LAN? I tried using the jdbc thin driver as follows: jdbc:oracle:thin:#10.0.11.69:1521:orcl where 10.0.11.69 is my ip address where Oracle is installed. Do i need to install any server where oracle is installed(10.0.11.69) to connect to my db from another machine?
I'm trying this from past 3 days and referred to many questions of the same model but none solved my issue.
My tnsnames.ora description is as follows:
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
Thanks in advance.
You need to connect to PDB if it is a Oracle 12c installation. You can add the following entry in tnsnames.ora:
pdborcl =
(DESCRIPTION =
(ADDRESS = (PROTOCOL=TCP)(HOST=localhost)(PORT=1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdborcl)
)
)
After setting this, the listener needs to be restarted.
lsnrctl stop
lsnrctl start
Then the connect string will be something like this:
jdbc:oracle:thin:#//10.0.11.69:1521/pdborcl
Note the connect string above uses service name instead of SID, because in 12C we need to use service name instead of SID to connect to PDB. Check this post for more details.
Java application will not use tnsnames.ora by it's own. You have to call:
System.setProperty("oracle.net.tns_admin", "..path to tnsnames.ora");
To tell the driver where to search for it.
Also note, that some tnsnames.ora constructs are not supported by thin driver. For examples the "include" directive.
Thanks for the following link, Configuring the connection between client and server Oracle 10g
after researching for a long time I found that I need to add my LAN address(10.0.11.69) in the listener.ora file which solves my problem.
so my listener.ora will looks like this now:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.11.69)(PORT = 1521))
)
)
)

Unable to connect to Oracle XE

I installed Oracle 11XE a while back - suddenly I am getting ORA-01034 and ORA-27101 errors when trying to connect
My ORACLE_HOME and ORACLE_SID appear to be correct.
My listener.ora file is:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
))
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = Home-PC)(PORT = 1521))
)
(PROGRAM = extproc)
)
DEFAULT_SERVICE_LISTENER = (XE)
The following Windows Services are all started:
OracleJobSchedulerXE
OracleMTSRecoveryService
OracleServiceXE
OracleXEClrAgent
OracleTNSListener
When I switch Windows Firewall off (just in case it is blocking port 1521), it still brings up the error
What else can I check?
It must have been a permissions issue for some reason
When I ran the Start Database batch file, it just hung
From the SQL Command Line, I typed
STARTUP
and got
ORA-01038: insufficient privileges
So I connected using
connect sys as sysdba
and got
Connected to an idle instance
I then used
STARTUP
again and it started! I had not changed anything else. I can only assume I will have to change my Start.bat file to connect as sysdba first
I ran into this exact problem when one of my drives used by Oracle had 25GB used and only 5GB free space. I increased the size to 60GB and it fixed the problem.

Resources