设为首页 收藏本站
查看: 906|回复: 0

[经验分享] oracle backup controlfile以及查找备份文件目录

[复制链接]

尚未签到

发表于 2018-9-11 11:54:52 | 显示全部楼层 |阅读模式
  Last login: Fri Jul 11 15:25:49 2014 from chenjh
  [oracle@dbachenjh ~]$ sqlplus /nolog

  SQL*Plus:>  Copyright (c) 1982, 2011, Oracle.  All rights reserved.
  SQL> conn /as sysdba
  Connected.

  SQL> >
  Database>  SQL> show parameter dump;----------------查找trace文件的目录
  NAME                                 TYPE        VALUE
  ------------------------------------ ----------- ------------------------------
  background_core_dump                 string      partial
  background_dump_dest                 string      /s01/oracle/diag/rdbms/chenjh/chenjh
  /trace
  core_dump_dest                       string      /s01/oracle/diag/rdbms/chenjh/chenjh
  /cdump
  max_dump_file_size                   string      unlimited
  shadow_core_dump                     string      partial
  user_dump_dest                       string      /s01/oracle/diag/rdbms/chenjh/chenjh
  /trace
  SQL> ho
  [oracle@dbachenjh ~]$ cd /s01/oracle/diag/rdbms/chenjh/chenjh/
  /[oracle@dbachenjh chenjh]$ cd trace/
  [oracle@dbachenjh trace]$ ls alert_chenjh.log
  alert_chenjh.log
  [oracle@dbachenjh trace]$ tail -30f alert_chenjh.log ---查看日志中最后30条信息
  Private strand flush not complete
  Current log# 3 seq# 348 mem# 0: /s01/oracle/oradata/chenjh/redo03.log
  Thread 1 advanced to log sequence 349 (LGWR switch)
  Current log# 2 seq# 349 mem# 0: /s01/oracle/oradata/chenjh/redo02.log
  Fri Jul 11 02:01:02 2014

  Archived Log entry 342 added for thread 1 sequence 348>  Fri Jul 11 07:00:47 2014
  Thread 1 cannot allocate new log, sequence 350
  Private strand flush not complete
  Current log# 2 seq# 349 mem# 0: /s01/oracle/oradata/chenjh/redo02.log
  Thread 1 advanced to log sequence 350 (LGWR switch)
  Current log# 1 seq# 350 mem# 0: /s01/oracle/oradata/chenjh/redo01.log
  Fri Jul 11 07:00:51 2014

  Archived Log entry 343 added for thread 1 sequence 349>  Fri Jul 11 12:00:18 2014
  Thread 1 cannot allocate new log, sequence 351
  Private strand flush not complete
  Current log# 1 seq# 350 mem# 0: /s01/oracle/oradata/chenjh/redo01.log
  Thread 1 advanced to log sequence 351 (LGWR switch)
  Current log# 3 seq# 351 mem# 0: /s01/oracle/oradata/chenjh/redo03.log
  Fri Jul 11 12:00:21 2014

  Archived Log entry 344 added for thread 1 sequence 350>  Fri Jul 11 16:46:10 2014
  alter database backup controlfile to trace
  Backup controlfile written to trace file /s01/oracle/diag/rdbms/chenjh/chenjh/trace/chenjh_ora_23408.trc

  Completed: >  [oracle@dbachenjh trace]$ more chenjh_ora_23408.trc---下面的内容即为控制文件的内容
  Trace file /s01/oracle/diag/rdbms/chenjh/chenjh/trace/chenjh_ora_23408.trc

  Oracle Database 11g Enterprise Edition>  With the Partitioning, OLAP, Data Mining and Real Application Testing options
  ORACLE_HOME = /s01/oracle/proudct/11.2.0.1/db_home1
  System name:    Linux
  Node name:      dbachenjh
  Release:        2.6.32-300.10.1.el5uek
  Version:        #1 SMP Wed Feb 22 17:37:40 EST 2012
  Machine:        x86_64
  VM name:        VMWare Version: 6
  Instance name: chenjh
  Redo thread mounted by this instance: 1
  Oracle process number: 44
  Unix process pid: 23408, image: oracle@dbachenjh (TNS V1-V3)
  *** 2014-07-11 16:46:10.328

  *** SESSION>
  *** CLIENT>  *** SERVICE NAME:(SYS$USERS) 2014-07-11 16:46:10.328
  *** MODULE NAME:(sqlplus@dbachenjh (TNS V1-V3)) 2014-07-11 16:46:10.328
  *** ACTION NAME:() 2014-07-11 16:46:10.328

  -- The following are current System-scope REDO Log Archival>  -- 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="chenjh"
  --
  -- 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=/arch_log'
  -- 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:

  -- >  STARTUP NOMOUNT
  CREATE CONTROLFILE REUSE DATABASE "chenjh" NORESETLOGS  ARCHIVELOG
  MAXLOGFILES 16
  MAXLOGMEMBERS 3
  MAXDATAFILES 100
  MAXINSTANCES 8
  MAXLOGHISTORY 292
  LOGFILE

  GROUP 1 '/s01/oracle/oradata/chenjh/redo01.log' >
  GROUP 2 '/s01/oracle/oradata/chenjh/redo02.log' >
  GROUP 3 '/s01/oracle/oradata/chenjh/redo03.log' >  -- STANDBY LOGFILE
  DATAFILE
  '/s01/oracle/oradata/chenjh/system01.dbf',
  '/s01/oracle/oradata/chenjh/sysaux01.dbf',
  '/s01/oracle/oradata/chenjh/undotbs01.dbf',
  '/s01/oracle/oradata/chenjh/users01.dbf',
  '/s01/oracle/oradata/chenjh/example01.dbf',
  '/s01/oracle/oradata/chenjh/chenjh01.dbf',
  '/s01/oracle/oradata/chenjh/chenjh02.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.

  -->
  -->  -- Recovery is required if any of the datafiles are restored backups,
  -- or if the last shutdown was not normal or immediate.
  RECOVER DATABASE
  -- All logs need archiving and a log switch is needed.
  ALTER SYSTEM ARCHIVE LOG ALL;
  -- 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 '/s01/oracle/oradata/chenjh/temp01.dbf'

  >  -- 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:

  -- >  STARTUP NOMOUNT
  CREATE CONTROLFILE REUSE DATABASE "chenjh" RESETLOGS  ARCHIVELOG
  MAXLOGFILES 16
  MAXLOGMEMBERS 3
  MAXDATAFILES 100
  MAXINSTANCES 8
  MAXLOGHISTORY 292
  LOGFILE

  GROUP 1 '/s01/oracle/oradata/chenjh/redo01.log' >
  GROUP 2 '/s01/oracle/oradata/chenjh/redo02.log' >
  GROUP 3 '/s01/oracle/oradata/chenjh/redo03.log' >  -- STANDBY LOGFILE
  DATAFILE
  '/s01/oracle/oradata/chenjh/system01.dbf',
  '/s01/oracle/oradata/chenjh/sysaux01.dbf',
  '/s01/oracle/oradata/chenjh/undotbs01.dbf',
  '/s01/oracle/oradata/chenjh/users01.dbf',
  '/s01/oracle/oradata/chenjh/example01.dbf',
  '/s01/oracle/oradata/chenjh/chenjh01.dbf',
  '/s01/oracle/oradata/chenjh/chenjh02.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.

  -->
  -->  -- 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 '/s01/oracle/oradata/chenjh/temp01.dbf'

  >  -- End of tempfile additions.
  --


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-571984-1-1.html 上篇帖子: Oracle使用cast() 函数的一个BUG-Coder随手记 下篇帖子: oracle 查看表的信息
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表