欧美男女网站_18禁网站免费无遮挡无码中文_国产人妻777人伦精品hd_91超级碰碰_国产三级大全_精品无码国模私拍视频

以文本方式查看主題

-  曙海教育集團(tuán)論壇  (http://www.scarborough.cn/bbs/index.asp)
--  Oracle數(shù)據(jù)庫  (http://www.scarborough.cn/bbs/list.asp?boardid=65)
----  Oracle備份恢復(fù)之利用dbms_backup_restore恢復(fù)數(shù)據(jù)庫  (http://www.scarborough.cn/bbs/dispbbs.asp?boardid=65&id=2505)

--  作者:wangxinxin
--  發(fā)布時間:2010-12-11 11:08:29
--  Oracle備份恢復(fù)之利用dbms_backup_restore恢復(fù)數(shù)據(jù)庫
引用
RMAN> run {
2> allocate channel ch00 device type disk;
3> backup database include current controlfile format \'/backup/full%t\' tag=\'FULLDB\';
4> sql \'alter system archive log current\';
5> backup archivelog all format \'/backup/arch%t\' tag=\'ARCHIVELOG\';
6> release channel ch00;
7> }

allocated channel: ch00
channel ch00: sid=17 devtype=DISK

Starting backup at 20-JAN-10
channel ch00: starting full datafile backupset
channel ch00: specifying datafile(s) in backupset
including current controlfile in backupset
input datafile fno=00001 name=/app/oracle/oradata/ora9i/system01.dbf
input datafile fno=00002 name=/app/oracle/oradata/ora9i/undotbs01.dbf
input datafile fno=00005 name=/app/oracle/oradata/ora9i/example01.dbf
input datafile fno=00011 name=/app/oracle/oradata/ora9i/STREAM01.dbf
input datafile fno=00010 name=/app/oracle/oradata/ora9i/xdb01.dbf
input datafile fno=00006 name=/app/oracle/oradata/ora9i/indx01.dbf
input datafile fno=00009 name=/app/oracle/oradata/ora9i/users01.dbf
input datafile fno=00003 name=/app/oracle/oradata/ora9i/cwmlite01.dbf
input datafile fno=00004 name=/app/oracle/oradata/ora9i/drsys01.dbf
input datafile fno=00007 name=/app/oracle/oradata/ora9i/odm01.dbf
input datafile fno=00008 name=/app/oracle/oradata/ora9i/tools01.dbf
channel ch00: starting piece 1 at 20-JAN-10
channel ch00: finished piece 1 at 20-JAN-10
piece handle=/backup/full708756233 comment=NONE
channel ch00: backup set complete, elapsed time: 00:02:26
Finished backup at 20-JAN-10

Starting Control File and SPFILE Autobackup at 20-JAN-10
piece handle=/app/oracle/product/9.0.2/dbs/c-2494723682-20100120-00 comment=NONE
Finished Control File and SPFILE Autobackup at 20-JAN-10

sql statement: alter system archive log current

Starting backup at 20-JAN-10
current log archived
channel ch00: starting archive log backupset
channel ch00: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=254 stamp=708756150
input archive log thread=1 sequence=2 recid=255 stamp=708756383
input archive log thread=1 sequence=3 recid=256 stamp=708756383
channel ch00: starting piece 1 at 20-JAN-10
channel ch00: finished piece 1 at 20-JAN-10
piece handle=/backup/arch708756383 comment=NONE
channel ch00: backup set complete, elapsed time: 00:00:02
Finished backup at 20-JAN-10

Starting Control File and SPFILE Autobackup at 20-JAN-10
piece handle=/app/oracle/product/9.0.2/dbs/c-2494723682-20100120-01 comment=NONE
Finished Control File and SPFILE Autobackup at 20-JAN-10

released channel: ch00

假設(shè)現(xiàn)在數(shù)據(jù)庫異常宕機(jī)
引用
SQL> shutdown abort
ORACLE instance shut down

啟動數(shù)據(jù)庫至nomount狀態(tài)
引用
SQL> startup nomount
ORACLE instance started.

Total System Global Area 1125193868 bytes
Fixed Size                   452748 bytes
Variable Size             335544320 bytes
Database Buffers          788529152 bytes
Redo Buffers                 667648 bytes

1、利用dbms_backup_restore恢復(fù)控制文件
引用

SQL> DECLARE
  2  devtype varchar2(256);
  3  done boolean;
  4  BEGIN
  5  devtype := dbms_backup_restore.DeviceAllocate(type => \'\',ident => \'testctl\');
  6  dbms_backup_restore.RestoresetdataFile;
  7  dbms_backup_restore.RestoreControlFileto(\'/app/oracle/oradata/ora9i/control01.ctl\');
  8  dbms_backup_restore.RestoreBackupPiece(\'/backup/full708756233\',done => done);
  9  dbms_backup_restore.RestoresetdataFile;
10  dbms_backup_restore.RestoreControlFileto(\'/app/oracle/oradata/ora9i/control02.ctl\');
11  dbms_backup_restore.RestoreBackupPiece(\'/backup/full708756233\',done => done);
12  dbms_backup_restore.RestoresetdataFile;
13  dbms_backup_restore.RestoreControlFileto(\'/app/oracle/oradata/ora9i/control03.ctl\');
14  dbms_backup_restore.RestoreBackupPiece(\'/backup/full708756233\',done => done);
15  dbms_backup_restore.DeviceDeallocate;
16  END;
17  /

PL/SQL procedure successfully completed.

當(dāng)然也已可用rman進(jìn)行控制文件恢復(fù)
引用
RMAN> restore controlfile from \'/app/oracle/product/9.0.2/dbs/c-2494723682-20100120-00\';

Starting restore at 20-JAN-10

using channel ORA_DISK_1
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/app/oracle/oradata/ora9i/control01.ctl
output filename=/app/oracle/oradata/ora9i/control02.ctl
output filename=/app/oracle/oradata/ora9i/control03.ctl
Finished restore at 20-JAN-10


2、利用dbms_backup_restore恢復(fù)數(shù)據(jù)文件
引用
SQL> DECLARE
  2  devtype varchar2(256);
  3  done boolean;
  4  BEGIN
  5  devtype := dbms_backup_restore.DeviceAllocate (type => \'\',ident => \'testdatafile\');
  6  dbms_backup_restore.RestoreSetDatafile;
  7  dbms_backup_restore.RestoreDatafileTo(dfnumber => 1,toname => \'/app/oracle/oradata/ora9i/system01.dbf\');
  8  dbms_backup_restore.RestoreDatafileTo(dfnumber => 2,toname => \'/app/oracle/oradata/ora9i/undotbs01.dbf\');
  9  dbms_backup_restore.RestoreBackupPiece(done => done,handle => \'/backup/full708756233\', params => null);
10  dbms_backup_restore.DeviceDeallocate;
11  END;
12  /



PL/SQL procedure successfully completed.

3、利用dbms_backup_restore恢復(fù)歸檔日志
引用
SQL> DECLARE
  2  devtype varchar2(256);
  3  done boolean;
  4  BEGIN
  5  devtype := dbms_backup_restore.DeviceAllocate (type => \'\',ident => \'testarchlog\');
  6  dbms_backup_restore.RestoreSetArchivedLog(destination=>\'/app/oracle/product/9.0.2/dbs/arch\');
  7  dbms_backup_restore.RestoreArchivedLog(thread=>1,sequence=>1);
  8  dbms_backup_restore.RestoreArchivedLog(thread=>1,sequence=>2);
  9  dbms_backup_restore.RestoreArchivedLog(thread=>1,sequence=>3);
10  dbms_backup_restore.RestoreBackupPiece(done => done,handle => \'/backup/arch708756383\', params => null);
11  dbms_backup_restore.DeviceDeallocate;
12  END;
13  /

PL/SQL procedure successfully completed.


主站蜘蛛池模板: 免费精品在线 | 好吊色欧美一区二区三区视频 | 黄色成人在线视频 | 亚洲一区二区精品在线观看 | 国产精品91在线观看 | 国产精品久久久久久久天堂第1集 | 成人毛片100免费观看 | 手机av网址 | 日韩欧美亚洲视频 | 久久久久久久免费视频 | 天天舔天天爱 | 欧美性大战久久久 | 天天操夜夜爽 | 黄色的网站在线观看 | 波多野结衣家庭教师 | 久久伊人爱 | 久久av色| 亚洲精品一二 | 中文字幕av久久爽一区 | 综合五月网 | 成人在线综合 | 麻豆国产精品777777在线 | 手机看片国产精品 | 婷婷视频在线播放 | 天堂国产在线 | 黄色特级大片 | 五月视频| 岛国av免费在线观看 | 午夜天堂在线 | 91精品国产综合久久久久久 | 亚洲激情四射 | 亚洲a在线播放 | 久久久免费精品视频 | 国产又爽又黄免费视频 | 麻豆一区二区99久久久久 | 亚洲男人天堂2023 | 欧洲精品一区 | 国产视频第一页 | 欧美日韩亚洲综合 | 亚洲精品免费在线 | 国产精品一区二区三区不卡 |