Oracle Dataguard(主库为 Oracle rac 集群)配置教程(02)—— Oracle RAC 主库的相关操作

news2024/11/26 23:24:46

Oracle Dataguard(主库为 Oracle rac 集群)配置教程(02)—— Oracle RAC 主库的相关操作

在这里插入图片描述
/
本专栏详细讲解 Oracle Dataguard(Oracle 版本为11g,主库为双节点 Oracle rac 集群)的配置过程。主要内容包括:
(1)dataguard 服务器 Oracle 软件的安装。
(2)Oracle RAC 主库与 Dataguard 服务器的配置。
(3)主从同步测试。
(4)主备库切换。
/

目录

  • Oracle Dataguard(主库为 Oracle rac 集群)配置教程(02)—— Oracle RAC 主库的相关操作
    • 一、把 Oracle RAC 主库设置为 Force Logging 模式与归档模式
        • 1、查看 Oracle RAC 主库是否为归档模式和 Force Logging 模式
        • 2、把 Oracle RAC 主库设置为 Force Logging 模式
        • 3、把 Oracle RAC 主库设置为归档模式
    • 二、在 Oracle RAC 主库执行 RMAN 全备操作
        • 1、在 Oracle RAC 主库的节点1上添加一块磁盘,用于存放备份文件
        • 3、在 Oracle RAC 主库执行 RMAN 全备操作
        • 4、在 Oracle RAC 主库创建物理备库控制文件
        • 5、在 Oracle RAC 主库创建物理备库初始化参数文件
        • 6、在 Oracle RAC 主库修改口令文件,使两个节点的SYS 用户口令均为 oracle

一、把 Oracle RAC 主库设置为 Force Logging 模式与归档模式

1、查看 Oracle RAC 主库是否为归档模式和 Force Logging 模式

SQL> select name,open_mode,log_mode,force_logging from v$database;

NAME	  OPEN_MODE	       LOG_MODE     FOR
--------- -------------------- ------------ ---
HISDB	  READ WRITE	       NOARCHIVELOG NO

2、把 Oracle RAC 主库设置为 Force Logging 模式

SQL> alter database force logging;

Database altered.

SQL> select name,open_mode,log_mode,force_logging from v$database;

NAME	  OPEN_MODE	       LOG_MODE     FOR
--------- -------------------- ------------ ---
HISDB	  READ WRITE	       NOARCHIVELOG YES

3、把 Oracle RAC 主库设置为归档模式

设置数据库为归档模式需要停库,然后启动数据库到 mount 状态。

(1)停库

# 切换到grid用户
# 查看数据库
[grid@rac1 ~]$ srvctl status database -d hisdb;
Instance hisdb1 is running on node rac1
Instance hisdb2 is running on node rac2

# 停库
[grid@rac1 ~]$ srvctl stop database -d hisdb;

# 查看数据库
[grid@rac1 ~]$ srvctl status database -d hisdb;
Instance hisdb1 is not running on node rac1
Instance hisdb2 is not running on node rac2

(2)切换到Oracle用户,启动数据库到mount状态(在任意一个节点操作即可)

SQL> startup mount;
ORACLE instance started.

Total System Global Area  626327552 bytes
Fixed Size		    2255832 bytes
Variable Size		  297796648 bytes
Database Buffers	  322961408 bytes
Redo Buffers		    3313664 bytes
Database mounted.

-- 把数据库设置为归档模式
SQL> alter database archivelog;

Database altered.

-- 查看数据库
SQL> select name,open_mode,log_mode,force_logging from v$database;

NAME	  OPEN_MODE	       LOG_MODE     FOR
--------- -------------------- ------------ ---
HISDB	  MOUNTED	       ARCHIVELOG   YES

(3)启动数据库

--停库
SQL> shutdown immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

-- 切换到grid用户
-- 启动数据库
[grid@rac1 ~]$ srvctl start database -d hisdb;

[grid@rac1 ~]$ srvctl status database -d hisdb;
Instance hisdb1 is running on node rac1
Instance hisdb2 is running on node rac2

二、在 Oracle RAC 主库执行 RMAN 全备操作

1、在 Oracle RAC 主库的节点1上添加一块磁盘,用于存放备份文件

在 Oracle RAC 主库的节点1上添加一块磁盘,大小10GB,并挂载到目录 /rman_backup;在 dataguard 服务器上添加一块磁盘,大小10GB,并挂载到目录 /rman_backup。把 Oracle RAC 主库的数据库备份文件写入 /rman_backup 目录。然后通过把备份文件复制到 dataguard 服务器的 /rman_backup 目录,用于恢复数据库。

在 Oracle RAC 主库的节点1执行如下操作:

