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