Using RMAN duplicate Created Remote Auxiliary Database with ASM to ASM

22 篇文章 0 订阅
19 篇文章 0 订阅

target    SID=zwc
auxiliary SID=zwc


on target

[oracle@source ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 26 13:10:41 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ZWC (DBID=583077230)

RMAN> run{
2> allocate channel c1 device type disk;
3> allocate channel c2 device type disk;
4> allocate channel c3 device type disk;
5> allocate channel c4 device type disk;
6> backup as compressed backupset
7> format='/orabackup/full_%d_%U' tag='full'
8> database plus archivelog delete input;
9> backup format='/orabackup/bkctl.ctl' tag='ctl'
10> current controlfile;
11> release channel c1;
12> release channel c2;
13> release channel c3;
14> release channel c4;
15> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=42 device type=DISK

allocated channel: c2
channel c2: SID=45 device type=DISK

allocated channel: c3
channel c3: SID=43 device type=DISK

allocated channel: c4
channel c4: SID=46 device type=DISK


Starting backup at 26-SEP-2013 13:14:09
current log archived
channel c1: starting compressed archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=1 STAMP=827098251
channel c1: starting piece 1 at 26-SEP-2013 13:14:13
channel c2: starting compressed archived log backup set
channel c2: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=2 STAMP=827100097
channel c2: starting piece 1 at 26-SEP-2013 13:14:13
channel c3: starting compressed archived log backup set
channel c3: specifying archived log(s) in backup set
input archived log thread=1 sequence=7 RECID=3 STAMP=827147784
channel c3: starting piece 1 at 26-SEP-2013 13:14:13
channel c4: starting compressed archived log backup set
channel c4: specifying archived log(s) in backup set
input archived log thread=1 sequence=8 RECID=4 STAMP=827154851
channel c4: starting piece 1 at 26-SEP-2013 13:14:13
channel c4: finished piece 1 at 26-SEP-2013 13:14:14
piece handle=/orabackup/full_ZWC_04okqod5_1_1 tag=FULL comment=NONE
channel c4: backup set complete, elapsed time: 00:00:01
channel c4: deleting archived log(s)
archived log file name=+DATADG/zwc/archivelog/2013_09_26/thread_1_seq_8.281.827154849 RECID=4 STAMP=827154851
channel c1: finished piece 1 at 26-SEP-2013 13:14:15
piece handle=/orabackup/full_ZWC_01okqod5_1_1 tag=FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:02
channel c1: deleting archived log(s)
archived log file name=+DATADG/zwc/archivelog/2013_09_25/thread_1_seq_5.271.827098251 RECID=1 STAMP=827098251
channel c3: finished piece 1 at 26-SEP-2013 13:14:16
piece handle=/orabackup/full_ZWC_03okqod5_1_1 tag=FULL comment=NONE
channel c3: backup set complete, elapsed time: 00:00:03
channel c3: deleting archived log(s)
archived log file name=+DATADG/zwc/archivelog/2013_09_26/thread_1_seq_7.273.827147781 RECID=3 STAMP=827147784
channel c2: finished piece 1 at 26-SEP-2013 13:14:16
piece handle=/orabackup/full_ZWC_02okqod5_1_1 tag=FULL comment=NONE
channel c2: backup set complete, elapsed time: 00:00:03
channel c2: deleting archived log(s)
archived log file name=+DATADG/zwc/archivelog/2013_09_25/thread_1_seq_6.272.827100095 RECID=2 STAMP=827100097
Finished backup at 26-SEP-2013 13:14:18

Starting backup at 26-SEP-2013 13:14:18
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATADG/zwc/datafile/system.256.827097455
channel c1: starting piece 1 at 26-SEP-2013 13:14:18
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATADG/zwc/datafile/sysaux.257.827097455
input datafile file number=00004 name=+DATADG/zwc/datafile/users.259.827097459
channel c2: starting piece 1 at 26-SEP-2013 13:14:18
channel c3: starting compressed full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00005 name=+DATADG/zwc/datafile/example.269.827097551
input datafile file number=00003 name=+DATADG/zwc/datafile/undotbs1.258.827097457
channel c3: starting piece 1 at 26-SEP-2013 13:14:19
channel c4: starting compressed full datafile backup set
channel c4: specifying datafile(s) in backup set
including current control file in backup set
channel c4: starting piece 1 at 26-SEP-2013 13:14:26
channel c4: finished piece 1 at 26-SEP-2013 13:14:29
piece handle=/orabackup/full_ZWC_08okqodb_1_1 tag=FULL comment=NONE
channel c4: backup set complete, elapsed time: 00:00:03
channel c4: starting compressed full datafile backup set
channel c4: specifying datafile(s) in backup set
including current SPFILE in backup set
channel c4: starting piece 1 at 26-SEP-2013 13:14:29
channel c4: finished piece 1 at 26-SEP-2013 13:14:36
piece handle=/orabackup/full_ZWC_09okqodl_1_1 tag=FULL comment=NONE
channel c4: backup set complete, elapsed time: 00:00:07
channel c3: finished piece 1 at 26-SEP-2013 13:14:44
piece handle=/orabackup/full_ZWC_07okqoda_1_1 tag=FULL comment=NONE
channel c3: backup set complete, elapsed time: 00:00:25
channel c1: finished piece 1 at 26-SEP-2013 13:14:54
piece handle=/orabackup/full_ZWC_05okqoda_1_1 tag=FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:36
channel c2: finished piece 1 at 26-SEP-2013 13:14:54
piece handle=/orabackup/full_ZWC_06okqoda_1_1 tag=FULL comment=NONE
channel c2: backup set complete, elapsed time: 00:00:36
Finished backup at 26-SEP-2013 13:14:54

Starting backup at 26-SEP-2013 13:14:54
current log archived
channel c1: starting compressed archived log backup set
channel c1: specifying archived log(s) in backup set
input archived log thread=1 sequence=9 RECID=5 STAMP=827154894
channel c1: starting piece 1 at 26-SEP-2013 13:14:54
channel c1: finished piece 1 at 26-SEP-2013 13:14:55
piece handle=/orabackup/full_ZWC_0aokqoee_1_1 tag=FULL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
channel c1: deleting archived log(s)
archived log file name=+DATADG/zwc/archivelog/2013_09_26/thread_1_seq_9.272.827154895 RECID=5 STAMP=827154894
Finished backup at 26-SEP-2013 13:14:55

Starting backup at 26-SEP-2013 13:14:55
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
channel c1: starting piece 1 at 26-SEP-2013 13:14:57
channel c1: finished piece 1 at 26-SEP-2013 13:14:58
piece handle=/orabackup/bkctl.ctl tag=CTL comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-SEP-2013 13:14:58

released channel: c1

released channel: c2

released channel: c3

released channel: c4

RMAN> 

[oracle@source ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 26 13:29:06 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ZWC (DBID=583077230)

RMAN> list backupset by file;

using target database control file instead of recovery catalog

List of Datafile Backups
========================

File Key     TY LV S Ckp SCN    Ckp Time             #Pieces #Copies Compressed Tag
---- ------- -  -- - ---------- -------------------- ------- ------- ---------- ---
1    9       B  F  A 1036145    26-SEP-2013 13:14:18 1       1       YES        FULL
2    8       B  F  A 1036146    26-SEP-2013 13:14:18 1       1       YES        FULL
3    7       B  F  A 1036147    26-SEP-2013 13:14:20 1       1       YES        FULL
4    8       B  F  A 1036146    26-SEP-2013 13:14:18 1       1       YES        FULL
5    7       B  F  A 1036147    26-SEP-2013 13:14:20 1       1       YES        FULL

List of Archived Log Backups
============================

Thrd Seq     Low SCN    Low Time             BS Key  S #Pieces #Copies Compressed Tag
---- ------- ---------- -------------------- ------- - ------- ------- ---------- ---
1    5       993886     25-SEP-2013 21:22:50 3       A 1       1       YES        FULL
1    6       999248     25-SEP-2013 21:30:51 4       A 1       1       YES        FULL
1    7       1008402    25-SEP-2013 22:01:35 2       A 1       1       YES        FULL
1    8       1030210    26-SEP-2013 11:16:20 1       A 1       1       YES        FULL
1    9       1036129    26-SEP-2013 13:14:09 10      A 1       1       YES        FULL

List of Control File Backups
============================

CF Ckp SCN Ckp Time             BS Key  S #Pieces #Copies Compressed Tag
---------- -------------------- ------- - ------- ------- ---------- ---
1036177    26-SEP-2013 13:14:56 11      A 1       1       NO         CTL
1036146    26-SEP-2013 13:14:19 5       A 1       1       YES        FULL
List of SPFILE Backups
======================

Modification Time    BS Key  S #Pieces #Copies Compressed Tag
-------------------- ------- - ------- ------- ---------- ---
26-SEP-2013 13:14:18 6       A 1       1       YES        FULL

RMAN> 
[oracle@source orabackup]$ scp -r * oracle@192.168.1.204:/orabackup
oracle@192.168.1.204's password: 
bkctl.ctl                                                                                                                                                                                          100% 9568KB   9.3MB/s   00:00    
full_ZWC_01okqod5_1_1                                                                                                                                                                              100% 5487KB   5.4MB/s   00:00    
full_ZWC_02okqod5_1_1                                                                                                                                                                              100%   16MB  15.6MB/s   00:00    
full_ZWC_03okqod5_1_1                                                                                                                                                                              100% 2831KB   2.8MB/s   00:00    
full_ZWC_04okqod5_1_1                                                                                                                                                                              100% 2157KB   2.1MB/s   00:00    
full_ZWC_05okqoda_1_1                                                                                                                                                                              100%  194MB  32.4MB/s   00:06    
full_ZWC_06okqoda_1_1                                                                                                                                                                              100%   71MB  35.6MB/s   00:02    
full_ZWC_07okqoda_1_1                                                                                                                                                                              100%   21MB  21.3MB/s   00:01    
full_ZWC_08okqodb_1_1                                                                                                                                                                              100% 1072KB   1.1MB/s   00:00    
full_ZWC_09okqodl_1_1                                                                                                                                                                              100%   96KB  96.0KB/s   00:00    
full_ZWC_0aokqoee_1_1                                                                                                                                                                              100% 4096     4.0KB/s   00:00    
[oracle@source orabackup]$ ll


on auxiliary

[oracle@target ~]$ mkdir -p $ORACLE_BASE/admin/zwc/adump  
[oracle@target ~]$ mkdir -p $ORACLE_BASE/admin/zwc/bdump  
[oracle@target ~]$ mkdir -p $ORACLE_BASE/admin/zwc/cdump  
[oracle@target ~]$ mkdir -p $ORACLE_BASE/admin/zwc/udump 
[oracle@target dbs]$ orapwd file=$ORACLE_HOME/dbs/orapwzwc password=oracle entries=5
[oracle@target dbs]$ cat initzwc.ora 
zwc.__db_cache_size=411041792
zwc.__java_pool_size=4194304
zwc.__large_pool_size=8388608
zwc.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
zwc.__pga_aggregate_target=213909504
zwc.__sga_target=624951296
zwc.__shared_io_pool_size=0
zwc.__shared_pool_size=192937984
zwc.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/zwc/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='+DATADG/zwc/controlfile/current.261.827097519','+DATADG/zwc/controlfile/current.260.827097521'
*.db_block_size=8192
*.db_create_file_dest='+DATADG'
*.db_domain=''
*.db_name='zwc'
*.db_recovery_file_dest='+DATADG'
*.db_recovery_file_dest_size=10737418240
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=zwcXDB)'
*.log_archive_dest_1='LOCATION=+DATADG'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=838860800
*.open_cursors=300
*.processes=800
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=885
*.undo_tablespace='UNDOTBS1'
[oracle@target ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 26 13:24:00 2013

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

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2257840 bytes
Variable Size             717229136 bytes
Database Buffers          113246208 bytes
Redo Buffers                2371584 bytes
SQL> 
[oracle@target ~]$ rman target sys/oracle@source auxiliary /

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Sep 26 13:32:41 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ZWC (DBID=583077230)
connected to auxiliary database: ZWC (not mounted)

RMAN> run{
2> allocate auxiliary channel c1 device type disk;
3> duplicate target database to zwc nofilenamecheck;
4> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=25 device type=DISK

Starting Duplicate Db at 26-SEP-2013 13:34:12

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                717229136 bytes
Database Buffers             113246208 bytes
Redo Buffers                   2371584 bytes
allocated channel: c1
channel c1: SID=23 device type=DISK

contents of Memory Script:
{
   sql clone "alter system set  control_files = 
  ''+DATADG/zwc/controlfile/current.258.827156061'', ''+DATADG/zwc/controlfile/current.259.827156061'' comment=
 ''Set by RMAN'' scope=spfile";
   sql clone "alter system set  db_name = 
 ''ZWC'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''ZWC'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile;
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  control_files =   ''+DATADG/zwc/controlfile/current.258.827156061'', ''+DATADG/zwc/controlfile/current.259.827156061'' comment= ''Set by RMAN'' scope=spfile

sql statement: alter system set  db_name =  ''ZWC'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''ZWC'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                717229136 bytes
Database Buffers             113246208 bytes
Redo Buffers                   2371584 bytes
allocated channel: c1
channel c1: SID=23 device type=DISK

Starting restore at 26-SEP-2013 13:34:27

channel c1: starting datafile backup set restore
channel c1: restoring control file
channel c1: reading from backup piece /orabackup/bkctl.ctl
channel c1: piece handle=/orabackup/bkctl.ctl tag=CTL
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:09
output file name=+DATADG/zwc/controlfile/current.258.827156061
output file name=+DATADG/zwc/controlfile/current.259.827156061
Finished restore at 26-SEP-2013 13:34:36

database mounted

contents of Memory Script:
{
   set until scn  1036166;
   set newname for clone datafile  1 to new;
   set newname for clone datafile  2 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   set newname for clone datafile  5 to new;
   restore
   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

Starting restore at 26-SEP-2013 13:34:41

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00003 to +DATADG
channel c1: restoring datafile 00005 to +DATADG
channel c1: reading from backup piece /orabackup/full_ZWC_07okqoda_1_1
channel c1: piece handle=/orabackup/full_ZWC_07okqoda_1_1 tag=FULL
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:15
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00002 to +DATADG
channel c1: restoring datafile 00004 to +DATADG
channel c1: reading from backup piece /orabackup/full_ZWC_06okqoda_1_1
channel c1: piece handle=/orabackup/full_ZWC_06okqoda_1_1 tag=FULL
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:15
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to +DATADG
channel c1: reading from backup piece /orabackup/full_ZWC_05okqoda_1_1
channel c1: piece handle=/orabackup/full_ZWC_05okqoda_1_1 tag=FULL
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:35
Finished restore at 26-SEP-2013 13:35:46

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=827156147 file name=+DATADG/zwc/datafile/system.264.827156111
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=827156147 file name=+DATADG/zwc/datafile/sysaux.262.827156097
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=827156147 file name=+DATADG/zwc/datafile/undotbs1.261.827156085
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=827156147 file name=+DATADG/zwc/datafile/users.263.827156099
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=827156147 file name=+DATADG/zwc/datafile/example.260.827156081

contents of Memory Script:
{
   set until scn  1036166;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 26-SEP-2013 13:35:47

starting media recovery

channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=9
channel c1: reading from backup piece /orabackup/full_ZWC_0aokqoee_1_1
channel c1: piece handle=/orabackup/full_ZWC_0aokqoee_1_1 tag=FULL
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:03
archived log file name=+DATADG/zwc/archivelog/2013_09_26/thread_1_seq_9.265.827156147 thread=1 sequence=9
channel clone_default: deleting archived log(s)
archived log file name=+DATADG/zwc/archivelog/2013_09_26/thread_1_seq_9.265.827156147 RECID=6 STAMP=827156149
media recovery complete, elapsed time: 00:00:00
Finished recover at 26-SEP-2013 13:35:51
Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                717229136 bytes
Database Buffers             113246208 bytes
Redo Buffers                   2371584 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''ZWC'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ZWC'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     835104768 bytes

Fixed Size                     2257840 bytes
Variable Size                717229136 bytes
Database Buffers             113246208 bytes
Redo Buffers                   2371584 bytes
allocated channel: c1
channel c1: SID=23 device type=DISK
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ZWC" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1  SIZE 50 M ,
  GROUP   2  SIZE 50 M ,
  GROUP   3  SIZE 50 M 
 DATAFILE
  '+DATADG/zwc/datafile/system.264.827156111'
 CHARACTER SET ZHS16GBK


contents of Memory Script:
{
   set newname for clone tempfile  1 to new;
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATADG/zwc/datafile/sysaux.262.827156097", 
 "+DATADG/zwc/datafile/undotbs1.261.827156085", 
 "+DATADG/zwc/datafile/users.263.827156099", 
 "+DATADG/zwc/datafile/example.260.827156081";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +DATADG in control file

cataloged datafile copy
datafile copy file name=+DATADG/zwc/datafile/sysaux.262.827156097 RECID=1 STAMP=827156165
cataloged datafile copy
datafile copy file name=+DATADG/zwc/datafile/undotbs1.261.827156085 RECID=2 STAMP=827156165
cataloged datafile copy
datafile copy file name=+DATADG/zwc/datafile/users.263.827156099 RECID=3 STAMP=827156165
cataloged datafile copy
datafile copy file name=+DATADG/zwc/datafile/example.260.827156081 RECID=4 STAMP=827156165

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=827156165 file name=+DATADG/zwc/datafile/sysaux.262.827156097
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=827156165 file name=+DATADG/zwc/datafile/undotbs1.261.827156085
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=827156165 file name=+DATADG/zwc/datafile/users.263.827156099
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=827156165 file name=+DATADG/zwc/datafile/example.260.827156081
Reenabling controlfile options for auxiliary database
Executing: alter database force logging

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 26-SEP-2013 13:36:27
released channel: c1

RMAN> 
[oracle@target ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 26 13:39:20 2013

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select name from v$controlfile
  2  union all
  3  select name from v$datafile
  4  union all
  5  select name from v$tempfile
  6  union all
  7  select member from v$logfile
  8  /

NAME
--------------------------------------------------------------------------------
+DATADG/zwc/controlfile/current.258.827156061
+DATADG/zwc/controlfile/current.259.827156061
+DATADG/zwc/datafile/system.264.827156111
+DATADG/zwc/datafile/sysaux.262.827156097
+DATADG/zwc/datafile/undotbs1.261.827156085
+DATADG/zwc/datafile/users.263.827156099
+DATADG/zwc/datafile/example.260.827156081
+DATADG/zwc/tempfile/temp.271.827156181
+DATADG/zwc/onlinelog/group_3.269.827156175
+DATADG/zwc/onlinelog/group_3.270.827156177
+DATADG/zwc/onlinelog/group_2.267.827156171

NAME
--------------------------------------------------------------------------------
+DATADG/zwc/onlinelog/group_2.268.827156173
+DATADG/zwc/onlinelog/group_1.265.827156165
+DATADG/zwc/onlinelog/group_1.266.827156167

14 rows selected.

SQL> 
SQL> select name from v$archived_log;

no rows selected

SQL> alter system switch logfile;

System altered.

SQL> select name from v$archived_log;

NAME
--------------------------------------------------------------------------------
+DATADG/zwc/archivelog/2013_09_26/thread_1_seq_1.272.827156469
[oracle@target ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Sep 26 13:45:46 2013

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

Connected to an idle instance.

SQL> startup pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initzwc.ora'
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2257840 bytes
Variable Size             717229136 bytes
Database Buffers          113246208 bytes
Redo Buffers                2371584 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile;

File created.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2257840 bytes
Variable Size             717229136 bytes
Database Buffers          113246208 bytes
Redo Buffers                2371584 bytes
Database mounted.
Database opened.
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0
                                                 /dbhome_1/dbs/spfilezwc.ora
SQL> conn scott/tiger@zwc
Connected.
SQL> conn scott/tiger
Connected.
SQL> select ename from emp;

ENAME
----------
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS

ENAME
----------
JAMES
FORD
MILLER

14 rows selected.

SQL> 
[oracle@target ~]$ lsnrctl service

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-SEP-2013 13:48:26

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "zwc" has 2 instance(s).
  Instance "zwc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:5 refused:0
         LOCAL SERVER
  Instance "zwc", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:1 refused:0 state:ready
         LOCAL SERVER
Service "zwcXDB" has 1 instance(s).
  Instance "zwc", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER <machine: target, pid: 7778>
         (ADDRESS=(PROTOCOL=tcp)(HOST=target)(PORT=32331))
The command completed successfully
[oracle@target ~]$ 
[oracle@target ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-SEP-2013 13:48:30

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                26-SEP-2013 12:25:23
Uptime                    0 days 1 hr. 23 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/target/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=target)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "zwc" has 2 instance(s).
  Instance "zwc", status UNKNOWN, has 1 handler(s) for this service...
  Instance "zwc", status READY, has 1 handler(s) for this service...
Service "zwcXDB" has 1 instance(s).
  Instance "zwc", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@target ~]$ 
[root@target ~]# vi /etc/oratab 

#



# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/11.2.0/grid:N
zwc:/u01/app/oracle/product/11.2.0/dbhome_1:N 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值