(1)在 Oracle RAC 主库的节点1上添加磁盘

# 查看磁盘信息,/dev/sdb 为新添加的磁盘
[root@rac1 ~]# ll /dev/sd*
brw-rw---- 1 root disk 8,  0 210 15:55 /dev/sda
brw-rw---- 1 root disk 8,  1 210 15:55 /dev/sda1
brw-rw---- 1 root disk 8,  2 210 15:55 /dev/sda2
brw-rw---- 1 root disk 8, 16 210 15:55 /dev/sdb
brw-rw---- 1 root disk 8, 32 210 15:55 /dev/sdc
brw-rw---- 1 root disk 8, 33 210 15:55 /dev/sdc1
brw-rw---- 1 root disk 8, 34 210 15:55 /dev/sdc2
brw-rw---- 1 root disk 8, 35 210 15:55 /dev/sdc3
brw-rw---- 1 root disk 8, 36 210 15:55 /dev/sdc4
brw-rw---- 1 root disk 8, 37 210 15:55 /dev/sdc5
brw-rw---- 1 root disk 8, 38 210 15:55 /dev/sdc6
brw-rw---- 1 root disk 8, 39 210 15:55 /dev/sdc7
brw-rw---- 1 root disk 8, 40 210 15:55 /dev/sdc8

(2)为磁盘 /dev/sdb 创建分区

[root@rac1 ~]# fdisk /dev/sdb
欢迎使用 fdisk (util-linux 2.23.2)。

更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。

Device does not contain a recognized partition table
使用磁盘标识符 0x4bbf68c2 创建新的 DOS 磁盘标签。

命令(输入 m 获取帮助):n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
分区号 (1-4,默认 1):
起始 扇区 (2048-20971519,默认为 2048):
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-20971519,默认为 20971519):
将使用默认值 20971519
分区 1 已设置为 Linux 类型,大小设为 10 GiB

命令(输入 m 获取帮助):w
The partition table has been altered!

Calling ioctl() to re-read partition table.
正在同步磁盘。


# 查看磁盘信息
[root@rac1 ~]# ll /dev/sd*
brw-rw---- 1 root disk 8,  0 210 15:55 /dev/sda
brw-rw---- 1 root disk 8,  1 210 15:55 /dev/sda1
brw-rw---- 1 root disk 8,  2 210 15:55 /dev/sda2
brw-rw---- 1 root disk 8, 16 210 15:59 /dev/sdb
brw-rw---- 1 root disk 8, 17 210 15:59 /dev/sdb1
brw-rw---- 1 root disk 8, 32 210 15:55 /dev/sdc
brw-rw---- 1 root disk 8, 33 210 15:55 /dev/sdc1
brw-rw---- 1 root disk 8, 34 210 15:55 /dev/sdc2
brw-rw---- 1 root disk 8, 35 210 15:55 /dev/sdc3
brw-rw---- 1 root disk 8, 36 210 15:55 /dev/sdc4
brw-rw---- 1 root disk 8, 37 210 15:55 /dev/sdc5
brw-rw---- 1 root disk 8, 38 210 15:55 /dev/sdc6
brw-rw---- 1 root disk 8, 39 210 15:55 /dev/sdc7
brw-rw---- 1 root disk 8, 40 210 15:55 /dev/sdc8

(3)格式化磁盘 /dev/sdb1

