欢迎来到天天文库
浏览记录
ID:37748403
大小:60.00 KB
页数:9页
时间:2019-05-30
《数据库备份和恢复方案及步骤》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、操作系统:GNU/Linux数据库管理系统:Oracle10g一、安装RecoveryCatalog1,用dbca创建一个DATABASEcatdb,用于存放recoverycatalogdata[oracle@localhost~]$dbca2,在catdb中创建一个名为rcat_ts的表空间作为用户rman的默认表空间[oracle@localhost~]$sqlplussys/oracle@catdbassysdbaSQL>createtablespacercat_ts;SQL>createuserrma
2、nidentifiedbyoracletemporarytablespacetempDefaulttablespacercat_tsquotaunlimitedonrcat_ts;3,授予catlog所有者rmanrecovery_catalog_owner角色,该角色提供给用户所有查询和维护recoverycatalog所必需的权限SQL>grantconnect,resource,recovery_catalog_ownertorman;4,启动rman,以catalog所有者rman登录[oracle@l
3、ocalhost~]$rmancatalogrman/oracle@catdbRMAN>createcatalogtablespacercat_ts;5,用rman同时连接到target数据库、catalog数据库,在新建的recoverycatalog中注册target数据库[oracle@localhost~]$rmantargetsys/oracle@orclcatalogrman/oracle@catdbRMAN>registerdatabase;6,察看已在recoverycatalog中注册的tar
4、get数据库[oracle@localhost~]$sqlplusrman/oracle@catdbSQL>select*fromdb;二、配置RMAN 1,同时连接target数据库和recoverycatalog数据库[oracle@localhost~]$rmantargetsys/oracle@orclcatalogrman/oracle@catdb2,RMAN> showall (检查配置) configuredefaultdevicetypetodisk (设置默认的备份的设备为磁盘)
5、CONFIGUREDEVICETYPEDISKPARALLELISM1BACKUPTYPETOBACKUPSET;(设置备份的并行级别) configurechannel1devicetypediskformat'/home/new/backup_%U' (设置备份文件格式) configurechannel2devicetypediskformat'/home/oracle/backup_%U' (设置备份文件格式) configurecontrolfileautobackupon (打开控制文件
6、的自动备份) configurecontrolfileautobackupformatfordevicetypediskto'/home/new/ctl_%F'(设置控制文件备份格式)三.备份测试 备份全库 1,同时连接target数据库和recoverycatalog数据库[oracle@localhost~]$rmantargetsys/oracle@orclcatalogrman/oracle@catdb2,RMAN>backupdatabaseplusarchivelogdeleteinput;3,
7、连接target数据库[oracle@localhost~]$sqlplussys/oracle@orclassysdbaSQL>connhr/hr;SQL>selectsalaryfromemployeeswhereemployee_id=157;SQL>updateemployeessetsalary=2000whereemployee_id=157;SQL>commit;SQL>selectsalaryfromemployeeswhereemployee_id=157; 四.恢复测试复原及恢复全库1,连接
8、target数据库[oracle@localhost~]$sqlplussys/oracle@orclassysdba2,把target数据库先关闭,然后启动到mount状态SQL>shutdownimmediate;SQL>startupmount;3,复原及恢复全库RMAN>restoredatabasechannelORA_DISK_1:restorecomplete,elaps
此文档下载收益归作者所有