oracle增加控制文件

来源:互联网 发布:欧洲女装品牌 知乎 编辑:程序博客网 时间:2024/05/17 05:56

根据官方文档增加一份控制文件


[oracle@kevin ~]$ sqlplus  / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 9 10:36:36 2016

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>show parameter control_files;              --查看当前数据库控制文件路径

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u01/app/oracle/oradata/ora11g
                                                 /control01.ctl, /u01/app/oracl
                                                 e/flash_recovery_area/ora11g/c
                                                 ontrol02.ctl
SQL>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !cp /u01/app/oracle/oradata/ora11g/control01.ctl /u01/app/control03.ctl            --拷贝一份并且该名称

SQL> startup nomount
ORACLE instance started.

Total System Global Area 1570009088 bytes
Fixed Size            2213696 bytes
Variable Size          922749120 bytes
Database Buffers      637534208 bytes
Redo Buffers            7512064 bytes
SQL> alter system set control_files='/u01/app/oracle/oradata/ora11g/control01.ctl','/u01/app/oracle/flash_recovery_area/ora11g/control02.ctl','/u01/app/control03.ctl' scope=spfile;             --修改spfile中控制文件参数

System altered.

SQL> shutdown immediate
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 1570009088 bytes
Fixed Size            2213696 bytes
Variable Size          922749120 bytes
Database Buffers      637534208 bytes
Redo Buffers            7512064 bytes
Database mounted.
Database opened.
SQL> show parameter control_files;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                         string     /u01/app/oracle/oradata/ora11g
                                                 /control01.ctl, /u01/app/oracl
                                                 e/flash_recovery_area/ora11g/c
                                                 ontrol02.ctl, /u01/app/control
                                                 03.ctl
SQL>
0 0