Home » RDBMS Server » Server Administration » How to start/access additional database created from command line
icon5.gif   How to start/access additional database created from command line [message #390655] Mon, 09 March 2009 03:36 Go to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
Hi guys
I just had completed creating additional database for testing purposes. Seems everything during the creation of the database were pretty successful.
However I am confused with following:
How I can establish a successful connection to the new database I created. The new database name is 'ORA10'. I had a full enterprise installation the database created defaul is 'local'.
Should I need to create an additional listner for the new database?
Appreciate incase if somebody would provide me the guidelines.

Thanks and regards,

Re: How to start/access additional database created from command line [message #390660 is a reply to message #390655] Mon, 09 March 2009 03:58 Go to previous messageGo to next message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member

What's your database version ( 4 digit)

What's your Operating System??

>>How to start/access additional database created from command line

Try

In Windows

set ORACLE_SID=ORA10

sqlplus "/as sysdba"

startup 

In Unix/Linux

export ORACLE_SID=ORA10

sqlplus "/as sysdba"

startup 

>>How I can establish a successful connection to the new database I created

sqlplus username/password@Connection String

[Updated on: Mon, 09 March 2009 04:03]

Report message to a moderator

Re: How to start/access additional database created from command line [message #390664 is a reply to message #390655] Mon, 09 March 2009 04:04 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Database 2 Day DBA
Database Administrator's Guide
Database Concepts
Database Net Services Administrator's Guide
Database Net Services Reference

Regards
Michel

[Updated on: Mon, 09 March 2009 04:05]

Report message to a moderator

Re: How to start/access additional database created from command line [message #390665 is a reply to message #390660] Mon, 09 March 2009 04:04 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
OS: Windows XP SP3
Database: ORACLE 10G 10.1.0.2

When I tried your tip, I was getting the following error:

D:\oracle\product\10.1.0>set ORACLE_SID=ORA10

D:\oracle\product\10.1.0>sqlplus "/as sysdba"

SQL*Plus: Release 10.1.0.2.0 - Production on Mon Mar 9 12:02:13 2009

Copyright (c) 1982, 2004, Oracle.  All rights reserved.

ERROR:
ORA-12560: TNS:protocol adapter error


Enter user-name: sys
Enter password:mypassword
ERROR:
ORA-12560: TNS:protocol adapter error


Thank you very much for the reply.
Re: How to start/access additional database created from command line [message #390667 is a reply to message #390664] Mon, 09 March 2009 04:06 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
Thank you very much Michel. I will go through the documents you had mentioned.
Re: How to start/access additional database created from command line [message #390668 is a reply to message #390665] Mon, 09 March 2009 04:06 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Database Platform Guide 10g Release 2 (10.2) for Microsoft Windows

Start Oracle service.

Regards
Michel
Re: How to start/access additional database created from command line [message #390669 is a reply to message #390668] Mon, 09 March 2009 04:10 Go to previous messageGo to next message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member

From command prompt.

net start OracleServiceORA10

set ORACLE_SID=ORA10

Then try to connect your database.

Babu
Re: How to start/access additional database created from command line [message #390672 is a reply to message #390669] Mon, 09 March 2009 04:19 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
Hello Babu
I managed to start the database following your tips. Ran a select * from tab command and exit from the SQL prompt.
Tried to connect as you have mentioned with your last post

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pr
oduction
With the Partitioning, OLAP and Data Mining options

D:\oracle\product\10.1.0>sqlplus sys/mypassword@ora10 as sysdba;

SQL*Plus: Release 10.1.0.2.0 - Production on Mon Mar 9 12:14:34 2009

Copyright (c) 1982, 2004, Oracle.  All rights reserved.

ERROR:
ORA-12541: TNS:no listener


I am sure I haven't made certain configurations why which I am getting this error. Could you please help me with this also?

Thanks and regards,

Re: How to start/access additional database created from command line [message #390678 is a reply to message #390672] Mon, 09 March 2009 04:26 Go to previous messageGo to next message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member


>>ORA-12541: TNS:no listener

Fix this error before check your listener status.

start -> run > cmd > lsnrctl status


If it's down; Try to start using

lsnrctl start


Also

Quote:
D:\oracle\product\10.1.0>sqlplus sys/mypassword@ora10 as sysdba;

SQL*Plus: Release 10.1.0.2.0 - Production on Mon Mar 9 12:14:34 2009

Copyright (c) 1982, 2004, Oracle. All rights reserved.


With out listener connect database using..

Set ORACLE_SID=SIDNAMe

sqlplus "/as sysdba"

Babu
Re: How to start/access additional database created from command line [message #390680 is a reply to message #390678] Mon, 09 March 2009 04:37 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
You are right. Finally I managed to connect once after starting the listener which was down using lsnrctl start. However, I did try to start the listner service from the services.msc control panel many times, still was having the same error that TNS error.
Babu, when I installed oracle in my computer, I had created a database during the installation and the ORA10 database is an additional database mostly for learning and testing purpose.

Is it possible for me to run both the database instances at the same time? (My machine has enough resources) or I have to stop on database instance and start the other one manually following your tips?

Thanks for all the assistance you had provided.



Re: How to start/access additional database created from command line [message #390681 is a reply to message #390680] Mon, 09 March 2009 04:42 Go to previous messageGo to next message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member


>>Is it possible for me to run both the database instances at the same time? (My machine has enough resources)

Yes; It's possible.
Re: How to start/access additional database created from command line [message #390686 is a reply to message #390681] Mon, 09 March 2009 04:50 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
Meanwhile I was waiting for your response, I did try to start the default instance, and Yes, I can run both the database instances at the same time.
Thank you very much Babu. You made my day Smile
icon7.gif  Re: How to start/access additional database created from command line [message #391036 is a reply to message #390686] Tue, 10 March 2009 13:58 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
By the way if somebody is following up this thread, the new ORACLE database 'ORA10' could be started automatically by changing the registry value HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/KEY_OraDb10g_home1/ORA_ORA10_AUTOSTART value 'FALSE' with 'TRUE'. This will start both service and instance at the same time. The whole exercises I followed are available here.
http://www.simpleoracle.com/

Hope this would be useful for beginners like me.
Re: How to start/access additional database created from command line [message #391037 is a reply to message #391036] Tue, 10 March 2009 14:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68665
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Thanks for the feedback.

Note that this information is in the documentation I pointed you:
Database Platform Guide 10g Release 2 (10.2) for Microsoft Windows
Chapter 14 Configuration Parameters and the Registry
Section Registry Parameters
Subsection HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_HOME_NAME
ORA_SID_AUTOSTART
among many other useful parameters.

Regards
Michel

Re: How to start/access additional database created from command line [message #391099 is a reply to message #391037] Wed, 11 March 2009 00:53 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
Dear Michel
My primary role at work is to develope oracle applications. Hence my exposure to database related activities were minimal until recent when started R12 implementation and I was asked to set up a test database.
I had come across a number of documents, took the bits from them and managed to get everything online. I had a chance to download the document you pointed yesterday only and yet to go through it.
I thank you and Babu (GentleBabu) for all the assistances provided.

Regards
Re: How to start/access additional database created from command line [message #391126 is a reply to message #391099] Wed, 11 March 2009 03:11 Go to previous messageGo to next message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member


Thanks.

Having one query with you. Why you want to change "Regedit" setting?

If you want to start your database manually then set OracleService<<SID>> = "manual in "Services.msc"

PS: Requesting to you; if you have any further query start new topic; Should be related to oracle.

Babu
Re: How to start/access additional database created from command line [message #391159 is a reply to message #391126] Wed, 11 March 2009 04:52 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
Hi once again Babu
Well I believe the following command:
oradim -new -sid %ORACLE_SID% -intpwd MYSECRETPASSWORD -startmode M

Only creates a service in Windows and after the creation of database, when the user tries to start the service, the service gets started, but the database.
According to the documentation I obtained through following link http://www.dba-oracle.com/oracle9iAS_tips_windows_service.htm if the user wants to start both instance and service, the registry key must be changed to TRUE. Hence the registry modification was made.

Hope I explained it properly.
Re: How to start/access additional database created from command line [message #391176 is a reply to message #391159] Wed, 11 March 2009 06:28 Go to previous message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member


Thanks.
Previous Topic: Users unknown
Next Topic: RMAN Recovery
Goto Forum:
  


Current Time: Wed Jul 03 04:21:00 CDT 2024