首页 > 数据库 >nbu下oracle11g异机迁移

nbu下oracle11g异机迁移

时间:2024-10-24 10:00:05浏览次数:9  
标签:log 异机 app nbu oradata bom oracle oracle11g u01

操作系统:centos7.6

oracle版本:11.2.0.4

一、源数据库操作

1.源库备份情况:查看nbu备份文件

/usr/openv/netbackup/bin/bplist -C bomdb -S NBU-server -t 4 -R -l /

 

2.创建pfile文件并传递到目标库
create pfile='/home/oracle/initbom.ora' from spfile;
scp -r initbom.ora xxxx:/u01/app/oracle/product/11.2.0/db_1/dbs/

 

二、目标数据库操作 1.创建相关目录
--FRA目录
mkdir -p /u01/app/oracle/fast_recovery_area/bom
--DATAFILE
mkdir -p /u01/app/oracle/oradata/bom
--adump
mkdir -p /u01/app/oracle/admin/bom/adump
--arch
mkdir -p /u01/app/oracle/arch
--配置权限
chown -R oracle.oinstall /u01/app/oracle

2.参数文件修改

bom.__db_cache_size=889192448
bom.__java_pool_size=16777216
bom.__large_pool_size=33554432
bom.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
bom.__pga_aggregate_target=838860800
bom.__sga_target=2516582400
bom.__shared_io_pool_size=335544320
bom.__shared_pool_size=1174405120
bom.__streams_pool_size=33554432
*.aq_tm_processes=0
*.audit_file_dest='/u01/app/oracle/admin/bom/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/bom/control01.ctl','/u01/app/oracle/fast_recovery_area/bom/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='bom'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4385144832
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=bomXDB)'
*.job_queue_processes=0
*.log_archive_dest_1='location=/u01/app/oracle/arch'
*.open_cursors=300
*.pga_aggregate_target=836763648
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2510290944
*.undo_tablespace='UNDOTBS1'

3.创建目标库的口令文件

$ORACLE_HOME/dbs
orapwd file=orapwbom password=oracle entries=10

4.使用修改后的参数文件启动到nomount

sqlplus / as sysdba
startup nomount;

5.生成spfile文件,关闭数据库,然后重新启动到nomount

create spfile from pfile;
shutdown immediate;
startup nomount;

6.启动rman,恢复控制文件

run{
allocate channel c1 type 'sbt_tape';
send 'nb_ora_serv=NBU-Server,nb_ora_client=bomdb'; 备份库主机名
restore controlfile from '/ctrl_dBOM_ugl38a6b1_s33301_p1_t1183127905';
release channel c1;
}

7.启动到mount

alter database mount;

8.恢复数据库

run{
allocate channel ch1 type 'sbt_tape';  
allocate channel ch2 type 'sbt_tape';
send 'nb_ora_serv=NBU-Server,nb_ora_client=bomdb';
set newname for datafile 1 to '/u01/app/oracle/oradata/bom/system01.dbf';
set newname for datafile 2 to '/u01/app/oracle/oradata/bom/sysaux01.dbf';
set newname for datafile 3 to '/u01/app/oracle/oradata/bom/undotbs01.dbf';
set newname for datafile 4 to '/u01/app/oracle/oradata/bom/users01.dbf';
set newname for datafile 1 to '/u01/app/oracle/oradata/bom/temp01.dbf';
restore database;
switch datafile all;  #将控制文件中记录的数据文件位置更新为使用set newname命令指定的新位置
switch tempfile all;
recover database;
release channel ch1;
release channel ch1;
}

RMAN-03002: failure of recover command at 10/23/2024 17:07:57
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 18736 and starting SCN of 54835808
---报错原因:RMAN备份不会备份当前的redo logfile文件,异机恢复时找不到redo logfile,所以报错rman-06054
可以基于sequence的恢复,恢复到当前18736号之前的,不包含18736号
list backup of archivelog from sequence 18736;
recover database until sequence 18736;

