In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to create a script for generating control files. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Create a build control file script
[put the creation statement of the current controlfile file into the trace file] backup control file
Alter database backup controlfile to trace as'e:\ bak_controlfile.txt'
If you can no longer back up the control file, you can create a control file in another library by changing the path and instance name, all in the same format.
According to the generated bak_controlfile.txt file, write the script create_cfile.sql for rebuilding the control file and put it under disk E.
SQL > shutdown immediate
SQL > startup nomount
SQL > @ e:\ create_file.sql
If the statement used is NORESETLOGS NOARCHIVELOG
SQL > ALTER DATABASE OPEN;-- opening the library
-- rebuilding temporary tablespaces
SQL > ALTER TABLESPACE TEMP ADD TEMPFILE'e:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ TEMP01.DBF'
SIZE 314572800 REUSE AUTOEXTEND ON NEXT 52428800 MAXSIZE 32767M
If the statement used is RESETLOGS NOARCHIVELOG
SQL > ALTER DATABASE OPEN RESETLOGS
-- rebuilding temporary tablespaces
SQL > ALTER TABLESPACE TEMP ADD TEMPFILE'e:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ TEMP01.DBF'
SIZE 314572800 REUSE AUTOEXTEND ON NEXT 52428800 MAXSIZE 32767M
View log files, temporary tablespace files, data files after completion
Select * from v$logfile
Select * from v$tempfile
Select * from v$datafile
An example of a script to rebuild a control file:
CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO01.LOG' SIZE 50m BLOCKSIZE 512
GROUP 2'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO02.LOG' SIZE 50m BLOCKSIZE 512
GROUP 3'E:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ REDO03.LOG' SIZE 50m BLOCKSIZE 512
DATAFILE
'e:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ SYSTEM01.DBF'
'e:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ SYSAUX01.DBF'
'e:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ UNDOTBS01.DBF'
'e:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ USERS01.DBF'
'e:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ EMR01.DBF'
'e:\ APP\ ADMINISTRATOR\ ORADATA\ ORCL\ EMPI01.DBF'
CHARACTER SET ZHS16GBK
Note:
There is a sentence in the creation statement in E:\ bak_controlfile.txt-STANDBY LOGFILE is commented out, but it should also be deleted, otherwise an error will be reported during execution.
This is the end of the article on "how to create a script for generating control files". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.