SlideShare a Scribd company logo
1 of 4
Control file management
Every oracle database has a control file. A control file contains information about the associated
database that is required for access by an instance, both at startup and during normal operation.
Control file information can be modified only by oracle; no database administrator or user can edit a
control file.
Among other things, a control file contains information such as:--
• The database name.
• The timestamp of database creation.
• The names and locations of associated data files and redo log files.
• Table space information.
• Data file offline ranges.
• The log history.
• Archived log information.
• Backup set and backup piece information.
• Backup data file and redo log information.
• Data file copy information.
• The current log sequence number.
• Checkpoint information.
The database name and timestamp originate at database creation. The database name is taken from
either the name specified by the db_name initialization parameter or the name used in the create
database statement.
Each time that a data file or a redo log file is added to, renamed in, or dropped from the database, the
control file is updated to reflect this physical structure change.
These changes are recorded so that:
Oracle can identify the data files and redo log files to open during database startup. Oracle can identify
files that are required or available in case database recovery is necessary.
View: desc v$controlfile;
To see the location of control files:
Select name from v$controlfile;
To add a control file:
Sql>create pfile from spfile;
1. Shutdown the database gracefully.
2. Edit the init<sid>.ora file
3 Modify the control file parameter and add the location of the new file.
4. Copy the control file physically using ‘cp’ command.
$cd dev/control/
$cp control.ctl control2.ctl
Sql>create spfile from pfile;
Sql>startup
Cloning:
To backup control file:
Sql>Alter database backup controlfile to trace;
Sql>show parameter user_dump_dest
Sql>shutdown immediate
Sql>exit
$cd prod/udump
$ls –ltr
$vi “latest updated file.trc” #here file name is not latest updated file.
Copy the create controlfile script up to character set.
:q
$mkdir clone
$cd clone
$mkdir data log control udump cdump bdump adump arch
$cd
$vi createcontrol.ctl
Click on I to enter INSERT mode and then write click on your mouse.
Change the directory path from prod to clone.
Create controlfile set database “newsid” resetlogs archivelog
Logfile
Group 1’/data/oracle/clone/redolog01.log’ size 50M;
Group 2’/path’ size 50M;
Datafile
‘/data/oracle/clone/system.dbf’
‘/path/sysaux.dbf’
‘/path/undotbs.dbf’
‘/path/users.dbf’
:1,$s/prod/clone/gc
:wq
$cd
Copy the datafiles from prod/data to /home/oracle/clone/data
$cd prod/data
$cp -v *.dbf /home/oracle/clone/data/
Go to parameters file location $ORACLE_HOME/dbs
$cd $ORACLE_HOME/dbs
Copy the init parameter file to clone.
$cp initprod.ora initclone.ora
$vi initclone.ora
:1,$s/prod/clone/gc
:wq
$env |grep ORA
$export ORACLE_SID=clone
$env |grep ORA
$cd
$sqlplus / as sysdba
Sql>startup nomount;
Sql>@createcontrol.ctl
Sql>alter database open resetlogs;
Sql>recover database using backup controlfile; (online)

More Related Content

What's hot

12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storageMonowar Mukul
 
Les 11 Fb Queries
Les 11 Fb QueriesLes 11 Fb Queries
Les 11 Fb Queriesvivaankumar
 
Whitepaper To Study Filestream Option In Sql Server
Whitepaper To Study Filestream Option In Sql ServerWhitepaper To Study Filestream Option In Sql Server
Whitepaper To Study Filestream Option In Sql ServerShahzad
 
Backup and Recovery
Backup and RecoveryBackup and Recovery
Backup and RecoveryAnar Godjaev
 
Test Dml With Nologging
Test Dml With NologgingTest Dml With Nologging
Test Dml With NologgingN/A
 
Move spfile from asm to file system
Move spfile from asm to file systemMove spfile from asm to file system
Move spfile from asm to file systemraviranchi02
 
Introduction to scoop and its functions
Introduction to scoop and its functionsIntroduction to scoop and its functions
Introduction to scoop and its functionsRupak Roy
 
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهم
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهمآموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهم
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهمfaradars
 
eZ Publish cluster unleashed revisited
eZ Publish cluster unleashed revisitedeZ Publish cluster unleashed revisited
eZ Publish cluster unleashed revisitedBertrand Dunogier
 
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 databaseJorge Batista
 
Coffee at DBG- Solr introduction
Coffee at DBG- Solr introduction Coffee at DBG- Solr introduction
Coffee at DBG- Solr introduction Sajindbg Dbg
 
