今天用rman连接数据库报错
[jeff@rhel55 ~]$rman target sys/oracle@orcl
[jeff@rhel55 ~]$ rman target sys/oracle@orcl
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Oct 3 04:37:05 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1302004769, not open)
RMAN> show all ;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 31 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOA D TRUE ; # default
CONFIGURE EXCLUDE FOR TABLESPACE 'SYSAUX';
CONFIGURE EXCLUDE FOR TABLESPACE 'USERS';
CONFIGURE EXCLUDE FOR TABLESPACE 'EXAMPLE';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.0.2/db_1/dbs/ snapcf_orcl.f'; # default
RMAN>exit
[jeff@rhel55 ~]rman help#查看帮助
[jeff@rhel55 ~]rman target sys/oracle@orcl log /home/jeff/rman_log.txt#记录日志
RMAN>configure device type disk parallelism 4 backup type to compressed backupset;
RMAN>configure device type disk clear;#reset
RMAN>configure device type sbt_tape parallelism 4 backup type to backupset;
RMAN>configure device type disk clear;#reset again
RMAN>configure device type sbt_tape parallelism 4 backup type to compressed backupset;
RMAN>configure device type disk clear;#reset again
RMAN>configure device type disk parallelism 4 backup type to copy;#copy只能是disk类型的
RMAN>configure device type disk clear;#reset again
RMAN>configure retention policy to recovery window of 7 days;#基于恢复窗口的备份保留策略,7天
RMAN>
RMAN> configure retention policy clear;#默认是基于冗余策略,每个文件至少保留一份
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN configuration parameters are successfully reset to default value
RMAN> show retention policy;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
RMAN> config retention policy to redundancy 2;#基于冗余,每个文件至少保留2份
RMAN>configure retention policy to recovery window of 0 days;
RMAN>report obsolete;#查看过时的备份文件
RMAN>delete obsolete;#根据保留策略,删除过时的备份文件
RMAN>configure retention policy to recovery window of 7 days;
[jeff@rhel55 ~]$rman target sys/oracle@orcl
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
[jeff@rhel55 ~]$lsnrctl stop
[jeff@rhel55 ~]$cd $ORACLE_HOME
[jeff@rhel55 db_1]$vim listener.ora
[jeff@rhel55 ~]$lsnrctl start
[jeff@rhel55 ~]$[jeff@rhel55 ~]$ rman target sys/oracle@orcl
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Oct 3 04:37:05 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1302004769, not open)
RMAN> show all ;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 31 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOA D TRUE ; # default
CONFIGURE EXCLUDE FOR TABLESPACE 'SYSAUX';
CONFIGURE EXCLUDE FOR TABLESPACE 'USERS';
CONFIGURE EXCLUDE FOR TABLESPACE 'EXAMPLE';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.0.2/db_1/dbs/ snapcf_orcl.f'; # default
RMAN>exit
[jeff@rhel55 ~]rman help#查看帮助
[jeff@rhel55 ~]rman target sys/oracle@orcl log /home/jeff/rman_log.txt#记录日志
RMAN>configure device type disk parallelism 4 backup type to compressed backupset;
RMAN>configure device type disk clear;#reset
RMAN>configure device type sbt_tape parallelism 4 backup type to backupset;
RMAN>configure device type disk clear;#reset again
RMAN>configure device type sbt_tape parallelism 4 backup type to compressed backupset;
RMAN>configure device type disk clear;#reset again
RMAN>configure device type disk parallelism 4 backup type to copy;#copy只能是disk类型的
RMAN>configure device type disk clear;#reset again
RMAN>configure retention policy to recovery window of 7 days;#基于恢复窗口的备份保留策略,7天
RMAN>
RMAN> configure retention policy clear;#默认是基于冗余策略,每个文件至少保留一份
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN configuration parameters are successfully reset to default value
RMAN> show retention policy;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
RMAN> config retention policy to redundancy 2;#基于冗余,每个文件至少保留2份
RMAN>configure retention policy to recovery window of 0 days;
RMAN>report obsolete;#查看过时的备份文件
RMAN>delete obsolete;#根据保留策略,删除过时的备份文件
RMAN>configure retention policy to recovery window of 7 days;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27795363/viewspace-745555/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27795363/viewspace-745555/