Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

change-database-name

Posted on 2011-03-20
5
Medium Priority
?
424 Views
Last Modified: 2012-05-11
I am trying to change the name of database orcl123.
SQL> alter database backup controlfile to trace;

Database altered.

SQL> show parameter user_dump_dest;

NAME                                 TYPE        VALUE                          
------------------------------------ ----------- ------------------------------
user_dump_dest                       string      c:\app\mathew\diag\rdbms\compa
                                                 ny\company\trace              

0
Comment
Question by:nobleit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 

Author Comment

by:nobleit
ID: 35176438
Any experts please help me to continue next step..
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35178015
Check out the dbnewid command in the docs.  It should walk you through the steps.

There are a lot of links out there that walk you through the steps.
0
 
LVL 21

Expert Comment

by:Amitkumar Panchal
ID: 35197019
Follow the steps given in the below link.

http://www.adp-gmbh.ch/ora/admin/rename_db.html
0
 

Author Comment

by:nobleit
ID: 35212531
I tried to change the name of database..
I request your further step

This is what I did..
SQL> select name from v$database;

NAME                                                                            
---------                                                                      
COMPANY                                                                        

Elapsed: 00:00:00.00
SQL> alter system switch logfile;

System altered.

Elapsed: 00:00:00.07
SQL> alter database backup controlfile to trace;

Database altered.

Elapsed: 00:00:00.20
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> connect /as sysdba
Connected to an idle instance.
SQL> startup nomount;
ORACLE instance started.




"====This is the trace file=============="
Trace file c:\app\mathew\diag\rdbms\company\company\trace\company_ora_4984.trc
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Windows XP Version V5.1 Service Pack 2
CPU                 : 2 - type 586
Process Affinity    : 0x00000000
Memory (Avail/Total): Ph:471M/1917M, Ph+PgF:2202M/3965M, VA:1301M/2047M
Instance name: company
Redo thread mounted by this instance: 1
Oracle process number: 18
Windows thread id: 4984, image: ORACLE.EXE (SHAD)


*** 2010-11-26 18:32:31.109
*** SESSION ID:(170.3) 2010-11-26 18:32:31.109
*** CLIENT ID:() 2010-11-26 18:32:31.109
*** SERVICE NAME:(SYS$USERS) 2010-11-26 18:32:31.109
*** MODULE NAME:(oradim.exe) 2010-11-26 18:32:31.109
*** ACTION NAME:() 2010-11-26 18:32:31.109
 
kwqmnich: current time::  2: 32: 30
kwqmnich: instance no 0 check_only flag 1
kwqmnich: initialized job cache structure
Trace file c:\app\mathew\diag\rdbms\company\company\trace\company_ora_4984.trc
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Windows XP Version V5.1 Service Pack 2
CPU                 : 2 - type 586
Process Affinity    : 0x00000000
Memory (Avail/Total): Ph:764M/1917M, Ph+PgF:2513M/3965M, VA:1277M/2047M
Instance name: company
Redo thread mounted by this instance: 1
Oracle process number: 18
Windows thread id: 4984, image: ORACLE.EXE (SHAD)


*** 2011-03-24 19:28:25.140
*** SESSION ID:(170.3) 2011-03-24 19:28:25.140
*** CLIENT ID:() 2011-03-24 19:28:25.140
*** SERVICE NAME:(SYS$USERS) 2011-03-24 19:28:25.140
*** MODULE NAME:(sqlplus.exe) 2011-03-24 19:28:25.140
*** ACTION NAME:() 2011-03-24 19:28:25.140
 
tkcrrsarc: (WARN) Failed to find ARCH for message (message:0x1)
tkcrrpa: (WARN) Failed initial attempt to send ARCH message (message:0x1)

*** 2011-03-24 19:28:30.015
kwqmnich: current time::  2: 28: 29
kwqmnich: instance no 0 check_only flag 1

*** 2011-03-24 19:28:30.468
kwqmnich: initialized job cache structure
*** MODULE NAME:(Oracle Enterprise Manager.pin EM plsql) 2011-03-24 19:32:27.000
*** ACTION NAME:(start) 2011-03-24 19:32:27.000
 

