您好,登錄后才能下訂單哦!
本篇內容主要講解“Oracle19c rman使用簡單測試分析”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“Oracle19c rman使用簡單測試分析”吧!
PDB 支持 資料庫
--連接示例 connect target "sbu @prod AS SYSBACKUP"
自動刪除閃回日志
--默認1440分鐘/一天,19c開始超過自動清理 db_flashback_retention_target
復制一個pdb到另一個存在的cdb中
復制數據庫到Oracle云
前滾物理備庫,簡化使用
RMAN備份可以用遷移,pdb、cdb切換
塊丟失寫保護增強
connect target / run { allocate channel ch2 type disk; allocate channel ch3 type disk; alter system archive log current; alter system archive log current; backup format '/backup/mypdb_full_%T_%s_%p' database plus archivelog delete all input; backup format '/backup/mypdb_controlfile_%T_%s_%p' current controlfile; alter system archive log current; backup format '/backup/mypdb_arch_%Y%M%D_%s_%p' archivelog all; release channel ch2; release channel ch3; }
全備備份的數據文件參考
--其中數據文件2,5,6是pdb模板 col file_name for a50 select file_id,file_name,tablespace_name from cdb_data_files order by file_id;
--更相信命令,參考全備 BACKUP PLUGGABLE DATABASE mypdb; --or [oracle@node216 ~]$ rman target sys/oracle@mypdb Recovery Manager: Release 19.0.0.0.0 - Production on Fri Feb 14 21:57:32 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: MYDB19C:MYPDB (DBID=2219134196) RMAN> backup database;
--備份root+pdbseed 建議一起備份 run { allocate channel ch2 type disk; allocate channel ch3 type disk; alter system archive log current; alter system archive log current; backup format '/backup/root_full_%T_%s_%p' database root plus archivelog delete all input; backup format '/backup/pdbseed_full_%T_%s_%p' database 'PDB$SEED'; backup format '/backup/root_controlfile_%T_%s_%p' current controlfile; alter system archive log current; backup format '/backup/root_arch_%Y%M%D_%s_%p' archivelog all; release channel ch2; release channel ch3; }
--恢復root+pdbseed ,也可單獨恢復 restore controlfile from '/backup/root_controlfile_20200215_62_1'; alter database mount; run { restore database root; restore database 'pdb$seed'; recover database root; recover database 'pdb$seed'; } --跳過pdb 數據庫,open alter session set container=mypdb; col name for a50 select file#,name,status from v$datafile; alter database datafile 9,10,11,12,13 offline; alter database open resetlogs; --恢復pdb col pdb_name for a20 select pdb_name,status from dba_pdbs; restore pluggable database mypdb; recover pluggable database mypdb; alter session set container=mypdb; alter database datafile 9,10,11,12,13 online; alter database open; --or alter session set container="CDB$ROOT"; alter pluggable database mypdb open;
--備份 BACKUP format '/backup/testpdb_full_%T_%s_%p' PLUGGABLE DATABASE testpdb PLUS ARCHIVELOG; --卸載/導出 pdb sqlplus / as sysdba alter pluggable database testpdb unplug into '/home/oracle/testpdb.xml'; --刪除pdb,遷移可不刪除,注意不能刪除數據文件 drop pluggable database testpdb keep datafiles; --檢查目標cdb,是否適用 備份的pdb SET SERVEROUTPUT ON DECLARE compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY( pdb_descr_file => '/home/oracle/testpdb.xml') WHEN TRUE THEN 'YES' ELSE 'NO' END; BEGIN DBMS_OUTPUT.PUT_LINE(compatible); END; / --創建pdb create pluggable database testpdb using '/home/oracle/testpdb.xml' --nocopy tempfile reuse; FILE_NAME_CONVERT=('/u01/app/oracle/oradata/MYDB19C/pdbseed/', '/u01/app/oracle/oradata/testpdb'); --open alter pluggable database testpdb open; --恢復,手動刪除原有數據文件,可不刪除,直接恢復 SET PREPLUGIN CONTAINER=testpdb; LIST PREPLUGIN BACKUP OF PLUGGABLE DATABASE testpdb; --恢復 RESTORE PLUGGABLE DATABASE testpdb FROM PREPLUGIN; RECOVER PLUGGABLE DATABASE testpdb FROM PREPLUGIN; catalog preplugin archivelog '/u01/app/oracle_base/oradata/CDB18/arch/1_26_969723966.dbf'; --檢查 RESTORE PLUGGABLE DATABASE testpdb SKIP PREPLUGIN; --open RECOVER PLUGGABLE DATABASE testpdb; ALTER PLUGGABLE DATABASE testpdb open; --or rman target sys/oracle@testpdb recover database;
Only active database duplication is supported.
Only the following clauses of the DUPLICATE command are supported: NORESUME,
DB_FILE_NAME_CONVERT, SECTION SIZE, and USING COMPRESSED BACKUPSET
The following clauses of the DUPLICATE command are not supported: SPFILE, NO
STANDBY, FARSYNC STANDBY, and LOG_FILE_NAME_CONVERT.
Duplicating a PDB to a CDB that is a standby database is not supported
Only one PDB can be duplicated at a time.
Partial PDB duplication is not supported, only complete PDB duplication is
supported. For example, you cannot include or exclude specific tablespaces while
duplicating a PDB
Duplicating a non-CDB as a PDB in an existing CDB is not supported.
Duplicating PDBs that contain TDE-encrypted tablespaces is not supported.
--配置網絡 MYDB19C = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = node216)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mydb19c) ) ) TESTCDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = node217)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = testcdb) ) ) --創建相關目錄,目標端 mkdir -p /u01/app/oracle/oradata/TESTCDB/mystpdb --臨時存放歸檔等 mkdir -p /backup/mystpdb alter system set remote_recovery_file_dest='/backup/mystpdb'; --連接 rman target sys/oracle@mydb19c auxiliary sys/oracle@testcdb --開始復制 DUPLICATE PLUGGABLE DATABASE mypdb AS mystpdb TO testcdb FROM ACTIVE DATABASE DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/mypdb','/u01/app/oracle/oradata/TESTCDB/mystpdb'; --會自動導入相關元數據
復制大概過程
恢復數據文件:restore complete of datafile 14 to datafile copy
創建pdb
CREATE PLUGGABLE DATABASE mystpdb AS CLONE USING '/u01/app/oracle/product/19.0.0/dbhome_1/dbs/_rm_pdb_pitr_1_testcdb.xml' SOURCE_FILE_NAME_CONVERT = ( '/u01/app/oracle/oradata/mypdb/mypdp_system01.dbf' , '/u01/app/oracle/oradata/TESTCDB/mystpdb/mypdp_system01.dbf') NOCOPY REFRESH MODE MANUAL;
拷貝歸檔至目標端,并應用,增量/不完成恢復完成
調整數據文件號:刪除之前,根據新環境整理新的file_id
open pdb
--源端設置用戶權限 alter session set container=mypdb; grant create pluggable database to mypdb; --目標端創建dblink create database link clonePdb connect to mypdb identified by mypdb using '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.80.216)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = mypdb)))'; --開始創建,與Duplicating 處理過程相似 create pluggable database pdb8 from mypdb@clonePdb FILE_NAME_CONVERT=('/u01/app/oracle/oradata/mypdb','/u01/app/oracle/oradata/TESTCDB/pdb8');
到此,相信大家對“Oracle19c rman使用簡單測試分析”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。