9.修改日志文件 如果两边redo路径一致可以不操作

select group#,member from v$logfile order by group#;
select 'alter database rename file ''' || member ||'''' || ' to '''|| substr(member,0,instr(member,'/',-1) -1)|| substr(member,instr(member,'/',-1)) ||''';' from v$logfile;
alter database rename file '/u01/app/oracle/oradata/bom/redo03.log' to '/u01/app/oracle/oradata/bom/redo03.log';
alter database rename file '/u01/app/oracle/oradata/bom/redo02.log' to '/u01/app/oracle/oradata/bom/redo02.log';
alter database rename file '/u01/app/oracle/oradata/bom/redo01.log' to '/u01/app/oracle/oradata/bom/redo01.log';

10.启动数据库

alter database open resetlogs; 
ORA-00392: log 1 of thread 1 is being cleared, operation not allowed
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/bom/redo01.log'
处理:日志状态为clearling
select group#,sequence#,bytes,members,status from v$log;
ALTER DATABASE CLEAR LOGFILE GROUP 1;
ALTER DATABASE CLEAR LOGFILE GROUP 2;
ALTER DATABASE CLEAR LOGFILE GROUP 3;

11.查看temp表空间,并重建temp表空间(可不做)

SQL> select name from v$tempfile;
/u01/app/oracle/oradata/bom/temp01.dbf
SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';
TEMP
SQL> create temporary tablespace TEMP1; OMF管理
SQL> create temporary tablespace TEMP1 tempfile '/u01/app/oracle/oradata/orcl/temp01.dbf' size 50M;
SQL> alter database default temporary tablespace TEMP1;
SQL> drop tablespace TEMP including contents and datafiles;

12.查看监听状态并配置,编辑tnsname.ora文件。

[oracle@orcl ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/network/admin
[oracle@rac1 admin]$ vi tnsnames.ora
 bom =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracletest)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = bom)
    )
  )
登录测试
 sqlplus sys/oracle@oracletest:1521/bom as sysdba

13.检查控制文件和数据文件头记录的scn是否一致

select checkpoint_change# from v$datafile;
select checkpoint_change# from v$datafile_header;

14.将新数据库添加到oratab中

vi /etc/oratab
bom:/u01/app/oracle/product/11.2.0/dbhome_1:N
错误处理: 1.执行控制文件恢复报错ORA-01034
RMAN-03002: failure of allocate command at 10/23/2024 15:09:51
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
原因:数据库实例没有生效
解决:source /home/oracle/.bash_profile

2.执行控制文件恢复报错RMAN-06172

RMAN-03002: failure of restore command at 05/11/2020 22:10:12
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece
解决方法:nb_ora_client参数后应该填备份服务器名而非还原服务器名

3.执行控制文件恢复报错 skgfrtrv: sbtrestore returned error

RMAN-03002: failure of restore command at 10/23/2024 15:25:39
ORA-19870: error while restoring backup piece ctrl_dBOM_ugl38a6b1_s33301_p1_t1183127905
ORA-19507: failed to retrieve sequential file, handle="ctrl_dBOM_ugl38a6b1_s33301_p1_t1183127905", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Failed to process backup file <ctrl_dBOM_ugl38a6b1_s33301_p1_t1183127905>
原因:在nbu服务器和要恢复的服务器上检查路径是否存在No.Restrictions,如不存在手动建
解决:nbu服务端:C:\Program Files\Veritas\NetBackup\db\altnames No.Restrictions
         恢复机器:/usr/openv/netbackup/db/altnames  touch No.Restrictions

 

标签:log,异机,app,nbu,oradata,bom,oracle,oracle11g,u01
From: https://www.cnblogs.com/sherq1989/p/18498941

相关文章

  • Oracle11g一键巡检脚本(输出HTML格式)
    脚本内容:#!/bin/bash#设置Oracle环境变量exportORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1exportORACLE_SID=orcl11gexportPATH=$ORACLE_HOME/bin:$PATHfunctionseparator(){localLine=Title=Bytes=Xlength=Title="$*"Line='......
  • 实战!oracle11g一键安装脚本分享
    #!/bin/bash#一键安装oracle数据库#修改主机名hostnamectlset-hostnamemyoracle#添加主机名与IP对应记录public_ip=$(hostname-I|grep-o-e'[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}.[0-9]\{1,3\}'|head-n1)node_name=$(hostname)echo-e"${public_ip}${no......
  • Unbuntu nginx 安装
    1.下载源码下载页面:https://nginx.org/en/download.html下载地址:https://nginx.org/download/nginx-1.27.2.tar.gzcurl-Ohttps://nginx.org/download/nginx-1.27.2.tar.gz2.依赖配置sudoaptinstallgccmakelibpcre3-devzlib1g-devopenssllibssl-dev3.编译解压......
  • Oracle11g服务器linux 安装
    一.安装前准备1.检查硬件(内存,交换分区,tmp分区,cpu信息,内核版本)  #grepMemTotal/proc/meminfo  #grepSwapTotal/proc/meminfo  #df-k/tmp(>400M)  #grep"modelname"/proc/cpuinfo  #uname –r(-a,-m)查看Linux系统版本2.检查所需软件包(两种安......
  • 使用RMAN进行异机恢复Oracle数据库
     假设:某一台oracle12c机器上有30个pdb数据库,采用传统的exp/imp和expdp/impdp需要进行多次导入导出,极为不变。 分析:可以采用oracle自带的RMAN命令导出参数文件、控制文件、数据文件、归档日志 实施步骤如下:1、对源机的处理1.1、开启源机的归档模式命令行如下:#登陆......
  • oracle11g启动过程中加载配置文件
    oracle指定配置文件启动,要是不指定配置文件启动的话默认找的参数文件顺序如下:在oracle11g中oracle启动过程中默认会加载相应的配置文件来启动oracle服务。检查参数文件有两个,一个是spfile<ORACLE_SID>.ora文件,另一个是inti<ORACLE_SID>.ora文件。oracle软件服务安装完成后,s......
  • SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffer
    SQLSTATE[HY000]:Generalerror:2014Cannotexecutequerieswhileotherunbufferedqueriesareactive.ConsiderusingPDOStatement::fetchAll().Alternatively,ifyourcodeisonlyevergoingtorunagainstmysql,youmayenablequerybufferingbysetting......
  • 高级DBA培训02:国产麒麟操作系统+Oracle11gR2安装配置
    一、高级DBA培训02:国产麒麟操作系统+Oracle11gR2安装配置:本课程大纲内容如下:(*)国产麒麟-Oracle11gR2课程环境规划(*)国产麒麟Linux操作系统安装(*)国产麒麟安装Oracle11gR2的操作系统参数配置(*)国产麒麟静默安装Oracle11gR2过程(*)国产麒麟静默配置Oracle11g监听服务(*)国产麒麟静默创建Orac......
  • 高级DBA培训04:Oracle11gR2迁移到国产麒麟操作系统(单机/RAC)
    一、高级DBA培训04:Oracle11gR2迁移到国产麒麟操作系统(单机/RAC)本课程大纲内容如下:(*)Oracle11gR2迁移到国产麒麟操作系统(单机)(*)Oracle11gR2迁移到国产麒麟操作系统(RAC)学习地址:https://edu.51cto.com/course/37405.html欢迎加入:51CTO学堂风哥大数据/Oracle/MySQL数据库学习专用QQ群:4541......
  • IconButton的用法
    文章目录1.概念介绍2.使用方法2.1filled风格2.2filledTonal风格2.3outlined风格3.代码与效果3.1示例代码3.2运行效果4.内容总结我们在上一章回中介绍了"如何修改NavigationBar组件的形状"相关的内容,本章回中将介绍IconButtion组件.闲话休提,让我们一起Talk......