RMAN常用设置[final]

 

1. 登陆RMAN, 不做介绍。


2. 常用命令


① 要使用操作系统命令:

RMAN> host;

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\wangxiaoqi>

与SqlPlus中不同的是,RMAN中host后面必须加“;”

② 使用SQL命令:

RMAN> SQL 'ALTER SYSTEM ARCHIVE LOG ALL';

但是使用SQL命令的限制比较多,主要是针对数据库级的操作,很多的SQL语句都是无法使用的
因此最好的方法是先host登录到OS,再sqlplus进入SQL:

RMAN> host;

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\wangxiaoqi>sqlplus wangxiaoqi/wangxiaoqi

SQL*Plus: Release 9.2.0.1.0 - Production on Thu Sep 18 14:30:03 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

SQL>


3、 首先列出所有指标:

RMAN> show all;
using target database controlfile instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\ORA92\DATABASE\SNCFDODO.ORA';# default


4、 配置自动通道数:

RMAN> show device type;

RMAN configuration parameters are:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default

RMAN> configure device type disk parallelism 2; --表示并行数

new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

 指定在以后的备份与恢复中,将采用并行度为2,同时开启2个通道进行备份与恢复,当然也可以在run中指定通道来决定备份与恢复的并行程度。并行的数目决定了开启通道的个数。如果指定了通道配置,将采用指定的通道,如果没有指定通道,将采用默认通道配置。有点儿绕是吧,我来给你白话一把。


 默认情况下,自动分配通道的并行度为1,如果你通过设置PARALLELISM设置了并行通道为2,那么在run块中,如果你没有单独通过ALLOCATE CHANNEL命令指定通道,它会默认使用2条并行通道,如果你在run命令块中指定了数个ALLOCATE CHANNEL,那么rman在执行备份命令时会以你设置的channel为准,而不管configure中配置了多少个并行通道。需要注意的一点是,在backup命令中有一个FILESPERSET参数,该参数是指rman建立的每个备份集中所能包含的备份片段(即磁盘文件)的最大数,该参数默认值为64,如果在执行backup命令时没有指定该参数值,那么rman会仅使用第一个通道来执行备份,其它通道将处于空闲状态。关于通道数与FILESPERSET值之间也有一个大小关系,逻辑稍显复杂这些就不多废话了,总之一条,filesperset值不要小于你设定的通道数。

RMAN> show device type;

RMAN configuration parameters are:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;

若要清除对通道数的设置(其它参数同):

RMAN> configure device type disk clear;

old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
RMAN configuration parameters are successfully reset to default value
starting full resync of recovery catalog
full resync complete

 

5、制定自动通道默认设备:

RMAN> show default device type;

RMAN configuration parameters are:
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

RMAN> configure default device type to sbt; --磁带备份

new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> configure default device type clear; --还原默认设置

old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
RMAN configuration parameters are successfully reset to default value
starting full resync of recovery catalog
full resync complete

 

6、配置磁盘:

RMAN> show channel;

RMAN configuration parameters are:
RMAN configuration has no stored or default parameters

RMAN> configure channel device type disk format 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> configure channel 2 device type disk format 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';

new RMAN configuration parameters:
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> show channel;

RMAN configuration parameters are:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';

注:%t代替时间戳;%s代替备份组号;%p代替备份片号

取消:

RMAN> configure channel 2 device type disk clear;

old RMAN configuration parameters:
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT 'D:\oracle\oradata\dodo\rmanback\ora_%t_%s_%p';
old RMAN configuration parameters are successfully deleted
starting full resync of recovery catalog
full resync complete

 

7、控制文件配置:

启动控制文件的自动备份:

RMAN> configure controlfile autobackup on;

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> show controlfile autobackup;

RMAN configuration parameters are:
CONFIGURE CONTROLFILE AUTOBACKUP ON;

设置控制文件、服务器参数文件备份文件格式路径:

RMAN> configure controlfile autobackup format for device type disk to 'D:\oracle
\oradata\dodo\rmanback\ctl_%F'; --F必须大写

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\oracle\orada
ta\dodo\rmanback\ctl_%F';
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

 

8、保存策略:

保存策略分两种

时间策略:决定至少有一个备份能恢复到指定的日期

RMAN> configure retention policy to recovery window of 3 days;

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

注:保证至少有一个备份能恢复到3天前的时间点上,之前备份标注为obsolete

冗余策略:决定至少有几个冗余的备份:
RMAN> configure retention policy to redundancy 3;

old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

注:至少需要有3个冗余备份,若多于3个,则以前备份标记为obsolete

取消策略:

RMAN> configure retention policy to none;

查看策略:

RMAN> show retention policy

RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;

注:可以用 RMAN> report obsolete; 来查找当前的obsolete备份。


9、备份优化设置:

打开备份优化:
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;

关闭备份优化:
RMAN> CONFIGURE BACKUP OPTIMIZATION OFF;


具体优化机制比较复杂,需要注意以下两点:
①type只能选一种,不能disk和sbt都选
②BACKUP DATABASE或BACKUP ARCHIVELOG命令中带有ALL或LIKE参数

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-675024/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-675024/

