首页 > 数据库 >Linux下Oracle11G数据备份恢复(RMAN)

Linux下Oracle11G数据备份恢复(RMAN)

时间:2023-11-24 16:36:25浏览次数:49  
标签:umpay DataBase app 数据备份 orcl oracle RMAN Oracle11G

  1. 数据库安装参考步骤1--14
https://www.cnblogs.com/baixisuozai/p/17852235.html
  1. 创建初始pfile文件
$ vim init.umpay.ora
文件内容:
umpay.__java_pool_size=4194304
umpay.__large_pool_size=4194304
umpay.__oracle_base='/DataBase/app/oracle'#ORACLE_BASE set from environment
umpay.__pga_aggregate_target=167772160
umpay.__sga_target=243269632
umpay.__shared_io_pool_size=0
umpay.__shared_pool_size=176160768
umpay.__streams_pool_size=8388608
*.audit_file_dest='/DataBase/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/DataBase/app/oracle/oradata/orcl/control01.ctl','/DataBase/app/oracle/flash_recovery_area/orcl/control02.ct
l'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/DataBase/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/DataBase/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=umpayXDB)'
*.log_archive_dest_1='location=/DataBase/app/oracle/archive'
*.memory_max_target=4966055936
*.memory_target=4966055936
*.open_cursors=300
*.pga_aggregate_target=2475687936
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2475687936
*.shared_pool_size=2147483648
*.undo_tablespace='UNDOTBS1'

【可以从rman备份的spfile文件中获取以上配置信息】
  1. 根据pfile文件,创建对应的文件目录
mkdir /DataBase/app/oracle
mkdir /DataBase/app/oracle/admin/orcl/adump
mkdir /DataBase/app/oracle/oradata/orcl/
mkdir /DataBase/app/oracle/flash_recovery_area/orcl/
mkdir /DataBase/app/oracle/flash_recovery_area
mkdir /DataBase/app/oracle/archive
  1. 使用配置文件启动数据库
sqlplus / as sysdba
shutdown immediate
startup nomount pfile='/home/oracle/init.umpay.ora';
  1. 恢复控制文件
$ rman target /
RMAN> restore controlfile from '/home/oracle/backup/ctl_be2c88dk_1_1_20231124.ctl';
RMAN> alter database mount;
  1. 恢复数据库
RMAN> crosscheck backup;
RMAN> crosscheck archivelog all;
RMAN> delete noprompt expired backup;
RMAN> delete noprompt expired archivelog all;
RMAN> catalog start with '/home/oracle/backup/';
Do you really want to catalog the above files (enter YES or NO)? YES  //【输入YES】
cataloging files...
cataloging done
RMAN> crosscheck backup;
RMAN> restore database;
RMAN> recover database;
unable to find archived log
archived log thread=1 sequence=22421
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/24/2023 15:51:36
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 22421 and starting SCN of 505305385
【修改命令如下,再次执行。】
RMAN> recover database until scn=505305385;

  1. 启动数据库
export ORACLE_SID=orcl
sqlplus / as sysdba
SQL> alter database open resetlogs;
SQL> shutdown immediate;
SQL> startup mount;
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/DataBase/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora'
解决办法:
把可用的pfile文件覆盖报错文件
$ cp /home/oracle/init.umpay.ora /DataBase/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora
SQL> alter database open;
  1. 创建数据库监听文件
$ vim listener.ora
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.133.21)(PORT = 1521))
    )
  )
ADR_BASE_LISTENER = /DataBase/app/oracle

$ vim tnsnames.ora
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.133.21)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
  1. 启动数据库监听进程
lsnrctl start

标签:umpay,DataBase,app,数据备份,orcl,oracle,RMAN,Oracle11G
From: https://www.cnblogs.com/baixisuozai/p/17854038.html

