91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Oracle 冷備份詳解【實戰案例】

發布時間:2020-06-17 12:10:35 來源:網絡 閱讀:1505 作者:PengChonggui 欄目:關系型數據庫

Oracle 冷備份詳解

--準備工作
select * from v$database;
select file_name from dba_data_files;

create tablespace inv datafile '/oradata/ocm/inv01.dbf' size 2048M;
create user inv identified by inv default tablespace inv temporary tablespace temp;
grant dba,resource to inv;

alter user scott account unlock;
SQL> conn scott/tiger
select * from tab;
select 'create table '||tname||' as select * from scott.'||tname||';' from tab;

create table BONUS as select * from scott.BONUS;
create table DEPT as select * from scott.DEPT;
create table EMP as select * from scott.EMP;
create table SALGRADE as select * from scott.SALGRADE;

create table te_objects as select * from dba_objects;


--oracle冷備份


select instance_name,version,status,archiver,database_status from v$instance;
select dbid,name,log_mode from v$database;

--需要備份文件包括:
/*
 數據文件,聯機重做日志文件,控制文件,臨時文件,參數文件,密碼文件,監聽文件,tnsnames文件,sqlnet文件
*/

--執行語句準備
select 'cp '|| name ||' /ggs/backup/cold_back' from v$datafile
union all
select 'cp '|| name ||' /ggs/backup/cold_back' from v$tempfile
union all
select 'cp '|| member ||' /ggs/backup/cold_back' from v$logfile
union all
select 'cp '|| name ||' /ggs/backup/cold_back' from v$controlfile;

--注:使用以上SQL生成的Linux命令進行執行,如下:
cp /oradata/ocm/system01.dbf /ggs/backup/cold_back
cp /oradata/ocm/sysaux01.dbf /ggs/backup/cold_back
cp /oradata/ocm/undotbs01.dbf /ggs/backup/cold_back
cp /oradata/ocm/users01.dbf /ggs/backup/cold_back
cp /oradata/ocm/ogg.dbf /ggs/backup/cold_back
cp /oradata/ocm/inv01.dbf /ggs/backup/cold_back
cp /oradata/ocm/temp01.dbf /ggs/backup/cold_back
cp /oradata/ocm/redo04a.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo04b.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo03a.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo03b.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo02a.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo02b.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo01a.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo01b.rdo /ggs/backup/cold_back
cp /oradata/ocm/control01.ctl /ggs/backup/cold_back
cp /oradata/ocm/control02.ctl /ggs/backup/cold_back
cp /oradata/ocm/control03.ctl /ggs/backup/cold_back

create pfile='/ggs/backup/cold_back/dbs/initocm.ora' from spfile;
cp $ORACLE_HOME/dbs/orapwocm  /ggs/backup/cold_back/dbs/
cp $ORACLE_HOME/network/admin/  /ggs/backup/cold_back/admin/


--關閉數據庫
alter system archive log all;
shutdown immediate;

--執行代碼
cp /oradata/ocm/system01.dbf /ggs/backup/cold_back
cp /oradata/ocm/sysaux01.dbf /ggs/backup/cold_back
cp /oradata/ocm/undotbs01.dbf /ggs/backup/cold_back
cp /oradata/ocm/users01.dbf /ggs/backup/cold_back
cp /oradata/ocm/ogg.dbf /ggs/backup/cold_back
cp /oradata/ocm/inv01.dbf /ggs/backup/cold_back
cp /oradata/ocm/temp01.dbf /ggs/backup/cold_back
cp /oradata/ocm/redo04a.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo04b.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo03a.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo03b.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo02a.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo02b.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo01a.rdo /ggs/backup/cold_back
cp /oradata/ocm/redo01b.rdo /ggs/backup/cold_back
cp /oradata/ocm/control01.ctl /ggs/backup/cold_back
cp /oradata/ocm/control02.ctl /ggs/backup/cold_back
cp /oradata/ocm/control03.ctl /ggs/backup/cold_back

cp $ORACLE_HOME/dbs/orapwocm  /ggs/backup/cold_back/dbs/
cp -r $ORACLE_HOME/network/admin/  /ggs/backup/cold_back/


--啟動數據庫
sqlplus / as sysdba
startup


【冷備份的優點和缺點】

01、優點冷備模式下概念易于理解,即將需要備份的文件復制到安全的位置操作比較簡單,不需要太多的干預容易恢復到某個時間點上(只需將文件再拷貝回去)能與歸檔方法相結合,作數據庫“最新狀態”的恢復。

02、缺點 備份時,數據庫必須處于一致性關閉狀態 只能提供到某一時間點的恢復 備份時速度比較慢,尤其是數據量大性能影響比較大 不能實現基于表和用戶級別的數據恢復。


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

墨江| 北宁市| 恩施市| 那曲县| 平舆县| 钟祥市| 大丰市| 武川县| 桑日县| 唐海县| 兖州市| 五大连池市| 琼海市| 昌吉市| 寿宁县| 怀化市| 新源县| 读书| 沂源县| 衡阳县| 牟定县| 瑞丽市| 万全县| 博客| 榆林市| 赞皇县| 新竹县| 松桃| 镇康县| 云梦县| 保靖县| 东阳市| 阳泉市| 化州市| 海阳市| 嘉义县| 邹城市| 游戏| 成武县| 台东市| 浦北县|