PS D:\Codes> conda activate base PS D:\Codes> & D:/anaconda/python.exe d:/Codes/参照化模态感知网络.py Epoch [1/30]: New best model saved with accuracy: 94.35% Epoch [2/30]: New best model saved with accuracy: 94.97% Epoch [3/30]: New best model saved with accuracy: 95.53% Epoch [5/30]: New best model saved with accuracy: 95.84% Epoch [7/30]: New best model saved with accuracy: 95.90% Epoch [8/30]: New best model saved with accuracy: 96.21% Epoch [13/30]: Early stopping after 5 epochs without improvement Overall Training: 40%|███████████████▌ | 12/30 [01:37<02:26, 8.16s/it, test_acc=95.84%, test_loss=0.1185, train_acc=99.50%, train_loss=0.0185] Final Evaluation: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 26/26 [00:01<00:00, 22.53it/s, acc=100.00%] Final Test Accuracy: 96.21% d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 20005 (\N{CJK UNIFIED IDEOGRAPH-4E25}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 37325 (\N{CJK UNIFIED IDEOGRAPH-91CD}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 20379 (\N{CJK UNIFIED IDEOGRAPH-4F9B}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 28082 (\N{CJK UNIFIED IDEOGRAPH-6DB2}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 19981 (\N{CJK UNIFIED IDEOGRAPH-4E0D}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 36275 (\N{CJK UNIFIED IDEOGRAPH-8DB3}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 24037 (\N{CJK UNIFIED IDEOGRAPH-5DE5}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 20917 (\N{CJK UNIFIED IDEOGRAPH-51B5}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 27491 (\N{CJK UNIFIED IDEOGRAPH-6B63}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 24120 (\N{CJK UNIFIED IDEOGRAPH-5E38}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 21943 (\N{CJK UNIFIED IDEOGRAPH-55B7}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 25277 (\N{CJK UNIFIED IDEOGRAPH-62BD}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 27668 (\N{CJK UNIFIED IDEOGRAPH-6C14}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 24433 (\N{CJK UNIFIED IDEOGRAPH-5F71}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:322: UserWarning: Glyph 21709 (\N{CJK UNIFIED IDEOGRAPH-54CD}) missing from current font. plt.tight_layout() d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 20005 (\N{CJK UNIFIED IDEOGRAPH-4E25}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 37325 (\N{CJK UNIFIED IDEOGRAPH-91CD}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 20379 (\N{CJK UNIFIED IDEOGRAPH-4F9B}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 28082 (\N{CJK UNIFIED IDEOGRAPH-6DB2}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 19981 (\N{CJK UNIFIED IDEOGRAPH-4E0D}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 36275 (\N{CJK UNIFIED IDEOGRAPH-8DB3}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 24037 (\N{CJK UNIFIED IDEOGRAPH-5DE5}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 20917 (\N{CJK UNIFIED IDEOGRAPH-51B5}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 27491 (\N{CJK UNIFIED IDEOGRAPH-6B63}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 24120 (\N{CJK UNIFIED IDEOGRAPH-5E38}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 21943 (\N{CJK UNIFIED IDEOGRAPH-55B7}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 25277 (\N{CJK UNIFIED IDEOGRAPH-62BD}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 27668 (\N{CJK UNIFIED IDEOGRAPH-6C14}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 24433 (\N{CJK UNIFIED IDEOGRAPH-5F71}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:323: UserWarning: Glyph 21709 (\N{CJK UNIFIED IDEOGRAPH-54CD}) missing from current font. plt.savefig('predictions.png') d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 20005 (\N{CJK UNIFIED IDEOGRAPH-4E25}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 37325 (\N{CJK UNIFIED IDEOGRAPH-91CD}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 20379 (\N{CJK UNIFIED IDEOGRAPH-4F9B}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 28082 (\N{CJK UNIFIED IDEOGRAPH-6DB2}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 19981 (\N{CJK UNIFIED IDEOGRAPH-4E0D}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 36275 (\N{CJK UNIFIED IDEOGRAPH-8DB3}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 24037 (\N{CJK UNIFIED IDEOGRAPH-5DE5}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 20917 (\N{CJK UNIFIED IDEOGRAPH-51B5}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 27491 (\N{CJK UNIFIED IDEOGRAPH-6B63}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 24120 (\N{CJK UNIFIED IDEOGRAPH-5E38}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 21943 (\N{CJK UNIFIED IDEOGRAPH-55B7}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 25277 (\N{CJK UNIFIED IDEOGRAPH-62BD}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 27668 (\N{CJK UNIFIED IDEOGRAPH-6C14}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 24433 (\N{CJK UNIFIED IDEOGRAPH-5F71}) missing from current font. plt.show() d:\Codes\参照化模态感知网络.py:324: UserWarning: Glyph 21709 (\N{CJK UNIFIED IDEOGRAPH-54CD}) missing from current font. plt.show() Model saved as 'final_rman_model.pth' 这是什么以上
08-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值