经典推荐: Oracle 常用命令汇总

来源:本站整理  作者:学生大读书站
摘要://创建一个控制文件命令到跟踪文件 alter database backup controlfile to trace;//增加一个新的日志文件组的语句 connect internal as sysdba alter database ……

archive log start;
exit
EOFarch2
#
#   Step 4. Back up the archived redo logs to the tape
#  device via the "tar" command, then delete them
#  from the destination device via the "rm" command.
#
tar -rvf /dev/rmt/0hc $FILES
#
#   Step 5. Delete those files from the destination directory.
#
rm -f $FILES
#
#   End of archived redo log file backup script.

REM  磁盘到磁盘的备份
REM
REM   Back up the RBS tablespace - to another disk (UNIX)
REM
alter tablespace RBS begin backup;
!cp /db02/oracle/CC1/rbs01.dbf /db10/oracle/CC1/backups
alter tablespace RBS end backup;
REM

REM  移动归档日志文件的shell脚本
#
# Procedure for moving archived redo logs to another device
#
svrmgrl <<EOFarch2
connect internal as sysdba
archive log stop;
!mv /db01/oracle/arch/CC1 /db10/oracle/arch/CC1
archive log start;
exit
EOFarch2
#
# end of archived redo log directory move.

//生成创建控制文件命令
alter database backup controlfile to trace;

//时间点恢复的例子
connect internal as sysdba
startup mount instance_name;
recover database until time ’1999-08-07:14:40:00’;

//创建恢复目录
rman rcvcat rman/rman@<database_service_name>

// 在(UNIX)下创建恢复目录
RMAN> create catalog tablespace rcvcat;

// 在(NT)下创建恢复目录
RMAN> create catalog tablespace "RCVCAT";

//连接描述符范例 
(DESCRIPTION=
    (ADDRESS=
          (PROTOCOL=TCP)
          (HOST=HQ)
          (PORT=1521))
    (CONNECT DATA=
          (SID=loc)))

// listener.ora 的条目entry
LISTENER =
  (ADDRESS_LIST =
      (ADDRESS=
        (PROTOCOL=IPC)
         (KEY= loc.world)
      )
   ) 
SID_LIST_LISTENER =
  (SID_LIST =
  (SID_DESC =
    (SID_NAME = loc)
    (ORACLE_HOME = /orasw/app/oracle/product/8.1.5.1)
   )
 )

【相关文章】好搜一下
甲骨文正式推出Oracle数据库11g第二版

甲骨文正式推出Oracle数据库11g第二版

9月23日在北京召开的Oracle数据库11g第二版媒体见面会上,甲骨文公司大中…