RMAN数据库全备
发表于:2025-01-20 作者:千家信息网编辑
千家信息网最后更新 2025年01月20日,在数据库mount或者open阶段,我们可以使用backup database备份整个数据库。也可以使用configure exclude命令在配置中默认在全备时排除某个表空间不备份,也可以在back
千家信息网最后更新 2025年01月20日RMAN数据库全备在数据库mount或者open阶段,我们可以使用backup database备份整个数据库。
也可以使用configure exclude命令在配置中默认在全备时排除某个表空间不备份,也可以在backup时指定 noexclude不排除某个表空间。
备份数据的步骤:
1.使用RMAN连接目标库
2.确认数据库是mount或者open阶段
3.使用backup database命令备份数据库。在备份之前应该确认configuration中的默认值,然后根据实际情况添加参数,如果channel,format,plus archivelog等等。
默认值中备份了spfile和controlfile,示例分配两个channel备份全库
[oracle@lzl ~]$ vi /home/oracle/full_backup.sql
[oracle@lzl ~]$ cat /home/oracle/full_backup.sql
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database format '/home/oracle/rman_full_%T_%u';
release channel c1;
release channel c2;
}
RMAN> @/home/oracle/full_backup.sql
RMAN> run{
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> backup database format '/home/oracle/rman_full_%T_%u';
5> release channel c1;
6> release channel c2;
7> }
released channel: ORA_DISK_1。 -release了默认值中的channel
allocated channel: c1
channel c1: SID=1 device type=DISK
allocated channel: c2
channel c2: SID=43 device type=DISK。 -每个channel拥有独立的sid
Starting backup at 2017-07-25 16:48:13
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/test/users01.dbf
channel c1: starting piece 1 at 2017-07-25 16:48:13
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel c2: starting piece 1 at 2017-07-25 16:48:13。 -两个channel分别备份了两个数据文件。
channel c1: finished piece 1 at 2017-07-25 16:48:28
piece handle=/home/oracle/rman_full_20170725_0asa8fad tag=TAG20170725T164813 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:15
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
channel c2: finished piece 1 at 2017-07-25 16:48:28
piece handle=/home/oracle/rman_full_20170725_0bsa8fad tag=TAG20170725T164813 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:15
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
including current SPFILE in backup set。
channel c2: starting piece 1 at 2017-07-25 16:48:28
including current control file in backup set。
channel c1: starting piece 1 at 2017-07-25 16:48:29
channel c2: finished piece 1 at 2017-07-25 16:48:29
piece handle=/home/oracle/rman_full_20170725_0dsa8fas tag=TAG20170725T164813 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c1: finished piece 1 at 2017-07-25 16:48:30
piece handle=/home/oracle/rman_full_20170725_0csa8fas tag=TAG20170725T164813 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-25 16:48:30。 -每个backup piece都是同一个tag
released channel: c1
released channel: c2。 -释放channel
RMAN> **end-of-file**
[oracle@lzl ~]$ ls -lrth rman_full_*
-rw-r----- 1 oracle oinstall 490M Jul 25 16:48 rman_full_20170725_0bsa8fad
-rw-r----- 1 oracle oinstall 998M Jul 25 16:48 rman_full_20170725_0asa8fad
-rw-r----- 1 oracle oinstall 96K Jul 25 16:48 rman_full_20170725_0dsa8fas
-rw-r----- 1 oracle oinstall 9.4M Jul 25 16:48 rman_full_20170725_0csa8fas
[oracle@lzl ~]$ strings rman_full_20170725_0dsa8fas |more
}|{z
TEST
TAG20170725T164813
TEST
test.__db_cache_size=729808896
test.__java_pool_size=4194304
…
strings的开头几行可以查看目标库和tag,如果是spfile还可以清楚的看到参数设置
也可以使用configure exclude命令在配置中默认在全备时排除某个表空间不备份,也可以在backup时指定 noexclude不排除某个表空间。
备份数据的步骤:
1.使用RMAN连接目标库
2.确认数据库是mount或者open阶段
3.使用backup database命令备份数据库。在备份之前应该确认configuration中的默认值,然后根据实际情况添加参数,如果channel,format,plus archivelog等等。
默认值中备份了spfile和controlfile,示例分配两个channel备份全库
[oracle@lzl ~]$ vi /home/oracle/full_backup.sql
[oracle@lzl ~]$ cat /home/oracle/full_backup.sql
run{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database format '/home/oracle/rman_full_%T_%u';
release channel c1;
release channel c2;
}
RMAN> @/home/oracle/full_backup.sql
RMAN> run{
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> backup database format '/home/oracle/rman_full_%T_%u';
5> release channel c1;
6> release channel c2;
7> }
released channel: ORA_DISK_1。 -release了默认值中的channel
allocated channel: c1
channel c1: SID=1 device type=DISK
allocated channel: c2
channel c2: SID=43 device type=DISK。 -每个channel拥有独立的sid
Starting backup at 2017-07-25 16:48:13
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/test/system01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/test/users01.dbf
channel c1: starting piece 1 at 2017-07-25 16:48:13
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/test/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/test/undotbs01.dbf
channel c2: starting piece 1 at 2017-07-25 16:48:13。 -两个channel分别备份了两个数据文件。
channel c1: finished piece 1 at 2017-07-25 16:48:28
piece handle=/home/oracle/rman_full_20170725_0asa8fad tag=TAG20170725T164813 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:15
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
channel c2: finished piece 1 at 2017-07-25 16:48:28
piece handle=/home/oracle/rman_full_20170725_0bsa8fad tag=TAG20170725T164813 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:15
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
including current SPFILE in backup set。
channel c2: starting piece 1 at 2017-07-25 16:48:28
including current control file in backup set。
channel c1: starting piece 1 at 2017-07-25 16:48:29
channel c2: finished piece 1 at 2017-07-25 16:48:29
piece handle=/home/oracle/rman_full_20170725_0dsa8fas tag=TAG20170725T164813 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:01
channel c1: finished piece 1 at 2017-07-25 16:48:30
piece handle=/home/oracle/rman_full_20170725_0csa8fas tag=TAG20170725T164813 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-25 16:48:30。 -每个backup piece都是同一个tag
released channel: c1
released channel: c2。 -释放channel
RMAN> **end-of-file**
[oracle@lzl ~]$ ls -lrth rman_full_*
-rw-r----- 1 oracle oinstall 490M Jul 25 16:48 rman_full_20170725_0bsa8fad
-rw-r----- 1 oracle oinstall 998M Jul 25 16:48 rman_full_20170725_0asa8fad
-rw-r----- 1 oracle oinstall 96K Jul 25 16:48 rman_full_20170725_0dsa8fas
-rw-r----- 1 oracle oinstall 9.4M Jul 25 16:48 rman_full_20170725_0csa8fas
[oracle@lzl ~]$ strings rman_full_20170725_0dsa8fas |more
}|{z
TEST
TAG20170725T164813
TEST
test.__db_cache_size=729808896
test.__java_pool_size=4194304
…
strings的开头几行可以查看目标库和tag,如果是spfile还可以清楚的看到参数设置
备份
数据
数据库
两个
参数
命令
目标
空间
阶段
全备
清楚
实际
开头
情况
文件
步骤
示例
分配
独立
配置
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
数据库笔试50题
网络安全现场检查工具
网游的服务器长什么样
hgnc数据库使用
计算机网络技术和修车哪个挣钱
电力网络安全市场机遇
戴尔430服务器怎么加硬盘
服务器怎么进入任务管理器
服务器怎么造好看
给政府机关讲网络安全开场白
eve手机版无法加载服务器
办公系统基础数据库搭建
机构知识库 特色数据库
电子发票手动上传服务器地址错误
怎么导出商贸宝上的数据库
《网络安全》讲座心得
关于网络安全的积极文章
多维数据库
汕头智能软件开发公司
远程会诊软件开发
win7做网站服务器
维护网络安全 人人有责讨论
中兴通讯网络技术工程师待遇
智邦国际软件开发
广西企业党建软件开发专业制作
网络安全防护是二次安防
安装服务器证书失败
取消xp网络安全密码
服务器名
人民共和国网络安全法自实施