Oracle database commonly used command five (PDB snapshot)

Insert picture description here
SHOW PARAMETER “_exadata_feature_on”
alter system set “_exadata_feature_on”=true scope=spfile;
Insert picture description here
shutdown immediate;
startup;
Insert picture description here
alter session set container = cdb$root;
CREATE PLUGGABLE DATABASE pdb3
ADMIN USER pdb_admin IDENTIFIED BY Password1
SNAPSHOT MODE EVERY 24 HOURS;
ALTER PLUGGABLE DATABASE pdb3 OPEN;
show pdbs
Insert picture description here
ALTER PLUGGABLE DATABASE pdb3 SAVE STATE;
Insert picture description here
SELECT p.con_id,p.pdb_name,p.snapshot_mode,
p.snapshot_interval
FROM cdb_pdbs p
ORDER BY 1;
Insert picture description here
更改快照设置
alter session set container = PDB3;
ALTER PLUGGABLE DATABASE SNAPSHOT MODE EVERY 2999 MINUTES;
Insert picture description here
Insert picture description here
ALTER PLUGGABLE DATABASE SNAPSHOT MODE EVERY 1999 HOURS;
Insert picture description here
ALTER PLUGGABLE DATABASE SNAPSHOT MODE MANUAL;
Insert picture description here
ALTER PLUGGABLE DATABASE SNAPSHOT MODE NONE;
Insert picture description here
ALTER PLUGGABLE DATABASE SNAPSHOT MODE EVERY 24 HOURS;
Insert picture description here
SELECT pr.con_id,
p.pdb_name,
pr.property_name,
pr.property_value,
pr.description
FROM cdb_properties pr
JOIN cdb_pdbs p ON pr.con_id = p.con_id
WHERE pr.property_name = ‘MAX_PDB_SNAPSHOTS’
ORDER BY pr.property_name;
Insert picture description here
设置快照数量
alter session set container = PDB3;
ALTER PLUGGABLE DATABASE pdb3 SET MAX_PDB_SNAPSHOTS=4;
SELECT r.CON_ID AS id, p.PDB_NAME, PROPERTY_NAME,
PROPERTY_VALUE AS value, DESCRIPTION
FROM CDB_PROPERTIES r, CDB_PDBS p
WHERE r.CON_ID = p.CON_ID
PROPERTY_NAME the LIKE the AND 'MAX_PDB%'
the ORDER BY PROPERTY_NAME;
Insert picture description here
modify back
Insert picture description here
snapshot of information
the SELECT CON_ID, con_name, snapshot_name,
snapshot_scn, full_snapshot_path
the FROM cdb_pdb_snapshots
the ORDER BY CON_ID, snapshot_scn;
Insert picture description here
done manually create a snapshot
creates two
the ALTER DATABASE SNAPSHOT PLUGGABLE;
the ALTER DATABASE SNAPSHOT PLUGGABLE lh_kuaizhao_1;
Insert picture description here
see the creation of a snapshot
Insert picture description here
delete snapshots
the ALTER DATABASE DROP sNAPSHOT PLUGGABLE LH_KUAIZHAO_2;
the ALTER DATABASE DROP sNAPSHOT PLUGGABLE SNAP_562389786_1067211597;
Insert picture description here
Insert picture description here
Insert picture description here
use the snapshot creation PDB
the cREATE DATABASE pdb3_kuaiz PLUGGABLE the FROM pdb3 LH_KUAIZHAO_1 the uSING sNAPSHOT
sNAPSHOT the MODE EVERY 24-HOURS;
the ALTER DATABASE pdb3_kuaiz PLUGGABLE the OPEN;
Insert picture description here
ALTER PLUGGABLE DATABASE pdb3_kuaiz OPEN;
Insert picture description here
Insert picture description here
使用快照号创建
show pdbs
CREATE PLUGGABLE DATABASE pdb3_copy FROM pdb3 USING
SNAPSHOT SNAP_562389786_1067211731 SNAPSHOT MODE EVERY 24 HOURS;
ALTER PLUGGABLE DATABASE pdb3_copy OPEN;
Insert picture description here
SELECT owner,
job_name,
repeat_interval
FROM dba_scheduler_jobs
WHERE job_name LIKE ‘%SNAPSHOT’
ORDER BY owner, job_name;
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_39568073/article/details/114839129