Solved

change-database-name

Posted on 2011-03-20
5
417 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
  • 2
  • 2
5 Comments
 

Author Comment

by:nobleit
Comment Utility
Any experts please help me to continue next step..
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
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 20

Expert Comment

by:Amitkumar Panchal
Comment Utility
Follow the steps given in the below link.

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

Author Comment

by:nobleit
Comment Utility
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 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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 video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now