Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle database add and move control files

Shulou Source: shulou.com Published: 2022-06-01 07:09:10 10月01日 Update

The procedure for configuring Oracle database control file redundancy:

SQL > set lines 200

SQL > col name for A50

SQL > select * from v$controlfile

STATUS NAME IS_ BLOCK_SIZE FILE_SIZE_BLKS

/ data/cams/control01.ctl NO 16384 692

/ data/cams/control02.ctl NO 16384 992 two control files are found here in one path, which is obviously not safe, and now the control files are redundant.

View spfile information:

SQL > show parameter pfile

NAME TYPE VALUE

-

Spfile string / oradata/oracle/product/11.2.0

/ db_1/dbs/spfilecams.ora close the database and create a pfile file

SQL > create pfile from spfile

SQL >! ls / oradata/oracle/product/11.2.0/db_1/dbs

Hc_cams.dat initcams.ora init.ora lkCAMS orapwcams snapcf_cams.f spfilecams.ora

SQL >! vi / oradata/oracle/product/11.2.0/db_1/dbs/initcams.ora

Modify the content of * .control _ files='/data/cams/control01.ctl','/data/cams/control02.ctl' to

* .create path for control_files='/data/cams/control01.ctl','/file/cams/controlfile/control02.ctl','/backup/cams/controlfile/control03.ctl'

Mkdir-p / file/cams/controlfile

Mkdir-p / backup/cams/controlfile copies the existing control file to the storage path

SQL >! ls / file/cams/controlfile

Control02.ctl

SQL >! ls / backup/cams/controlfile

Control03.ctl starts oracle through pfile and creates a new spfile

SQL > startup pfile='/oradata/oracle/product/11.2.0/db_1/dbs/initcams.ora'

SQL > create spfile from pfile

SQL > shutdown immediate

SQL > startup

Summarize the operation process:

(2) View the path where spfile is located

(3) shut down the database normally

(4) use spfile file to create pfile file

(5) modify the CONTROL_FILES parameter in the pfile file to the latest control file information

(7) start oracle through pfile and create a new spfile

(8) close the database and start the database with spfile parameter file

Other instructions:

(1) if the database is started with pfile and there is no spfile, you can omit the switching process between spfile and pfile and modify pfile directly.

(2) the operation in this paper can not be modified after spfile is converted into pfile, and the CONTROL_FILES parameter information can be changed by using the command alter system set control_files = XXX scope=spfile;.

(3) it is recommended to check the v$controlfile and the physical control file on the server after the modification is completed.

(4) if there are useless control files after the completion of the operation, for example, the original control files are not needed, it is recommended to delete the useless control files after the completion of the operation to avoid system junk files.

Tags: File control data database information path parameter procedure redundancy dictionary suggestion copy security no two location content command garbage where Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Xiaomi NVidia MySQL Apple