*** 2011-03-24 19:32:27.000
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=ARC%S_%R.%T
--
-- DB_UNIQUE_NAME="company"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=4
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=%ORACLE_HOME%\RDBMS
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_10='LOCATION=USE_DB_RECOVERY_FILE_DEST'
-- LOG_ARCHIVE_DEST_10='OPTIONAL REOPEN=300 NODELAY'
-- LOG_ARCHIVE_DEST_10='ARCH NOAFFIRM NOEXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_10='REGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_10='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_10='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_10=ENABLE
--
-- LOG_ARCHIVE_DEST_1='LOCATION=C:\app\Mathew\product\11.1.0\db_1\RDBMS'
-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE
--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
--     Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "COMPANY" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 'C:\APP\MATHEW\ORADATA\COMPANY\REDO01.LOG'  SIZE 50M,
  GROUP 2 'C:\APP\MATHEW\ORADATA\COMPANY\REDO02.LOG'  SIZE 50M,
  GROUP 3 'C:\APP\MATHEW\ORADATA\COMPANY\REDO03.LOG'  SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  'C:\APP\MATHEW\ORADATA\COMPANY\SYSTEM01.DBF',
  'C:\APP\MATHEW\ORADATA\COMPANY\SYSAUX01.DBF',
  'C:\APP\MATHEW\ORADATA\COMPANY\UNDOTBS01.DBF',
  'C:\APP\MATHEW\ORADATA\COMPANY\USERS01.DBF',
  'C:\APP\MATHEW\ORADATA\COMPANY\RMAN01.DBF'
CHARACTER SET WE8MSWIN1252
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE 'C:\APP\MATHEW\FLASH_RECOVERY_AREA\COMPANY\ARCHIVELOG\2011_03_24\O1_MF_1_1_%U_.ARC';
-- ALTER DATABASE REGISTER LOGFILE 'C:\APP\MATHEW\FLASH_RECOVERY_AREA\COMPANY\ARCHIVELOG\2011_03_24\O1_MF_1_1_%U_.ARC';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE 'C:\APP\MATHEW\ORADATA\COMPANY\TEMP01.DBF'
     SIZE 20971520  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
--     Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "COMPANY" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 'C:\APP\MATHEW\ORADATA\COMPANY\REDO01.LOG'  SIZE 50M,
  GROUP 2 'C:\APP\MATHEW\ORADATA\COMPANY\REDO02.LOG'  SIZE 50M,
  GROUP 3 'C:\APP\MATHEW\ORADATA\COMPANY\REDO03.LOG'  SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  'C:\APP\MATHEW\ORADATA\COMPANY\SYSTEM01.DBF',
  'C:\APP\MATHEW\ORADATA\COMPANY\SYSAUX01.DBF',
  'C:\APP\MATHEW\ORADATA\COMPANY\UNDOTBS01.DBF',
  'C:\APP\MATHEW\ORADATA\COMPANY\USERS01.DBF',
  'C:\APP\MATHEW\ORADATA\COMPANY\RMAN01.DBF'
CHARACTER SET WE8MSWIN1252
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE 'C:\APP\MATHEW\FLASH_RECOVERY_AREA\COMPANY\ARCHIVELOG\2011_03_24\O1_MF_1_1_%U_.ARC';
-- ALTER DATABASE REGISTER LOGFILE 'C:\APP\MATHEW\FLASH_RECOVERY_AREA\COMPANY\ARCHIVELOG\2011_03_24\O1_MF_1_1_%U_.ARC';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE
-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE 'C:\APP\MATHEW\ORADATA\COMPANY\TEMP01.DBF'
     SIZE 20971520  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 35214633
What next step?

The link provided by amit_n_panchal has the rest of the steps.  Just keep going?

...START HERE AND KEEP GOING
The instance needs to be shut down. SYSDBA privileges will be needed.
SQL> shutdown
Modify (and optionally rename) the created trace file:
...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question