ablog

不器用で落着きのない技術者のメモ

表領域をバックアップ・モードにした状態では shutdown immediate できない

備忘録です。

startup mount
alter database archivelog;
archive log list
alter database open;
alter system archive log current;
  • BEGIN BACKUP を実行する
select tablespace_name from dba_tablespaces;
alter tablespace SYSTEM begin backup;
alter tablespace SYSAUX begin backup;
alter tablespace UNDOTBS1 begin backup;
alter tablespace USERS begin backup;
  • バックアップ・モードになっていることを確認する。
set linesize 200
col tablespace_name for a10
col file_name for a50

select vt.name as tablespace_name,vd.name as file_name,
		vb.status,vb.change#,vb.time
	from v$backup vb,v$datafile vd,v$tablespace vt
		where vb.file#=vd.file#
		and vd.ts#=vt.ts#;
shutdown immediate
ORA-01149: cannot shutdown - file 1 has online backup set
ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
  • 表領域のバックアップ・モードを終了してからインスタンスを停止する。
alter tablespace SYSTEM end backup;
alter tablespace SYSAUX end backup;
alter tablespace UNDOTBS1 end backup;
alter tablespace USERS end backup;
shutdown immediate

参考