【Oracle Database】数据库控制文件管理
admin
2023-04-19 08:02:20
0
移动控制文件
[oracle@wallet01 ~]$ sqlplus / as sysdba
SQL> set line 200
SQL> col name for a60
SQL> select status,name from v$controlfile;

STATUS  NAME
------- ------------------------------------------------------------
        /u01/app/oracle/oradata/wallet/control01.ctl
        /u01/app/oracle/fast_recovery_area/wallet/control02.ctl
                      
SQL> alter system set control_files=
'/u01/app/oracle/oradata/wallet/control01.ctl',
'/u02/app/oracle/oradata/wallet/control02.ctl' scope=spfile;
System altered.

SQL> shutdown immediate   
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@wallet01 ~]$ cp /u01/app/oracle/oradata/wallet/control01.ctl /u02/app/oracle/oradata/wallet/control02.ctl

[oracle@wallet01 ~]$ sqlplus / as sysdba
SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2260088 bytes
Variable Size             335545224 bytes
Database Buffers          725614592 bytes
Redo Buffers                5517312 bytes
Database mounted.
Database opened.

SQL> set line 200
SQL> col name for a60
SQL> select status,name from v$controlfile;

STATUS  NAME
------- ------------------------------------------------------------
        /u01/app/oracle/oradata/wallet/control01.ctl
        /u02/app/oracle/oradata/wallet/control02.ctl
                      
SQL> host rm -rf /u01/app/oracle/flash_recovery_area/wallet/control02.ctl


重建控制文件
SQL> show parameter user_dump_dest
NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
user_dump_dest                       string                            /u01/app/oracle/diag/rdbms/kin
                                                                       g/wallet/trace
                                                                       
SQL> alter session set tracefile_identifier='trace_control';
Session altered.

SQL> alter database backup controlfile to trace;
Database altered.

[oracle@wallet01 ~]$ cd /u01/app/oracle/diag/rdbms/wallet/wallet/trace

[oracle@wallet01 trace]$ more wallet_ora_28356_trace_control.trc

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> host rm -rf /u01/app/oracle/oradata/wallet/control01.ctl

SQL> host rm -rf /u02/app/oracle/oradata/wallet/control02.ctl

SQL> startup nomount
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2260088 bytes
Variable Size             335545224 bytes
Database Buffers          725614592 bytes
Redo Buffers                5517312 bytes

SQL> CREATE CONTROLFILE REUSE DATABASE "WALLET" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '/u01/app/oracle/oradata/wallet/redo01a.log',
    '/u02/app/oracle/oradata/wallet/redo01b.log'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 2 (
    '/u01/app/oracle/oradata/wallet/redo02a.log',
    '/u02/app/oracle/oradata/wallet/redo02b.log'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 3 (
    '/u01/app/oracle/oradata/wallet/redo03a.log',
    '/u02/app/oracle/oradata/wallet/redo03b.log'
  ) SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/wallet/system01.dbf',
  '/u01/app/oracle/oradata/wallet/sysaux01.dbf',
  '/u01/app/oracle/oradata/wallet/undotbs01.dbf',
  '/u01/app/oracle/oradata/wallet/users01.dbf',
  '/u01/app/oracle/oradata/wallet/soe01.dbf',
  '/u01/app/oracle/oradata/wallet/soe02.dbf',
CHARACTER SET AL32UTF8;
Control file created.

SQL> shutdown abort    
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2260088 bytes
Variable Size             335545224 bytes
Database Buffers          725614592 bytes
Redo Buffers                5517312 bytes
Database mounted.
Database opened.


相关内容

热门资讯

自控所推动GNC专业智能化升级 来源:滚动播报 (来源:中国航空报) 本报讯 5月6日,航空工业自控所召开 GNC+AI关键技术研发...
华电电力申请数据库访问方法专利... 国家知识产权局信息显示,华电电力科学研究院有限公司申请一项名为“数据库访问方法、装置、设备及介质”的...
苏州率先打造数据流通利用新范式 数据,作为第五大生产要素 具有流动性强、非消耗性、非均质性等特点 苏州率先打造数据流通利用新范式 夯...
伊媒披露伊美新一轮谈判5个先决... 当地时间5月12日,据伊朗法尔斯通讯社援引知情人士消息报道,伊朗对与美国新一轮谈判提出的5个先决条件...
英国将向霍尔木兹海峡多国护航行... 当地时间12日,总台记者从英国国防部获悉,英国将向在霍尔木兹海峡执行任务的多国护航行动提供无人机、战...
强化技术引领场景培育政策保障 ... 5月11日,省长叶建春就脑机接口技术与产业创新工作开展专题调研。他强调,脑机接口是培育未来产业发展新...
上海交大王如竹教授领衔撰写的“... 4月30日,国际制冷学会(IIR,International Institute of Refrig...
非人类身份蔓延:智能体AI真正... 长期以来,企业依赖服务账户、API密钥、OAuth令牌等各类非人类身份凭证,使不同服务能够在数字环境...
脑机接口“狂飙” 从病房走向多... (记者 陈锦锋)当大脑的神经信号能够直接与外部设备对话,“心想事成”便从科幻走向现实。近日,中南大学...
中巴外长通话,王毅:希望巴方保... 2026年5月12日晚,中共中央政治局委员、外交部长王毅同巴基斯坦副总理兼外长达尔通电话。达尔介绍了...