imp system/manager file=expdat.dmp full=Y commit=Y buffer=64000
imp system/manager file=expdat.dmp ignore=N rows=N commit=Y buffer=64000
//使用操作系统备份命令
REM TAR examples
tar -cvf /dev/rmt/0hc /db0[1-9]/oracle/CC1
tar -rvf /dev/rmt/0hc /orasw/app/oracle/CC1/pfile/initcc1.ora
tar -rvf /dev/rmt/0hc /db0[1-9]/oracle/CC1 /orasw/app/oracle/CC1/pfile/initcc1.ora
//离线备份的shell脚本
ORACLE_SID=cc1; export ORACLE_SID
ORAENV_ASK=NO; export ORAENV_ASK
. oraenv
svrmgrl <<EOF1
connect internal as sysdba
shutdown immediate;
exit
EOF1
insert backup commands like the "tar" commands here
svrmgrl <<EOF2
connect internal as sysdba
startup
EOF2
//在Server Manager上设置为archivelog mode:
connect internal as sysdba
startup mount cc1;
alter database archivelog;
archive log start;
alter database open;
//在Server Manager上设置为archivelog mode:
connect internal as sysdba
startup mount cc1;
alter database noarchivelog;
alter database open;
select Name,
Value
from V$PARAMETER
where Name like ’log_archive%’;
//联机备份的脚本
#
# Sample Hot Backup Script for a UNIX File System database
#
# Set up environment variables:
ORACLE_SID=cc1; export ORACLE_SID
ORAENV_ASK=NO; export ORAENV_ASK
. oraenv
svrmgrl <<EOFarch1
connect internal as sysdba
REM
REM 备份 SYSTEM tablespace
REM
alter tablespace SYSTEM begin backup;
!tar -cvf /dev/rmt/0hc /db01/oracle/CC1/sys01.dbf
alter tablespace SYSTEM end backup;
REM
REM The SYSTEM tablespace has now been written to a
REM tar saveset on the tape device /dev/rmt/0hc. The
REM rest of the tars must use the "-rvf" clause to append
REM to that saveset.
REM
REM 备份 RBS tablespace
REM
alter tablespace RBS begin backup;
!tar -rvf /dev/rmt/0hc /db02/oracle/CC1/rbs01.dbf
alter tablespace RBS end backup;
REM
REM 备份 DATA tablespace