目录
RAC Rman 配置全过程... 1
1 配置nfs. 2
2 配置archive. 4
3 配置rman. 4
4 配置 crontab. 5
检查linux系统中是否安装了nfs-utils和portmap两个软件包(RHEL4系统默认已经安装了这两个软件包)
#rpm –qa nfs-utils portmap
查看NFS服务是否启动,没有则启动
#service nfs starus
#service portmap status
#service nfs start
#service portmap start
在两个节点都要创建
/archivelog/archivelog1
/archivelog/archivelog2
NFS服务器的配置文件保存“/etc/”目录中,文件名称是“exports”,该文件用于被指NFS服务器提供的目录共享
#vi /etc/exports
例如:在节点一11.64.1.70在的/etc/exports 文件为
[root@vmdb01p ~]# more /etc/exports
/archivelog/archivelog1 11.64.19.72(rw)
在节点二11.64.1.72的/etc/exports 文件为
/archivelog/archivelog2 11.64.19.70(rw)
Exportfs管理工具可以对“exports”文件进行管理
命令#exportfs –rv 可以让新设置的“exports”文件内容生效
显示当前主机中NFS服务器的输出列表
# showmount -e
显示当前主机NFS服务器中已经被NFS客户机挂载使用的共享目录
# showmount -d
在节点一执行
# mount -t nfs 11.64.1.72: /archivelog/archivelog2 /archivelog/archivelog2
在节点二执行
# mount -t nfs 11.64.1.70: /archivelog/archivelog1 /archivelog/archivelog1
#df -h
总结:
1.10、在配置NFS服务器之前用ping命令确保两个linux系统正常连接,如果无法连接关闭图形界面中的防火墙#service iptables stop
1.11、在配置中确保输入的命令是正确的
1.12、更改完“exports”文件后要输入exportfs –rv ,使得“exports”文件生效。
1.13、检查nfs服务是否开启,默认是关闭的。
1.14、卸载的时候不能在/mnt目录中卸载,必须注销系统后卸载。
srvctl stop database -d HR91PRD
sql>startup mount
sql>alter system set cluster_database=false scope=spfile;
sql>shutdown immediate
sql>startup mount
sql>alter system set log_archive_dest_1='LOCATION=/archivelog1' scope=spfile sid=' HR91PRD1 ';
sql>alter system set log_archive_dest_1='LOCATION=/archivelog2' scope=spfile sid=' HR91PRD2 ';
sql>alter system set log_archive_format ='arch1_%s_%R_%T.arc' scope=spfile sid=' HR91PRD1';
sql>alter system set log_archive_format ='arch2_%s_%R_%T.arc' scope=spfile sid=' HR91PRD2 ';
sql>alter database archivelog
sql>alter database open
sql>alter system set cluster_database=true scope=spfile;
sql>shutdown immediate;
sql>srvctl start database -d HR91PRD
sql>sqlplus / as sysdba;
sql>archive log list;
/oracle/rmanbackup/
RMAN> show all;
rman>CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 2 DAYS;
rman>CONFIGURE CONTROLFILE AUTOBACKUP ON;
rman>CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oracle/rmanbackup/%F.ctl';
#!/bin/sh
# set porfile_env
export ORACLE_SID= HR91PRD1 # rman level0 backup
rman log='/oracle/rmanbackup/log/arch_rman0.log' append <<EOF
connect target/
run {
allocate channel c1 type disk;
allocate channel c2 type disk;
backup incremental level 0
database format '/oracle/rmanbackup/level0_%d_%s_%p_%u.bak' tag 'level0 include controlfile';
sql 'alter system archive log current';
backup archivelog all format '/oracle/rmanbackup/archlog_%d_%s_%p_%u.bak' delete all input;
release channel c1;
release channel c2;
}
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
在crontab添加计划任务 crontab -e 或者vi /etc/spool/cron/crontab
0 22 * * * su – oracle -c /oracle/rmanbackup/scripts/rmanlevel0.sh 1>/dev/null 2>/dev/null //每日22:00运行 0级备份
本文出自 “分享快乐” 博客,转载请与作者联系!