RMAN Backup
Shell
rman target /
RMAN
backup database;
- バックアップはdb_recovery_file_destの設定に影響があるので必ず下記を注意すること
- db_recovery_file_dest_size = 10TB
- サイズがDBデータサイズを超えるとエラーになってバックアップが止まる
- db_recovery_file_dest_size
- バックアップしたディスクの容量及びディスクのIOが余裕があることを確認すること
- db_recovery_file_dest_size = 10TB
alter system set db_recovery_file_dest_size = 12800G scope=both;
alter system set db_recovery_file_dest = '/data3/fast_recovery_area/' scope=both;
RMAN Restore
Shell
rman target /
RMAN
startup mount
restore database;
recover database;
Using Data PUMP (expdp/impdp)
It must execute config backup dir SQL before execute data pump
Set export directory on sqlplus
create or replace directory BAK_DIR as '/data/bak';
- export schema
expdp admin/pass@orcl schemas=servie01 directory=BAK_DIR dumpfile=service01_20210301.dmp logfile=exp.log
- Delete job table if you see error message when execute expdp or impdp
With the Partitioning, OLAP and Data Mining options
ORA-31634: job already exists
ORA-31664: unable to construct unique job name when defaulted
select 'drop table ' || owner_name || '.' || job_name || ';'
from dba_datapump_jobs
where state = 'NOT RUNNING';
It must execute config backup dir SQL before execute data pump
Set export directory on sqlplus
create or replace directory BAK_DIR as '/data/bak';
expdp admin/pass@orcl schemas=servie01 directory=BAK_DIR dumpfile=service01_20210301.dmp logfile=exp.log
With the Partitioning, OLAP and Data Mining options
ORA-31634: job already exists
ORA-31664: unable to construct unique job name when defaulted
select 'drop table ' || owner_name || '.' || job_name || ';'
from dba_datapump_jobs
where state = 'NOT RUNNING';
Using Export/Import (exp/imp)
redo log file
select * from v$log;
select * from v$logfile;
-- Drop logfile group
ALTER DATABASE DROP LOGFILE GROUP 4;
-- Add logfile group
ALTER DATABASE ADD LOGFILE GROUP 7;
-- add logfile to group
ALTER DATABASE ADD LOGFILE MEMBER '/mnt/sdb1/redolog/redo06.log' TO GROUP 6;
-- rename and change path log file
ALTER DATABASE
RENAME FILE '/app/oracle/flash_recovery_area/SMARTDB/onlinelog/o1_mf_6_h3hzqkx2_.log'
TO '/mnt/sdb1/redolog/redo06.log';
select * from v$log;
select * from v$logfile;
-- Drop logfile group
ALTER DATABASE DROP LOGFILE GROUP 4;
-- Add logfile group
ALTER DATABASE ADD LOGFILE GROUP 7;
-- add logfile to group
ALTER DATABASE ADD LOGFILE MEMBER '/mnt/sdb1/redolog/redo06.log' TO GROUP 6;
-- rename and change path log file
ALTER DATABASE
RENAME FILE '/app/oracle/flash_recovery_area/SMARTDB/onlinelog/o1_mf_6_h3hzqkx2_.log'
TO '/mnt/sdb1/redolog/redo06.log';
コメント
コメントを投稿