SlideShare a Scribd company logo
Anar Godjaev

Change DB name.
Step by Step:
SQL> startup mount
ORACLE instance started.
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted.
SQL>

595591168
1220748
209719156
377487360
7163904

bytes
bytes
bytes
bytes
bytes

[oracle@anar ~]$nid
DBNEWID: Release 10.2.0.1.0 - Production on Thu Jul 21 11:52:54 2011
Copyright (c) 1982, 2005, Oracle.

All rights reserved.

Keyword
Description
(Default)
---------------------------------------------------TARGET
Username/Password
(NONE)
DBNAME
New database name
(NONE)
LOGFILE
Output Log
(NONE)
REVERT
Revert failed change
NO
SETNAME
Set a new database name only
NO
APPEND
Append to output log
NO
HELP
Displays these messages
NO
[oracle@anar ~]$ nid target=sys/oracle@anar_f as sysdbadbname=anar_f1
DBNEWID: Release 10.2.0.1.0 - Production on Thu Jul 21 12:19:19 2011
Copyright (c) 1982, 2005, Oracle.

All rights reserved.

Password:
Connected to database ANAR_F (DBID=604182317)
Connected to server version 10.2.0
Control Files in database:
/u01/app/oracle/anar_f/controlfile/control01.ctl
Anar Godjaev
/u01/app/oracle/anar_f/controlfile/control02.ctl
/u01/app/oracle/anar_f/controlfile/control03.ctl
Change database ID and database name ANAR_F to ANAR_F1? (Y/[N]) => y
Proceeding with operation
Changing database ID from 604182317 to 3902868108
Changing database name from ANAR_F to ANAR_F1
Control File /u01/app/oracle/anar_f/controlfile/control01.ctl modified
Control File /u01/app/oracle/anar_f/controlfile/control02.ctl modified
Control File /u01/app/oracle/anar_f/controlfile/control03.ctl modified
Datafile /u01/app/oracle/anar_f/system100.dbf - dbid changed, wrote
new name
Datafile /u01/app/oracle/anar_f/myundo.dbf - dbid changed, wrote new
name
Datafile /u01/app/oracle/anar_f/sysaux100.dbf - dbid changed, wrote
new name
Datafile /u01/app/oracle/anar_f/tsanar01.dbf - dbid changed, wrote new
name
Datafile /u01/app/oracle/anar_f/tsanar02.dbf - dbid changed, wrote new
name
Datafile /u01/app/oracle/anar_f/users01.dbf - dbid changed, wrote new
name
Datafile /u01/app/oracle/anar_f/users02.dbf - dbid changed, wrote new
name
Datafile /u01/ivants.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/pri_rman.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/rman_moni.dbf - dbid changed, wrote new name
Datafile /u01/app/oracle/anar_f/temp01.dbf - dbid changed, wrote new
name
Control File /u01/app/oracle/anar_f/controlfile/control01.ctl - dbid
changed, wrote new name
Control File /u01/app/oracle/anar_f/controlfile/control02.ctl - dbid
changed, wrote new name
Control File /u01/app/oracle/anar_f/controlfile/control03.ctl - dbid
changed, wrote new name
Instance shut down
Database name changed to ANAR_F1.
Modify parameter file and generate a new password file before restarting.
Database ID for database ANAR_F1 changed to 3902868108.
All previous backups and archived redo logs for this database are
Anar Godjaev
unusable.
Database is not aware of previous backups and archived logs in Recovery
Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.
Now we need to change our parameter file:
[oracle@anar ~]$ cd $ORACLE_HOME/dbs
[oracle@anardbs]$ mv initanar_f.ora initanar_f1.ora
[oracle@anardbs]$ vi initanar_f1.ora
Alter the parameter DB_NAME=<newdbname>
[oracle@anardbs]$ export ORACLE_SID=anar_f1
[oracle@anardbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 21 12:24:15 2011
Copyright (c) 1982, 2005, Oracle.

All rights reserved.

Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 595591168 bytes
Fixed Size
1220748 bytes
Variable Size
163581812 bytes
Database Buffers
423624704 bytes
Redo Buffers
7163904 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;
Database altered.
SQL> create spfile from pfile;
File created.
Just to check if is everything ok in the initialization:
Anar Godjaev
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted.
Database opened.
SQL>

595591168
1220748
163581812
423624704
7163904

bytes
bytes
bytes
bytes
bytes

More Related Content

What's hot

Oracle Database 11g Product Family
Oracle Database 11g Product FamilyOracle Database 11g Product Family
Oracle Database 11g Product Family
N/A
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
N/A
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
Deepti Singh
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
Deepti Singh
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
N/A
 
How to create a non managed standby database
How to create a non managed  standby databaseHow to create a non managed  standby database
How to create a non managed standby database
Jorge Batista
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
Anar Godjaev
 

What's hot (17)

Oracle Database 11g Product Family
Oracle Database 11g Product FamilyOracle Database 11g Product Family
Oracle Database 11g Product Family
 
Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windows
 
Rman cloning guide
Rman cloning guideRman cloning guide
Rman cloning guide
 
Db health check
Db health checkDb health check
Db health check
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
Beginbackup
BeginbackupBeginbackup
Beginbackup
 
Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2Install and upgrade Oracle grid infrastructure 12.1.0.2
Install and upgrade Oracle grid infrastructure 12.1.0.2
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
 
Database administration commands
Database administration commands Database administration commands
Database administration commands
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
 
Oracle 11g Installation With ASM and Data Guard Setup
Oracle 11g Installation With ASM and Data Guard SetupOracle 11g Installation With ASM and Data Guard Setup
Oracle 11g Installation With ASM and Data Guard Setup
 
How to create a non managed standby database
How to create a non managed  standby databaseHow to create a non managed  standby database
How to create a non managed standby database
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and Recovery
 
Test Dml With Nologging
Test Dml With NologgingTest Dml With Nologging
Test Dml With Nologging
 

Viewers also liked

Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
Anar Godjaev
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklist
praveen_01236
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
Anar Godjaev
 
La base de données Oracle
La base de données OracleLa base de données Oracle
La base de données Oracle
Bruno Delb
 

Viewers also liked (17)

Tuning SGA
Tuning SGATuning SGA
Tuning SGA
 
Introduction to Oracle RMAN, backup and recovery tool.
Introduction to Oracle RMAN, backup and recovery tool.Introduction to Oracle RMAN, backup and recovery tool.
Introduction to Oracle RMAN, backup and recovery tool.
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
oracle dba
oracle dbaoracle dba
oracle dba
 
Oracle RAC - Standard Edition, Enterprise Edition &amp; One Node
Oracle RAC - Standard Edition, Enterprise Edition &amp; One NodeOracle RAC - Standard Edition, Enterprise Edition &amp; One Node
Oracle RAC - Standard Edition, Enterprise Edition &amp; One Node
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklist
 
Backup and Recovery Procedure
Backup and Recovery ProcedureBackup and Recovery Procedure
Backup and Recovery Procedure
 
La base de données Oracle
La base de données OracleLa base de données Oracle
La base de données Oracle
 
10 ways to improve your rman script
10 ways to improve your rman script10 ways to improve your rman script
10 ways to improve your rman script
 
Data Guard Architecture & Setup
Data Guard Architecture & SetupData Guard Architecture & Setup
Data Guard Architecture & Setup
 
Backup & recovery with rman
Backup & recovery with rmanBackup & recovery with rman
Backup & recovery with rman
 
Backup and Restore of database on 2-Node RAC
Backup and Restore of database on 2-Node RACBackup and Restore of database on 2-Node RAC
Backup and Restore of database on 2-Node RAC
 
10 Problems with your RMAN backup script - whitepaper
10 Problems with your RMAN backup script - whitepaper10 Problems with your RMAN backup script - whitepaper
10 Problems with your RMAN backup script - whitepaper
 
RMAN best practices for RAC
RMAN best practices for RACRMAN best practices for RAC
RMAN best practices for RAC
 
Oracle 11g R2 RAC implementation and concept
Oracle 11g R2 RAC implementation and conceptOracle 11g R2 RAC implementation and concept
Oracle 11g R2 RAC implementation and concept
 
Oracle Cluster Rac
Oracle Cluster RacOracle Cluster Rac
Oracle Cluster Rac
 
alphorm.com - Formation Oracle Database 11g DBA 1 (1Z0-052)
alphorm.com - Formation Oracle Database 11g DBA 1 (1Z0-052)alphorm.com - Formation Oracle Database 11g DBA 1 (1Z0-052)
alphorm.com - Formation Oracle Database 11g DBA 1 (1Z0-052)
 

Similar to Change DB Name

Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2
nesmaddy
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
maclean liu
 
Colvin RMAN New Features
Colvin RMAN New FeaturesColvin RMAN New Features
Colvin RMAN New Features
Enkitec
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly database
Anar Godjaev
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in Dataguard
Jason Arneil
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
Controlfilemanagement
Vinay Thota
 
D17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlD17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sql
Moeen_uddin
 
oracle upgradation
oracle upgradationoracle upgradation
oracle upgradation
influxbob
 

Similar to Change DB Name (20)

br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.doc
 
Oracle data guard configuration in 12c
Oracle data guard configuration in 12cOracle data guard configuration in 12c
Oracle data guard configuration in 12c
 
Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4
 
Less04 Instance
Less04 InstanceLess04 Instance
Less04 Instance
 
Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2
 
Oracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby databaseOracle goldengate 11g schema replication from standby database
Oracle goldengate 11g schema replication from standby database
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
Colvin RMAN New Features
Colvin RMAN New FeaturesColvin RMAN New Features
Colvin RMAN New Features
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly database
 
Migrate from database file system to asm
Migrate from database file system to asmMigrate from database file system to asm
Migrate from database file system to asm
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in Dataguard
 
Controlfilemanagement
ControlfilemanagementControlfilemanagement
Controlfilemanagement
 
Data Guard New Features
Data Guard New FeaturesData Guard New Features
Data Guard New Features
 
D17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlD17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sql
 
Odv oracle customer_demo
Odv oracle customer_demoOdv oracle customer_demo
Odv oracle customer_demo
 
oracle upgradation
oracle upgradationoracle upgradation
oracle upgradation
 
Pluggable database tutorial 2
Pluggable database tutorial 2Pluggable database tutorial 2
Pluggable database tutorial 2
 
Oracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create DatabaseOracle 12cR2 RAC Database Software Installation and Create Database
Oracle 12cR2 RAC Database Software Installation and Create Database
 
Rman backup and recovery 11g new features
Rman backup and recovery 11g new featuresRman backup and recovery 11g new features
Rman backup and recovery 11g new features
 

More from Anar Godjaev

More from Anar Godjaev (20)

Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGate
 
How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vault
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin Güvenliği
 
Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server Kurulum
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon Export
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇
 
Contraints
ContraintsContraints
Contraints
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını Inceleme
 
Conditional Control
Conditional ControlConditional Control
Conditional Control
 
PL/SQL Blocks
PL/SQL BlocksPL/SQL Blocks
PL/SQL Blocks
 
Wait Interface
Wait InterfaceWait Interface
Wait Interface
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasi
 
Parallel Server
Parallel ServerParallel Server
Parallel Server
 
Table Partitions
Table PartitionsTable Partitions
Table Partitions
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
LogMiner
LogMinerLogMiner
LogMiner
 
Undo Management
Undo ManagementUndo Management
Undo Management
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 

Change DB Name

  • 1. Anar Godjaev Change DB name. Step by Step: SQL> startup mount ORACLE instance started. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers Database mounted. SQL> 595591168 1220748 209719156 377487360 7163904 bytes bytes bytes bytes bytes [oracle@anar ~]$nid DBNEWID: Release 10.2.0.1.0 - Production on Thu Jul 21 11:52:54 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Keyword Description (Default) ---------------------------------------------------TARGET Username/Password (NONE) DBNAME New database name (NONE) LOGFILE Output Log (NONE) REVERT Revert failed change NO SETNAME Set a new database name only NO APPEND Append to output log NO HELP Displays these messages NO [oracle@anar ~]$ nid target=sys/oracle@anar_f as sysdbadbname=anar_f1 DBNEWID: Release 10.2.0.1.0 - Production on Thu Jul 21 12:19:19 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Password: Connected to database ANAR_F (DBID=604182317) Connected to server version 10.2.0 Control Files in database: /u01/app/oracle/anar_f/controlfile/control01.ctl
  • 2. Anar Godjaev /u01/app/oracle/anar_f/controlfile/control02.ctl /u01/app/oracle/anar_f/controlfile/control03.ctl Change database ID and database name ANAR_F to ANAR_F1? (Y/[N]) => y Proceeding with operation Changing database ID from 604182317 to 3902868108 Changing database name from ANAR_F to ANAR_F1 Control File /u01/app/oracle/anar_f/controlfile/control01.ctl modified Control File /u01/app/oracle/anar_f/controlfile/control02.ctl modified Control File /u01/app/oracle/anar_f/controlfile/control03.ctl modified Datafile /u01/app/oracle/anar_f/system100.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/anar_f/myundo.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/anar_f/sysaux100.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/anar_f/tsanar01.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/anar_f/tsanar02.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/anar_f/users01.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/anar_f/users02.dbf - dbid changed, wrote new name Datafile /u01/ivants.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/pri_rman.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/rman_moni.dbf - dbid changed, wrote new name Datafile /u01/app/oracle/anar_f/temp01.dbf - dbid changed, wrote new name Control File /u01/app/oracle/anar_f/controlfile/control01.ctl - dbid changed, wrote new name Control File /u01/app/oracle/anar_f/controlfile/control02.ctl - dbid changed, wrote new name Control File /u01/app/oracle/anar_f/controlfile/control03.ctl - dbid changed, wrote new name Instance shut down Database name changed to ANAR_F1. Modify parameter file and generate a new password file before restarting. Database ID for database ANAR_F1 changed to 3902868108. All previous backups and archived redo logs for this database are
  • 3. Anar Godjaev unusable. Database is not aware of previous backups and archived logs in Recovery Area. Database has been shutdown, open database with RESETLOGS option. Succesfully changed database name and ID. DBNEWID - Completed succesfully. Now we need to change our parameter file: [oracle@anar ~]$ cd $ORACLE_HOME/dbs [oracle@anardbs]$ mv initanar_f.ora initanar_f1.ora [oracle@anardbs]$ vi initanar_f1.ora Alter the parameter DB_NAME=<newdbname> [oracle@anardbs]$ export ORACLE_SID=anar_f1 [oracle@anardbs]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 21 12:24:15 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 595591168 bytes Fixed Size 1220748 bytes Variable Size 163581812 bytes Database Buffers 423624704 bytes Redo Buffers 7163904 bytes Database mounted. ORA-01589: must use RESETLOGS or NORESETLOGS option for database open SQL> alter database open resetlogs; Database altered. SQL> create spfile from pfile; File created. Just to check if is everything ok in the initialization:
  • 4. Anar Godjaev SQL> shut immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area Fixed Size Variable Size Database Buffers Redo Buffers Database mounted. Database opened. SQL> 595591168 1220748 163581812 423624704 7163904 bytes bytes bytes bytes bytes