Wso2 Scenarios Esb Webinar July 1st
Wso2 Scenarios Esb Webinar July 1stWso2 Scenarios Esb Webinar July 1st
Wso2 Scenarios Esb Webinar July 1stWSO2
 
Enable archivelod mode in oracle rac12cR1 with asm location
Enable archivelod mode  in oracle rac12cR1 with asm locationEnable archivelod mode  in oracle rac12cR1 with asm location
Enable archivelod mode in oracle rac12cR1 with asm locationDebasish Nayak
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission processK Kumar Guduru
 
Pluggable database 3
Pluggable database 3Pluggable database 3
Pluggable database 3Osama Mustafa
 
Installing Apache Hive, internal and external table, import-export
Installing Apache Hive, internal and external table, import-export Installing Apache Hive, internal and external table, import-export
Installing Apache Hive, internal and external table, import-export Rupak Roy
 
Exadata - BULK DATA LOAD Testing on Database Machine
Exadata - BULK DATA LOAD Testing on Database Machine Exadata - BULK DATA LOAD Testing on Database Machine
Exadata - BULK DATA LOAD Testing on Database Machine Monowar Mukul
 

What's hot (20)

12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage
 
Les 11 Fb Queries
Les 11 Fb QueriesLes 11 Fb Queries
Les 11 Fb Queries
 
Whitepaper To Study Filestream Option In Sql Server
Whitepaper To Study Filestream Option In Sql ServerWhitepaper To Study Filestream Option In Sql Server
Whitepaper To Study Filestream Option In Sql Server
 
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
 
ACLs
ACLsACLs
ACLs
 
Move spfile from asm to file system
Move spfile from asm to file systemMove spfile from asm to file system
Move spfile from asm to file system
 
Introduction to scoop and its functions
Introduction to scoop and its functionsIntroduction to scoop and its functions
Introduction to scoop and its functions
 
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهم
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهمآموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهم
آموزش مدیریت بانک اطلاعاتی اوراکل - بخش پانزدهم
 
eZ Publish cluster unleashed revisited
eZ Publish cluster unleashed revisitedeZ Publish cluster unleashed revisited
eZ Publish cluster unleashed revisited
 
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
 
Coffee at DBG- Solr introduction
Coffee at DBG- Solr introduction Coffee at DBG- Solr introduction
Coffee at DBG- Solr introduction
 
Wso2 Scenarios Esb Webinar July 1st
Wso2 Scenarios Esb Webinar July 1stWso2 Scenarios Esb Webinar July 1st
Wso2 Scenarios Esb Webinar July 1st
 
Enable archivelod mode in oracle rac12cR1 with asm location
Enable archivelod mode  in oracle rac12cR1 with asm locationEnable archivelod mode  in oracle rac12cR1 with asm location
Enable archivelod mode in oracle rac12cR1 with asm location
 
Database decommission process
Database decommission processDatabase decommission process
Database decommission process
 
Pluggable database 3
Pluggable database 3Pluggable database 3
Pluggable database 3
 
Hive commands
Hive commandsHive commands
Hive commands
 
Installing Apache Hive, internal and external table, import-export
Installing Apache Hive, internal and external table, import-export Installing Apache Hive, internal and external table, import-export
Installing Apache Hive, internal and external table, import-export
 
Exadata - BULK DATA LOAD Testing on Database Machine
Exadata - BULK DATA LOAD Testing on Database Machine Exadata - BULK DATA LOAD Testing on Database Machine
Exadata - BULK DATA LOAD Testing on Database Machine
 
Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4Physical_Standby_Database_R12.2.4
Physical_Standby_Database_R12.2.4
 

Viewers also liked

Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql serverVinay Thota
 
Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9tantascosasquenose
 
Startupandshutdown
StartupandshutdownStartupandshutdown
StartupandshutdownVinay Thota
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Viewers also liked (8)

Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
 
Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9Curso basicoseguridadweb slideshare9
Curso basicoseguridadweb slideshare9
 
Startupandshutdown
StartupandshutdownStartupandshutdown
Startupandshutdown
 
Tablespaces
TablespacesTablespaces
Tablespaces
 
Basic commands
Basic commandsBasic commands
Basic commands
 
Backup&recovery
Backup&recoveryBackup&recovery
Backup&recovery
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similar to Manage Oracle control files

Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Recvivaankumar
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.subhani shaik
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_pptmaclean liu
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recoveryArun Sharma
 
D17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlD17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlMoeen_uddin
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recoveryaltistory
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userDesty Yani
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productionsOsama Mustafa
 
