I am currently having issues configuring Oracle DB 11g on Ubuntu 14.04. I have successfully installed Oracle but the problem comes when I start configuring it.
First it was a invalid listener issue, after some extensive searching I found out that I had to put my domain name on 127.0.0.1 which I did (my domain name also contains dashes). After I made those changes, I ran into another error:
ORA-01109 database not open
I have had no luck with this one. What causes the "database not open" error and how could I fix it?
Try
ALTER DATABASE OPEN
It should work I guess.
Or Give this a try
$ sqlplus sys/Change12345#orc01 as sysdba
SQL> shut immediate
SQL> startup
and check the status of the instance use
SQL> select status from v$instance;
Related
I needed to change the SID of an Oracle XE database (not the Service Name) to match a production database.
When I tried searching online, most of the pages were describing changing or adding a service name through tnsnames.ora; that's not what I needed to do.
The asktom article has the answer, but the formatting and verbosity makes it hard to follow, so here's a summary:
[XE_HOME] means where Oracle XE is installed. Normally this is C:\oraclexe\app\oracle\product\10.2.0\server.
Make sure you have Administrator privileges or the procedure will fail.
Configure the SPFILE (you can remove the old file if you want)
copy [XE_HOME]\dbs\spfileXE.ora [XE_HOME]\dbs\spfileNEW_SID_NAME.ora
copy [XE_HOME]\database\initXE.ora [XE_HOME]\database\initNEW_SID_NAME.ora
Edit [XE_HOME]\database\initNEW_SID_NAME.ora: It should contain a single line like this: SPFILE='[XE_HOME]\server\dbs/spfileNEW_SID_NAME.ora'
Shutdown and replace the old service with a new:
sqlplus / as sysdba and execute shutdown
lsnrctl stop
oradim -new -sid NEW_SID_NAME -startmode auto -pfile [XE_HOME]\database\initNEW_SID_NAME.ora
oradim -delete -sid XE
lsnrctl start
Update the ORACLE_SID environment property (System Settings > Advanced > Environment)
Force Oracle to register with listener
sqlplus / as sysdba and execute alter system register;
You can verify that the SID was changed by executing the following query: select instance_name from v$instance;
I had some problems with the solution posted by Johannes, so I had to do some extra steps.
When trying to connect to oracle (step 4) by doing sqlplus / as sysdba I got:
ERROR: ORA-12560: TNS:protocol adapter error
The solution for this was executing the following line:
oradim -start -sid NEW_SID_NAME
Then connecting with / worked fine, but trying to connect to NEW_SID_NAME with system or HR got me another problem:
ERROR: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
I checked that with the query select instance_name from v$instance; that the listener would be NEW_SID_NAME, and so did. But running lsnrctl status in the command line or querying select name from dba_services; didn't show NEW_SID_NAME as a listener.
The solution of this problem was executing the followind sentence on sqlplus:
alter system set service_names='NEW_SID_NAME';
Maybe you'll need to execute alter system register; after this also.
After doing this two steps I can connect to the NEW_SID_NAME with system and HR.
Hope it helps
In version 11g, all of the previous solution didn't work... I always get the following error when trying to do the sqlplus / as sysdba :
ERROR: ORA-12560: TNS:protocol adapter error
Luckily I found a script to do what I wanted to do under [XE_HOME]\config\scripts. The script is named XE.bat and it will instantiate a new database from scratch asking you for the sysPassword along the process. So what I did was :
Stop and remove the existing service if any:
oradim -delete -sid XE
Stop the listener
Configure the SPFILE as explained by Johannes
Make a copy of the script XE.bat, you can name it whatever you want
Edit the copy of the script as follows :
Change line "set ORACLE_SID=XE" to "set ORACLE_SID=NEW_SID_NAME"
Change wherever you see "-sid XE" to "-sid NEW_SID_NAME"
Update the line where it calls the "orapwd.exe" command to point to a file called PWDNEW_SID_NAME.ora instead of PWDXE.ora
Update the line that echos the spfileXE.ora into the initXE.ora to echo spfileNEW_SID_NAME.ora into initNEW_SID_NAME.ora (this part may render the step 3 useless but I prefer to do it anyway, just in case...)
Execute the script... It will prompt you for the SYSTEM password a few times saying
Enter value for 1:
or
Enter value for 2:
That's it, the new database with your NEW_SID_NAME is up and running!!
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.
I have installed Oracle 11g on my Windows 10 machine. I followed all preinstallation requirements.
When trying to log in to the Enterprise manager via this link:
https://localhost:1158/em
I get the error:
Internal Error has occurred. Check the log file for details.
I have found log files and it looks like this is the relevant entry:
2017-09-17 07:36:53,631 [MetricCollector:HOMETAB_THREAD600:60] ERROR rt.DbMetricCollectorTarget _getAllData.344 - java.lang.NullPointerException
java.lang.NullPointerException
at oracle.sysman.emSDK.emd.comm.EMDClient.getURL(EMDClient.java:1570)
at oracle.sysman.emSDK.emd.comm.EMDClient.getConnection(EMDClient.java:1266)
at oracle.sysman.emSDK.emd.comm.EMDClient.getConnection(EMDClient.java:1242)
at oracle.sysman.emSDK.emd.comm.EMDClient.getResponseForRequest(EMDClient.java:1689)
at oracle.sysman.emSDK.emd.comm.EMDClient.getMetrics(EMDClient.java:981)
at oracle.sysman.emo.perf.metric.rt.DbHomeTab._getAllData(DbHomeTab.java:340)
at oracle.sysman.emo.perf.metric.rt.DbHomeTab.getData(DbHomeTab.java:154)
at oracle.sysman.emo.perf.metric.eng.MetricCached.collectCachedData(MetricCached.java:416)
at oracle.sysman.emo.perf.metric.eng.MetricCollectorThread._collectCachedData(MetricCollectorThread.java:605)
at oracle.sysman.emo.perf.metric.eng.MetricCollectorThread.run(MetricCollectorThread.java:325)
at java.lang.Thread.run(Thread.java:595)
I have tried to set the unique name in environment variables, I thought maybe Java was the problem so I updated my JDK to 8. I am still getting the same error, and my SQL Plus will not open, as soon as I put in the correct credentials it closes. Also I have configured a Listener and tested, test was successful.
I managed to fix the issue, turns out it was a time zone issue. The DB time zone and computer time zone were different. Thus the DB Console would not start and was giving the error "EM daemon is not running".
I fixed it by following instructions here.
Also note before I did that I completely uninstalled Oracle and reinstalled it. There were some issues on that install that were causing SQL not to run. But the above is what fixed the Internal Error I was getting.
Make sure the SYSMAN database user is not locked.
select username, account_status from dba_users where username = 'SYSMAN';
If the account status is not OPEN then
alter user SYSMAN account unlock;
Try restarting dbconsole
$ emctl stop dbconsole
$ emctl start dbconsole
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
I needed to change the SID of an Oracle XE database (not the Service Name) to match a production database.
When I tried searching online, most of the pages were describing changing or adding a service name through tnsnames.ora; that's not what I needed to do.
The asktom article has the answer, but the formatting and verbosity makes it hard to follow, so here's a summary:
[XE_HOME] means where Oracle XE is installed. Normally this is C:\oraclexe\app\oracle\product\10.2.0\server.
Make sure you have Administrator privileges or the procedure will fail.
Configure the SPFILE (you can remove the old file if you want)
copy [XE_HOME]\dbs\spfileXE.ora [XE_HOME]\dbs\spfileNEW_SID_NAME.ora
copy [XE_HOME]\database\initXE.ora [XE_HOME]\database\initNEW_SID_NAME.ora
Edit [XE_HOME]\database\initNEW_SID_NAME.ora: It should contain a single line like this: SPFILE='[XE_HOME]\server\dbs/spfileNEW_SID_NAME.ora'
Shutdown and replace the old service with a new:
sqlplus / as sysdba and execute shutdown
lsnrctl stop
oradim -new -sid NEW_SID_NAME -startmode auto -pfile [XE_HOME]\database\initNEW_SID_NAME.ora
oradim -delete -sid XE
lsnrctl start
Update the ORACLE_SID environment property (System Settings > Advanced > Environment)
Force Oracle to register with listener
sqlplus / as sysdba and execute alter system register;
You can verify that the SID was changed by executing the following query: select instance_name from v$instance;
I had some problems with the solution posted by Johannes, so I had to do some extra steps.
When trying to connect to oracle (step 4) by doing sqlplus / as sysdba I got:
ERROR: ORA-12560: TNS:protocol adapter error
The solution for this was executing the following line:
oradim -start -sid NEW_SID_NAME
Then connecting with / worked fine, but trying to connect to NEW_SID_NAME with system or HR got me another problem:
ERROR: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
I checked that with the query select instance_name from v$instance; that the listener would be NEW_SID_NAME, and so did. But running lsnrctl status in the command line or querying select name from dba_services; didn't show NEW_SID_NAME as a listener.
The solution of this problem was executing the followind sentence on sqlplus:
alter system set service_names='NEW_SID_NAME';
Maybe you'll need to execute alter system register; after this also.
After doing this two steps I can connect to the NEW_SID_NAME with system and HR.
Hope it helps
In version 11g, all of the previous solution didn't work... I always get the following error when trying to do the sqlplus / as sysdba :
ERROR: ORA-12560: TNS:protocol adapter error
Luckily I found a script to do what I wanted to do under [XE_HOME]\config\scripts. The script is named XE.bat and it will instantiate a new database from scratch asking you for the sysPassword along the process. So what I did was :
Stop and remove the existing service if any:
oradim -delete -sid XE
Stop the listener
Configure the SPFILE as explained by Johannes
Make a copy of the script XE.bat, you can name it whatever you want
Edit the copy of the script as follows :
Change line "set ORACLE_SID=XE" to "set ORACLE_SID=NEW_SID_NAME"
Change wherever you see "-sid XE" to "-sid NEW_SID_NAME"
Update the line where it calls the "orapwd.exe" command to point to a file called PWDNEW_SID_NAME.ora instead of PWDXE.ora
Update the line that echos the spfileXE.ora into the initXE.ora to echo spfileNEW_SID_NAME.ora into initNEW_SID_NAME.ora (this part may render the step 3 useless but I prefer to do it anyway, just in case...)
Execute the script... It will prompt you for the SYSTEM password a few times saying
Enter value for 1:
or
Enter value for 2:
That's it, the new database with your NEW_SID_NAME is up and running!!