亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

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

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

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

富蕴县| 青冈县| 海宁市| 曲麻莱县| 耒阳市| 诸暨市| 饶河县| 晋州市| 台江县| 淮滨县| 连云港市| 曲靖市| 辽宁省| 革吉县| 南投市| 无锡市| 永顺县| 新河县| 咸丰县| 大新县| 措勤县| 青龙| 游戏| 翼城县| 恭城| 宣武区| 广西| 吉木萨尔县| 抚顺市| 浙江省| 襄汾县| 隆德县| 营山县| 莒南县| 静乐县| 南宫市| 千阳县| 余干县| 海淀区| 临沭县| 嘉峪关市|