oralce切换归档模式并热备

oracle@linux55 ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 10.2.0.1.0 - Production on Sat May 11 10:22:17 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> archive log list;
ORA-01034: ORACLE not available
SQL> archive log list;
ORA-01034: ORACLE not available
SQL> startup
ORACLE instance started.

Total System Global Area 2147483648 bytes
Fixed Size                  1220432 bytes
Variable Size             452985008 bytes
Database Buffers         1677721600 bytes
Redo Buffers               15556608 bytes
Database mounted.
Database opened.
SQL> shutdown immediate /关闭DB
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount  /启动mount状态
RACLE instance started.

Total System Global Area 2147483648 bytes
Fixed Size                  1220432 bytes
Variable Size             452985008 bytes
Database Buffers         1677721600 bytes
Redo Buffers               15556608 bytes
Database mounted.
SQL> alter database archivelog; /切换至归档模式


(1 sql> archive log list;   #查看是否是归档方式

2 sql> alter system set log_archive_start=false scope=spfile; #禁用自动归档

3 sql> shutdown immediate;

4 sql> startup mount;    #打开控制文件,不打开数据文件

5 sql> alter database noarchivelog; #将数据库切换为非归档模式

6 sql> alter database open;   #将数据文件打开

7 sql> archive log list;   #查看此时便处于非归档模式}\ )


Database altered.

SQL> alter database open; / 打开DB

Database altered.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@linux55 ~]$ rman target /  /进入备份模式

Recovery Manager: Release 10.2.0.1.0 - Production on Sat May 11 10:30:43 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: SYNTONG (DBID=3486986173)

RMAN> configure controlfile autobackup on ; /后每次备份都会自动备份controlfile和spfile

using target database control file instead of recovery catalog
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN> backup full database;

Starting backup at 11-MAY-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=144 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00002 name=/oracledata/syntong/undotbs01.dbf
input datafile fno=00005 name=/oracledata/syntong/SCHOOL_DATA1.dbf
input datafile fno=00006 name=/oracledata/syntong/SCHOOL_DATA2.dbf
input datafile fno=00007 name=/oracledata/syntong/SCHOOL_DATA3.dbf
input datafile fno=00008 name=/oracledata/syntong/SCHOOL_INDEX1.dbf
input datafile fno=00009 name=/oracledata/syntong/SCHOOL_INDEX2.dbf
input datafile fno=00010 name=/oracledata/syntong/SCHOOL_INDEX3.dbf
input datafile fno=00011 name=/oracledata/syntong/SCHOOL_HISTRJN1.dbf
input datafile fno=00012 name=/oracledata/syntong/SCHOOL_HISTRJN2.dbf
input datafile fno=00013 name=/oracledata/syntong/SCHOOL_HISTRJN3.dbf
input datafile fno=00014 name=/oracledata/syntong/IDINFORMATION_DATA11.dbf
input datafile fno=00015 name=/oracledata/syntong/IDINFORMATION_DATA12.dbf
input datafile fno=00016 name=/oracledata/syntong/IDINFORMATION_DATA13.dbf
input datafile fno=00017 name=/oracledata/syntong/IDINFORMATION_PHOTO1.dbf
input datafile fno=00018 name=/oracledata/syntong/IDINFORMATION_PHOTO2.dbf
input datafile fno=00019 name=/oracledata/syntong/IDINFORMATION_PHOTO3.dbf
input datafile fno=00020 name=/oracledata/syntong/IDINFORMATION_INDEX1.dbf
input datafile fno=00021 name=/oracledata/syntong/IDINFORMATION_INDEX2.dbf
input datafile fno=00022 name=/oracledata/syntong/IDINFORMATION_INDEX3.dbf
input datafile fno=00001 name=/oracledata/syntong/system01.dbf
input datafile fno=00003 name=/oracledata/syntong/sysaux01.dbf
input datafile fno=00004 name=/oracledata/syntong/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-MAY-13
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/11/2013 10:35:05
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 52428800 bytes disk space from 2147483648 limit/提示错误 磁盘空间不足

RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;  /保留7天备份文件

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
new RMAN configuration parameters are successfully stored

RMAN> exit


Recovery Manager complete.
[oracle@linux55 ~]$

你可能感兴趣的:(oracle,AS)