Get the App
SLTechnology News&Howtos  ›  Database  › 

How to add control files to the database

Shulou Source: shulou.com Published: 2022-05-31 14:39:41 10月03日 Update

This article mainly explains "how to add control files to the database". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. let's study and learn how to add control files to the database.

1. Consistency shuts down database

Shutdown immediate

two。 Create a pfile through spfile

Create pfile from spfile

3. Modify pfile to add a control file

Vi pfile

4. Copy a new control file from an existing control file on the operating system

Cp new control file from control file that already exist

The control file path is / u01/app/oracle/product/fast_recovery_area

Must be changed to an absolute path in Pfile, otherwise an error will be reported.

From pfile must be absolute path

ORA48140 the specified ADR Base directory does not exist [u01/app/oracle]

ORA48187 specified directory does not exist

Cd / u01/app/oracle/product/fast_recovery_area/sales

Cp control02.ctl control03.ctl

5. Brush the pfile content on spfile

Create spfile from pfile

6. Start the database to nomount

SQL > startup nomount

ORA-09925:Unable to create audit trail file

Linux-x86_64 Error:2: No such file or directory

Additional information: 9925

It is found that the audit file path does not exist and there is no orcl/adump under admin. Create this file and solve the problem.

Audit file does extist, create orcl/adump under admin to solve

Touch / u01/app/oracle/product/admin/orcl/adump

7. Start the database to mount

Startup nomount

Alter database mount

Startup

Rebuild control file (use with caution, redo will be reset)

Recreate control file (be careful, it will reset redo log)

.SQL > alter database backup controlfile to trace as'/ u01ax controlfile'

Database altered

SQL > CREATE CONTROLFILE REUSE DATABASE "SALES" RESETLOGS NOARCHIVELOG

2 MAXLOGFILES 16

3 MAXLOGMEMBERS 3

4 MAXDATAFILES 100

5 MAXINSTANCES 8

6 MAXLOGHISTORY 292

7 LOGFILE

8 GROUP 1'/ u01 BLOCKSIZE BLOCKSIZE 512 Baseball sales SIZE redo01.log'

9 GROUP 2'/ u01 BLOCKSIZE BLOCKSIZE 512 Baseball salesman SIZE redo02.log'

10 GROUP 3'/ u01 SIZE Baseball Saleship redo03.log' Universe 50m BLOCKSIZE

11-- STANDBY LOGFILE

12 DATAFILE

13'/ u01Universe Baseball salespool system01.dbf'

14'/ u01Universe Baseball salespool sysaux01.dbf'

15'/ u01Universe basebank salesaccount undotbs01.dbf'

16'/ u01Universe Baseball salesaccount users01.dbf'

17'/ u01GUO1GUSTAGUSTAGULAR salesaccount example01.dbf'

18 CHARACTER SET WE8MSWIN1252

19

Control file created.

Thank you for your reading. the above is the content of "how to add control files to the database". After the study of this article, I believe you have a deeper understanding of how to add control files to the database. The specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: File control data database content path learning consistency operating system consistency that is ideas situations articles more knowledge knowledge points articles systems follow Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft macOS Shulou Technology Huawei