[root@rac1 ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 2621184 blocks
131059 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: 完成                            
正在写入inode表: 完成                            
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成 

(4)创建目录 /rman_backup,并修改属性

[root@rac1 ~]# mkdir /rman_backup
[root@rac1 ~]# chown -R oracle:oinstall /rman_backup
[root@rac1 ~]# ll /
总用量 20
lrwxrwxrwx.   1 root   root        7 210 06:19 bin -> usr/bin
dr-xr-xr-x.   4 root   root     4096 29 23:50 boot
drwxr-xr-x   21 root   root     3480 210 15:59 dev
drwxr-xr-x.  80 root   root     8192 210 15:55 etc
drwxr-xr-x.   4 root   root       32 29 22:47 home
lrwxrwxrwx.   1 root   root        7 210 06:19 lib -> usr/lib
lrwxrwxrwx.   1 root   root        9 210 06:19 lib64 -> usr/lib64
drwxr-xr-x.   2 root   root        6 115 2016 media
drwxr-xr-x.   2 root   root        6 115 2016 mnt
drwxr-xr-x.   4 root   root       36 210 00:10 opt
dr-xr-xr-x  228 root   root        0 210 15:55 proc
drwxr-xr-x    2 oracle oinstall    6 210 16:03 rman_backup
dr-xr-x---.   2 root   root      135 29 23:44 root
drwxr-xr-x   21 root   root      620 210 15:55 run
lrwxrwxrwx.   1 root   root        8 210 06:19 sbin -> usr/sbin
drwxr-xr-x.   8 root   root      166 29 23:49 soft
drwxr-xr-x.   2 root   root        6 115 2016 srv
dr-xr-xr-x   13 root   root        0 210 15:55 sys
drwxrwxrwt.  15 root   root     4096 210 15:56 tmp
drwxr-xr-x.   3 root   oinstall   17 29 22:59 u01
drwxr-xr-x.  13 root   root      155 210 06:19 usr
drwxr-xr-x.  19 root   root      267 210 15:55 var

(5)把磁盘 /dev/sdb1 挂载到目录 /rman_backup

# 临时挂载
[root@rac1 ~]# mount -t ext3 /dev/sdb1 /rman_backup

# 永久挂载
[root@rac1 ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Mon Jan 30 02:37:18 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/cl-root     /                       xfs     defaults        0 0
UUID=870d48ff-ed96-4f06-ace9-34127c37003c /boot                   xfs     defaults        0 0
/dev/mapper/cl-swap     swap                    swap    defaults        0 0
/dev/sdb1               /rman_backup            ext3    defaults        0 0

# 查看磁盘挂载信息
[root@rac1 ~]# df -Th
文件系统            类型      容量  已用  可用 已用% 挂载点
/dev/mapper/cl-root xfs        20G   18G  2.5G   88% /
devtmpfs            devtmpfs  902M     0  902M    0% /dev
tmpfs               tmpfs     912M  116M  797M   13% /dev/shm
tmpfs               tmpfs     912M  8.7M  904M    1% /run
tmpfs               tmpfs     912M     0  912M    0% /sys/fs/cgroup
/dev/sda1           xfs      1014M  138M  877M   14% /boot
tmpfs               tmpfs     183M     0  183M    0% /run/user/0
/dev/sdb1           ext3      9.8G   23M  9.2G    1% /rman_backup

2、在 Dataguard 服务器上添加一块磁盘,用于存放备份文件

(1)查看磁盘信息

[root@hisdg ~]# ll /dev/sd*
brw-rw----. 1 root disk 8,  0 210 15:53 /dev/sda
brw-rw----. 1 root disk 8,  1 210 15:53 /dev/sda1
brw-rw----. 1 root disk 8,  2 210 15:53 /dev/sda2
brw-rw----. 1 root disk 8, 16 210 15:53 /dev/sdb

(2)为磁盘 /dev/sdb 创建分区

[root@hisdg ~]# fdisk /dev/sdb
欢迎使用 fdisk (util-linux 2.23.2)。

更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。

Device does not contain a recognized partition table
使用磁盘标识符 0x31bf155b 创建新的 DOS 磁盘标签。

命令(输入 m 获取帮助):n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
分区号 (1-4,默认 1):
起始 扇区 (2048-20971519,默认为 2048):
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-20971519,默认为 20971519):
将使用默认值 20971519
分区 1 已设置为 Linux 类型,大小设为 10 GiB

命令(输入 m 获取帮助):w
The partition table has been altered!

Calling ioctl() to re-read partition table.
正在同步磁盘。

# 查看磁盘信息
[root@hisdg ~]# ll /dev/sd*
brw-rw----. 1 root disk 8,  0 210 15:53 /dev/sda
brw-rw----. 1 root disk 8,  1 210 15:53 /dev/sda1
brw-rw----. 1 root disk 8,  2 210 15:53 /dev/sda2
brw-rw----. 1 root disk 8, 16 210 16:10 /dev/sdb
brw-rw----. 1 root disk 8, 17 210 16:10 /dev/sdb1

(3)格式化磁盘 /dev/sdb1

[root@hisdg ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655360 inodes, 2621184 blocks
131059 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: 完成                            
正在写入inode表: 完成                            
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成

(4)创建目录 /rman_backup,并修改属性

[root@hisdg ~]# mkdir /rman_backup
[root@hisdg ~]# chown -R oracle:oinstall /rman_backup
[root@hisdg ~]# ll /
总用量 20
lrwxrwxrwx.   1 root   root        7 26 03:24 bin -> usr/bin
dr-xr-xr-x.   4 root   root     4096 26 03:32 boot
drwxr-xr-x.  20 root   root     3260 210 16:10 dev
drwxr-xr-x.  78 root   root     8192 210 15:53 etc
drwxr-xr-x.   3 root   root       20 210 12:51 home
lrwxrwxrwx.   1 root   root        7 26 03:24 lib -> usr/lib
lrwxrwxrwx.   1 root   root        9 26 03:24 lib64 -> usr/lib64
drwxr-xr-x.   2 root   root        6 115 2016 media
drwxr-xr-x.   2 root   root        6 115 2016 mnt
drwxr-xr-x.   3 root   root       22 210 14:35 opt
dr-xr-xr-x. 105 root   root        0 210 15:53 proc
drwxr-xr-x.   2 oracle oinstall    6 210 16:13 rman_backup
dr-xr-x---.   2 root   root      135 25 20:13 root
drwxr-xr-x.  21 root   root      620 210 15:54 run
lrwxrwxrwx.   1 root   root        8 26 03:24 sbin -> usr/sbin
drwxr-xr-x.   6 root   root      134 210 13:34 soft
drwxr-xr-x.   2 root   root        6 115 2016 srv
dr-xr-xr-x.  13 root   root        0 210 15:53 sys
drwxrwxrwt.  12 root   root     4096 210 15:54 tmp
drwxrwxr-x.   3 oracle oinstall   17 210 13:00 u01
drwxr-xr-x.  13 root   root      155 26 03:24 usr
drwxr-xr-x.  19 root   root      267 210 15:53 var

(5)把磁盘 /dev/sdb1 挂载到目录 /rman_backup

# 临时挂载
[root@hisdg ~]# mount -t ext3 /dev/sdb1 /rman_backup

# 永久挂载
[root@hisdg ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Mon Feb  6 03:24:40 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/cl-root     /                       xfs     defaults        0 0
UUID=98f33897-679b-41a1-a3e9-e6b7824033ab /boot                   xfs     defaults        0 0
/dev/mapper/cl-swap     swap                    swap    defaults        0 0
/dev/sdb1               /rman_backup            ext3    defaults        0 0

3、在 Oracle RAC 主库执行 RMAN 全备操作

(1)切换到 Oracle 用户,查看备份信息

在 Oracle RAC 集群的节点1执行如下代码:

-- 切换到 Oracle 用户,进入 rman
[root@rac1 ~]# su - oracle
上一次登录:五 210 12:00:42 CST 2023pts/6[oracle@rac1 ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Feb 10 16:19:38 2023

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

connected to target database: HISDB (DBID=2041031531)

-- 查看需要备份的数据文件
RMAN> report need backup;

using target database control file instead of recovery catalog
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups
File #bkps Name
---- ----- -----------------------------------------------------
1    0     +DATA/hisdb/datafile/system.267.1128415373
2    0     +DATA/hisdb/datafile/sysaux.260.1128415373
3    0     +DATA/hisdb/datafile/undotbs1.263.1128415373
4    0     +DATA/hisdb/datafile/users.266.1128415373
5    0     +DATA/hisdb/datafile/undotbs2.259.1128415887

-- 删除归档日志文件
RMAN> delete archivelog all;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=60 instance=hisdb1 device type=DISK
List of Archived Log Copies for database with db_unique_name HISDB
=====================================================================

Key     Thrd Seq     S Low Time 
------- ---- ------- - ---------
1       1    5       A 10-FEB-23
        Name: +BAK/hisdb/archivelog/2023_02_10/thread_1_seq_5.261.1128441541

2       2    2       A 10-FEB-23
        Name: +BAK/hisdb/archivelog/2023_02_10/thread_2_seq_2.262.1128441549

3       2    3       A 10-FEB-23
        Name: +BAK/hisdb/archivelog/2023_02_10/thread_2_seq_3.263.1128441563


Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=+BAK/hisdb/archivelog/2023_02_10/thread_1_seq_5.261.1128441541 RECID=1 STAMP=1128441551
deleted archived log
archived log file name=+BAK/hisdb/archivelog/2023_02_10/thread_2_seq_2.262.1128441549 RECID=2 STAMP=1128441555
deleted archived log
archived log file name=+BAK/hisdb/archivelog/2023_02_10/thread_2_seq_3.263.1128441563 RECID=3 STAMP=1128441564
Deleted 3 objects

-- 查看备份信息
RMAN> list backup;

specification does not match any backup in the repository

-- 查看归档日志信息
RMAN> list archivelog all;

specification does not match any archived log in the repository

(2)在 Oracle RAC 主库执行全备操作

-- 执行全备(同时备份归档日志)
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
backup database format '/rman_backup/Full_%U.bak';
backup archivelog all format '/rman_backup/ARC_%U.bak';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}


--执行全备操作,备份数据文件和归档日志
RMAN> 
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
backup database format '/rman_backup/Full_%U.bak';
backup archivelog all format '/rman_backup/ARC_%U.bak';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> }

allocated channel: c1
channel c1: SID=60 instance=hisdb1 device type=DISK

allocated channel: c2
channel c2: SID=35 instance=hisdb1 device type=DISK

allocated channel: c3
channel c3: SID=69 instance=hisdb1 device type=DISK

allocated channel: c4
channel c4: SID=72 instance=hisdb1 device type=DISK

Starting backup at 10-FEB-23
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATA/hisdb/datafile/system.267.1128415373
channel c1: starting piece 1 at 10-FEB-23
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/hisdb/datafile/sysaux.260.1128415373
input datafile file number=00004 name=+DATA/hisdb/datafile/users.266.1128415373
channel c2: starting piece 1 at 10-FEB-23
channel c3: starting full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00003 name=+DATA/hisdb/datafile/undotbs1.263.1128415373
input datafile file number=00005 name=+DATA/hisdb/datafile/undotbs2.259.1128415887
channel c3: starting piece 1 at 10-FEB-23
channel c4: starting full datafile backup set
channel c4: specifying datafile(s) in backup set
channel c1: finished piece 1 at 10-FEB-23
piece handle=/rman_backup/Full_051k5ba1_1_1.bak tag=TAG20230210T162640 comment=NONE
channel c1: backup set complete, elapsed time: 00:01:57
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 10-FEB-23
channel c2: finished piece 1 at 10-FEB-23
piece handle=/rman_backup/Full_061k5ba2_1_1.bak tag=TAG20230210T162640 comment=NONE
channel c2: backup set complete, elapsed time: 00:02:42
including current control file in backup set
channel c4: starting piece 1 at 10-FEB-23
channel c1: finished piece 1 at 10-FEB-23
piece handle=/rman_backup/Full_091k5beb_1_1.bak tag=TAG20230210T162640 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:22
channel c3: finished piece 1 at 10-FEB-23
piece handle=/rman_backup/Full_071k5ba2_1_1.bak tag=TAG20230210T162640 comment=NONE
channel c3: backup set complete, elapsed time: 00:02:48
channel c4: finished piece 1 at 10-FEB-23
piece handle=/rman_backup/Full_081k5bab_1_1.bak tag=TAG20230210T162640 comment=NONE
channel c4: backup set complete, elapsed time: 00:00:16
Finished backup at 10-FEB-23

Starting backup at 10-FEB-23
current log archived
channel c1: starting archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=5 STAMP=1128443427
channel c1: starting piece 1 at 10-FEB-23
channel c2: starting archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=2 sequence=4 RECID=4 STAMP=1128443427
channel c2: starting piece 1 at 10-FEB-23
channel c1: finished piece 1 at 10-FEB-23
piece handle=/rman_backup/ARC_0a1k5bh5_1_1.bak tag=TAG20230210T163027 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:06
channel c2: finished piece 1 at 10-FEB-23
piece handle=/rman_backup/ARC_0b1k5bh6_1_1.bak tag=TAG20230210T163027 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:04
Finished backup at 10-FEB-23

released channel: c1

released channel: c2

released channel: c3

released channel: c4


-- 查看备份信息
RMAN> list backup;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    634.48M    DISK        00:00:54     10-FEB-23      
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20230210T162640
        Piece Name: /rman_backup/Full_051k5ba1_1_1.bak
  List of Datafiles in backup set 1
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 1035627    10-FEB-23 +DATA/hisdb/datafile/system.267.1128415373

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    390.88M    DISK        00:01:36     10-FEB-23      
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20230210T162640
        Piece Name: /rman_backup/Full_061k5ba2_1_1.bak
  List of Datafiles in backup set 2
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 1035629    10-FEB-23 +DATA/hisdb/datafile/sysaux.260.1128415373
  4       Full 1035629    10-FEB-23 +DATA/hisdb/datafile/users.266.1128415373

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    80.00K     DISK        00:00:31     10-FEB-23      
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20230210T162640
        Piece Name: /rman_backup/Full_091k5beb_1_1.bak
  SPFILE Included: Modification time: 10-FEB-23
  SPFILE db_unique_name: HISDB

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4       Full    6.41M      DISK        00:02:49     10-FEB-23      
        BP Key: 4   Status: AVAILABLE  Compressed: NO  Tag: TAG20230210T162640
        Piece Name: /rman_backup/Full_071k5ba2_1_1.bak
  List of Datafiles in backup set 4
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  3       Full 1035639    10-FEB-23 +DATA/hisdb/datafile/undotbs1.263.1128415373
  5       Full 1035639    10-FEB-23 +DATA/hisdb/datafile/undotbs2.259.1128415887

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5       Full    17.67M     DISK        00:02:47     10-FEB-23      
        BP Key: 5   Status: AVAILABLE  Compressed: NO  Tag: TAG20230210T162640
        Piece Name: /rman_backup/Full_081k5bab_1_1.bak
  Control File Included: Ckp SCN: 1035644      Ckp time: 10-FEB-23

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6       2.22M      DISK        00:00:06     10-FEB-23      
        BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: TAG20230210T163027
        Piece Name: /rman_backup/ARC_0a1k5bh5_1_1.bak

  List of Archived Logs in backup set 6
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    6       1031045    10-FEB-23 1035799    10-FEB-23

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7       1.42M      DISK        00:00:05     10-FEB-23      
        BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: TAG20230210T163027
        Piece Name: /rman_backup/ARC_0b1k5bh6_1_1.bak

  List of Archived Logs in backup set 7
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  2    4       1031521    10-FEB-23 1035802    10-FEB-23


-- 查看备份文件
[oracle@rac1 ~]$ cd /rman_backup/
[oracle@rac1 rman_backup]$ ll
total 1079604
-rw-r----- 1 oracle asmadmin   2332160 Feb 10 16:30 ARC_0a1k5bh5_1_1.bak
-rw-r----- 1 oracle asmadmin   1490432 Feb 10 16:30 ARC_0b1k5bh6_1_1.bak
-rw-r----- 1 oracle asmadmin 665313280 Feb 10 16:27 Full_051k5ba1_1_1.bak
-rw-r----- 1 oracle asmadmin 409878528 Feb 10 16:28 Full_061k5ba2_1_1.bak
-rw-r----- 1 oracle asmadmin   6725632 Feb 10 16:29 Full_071k5ba2_1_1.bak
-rw-r----- 1 oracle asmadmin  18546688 Feb 10 16:29 Full_081k5bab_1_1.bak
-rw-r----- 1 oracle asmadmin     98304 Feb 10 16:29 Full_091k5beb_1_1.bak
drwx------ 2 oracle oinstall     16384 Feb 10 16:02 lost+found

4、在 Oracle RAC 主库创建物理备库控制文件

RMAN> backup device type disk format '/rman_backup/standby_%U.ctl' current controlfile for standby;

Starting backup at 10-FEB-23
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=73 instance=hisdb1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including standby control file in backup set
channel ORA_DISK_1: starting piece 1 at 10-FEB-23
channel ORA_DISK_1: finished piece 1 at 10-FEB-23
piece handle=/rman_backup/standby_0c1k5bse_1_1.ctl tag=TAG20230210T163630 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 10-FEB-23


-- 查看备份文件
[root@rac1 ~]# cd /rman_backup/
[root@rac1 rman_backup]# ll
总用量 1097740
-rw-r----- 1 oracle asmadmin   2332160 2月  10 16:30 ARC_0a1k5bh5_1_1.bak
-rw-r----- 1 oracle asmadmin   1490432 2月  10 16:30 ARC_0b1k5bh6_1_1.bak
-rw-r----- 1 oracle asmadmin 665313280 2月  10 16:27 Full_051k5ba1_1_1.bak
-rw-r----- 1 oracle asmadmin 409878528 2月  10 16:28 Full_061k5ba2_1_1.bak
-rw-r----- 1 oracle asmadmin   6725632 2月  10 16:29 Full_071k5ba2_1_1.bak
-rw-r----- 1 oracle asmadmin  18546688 2月  10 16:29 Full_081k5bab_1_1.bak
-rw-r----- 1 oracle asmadmin     98304 2月  10 16:29 Full_091k5beb_1_1.bak
drwx------ 2 oracle oinstall     16384 2月  10 16:02 lost+found
-rw-r----- 1 oracle asmadmin  18546688 2月  10 16:36 standby_0c1k5bse_1_1.ctl

5、在 Oracle RAC 主库创建物理备库初始化参数文件

SQL> show parameter spfile;

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
spfile				     string	 +DATA/hisdb/spfilehisdb.ora

--备库的 ORACLE_SID 为:hisdg,备份的参数文件命名为:inithisdg.ora
SQL> create pfile='/rman_backup/inithisdg.ora' from spfile;

File created.

-- 查看备份文件
[root@rac1 rman_backup]# ll
总用量 1097744
-rw-r----- 1 oracle asmadmin   2332160 2月  10 16:30 ARC_0a1k5bh5_1_1.bak
-rw-r----- 1 oracle asmadmin   1490432 2月  10 16:30 ARC_0b1k5bh6_1_1.bak
-rw-r----- 1 oracle asmadmin 665313280 2月  10 16:27 Full_051k5ba1_1_1.bak
-rw-r----- 1 oracle asmadmin 409878528 2月  10 16:28 Full_061k5ba2_1_1.bak
-rw-r----- 1 oracle asmadmin   6725632 2月  10 16:29 Full_071k5ba2_1_1.bak
-rw-r----- 1 oracle asmadmin  18546688 2月  10 16:29 Full_081k5bab_1_1.bak
-rw-r----- 1 oracle asmadmin     98304 2月  10 16:29 Full_091k5beb_1_1.bak
-rw-r--r-- 1 oracle asmadmin      1392 2月  10 16:40 inithisdg.ora
drwx------ 2 oracle oinstall     16384 2月  10 16:02 lost+found
-rw-r----- 1 oracle asmadmin  18546688 2月  10 16:36 standby_0c1k5bse_1_1.ctl

6、在 Oracle RAC 主库修改口令文件,使两个节点的SYS 用户口令均为 oracle

--节点1
SQL> show user;
USER is "SYS"
SQL> alter user sys identified by oracle;

User altered.

--节点2
SQL> show user;
USER is "SYS"
SQL> alter user sys identified by oracle;

User altered.

-- 查看生成的口令文件
[oracle@rac2 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac2 dbs]$ ll
total 20
-rw-rw---- 1 oracle asmadmin 1544 Feb 10 08:26 hc_false2.dat
-rw-rw---- 1 oracle asmadmin 1544 Feb 10 16:06 hc_hisdb2.dat
-rw-r----- 1 oracle oinstall   37 Feb 10 08:59 inithisdb2.ora
-rw-r--r-- 1 oracle oinstall 2851 Feb 10 01:02 init.ora
-rw-r----- 1 oracle oinstall 1536 Feb 10 16:43 orapwhisdb2  --口令文件

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/336181.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

数据库 与 数据仓库的本质区别是什么?

当用计算机来处理数据的时候, 数据就需要存储和管理了。早期的数据, 就是用一个文件来实现的, 即是文件系统。随着处理的数据量增大, 发展到用数据库来管理和存储数据了。 数据库包括多媒体数据库、对象关系数据库和关系数据库。关系数据库管理系统,已经成为了事实上通用的数据…

FANUC机器人UI[4]_CSTOPI循环停止信号使用时的注意事项

FANUC机器人UI[4]_CSTOPI循环停止信号使用时的注意事项 前面已经和大家介绍了关于FANUC机器人的UOP信号的具体功能,具体可参考以下链接中的内容: FANUC机器人UOP信号(UI+UO)功能详细介绍 本次关于FANUC机器人的UI[4] CSTOPI循环停止信号使用时的注意事项进行一个补充说明。…

C语言-程序环境和预处理(14.2)

目录 预处理详解 1.预定义符号 2. #define 2.1 #define定义标识符 2.2 #define 定义宏 2.3 #define 替换规则 注意事项: 2.4 #和## 2.5 带副作用的宏参数 2.6 宏和函数对比 3. #undef 4. 条件编译 4.1 单分支条件编译 4.2 多分支条件编译 4.3 判断是…

基础篇:01-微服务概述

1.单体应用与微服务架构区别 如上图左侧为单体应用架构。在传统单体应用中,所有功能模块都在一个工程中编码、部署,即使是集群部署,也只是单体应用的水平复制。 如上图右侧为微服务架构。在微服务架构的项目中,每个应用会按照领域…

浅谈保护数据的加密策略

加密是一种将信息从可读格式转换为混乱字符串的技术。这样做可以防止数据传输中的机密数据泄露。文档、文件、消息和所有其他形式的网络通信都可以加密。加密策略和身份验证服务的结合,还能保障企业机密信息只对授权用户开启访问权限。常见的数据加密包括以下两种&a…

定期备份日志并发送至存储服务器指定路径脚本

根据需求编写一个日志定时备份并发送至存储服务器的脚本定期把三天前的日志文件备份,打包发送至日志备份服务器指定目录(修改对应路径拿走即用)vim qingli.sh#!/bin/bash#定义星期几week$(date |awk NR1{print $4})num${week}#日志源目录log&…

Android MVI框架搭建与使用

MVI框架搭建与使用前言正文一、创建项目① 配置AndroidManifest.xml② 配置app的build.gradle二、网络请求① 生成数据类② 接口类③ 网络请求工具类三、意图与状态① 创建意图② 创建状态四、ViewModel① 创建存储库② 创建ViewModel③ 创建ViewModel工厂五、UI① 列表适配器②…

【3D目标检测】基于伪雷达点云的单目3D目标检测方法研宄

目录概述细节基准模型点云置信度生成网络特征聚合 DGCNN概述 本文是基于单目图像的3D目标检测方法,是西安电子科技大学的郭鑫宇学长的硕士学位论文。 【2021】【单目图像的3D目标检测方法】 细节 基准模型 作者还是按照伪雷达点云算法的流程设计的,并…

多传感器融合定位十四-基于图优化的定位方法

多传感器融合定位十四-基于图优化的定位方法1. 基于图优化的定位简介1.1 核心思路1.2 定位流程2. 边缘化原理及应用2.1 边缘化原理2.2 从滤波角度理解边缘化3. 基于kitti的实现原理3.1 基于地图定位的滑动窗口模型3.2 边缘化过程4. lio-mapping 介绍4.1 核心思想4.2 具体流程4.…

lamada表达式、stream、collect整理

lamada表达式格式 格式:( parameter-list ) -> { expression-or-statements } 实例:简化匿名内部类的写法 原本写法: public class LamadaTest { public static void main(String[] args) { new Thread(new Runnable() { …

基于PYTHON django四川旅游景点推荐系统

摘 要基于四川旅游景点推荐系统的设计与实现是一个专为四川旅游景点为用户打造的旅游网站。该课题基于网站比较流行的Python 语言系统架构,B/S三层结构模式,通过Maven项目管理工具进行Jar包版本的控制。本系统用户可以发布个人游记,查看景点使用户达到良…

树莓派安装虚拟键盘matchbox-keyboard,解决虚拟键盘乱码问题,解决MIPI DSI触摸屏触控漂移问题

安装虚拟键盘,解决乱码问题 当我们买了触摸屏后,会发现没有键盘,还是无法输入,因此需要虚拟键盘 如果你的语言和地区是中文,那么安装虚拟键盘后可能显示乱码,所以还需要安装中文字体 sudo apt install ttf…

音视频开发—FFMpeg编码解码

FFMpeg 作为音视频领域的开源工具,它几乎可以实现所有针对音视频的处理,本文主要利用 FFMpeg 官方提供的 SDK 实现音视频最简单的几个实例:编码、解码、封装、解封装、转码、缩放以及添加水印。 接下来会由发现问题->分…

Elasticsearch5.5.1 自定义评分插件开发

文本相似度插件开发,本文基于Elasticsearch5.5.1,Kibana5.5.1 下载地址为: Past Releases of Elastic Stack Software | Elastic 本地启动两个服务后,localhost:5601打开Kibana界面,点击devTools,效果图…

koa ts kick off 搭建项目的基本架子

koa ts kick off 使用ts开发koa项目的基本架子,便于平时随手调研一些技术 项目结构 ├── src │ ├── controller //controller层 │ ├── service //service层 │ ├── routes.ts //路由 │ └── index.ts //项目入…

【图像配准】多图配准/不同特征提取算法/匹配器比较测试

前言 本文首先完成之前专栏前置博文未完成的多图配准拼接任务&#xff0c;其次对不同特征提取器/匹配器效率进行进一步实验探究。 各类算法原理简述 看到有博文[1]指出&#xff0c;在速度方面SIFT<SURF<BRISK<FREAK<ORB&#xff0c;在对有较大模糊的图像配准时&…

04 react css上下浮动动画效果

react css上下浮动动画效果html原生实现上下浮动react 实现上下浮动思路分析实现步骤1.引入useRef2.在所属组件内定义—个变量3.在按钮上添加事件4.定义点击事件对window.scrollTo()进行了解&#xff1a;在react中实现效果图&#xff1a;html原生实现上下浮动 我们有一个导向箭…

【分享】订阅金蝶KIS集简云连接器同步OA付款审批数据至金蝶KIS

方案简介 集简云基于钉钉连接平台完成与钉钉的深度融合&#xff0c;实现钉钉OA审批与数百款办公应用软件&#xff08;如金蝶KIS、用友等&#xff09;的数据互通&#xff0c;让钉钉的OA审批流程与企业内部应用软件的采购、付款、报销、收款、人事管理、售后工单、立项申请等环节…

【2023面试秘籍】 测试工程师的简历该怎么写?

作为软件测试的垂直领域深耕者&#xff0c;面试或者被面试都是常有的事&#xff0c;可是不管是啥&#xff0c;总和简历有着理不清的关系&#xff0c;面试官要通过简历了解面试者的基本信息、过往经历等&#xff0c;面试者希望通过简历把自己最好的一面体现给面试官&#xff0c;…

【Java 面试合集】重写以及重载有什么区别能简单说说嘛

重写以及重载有什么区别能简单说说嘛 前述 这是一道非常基础的面试题&#xff0c;我们在回答的过程中一定要逐一横向比较。 从方法的 修饰符&#xff0c;返回值&#xff0c;方法名&#xff0c;含义&#xff0c;参数等方面进行逐一分析来比较不同。 话不多话&#xff0c;看下…