반응형

 

1. dd.sql

@dd
dd.sql


alter tablespace system begin backup;
!cp /u01/app/oracle/oradata/orcl/system01.dbf /data/backup/open
alter tablespace system end backup;

alter tablespace undotbs1 begin backup;
!cp /u01/app/oracle/oradata/orcl/undotbs01.dbf /data/backup/open
alter tablespace undotbs1 end backup;

alter tablespace sysaux begin backup;
!cp /u01/app/oracle/oradata/orcl/sysaux01.dbf /data/backup/open
alter tablespace sysaux end backup;

alter tablespace users begin backup;
!cp /u01/app/oracle/oradata/orcl/users01.dbf /data/backup/open
alter tablespace users end backup;

alter tablespace example begin backup;
!cp /u01/app/oracle/oradata/orcl/example01.dbf /data/backup/open
alter tablespace example end backup;

 

2. log.sql

@log

log.sql

 

set line 200
col group# for 999
col member for a50
col mb for 999
col sequence# for 999
col status for a8

select a.group#, a.member, b.bytes/1024/1024 MB, b.archived,
       b.sequence#, b.status
from v$logfile a, v$log b
where a.group#=b.group#
order by 1,2
/

 

3. ud.sql

@ud

ud.sql

 

set line 200

select s.sid, s.serial#, s.username, r.name "ROLLBACK SEG"
from v$session s, v$transaction t, v$rollname r
where s.taddr=t.addr
and t.xidusn=r.usn
/

 

 

4. df.sql

@df
df.sql

set line 200
col ts_name for a10
col file_name for a50

select a.name "TS_NAME", b.name "FILE_NAME", b.bytes/1024/1024 MB, b.status
from v$tablespace a, v$datafile b
where a.ts#=b.ts#
/

 

5. tt.sql

@tt
tt.sql
select to_char(sysdate, 'YYYY-MM-DD:HH24:MI:SS') from dual;

반응형