数据库做不完全恢复198

 

1.数据库处于mount模式

SQL>start mount

 

2.执行不完全恢复

#!/bin/bash
. /etc/profile
. ~/.bash_profile

export ORACLE_SID=mydb
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1
rman target / log=/home/oracle/my_scripts/restore_database.log<<EOF
run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
allocate channel ch3 device type disk;
allocate channel ch4 device type disk;
allocate channel ch5 device type disk;
set until time "to_date('2024-06-17 11:40:00','YYYY-MM-DD HH24:MI:SS')";
restore database;
recover database;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
}
EOF

 

3.打开数据库

alter database open resetlogs;

posted @ 2024-06-17 22:28  slnngk  阅读(8)  评论(0编辑  收藏  举报