Is there a global variable/parameter I can look at to find the name of the database.
Printable View
Is there a global variable/parameter I can look at to find the name of the database.
In UNIX type: env
In NT type: set
Variable is ORACLE_SID
select global_name from global_name;
I have renamed my database name and when I ran following query
it is giving me old database_name.world
select global_name from global_name;
What needs to be change?
Thanks.
What's the ORACLE_SID???? Your ORACLE_SID should be the new ORACLE_SID before you see the new database name from that query.
This value typically changes when you change your db_name parameter in init.ora. If you don't have that parameter, use:
alter database rename old_db_name to new_db_name.domain
When I did
echo $ORACLE_SID
=> changed database name.
ps -ef | grep -i ora
=>changed database name.
lsnrctl status
=>changed database name.
I don't have any ref. old database name then why am I getting the ref.
to old database name.
Thanks.
jeff:
I getting following error
SQL> alter database rename old_db_name to new_db_name.world;
alter database rename old_db_name to new_db_name.world
*
ERROR at line 1:
ORA-02231: missing or invalid option to ALTER DATABASE
Also,
When I renamed the database why do I need to do resetlog?
Thanks.
Actually, to answer Mary's question, your parameter would be: db_name
ie: show parameter db_name
You can also look it up with:
select * from v$instance;
select * from v$database;
- Magnus
:DQuote:
Originally posted by marist89
alter database rename old_db_name to new_db_name.domain
Actually, its:
alter database rename global_name to new_db_name
Jeff:
I tried but I am getting the same error as before.
Also, when you change the db_name why do I need to do resetlog?
Thanks.
Check metalink ( http://metalink.oracle.com/metalink/...atabase_id=NOT )Quote:
Originally posted by ora_inf
Jeff:
I tried but I am getting the same error as before.
Do you need to open resetlogs? No, probably not. I do it because I have just changed a major parameter of my database. Also, that's the way Oracle recommends to do it (http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=15390.1 )Quote:
Also, when you change the db_name why do I need to do resetlog?
Jeff:
I read the document and check config and init files as suggested. I could not find any ref. old database name.
When I tried "alter database rename....", did not work. I am getting the same error.
I am using oracle 8.0.5
Thanks.
Not really sure what to tell you. I have done it may times myself. The syntax for alter database is at ( http://technet.oracle.com/doc/server...4a.htm#1980962 )
Jeff:
You are right..It worked. I was replacing global_name with
my old database name.
Thanks lot....