相关文章

  • 使用RMAN Duplicate搭建DG,备库启动时报ORA-19838
    1、故障概要客户使用duplicate搭建DataGuard时,遭遇ORA-19838错误,备库无法mount,具体报错信息如下所示。 2、故障分析(1).与客户进行电话沟通,了解整个故障的过程:客户先在主库上进行RMAN备份,然后将备份集传输至备库,最后使用duplicatetargetdatabaseforstandbynofilenameche......
  • Performance Improvements in .NET 8 -- Exceptions & Reflection & Primitives【翻译
    Exceptions在.NET6中,ArgumentNullException增加了一个ThrowIfNull方法,我们开始尝试提供“抛出助手”。该方法的目的是简洁地表达正在验证的约束,让系统在未满足约束时抛出一致的异常,同时也优化了成功和99.999%的情况,无需抛出异常。该方法的结构是这样的,执行检查的快速路径被......
  • Performance Improvements in .NET 8 -- Exceptions & Reflection & Primitives【翻译
    Exceptions在.NET6中,ArgumentNullException增加了一个ThrowIfNull方法,我们开始尝试提供“抛出助手”。该方法的目的是简洁地表达正在验证的约束,让系统在未满足约束时抛出一致的异常,同时也优化了成功和99.999%的情况,无需抛出异常。该方法的结构是这样的,执行检查的快速路径被......
  • RMAN-ERROR:因为找不到过期和丢失的归档日志而备份失败
    oracleRMANERRORoracle采用rman备份,但是备份过程中报错如下:RMAN-00571:===========================================================RMAN-00569:===============ERRORMESSAGESTACKFOLLOWS===============RMAN-00571:========================================......
  • High-performance computing (HPC)
    ConceptsdiscriminationWhatistherealtionshipsamongparallelcomputing,high-performancecomputingandsupercomputing?parallelcomputing:usingmultiplecomputingcoretocomputeajobhigh-performancecomputing:atypeofparallelcomputing,an......
  • Performance Improvements in .NET 8 -- Native AOT & VM & GC & Mono
    原生AOT原生AOT在.NET7中发布。它使.NET程序在构建时被编译成一个完全由原生代码组成的自包含可执行文件或库:在执行时不需要JIT来编译任何东西,实际上,编译的程序中没有包含JIT。结果是一个可以有非常小的磁盘占用,小的内存占用,和非常快的启动时间的应用程序。在.NET7......
  • Performance Improvements in .NET 8 -- Native AOT & VM & GC & Mono
    原生AOT原生AOT在.NET7中发布。它使.NET程序在构建时被编译成一个完全由原生代码组成的自包含可执行文件或库:在执行时不需要JIT来编译任何东西,实际上,编译的程序中没有包含JIT。结果是一个可以有非常小的磁盘占用,小的内存占用,和非常快的启动时间的应用程序。在.NET7......
  • 使用PerformanceObserver这个性能监控相关的API
    elementtiming属性可以设置在任何有图文内容的元素上,包括background-image背景图,对了,还有视频元素。配合PerformanceObserverAPI,我们就可以获得加载时长实例:<imgsrc="../202305/book.jpg"elementtiming="image"><pelementtiming="text">我是一段内容。</p>此时,......
  • 为MySQL新增一张performance_schema表 | StoneDB 技术分享会 #4
    StoneDB开源地址https://github.com/stoneatom/stonedb设计:小艾审核:丁奇、李浩编辑:宇亭作者:王若添中国科学技术大学-软件工程-在读硕士、StoneDB内核研发实习生performance_schema简介MySQL启动后会自动创建四个databasemysql>showdatabases;+--------------------+|Da......
  • mysql 远端数据库的数据备份与恢复
    备份基本语法mysqldump-u[用户名]-p[密码]-h[主机IP]-P[端口号][数据库名称]>/home/username/备份文件.sql例如mysqldump-uroot-p123456-h192.168.1.100-P3306mydb>mydb_backup.sql恢复基本语法mysql-u[用户名]-p[密码]-h[主机IP]-P[端口号][数据库名......