Oracle控制文件control file(2)查看控制文件内容的三中方法

导读
本文介绍如何查看控制文件的内容

可以通过下面两种方法查看控制文件的内容

  • 使用strings命令查看
  • 使用视图v$controlfile_record_session查看
  • 转储控制文件到一个文本文件,然后查看文本文件的内容
1、使用strings命令查看控制文件内容

strings <控制文件名>

[oracle@db11g ~]$ strings /u01/app/oracle/oradata/PROD11G/control01.ctl
}|{z
PROD11G
BPROD11G
BPROD11G
PROD11G
m*EE
PROD11G
m*EE7N.
m*EE
IL9E
m*EE7N.
m*EE~
m*EE
m*EE
m*EE
m*EE
m*EE
m*EEl
m*EEl
m*EEl
m*EEl
m*EEl
m*EEl
m*EE"
/u01/app/oracle/oradata/PROD11G/redo03.log
/u01/app/oracle/oradata/PROD11G/redo02.log
/u01/app/oracle/oradata/PROD11G/redo01.log
/u01/app/oracle/oradata/PROD11G/users01.dbf
/u01/app/oracle/oradata/PROD11G/undotbs01.dbf
/u01/app/oracle/oradata/PROD11G/sysaux01.dbf
/u01/app/oracle/oradata/PROD11G/system01.dbf
/u01/app/oracle/oradata/PROD11G/temp01.dbf
/u01/app/oracle/oradata/PROD11G/example01.dbf
/u01/app/oracle/oradata/PROD11G/users02.dbf
/u01/app/oracle/oradata/PROD11G/system02.dbf
/u01/app/oracle/oradata/PROD11G/sysaux02.dbf
/u01/app/oracle/oradata/PROD11G/undotbs02.dbf
/u01/app/oracle/oradata/PROD11G/lzy01.dbf
/u01/app/oracle/oradata/PROD11G/lzy02.dbf
/u01/app/oracle/oradata/PROD11G/redo03.log
/u01/app/oracle/oradata/PROD11G/redo02.log
/u01/app/oracle/oradata/PROD11G/redo01.log
/u01/app/oracle/oradata/PROD11G/users01.dbf
/u01/app/oracle/oradata/PROD11G/undotbs01.dbf
/u01/app/oracle/oradata/PROD11G/sysaux01.dbf
/u01/app/oracle/oradata/PROD11G/system01.dbf
/u01/app/oracle/oradata/PROD11G/temp01.dbf
/u01/app/oracle/oradata/PROD11G/example01.dbf
/u01/app/oracle/oradata/PROD11G/users02.dbf
/u01/app/oracle/oradata/PROD11G/system02.dbf
/u01/app/oracle/oradata/PROD11G/sysaux02.dbf
/u01/app/oracle/oradata/PROD11G/undotbs02.dbf
/u01/app/oracle/oradata/PROD11G/lzy01.dbf
/u01/app/oracle/oradata/PROD11G/lzy02.dbf
/u01/app/oracle/oradata/PROD11G/cbo01.dbf
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
EXAMPLE
SYSTEM
SYSAUX
UNDOTBS1
USERS
TEMP
EXAMPLE
Bg]$
B"u3
C8EC
"CnwL
;CPPY
mpUC
mpUCh
C5`f
C)bi
-E*D
/3.D
-E*D
/3.D
5D`q
bY=D
bY=D
'{ZD
'{ZD
pbbD
pbbDqQ
eDK!{mD{mD
{U}D
zU}Dt5;
DRWX
DH!{
IL9E
3E7N.
IL9E
m*EE
Bg]$
B"u3
C8EC
"CnwL
;CPPY
mpUC
mpUCh
C5`f
C)bi
-E*D
/3.D
-E*D
/3.D
5D`q
bY=D
bY=D
'{ZD
'{ZD
pbbD
pbbDqQ
eDK!{mD{mD
{U}D
zU}Dt5;
DRWX
DH!{
IL9E
3E7N.
IL9E
m*EE
m*EE~
u01/app/oracle/oradata/PROD11G/example01.dbf
/u01/app/oracle/oradata/PROD11G/example01.dbf
PROD11G
PROD11G
PROD11G
UNNAMED_INSTANCE_2
UNNAMED_INSTANCE_3
UNNAMED_INSTANCE_4
UNNAMED_INSTANCE_5
UNNAMED_INSTANCE_6
UNNAMED_INSTANCE_7
UNNAMED_INSTANCE_8
PROD11G
UNNAMED_INSTANCE_2
UNNAMED_INSTANCE_3
UNNAMED_INSTANCE_4
UNNAMED_INSTANCE_5
UNNAMED_INSTANCE_6
UNNAMED_INSTANCE_7
UNNAMED_INSTANCE_8
ACM unit testing operation
LSB Database Guard
Supplemental Log Data DDL
LSB Role Change Support
RFS block and kill across RAC
RAC-wide SGA
ACM unit testing operation
LSB Database Guard
Supplemental Log Data DDL
LSB Role Change Support
RFS block and kill across RAC
RAC-wide SGA
2、使用视图v$controlfile_record_session查看

查询视图v$controlfile_record_session中的相关列
SQL>select type,record_size,records_total,records_used from v$controlfile_record_section;

SYS@PROD11G> select controlfile_sequence# from v$database;CONTROLFILE_SEQUENCE#
---------------------209188SYS@PROD11G> select type,record_size,records_total,records_used from v$controlfile_record_section;TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED
---------------------------- ----------- ------------- ------------
DATABASE                             316             1            1
CKPT PROGRESS                       8180            11            0
REDO THREAD                          256             8            1
REDO LOG                              72            16            3
DATAFILE                             520           100           12
FILENAME                             524          2298           16
TABLESPACE                            68           100            8
TEMPORARY FILENAME                    56           100            1
RMAN CONFIGURATION                  1108            50            0
LOG HISTORY                           56           292          137
OFFLINE RANGE                        200           163            0
ARCHIVED LOG                         584            28            0
BACKUP SET                            40           409            0
BACKUP PIECE                         736           200            0
BACKUP DATAFILE                      200           245            0
BACKUP REDOLOG                        76           215            0
DATAFILE COPY                        736           200            1
BACKUP CORRUPTION                     44           371            0
COPY CORRUPTION                       40           409            0
DELETED OBJECT                        20           818            1
PROXY COPY                           928           246            0
BACKUP SPFILE                        124           131            0
DATABASE INCARNATION                  56           292            2
FLASHBACK LOG                         84          2048            0
RECOVERY DESTINATION                 180             1            0
INSTANCE SPACE RESERVATION            28          1055            1
REMOVABLE RECOVERY FILES              32          1000            0
RMAN STATUS                          116           141            0
THREAD INSTANCE NAME MAPPING          80             8            8
MTTR                                 100             8            1
DATAFILE HISTORY                     568            57            0
STANDBY DATABASE MATRIX              400            31           31
GUARANTEED RESTORE POINT             212          2048            0
RESTORE POINT                        212          2083            0
DATABASE BLOCK CORRUPTION             80          8384            0
ACM OPERATION                        104            64            6
FOREIGN ARCHIVED LOG                 604          1002            037 rows selected.SYS@PROD11G>
3、转储控制文件到一个文本文件

使用alter database backup controlfile命令转储一个控制文件
SQL>alter database backup controlfile to trace as ‘/home/oracle/control.sql’;

SYS@PROD11G> alter database backup controlfile to trace as '/home/oracle/control.sql';Database altered.SYS@PROD11G> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options[oracle@db11g ~]$ cat control.sql
-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="PROD11G"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=4
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_1='LOCATION=/u01/app/oracle/product/11g/dbhome_1/dbs/arch'
-- LOG_ARCHIVE_DEST_1='MANDATORY NOREOPEN NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM EXPEDITE NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
--     Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCESTARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "PROD11G" NORESETLOGS  NOARCHIVELOGMAXLOGFILES 16MAXLOGMEMBERS 3MAXDATAFILES 100MAXINSTANCES 8MAXLOGHISTORY 292
LOGFILEGROUP 1 '/u01/app/oracle/oradata/PROD11G/redo01.log'  SIZE 500M BLOCKSIZE 512,GROUP 2 '/u01/app/oracle/oradata/PROD11G/redo02.log'  SIZE 500M BLOCKSIZE 512,GROUP 3 '/u01/app/oracle/oradata/PROD11G/redo03.log'  SIZE 500M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE'/u01/app/oracle/oradata/PROD11G/system01.dbf','/u01/app/oracle/oradata/PROD11G/sysaux01.dbf','/u01/app/oracle/oradata/PROD11G/undotbs01.dbf','/u01/app/oracle/oradata/PROD11G/users01.dbf','/u01/app/oracle/oradata/PROD11G/example01.dbf','/u01/app/oracle/oradata/PROD11G/users02.dbf','/u01/app/oracle/oradata/PROD11G/system02.dbf','/u01/app/oracle/oradata/PROD11G/sysaux02.dbf','/u01/app/oracle/oradata/PROD11G/undotbs02.dbf','/u01/app/oracle/oradata/PROD11G/lzy01.dbf','/u01/app/oracle/oradata/PROD11G/lzy02.dbf','/u01/app/oracle/oradata/PROD11G/cbo01.dbf'
CHARACTER SET AL32UTF8
;-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/product/11g/dbhome_1/dbs/arch1_1_824297850.dbf';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/product/11g/dbhome_1/dbs/arch1_1_1118659776.dbf';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE-- Database can now be opened normally.
ALTER DATABASE OPEN;-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/PROD11G/temp01.dbf'SIZE 30408704  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
--     Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCESTARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "PROD11G" RESETLOGS  NOARCHIVELOGMAXLOGFILES 16MAXLOGMEMBERS 3MAXDATAFILES 100MAXINSTANCES 8MAXLOGHISTORY 292
LOGFILEGROUP 1 '/u01/app/oracle/oradata/PROD11G/redo01.log'  SIZE 500M BLOCKSIZE 512,GROUP 2 '/u01/app/oracle/oradata/PROD11G/redo02.log'  SIZE 500M BLOCKSIZE 512,GROUP 3 '/u01/app/oracle/oradata/PROD11G/redo03.log'  SIZE 500M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE'/u01/app/oracle/oradata/PROD11G/system01.dbf','/u01/app/oracle/oradata/PROD11G/sysaux01.dbf','/u01/app/oracle/oradata/PROD11G/undotbs01.dbf','/u01/app/oracle/oradata/PROD11G/users01.dbf','/u01/app/oracle/oradata/PROD11G/example01.dbf','/u01/app/oracle/oradata/PROD11G/users02.dbf','/u01/app/oracle/oradata/PROD11G/system02.dbf','/u01/app/oracle/oradata/PROD11G/sysaux02.dbf','/u01/app/oracle/oradata/PROD11G/undotbs02.dbf','/u01/app/oracle/oradata/PROD11G/lzy01.dbf','/u01/app/oracle/oradata/PROD11G/lzy02.dbf','/u01/app/oracle/oradata/PROD11G/cbo01.dbf'
CHARACTER SET AL32UTF8
;-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/product/11g/dbhome_1/dbs/arch1_1_824297850.dbf';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/oracle/product/11g/dbhome_1/dbs/arch1_1_1118659776.dbf';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/u01/app/oracle/oradata/PROD11G/temp01.dbf'SIZE 30408704  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
[oracle@db11g ~]$

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/727625.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

银行数字化转型导师坚鹏:银行数字化转型案例研究

银行数字化转型案例研究 课程背景&#xff1a; 数字化背景下&#xff0c;很多银行存在以下问题&#xff1a; 不清楚银行科技金融数智化案例&#xff1f; 不清楚银行供应链金融数智化案例&#xff1f; 不清楚银行普惠金融数智化案例&#xff1f; 不清楚银行跨境金融数智…

【C语言】【字符串函数】【超详解】【上】!!!

前言&#xff1a; 在学习C语言的过程中&#xff0c;字符串、字符数组等对新手来说总是会有疏忽&#xff0c;在已有的库函数中&#xff0c;我们平时用到最多的就是关于字符串的函数&#xff0c;今天我们就来详细学习字符串函数的相关内容。 下面我们就开始讲解字符串函数&#x…

Eclipse左边project框如何打开?

1、点击Eclipse顶端window 2、点击Show View 3、点击Project Explorer。 如下图&#xff08;图片转自其他博主&#xff09;。

大疆这里的工作待遇简直太好了

我来天空之城实习已经一个月了&#xff0c;这里的工作待遇简直太好了&#xff01;在大疆&#xff0c;不仅有舒适的办公椅&#xff0c;可升降的定制工位&#xff0c;还有员工零食间、健身房、下午茶、文创店、理发店&#xff0c;甚至还有羽毛球每日有局。此外&#xff0c;我们还…

自动化测试之web自动化(Selenium)

&#x1f525; 交流讨论&#xff1a;欢迎加入我们一起学习&#xff01; &#x1f525; 资源分享&#xff1a;耗时200小时精选的「软件测试」资料包 &#x1f525; 教程推荐&#xff1a;火遍全网的《软件测试》教程 &#x1f4e2;欢迎点赞 &#x1f44d; 收藏 ⭐留言 &#x1…

大模型日报|今日必读的6篇大模型论文

1.天津大学提出SheetAgent&#xff1a;通过大模型进行电子表格推理和操作 电子表格操作能显著提高工作效率&#xff0c;已经被广泛用于大多数日常工作中。大型语言模型&#xff08;LLM&#xff09;已被尝试用于电子表格的自动操作&#xff0c;但尚未在存在推理挑战的复杂现实任…

关于MediaEval数据集的Dataset构建(Text部分-使用PLM BERT)

import random import numpy as np import pandas as pd import torch from transformers import BertModel,BertTokenizer from tqdm.auto import tqdm from torch.utils.data import Dataset import re """参考Game-On论文""" ""&qu…

C++:设计包含min 函数的栈

目录 题目 代码实现 输出 题目 定义栈的数据结构&#xff0c;要求添加一个min 函数&#xff0c;能够得到栈的最小元素。 要求函数min、push 以及pop 的时间复杂度都是O(1)。 代码实现 #include <iostream>template<typename T>class stack { public:stack() {…

k倍区间c++

题目 输入样例&#xff1a; 5 2 1 2 3 4 5输出样例&#xff1a; 6 思路 本题默认所有读者已经理解了如何求前缀和。 可以利用双层循环分别枚举左端点和右端点即可枚举完所有区间&#xff0c;而对于每个区间&#xff0c;利用一维前缀和判断它是否是一个k倍区间&#xff0c;是…

GraphQL

从表中查询10条数据 {user_info(_limit: 100) {idname} }根据id查询数据 {user_info(_where: {id: 1727515006802587648}_order_by: {create_time: _desc}_limit: 10) {idname} }外键联表查询(特别注意写法:update_by.id): {speaker_info(update_by.id: {_eq: 1729043650301…

外包干了8天,技术退步明显。。。。。

先说一下自己的情况&#xff0c;本科生&#xff0c;19年通过校招进入杭州某软件公司&#xff0c;干了接近3年的功能测试&#xff0c;今年年初&#xff0c;感觉自己不能够在这样下去了&#xff0c;长时间呆在一个舒适的环境会让一个人堕落!而我已经在一个企业干了四年的功能测试…

鸿蒙Harmony应用开发—ArkTS声明式开发(基础手势:PanGesture)

拖动手势事件&#xff0c;当滑动的最小距离超过设定的最小值时触发拖动手势事件。 说明&#xff1a; 从API Version 7开始支持。后续版本如有新增内容&#xff0c;则采用上角标单独标记该内容的起始版本。 接口 PanGesture(value?: { fingers?: number; direction?: PanDir…

sudo command not found

文章目录 一句话Intro其他操作 一句话 sudo 某命令 改成 sudo -i 某命令 试试。 -i 会把当前用户的环境变量带过去&#xff0c;这样在sudo的时候&#xff0c;有更高的权限&#xff0c;有本用户的环境变量(下的程序命令)。 -i, --login run login shell as the target user; a …

腾讯云学生服务器申请入口、续费优惠价格和常见问题解答

2024年腾讯云学生服务器优惠活动「云校园」&#xff0c;学生服务器优惠价格&#xff1a;轻量应用服务器2核2G学生价30元3个月、58元6个月、112元一年&#xff0c;轻量应用服务器4核8G配置191.1元3个月、352.8元6个月、646.8元一年&#xff0c;CVM云服务器2核4G配置842.4元一年&…

Gemini 初体验

1 使用体验 同样需要科学上网。速度很快&#xff0c;而且还不要钱&#xff0c;据说使用太多可能被限流。对于小语种翻译效果比 GPT-4 好&#xff0c;其它还没测试。可通过 ChatBox 界面调用&#xff0c;也可使用 Python 调用。 2 使用 ChatBox 方式调用 在 build with gemin…

【目标分类检测测试指标】

目标分类指标 目标分类指标是指在机器学习和深度学习中&#xff0c;用于衡量模型对目标类别预测准确度的一系列评价标准。以下是一些常见的目标分类指标及其详细说明&#xff0c;并附上Python代码示例&#xff08;以PyTorch为例&#xff09;&#xff1a; 准确率&#xff08;Ac…

应用层协议--HTTP

目录 一.HTTP是什么&#xff1f; 二.HTTP的请求和响应 a.请求&#xff1a; b.响应&#xff1a; 三.URL 四.Header 1.Host 2. Content-Length 3. Content-Type a. 请求 b. 响应 4. Referer 5. User-Agent 6. Cookie 一.HTTP是什么&#xff1f; HTTP是一种应用层协议&#xff0c…

springboot实现多线程开发(使用@Async注解,简单易上手)

根据springboot的核心思想便捷开发&#xff0c;使用多线程也变得简单起来&#xff0c;通过一下几个步骤即可实现。 核心注解 EnableAsync将此注解加在启动类上&#xff0c;使项目支持多线程。 Async 使用我们的Async注解在所需要进行多线程的类上即可实现。 配置线程池 …

算法刷题Day1 | 704.二分查找、27.移除元素

目录 0 引言1 二分查找1.1 我的解题1.2 修改后1.3 总结 2 移除元素2.1 暴力求解2.2 双指针法&#xff08;快慢指针&#xff09; &#x1f64b;‍♂️ 作者&#xff1a;海码007&#x1f4dc; 专栏&#xff1a;算法专栏&#x1f4a5; 标题&#xff1a;代码随想录算法训练营第一天…

【MySQL】子查询优化、排序优化和覆盖索引

一、子查询优化 子查询可以通过一个SQL语句实现比较复杂的查询。但是子查询的效率不高。原因在于 执行子查询时&#xff0c;MySQL为内层查询语句的结果建立一个临时表&#xff0c;在查询结束后&#xff0c;会撤销这些临时表。这就导致消耗过多的CPU和IO资源&#xff0c;产生大…