--dobegin.sql:
connect sys/oracle@orcl as sysdba
SET FEEDBACK off
SET PAGESIZE 0
SPOOL C:/scripts/begin.sql
SELECT
'ALTER TABLESPACE ' ||
tablespace_name ||
' BEGIN BACKUP;'
FROM
dba_tablespaces where contents <> 'TEMPORARY';
SPOOL off
@C:/scripts/begin.sql
select status from v$instance;
EXIT
--doend.sql
connect sys/oracle@orcl as sysdba
SET FEEDBACK off
SET PAGESIZE 0
SPOOL C:/scripts/end.sql
SELECT
'ALTER TABLESPACE ' ||
tablespace_name ||
' END BACKUP;'
FROM
dba_tablespaces where contents <> 'TEMPORARY';
SPOOL off
@C:/scripts/end.sql
EXIT
沒有留言:
張貼留言