目的:在同一台机器上用rman 克隆库
环境:RedHat 4 + Oracle 10g
主库库名:db01
克隆库名: clonedb
1、主库db01 ,用rman进行备份(datafile、controlfile、archivelog file)
08:49:43 SQL> show parameter name ;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string
db_name string cuug
db_unique_name string cuug
global_names boolean FALSE
instance_name string cuug
lock_name_space string
log_file_name_convert string
service_names string cuug
08:49:53 SQL> select current_scn from v$database;
CURRENT_SCN
-----------
1139339
08:50:17 SQL>
RMAN> run {
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> backup full database format '/disk2/rman/db01/hot_bak/%d_%s_%t.bak';
5> backup archivelog all format '/disk2/rman/db01/hot_bak/arch_%s.bak';
6> backup current controlfile format '/disk2/rman/db01/hot_bak/ctl_%s.bak';
7> }
08:58:59 SQL> col file_namr for a50
08:59:19 SQL> select file_id,file_name,tablespace_name from dba_data_files;
FILE_ID FILE_NAME TABLESPACE_NAME
---------- -------------------------------------------------- ------------------------------
5 /u01/app/oracle/oradata/db01/lxtb1.dbf LXTBS1
4 /u01/app/oracle/oradata/db01/users01.dbf USERS
3 /u01/app/oracle/oradata/db01/sysaux01.dbf SYSAUX
2 /u01/app/oracle/oradata/db01/rtbs01.dbf RTBS
1 /u01/app/oracle/oradata/db01/system01.dbf SYSTEM
8 /u01/app/oracle/oradata/db01/undotbs1.dbf UNDOTBS1
11 /u01/app/oracle/oradata/db01/tbsbig.dbf TBS_BIG
12 /u01/app/oracle/oradata/db01/indx01.dbf INDX
6 /u01/app/oracle/oradata/db01/lxtbs2.dbf LXTBS2
9 rows selected.
2、建立pfile 文件
08:59:31 SQL> create pfile from spfile;
File created.
3、建立克隆库的目录
[oracle@RH4 dbs]$ mkdir -p $ORACLE_BASE/admin/clonedb/bdump
[oracle@RH4 dbs]$ mkdir -p $ORACLE_BASE/admin/clonedb/cdump
[oracle@RH4 dbs]$ mkdir -p $ORACLE_BASE/admin/clonedb/udump
[oracle@RH4 dbs]$ mkdir -p $ORACLE_BASE/oradata/clonedb
4、将主库pfile 拷贝生成clone 库的pfile,并生成clone库的口令文件
[oracle@RH4 dbs]$ orapwd file=orapwclonedb.ora password=oracle entries=3;
[oracle@RH4 dbs]$ cp initdb01.ora initclonedb.ora
[oracle@RH4 dbs]$ vi initclonedb.ora
将db01 替换为 clonedb,并增加以下内容:
db_file_name_convert = ("/u01/app/oracle/oradata/db01" ,"/u01/app/oracle/oradata/clonedb")
log_file_name_convert = ("/disk1/oradata/db01","/disk1/oradata/clonedb","/disk2/oradata/db01","/disk2/oradata/clonedb")
5、将clone 库启动到nomount
[oracle@RH4 dbs]$ export ORACLE_SID=clonedb
[oracle@RH4 dbs]$ !sql
sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Mar 23 09:11:22 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
09:11:22 SQL> startup pfile=$ORACLE_HOME/dbs/initclonedb.ora nomount
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219160 bytes
Variable Size 113247656 bytes
Database Buffers 197132288 bytes
Redo Buffers 2973696 bytes
09:11:49 SQL>
6、对主库的日志进行归档,并将归档日志拷贝到clone库的归档目录下
09:23:47 SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 14 10485760 2 YES INACTIVE 1134075 2012-03-23 05:23:36
2 1 15 10485760 2 NO CURRENT 1141263 2012-03-23 08:57:57
3 1 12 10485760 2 YES INACTIVE 1123738 2012-03-23 02:54:16
4 1 13 10485760 2 YES INACTIVE 1126370 2012-03-23 03:23:17
09:55:18 SQL> alter system archive log current;
System altered.
09:57:35 SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 14 10485760 2 YES INACTIVE 1134075 2012-03-23 05:23:36
2 1 15 10485760 2 YES ACTIVE 1141263 2012-03-23 08:57:57
3 1 16 10485760 2 NO CURRENT 1143553 2012-03-23 09:57:35
4 1 13 10485760 2 YES INACTIVE 1126370 2012-03-23 03:23:17
09:57:38 SQL> !
7、建立clone库的归档目录,并将主库的归档日志拷贝到clone 库下
[oracle@RH4 dbs]$ mkdir /disk1/arch/clonedb
[oracle@RH4 dbs]$ cd /disk1/arch/db01/
[oracle@RH4 db01]$ ls
arch_1_10_778577586.log arch_1_13_778577586.log arch_1_5_778577586.log arch_1_8_778577586.log
arch_1_11_778577586.log arch_1_14_778577586.log arch_1_6_778577586.log arch_1_9_778577586.log
arch_1_12_778577586.log arch_1_15_778577586.log arch_1_7_778577586.log
[oracle@RH4 db01]$ cp *.* /clonedb/
[oracle@RH4 db01]$
8、用rman连接主库和clone库
[oracle@RH4 admin]$ export ORACLE_SID=clonedb
[oracle@RH4 admin]$ rman target sys/oracle@db01 auxiliary sys/oracle
Recovery Manager: Release 10.2.0.1.0 - Production on Fri Mar 23 10:03:55 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: DB01 (DBID=1408485026)
connected to auxiliary database: CLONEDB (not mounted)
RMAN> list backup;
using target database control file instead of recovery catalog
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
67 Full 344.21M DISK 00:01:44 23-MAR-12
BP Key: 67 Status: AVAILABLE Compressed: NO Tag: TAG20120323T085547
Piece Name: /disk2/rman/db01/hot_bak/DB01_75_778668947.bak
List of Datafiles in backup set 67
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 Full 1141202 23-MAR-12 /u01/app/oracle/oradata/db01/system01.dbf
2 Full 1141202 23-MAR-12 /u01/app/oracle/oradata/db01/rtbs01.dbf
5 Full 1141202 23-MAR-12 /u01/app/oracle/oradata/db01/lxtb1.dbf
8 Full 1141202 23-MAR-12 /u01/app/oracle/oradata/db01/undotbs1.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
68 Full 122.17M DISK 00:02:03 23-MAR-12
BP Key: 68 Status: AVAILABLE Compressed: NO Tag: TAG20120323T085547
Piece Name: /disk2/rman/db01/hot_bak/DB01_74_778668947.bak
List of Datafiles in backup set 68
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
3 Full 1141201 23-MAR-12 /u01/app/oracle/oradata/db01/sysaux01.dbf
4 Full 1141201 23-MAR-12 /u01/app/oracle/oradata/db01/users01.dbf
6 Full 1141201 23-MAR-12 /u01/app/oracle/oradata/db01/lxtbs2.dbf
11 Full 1141201 23-MAR-12 /u01/app/oracle/oradata/db01/tbsbig.dbf
12 Full 1141201 23-MAR-12 /u01/app/oracle/oradata/db01/indx01.dbf
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
69 29.16M DISK 00:00:03 23-MAR-12
BP Key: 69 Status: AVAILABLE Compressed: NO Tag: TAG20120323T085758
Piece Name: /disk2/rman/db01/hot_bak/arch_76.bak
List of Archived Logs in backup set 69
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 10 1100972 22-MAR-12 1121178 23-MAR-12
1 11 1121178 23-MAR-12 1123738 23-MAR-12
1 12 1123738 23-MAR-12 1126370 23-MAR-12
1 13 1126370 23-MAR-12 1134075 23-MAR-12
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
70 7.91M DISK 00:00:04 23-MAR-12
BP Key: 70 Status: AVAILABLE Compressed: NO Tag: TAG20120323T085758
Piece Name: /disk2/rman/db01/hot_bak/arch_77.bak
List of Archived Logs in backup set 70
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 14 1134075 23-MAR-12 1141263 23-MAR-12
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
71 5.83M DISK 00:00:01 23-MAR-12
BP Key: 71 Status: AVAILABLE Compressed: NO Tag: TAG20120323T085758
Piece Name: /disk2/rman/db01/hot_bak/arch_78.bak
List of Archived Logs in backup set 71
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 5 1095102 22-MAR-12 1100449 22-MAR-12
1 6 1100449 22-MAR-12 1100451 22-MAR-12
1 7 1100451 22-MAR-12 1100936 22-MAR-12
1 8 1100936 22-MAR-12 1100938 22-MAR-12
1 9 1100938 22-MAR-12 1100972 22-MAR-12
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
72 Full 7.14M DISK 00:00:01 23-MAR-12
BP Key: 72 Status: AVAILABLE Compressed: NO Tag: TAG20120323T085810
Piece Name: /disk2/rman/db01/hot_bak/ctl_79.bak
Control File Included: Ckp SCN: 1141277 Ckp time: 23-MAR-12
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
73 Full 7.17M DISK 00:00:02 23-MAR-12
BP Key: 73 Status: AVAILABLE Compressed: NO Tag: TAG20120323T085812
Piece Name: /disk1/flash/DB01/autobackup/2012_03_23/o1_mf_s_778669092_7pqlo5fo_.bkp
Control File Included: Ckp SCN: 1141281 Ckp time: 23-MAR-12
SPFILE Included: Modification time: 23-MAR-12
9、用rman 克隆库
RMAN> duplicate target database to clonedb;
Starting Duplicate Db at 23-MAR-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=36 devtype=DISK
contents of Memory Script:
{
set until scn 1143553;
set newname for datafile 1 to
"/u01/app/oracle/oradata/clonedb/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/clonedb/rtbs01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/clonedb/sysaux01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/clonedb/users01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/clonedb/lxtb1.dbf";
set newname for datafile 6 to
"/u01/app/oracle/oradata/clonedb/lxtbs2.dbf";
set newname for datafile 8 to
"/u01/app/oracle/oradata/clonedb/undotbs1.dbf";
set newname for datafile 11 to
"/u01/app/oracle/oradata/clonedb/tbsbig.dbf";
set newname for datafile 12 to
"/u01/app/oracle/oradata/clonedb/indx01.dbf";
restore
check readonly
clone database
;
}
executing Memory Script
executing command: SET until clause
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 23-MAR-12
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/clonedb/system01.dbf
restoring datafile 00002 to /u01/app/oracle/oradata/clonedb/rtbs01.dbf
restoring datafile 00005 to /u01/app/oracle/oradata/clonedb/lxtb1.dbf
restoring datafile 00008 to /u01/app/oracle/oradata/clonedb/undotbs1.dbf
channel ORA_AUX_DISK_1: reading from backup piece /disk2/rman/db01/hot_bak/DB01_75_778668947.bak
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/disk2/rman/db01/hot_bak/DB01_75_778668947.bak tag=TAG20120323T085547
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:47
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /u01/app/oracle/oradata/clonedb/sysaux01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/clonedb/users01.dbf
restoring datafile 00006 to /u01/app/oracle/oradata/clonedb/lxtbs2.dbf
restoring datafile 00011 to /u01/app/oracle/oradata/clonedb/tbsbig.dbf
restoring datafile 00012 to /u01/app/oracle/oradata/clonedb/indx01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /disk2/rman/db01/hot_bak/DB01_74_778668947.bak
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/disk2/rman/db01/hot_bak/DB01_74_778668947.bak tag=TAG20120323T085547
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 23-MAR-12
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONEDB" RESETLOGS ARCHIVELOG
MAXLOGFILES 10
MAXLOGMEMBERS 5
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/disk2/oradata/clonedb/redo01a.log', '/disk1/oradata/clonedb/redo01b.log' ) SIZE 10 M REUSE,
GROUP 2 ( '/disk2/oradata/clonedb/redo02a.log', '/disk1/oradata/clonedb/redo02b.log' ) SIZE 10 M REUSE,
GROUP 3 ( '/disk1/oradata/clonedb/redo03b.log', '/disk2/oradata/clonedb/redo03a.log' ) SIZE 10 M REUSE,
GROUP 4 ( '/disk1/oradata/clonedb/redo04b.log', '/disk2/oradata/clonedb/redo04a.log' ) SIZE 10 M REUSE
DATAFILE
'/u01/app/oracle/oradata/clonedb/system01.dbf'
CHARACTER SET ZHS16GBK
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
released channel: ORA_AUX_DISK_1
datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=778673170 filename=/u01/app/oracle/oradata/clonedb/rtbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=778673170 filename=/u01/app/oracle/oradata/clonedb/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=778673170 filename=/u01/app/oracle/oradata/clonedb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=778673170 filename=/u01/app/oracle/oradata/clonedb/lxtb1.dbf
datafile 6 switched to datafile copy
input datafile copy recid=5 stamp=778673170 filename=/u01/app/oracle/oradata/clonedb/lxtbs2.dbf
datafile 8 switched to datafile copy
input datafile copy recid=6 stamp=778673171 filename=/u01/app/oracle/oradata/clonedb/undotbs1.dbf
datafile 11 switched to datafile copy
input datafile copy recid=7 stamp=778673171 filename=/u01/app/oracle/oradata/clonedb/tbsbig.dbf
datafile 12 switched to datafile copy
input datafile copy recid=8 stamp=778673171 filename=/u01/app/oracle/oradata/clonedb/indx01.dbf
contents of Memory Script:
{
set until scn 1143553;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 23-MAR-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=36 devtype=DISK
starting media recovery
archive log thread 1 sequence 14 is already on disk as file /disk1/arch/db01/arch_1_14_778577586.log
archive log thread 1 sequence 15 is already on disk as file /disk1/arch/db01/arch_1_15_778577586.log
archive log filename=/disk1/arch/db01/arch_1_14_778577586.log thread=1 sequence=14
archive log filename=/disk1/arch/db01/arch_1_15_778577586.log thread=1 sequence=15
media recovery complete, elapsed time: 00:00:11
Finished recover at 23-MAR-12
contents of Memory Script:
{
shutdown clone;
startup clone nomount ;
}
executing Memory Script
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 314572800 bytes
Fixed Size 1219160 bytes
Variable Size 113247656 bytes
Database Buffers 197132288 bytes
Redo Buffers 2973696 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "CLONEDB" RESETLOGS ARCHIVELOG
MAXLOGFILES 10
MAXLOGMEMBERS 5
MAXDATAFILES 100
MAXINSTANCES 1
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/disk2/oradata/clonedb/redo01a.log', '/disk1/oradata/clonedb/redo01b.log' ) SIZE 10 M REUSE,
GROUP 2 ( '/disk2/oradata/clonedb/redo02a.log', '/disk1/oradata/clonedb/redo02b.log' ) SIZE 10 M REUSE,
GROUP 3 ( '/disk1/oradata/clonedb/redo03b.log', '/disk2/oradata/clonedb/redo03a.log' ) SIZE 10 M REUSE,
GROUP 4 ( '/disk1/oradata/clonedb/redo04b.log', '/disk2/oradata/clonedb/redo04a.log' ) SIZE 10 M REUSE
DATAFILE
'/u01/app/oracle/oradata/clonedb/system01.dbf'
CHARACTER SET ZHS16GBK
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/clonedb/temp01.dbf";
set newname for tempfile 2 to
"/u01/app/oracle/oradata/clonedb/tmp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/clonedb/rtbs01.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/clonedb/sysaux01.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/clonedb/users01.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/clonedb/lxtb1.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/clonedb/lxtbs2.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/clonedb/undotbs1.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/clonedb/tbsbig.dbf";
catalog clone datafilecopy "/u01/app/oracle/oradata/clonedb/indx01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed temporary file 1 to /u01/app/oracle/oradata/clonedb/temp01.dbf in control file
renamed temporary file 2 to /u01/app/oracle/oradata/clonedb/tmp01.dbf in control file
cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/clonedb/rtbs01.dbf recid=1 stamp=778673548
cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/clonedb/sysaux01.dbf recid=2 stamp=778673548
cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/clonedb/users01.dbf recid=3 stamp=778673549
cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/clonedb/lxtb1.dbf recid=4 stamp=778673549
cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/clonedb/lxtbs2.dbf recid=5 stamp=778673549
cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/clonedb/undotbs1.dbf recid=6 stamp=778673549
cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/clonedb/tbsbig.dbf recid=7 stamp=778673549
cataloged datafile copy
datafile copy filename=/u01/app/oracle/oradata/clonedb/indx01.dbf recid=8 stamp=778673549
datafile 2 switched to datafile copy
input datafile copy recid=1 stamp=778673548 filename=/u01/app/oracle/oradata/clonedb/rtbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=2 stamp=778673548 filename=/u01/app/oracle/oradata/clonedb/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=3 stamp=778673549 filename=/u01/app/oracle/oradata/clonedb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=4 stamp=778673549 filename=/u01/app/oracle/oradata/clonedb/lxtb1.dbf
datafile 6 switched to datafile copy
input datafile copy recid=5 stamp=778673549 filename=/u01/app/oracle/oradata/clonedb/lxtbs2.dbf
datafile 8 switched to datafile copy
input datafile copy recid=6 stamp=778673549 filename=/u01/app/oracle/oradata/clonedb/undotbs1.dbf
datafile 11 switched to datafile copy
input datafile copy recid=7 stamp=778673549 filename=/u01/app/oracle/oradata/clonedb/tbsbig.dbf
datafile 12 switched to datafile copy
input datafile copy recid=8 stamp=778673549 filename=/u01/app/oracle/oradata/clonedb/indx01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 23-MAR-12
10、克隆成功,打开clone库,查看
10:13:28 SQL> select status from v$instance;
STATUS
------------
OPEN
10:13:33 SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------------------------------------------------------------------------
----
/u01/app/oracle/oradata/clonedb/system01.dbf
/u01/app/oracle/oradata/clonedb/rtbs01.dbf
/u01/app/oracle/oradata/clonedb/sysaux01.dbf
/u01/app/oracle/oradata/clonedb/users01.dbf
/u01/app/oracle/oradata/clonedb/lxtb1.dbf
/u01/app/oracle/oradata/clonedb/lxtbs2.dbf
/u01/app/oracle/oradata/clonedb/undotbs1.dbf
/u01/app/oracle/oradata/clonedb/tbsbig.dbf
/u01/app/oracle/oradata/clonedb/indx01.dbf
9 rows selected.
10:13:40 SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 0 10485760 2 YES UNUSED 0
2 1 0 10485760 2 YES UNUSED 0
3 1 0 10485760 2 YES UNUSED 0
4 1 1 10485760 2 NO CURRENT 1143554 2012-03-23 10:12:30
10:13:49 SQL> alter system switch logfile;
System altered.
10:13:56 SQL> /
System altered.
10:13:57 SQL> /
System altered.
10:13:58 SQL> /
System altered.
10:14:03 SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- -------------------
1 1 2 10485760 2 YES INACTIVE 1144304 2012-03-23 10:13:56
2 1 3 10485760 2 YES INACTIVE 1144306 2012-03-23 10:13:57
3 1 4 10485760 2 YES INACTIVE 1144308 2012-03-23 10:13:58
4 1 5 10485760 2 NO CURRENT 1144311 2012-03-23 10:14:03
oracle视频教程请关注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html