日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

oracle end backup,oracle-backup-hot backup

發布時間:2023/12/15 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle end backup,oracle-backup-hot backup 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

hot backup

--**********************************

--?1、環境確認 歸檔模式、路徑、文件

--**********************************

alter system set log_archive_dest_1='location=/tools/ko16_arch' scope =both;

alter system set db_recovery_file_dest_size=5368709102;

SQL> archive log list

Database log mode????????????? Archive Mode

Automatic archival???????????? Enabled

Archive destination??????????? /tools/ko16_arch

Oldest online log sequence???? 54

Next log sequence to archive?? 56

Current log sequence?????????? 56

set lines 200

col file_name format a50

select tablespace_name,file_name from dba_data_files;

TABLESPACE_NAME??????????????? FILE_NAME

------------------------------ --------------------------------------------------

SYSTEM???????????????????????? /oracle/app/oracle/oradata/ko16/system01.dbf

SYSAUX???????????????????????? /oracle/app/oracle/oradata/ko16/sysaux01.dbf

UNDOTBS1?????????????????????? /oracle/app/oracle/oradata/ko16/undotbs01.dbf

USERS????????????????????????? /oracle/app/oracle/oradata/ko16/users01.dbf

2、準備測試數據

conn scott/tiger

insert into t1 values(1,sysdate);

commit;

alter system switch logfile;

insert into t1 values(2,sysdate);

commit;

alter system switch logfile;

SQL> archive log list

Database log mode????????????? Archive Mode

Automatic archival???????????? Enabled

Archive destination??????????? /tools/ko16_arch

Oldest online log sequence???? 56

Next log sequence to archive?? 58

Current log sequence?????????? 58

[oracle@dg1 ko16_arch]$ ll

total 988

-rw-r----- 1 oracle oinstall?? 4096 Mar 13 11:47 1_55_841493987.dbf

-rw-r----- 1 oracle oinstall 987136 Mar 13 12:10 1_56_841493987.dbf

-rw-r----- 1 oracle oinstall? 16384 Mar 13 12:12 1_57_841493987.dbf

3、開始備份

alter tablespace SYSTEM begin backup;

!cp /oracle/app/oracle/oradata/ko16/system01.dbf /tools/ora_bak/0313

alter tablespace SYSTEM end backup;

alter tablespace SYSAUX begin backup;

!cp /oracle/app/oracle/oradata/ko16/sysaux01.dbf? /tools/ora_bak/0313

alter tablespace SYSAUX end backup;

alter tablespace UNDOTBS1 begin backup;

!cp /oracle/app/oracle/oradata/ko16/undotbs01.dbf? /tools/ora_bak/0313

alter tablespace UNDOTBS1 end backup;

alter tablespace USERS begin backup;

insert into scott.t1 values(3,sysdate);

commit;

alter system switch logfile;

insert into scott.t1 values(4,sysdate);

commit;

alter system switch logfile;

!cp /oracle/app/oracle/oradata/ko16/users01.dbf? /tools/ora_bak/0313

alter tablespace USERS end backup;

insert into scott.t1 values(5,sysdate);

insert into scott.t1 values(6,sysdate);

commit;

alter system switch logfile;

4、模擬數據損壞

rm -rf users01.dbf

將歸檔文件cp到磁帶

shutdown abort

SQL> startup

ORACLE instance started.

Total System Global Area? 521936896 bytes

Fixed Size????????????????? 2214936 bytes

Variable Size???????????? 364905448 bytes

Database Buffers????????? 150994944 bytes

Redo Buffers??????????????? 3821568 bytes

Database mounted.

ORA-01157: cannot identify/lock data file 4 - see DBWR trace file

ORA-01110: data file 4: '/oracle/app/oracle/oradata/ko16/users01.dbf'

5、恢復

alter database datafile '/oracle/app/oracle/oradata/ko16/users01.dbf' offline ;

alter database open;

通知backup組將從磁帶中恢復/oracle/app/oracle/oradata/ko16/users01.dbf及備份期間的歸檔日志

SQL> recover datafile '/oracle/app/oracle/oradata/ko16/users01.dbf';

ORA-00279: change 846808 generated at 03/13/2014 12:29:09 needed for thread 1

ORA-00289: suggestion : /tools/ko16_arch/1_58_841493987.dbf

ORA-00280: change 846808 for thread 1 is in sequence #58

Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 846816 generated at 03/13/2014 12:29:09 needed for thread 1

ORA-00289: suggestion : /tools/ko16_arch/1_59_841493987.dbf

ORA-00280: change 846816 for thread 1 is in sequence #59

Specify log: {=suggested | filename | AUTO | CANCEL}

Log applied.

Media recovery complete.

alter database datafile '/oracle/app/oracle/oradata/ko16/users01.dbf' online ;

select * from scott.t1;

NO CDATE

---------- -------------------

1 2014-03-13 12:07:53

2 2014-03-13 12:12:03

3 2014-03-13 12:29:32

4 2014-03-13 12:29:48

5 2014-03-13 12:31:24

6 2014-03-13 12:31:24

6 rows selected.

總結

以上是生活随笔為你收集整理的oracle end backup,oracle-backup-hot backup的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。