Administration and Management of Users in Oracle / Oracle Database Storage st...
Administration and Management of Users in Oracle / Oracle Database Storage st...Administration and Management of Users in Oracle / Oracle Database Storage st...
Administration and Management of Users in Oracle / Oracle Database Storage st...rajeshkumarcse2001
 
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 asmSurender Martha
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklistpraveen_01236
 
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 cloneDeepti 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 cloneDeepti Singh
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database BackupHandy_Backup
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)than sare
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Conceptsvivaankumar
 

Similar to Manage Oracle control files (20)

Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
 
Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.Rman cloning when both directory and db name are same.
Rman cloning when both directory and db name are same.
 
control_file.pdf
control_file.pdfcontrol_file.pdf
control_file.pdf
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
Oracle database hot backup and recovery
Oracle database hot backup and recoveryOracle database hot backup and recovery
Oracle database hot backup and recovery
 
D17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sqlD17316 gc20 l05_phys_sql
D17316 gc20 l05_phys_sql
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan user
 
Refresh development from productions
Refresh development from productionsRefresh development from productions
Refresh development from productions
 
Administration and Management of Users in Oracle / Oracle Database Storage st...
Administration and Management of Users in Oracle / Oracle Database Storage st...Administration and Management of Users in Oracle / Oracle Database Storage st...
Administration and Management of Users in Oracle / Oracle Database Storage st...
 
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
 
Backup andrecoverychecklist
Backup andrecoverychecklistBackup andrecoverychecklist
Backup andrecoverychecklist
 
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
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
 
Oracle Database Backup
Oracle Database BackupOracle Database Backup
Oracle Database Backup
 
Createclone
CreatecloneCreateclone
Createclone
 
Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)Mid term &amp; final- preparation- student-review(Oracle)
Mid term &amp; final- preparation- student-review(Oracle)
 
Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
 

Recently uploaded

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Manage Oracle control files

  • 1. Control file management Every oracle database has a control file. A control file contains information about the associated database that is required for access by an instance, both at startup and during normal operation. Control file information can be modified only by oracle; no database administrator or user can edit a control file. Among other things, a control file contains information such as:-- • The database name. • The timestamp of database creation. • The names and locations of associated data files and redo log files. • Table space information. • Data file offline ranges. • The log history. • Archived log information. • Backup set and backup piece information. • Backup data file and redo log information. • Data file copy information. • The current log sequence number. • Checkpoint information. The database name and timestamp originate at database creation. The database name is taken from either the name specified by the db_name initialization parameter or the name used in the create database statement. Each time that a data file or a redo log file is added to, renamed in, or dropped from the database, the control file is updated to reflect this physical structure change. These changes are recorded so that: Oracle can identify the data files and redo log files to open during database startup. Oracle can identify files that are required or available in case database recovery is necessary. View: desc v$controlfile;
  • 2. To see the location of control files: Select name from v$controlfile; To add a control file: Sql>create pfile from spfile; 1. Shutdown the database gracefully. 2. Edit the init<sid>.ora file 3 Modify the control file parameter and add the location of the new file. 4. Copy the control file physically using ‘cp’ command. $cd dev/control/ $cp control.ctl control2.ctl Sql>create spfile from pfile; Sql>startup Cloning: To backup control file: Sql>Alter database backup controlfile to trace; Sql>show parameter user_dump_dest Sql>shutdown immediate Sql>exit $cd prod/udump $ls –ltr $vi “latest updated file.trc” #here file name is not latest updated file. Copy the create controlfile script up to character set. :q $mkdir clone $cd clone
  • 3. $mkdir data log control udump cdump bdump adump arch $cd $vi createcontrol.ctl Click on I to enter INSERT mode and then write click on your mouse. Change the directory path from prod to clone. Create controlfile set database “newsid” resetlogs archivelog Logfile Group 1’/data/oracle/clone/redolog01.log’ size 50M; Group 2’/path’ size 50M; Datafile ‘/data/oracle/clone/system.dbf’ ‘/path/sysaux.dbf’ ‘/path/undotbs.dbf’ ‘/path/users.dbf’ :1,$s/prod/clone/gc :wq $cd Copy the datafiles from prod/data to /home/oracle/clone/data $cd prod/data $cp -v *.dbf /home/oracle/clone/data/ Go to parameters file location $ORACLE_HOME/dbs $cd $ORACLE_HOME/dbs Copy the init parameter file to clone. $cp initprod.ora initclone.ora $vi initclone.ora
  • 4. :1,$s/prod/clone/gc :wq $env |grep ORA $export ORACLE_SID=clone $env |grep ORA $cd $sqlplus / as sysdba Sql>startup nomount; Sql>@createcontrol.ctl Sql>alter database open resetlogs; Sql>recover database using backup controlfile; (online)