oracle backup controlfile以及查找备份文件目录

简介:

Last login: Fri Jul 11 15:25:49 2014 from chenjh

[oracle@dbachenjh ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 11 16:45:46 2014

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

SQL> conn /as sysdba
Connected.
SQL>  alter database backup controlfile to trace;--------备份控制文件到trace

Database altered.

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 ID 0xba3d3cac dest 1:
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 ID 0xba3d3cac dest 1:
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 ID 0xba3d3cac dest 1:
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:  alter database backup controlfile to trace------从日志中看出备份文件的目录及名字


[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 Release 11.2.0.3.0 - 64bit Production
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 ID:(11.64861) 2014-07-11 16:46:10.328
*** CLIENT ID:() 2014-07-11 16:46:10.328
*** 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 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="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:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
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'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '/s01/oracle/oradata/chenjh/redo02.log'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '/s01/oracle/oradata/chenjh/redo03.log'  SIZE 50M BLOCKSIZE 512
-- 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.
-- ALTER DATABASE REGISTER LOGFILE '/arch_log/1_1_762083164.dbf';
-- ALTER DATABASE REGISTER LOGFILE '/arch_log/1_1_848329454.dbf';
-- 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'
     SIZE 30408704  REUSE AUTOEXTEND ON NEXT 5242880  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 PERFORMANCE
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'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '/s01/oracle/oradata/chenjh/redo02.log'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '/s01/oracle/oradata/chenjh/redo03.log'  SIZE 50M BLOCKSIZE 512
-- 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.
-- ALTER DATABASE REGISTER LOGFILE '/arch_log/1_1_762083164.dbf';
-- ALTER DATABASE REGISTER LOGFILE '/arch_log/1_1_848329454.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 '/s01/oracle/oradata/chenjh/temp01.dbf'
     SIZE 30408704  REUSE AUTOEXTEND ON NEXT 5242880  MAXSIZE 32767M;
-- End of tempfile additions.
--

 


本文转自 abc3486389 51CTO博客,原文链接:http://blog.51cto.com/1336014/1437168

相关文章
|
3月前
|
存储 Oracle NoSQL
Oracle 表空间、数据文件、schema的关系
Oracle 表空间、数据文件、schema的关系
43 2
|
2月前
|
XML Java 数据库连接
struts+hibernate+oracle+easyui实现lazyout组件的简单案例——hibernate的config文件(hibernate.cfg.xml)
struts+hibernate+oracle+easyui实现lazyout组件的简单案例——hibernate的config文件(hibernate.cfg.xml)
12 0
|
7月前
|
Oracle 关系型数据库 数据库
9-4 Oracle管理表空间和数据文件
9-4 Oracle管理表空间和数据文件
|
7月前
|
Oracle 关系型数据库 数据库
9-2 Oracle数据库(表)的逻辑备份与恢复 --导出与导入
9-2 Oracle数据库(表)的逻辑备份与恢复 --导出与导入
|
22天前
|
运维 Oracle 安全
Oracle的三重奏:密码文件、警告文件与跟踪文件
【4月更文挑战第19天】Oracle数据库的三大守护者:密码文件保护系统免受未经授权访问,如同宝藏的“密码锁”;警告文件似“哨兵”,记录错误信息,助于及时解决问题;跟踪文件扮演“侦探”角色,详尽记录操作,便于性能优化和故障排查。这三份文件共同确保数据王国的安全与稳定。作为管理员,重视并善用它们是关键。
|
22天前
|
运维 Oracle 关系型数据库
Oracle服务器参数文件:数据王国的“调控大师”
【4月更文挑战第19天】Oracle服务器参数文件,数据库的“调控大师”,掌控着内存管理、进程调度等关键设置。通过参数调整如SGA_MAX_SIZE和PROCESSES,实现性能优化和故障防控。虽然挑战重重,但成功的性能调优带来无尽成就感。它在备份恢复中也扮演重要角色,保障数据一致性与可用性。成为真正的“调控大师”,为数据王国效力!
|
22天前
|
运维 Oracle 关系型数据库
Oracle日志文件:数据王国的“记事本”
【4月更文挑战第19天】Oracle日志文件是数据库稳定运行的关键,记录数据变更历史,用于恢复和故障处理。它们协调并发操作,确保数据一致性和完整性。日志文件实时写入操作信息并定期刷新到磁盘,便于数据恢复。然而,日志文件需备份和归档以保证安全性,防止数据丢失。日志文件,数据王国的“记事本”,默默守护数据安全。
|
22天前
|
存储 Oracle 安全
Oracle控制文件:数据王国的导航仪
【4月更文挑战第19天】Oracle控制文件是数据库的关键组件,存储结构信息和元数据,用于数据库启动、恢复。它指引数据库找到所需文件,保证数据完整性。控制文件的多重备份和定期更新确保其安全可靠。作为数据库导航仪,它对管理员理解和维护数据库至关重要,为数据存储和恢复提供关键支持。
|
22天前
|
存储 监控 Oracle
Oracle数据文件:数据王国的秘密藏宝图
【4月更文挑战第19天】Oracle数据文件是数据库物理存储的核心,存储实际数据,犹如数据王国的宝藏。它们对数据库性能至关重要,影响数据分布和访问效率。有效管理数据文件涉及合理规划大小、数量,监控使用情况,利用自动扩展功能,并能实现跨磁盘存储和高可靠性。理解数据文件原理有助于优化数据库性能和资源利用,发掘更多数据潜力。
|
4月前
|
SQL 存储 Oracle
oracle如何定期备份数据库sql文件
【1月更文挑战第7天】oracle如何定期备份数据库sql文件
58 8

推荐镜像

更多