暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

19c 数据库dataguar 搭建 from service

原创 许玉冲 2023-12-21
318

RMAN restore database from service

数据库版本:Version 19.18.0.0.0

## 恢复控制文件
restore standby controlfile from service  cdb;

## 恢复数据文件
alter database mount;
CONFIGURE DEVICE TYPE DISK PARALLELISM 8; <<<----配置并行参数。
restore database from service  cdb section size 2G; <<<---配置分片大小。


## gap 处理
RECOVER STANDBY DATABASE FROM SERVICE cdb;

This method is valid for  Oracle Database Server versions 12.1 to 19c and higher.
SECTION SIZE support is available. The section size clause used with multiple RMAN channels enables parallelization of individual files by dividing large files into smaller pieces.  This improves the overall efficiency of parallelization across channels.
Encryption is supported.
Compression is supported.

1,备机环境准备,密码文件,pfile文件。

*.audit_file_dest='/u01/app/oracle/admin/cdb/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/u01/SBCDB/cdb.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_create_file_dest='/u01/SBCDB'
*.db_create_online_log_dest_1='/u01/SBCDB'
*.db_file_name_convert='/u01/app/oracle/oradata/CDB','/u01/SBCDB' #主备目录不同需要配置
*.LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/CDB','/u01/SBCDB'  #主备目录不同需要配置
*.db_name='cdb'
*.db_recovery_file_dest='/u01/arc'
*.db_recovery_file_dest_size=40G
*.db_unique_name='cdbsb'
*.diagnostic_dest='/u01/app/oracle'
*.enable_pluggable_database=true
*.fal_server='cdb'
*.log_archive_config='DG_CONFIG=(CDB,CDBSB)'
*.log_archive_dest_1='LOCATION=/u01/arc'
*.log_archive_dest_state_2='ENABLE'
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.pga_aggregate_limit=0
*.pga_aggregate_target=325M
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=650M
*.sga_target=650M
*.standby_file_management='AUTO'

2,备库启动nomount


RMAN> startup nomount

Oracle instance started

Total System Global Area     683667848 bytes

Fixed Size                     9167240 bytes
Variable Size                197132288 bytes
Database Buffers             469762048 bytes
Redo Buffers                   7606272 bytes

3,恢复控制文件

[oracle@ora06 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Dec 21 09:26:28 2023
Version 19.18.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB (not mounted)

RMAN> restore standby controlfile from service  cdb;

Starting restore at 21-DEC-23
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=389 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/SBCDB/cdb.ctl
Finished restore at 21-DEC-23

4, 恢复数据文件

RMAN> restore database from service  cdb section size 2G;

Starting restore at 21-DEC-23
Starting implicit crosscheck backup at 21-DEC-23
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=263 device type=DISK
Crosschecked 3 objects
Finished implicit crosscheck backup at 21-DEC-23

Starting implicit crosscheck copy at 21-DEC-23
using channel ORA_DISK_1
Finished implicit crosscheck copy at 21-DEC-23

searching for all files in the recovery area
cataloging files...
no files cataloged

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/SBCDB/system01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:46
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to /u01/SBCDB/sysaux01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /u01/SBCDB/undotbs01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00005 to /u01/SBCDB/pdbseed/system01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00006 to /u01/SBCDB/pdbseed/sysaux01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00007 to /u01/SBCDB/users01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00008 to /u01/SBCDB/pdbseed/undotbs01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00009 to /u01/SBCDB/pdb01/system01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00010 to /u01/SBCDB/pdb01/sysaux01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00011 to /u01/SBCDB/pdb01/undotbs01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service cdb
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00012 to /u01/SBCDB/pdb01/users01.dbf
channel ORA_DISK_1: restoring section 1 of 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 21-DEC-23

RMAN>

5,启动数据库open read only

[oracle@ora06 SBCDB]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Dec 21 09:35:21 2023
Version 19.18.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0

SQL> alter database open;

Database altered.

SQL> 

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论