Home » RDBMS Server » Server Administration » confusion in copying a database
confusion in copying a database [message #140260] Mon, 03 October 2005 05:02 Go to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member
hello to all,

I have a database named "testdb" and instance name as "testdb" .

I thought to copy the database with new name as "clone_db" on the same machine. After editing pfile and controlfile , i thought to create a new service with the same name i.e. "clone_db" and a new password file with "pwdclone_db.ora". After doing the same i turned off the oracleservice for "testdb" and started the service "clone_db" and set environment variable ORACLE_SID to "clone_db" but now when i open SQL*plus i get

 ORA-12560 : TNS protocol adapter error


so then i closed the service for "clone_db" , set the ORACLE_SID back to "testdb" and then tried to login to SQL*plus and i was able to login.

Then i followed the procedure and the database is renamed to "clone_db" but the instance name is still "testdb".

 

SQL> select name from v$database;

NAME
---------
CLONE_DB



SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
testdb




and now see this

SQL> show parameter instance_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------
instance_name                        string      clone_db



i am able to rename the database but not the instance .
I think i am able to make it clear what i did ?

DO i come to a conclusion that we can rename a database but not an instance ?

I am really confused ,Can anyone throw some light on it and also what is the difference in renaming a database and an instance?

thanks & regards
tarun
Re: confusion in copying a database [message #140264 is a reply to message #140260] Mon, 03 October 2005 05:12 Go to previous messageGo to next message
girish.rohini
Messages: 744
Registered: April 2005
Location: Delhi (India)
Senior Member
Did you used INSTANCE_NAME parameter in your init.ors file?

FYI:
INSTANCE_NAME

Parameter type String

Syntax INSTANCE_NAME = instance_id

Default value The instance's SID

Note: The SID identifies the instance's shared memory on a host, but may not uniquely distinguish this instance from other instances.

Parameter class Static

Range of values Any alphanumeric characters

In an Oracle9i Real Application Clusters environment, multiple instances can be associated with a single database service. Clients can override Oracle's connection load balancing by specifying a particular instance by which to connect to the database. INSTANCE_NAME specifies the unique name of this instance.

In a single-instance database system, the instance name is usually the same as the database name.
Re: confusion in copying a database [message #140266 is a reply to message #140264] Mon, 03 October 2005 05:19 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member

yea i did specify instance_name in init.ora file.

see right now , Oracle service "oracleservicetestdb" is started but the database running is "clone_db" and i m proving it through the following output.

SQL> select name from v$database;

NAME
---------
CLONE_DB


SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
testdb

SQL> show parameter instance_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------
instance_name                        string      clone_db



the above O/P is taken from the "clone_db" database. Now i am really confused . Its a test database so no hurry but need to know the reason.

thanks & regards
tarun
Re: confusion in copying a database [message #140282 is a reply to message #140266] Mon, 03 October 2005 07:42 Go to previous message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member


I think i got the solution ,


Oracle doesnt allow to use an underscore "_" in ORACLE_SID name and that was the mistake i did.

so now i was able to fix it

SQL> select name from v$database;

NAME
---------
CLONEDB

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
clonedb

SQL> show parameter instance_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------
instance_name                        string      clonedb



regards,
tarun
Previous Topic: service
Next Topic: RMAN TTS
Goto Forum:
  


Current Time: Thu Sep 26 18:17:43 CDT 2024