使用Oracle安装包的ssh配置机器互信

[oracle@lunar test]$ ./sshUsersetup.sh -user oracle -hosts "192.168.56.66 192.168.56.101"
The output of this script is also logged into /tmp/sshUserSetup_2013-10-27-00-39-03.log
Hosts are 192.168.56.66 192.168.56.101
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING 192.168.56.66 (192.168.56.66) 56(84) bytes of data.
64 bytes from 192.168.56.66: icmp_seq=1 ttl=64 time=0.029 ms
64 bytes from 192.168.56.66: icmp_seq=2 ttl=64 time=0.071 ms
64 bytes from 192.168.56.66: icmp_seq=3 ttl=64 time=0.046 ms
64 bytes from 192.168.56.66: icmp_seq=4 ttl=64 time=0.036 ms
64 bytes from 192.168.56.66: icmp_seq=5 ttl=64 time=0.047 ms

--- 192.168.56.66 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.029/0.045/0.071/0.016 ms
PING 192.168.56.101 (192.168.56.101) 56(84) bytes of data.
64 bytes from 192.168.56.101: icmp_seq=1 ttl=64 time=2.86 ms
64 bytes from 192.168.56.101: icmp_seq=2 ttl=64 time=1.79 ms
64 bytes from 192.168.56.101: icmp_seq=3 ttl=64 time=1.46 ms
64 bytes from 192.168.56.101: icmp_seq=4 ttl=64 time=1.07 ms
64 bytes from 192.168.56.101: icmp_seq=5 ttl=64 time=0.625 ms

--- 192.168.56.101 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 0.625/1.563/2.864/0.759 ms
Remote host reachability check succeeded.
The following hosts are reachable: 192.168.56.66 192.168.56.101.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost 192.168.56.66
numhosts 2
The script will setup SSH connectivity from the host lunar to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host lunar
and the remote hosts without being prompted for passwords or confirmations.

NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.

NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.

Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes

The user chose yes
Please specify if you want to specify a passphrase for the private key this script will create for the local host. Passphrase is used to encrypt the private key and makes SSH much more secure. Type 'yes' or 'no' and then press enter. In case you press 'yes', you would need to enter the passphrase whenever the script executes ssh or scp.
The estimated number of times the user would be prompted for a passphrase is 4. In addition, if the private-public files are also newly created, the user would have to specify the passphrase on one additional occasion.
Enter 'yes' or 'no'.
yes

The user chose yes
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /home/oracle/.ssh/config, it would be backed up to /home/oracle/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Generating public/private rsa key pair.
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
9a:15:b2:57:0f:79:28:33:3a:0f:7c:e3:42:61:5f:22 oracle@lunar
Creating .ssh directory and setting permissions on remote host 192.168.56.66
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host 192.168.56.66. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host 192.168.56.66.
Warning: Permanently added '192.168.56.66' (RSA) to the list of known hosts.
oracle@192.168.56.66's password:
Done with creating .ssh directory and setting permissions on remote host 192.168.56.66.
Creating .ssh directory and setting permissions on remote host 192.168.56.101
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host 192.168.56.101. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host 192.168.56.101.
Warning: Permanently added '192.168.56.101' (RSA) to the list of known hosts.
oracle@192.168.56.101's password:
Done with creating .ssh directory and setting permissions on remote host 192.168.56.101.
Copying local host public key to the remote host 192.168.56.66
The user may be prompted for a password or passphrase here since the script would be using SCP for host 192.168.56.66.
oracle@192.168.56.66's password:
Done copying local host public key to the remote host 192.168.56.66
Copying local host public key to the remote host 192.168.56.101
The user may be prompted for a password or passphrase here since the script would be using SCP for host 192.168.56.101.
oracle@192.168.56.101's password:
Done copying local host public key to the remote host 192.168.56.101
The script will run SSH on the remote machine 192.168.56.66. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
The script will run SSH on the remote machine 192.168.56.101. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
cat: /home/oracle/.ssh/known_hosts.tmp: No such file or directory
cat: /home/oracle/.ssh/authorized_keys.tmp: No such file or directory
SSH setup is complete.

------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--192.168.56.66:--
Running /usr/bin/ssh -x -l oracle 192.168.56.66 date to verify SSH connectivity has been setup from local host to 192.168.56.66.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
The script will run SSH on the remote machine 192.168.56.66. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
Sun Oct 27 00:39:51 GMT+8 2013
------------------------------------------------------------------------
--192.168.56.101:--
Running /usr/bin/ssh -x -l oracle 192.168.56.101 date to verify SSH connectivity has been setup from local host to 192.168.56.101.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
The script will run SSH on the remote machine 192.168.56.101. The user may be prompted for a passphrase here in case the private key has been encrypted with a passphrase.
Sun Oct 27 16:38:47 GMT+8 2013
------------------------------------------------------------------------
SSH verification complete.
[oracle@lunar test]$
[oracle@lunar test]$
[oracle@lunar test]$
[oracle@lunar test]$ ssh 192.168.56.66
[oracle@lunar ~]$ ssh 192.168.56.101
[oracle@lunar ~]$ exit
logout
Connection to 192.168.56.101 closed.
[oracle@lunar ~]$
发表在 FAQ | 标签为 , | 一条评论

一次ORA-1578的处理

今天本想测试一个东西,却遇到一个ORA-1578,比较郁闷,最近vm总是出现乱七八糟郁闷问题。。。。。

LUNAR@travel>select count(*) from ff;
select count(*) from ff
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 129)
ORA-01110: data file 4: '/stage/travel/users01.dbf'
LUNAR@travel>
 
SYS@travel>select file#,name from v$datafile;
 
FILE# NAME
---------- -------------------------------------------------------
1 /stage/travel/system01.dbf
2 /stage/travel/sysaux01.dbf
3 /stage/travel/undotbs01.dbf
4 /stage/travel/users01.dbf
5 /stage/travel/lunar01.dbf
 
SYS@travel>
 
使用dbv检测了一下,发现两个坏块:
[oracle@lunar ~]$ dbv
 
DBVERIFY: Release 11.2.0.3.0 - Production on Sat Oct 26 20:32:04 2013
 
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
 
Keyword Description (Default)
----------------------------------------------------
FILE File to Verify (NONE)
START Start Block (First Block of File)
END End Block (Last Block of File)
BLOCKSIZE Logical Block Size (8192)
LOGFILE Output Log (NONE)
FEEDBACK Display Progress (0)
PARFILE Parameter File (NONE)
USERID Username/Password (NONE)
SEGMENT_ID Segment ID (tsn.relfile.block) (NONE)
HIGH_SCN Highest Block SCN To Verify (NONE)
(scn_wrap.scn_base OR scn)
[oracle@lunar ~]$ dbv file=/stage/travel/users01.dbf
 
DBVERIFY: Release 11.2.0.3.0 - Production on Sat Oct 26 20:32:26 2013
 
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
 
DBVERIFY - Verification starting : FILE = /stage/travel/users01.dbf
Page 128 is influx - most likely media corrupt
Corrupt block relative dba: 0x01000080 (file 4, block 128)
Fractured block found during dbv:
Data in bad block:
type: 30 format: 2 rdba: 0x01000080
last change scn: 0x0000.00055d9a seq: 0x4 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x5d9a2004
check value in block header: 0xd9f8
computed block checksum: 0x0
 
Page 129 is marked corrupt
Corrupt block relative dba: 0x01000081 (file 4, block 129)
Bad check value found during dbv:
Data in bad block:
type: 33 format: 2 rdba: 0x01000081
last change scn: 0x0000.00057901 seq: 0x3 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x79012103
check value in block header: 0xc13e
computed block checksum: 0x41f0

原因已经很清楚了,file 4 block 128是物理坏块;file 4 block 129是checksum问题

DBVERIFY - Verification complete
 
Total Pages Examined : 32000
Total Pages Processed (Data) : 29573
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing (Index): 0
Total Pages Processed (Other): 380
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 2045
Total Pages Marked Corrupt : 2
Total Pages Influx : 1
Total Pages Encrypted : 0
Highest block SCN : 442564 (0.442564)
 
我来试试rman检测的效果:
[oracle@lunar ~]$ rman target /
 
Recovery Manager: Release 11.2.0.3.0 - Production on Sat Oct 26 20:58:42 2013
 
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
 
connected to target database: TRAVEL (DBID=2874070637)
 
RMAN> backup validate check logical database;
 
Starting backup at 26-OCT-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=140 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/stage/travel/system01.dbf
input datafile file number=00002 name=/stage/travel/sysaux01.dbf
input datafile file number=00004 name=/stage/travel/users01.dbf
input datafile file number=00003 name=/stage/travel/undotbs01.dbf
input datafile file number=00005 name=/stage/travel/lunar01.dbf
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1 OK 0 12609 44800 537449
File Name: /stage/travel/system01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 22483
Index 0 6617
Other 0 3091
 
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
2 OK 0 24301 38400 537463
File Name: /stage/travel/sysaux01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 4311
Index 0 3504
Other 0 6284
 
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
3 OK 0 1 19840 537463
File Name: /stage/travel/undotbs01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 0
Index 0 0
Other 0 19839
 
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
4 FAILED 0 2045 32000 442564
File Name: /stage/travel/users01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 29573
Index 0 0
Other 2 382
 
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
5 OK 0 12475 12800 442504
File Name: /stage/travel/lunar01.dbf
Block Type Blocks Failing Blocks Processed
---------- -------------- ----------------
Data 0 0
Index 0 1
Other 0 324
 
validate found one or more corrupt blocks
See trace file /u01/app/oracle/diag/rdbms/travel/travel/trace/travel_ora_11181.trc for details
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
List of Control File and SPFILE
===============================
File Type Status Blocks Failing Blocks Examined
------------ ------ -------------- ---------------
SPFILE OK 0 2
Control File OK 0 594
Finished backup at 26-OCT-13
 
RMAN> exit
Recovery Manager complete.
[oracle@lunar ~]$ ss
 
SQL*Plus: Release 11.2.0.3.0 Production on Sat Oct 26 21:02:20 2013
 
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning and Real Application Testing options
 
SYS@travel>select * from v$database_block_corruption;
 
FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTION_TYPE
---------- ---------- ---------- ------------------ ------------------
4 128 1 0 FRACTURED 这里的信息与dbv的检测完全一致,非常方便,block corrupt的类型清晰明了
4 129 1 0 CHECKSUM
 
SYS@travel>
尝试使用event 10231跳过都失败了:
LUNAR@travel>set autotrace on explain
LUNAR@travel>alter session set events '10231 trace name context forever, level 1';
 
Session altered.
 
LUNAR@travel>select count(*) from ff;
select count(*) from ff
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 129)
ORA-01110: data file 4: '/stage/travel/users01.dbf'
LUNAR@travel>
 
LUNAR@travel>alter session set events '10231 trace name context forever, level 10';
 
Session altered.
 
LUNAR@travel>select count(*) from ff;
select count(*) from ff
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 129)
ORA-01110: data file 4: '/stage/travel/users01.dbf'
LUNAR@travel>
 
尝试按照rowid抽取,也失败了:
declare
n number:=0;
bad_rows number := 0;
error_code number;
ora1578 EXCEPTION;
PRAGMA EXCEPTION_INIT(ora1578, -1578);
begin
for i in (select rowid rid from ff) loop
begin
insert into newff
select *
from ff
where rowid=i.rid;
n:=n+1;
exception
when ora1578 then
bad_rows := bad_rows + 1;
insert into bad_rows values(i.rid,1578);
commit;
when others then
error_code:=SQLCODE;
bad_rows := bad_rows + 1;
insert into bad_rows values(i.rid,error_code);
commit;
end;
end loop;
dbms_output.put_line('Total Bad Rows: '||bad_rows);
dbms_output.put_line('Total Good rows: '||n);
end;
/
 
LUNAR@travel>declare
2 n number:=0;
3 bad_rows number := 0;
4 error_code number;
5 ora1578 EXCEPTION;
6 PRAGMA EXCEPTION_INIT(ora1578, -1578);
7 begin
8 for i in (select rowid rid from ff) loop
9 begin
10 insert into newff
11 select *
12 from ff
13 where rowid=i.rid;
14 n:=n+1;
15 exception
16 when ora1578 then
17 bad_rows := bad_rows + 1;
18 insert into bad_rows values(i.rid,1578);
19 commit;
20 when others then
21 error_code:=SQLCODE;
22 bad_rows := bad_rows + 1;
23 insert into bad_rows values(i.rid,error_code);
24 commit;
25 end;
26 end loop;
27 dbms_output.put_line('Total Bad Rows: '||bad_rows);
28 dbms_output.put_line('Total Good rows: '||n);
29 end;
30 /
declare
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 129)
ORA-01110: data file 4: '/stage/travel/users01.dbf'
ORA-06512: at line 8
LUNAR@travel>

尝试DBMS_REPAIR也不行:

execute DBMS_REPAIR.SKIP_CORRUPT_BLOCKS('','', flags=>dbms_repair.noskip_flag);
 
select owner, segment_name, segment_type, partition_name
from dba_segments
where header_file = &AFN
and header_block = &BL;
exec DBMS_REPAIR.ADMIN_TABLES('REPAIR_TABLE',1,1,'SYSTEM');
exec DBMS_REPAIR.ADMIN_TABLES('ORPHAN_TABLE',2,1,'SYSTEM');
 
SET serveroutput ON
DECLARE
cc NUMBER;
BEGIN
DBMS_REPAIR.check_object(schema_name => 'LUNAR',object_name =>'FF',corrupt_count => cc);
DBMS_OUTPUT.put_line(a => TO_CHAR(cc));
END;
/
 
SYS@travel>SET serveroutput ON
DECLARE
SYS@travel> 2 cc NUMBER;
3 BEGIN
4 DBMS_REPAIR.check_object(schema_name => 'LUNAR',object_name =>'FF',corrupt_count => cc);
5 DBMS_OUTPUT.put_line(a => TO_CHAR(cc));
6 END;
7 /
DECLARE
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 129)
ORA-01110: data file 4: '/stage/travel/users01.dbf'
ORA-06512: at "SYS.DBMS_REPAIR", line 294
ORA-06512: at line 4
SYS@travel>
dump一下,看看什么情况:
SYS@travel>oradebug setmypid
Statement processed.
SYS@travel> ALTER system dump datafile 4 block 129;
 
System altered.
 
SYS@travel>oradebug tracefile_name
/u01/app/oracle/diag/rdbms/travel/travel/trace/travel_ora_11492.trc
SYS@travel>
 
*** 2013-10-26 22:06:33.568
Start dump data blocks tsn: 4 file#:4 minblk 129 maxblk 129
Block dump from cache:
Dump of buffer cache at level 4 for tsn=4 rdba=16777345
BH (0x693e6418) file#: 4 rdba: 0x01000081 (4/129) class: 9 ba: 0x69182000
set: 5 pool: 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 110,28
dbwrid: 0 obj: 17946 objn: 17946 tsn: 4 afn: 4 hint: f
hash: [0x7448c5d0,0x7448c5d0] lru: [0x693e6630,0x693e63d0]
ckptq: [NULL] fileq: [NULL] objq: [0x697f40d8,0x693e63f8] objaq: [0x697f40e8,0x693e6408]
st: XCURRENT md: NULL fpin: 'ktspswh6: ktspInitScan' tch: 0
flags: auto_bmr_tried
LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]
Block dump from disk:
buffer tsn: 4 rdba: 0x01000081 (4/129)
scn: 0x0000.00057901 seq: 0x03 flg: 0x04 tail: 0x79012103
frmt: 0x02 chkval: 0xc13e type: 0x21=SECOND LEVEL BITMAP BLOCK ------这里看到是type: 0x21=SECOND LEVEL BITMAP BLOCK,event 10231等等手段是跳不过去的
Hex dump of corrupt header 3 = CHKVAL
尝试使用bbed修改:
BBED> verify
DBVERIFY - Verification starting
FILE = /stage/travel/users01.dbf
BLOCK = 129
 
Block 129 is corrupt
Corrupt block relative dba: 0x01000081 (file 0, block 129)
Bad check value found during verification
Data in bad block:
type: 33 format: 2 rdba: 0x01000081
last change scn: 0x0000.00057901 seq: 0x3 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x79012103
check value in block header: 0xc13e
computed block checksum: 0x41f0
DBVERIFY - Verification complete
 
Total Blocks Examined : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 0
Total Blocks Marked Corrupt : 1
Total Blocks Influx : 0
Message 531 not found; product=RDBMS; facility=BBED
BBED>
BBED> sum apply
Check value for File 4, Block 129:
current = 0x80ce, required = 0x80ce
 
BBED> verify
DBVERIFY - Verification starting
FILE = /stage/travel/users01.dbf
BLOCK = 129
DBVERIFY - Verification complete
 
Total Blocks Examined : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Empty : 0
Total Blocks Marked Corrupt : 0
Total Blocks Influx : 0
Message 531 not found; product=RDBMS; facility=BBED
BBED>

好了,已经不抱错了,再试试,dbv,这里理论上应该是只有1个坏块了,file 4 block 129已经修好了:

[oracle@lunar bbed]$ dbv file=/stage/travel/users01.dbf
 
DBVERIFY: Release 11.2.0.3.0 - Production on Sat Oct 26 23:10:51 2013
 
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
 
DBVERIFY - Verification starting : FILE = /stage/travel/users01.dbf
Page 128 is influx - most likely media corrupt
Corrupt block relative dba: 0x01000080 (file 4, block 128)
Fractured block found during dbv:
Data in bad block:
type: 30 format: 2 rdba: 0x01000080
last change scn: 0x0000.00055d9a seq: 0x4 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x5d9a2004
check value in block header: 0xd9f8
computed block checksum: 0x0
 
 
 
DBVERIFY - Verification complete
 
Total Pages Examined : 32000
Total Pages Processed (Data) : 29565
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing (Index): 0
Total Pages Processed (Other): 389
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 2045
Total Pages Marked Corrupt : 1
Total Pages Influx : 1
Total Pages Encrypted : 0
Highest block SCN : 539524 (0.539524)
[oracle@lunar bbed]$

记录一下:
bbed修改后的block: 有问题的block:

*** 2013-10-26 23:12:54.998 *** 2013-10-26 22:06:33.568
Start dump data blocks tsn: 4 file#:4 minblk 129 maxblk 129 Start dump data blocks tsn: 4 file#:4 minblk 129 maxblk 129
Block dump from cache: Block dump from cache:
Dump of buffer cache at level 4 for tsn=4 rdba=16777345 Dump of buffer cache at level 4 for tsn=4 rdba=16777345
BH (0x693e6418) file#: 4 rdba: 0x01000081 (4/129) class: 9 ba: 0x69182000 BH (0x693e6418) file#: 4 rdba: 0x01000081 (4/129) class: 9 ba: 0x69182000
set: 5 pool: 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 116,28 set: 5 pool: 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 110,28
dbwrid: 0 obj: 17946 objn: 17946 tsn: 4 afn: 4 hint: f dbwrid: 0 obj: 17946 objn: 17946 tsn: 4 afn: 4 hint: f
hash: [0x7448c5d0,0x7448c5d0] lru: [0x693e6630,0x693e63d0] hash: [0x7448c5d0,0x7448c5d0] lru: [0x693e6630,0x693e63d0]
ckptq: [NULL] fileq: [NULL] objq: [0x697f40d8,0x693e63f8] objaq: [0x697f40e8,0x693e6408] ckptq: [NULL] fileq: [NULL] objq: [0x697f40d8,0x693e63f8] objaq: [0x697f40e8,0x693e6408]
st: XCURRENT md: NULL fpin: 'ktspswh6: ktspInitScan' tch: 0 st: XCURRENT md: NULL fpin: 'ktspswh6: ktspInitScan' tch: 0
flags: auto_bmr_tried flags: auto_bmr_tried
LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535] LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]
Block dump from disk: Block dump from disk:
buffer tsn: 4 rdba: 0x01000081 (4/129) buffer tsn: 4 rdba: 0x01000081 (4/129)
scn: 0x0000.00057901 seq: 0x03 flg: 0x04 tail: 0x79012103 scn: 0x0000.00057901 seq: 0x03 flg: 0x04 tail: 0x79012103
frmt: 0x02 chkval: 0x80ce type: 0x21=SECOND LEVEL BITMAP BLOCK frmt: 0x02 chkval: 0xc13e type: 0x21=SECOND LEVEL BITMAP BLOCK
Hex dump of block: st=0, typ_found=1 Hex dump of corrupt header 3 = CHKVAL
Dump of memory from 0x00007FFDE0FECA00 to 0x00007FFDE0FEEA00

对比修复之前的file 4 block129的dbv的信息:

Page 129 is marked corrupt
Corrupt block relative dba: 0x01000081 (file 4, block 129)
Bad check value found during dbv:
Data in bad block:
type: 33 format: 2 rdba: 0x01000081
last change scn: 0x0000.00057901 seq: 0x3 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x79012103
check value in block header: 0xc13e
computed block checksum: 0x41f0

再次尝试event 10231跳过,发现还是不行:

SYS@travel>conn lunar/lunar
Connected.
LUNAR@travel>alter session set events '10231 trace name context forever, level 10';
 
Session altered.
 
LUNAR@travel>select count(*) from ff;
select count(*) from ff
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 129)
ORA-01110: data file 4: '/stage/travel/users01.dbf'
LUNAR@travel>!

bbed再次检查,发现没有问题:

[oracle@lunar bbed]$ dbv file=/stage/travel/users01.dbf
 
DBVERIFY: Release 11.2.0.3.0 - Production on Sat Oct 26 23:20:14 2013
 
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
 
DBVERIFY - Verification starting : FILE = /stage/travel/users01.dbf
Page 128 is influx - most likely media corrupt
Corrupt block relative dba: 0x01000080 (file 4, block 128)
Fractured block found during dbv:
Data in bad block:
type: 30 format: 2 rdba: 0x01000080
last change scn: 0x0000.00055d9a seq: 0x4 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x5d9a2004
check value in block header: 0xd9f8
computed block checksum: 0x0
 
 
 
DBVERIFY - Verification complete
 
Total Pages Examined : 32000
Total Pages Processed (Data) : 29565
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing (Index): 0
Total Pages Processed (Other): 389
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 2045
Total Pages Marked Corrupt : 1
Total Pages Influx : 1
Total Pages Encrypted : 0
Highest block SCN : 539524 (0.539524)
[oracle@lunar bbed]$

怀疑是buffer中该块还是老的,因此试试刷新一下:

SYS@travel>alter system flush BUFFER_CACHE;
 
System altered.
 
SYS@travel>conn lunar/lunar
Connected.
LUNAR@travel>alter session set events '10231 trace name context forever, level 10';
 
Session altered.
 
LUNAR@travel>select count(*) from ff;
 
COUNT(*)
----------
141112
 
LUNAR@travel>

问题解决了,O(∩_∩)O哈哈~

 

发表在 backup&recovery, ORA-XXXXX | 标签为 | 一条评论

我的sqlplus怎么不能显示title了??

我的sqlplus显示不正常:
[root@lunar ~]# su – oracle
[oracle@lunar ~]$ sqlplus / as sysdba
-bash: sqlplus: command not found
[oracle@lunar ~]$ . bb.env
[oracle@lunar ~]$ ss

SQL*Plus: Release 11.2.0.3.0 Production on Thu Oct 10 09:10:53 2013

Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning and Real Application Testing options

SYS@bb>select * from dual;
X

SYS@bb>

检查glogin:
SYS@bb>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning and Real Application Testing options
[oracle@lunar ~]$ cd $ORACLE_HOME/sqlplus/admin
[oracle@lunar admin]$ ls
glogin.sql help libsqlplus.def plustrce.sql pupbld.sql
[oracle@lunar admin]$ tail glogin.sql
— Add any SQL*Plus commands here that are to be executed when a
— user starts SQL*Plus, or uses the SQL*Plus CONNECT command.

— USAGE
— This script is automatically run

#set pagesize 0
#set linesize 148
#SET SQLPROMPT ‘&_USER@&_CONNECT_IDENTIFIER>’

[oracle@lunar admin]$

检查环境变量:

[oracle@lunar ~]$ cat bb.env
umask 022
TMP=/tmp
TMPDIR=/tmp
export PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin

export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=bb
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/dbhome_1
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:$PATH
export LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib
export ORACLE_PATH=/home/oracle/Scripts:$ORACLE_HOME/rdbms/admin
export NLS_LANG=American_America.ZHS16GBK

alias ss=”sqlplus / as sysdba”
[oracle@lunar ~]$
检查其他影响环境变量的配置文件:
[oracle@lunar ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
[oracle@lunar ~]$

[oracle@lunar ~]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and functions
[oracle@lunar ~]$

[oracle@lunar ~]$ cat /etc/profile
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

pathmunge () {
if ! echo $PATH | /bin/egrep -q “(^|:)$1($|:)” ; then
if [ “$2” = “after” ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}

# ksh workaround
if [ -z “$EUID” -a -x /usr/bin/id ]; then
EUID=`id -u`
UID=`id -ru`
fi

# Path manipulation
if [ “$EUID” = “0” ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi

# No core files by default
ulimit -S -c 0 > /dev/null 2>&1

if [ -x /usr/bin/id ]; then
USER=”`id -un`”
LOGNAME=$USER
MAIL=”/var/spool/mail/$USER”
fi

HOSTNAME=`/bin/hostname`
HISTSIZE=1000

if [ -z “$INPUTRC” -a ! -f “$HOME/.inputrc” ]; then
INPUTRC=/etc/inputrc
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 99 ] && [ “`id -gn`” = “`id -un`” ]; then
umask 002
else
umask 022
fi

for i in /etc/profile.d/*.sh ; do
if [ -r “$i” ]; then
if [ “${-#*i}” != “$-” ]; then
. $i
else
. $i >/dev/null 2>&1
fi
fi
done

unset i
unset pathmunge
[oracle@lunar ~]$ cd /etc/profile.d
[oracle@lunar profile.d]$ ls
colorls.csh cvs.sh gnome-ssh-askpass.csh krb5-devel.sh lang.csh less.sh mpi-selector.csh vim.sh
colorls.sh glib2.csh gnome-ssh-askpass.sh krb5-workstation.csh lang.sh mc.csh mpi-selector.sh which-2.sh
cvs.csh glib2.sh krb5-devel.csh krb5-workstation.sh less.csh mc.sh vim.csh
[oracle@lunar profile.d]$

[root@lunar ~]# su – oracle
[oracle@lunar ~]$ env|grep SQLPATH
[oracle@lunar ~]$ . bb.env
[oracle@lunar ~]$ env|grep SQLPATH
[oracle@lunar ~]$

 

[oracle@lunar ~]$ ls -la
total 108
drwx—— 5 oracle oinstall 4096 Oct 10 09:13 .
drwxr-xr-x 3 root root 4096 Feb 8 2013 ..
-rw——- 1 oracle oinstall 10020 Oct 10 09:10 .bash_history
-rw-r–r– 1 oracle oinstall 33 Feb 8 2013 .bash_logout
-rw-r–r– 1 oracle oinstall 176 Feb 8 2013 .bash_profile
-rw-r–r– 1 oracle oinstall 124 Feb 8 2013 .bashrc
-rw-r–r– 1 oracle oinstall 529 Jun 23 12:20 bb.env
-rw-r–r– 1 oracle oinstall 515 Feb 8 2013 .emacs
-rw-r–r– 1 oracle oinstall 533 Jun 23 07:15 rac_dg.env
drwxr-xr-x 2 oracle oinstall 4096 Jun 19 07:08 Scripts
drwxr-xr-x 7 oracle oinstall 4096 Jun 23 12:23 test
-rw-r–r– 1 oracle oinstall 533 Jun 19 06:14 travel.env
-rw——- 1 oracle oinstall 9668 Oct 10 09:13 .viminfo
drwxr-xr-x 2 oracle oinstall 4096 Jun 23 09:29 .vnc
-rw——- 1 oracle oinstall 298 Jun 23 09:29 .Xauthority
-rw-r–r– 1 oracle oinstall 658 Feb 8 2013 .zshrc
[oracle@lunar ~]$ cat .zshrc
#
# .zshrc is sourced in interactive shells.
# It should contain commands to set up aliases,
# functions, options, key bindings, etc.
#

autoload -U compinit
compinit

#allow tab completion in the middle of a word
setopt COMPLETE_IN_WORD

## keep background processes at full speed
#setopt NOBGNICE
## restart running processes on exit
#setopt HUP

## history
#setopt APPEND_HISTORY
## for sharing history between zsh processes
#setopt INC_APPEND_HISTORY
#setopt SHARE_HISTORY

## never ever beep ever
#setopt NO_BEEP

## automatically decide when to page a list of completions
#LISTMAX=0

## disable mail checking
#MAILCHECK=0

# autoload -U colors
#colors
[oracle@lunar ~]$

 

一筹莫展中。。。。。。

 

忽然想起strace:
strace sqlplus / as sysdba 输出很多,相关的如下:

write(1, “Connected to:\n”, 14Connected to:
) = 14
write(1, “Oracle Database 11g Enterprise E”…, 77Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
) = 77
write(1, “With the Partitioning and Real A”…, 59With the Partitioning and Real Application Testing options
) = 59
write(1, “\n”, 1
) = 1 这里已经连接到oracle了,然后看它执行了什么
access(“/home/oracle/Scripts/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/u01/app/oracle/product/11.2.0.3/dbhome_1/rdbms/admin/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/home/oracle/Scripts/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/u01/app/oracle/product/11.2.0.3/dbhome_1/rdbms/admin/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/home/oracle/Scripts/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/u01/app/oracle/product/11.2.0.3/dbhome_1/rdbms/admin/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/home/oracle/Scripts/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/u01/app/oracle/product/11.2.0.3/dbhome_1/rdbms/admin/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 143360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff3317ac000
munmap(0x7ff3317ac000, 143360) = 0
stat(“login.sql”, 0x7fff82d59450) = -1 ENOENT (No such file or directory)
access(“/home/oracle/Scripts/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/u01/app/oracle/product/11.2.0.3/dbhome_1/rdbms/admin/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/home/oracle/Scripts/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
access(“/u01/app/oracle/product/11.2.0.3/dbhome_1/rdbms/admin/login.sql”, F_OK) = -1 ENOENT (No such file or directory)
brk(0x2135000) = 0x2135000
stat(“/u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql”, {st_mode=S_IFREG|0644, st_size=449, …}) = 0
access(“/u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql”, F_OK) = 0
statfs(“/u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql”, {f_type=”EXT2_SUPER_MAGIC”, f_bsize=4096, f_blocks=2666308, f_bfree=225670, f_bavail=88045, f_files=2752512, f_ffree=2535681, f_fsid={-2129888753, -1635635063}, f_namelen=255, f_frsize=4096}) = 0
open(“/u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql”, O_RDONLY) = 9
read(9, “–\n– Copyright (c) 1988, 2011, “…, 57344) = 449
read(9, “”, 57344) = 0
close(9) = 0
write(1, “SYS@bb>”, 7SYS@bb>) = 7
fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), …}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff3317ce000
read(0,
这里没有这个文件,正如上面strace的结果所示:
[oracle@lunar ~]$ cat /home/oracle/Scripts/login.sql
cat: /home/oracle/Scripts/login.sql: No such file or directory
[oracle@lunar ~]$

这里显示还是执行了/u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql,可是这个文件中唯一相关的几行我已经注释了:
[oracle@lunar ~]$ cat /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql

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

— NAME
— glogin.sql

— DESCRIPTION
— SQL*Plus global login “site profile” file

— Add any SQL*Plus commands here that are to be executed when a
— user starts SQL*Plus, or uses the SQL*Plus CONNECT command.

— USAGE
— This script is automatically run

#set pagesize 0
#set linesize 148
#SET SQLPROMPT ‘&_USER@&_CONNECT_IDENTIFIER>’

[oracle@lunar ~]$

 

怀疑是不是什么信息驻足留在某个我不知道的配置文件或者内存中了,看了下,貌似没有找到
[oracle@lunar ~]$ lsof /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql
[oracle@lunar ~]$

于是我把这个文件mv成其他文件名,看看sqlplus什么样子:
[oracle@lunar ~]$ mv /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql.bak
[oracle@lunar ~]$ ls -lrt /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql
ls: /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql: No such file or directory
[oracle@lunar ~]$ ss

SQL*Plus: Release 11.2.0.3.0 Production on Thu Oct 10 09:29:39 2013

Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning and Real Application Testing options
[oracle@lunar ~]$
可以看到这里已经正常了,那我再次move回去试试看:

[oracle@lunar ~]$ mv /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql.bak /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql
[oracle@lunar ~]$ ss

SQL*Plus: Release 11.2.0.3.0 Production on Thu Oct 10 09:30:03 2013

Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning and Real Application Testing options

SYS@bb>select * from dual;
X

SYS@bb>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning and Real Application Testing options
[oracle@lunar ~]$ cat glogin.sql
cat: glogin.sql: No such file or directory
[oracle@lunar ~]$ cat /u01/app/oracle/product/11.2.0.3/dbhome_1/sqlplus/admin/glogin.sql

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

— NAME
— glogin.sql

— DESCRIPTION
— SQL*Plus global login “site profile” file

— Add any SQL*Plus commands here that are to be executed when a
— user starts SQL*Plus, or uses the SQL*Plus CONNECT command.

— USAGE
— This script is automatically run

#set pagesize 0
#set linesize 148
#SET SQLPROMPT ‘&_USER@&_CONNECT_IDENTIFIER>’

[oracle@lunar ~]$

还是不行,一筹莫展中。。。。。。。。。。。。。。。

 

重启了主机,重启了数据库,一切未曾改变,仍然一筹莫展中。。。。。
然后我touch了一个空的glogin.sql(空白的),结果依旧
后来我在里面写入3行:
set pagesize 0
set linesize 148
SET SQLPROMPT ‘&_USER@&_CONNECT_IDENTIFIER>’

依旧不行。。。

再后来,我把pagesize设置为非零值,比如9999,问题就解决了:
SYS@bb>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning and Real Application Testing options
[oracle@lunar ~]$ ss

SQL*Plus: Release 11.2.0.3.0 Production on Thu Oct 10 10:00:11 2013

Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Partitioning and Real Application Testing options

SYS@bb>select * from dual;

DU

X

SYS@bb>

查了下文档:
SET PAGESIZE
Sets the number of lines on each page of output.
Increase PAGESIZE to avoid printing headings frequently, or set it to 0 to prevent
headings being displayed.
好玩,lunar基础知识太不扎实了,O(∩_∩)O哈哈~

 

 

 

发表在 FAQ | 留下评论

基于scn恢复ADG和ASM在rman备份恢复过程中的tuning

以下过程主要涉及如下3个问题:
1,根据SCN号“重做”ADG
2,主库是ASM数据库,使用了一半自动命名文件名的文件,和一部分手工指定文件名(别名)的文件:
——————————————————————————–
针对OMF的数据文件使用下面命令:
catalog start with ‘+DATA1/MUM/DATAFILE/’;

针对非OFM的数据文件使用下面命令:
catalog datafilecopy ‘<File-Specification>’;
——————————————————————————–

3,优化ASM的IO效率

源库:

[oracle@dm01db01 exachk221]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Mon Sep 9 17:25:17 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> col CURRENT_SCN for 9999999999999999999999999999999999999999
SQL> SELECT CURRENT_SCN FROM V$DATABASE;

CURRENT_SCN
-----------------------------------------
 12762144188510

SQL>

备库:

[oracle@oradg ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Mon Sep 9 18:13:01 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning and Automatic Storage Management options

SQL> col CURRENT_SCN for 9999999999999999999999999999999999999999
SQL> SELECT CURRENT_SCN FROM V$DATABASE;

CURRENT_SCN
-----------------------------------------
 12742479679876 ---------备库当前的SCN

SQL>

--force logging scn
SQL> col MIN(FIRST_NONLOGGED_SCN) for 9999999999999999999999999999999999999999
SQL> SELECT MIN(FIRST_NONLOGGED_SCN) FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN>0;

MIN(FIRST_NONLOGGED_SCN)
-----------------------------------------
 12216936897722 ----------备库中最早一个nologging操作的SCN(怀疑建立dg时忘记force logging)
 这个数据量其实跟做一次全备恢复,或者说重做一个完整dg的数据量差不多了
 不过,最近有些人问起基于scn的方式,因此这里用这个做个例子,就做基于这个scn的adg的恢复工作

SQL>
SQL> col FIRST_NONLOGGED_SCN for 9999999999999999999999999999999999999999
SQL> SELECT FILE#, FIRST_NONLOGGED_SCN FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN > 0;

FILE# FIRST_NONLOGGED_SCN
---------- -----------------------------------------
 5 12216939788997
 6 12216939789023
 7 12216939789049
 8 12217338487354
 9 12216939789075
 10 12216939789099
 11 12216939789126
 12 12216939789177
 13 12217031789781
 14 12217031789985
 15 12217031790205
 16 12217031790532
 17 12217031790710
 18 12217031790873
 19 12217031791015
 20 12217031791175
 21 12217031791570
 22 12217031805288
 23 12217079076408
 24 12216939788876
 25 12216939788941
 26 12216939788946
 27 12216939788972
 30 12217079092653
 55 12217079042170
 56 12217079042203
 57 12217079042209
 58 12217079042213
 71 12216939751569
 72 12216939751587
 73 12216939751602
 74 12216939751622
 75 12216939751640
 76 12216939751660
 77 12216939751680
 78 12216939751390
 79 12216939751428
 80 12216939751429
 81 12216939751435
 82 12216939751443
 83 12216939751461
 84 12216939751475
 85 12216939751509
 86 12216939751528
 87 12216939751546
 94 12217094078570
 104 12216936897722 ---------这个是最小的,下次执行应该加个order by,O(∩_∩)O哈哈~
 105 12216936897724

48 rows selected.

SQL>

查看主库force logging:

SQL> select FORCE_LOGGING from v$database;

FOR
---
NO

SQL> alter database force logging;

Database altered.

SQL> select FORCE_LOGGING from v$database;

FOR
---
YES

SQL>

查看有哪些文件含有force logging操作,以及他们的scn(下次执行,应该带上orderby,这样更清晰):
备库:
生成批量的backup命令,进行基于scn的恢复(含有force logging的都需要)

SQL> SELECT 'BACKUP INCREMENTAL FROM SCN '||FIRST_NONLOGGED_SCN||' DATAFILE '||FILE#||' FORMAT ''/tmp/ForStandby_%U'' TAG ''FORSTANDBY'';' FROM V$DATAFILE WHERE FIRST_NONLOGGED_SCN > 0;

'BACKUPINCREMENTALFROMSCN'||FIRST_NONLOGGED_SCN||'DATAFILE'||FILE#||'FORMAT''/TMP/FORSTANDBY_%U''TAG''FORSTANDBY'';'
-----------------------------------------------------------------------------------------------------------------------------------------------------
BACKUP INCREMENTAL FROM SCN 12742479679876 DATAFILE 5 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939789023 DATAFILE 6 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939789049 DATAFILE 7 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217338487354 DATAFILE 8 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939789075 DATAFILE 9 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939789099 DATAFILE 10 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939789126 DATAFILE 11 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939789177 DATAFILE 12 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031789781 DATAFILE 13 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031789985 DATAFILE 14 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031790205 DATAFILE 15 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031790532 DATAFILE 16 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031790710 DATAFILE 17 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031790873 DATAFILE 18 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031791015 DATAFILE 19 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031791175 DATAFILE 20 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031791570 DATAFILE 21 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217031805288 DATAFILE 22 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217079076408 DATAFILE 23 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939788876 DATAFILE 24 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939788941 DATAFILE 25 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939788946 DATAFILE 26 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939788972 DATAFILE 27 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217079092653 DATAFILE 30 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217079042170 DATAFILE 55 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217079042203 DATAFILE 56 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217079042209 DATAFILE 57 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217079042213 DATAFILE 58 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751569 DATAFILE 71 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751587 DATAFILE 72 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751602 DATAFILE 73 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751622 DATAFILE 74 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751640 DATAFILE 75 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751660 DATAFILE 76 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751680 DATAFILE 77 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751390 DATAFILE 78 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751428 DATAFILE 79 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751429 DATAFILE 80 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751435 DATAFILE 81 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751443 DATAFILE 82 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751461 DATAFILE 83 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751475 DATAFILE 84 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751509 DATAFILE 85 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751528 DATAFILE 86 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216939751546 DATAFILE 87 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12217094078570 DATAFILE 94 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216936897722 DATAFILE 104 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';
BACKUP INCREMENTAL FROM SCN 12216936897724 DATAFILE 105 FORMAT '/tmp/ForStandby_%U' TAG 'FORSTANDBY';

48 rows selected.

SQL>

主库,备份可以有两个方法:
1,根据上述备份命令写备份脚本
2,从最早的一个scn开始备份也可以

[oracle@dm01db01 scripts]$ cat temp.sh
#!/bin/sh

export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/dbhome_1
export ORACLE_SID=bjlunar1
export ORACLE_BASE=/u01/app/oracle
export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:.

rman target / <<EOF
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate channel prmy5 type disk;
allocate channel prmy6 type disk;
allocate channel prmy7 type disk;
allocate channel prmy8 type disk;
BACKUP INCREMENTAL FROM SCN 12216936897722 DATABASE FORMAT '/u03/ForStandby_%U' tag 'FORSTANDBY';
release channel prmy1;
release channel prmy2;
release channel prmy3;
release channel prmy4;
release channel prmy5;
release channel prmy6;
release channel prmy7;
release channel prmy8;
EXIT;
EOF

[oracle@dm01db01 scripts]$
[oracle@dm01db01 scripts]$ more nohup.out
./temp.sh: line 1: i#!/bin/sh: No such file or directory

Recovery Manager: Release 11.2.0.2.0 - Production on Mon Sep 9 17:52:31 2013

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

connected to target database: bjlunar (DBID=4088537672)

RMAN>
Starting backup at 09-SEP-13

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1715 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=1250 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=1728 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=1921 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=7 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=1253 instance=bjlunar1 device type=DISK
backup will be obsolete on date 16-SEP-13
archived logs will not be kept or backed up
RMAN-06755: WARNING: datafile 48: incremental-start SCN is too recent; using checkpoint SCN 12030111275805 instead
RMAN-06755: WARNING: datafile 50: incremental-start SCN is too recent; using checkpoint SCN 12030111275805 instead
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00037 name=+DATA_DM01/bjlunar/datafile/pension
input datafile file number=00010 name=+DATA_DM01/bjlunar/datafile/users05
input datafile file number=00014 name=+DATA_DM01/bjlunar/datafile/users09
input datafile file number=00019 name=+DATA_DM01/bjlunar/datafile/users14
input datafile file number=00024 name=+DATA_DM01/bjlunar/datafile/users19
input datafile file number=00032 name=+DATA_DM01/bjlunar/datafile/undotbs201
input datafile file number=00047 name=+DATA_DM01/bjlunar/datafile/index_ac43_ts.328.770330337
input datafile file number=00057 name=+DATA_DM01/bjlunar/datafile/ac43_data03
input datafile file number=00063 name=+DATA_DM01/bjlunar/datafile/lunar_inx01
input datafile file number=00069 name=+DATA_DM01/bjlunar/datafile/lunar_inx07
input datafile file number=00075 name=+DATA_DM01/bjlunar/datafile/lunar_data05
input datafile file number=00081 name=+DATA_DM01/bjlunar/datafile/lunar_data11
input datafile file number=00087 name=+DATA_DM01/bjlunar/datafile/lunar_data17
input datafile file number=00028 name=+DATA_DM01/bjlunar/datafile/undotbs02
input datafile file number=00034 name=+DATA_DM01/bjlunar/datafile/medicalpart1
input datafile file number=00031 name=+DATA_DM01/bjlunar/datafile/sbdata02
input datafile file number=00093 name=+DATA_DM01/bjlunar/datafile/bxjh_data01
input datafile file number=00002 name=+DATA_DM01/bjlunar/datafile/sysaux.272.764800659
input datafile file number=00098 name=+DATA_DM01/bjlunar/datafile/lr_app_lr_ts.dat
channel ORA_DISK_1: starting piece 1 at 09-SEP-13
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00049 name=+DATA_DM01/bjlunar/datafile/dbfs_bak.330.770478151
input datafile file number=00051 name=+DATA_DM01/bjlunar/datafile/pension02
input datafile file number=00060 name=+DATA_DM01/bjlunar/datafile/ac43_inx02
input datafile file number=00066 name=+DATA_DM01/bjlunar/datafile/lunar_inx04
input datafile file number=00072 name=+DATA_DM01/bjlunar/datafile/lunar_data02
input datafile file number=00078 name=+DATA_DM01/bjlunar/datafile/lunar_data08
input datafile file number=00084 name=+DATA_DM01/bjlunar/datafile/lunar_data14
input datafile file number=00090 name=+DATA_DM01/bjlunar/datafile/ac43_inx07
input datafile file number=00007 name=+DATA_DM01/bjlunar/datafile/users02
input datafile file number=00053 name=+DATA_DM01/bjlunar/datafile/index_ac43_ts03
input datafile file number=00092 name=+DATA_DM01/bjlunar/datafile/undotbs04
input datafile file number=00097 name=+DATA_DM01/bjlunar/datafile/lr_app_ls_ts.dat
input datafile file number=00101 name=+DATA_DM01/bjlunar/datafile/lr_idx_lr_ts.dat
input datafile file number=00102 name=+DATA_DM01/bjlunar/datafile/lr_annex_ts.dat
channel ORA_DISK_2: starting piece 1 at 09-SEP-13
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00005 name=+DATA_DM01/bjlunar/datafile/users.267.764800667
input datafile file number=00003 name=+DATA_DM01/bjlunar/datafile/undotbs1.271.764800661
input datafile file number=00016 name=+DATA_DM01/bjlunar/datafile/users11
input datafile file number=00021 name=+DATA_DM01/bjlunar/datafile/users16
input datafile file number=00026 name=+DATA_DM01/bjlunar/datafile/users21
input datafile file number=00038 name=+DATA_DM01/bjlunar/datafile/unemployee
input datafile file number=00050 name=+DATA_DM01/medicare02
skipping datafile 00050 because it has not changed
input datafile file number=00059 name=+DATA_DM01/bjlunar/datafile/ac43_inx01
input datafile file number=00065 name=+DATA_DM01/bjlunar/datafile/lunar_inx03
input datafile file number=00071 name=+DATA_DM01/bjlunar/datafile/lunar_data01
input datafile file number=00077 name=+DATA_DM01/bjlunar/datafile/lunar_data07
input datafile file number=00083 name=+DATA_DM01/bjlunar/datafile/lunar_data13
input datafile file number=00089 name=+DATA_DM01/bjlunar/datafile/ac43_inx06
input datafile file number=00036 name=+DATA_DM01/bjlunar/datafile/ac43_par01
input datafile file number=00033 name=+DATA_DM01/bjlunar/datafile/medical_part
input datafile file number=00094 name=+DATA_DM01/bjlunar/datafile/base_data
input datafile file number=00091 name=+DATA_DM01/bjlunar/datafile/undotbs03
input datafile file number=00096 name=+DATA_DM01/bjlunar/datafile/lr_app_la_ts.dat
input datafile file number=00100 name=+DATA_DM01/bjlunar/datafile/lr_idx_ls_ts.dat
channel ORA_DISK_3: starting piece 1 at 09-SEP-13
channel ORA_DISK_4: starting full datafile backup set
channel ORA_DISK_4: specifying datafile(s) in backup set
input datafile file number=00039 name=+DATA_DM01/bjlunar/datafile/medicare
input datafile file number=00011 name=+DATA_DM01/bjlunar/datafile/users06
input datafile file number=00015 name=+DATA_DM01/bjlunar/datafile/users10
input datafile file number=00020 name=+DATA_DM01/bjlunar/datafile/users15
input datafile file number=00025 name=+DATA_DM01/bjlunar/datafile/users20
input datafile file number=00035 name=+DATA_DM01/bjlunar/datafile/ac43_par
input datafile file number=00048 name=+DATA_DM01/index_ac43_ts_01
skipping datafile 00048 because it has not changed
input datafile file number=00058 name=+DATA_DM01/bjlunar/datafile/ac43_data04
input datafile file number=00064 name=+DATA_DM01/bjlunar/datafile/lunar_inx02
input datafile file number=00070 name=+DATA_DM01/bjlunar/datafile/lunar_inx08
input datafile file number=00076 name=+DATA_DM01/bjlunar/datafile/lunar_data06
input datafile file number=00082 name=+DATA_DM01/bjlunar/datafile/lunar_data12
input datafile file number=00088 name=+DATA_DM01/bjlunar/datafile/ac43_inx05
input datafile file number=00004 name=+DATA_DM01/bjlunar/datafile/undotbs2.259.764800671
input datafile file number=00008 name=+DATA_DM01/bjlunar/datafile/users03
input datafile file number=00054 name=+DATA_DM01/bjlunar/datafile/index_ac43_ts04
input datafile file number=00095 name=+DATA_DM01/bjlunar/datafile/lr_public_ts.dat
input datafile file number=00029 name=+DATA_DM01/bjlunar/datafile/system01
input datafile file number=00099 name=+DATA_DM01/bjlunar/datafile/lr_idx_la_ts.dat
channel ORA_DISK_4: starting piece 1 at 09-SEP-13
channel ORA_DISK_5: starting full datafile backup set
channel ORA_DISK_5: specifying datafile(s) in backup set
input datafile file number=00041 name=+DATA_DM01/bjlunar/datafile/pension01
input datafile file number=00006 name=+DATA_DM01/bjlunar/datafile/users01
input datafile file number=00012 name=+DATA_DM01/bjlunar/datafile/users07
input datafile file number=00017 name=+DATA_DM01/bjlunar/datafile/users12
input datafile file number=00022 name=+DATA_DM01/bjlunar/datafile/users17
input datafile file number=00027 name=+DATA_DM01/bjlunar/datafile/users22
input datafile file number=00043 name=+DATA_DM01/bjlunar/datafile/lunar_index_l01
input datafile file number=00055 name=+DATA_DM01/bjlunar/datafile/ac43_data01
input datafile file number=00061 name=+DATA_DM01/bjlunar/datafile/ac43_inx03
input datafile file number=00067 name=+DATA_DM01/bjlunar/datafile/lunar_inx05
input datafile file number=00073 name=+DATA_DM01/bjlunar/datafile/lunar_data03
input datafile file number=00079 name=+DATA_DM01/bjlunar/datafile/lunar_data09
input datafile file number=00085 name=+DATA_DM01/bjlunar/datafile/lunar_data15
input datafile file number=00104 name=+DATA_DM01/bjlunar/datafile/bpcm.397.802032443
input datafile file number=00040 name=+DATA_DM01/bjlunar/datafile/lunarothers
input datafile file number=00045 name=+DATA_DM01/bjlunar/datafile/lunar_index_g02
input datafile file number=00107 name=+DATA_DM01/bjlunar/datafile/udotbs5
input datafile file number=00106 name=+DATA_DM01/bjlunar/datafile/form.399.802032659
input datafile file number=00109 name=+DATA_DM01/bjlunar/datafile/system02
channel ORA_DISK_5: starting piece 1 at 09-SEP-13
channel ORA_DISK_6: starting full datafile backup set
channel ORA_DISK_6: specifying datafile(s) in backup set
input datafile file number=00042 name=+DATA_DM01/bjlunar/datafile/medicare01
input datafile file number=00009 name=+DATA_DM01/bjlunar/datafile/users04
input datafile file number=00013 name=+DATA_DM01/bjlunar/datafile/users08
input datafile file number=00018 name=+DATA_DM01/bjlunar/datafile/users13
input datafile file number=00023 name=+DATA_DM01/bjlunar/datafile/users18
input datafile file number=00030 name=+DATA_DM01/bjlunar/datafile/sbdata01
input datafile file number=00044 name=+DATA_DM01/bjlunar/datafile/lunar_index_g01
input datafile file number=00056 name=+DATA_DM01/bjlunar/datafile/ac43_data02
input datafile file number=00062 name=+DATA_DM01/bjlunar/datafile/ac43_inx04
input datafile file number=00068 name=+DATA_DM01/bjlunar/datafile/lunar_inx06
input datafile file number=00074 name=+DATA_DM01/bjlunar/datafile/lunar_data04
input datafile file number=00080 name=+DATA_DM01/bjlunar/datafile/lunar_data10
input datafile file number=00086 name=+DATA_DM01/bjlunar/datafile/lunar_data16
input datafile file number=00105 name=+DATA_DM01/bjlunar/datafile/bpcm.398.802032553
input datafile file number=00052 name=+DATA_DM01/bjlunar/datafile/index_ac43_ts_02
input datafile file number=00046 name=+DATA_DM01/bjlunar/datafile/lunar_index_l02
input datafile file number=00108 name=+DATA_DM01/bjlunar/datafile/syldgx_01.dbf
input datafile file number=00001 name=+DATA_DM01/bjlunar/datafile/system.264.764800657
input datafile file number=00103 name=+DATA_DM01/bjlunar/datafile/bxrlzydata01
channel ORA_DISK_6: starting piece 1 at 09-SEP-13
channel ORA_DISK_2: finished piece 1 at 09-SEP-13
piece handle=/u03/ForStandby_5oojeeb6_1_1 tag=FORSTANDBY comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:57:26
channel ORA_DISK_6: finished piece 1 at 09-SEP-13
piece handle=/u03/ForStandby_5sojeeb7_1_1 tag=FORSTANDBY comment=NONE
channel ORA_DISK_6: backup set complete, elapsed time: 01:00:46
channel ORA_DISK_5: finished piece 1 at 09-SEP-13
piece handle=/u03/ForStandby_5rojeeb7_1_1 tag=FORSTANDBY comment=NONE
channel ORA_DISK_5: backup set complete, elapsed time: 01:05:36
channel ORA_DISK_4: finished piece 1 at 09-SEP-13
piece handle=/u03/ForStandby_5qojeeb7_1_1 tag=FORSTANDBY comment=NONE
channel ORA_DISK_4: backup set complete, elapsed time: 01:10:16
channel ORA_DISK_3: finished piece 1 at 09-SEP-13
piece handle=/u03/ForStandby_5pojeeb7_1_1 tag=FORSTANDBY comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 01:18:36
channel ORA_DISK_1: finished piece 1 at 09-SEP-13
piece handle=/u03/ForStandby_5nojeeb6_1_1 tag=FORSTANDBY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 01:21:27

using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
backup will be obsolete on date 16-SEP-13
archived logs will not be kept or backed up
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 09-SEP-13
channel ORA_DISK_1: finished piece 1 at 09-SEP-13
piece handle=/u03/ForStandby_5tojej3u_1_1 tag=FORSTANDBY comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 09-SEP-13

RMAN>
RMAN> show all;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name bjlunar are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u03/ctsp_%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 6 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/%Udb_bak';
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 LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0.2/dbhome_1/dbs/snapcf_bjlunar1.f'; # default

RMAN>

Recovery Manager complete.
[oracle@dm01db01 scripts]$

备份比较快,大约550G左右,耗时大约1个半小时:

-rw-r----- 1 oracle asmadmin 65224884224 Sep 9 19:11 ForStandby_5oojeeb6_1_1
-rw-r----- 1 oracle asmadmin 69556887552 Sep 9 19:15 ForStandby_5sojeeb7_1_1
-rw-r----- 1 oracle asmadmin 76908052480 Sep 9 19:20 ForStandby_5rojeeb7_1_1
-rw-r----- 1 oracle asmadmin 88362360832 Sep 9 19:24 ForStandby_5qojeeb7_1_1
-rw-r----- 1 oracle asmadmin 116584480768 Sep 9 19:33 ForStandby_5pojeeb7_1_1
-rw-r----- 1 oracle asmadmin 133882372096 Sep 9 19:35 ForStandby_5nojeeb6_1_1
-rw-r----- 1 oracle asmadmin 21987328 Sep 9 19:36 ForStandby_5tojej3u_1_1
在主库生成standby controlfile:
RMAN> backup current controlfile for standby format '/tmp/stdbyctl.bkp';

Starting backup at 10-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1431 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=1333 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=780 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=672 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=769 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=1334 instance=bjlunar1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including standby control file in backup set
channel ORA_DISK_1: starting piece 1 at 10-SEP-13
channel ORA_DISK_1: finished piece 1 at 10-SEP-13
piece handle=/tmp/stdbyctl.bkp tag=TAG20130910T091011 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 10-SEP-13

Starting Control File and SPFILE Autobackup at 10-SEP-13
piece handle=/u03/ctsp_c-4088537672-20130910-00 comment=NONE
Finished Control File and SPFILE Autobackup at 10-SEP-13

RMAN>

传输到备库
sftp> get /tmp/stdbyctl.bkp
Downloading stdbyctl.bkp from /tmp/stdbyctl.bkp
 100% 21472KB 21472KB/s 00:00:01
/tmp/stdbyctl.bkp: 21987328 bytes transferred in 1 seconds (21472 KB/s)
sftp>

sftp> put stdbyctl.bkp
Uploading stdbyctl.bkp to /tmp/stdbyctl.bkp
 100% 21472KB 7157KB/s 00:00:03
C:/TEMP/stdbyctl.bkp: 21987328 bytes transferred in 3 seconds (7157 KB/s)
sftp>

检查备库的空间,使用新备份的控制文件启动standby:

Last login: Tue Sep 10 09:47:25 2013 from 10.58.160.79
[root@oradg ~]# su - oracle
[oracle@oradg ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
 536G 160G 349G 32% /
/dev/sda1 99M 23M 72M 24% /boot
tmpfs 1.8G 180M 1.6G 10% /dev/shm
none 1.8G 104K 1.8G 1% /var/lib/xenstored
10.58.160.38:/u02 7.6T 1.7T 5.8T 23% /u03
[oracle@oradg ~]$ cd /u03
[oracle@oradg u03]$ cp /tmp/stdbyctl.bkp .
[oracle@oradg u03]$

&nbsp;

[oracle@oradg u03]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Tue Sep 10 10:03:34 2013

Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning and Automatic Storage Management options

SQL> alter database mount;

Database altered.

SQL>

RMAN> catalog backuppiece '/tmp/stdbyctl.bkp';

cataloged backup piece
backup piece handle=/tmp/stdbyctl.bkp RECID=3182 STAMP=825761032

RMAN>

SQL>shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size 2228200 bytes
Variable Size 1375731736 bytes
Database Buffers 754974720 bytes
Redo Buffers 4952064 bytes
SQL>
[oracle@oradg ~]$ rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Tue Sep 10 10:05:10 2013

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

connected to target database: bjlunar (not mounted)

RMAN> restore standby controlfile from '/tmp/stdbyctl.bkp';

Starting restore at 10-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=853 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DATA_DM01/lunars/controlfile/current.373.793718513
Finished restore at 10-SEP-13

RMAN>

restore 数据文件:

RMAN> CATALOG START WITH '/u03/ForStandby';

searching for all files that match the pattern /u03/ForStandby

List of Files Unknown to the Database
=====================================
File Name: /u03/ForStandby/ForStandby_5pojeeb7_1_1
File Name: /u03/ForStandby/ForStandby_5tojej3u_1_1
File Name: /u03/ForStandby/ForStandby_5nojeeb6_1_1
File Name: /u03/ForStandby/ForStandby_5qojeeb7_1_1
File Name: /u03/ForStandby/ForStandby_5rojeeb7_1_1
File Name: /u03/ForStandby/ForStandby_5sojeeb7_1_1

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u03/ForStandby/ForStandby_5pojeeb7_1_1
File Name: /u03/ForStandby/ForStandby_5tojej3u_1_1
File Name: /u03/ForStandby/ForStandby_5nojeeb6_1_1
File Name: /u03/ForStandby/ForStandby_5qojeeb7_1_1
File Name: /u03/ForStandby/ForStandby_5rojeeb7_1_1
File Name: /u03/ForStandby/ForStandby_5sojeeb7_1_1

RMAN>

SQL> select name from v$datafile;

NAME
----------------------------------------------------------------------------------------------------
+DATA_DM01/lunars/datafile/system.264.764800657
+DATA_DM01/lunars/datafile/sysaux.272.764800659
+DATA_DM01/lunars/datafile/undotbs1.271.764800661
+DATA_DM01/lunars/datafile/undotbs2.259.764800671
+DATA_DM01/lunars/datafile/users.267.764800667
+DATA_DM01/lunars/datafile/users01
+DATA_DM01/lunars/datafile/users02
+DATA_DM01/lunars/datafile/users03
+DATA_DM01/lunars/datafile/users04
+DATA_DM01/lunars/datafile/users05
+DATA_DM01/lunars/datafile/users06
+DATA_DM01/lunars/datafile/users07
+DATA_DM01/lunars/datafile/users08
+DATA_DM01/lunars/datafile/users09
+DATA_DM01/lunars/datafile/users10
+DATA_DM01/lunars/datafile/users11
+DATA_DM01/lunars/datafile/users12
+DATA_DM01/lunars/datafile/users13
+DATA_DM01/lunars/datafile/users14
+DATA_DM01/lunars/datafile/users15
+DATA_DM01/lunars/datafile/users16
+DATA_DM01/lunars/datafile/users17
+DATA_DM01/lunars/datafile/users18
+DATA_DM01/lunars/datafile/users19
+DATA_DM01/lunars/datafile/users20
+DATA_DM01/lunars/datafile/users21
+DATA_DM01/lunars/datafile/users22
+DATA_DM01/lunars/datafile/undotbs02
+DATA_DM01/lunars/datafile/system01
+DATA_DM01/lunars/datafile/sbdata01
+DATA_DM01/lunars/datafile/sbdata02
+DATA_DM01/lunars/datafile/undotbs201
+DATA_DM01/lunars/datafile/medical_part
+DATA_DM01/lunars/datafile/medicalpart1
+DATA_DM01/lunars/datafile/ac43_par
+DATA_DM01/lunars/datafile/ac43_par01
+DATA_DM01/lunars/datafile/pension
+DATA_DM01/lunars/datafile/unemployee
+DATA_DM01/lunars/datafile/medicare
+DATA_DM01/lunars/datafile/lunarothers
+DATA_DM01/lunars/datafile/pension01
+DATA_DM01/lunars/datafile/medicare01
+DATA_DM01/lunars/datafile/lunar_index_l01
+DATA_DM01/lunars/datafile/lunar_index_g01
+DATA_DM01/lunars/datafile/lunar_index_g02
+DATA_DM01/lunars/datafile/lunar_index_l02
+DATA_DM01/lunars/datafile/index_ac43_ts.328.770330337
+DATA_DM01/index_ac43_ts_01
+DATA_DM01/lunars/datafile/dbfs_bak.330.770478151
+DATA_DM01/medicare02
+DATA_DM01/lunars/datafile/pension02
+DATA_DM01/lunars/datafile/index_ac43_ts_02
+DATA_DM01/lunars/datafile/index_ac43_ts03
+DATA_DM01/lunars/datafile/index_ac43_ts04
+DATA_DM01/lunars/datafile/ac43_data01
+DATA_DM01/lunars/datafile/ac43_data02
+DATA_DM01/lunars/datafile/ac43_data03
+DATA_DM01/lunars/datafile/ac43_data04
+DATA_DM01/lunars/datafile/ac43_inx01
+DATA_DM01/lunars/datafile/ac43_inx02
+DATA_DM01/lunars/datafile/ac43_inx03
+DATA_DM01/lunars/datafile/ac43_inx04
+DATA_DM01/lunars/datafile/lunar_inx01
+DATA_DM01/lunars/datafile/lunar_inx02
+DATA_DM01/lunars/datafile/lunar_inx03
+DATA_DM01/lunars/datafile/lunar_inx04
+DATA_DM01/lunars/datafile/lunar_inx05
+DATA_DM01/lunars/datafile/lunar_inx06
+DATA_DM01/lunars/datafile/lunar_inx07
+DATA_DM01/lunars/datafile/lunar_inx08
+DATA_DM01/lunars/datafile/lunar_data01
+DATA_DM01/lunars/datafile/lunar_data02
+DATA_DM01/lunars/datafile/lunar_data03
+DATA_DM01/lunars/datafile/lunar_data04
+DATA_DM01/lunars/datafile/lunar_data05
+DATA_DM01/lunars/datafile/lunar_data06
+DATA_DM01/lunars/datafile/lunar_data07
+DATA_DM01/lunars/datafile/lunar_data08
+DATA_DM01/lunars/datafile/lunar_data09
+DATA_DM01/lunars/datafile/lunar_data10
+DATA_DM01/lunars/datafile/lunar_data11
+DATA_DM01/lunars/datafile/lunar_data12
+DATA_DM01/lunars/datafile/lunar_data13
+DATA_DM01/lunars/datafile/lunar_data14
+DATA_DM01/lunars/datafile/lunar_data15
+DATA_DM01/lunars/datafile/lunar_data16
+DATA_DM01/lunars/datafile/lunar_data17
+DATA_DM01/lunars/datafile/ac43_inx05
+DATA_DM01/lunars/datafile/ac43_inx06
+DATA_DM01/lunars/datafile/ac43_inx07
+DATA_DM01/lunars/datafile/undotbs03
+DATA_DM01/lunars/datafile/undotbs04
+DATA_DM01/lunars/datafile/bxjh_data01
+DATA_DM01/lunars/datafile/base_data
+DATA_DM01/lunars/datafile/lr_public_ts.dat
+DATA_DM01/lunars/datafile/lr_app_la_ts.dat
+DATA_DM01/lunars/datafile/lr_app_ls_ts.dat
+DATA_DM01/lunars/datafile/lr_app_lr_ts.dat
+DATA_DM01/lunars/datafile/lr_idx_la_ts.dat
+DATA_DM01/lunars/datafile/lr_idx_ls_ts.dat
+DATA_DM01/lunars/datafile/lr_idx_lr_ts.dat
+DATA_DM01/lunars/datafile/lr_annex_ts.dat
+DATA_DM01/lunars/datafile/bxrlzydata01
+DATA_DM01/lunars/datafile/bpcm.397.802032443
+DATA_DM01/lunars/datafile/bpcm.398.802032553
+DATA_DM01/lunars/datafile/form.399.802032659
+DATA_DM01/lunars/datafile/udotbs5
+DATA_DM01/lunars/datafile/syldgx_01.dbf
+DATA_DM01/lunars/datafile/system02

109 rows selected.

SQL>
RMAN> catalog start with '+DATA_DM01/lunars/datafile/';

searching for all files that match the pattern +DATA_DM01/lunars/datafile/

List of Files Unknown to the Database
=====================================
File Name: +data_dm01/lunars/datafile/DBFS_BAK.374.793719745
File Name: +data_dm01/lunars/datafile/PENSION_TABLESPACE.333.793719745
File Name: +data_dm01/lunars/datafile/MEDICARE_TABLESPACE.334.793719745
File Name: +data_dm01/lunars/datafile/USERS.337.793720931
File Name: +data_dm01/lunars/datafile/UNDOTBS1.338.793720931
File Name: +data_dm01/lunars/datafile/AC43_PAR.389.793728721
File Name: +data_dm01/lunars/datafile/UNEMPLOYEE_TABLESPACE.390.793729197
File Name: +data_dm01/lunars/datafile/INDEX_AC43_TS.377.793729989
File Name: +data_dm01/lunars/datafile/UNDOTBS2.425.793742003
File Name: +data_dm01/lunars/datafile/MEDICAL_PARTITION.429.793742873
File Name: +data_dm01/lunars/datafile/lunarOTHERS_TABLESPACE.431.793743417
File Name: +data_dm01/lunars/datafile/SYSAUX.446.793745257
File Name: +data_dm01/lunars/datafile/SYSTEM.448.793745389
File Name: +data_dm01/lunars/datafile/BPCM.361.802046773
File Name: +data_dm01/lunars/datafile/BPCM.362.802046921
File Name: +data_dm01/lunars/datafile/FORM.363.802046993

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +data_dm01/lunars/datafile/DBFS_BAK.374.793719745
File Name: +data_dm01/lunars/datafile/PENSION_TABLESPACE.333.793719745
File Name: +data_dm01/lunars/datafile/MEDICARE_TABLESPACE.334.793719745
File Name: +data_dm01/lunars/datafile/USERS.337.793720931
File Name: +data_dm01/lunars/datafile/UNDOTBS1.338.793720931
File Name: +data_dm01/lunars/datafile/AC43_PAR.389.793728721
File Name: +data_dm01/lunars/datafile/UNEMPLOYEE_TABLESPACE.390.793729197
File Name: +data_dm01/lunars/datafile/INDEX_AC43_TS.377.793729989
File Name: +data_dm01/lunars/datafile/UNDOTBS2.425.793742003
File Name: +data_dm01/lunars/datafile/MEDICAL_PARTITION.429.793742873
File Name: +data_dm01/lunars/datafile/lunarOTHERS_TABLESPACE.431.793743417
File Name: +data_dm01/lunars/datafile/SYSAUX.446.793745257
File Name: +data_dm01/lunars/datafile/SYSTEM.448.793745389
File Name: +data_dm01/lunars/datafile/BPCM.361.802046773
File Name: +data_dm01/lunars/datafile/BPCM.362.802046921
File Name: +data_dm01/lunars/datafile/FORM.363.802046993

RMAN>

catalog datafilecopy '+DATA_DM01/lunars/datafile/users01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users03';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users04';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users05';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users06';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users07';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users08';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users09';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users10';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users11';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users12';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users13';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users14';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users15';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users16';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users17';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users18';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users19';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users20';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users21';
catalog datafilecopy '+DATA_DM01/lunars/datafile/users22';
catalog datafilecopy '+DATA_DM01/lunars/datafile/undotbs02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/system01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/sbdata01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/sbdata02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/undotbs201';
catalog datafilecopy '+DATA_DM01/lunars/datafile/medical_part';
catalog datafilecopy '+DATA_DM01/lunars/datafile/medicalpart1';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_par';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_par01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/pension';
catalog datafilecopy '+DATA_DM01/lunars/datafile/unemployee';
catalog datafilecopy '+DATA_DM01/lunars/datafile/medicare';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunarothers';
catalog datafilecopy '+DATA_DM01/lunars/datafile/pension01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/medicare01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_index_l01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_index_g01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_index_g02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_index_l02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/pension02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/index_ac43_ts_02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/index_ac43_ts03';
catalog datafilecopy '+DATA_DM01/lunars/datafile/index_ac43_ts04';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_data01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_data02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_data03';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_data04';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx03';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx04';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx03';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx04';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx05';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx06';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx07';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_inx08';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data02';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data03';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data04';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data05';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data06';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data07';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data08';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data09';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data10';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data11';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data12';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data13';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data14';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data15';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data16';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lunar_data17';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx05';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx06';
catalog datafilecopy '+DATA_DM01/lunars/datafile/ac43_inx07';
catalog datafilecopy '+DATA_DM01/lunars/datafile/undotbs03';
catalog datafilecopy '+DATA_DM01/lunars/datafile/undotbs04';
catalog datafilecopy '+DATA_DM01/lunars/datafile/bxjh_data01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/base_data';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_public_ts.dat';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_app_la_ts.dat';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_app_ls_ts.dat';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_app_lr_ts.dat';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_idx_la_ts.dat';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_idx_ls_ts.dat';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_idx_lr_ts.dat';
catalog datafilecopy '+DATA_DM01/lunars/datafile/lr_annex_ts.dat';
catalog datafilecopy '+DATA_DM01/lunars/datafile/bxrlzydata01';
catalog datafilecopy '+DATA_DM01/lunars/datafile/udotbs5';
catalog datafilecopy '+DATA_DM01/lunars/datafile/syldgx_01.dbf';
有两个文件有问题,需要重新备份(后来根据时间等信息判断,这两个文件时我昨晚开始做备份后,他们新增加的文件,因此没有包含在昨晚的备份集):
RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of catalog command on default channel at 09/10/2013 10:44:50
ORA-19625: error identifying file +DATA_DM01/lunars/datafile/udotbs5
ORA-17503: ksfdopn:2 Failed to open file +DATA_DM01/lunars/datafile/udotbs5
ORA-15173: entry 'udotbs5' does not exist in directory 'datafile'

RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of catalog command on default channel at 09/10/2013 10:44:50
ORA-19625: error identifying file +DATA_DM01/lunars/datafile/syldgx_01.dbf
ORA-17503: ksfdopn:2 Failed to open file +DATA_DM01/lunars/datafile/syldgx_01.dbf
ORA-15173: entry 'syldgx_01.dbf' does not exist in directory 'datafile'

RMAN>

SQL> select * from v$datafile where name in ('+DATA_DM01/lunars/datafile/udotbs5','+DATA_DM01/lunars/datafile/syldgx_01.dbf');

FILE# CREATION_CHANGE# CREATION_TIM TS# RFILE# STATUS ENABLED CHECKPOINT_CHANGE# CHECKPOINT_T UNRECOVERABLE_CHANGE# UNRECOVERABL
---------- ---------------- ------------ ---------- ---------- ------- ---------- ------------------ ------------ --------------------- ------------
LAST_CHANGE# LAST_TIME OFFLINE_CHANGE# ONLINE_CHANGE# ONLINE_TIME BYTES BLOCKS CREATE_BYTES BLOCK_SIZE
------------ ------------ --------------- -------------- ------------ ---------- ---------- ------------ ----------
NAME PLUGGED_IN BLOCK1_OFFSET
---------------------------------------------------------------------------------------------------- ---------- -------------
AUX_NAME
-----------------------------------------------------------------------------------------------------------------------------------------------------
FIRST_NONLOGGED_SCN FIRST_NONLOG FOREIGN_DBID FOREIGN_CREATION_CHANGE# FOREIGN_CREA PLU PLUGIN_CHANGE# PLUGIN_RESETLOGS_CHANGE# PLUGIN_RESET
------------------- ------------ ------------ ------------------------ ------------ --- -------------- ------------------------ ------------
 107 1.2743E+13 13-MAY-13 2 107 ONLINE READ WRITE 1.2762E+13 09-SEP-13 0
 0 0 0 0 1.0737E+10 8192
+DATA_DM01/lunars/datafile/udotbs5 0 4294967295
NONE
 0 0 0 NO 0 0

108 1.2744E+13 15-JUL-13 65 108 ONLINE READ WRITE 1.2762E+13 09-SEP-13 0
 0 0 0 0 1.0737E+10 8192
+DATA_DM01/lunars/datafile/syldgx_01.dbf 0 4294967295
NONE
 0 0 0 NO 0 0
SQL>

&nbsp;
SQL> set linesize 149
SQL> set pages 999
SQL> /

FILE# CREATION_CHANGE# CREATION_TIM TS# RFILE# STATUS ENABLED CHECKPOINT_CHANGE# CHECKPOINT_T UNRECOVERABLE_CHANGE# UNRECOVERABL
---------- ---------------- ------------ ---------- ---------- ------- ---------- ------------------ ------------ --------------------- ------------
LAST_CHANGE# LAST_TIME OFFLINE_CHANGE# ONLINE_CHANGE# ONLINE_TIME BYTES BLOCKS CREATE_BYTES BLOCK_SIZE
------------ ------------ --------------- -------------- ------------ ---------- ---------- ------------ ----------
NAME
-----------------------------------------------------------------------------------------------------------------------------------------------------
PLUGGED_IN BLOCK1_OFFSET
---------- -------------
AUX_NAME
-----------------------------------------------------------------------------------------------------------------------------------------------------
FIRST_NONLOGGED_SCN FIRST_NONLOG FOREIGN_DBID FOREIGN_CREATION_CHANGE# FOREIGN_CREA PLU PLUGIN_CHANGE# PLUGIN_RESETLOGS_CHANGE# PLUGIN_RESET
------------------- ------------ ------------ ------------------------ ------------ --- -------------- ------------------------ ------------
 109 1.2752E+13 09-AUG-13 0 109 SYSTEM READ WRITE 1.2762E+13 09-SEP-13 0
 0 0 1073741824 131072 1073741824 8192
+DATA_DM01/bjlunar/datafile/system02
 0 4294967295
NONE
 0 0 0 NO 0 0
SQL>

总共新增加了3个文件,重新备份这3个文件即可:

[oracle@dm01db01 scripts]$ ./temp.sh
./temp.sh: line 1: i#!/bin/sh: No such file or directory

Recovery Manager: Release 11.2.0.2.0 - Production on Tue Sep 10 10:30:29 2013

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

connected to target database: bjlunar (DBID=4088537672)

RMAN>
Starting backup at 10-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1432 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=105 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=201 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=293 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=675 instance=bjlunar1 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=872 instance=bjlunar1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00107 name=+DATA_DM01/bjlunar/datafile/udotbs5
channel ORA_DISK_1: starting piece 1 at 10-SEP-13
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00108 name=+DATA_DM01/bjlunar/datafile/syldgx_01.dbf
channel ORA_DISK_2: starting piece 1 at 10-SEP-13
channel ORA_DISK_3: starting full datafile backup set
channel ORA_DISK_3: specifying datafile(s) in backup set
input datafile file number=00109 name=+DATA_DM01/bjlunar/datafile/system02
channel ORA_DISK_3: starting piece 1 at 10-SEP-13
channel ORA_DISK_3: finished piece 1 at 10-SEP-13
piece handle=/u03/datafile_62ojg8q8_1_1 tag=DF comment=NONE
channel ORA_DISK_3: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_2: finished piece 1 at 10-SEP-13
piece handle=/u03/datafile_61ojg8q8_1_1 tag=DF comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: finished piece 1 at 10-SEP-13
piece handle=/u03/datafile_60ojg8q8_1_1 tag=DF comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 10-SEP-13

Starting Control File and SPFILE Autobackup at 10-SEP-13
piece handle=/u03/ctsp_c-4088537672-20130910-01 comment=NONE
Finished Control File and SPFILE Autobackup at 10-SEP-13

RMAN>

Recovery Manager complete.
[oracle@dm01db01 scripts]$

[oracle@dm01db01 u03]$ ls -lrt /u03/datafile*
-rw-r----- 1 oracle asmadmin 5144576 Sep 10 2013 /u03/datafile_62ojg8q8_1_1
-rw-r----- 1 oracle asmadmin 45178880 Sep 10 2013 /u03/datafile_61ojg8q8_1_1
-rw-r----- 1 oracle asmadmin 190144512 Sep 10 2013 /u03/datafile_60ojg8q8_1_1
[oracle@dm01db01 u03]$

catalog backuppiece '/u03/datafile_62ojg8q8_1_1';
catalog backuppiece '/u03/datafile_61ojg8q8_1_1';
catalog backuppiece '/u03/datafile_60ojg8q8_1_1';

RMAN> restore datafile 107,108,109;

Starting restore at 10-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=853 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=1141 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=1991 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=3 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=289 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=574 device type=DISK

skipping datafile 108; already restored to file +DATA_DM01/lunars/datafile/syldgx_01.dbf
skipping datafile 109; already restored to file +DATA_DM01/lunars/datafile/system02
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00107 to +DATA_DM01/lunars/datafile/udotbs5
channel ORA_DISK_1: reading from backup piece /u03/datafile_60ojg8q8_1_1
channel ORA_DISK_1: piece handle=/u03/datafile_60ojg8q8_1_1 tag=DF
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 10-SEP-13

RMAN>

现有ASM的文件信息如下:


可以看见,一部分是系统定义的文件名,一部分使用了别名,后面会针对这两个种情况分别处理一下:
1
ASMCMD> ls -l
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_DATA.368.793731515
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_DATA.369.793732151
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_DATA.370.793732783
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_DATA.371.793732783
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.372.793732783
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.393.793733313
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.394.793733891
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.395.793733893
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.421.793740913
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.422.793741589
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_INX.423.793741589
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_PAR.389.793728721
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y AC43_PAR.426.793742681
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y BASE.441.793744845
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y BPCM.361.802046773
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y BPCM.362.802046921
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunarOTHERS_TABLESPACE.431.793743417
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.404.793736097
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.405.793736561
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.406.793737193
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.407.793737193
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.408.793737195
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.409.793737659
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.410.793738289
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.411.793738291
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.412.793738291
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.413.793738745
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.414.793739389
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.415.793739389
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.416.793739391
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.417.793739835
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.418.793740489
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.419.793740489
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_DATA.420.793740491
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INDEX_GLOBAL.392.793729979
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INDEX_GLOBAL.436.793744213
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INDEX_LOCAL.391.793729977
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INDEX_LOCAL.437.793744315
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.396.793733893
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.397.793734387
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.398.793734997
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.399.793734997
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.400.793734997
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.401.793735473
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.402.793736095
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y lunar_INX.403.793736095
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y BXJH_DATA.440.793744677
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y BXRLZYDATA.469.795147351
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y DBFS_BAK.374.793719745
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y FORM.363.802046993
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y INDEX_AC43_TS.349.793730593
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y INDEX_AC43_TS.377.793729989
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y INDEX_AC43_TS.432.793743487
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y INDEX_AC43_TS.433.793743601
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y INDEX_AC43_TS.434.793744149
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_ANNEX_TS.452.793745441
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_APP_LA_TS.443.793744957
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_APP_LR_TS.445.793745207
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_APP_LS_TS.444.793745039
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_IDX_LA_TS.449.793745391
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_IDX_LR_TS.451.793745439
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_IDX_LS_TS.450.793745439
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y LR_PUBLIC_TS.442.793744895
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICAL_PARTITION.429.793742873
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICAL_PARTITION.430.793743413
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICARE_TABLESPACE.334.793719745
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICARE_TABLESPACE.336.793720929
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y MEDICARE_TABLESPACE.366.793731459
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y PENSION_TABLESPACE.333.793719745
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y PENSION_TABLESPACE.335.793719745
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y PENSION_TABLESPACE.367.793731469
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SBDATA.387.793728719
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SBDATA.435.793744151
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SYLDGXNW.315.825765561
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y SYSAUX.446.793745257
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SYSTEM.317.825765561
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y SYSTEM.447.793745307
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y SYSTEM.448.793745389
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS1.316.825765669
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y UNDOTBS1.338.793720931
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS1.424.793741591
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS1.438.793744525
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS1.439.793744585
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNDOTBS2.388.793728719
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y UNDOTBS2.425.793742003
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y UNEMPLOYEE_TABLESPACE.390.793729197
DATAFILE UNPROT COARSE SEP 10 10:00:00 Y USERS.337.793720931
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.339.793722107
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.340.793722107
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.341.793722107
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.342.793723209
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.343.793723211
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.344.793723213
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.345.793724313
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.346.793724315
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.347.793724315
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.348.793725415
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.375.793725415
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.378.793725423
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.379.793726523
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.380.793726523
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.381.793726525
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.382.793726999
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.383.793727621
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.384.793727621
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.385.793727621
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.386.793728097
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.427.793742681
DATAFILE UNPROT COARSE SEP 10 11:00:00 Y USERS.428.793742685
 N ac43_data01 => +DATA_DM01/lunars/datafile/AC43_DATA.368.793731515
 N ac43_data02 => +DATA_DM01/lunars/datafile/AC43_DATA.369.793732151
 N ac43_data03 => +DATA_DM01/lunars/datafile/AC43_DATA.370.793732783
 N ac43_data04 => +DATA_DM01/lunars/datafile/AC43_DATA.371.793732783
 N ac43_inx01 => +DATA_DM01/lunars/datafile/AC43_INX.372.793732783
 N ac43_inx02 => +DATA_DM01/lunars/datafile/AC43_INX.393.793733313
 N ac43_inx03 => +DATA_DM01/lunars/datafile/AC43_INX.394.793733891
 N ac43_inx04 => +DATA_DM01/lunars/datafile/AC43_INX.395.793733893
 N ac43_inx05 => +DATA_DM01/lunars/datafile/AC43_INX.421.793740913
 N ac43_inx06 => +DATA_DM01/lunars/datafile/AC43_INX.422.793741589
 N ac43_inx07 => +DATA_DM01/lunars/datafile/AC43_INX.423.793741589
 N ac43_par => +DATA_DM01/lunars/datafile/AC43_PAR.389.793728721
 N ac43_par01 => +DATA_DM01/lunars/datafile/AC43_PAR.426.793742681
 N base_data => +DATA_DM01/lunars/datafile/BASE.441.793744845
 N lunar_data01 => +DATA_DM01/lunars/datafile/lunar_DATA.404.793736097
 N lunar_data02 => +DATA_DM01/lunars/datafile/lunar_DATA.405.793736561
 N lunar_data03 => +DATA_DM01/lunars/datafile/lunar_DATA.406.793737193
 N lunar_data04 => +DATA_DM01/lunars/datafile/lunar_DATA.407.793737193
 N lunar_data05 => +DATA_DM01/lunars/datafile/lunar_DATA.408.793737195
 N lunar_data06 => +DATA_DM01/lunars/datafile/lunar_DATA.409.793737659
 N lunar_data07 => +DATA_DM01/lunars/datafile/lunar_DATA.410.793738289
 N lunar_data08 => +DATA_DM01/lunars/datafile/lunar_DATA.411.793738291
 N lunar_data09 => +DATA_DM01/lunars/datafile/lunar_DATA.412.793738291
 N lunar_data10 => +DATA_DM01/lunars/datafile/lunar_DATA.413.793738745
 N lunar_data11 => +DATA_DM01/lunars/datafile/lunar_DATA.414.793739389
 N lunar_data12 => +DATA_DM01/lunars/datafile/lunar_DATA.415.793739389
 N lunar_data13 => +DATA_DM01/lunars/datafile/lunar_DATA.416.793739391
 N lunar_data14 => +DATA_DM01/lunars/datafile/lunar_DATA.417.793739835
 N lunar_data15 => +DATA_DM01/lunars/datafile/lunar_DATA.418.793740489
 N lunar_data16 => +DATA_DM01/lunars/datafile/lunar_DATA.419.793740489
 N lunar_data17 => +DATA_DM01/lunars/datafile/lunar_DATA.420.793740491
 N lunar_index_g01 => +DATA_DM01/lunars/datafile/lunar_INDEX_GLOBAL.392.793729979
 N lunar_index_g02 => +DATA_DM01/lunars/datafile/lunar_INDEX_GLOBAL.436.793744213
 N lunar_index_l01 => +DATA_DM01/lunars/datafile/lunar_INDEX_LOCAL.391.793729977
 N lunar_index_l02 => +DATA_DM01/lunars/datafile/lunar_INDEX_LOCAL.437.793744315
 N lunar_inx01 => +DATA_DM01/lunars/datafile/lunar_INX.396.793733893
 N lunar_inx02 => +DATA_DM01/lunars/datafile/lunar_INX.397.793734387
 N lunar_inx03 => +DATA_DM01/lunars/datafile/lunar_INX.398.793734997
 N lunar_inx04 => +DATA_DM01/lunars/datafile/lunar_INX.399.793734997
 N lunar_inx05 => +DATA_DM01/lunars/datafile/lunar_INX.400.793734997
 N lunar_inx06 => +DATA_DM01/lunars/datafile/lunar_INX.401.793735473
 N lunar_inx07 => +DATA_DM01/lunars/datafile/lunar_INX.402.793736095
 N lunar_inx08 => +DATA_DM01/lunars/datafile/lunar_INX.403.793736095
 N lunarothers => +DATA_DM01/lunars/datafile/lunarOTHERS_TABLESPACE.431.793743417
 N bxjh_data01 => +DATA_DM01/lunars/datafile/BXJH_DATA.440.793744677
 N bxrlzydata01 => +DATA_DM01/lunars/datafile/BXRLZYDATA.469.795147351
 N index_ac43_ts03 => +DATA_DM01/lunars/datafile/INDEX_AC43_TS.433.793743601
 N index_ac43_ts04 => +DATA_DM01/lunars/datafile/INDEX_AC43_TS.434.793744149
 N index_ac43_ts_02 => +DATA_DM01/lunars/datafile/INDEX_AC43_TS.432.793743487
 N lr_annex_ts.dat => +DATA_DM01/lunars/datafile/LR_ANNEX_TS.452.793745441
 N lr_app_la_ts.dat => +DATA_DM01/lunars/datafile/LR_APP_LA_TS.443.793744957
 N lr_app_lr_ts.dat => +DATA_DM01/lunars/datafile/LR_APP_LR_TS.445.793745207
 N lr_app_ls_ts.dat => +DATA_DM01/lunars/datafile/LR_APP_LS_TS.444.793745039
 N lr_idx_la_ts.dat => +DATA_DM01/lunars/datafile/LR_IDX_LA_TS.449.793745391
 N lr_idx_lr_ts.dat => +DATA_DM01/lunars/datafile/LR_IDX_LR_TS.451.793745439
 N lr_idx_ls_ts.dat => +DATA_DM01/lunars/datafile/LR_IDX_LS_TS.450.793745439
 N lr_public_ts.dat => +DATA_DM01/lunars/datafile/LR_PUBLIC_TS.442.793744895
 N lr_temp_ts.dat => +DATA_DM01/lunars/TEMPFILE/LR_TEMP_TS.360.801788791
 N medical_part => +DATA_DM01/lunars/datafile/MEDICAL_PARTITION.429.793742873
 N medicalpart1 => +DATA_DM01/lunars/datafile/MEDICAL_PARTITION.430.793743413
 N medicare => +DATA_DM01/lunars/datafile/MEDICARE_TABLESPACE.334.793719745
 N medicare01 => +DATA_DM01/lunars/datafile/MEDICARE_TABLESPACE.336.793720929
 N pension => +DATA_DM01/lunars/datafile/PENSION_TABLESPACE.333.793719745
 N pension01 => +DATA_DM01/lunars/datafile/PENSION_TABLESPACE.335.793719745
 N pension02 => +DATA_DM01/lunars/datafile/PENSION_TABLESPACE.367.793731469
 N sbdata01 => +DATA_DM01/lunars/datafile/SBDATA.387.793728719
 N sbdata02 => +DATA_DM01/lunars/datafile/SBDATA.435.793744151
 N syldgx_01.dbf => +DATA_DM01/lunars/datafile/SYLDGXNW.315.825765561
 N system01 => +DATA_DM01/lunars/datafile/SYSTEM.447.793745307
 N system02 => +DATA_DM01/lunars/datafile/SYSTEM.317.825765561
 N udotbs5 => +DATA_DM01/lunars/datafile/UNDOTBS1.316.825765669
 N undotbs02 => +DATA_DM01/lunars/datafile/UNDOTBS1.424.793741591
 N undotbs03 => +DATA_DM01/lunars/datafile/UNDOTBS1.438.793744525
 N undotbs04 => +DATA_DM01/lunars/datafile/UNDOTBS1.439.793744585
 N undotbs201 => +DATA_DM01/lunars/datafile/UNDOTBS2.388.793728719
 N unemployee => +DATA_DM01/lunars/datafile/UNEMPLOYEE_TABLESPACE.390.793729197
 N users01 => +DATA_DM01/lunars/datafile/USERS.339.793722107
 N users02 => +DATA_DM01/lunars/datafile/USERS.427.793742681
 N users03 => +DATA_DM01/lunars/datafile/USERS.428.793742685
 N users04 => +DATA_DM01/lunars/datafile/USERS.340.793722107
 N users05 => +DATA_DM01/lunars/datafile/USERS.341.793722107
 N users06 => +DATA_DM01/lunars/datafile/USERS.342.793723209
 N users07 => +DATA_DM01/lunars/datafile/USERS.343.793723211
 N users08 => +DATA_DM01/lunars/datafile/USERS.344.793723213
 N users09 => +DATA_DM01/lunars/datafile/USERS.345.793724313
 N users10 => +DATA_DM01/lunars/datafile/USERS.346.793724315
 N users11 => +DATA_DM01/lunars/datafile/USERS.347.793724315
 N users12 => +DATA_DM01/lunars/datafile/USERS.348.793725415
 N users13 => +DATA_DM01/lunars/datafile/USERS.375.793725415
 N users14 => +DATA_DM01/lunars/datafile/USERS.378.793725423
 N users15 => +DATA_DM01/lunars/datafile/USERS.379.793726523
 N users16 => +DATA_DM01/lunars/datafile/USERS.380.793726523
 N users17 => +DATA_DM01/lunars/datafile/USERS.381.793726525
 N users18 => +DATA_DM01/lunars/datafile/USERS.382.793726999
 N users19 => +DATA_DM01/lunars/datafile/USERS.383.793727621
 N users20 => +DATA_DM01/lunars/datafile/USERS.384.793727621
 N users21 => +DATA_DM01/lunars/datafile/USERS.385.793727621
 N users22 => +DATA_DM01/lunars/datafile/USERS.386.793728097
ASMCMD>
先把最新创建的3个文件还原出来:
RMAN> restore datafile 107,108,109;

Starting restore at 10-SEP-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1991 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=1710 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=1993 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=4 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=289 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=574 device type=DISK

datafile 107 is already restored to file +DATA_DM01/lunars/datafile/udotbs5
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00109 to +DATA_DM01/lunars/datafile/system02
channel ORA_DISK_1: reading from backup piece /u03/datafile_62ojg8q8_1_1
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00108 to +DATA_DM01/lunars/datafile/syldgx_01.dbf
channel ORA_DISK_2: reading from backup piece /u03/datafile_61ojg8q8_1_1
channel ORA_DISK_1: piece handle=/u03/datafile_62ojg8q8_1_1 tag=DF
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_2: piece handle=/u03/datafile_61ojg8q8_1_1 tag=DF
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:45
Finished restore at 10-SEP-13

RMAN>

有两个错误,这个是因为上面操作时没有注意到数据库中有2个offline的数据文件,下次操作记得备份时把offline的文件不要备份就好了。。。。。。

RMAN> catalog datafilecopy '+DATA_DM01/lunars/datafile/system02';

cataloged datafile copy
datafile copy file name=+DATA_DM01/lunars/datafile/system02 RECID=123 STAMP=825767730

RMAN> catalog datafilecopy '+DATA_DM01/lunars/datafile/syldgx_01.dbf';

cataloged datafile copy
datafile copy file name=+DATA_DM01/lunars/datafile/syldgx_01.dbf RECID=124 STAMP=825767734

RMAN>

RMAN> switch database to copy;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of switch to copy command at 09/10/2013 11:55:59
RMAN-06571: datafile 48 does not have recoverable copy

RMAN> catalog datafilecopy '+DATA_DM01/index_ac43_ts_01';

catalog datafilecopy '+DATA_DM01/medicare02';
cataloged datafile copy
datafile copy file name=+DATA_DM01/index_ac43_ts_01 RECID=125 STAMP=825768749

RMAN>
cataloged datafile copy
datafile copy file name=+DATA_DM01/medicare02 RECID=126 STAMP=825768749

RMAN> switch database to copy;

datafile 1 switched to datafile copy "+DATA_DM01/lunars/datafile/system.448.793745389"
datafile 2 switched to datafile copy "+DATA_DM01/lunars/datafile/sysaux.446.793745257"
datafile 3 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs1.338.793720931"
datafile 4 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs2.425.793742003"
datafile 5 switched to datafile copy "+DATA_DM01/lunars/datafile/users.337.793720931"
datafile 6 switched to datafile copy "+DATA_DM01/lunars/datafile/users01"
datafile 7 switched to datafile copy "+DATA_DM01/lunars/datafile/users02"
datafile 8 switched to datafile copy "+DATA_DM01/lunars/datafile/users03"
datafile 9 switched to datafile copy "+DATA_DM01/lunars/datafile/users04"
datafile 10 switched to datafile copy "+DATA_DM01/lunars/datafile/users05"
datafile 11 switched to datafile copy "+DATA_DM01/lunars/datafile/users06"
datafile 12 switched to datafile copy "+DATA_DM01/lunars/datafile/users07"
datafile 13 switched to datafile copy "+DATA_DM01/lunars/datafile/users08"
datafile 14 switched to datafile copy "+DATA_DM01/lunars/datafile/users09"
datafile 15 switched to datafile copy "+DATA_DM01/lunars/datafile/users10"
datafile 16 switched to datafile copy "+DATA_DM01/lunars/datafile/users11"
datafile 17 switched to datafile copy "+DATA_DM01/lunars/datafile/users12"
datafile 18 switched to datafile copy "+DATA_DM01/lunars/datafile/users13"
datafile 19 switched to datafile copy "+DATA_DM01/lunars/datafile/users14"
datafile 20 switched to datafile copy "+DATA_DM01/lunars/datafile/users15"
datafile 21 switched to datafile copy "+DATA_DM01/lunars/datafile/users16"
datafile 22 switched to datafile copy "+DATA_DM01/lunars/datafile/users17"
datafile 23 switched to datafile copy "+DATA_DM01/lunars/datafile/users18"
datafile 24 switched to datafile copy "+DATA_DM01/lunars/datafile/users19"
datafile 25 switched to datafile copy "+DATA_DM01/lunars/datafile/users20"
datafile 26 switched to datafile copy "+DATA_DM01/lunars/datafile/users21"
datafile 27 switched to datafile copy "+DATA_DM01/lunars/datafile/users22"
datafile 28 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs02"
datafile 29 switched to datafile copy "+DATA_DM01/lunars/datafile/system01"
datafile 30 switched to datafile copy "+DATA_DM01/lunars/datafile/sbdata01"
datafile 31 switched to datafile copy "+DATA_DM01/lunars/datafile/sbdata02"
datafile 32 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs201"
datafile 33 switched to datafile copy "+DATA_DM01/lunars/datafile/medical_part"
datafile 34 switched to datafile copy "+DATA_DM01/lunars/datafile/medicalpart1"
datafile 35 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_par"
datafile 36 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_par01"
datafile 37 switched to datafile copy "+DATA_DM01/lunars/datafile/pension"
datafile 38 switched to datafile copy "+DATA_DM01/lunars/datafile/unemployee"
datafile 39 switched to datafile copy "+DATA_DM01/lunars/datafile/medicare"
datafile 40 switched to datafile copy "+DATA_DM01/lunars/datafile/lunarothers"
datafile 41 switched to datafile copy "+DATA_DM01/lunars/datafile/pension01"
datafile 42 switched to datafile copy "+DATA_DM01/lunars/datafile/medicare01"
datafile 43 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_index_l01"
datafile 44 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_index_g01"
datafile 45 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_index_g02"
datafile 46 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_index_l02"
datafile 47 switched to datafile copy "+DATA_DM01/lunars/datafile/index_ac43_ts.377.793729989"
datafile 48 switched to datafile copy "+DATA_DM01/index_ac43_ts_01"
datafile 49 switched to datafile copy "+DATA_DM01/lunars/datafile/dbfs_bak.374.793719745"
datafile 50 switched to datafile copy "+DATA_DM01/medicare02"
datafile 51 switched to datafile copy "+DATA_DM01/lunars/datafile/pension02"
datafile 52 switched to datafile copy "+DATA_DM01/lunars/datafile/index_ac43_ts_02"
datafile 53 switched to datafile copy "+DATA_DM01/lunars/datafile/index_ac43_ts03"
datafile 54 switched to datafile copy "+DATA_DM01/lunars/datafile/index_ac43_ts04"
datafile 55 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_data01"
datafile 56 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_data02"
datafile 57 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_data03"
datafile 58 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_data04"
datafile 59 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx01"
datafile 60 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx02"
datafile 61 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx03"
datafile 62 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx04"
datafile 63 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx01"
datafile 64 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx02"
datafile 65 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx03"
datafile 66 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx04"
datafile 67 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx05"
datafile 68 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx06"
datafile 69 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx07"
datafile 70 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_inx08"
datafile 71 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data01"
datafile 72 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data02"
datafile 73 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data03"
datafile 74 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data04"
datafile 75 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data05"
datafile 76 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data06"
datafile 77 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data07"
datafile 78 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data08"
datafile 79 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data09"
datafile 80 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data10"
datafile 81 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data11"
datafile 82 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data12"
datafile 83 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data13"
datafile 84 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data14"
datafile 85 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data15"
datafile 86 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data16"
datafile 87 switched to datafile copy "+DATA_DM01/lunars/datafile/lunar_data17"
datafile 88 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx05"
datafile 89 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx06"
datafile 90 switched to datafile copy "+DATA_DM01/lunars/datafile/ac43_inx07"
datafile 91 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs03"
datafile 92 switched to datafile copy "+DATA_DM01/lunars/datafile/undotbs04"
datafile 93 switched to datafile copy "+DATA_DM01/lunars/datafile/bxjh_data01"
datafile 94 switched to datafile copy "+DATA_DM01/lunars/datafile/base_data"
datafile 95 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_public_ts.dat"
datafile 96 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_app_la_ts.dat"
datafile 97 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_app_ls_ts.dat"
datafile 98 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_app_lr_ts.dat"
datafile 99 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_idx_la_ts.dat"
datafile 100 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_idx_ls_ts.dat"
datafile 101 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_idx_lr_ts.dat"
datafile 102 switched to datafile copy "+DATA_DM01/lunars/datafile/lr_annex_ts.dat"
datafile 103 switched to datafile copy "+DATA_DM01/lunars/datafile/bxrlzydata01"
datafile 104 switched to datafile copy "+DATA_DM01/lunars/datafile/bpcm.361.802046773"
datafile 105 switched to datafile copy "+DATA_DM01/lunars/datafile/bpcm.362.802046921"
datafile 106 switched to datafile copy "+DATA_DM01/lunars/datafile/form.363.802046993"
datafile 107 switched to datafile copy "+DATA_DM01/lunars/datafile/udotbs5"
datafile 108 switched to datafile copy "+DATA_DM01/lunars/datafile/syldgx_01.dbf"
datafile 109 switched to datafile copy "+DATA_DM01/lunars/datafile/system02"

RMAN>
SQL> set linesize 149
SQL> set pages 999
SQL> col name for a70
SQL> col name for a90
SQL> select file#,name,status from v$datafile_header where status!='ONLINE';

FILE# NAME STATUS
---------- ------------------------------------------------------------------------------------------ -------
 48 +DATA_DM01/index_ac43_ts_01 OFFLINE
 50 +DATA_DM01/medicare02 OFFLINE

SQL> select file#,name,status from v$datafile where file# in (48,50);

FILE# NAME STATUS
---------- ------------------------------------------------------------------------------------------ -------
 48 +DATA_DM01/index_ac43_ts_01 RECOVER
 50 +DATA_DM01/medicare02 RECOVER

SQL>
这两个文件时offline的,等recover database之后一起处理。。。。。

<bold>开始recover database,这个过程非常慢长,主要原因:
1,存储着实太差了。。。。。。
2,网络速度太差了(这个是NFS的空间)
3,ASM在recover 时需要tuning
</bold>

RMAN> recover database;

Starting recover at 10-SEP-13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00007: +DATA_DM01/lunars/datafile/users02
destination for restore of datafile 00049: +DATA_DM01/lunars/datafile/dbfs_bak.374.793719745
destination for restore of datafile 00051: +DATA_DM01/lunars/datafile/pension02
destination for restore of datafile 00053: +DATA_DM01/lunars/datafile/index_ac43_ts03
destination for restore of datafile 00060: +DATA_DM01/lunars/datafile/ac43_inx02
destination for restore of datafile 00066: +DATA_DM01/lunars/datafile/lunar_inx04
destination for restore of datafile 00072: +DATA_DM01/lunars/datafile/lunar_data02
destination for restore of datafile 00078: +DATA_DM01/lunars/datafile/lunar_data08
destination for restore of datafile 00084: +DATA_DM01/lunars/datafile/lunar_data14
destination for restore of datafile 00090: +DATA_DM01/lunars/datafile/ac43_inx07
destination for restore of datafile 00092: +DATA_DM01/lunars/datafile/undotbs04
destination for restore of datafile 00097: +DATA_DM01/lunars/datafile/lr_app_ls_ts.dat
destination for restore of datafile 00101: +DATA_DM01/lunars/datafile/lr_idx_lr_ts.dat
destination for restore of datafile 00102: +DATA_DM01/lunars/datafile/lr_annex_ts.dat
channel ORA_DISK_1: reading from backup piece /u03/ForStandby_5oojeeb6_1_1
channel ORA_DISK_2: starting incremental datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: +DATA_DM01/lunars/datafile/system.448.793745389
destination for restore of datafile 00009: +DATA_DM01/lunars/datafile/users04
destination for restore of datafile 00013: +DATA_DM01/lunars/datafile/users08
destination for restore of datafile 00018: +DATA_DM01/lunars/datafile/users13
destination for restore of datafile 00023: +DATA_DM01/lunars/datafile/users18
destination for restore of datafile 00030: +DATA_DM01/lunars/datafile/sbdata01
destination for restore of datafile 00042: +DATA_DM01/lunars/datafile/medicare01
destination for restore of datafile 00044: +DATA_DM01/lunars/datafile/lunar_index_g01
destination for restore of datafile 00046: +DATA_DM01/lunars/datafile/lunar_index_l02
destination for restore of datafile 00052: +DATA_DM01/lunars/datafile/index_ac43_ts_02
destination for restore of datafile 00056: +DATA_DM01/lunars/datafile/ac43_data02
destination for restore of datafile 00062: +DATA_DM01/lunars/datafile/ac43_inx04
destination for restore of datafile 00068: +DATA_DM01/lunars/datafile/lunar_inx06
destination for restore of datafile 00074: +DATA_DM01/lunars/datafile/lunar_data04
destination for restore of datafile 00080: +DATA_DM01/lunars/datafile/lunar_data10
destination for restore of datafile 00086: +DATA_DM01/lunars/datafile/lunar_data16
destination for restore of datafile 00103: +DATA_DM01/lunars/datafile/bxrlzydata01
destination for restore of datafile 00105: +DATA_DM01/lunars/datafile/bpcm.362.802046921
channel ORA_DISK_2: reading from backup piece /u03/ForStandby_5sojeeb7_1_1
channel ORA_DISK_3: starting incremental datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
destination for restore of datafile 00006: +DATA_DM01/lunars/datafile/users01
destination for restore of datafile 00012: +DATA_DM01/lunars/datafile/users07
destination for restore of datafile 00017: +DATA_DM01/lunars/datafile/users12
destination for restore of datafile 00022: +DATA_DM01/lunars/datafile/users17
destination for restore of datafile 00027: +DATA_DM01/lunars/datafile/users22
destination for restore of datafile 00040: +DATA_DM01/lunars/datafile/lunarothers
destination for restore of datafile 00041: +DATA_DM01/lunars/datafile/pension01
destination for restore of datafile 00043: +DATA_DM01/lunars/datafile/lunar_index_l01
destination for restore of datafile 00045: +DATA_DM01/lunars/datafile/lunar_index_g02
destination for restore of datafile 00055: +DATA_DM01/lunars/datafile/ac43_data01
destination for restore of datafile 00061: +DATA_DM01/lunars/datafile/ac43_inx03
destination for restore of datafile 00067: +DATA_DM01/lunars/datafile/lunar_inx05
destination for restore of datafile 00073: +DATA_DM01/lunars/datafile/lunar_data03
destination for restore of datafile 00079: +DATA_DM01/lunars/datafile/lunar_data09
destination for restore of datafile 00085: +DATA_DM01/lunars/datafile/lunar_data15
destination for restore of datafile 00104: +DATA_DM01/lunars/datafile/bpcm.361.802046773
destination for restore of datafile 00106: +DATA_DM01/lunars/datafile/form.363.802046993
channel ORA_DISK_3: reading from backup piece /u03/ForStandby_5rojeeb7_1_1
channel ORA_DISK_4: starting incremental datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
destination for restore of datafile 00004: +DATA_DM01/lunars/datafile/undotbs2.425.793742003
destination for restore of datafile 00008: +DATA_DM01/lunars/datafile/users03
destination for restore of datafile 00011: +DATA_DM01/lunars/datafile/users06
destination for restore of datafile 00015: +DATA_DM01/lunars/datafile/users10
destination for restore of datafile 00020: +DATA_DM01/lunars/datafile/users15
destination for restore of datafile 00025: +DATA_DM01/lunars/datafile/users20
destination for restore of datafile 00029: +DATA_DM01/lunars/datafile/system01
destination for restore of datafile 00035: +DATA_DM01/lunars/datafile/ac43_par
destination for restore of datafile 00039: +DATA_DM01/lunars/datafile/medicare
destination for restore of datafile 00054: +DATA_DM01/lunars/datafile/index_ac43_ts04
destination for restore of datafile 00058: +DATA_DM01/lunars/datafile/ac43_data04
destination for restore of datafile 00064: +DATA_DM01/lunars/datafile/lunar_inx02
destination for restore of datafile 00070: +DATA_DM01/lunars/datafile/lunar_inx08
destination for restore of datafile 00076: +DATA_DM01/lunars/datafile/lunar_data06
destination for restore of datafile 00082: +DATA_DM01/lunars/datafile/lunar_data12
destination for restore of datafile 00088: +DATA_DM01/lunars/datafile/ac43_inx05
destination for restore of datafile 00095: +DATA_DM01/lunars/datafile/lr_public_ts.dat
destination for restore of datafile 00099: +DATA_DM01/lunars/datafile/lr_idx_la_ts.dat
channel ORA_DISK_4: reading from backup piece /u03/ForStandby_5qojeeb7_1_1
channel ORA_DISK_5: starting incremental datafile backup set restore
channel ORA_DISK_5: specifying datafile(s) to restore from backup set
destination for restore of datafile 00003: +DATA_DM01/lunars/datafile/undotbs1.338.793720931
destination for restore of datafile 00005: +DATA_DM01/lunars/datafile/users.337.793720931
destination for restore of datafile 00016: +DATA_DM01/lunars/datafile/users11
destination for restore of datafile 00021: +DATA_DM01/lunars/datafile/users16
destination for restore of datafile 00026: +DATA_DM01/lunars/datafile/users21
destination for restore of datafile 00033: +DATA_DM01/lunars/datafile/medical_part
destination for restore of datafile 00036: +DATA_DM01/lunars/datafile/ac43_par01
destination for restore of datafile 00038: +DATA_DM01/lunars/datafile/unemployee
destination for restore of datafile 00059: +DATA_DM01/lunars/datafile/ac43_inx01
destination for restore of datafile 00065: +DATA_DM01/lunars/datafile/lunar_inx03
destination for restore of datafile 00071: +DATA_DM01/lunars/datafile/lunar_data01
destination for restore of datafile 00077: +DATA_DM01/lunars/datafile/lunar_data07
destination for restore of datafile 00083: +DATA_DM01/lunars/datafile/lunar_data13
destination for restore of datafile 00089: +DATA_DM01/lunars/datafile/ac43_inx06
destination for restore of datafile 00091: +DATA_DM01/lunars/datafile/undotbs03
destination for restore of datafile 00094: +DATA_DM01/lunars/datafile/base_data
destination for restore of datafile 00096: +DATA_DM01/lunars/datafile/lr_app_la_ts.dat
destination for restore of datafile 00100: +DATA_DM01/lunars/datafile/lr_idx_ls_ts.dat
channel ORA_DISK_5: reading from backup piece /u03/ForStandby_5pojeeb7_1_1
channel ORA_DISK_6: starting incremental datafile backup set restore
channel ORA_DISK_6: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: +DATA_DM01/lunars/datafile/sysaux.446.793745257
destination for restore of datafile 00010: +DATA_DM01/lunars/datafile/users05
destination for restore of datafile 00014: +DATA_DM01/lunars/datafile/users09
destination for restore of datafile 00019: +DATA_DM01/lunars/datafile/users14
destination for restore of datafile 00024: +DATA_DM01/lunars/datafile/users19
destination for restore of datafile 00028: +DATA_DM01/lunars/datafile/undotbs02
destination for restore of datafile 00031: +DATA_DM01/lunars/datafile/sbdata02
destination for restore of datafile 00032: +DATA_DM01/lunars/datafile/undotbs201
destination for restore of datafile 00034: +DATA_DM01/lunars/datafile/medicalpart1
destination for restore of datafile 00037: +DATA_DM01/lunars/datafile/pension
destination for restore of datafile 00047: +DATA_DM01/lunars/datafile/index_ac43_ts.377.793729989
destination for restore of datafile 00057: +DATA_DM01/lunars/datafile/ac43_data03
destination for restore of datafile 00063: +DATA_DM01/lunars/datafile/lunar_inx01
destination for restore of datafile 00069: +DATA_DM01/lunars/datafile/lunar_inx07
destination for restore of datafile 00075: +DATA_DM01/lunars/datafile/lunar_data05
destination for restore of datafile 00081: +DATA_DM01/lunars/datafile/lunar_data11
destination for restore of datafile 00087: +DATA_DM01/lunars/datafile/lunar_data17
destination for restore of datafile 00093: +DATA_DM01/lunars/datafile/bxjh_data01
destination for restore of datafile 00098: +DATA_DM01/lunars/datafile/lr_app_lr_ts.dat
channel ORA_DISK_6: reading from backup piece /u03/ForStandby_5nojeeb6_1_1

监控rman恢复进度:

[oracle@oradg ~]$ ps -ef|grep rman
oracle 15439 13614 0 11:46 pts/2 00:00:03 rman target /
oracle 16382 14226 0 14:13 pts/3 00:00:00 grep rman
[oracle@oradg ~]$ ps -ef|grep 15439
oracle 15439 13614 0 11:46 pts/2 00:00:03 rman target /
oracle 15444 15439 0 11:46 ? 00:00:07 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 15448 15439 0 11:46 ? 00:00:00 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 15513 15439 0 11:53 ? 00:00:43 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 15514 15439 0 11:53 ? 00:00:44 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 15515 15439 0 11:53 ? 00:00:31 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 15516 15439 0 11:53 ? 00:00:31 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 15517 15439 0 11:53 ? 00:00:31 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 15518 15439 0 11:53 ? 00:00:28 oraclelunars (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 16384 14226 0 14:14 pts/3 00:00:00 grep 15439
[oracle@oradg ~]$

可以看见,v$session_longops监控rman备份很有用,但是监控rman的恢复进度就很不靠谱了:

SQL> select sid, serial#, context, sofar, opname,totalwork,
 2 round(sofar/totalwork*100,2) "%_complete"
 3 from v$session_longops;

SID SERIAL# CONTEXT SOFAR OPNAME TOTALWORK %_complete
---------- ---------- ---------- ---------- ---------------------------------------------------------------- ---------- ----------
 4 7 1 7.2761E+13 RMAN: incremental datafile restore 57413886 126730808
 1991 3 1 131072 RMAN: full datafile restore 131072 100
 1991 3 1 6.6761E+13 RMAN: incremental datafile restore 61767680 108084070
 574 1 1 6.5468E+13 RMAN: incremental datafile restore 62810878 104230697
 289 1 1 6.5601E+13 RMAN: incremental datafile restore 57571328 113947967
 1993 1 1 6.9020E+13 RMAN: incremental datafile restore 59899776 115226071
 1142 9 205 1442292 RMAN: aggregate input 1442292 100
 1710 1 1 1310720 RMAN: full datafile restore 1310720 100
 1710 1 1 7.2826E+13 RMAN: incremental datafile restore 59813248 121754801

9 rows selected.

SQL>

事实上,监控rman恢复的利器是:v$backup_async_io 和 v$rman_status,例如:

SET lines 200
col filename FOR a40
col status for a10
col DEVICE_TYPE for a10
col "Ela(s)" for 999999
SET pages 50
SELECT a.device_type,
 a.TYPE,
 b.status,
 b.mbytes_processed AS "Total MB",
 a.filename,
 ROUND(a.bytes / (1024 * 1024)) AS "Size MB",
 TO_CHAR(a.open_time, 'dd-mon-yyyy hh24:mi:ss') AS open_time,
 ROUND(a.elapsed_time / 100) AS "Time(s)",
 ROUND(a.elapsed_time / 100) AS "Ela(s)",
 ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s"
 FROM v$backup_async_io a, v$rman_status b
 WHERE a.rman_status_recid = b.recid
 ORDER BY a.use_count;

DEVICE_TYP TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s
---------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------ ----------
DISK INPUT COMPLETED 0 /u03/datafile_62ojg8q8_1_1 1 10-sep-2013 11:53:05 0 0 这里面需要注意,在恢复没有完成之前,这里是没有信息的,
DISK INPUT COMPLETED 0 /u03/datafile_61ojg8q8_1_1 1 10-sep-2013 11:53:06 0 0
DISK INPUT COMPLETED 0 /u03/datafile_60ojg8q8_1_1 1 10-sep-2013 11:53:06 0 0
DISK AGGREGATE COMPLETED 11264 1024 10-sep-2013 11:53:36 7 7 146 这里的信息是上次操作完成的监控数据(含操作完成和终止两种)
DISK OUTPUT COMPLETED 11264 +DATA_DM01/lunars/datafile/system02 1024 10-sep-2013 11:53:36 7 7 146
DISK INPUT COMPLETED 11264 /u03/datafile_62ojg8q8_1_1 5 10-sep-2013 11:53:36 7 7 1
DISK AGGREGATE COMPLETED 11264 10240 10-sep-2013 11:53:37 41 41 250
DISK INPUT COMPLETED 11264 /u03/datafile_61ojg8q8_1_1 43 10-sep-2013 11:53:36 42 42 1
DISK OUTPUT COMPLETED 11264 +DATA_DM01/lunars/datafile/syldgx_01.dbf 10240 10-sep-2013 11:53:37 41 41 250
DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 30340 10-sep-2013 12:15:17
DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 30433 10-sep-2013 12:15:17
DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 30485 10-sep-2013 12:15:17
DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 30458 10-sep-2013 12:15:17
DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 30336 10-sep-2013 12:15:17
DISK INPUT RUNNING 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 30271 10-sep-2013 12:15:20
终止rman恢复进度,放到后台重新执行:
15:06:48 SQL> /

DEVICE_TYP TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s
---------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------- ----------
DISK INPUT COMPLETED 0 /u03/datafile_62ojg8q8_1_1 1 10-sep-2013 11:53:05 0 0
DISK INPUT COMPLETED 0 /u03/datafile_61ojg8q8_1_1 1 10-sep-2013 11:53:06 0 0
DISK INPUT COMPLETED 0 /u03/datafile_60ojg8q8_1_1 1 10-sep-2013 11:53:06 0 0
DISK AGGREGATE COMPLETED 11264 1024 10-sep-2013 11:53:36 7 7 146
DISK OUTPUT COMPLETED 11264 +DATA_DM01/lunars/datafile/system02 1024 10-sep-2013 11:53:36 7 7 146
DISK INPUT COMPLETED 11264 /u03/datafile_62ojg8q8_1_1 5 10-sep-2013 11:53:36 7 7 1
DISK AGGREGATE COMPLETED 11264 10240 10-sep-2013 11:53:37 41 41 250
DISK INPUT COMPLETED 11264 /u03/datafile_61ojg8q8_1_1 43 10-sep-2013 11:53:36 42 42 1
DISK OUTPUT COMPLETED 11264 +DATA_DM01/lunars/datafile/syldgx_01.dbf 10240 10-sep-2013 11:53:37 41 41 250
DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 33128 10-sep-2013 12:15:17 10321 10321 3
DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 33226 10-sep-2013 12:15:17 10322 10322 3
DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 33290 10-sep-2013 12:15:17 10324 10324 3
DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 33254 10-sep-2013 12:15:17 10325 10325 3
DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 33157 10-sep-2013 12:15:17 10326 10326 3
DISK INPUT FAILED 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 33090 10-sep-2013 12:15:20 10324 10324 3

15 rows selected.

15:07:31 SQL>

 

[root@oradg ~]# ps -ef|grep ora_
oracle 17068 1 0 15:39 ? 00:00:00 ora_pmon_lunars
oracle 17070 1 0 15:39 ? 00:00:00 ora_psp0_lunars
oracle 17072 1 0 15:39 ? 00:00:00 ora_vktm_lunars
oracle 17076 1 0 15:39 ? 00:00:00 ora_gen0_lunars
oracle 17078 1 0 15:39 ? 00:00:00 ora_diag_lunars
oracle 17080 1 0 15:39 ? 00:00:00 ora_dbrm_lunars
oracle 17082 1 0 15:39 ? 00:00:05 ora_dia0_lunars
oracle 17084 1 0 15:39 ? 00:00:00 ora_mman_lunars
oracle 17086 1 0 15:39 ? 00:00:00 ora_dbw0_lunars
oracle 17088 1 0 15:39 ? 00:00:00 ora_lgwr_lunars
oracle 17090 1 0 15:39 ? 00:00:00 ora_ckpt_lunars
oracle 17092 1 0 15:39 ? 00:00:00 ora_smon_lunars
oracle 17094 1 0 15:39 ? 00:00:00 ora_reco_lunars
oracle 17096 1 0 15:39 ? 00:00:00 ora_rbal_lunars
oracle 17098 1 0 15:39 ? 00:00:00 ora_asmb_lunars
oracle 17100 1 0 15:39 ? 00:00:00 ora_mmon_lunars
oracle 17104 1 0 15:39 ? 00:00:00 ora_mmnl_lunars
oracle 17106 1 0 15:39 ? 00:00:00 ora_mark_lunars
oracle 17127 1 0 15:40 ? 00:00:00 ora_arc0_lunars
oracle 17129 1 0 15:40 ? 00:00:00 ora_arc1_lunars
oracle 17131 1 0 15:40 ? 00:00:00 ora_arc2_lunars
oracle 17133 1 0 15:40 ? 00:00:00 ora_arc3_lunars
oracle 17135 1 0 15:40 ? 00:00:00 ora_arc4_lunars
oracle 17137 1 0 15:40 ? 00:00:00 ora_arc5_lunars
oracle 17139 1 0 15:40 ? 00:00:00 ora_arc6_lunars
oracle 17141 1 0 15:40 ? 00:00:00 ora_arc7_lunars
oracle 17143 1 0 15:40 ? 00:00:00 ora_arc8_lunars
oracle 17145 1 0 15:40 ? 00:00:00 ora_arc9_lunars
oracle 17521 1 0 16:13 ? 00:00:00 ora_o000_lunars --增加的进程
oracle 17543 1 0 16:13 ? 00:00:00 ora_o001_lunars --增加的进程
root 17553 17477 0 16:14 pts/5 00:00:00 grep ora_
[root@oradg ~]#
Average: CPU %user %nice %system %iowait %steal %idle
Average: all 0.32 0.00 1.20 42.79 0.03 55.66

Average: IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
Average: lo 0.50 0.50 24.88 24.88 0.00 0.00 0.00
Average: peth0 12723.13 6345.52 19160625.62 448873.63 0.00 0.00 0.00
Average: eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: vif0.0 6653.98 13342.29 443880.10 20044932.34 0.00 0.00 0.00
Average: eth0 13342.29 6653.98 20044932.34 443880.10 0.00 0.00 0.00
Average: vif0.1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: veth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: vif0.2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: veth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: vif0.3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: veth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: vif0.4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: veth4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: xenbr0 57.71 0.00 11946.27 0.00 0.00 0.00 57.71

RECOVER DATABASE过程中 tuning ASM :


当前值(DISK AIO,从PGA分配):
SQL> show parameter async

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
disk_asynch_io boolean TRUE
tape_asynch_io boolean TRUE
SQL> show parameter slaves

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
backup_tape_io_slaves boolean FALSE
dbwr_io_slaves integer 0
SQL>

启用slaves(Slaves IO,从LARGE POOL中分配):
SQL> alter system set dbwr_io_slaves=8 scope=spfile;

System altered.

SQL>
SQL> alter system set disk_asynch_io=false scope=spfile;

System altered.

SQL>
SQL> alter system set large_pool_size=150M scope=both;

System altered.

SQL>

重启:
SQL> show parameter large

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
large_pool_size big integer 160M
use_large_pages string TRUE
SQL> show parameter slave

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
backup_tape_io_slaves boolean FALSE
dbwr_io_slaves integer 8
SQL> show parameter async

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
disk_asynch_io boolean FALSE
tape_asynch_io boolean TRUE
SQL>
SQL> col KSPPINM for a30
SQL> col ksppstvl format a15
SQL> col KSPPDESC for a55
SQL> select ksppinm, ksppstvl, KSPPDESC
 2 from x$ksppi pi, x$ksppcv cv
 3 where cv.indx=pi.indx and pi.ksppinm like '\_%' escape '\'
 4 and pi.ksppinm like '%ksfq%';

KSPPINM KSPPSTVL
------------------------------ ---------------
KSPPDESC
-------------------------------------------------------
_backup_ksfq_bufcnt_max 64
maximum number of buffers used for backup/restore

_backup_ksfq_bufsz 0
size of buffers used for backup/restore

_backup_ksfq_bufcnt 0
number of buffers used for backup/restore
SQL>

SQL> select group_number,count(*) from v$asm_disk group by group_number;

GROUP_NUMBER COUNT(*)
------------ ----------
 1 16
 2 4

SQL>
alter system set "_backup_ksfq_bufsz"=1048576;
alter system set "_backup_ksfq_bufcnt"=16;

SQL> alter system set "_backup_ksfq_bufsz"=1048576;

System altered.

SQL> alter system set "_backup_ksfq_bufcnt"=16;

System altered.

SQL>
RMAN> exit
[oracle@oradg scripts]$ cat temp.sh
#!/bin/sh

export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/dbhome_1
export ORACLE_SID=lunars
export ORACLE_BASE=/u01/app/oracle
export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:.

rman target / <<EOF
debug on;
recover database;
debug off;
EXIT;
EOF
[oracle@oradg scripts]$

&nbsp;

SET lines 200
col filename FOR a40
col status for a10
col DEVICE_TYPE for a10
col "Ela(s)" for 999999
SET pages 50
SELECT a.buffer_size,
-- a.device_type,
 a.TYPE,
 b.status,
 b.mbytes_processed AS "Total MB",
 a.filename,
 ROUND(a.bytes / (1024 * 1024)) AS "Size MB",
 TO_CHAR(a.open_time, 'dd-mon-yyyy hh24:mi:ss') AS open_time,
 ROUND(a.elapsed_time / 100) AS "Time(s)",
 ROUND(a.elapsed_time / 100) AS "Ela(s)",
 ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s"
 FROM v$backup_async_io a, v$rman_status b
 WHERE a.rman_status_recid = b.recid
 ORDER BY a.use_count;

16:23:27 SQL> /

BUFFER_SIZE TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s
----------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------- ----------
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 1882 10-sep-2013 16:13:50
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 2303 10-sep-2013 16:13:50
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 2257 10-sep-2013 16:13:52
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 2250 10-sep-2013 16:13:52
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 1830 10-sep-2013 16:14:53
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 1701 10-sep-2013 16:15:46

6 rows selected.

16:23:29 SQL>
16:25:35 SQL> /

BUFFER_SIZE TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s
----------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------- ----------
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 2244 10-sep-2013 16:13:50
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 2805 10-sep-2013 16:13:50
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 2778 10-sep-2013 16:13:52
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 2744 10-sep-2013 16:13:52
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 2296 10-sep-2013 16:14:53
 1048576 INPUT RUNNING 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 2249 10-sep-2013 16:15:46

6 rows selected.

16:25:36 SQL>

&nbsp;
看总共还原了多少M:
SET lines 200
col filename FOR a40
col status for a10
col DEVICE_TYPE for a10
col "Ela(s)" for 999999
SET pages 50
SELECT
 b.status,
 sum(b.mbytes_processed) AS "Total MB",
 sum(ROUND(a.bytes / (1024 * 1024))) AS "Size MB"
-- ROUND(a.elapsed_time / 100) AS "Time(s)",
-- ROUND(a.elapsed_time / 100) AS "Ela(s)",
-- ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s"
 FROM v$backup_async_io a, v$rman_status b
 WHERE a.rman_status_recid = b.recid
 group by b.status;

16:29:40 SQL> SET lines 200
16:29:41 SQL> col filename FOR a40
16:29:41 SQL> col status for a10
16:29:41 SQL> col DEVICE_TYPE for a10
16:29:41 SQL> col "Ela(s)" for 999999
16:29:41 SQL> SET pages 50
16:29:41 SQL> SELECT
16:29:41 2 b.status,
16:29:41 3 sum(b.mbytes_processed) AS "Total MB",
16:29:41 4 sum(ROUND(a.bytes / (1024 * 1024))) AS "Size MB"
16:29:41 5 -- ROUND(a.elapsed_time / 100) AS "Time(s)",
16:29:41 6 -- ROUND(a.elapsed_time / 100) AS "Ela(s)",
16:29:41 7 -- ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s"
16:29:41 8 FROM v$backup_async_io a, v$rman_status b
16:29:41 9 WHERE a.rman_status_recid = b.recid
16:29:41 10 group by b.status;
STATUS Total MB Size MB
---------- ---------- ----------
RUNNING 0 20756

16:29:41 SQL> 16:29:41 SQL>
16:29:53 SQL>

一分钟1.5G左右,一小时大概90G:
16:30:59 SQL> /

STATUS Total MB Size MB
---------- ---------- ----------
RUNNING 0 22594

16:31:01 SQL>
16:31:33 SQL>
16:31:43 SQL>
16:31:53 SQL>
16:32:00 SQL>
16:32:02 SQL> /

STATUS Total MB Size MB
---------- ---------- ----------
RUNNING 0 24055

16:32:03 SQL>
16:32:03 SQL> select 24055-22594 from dual;

24055-22594
-----------
 1461

16:32:40 SQL>
16:40:17 SQL> SELECT
16:40:17 2 b.status,
16:40:17 3 sum(b.mbytes_processed) AS "Total MB",
16:40:17 4 sum(ROUND(a.bytes / (1024 * 1024))) AS "Size MB"
16:40:17 5 -- ROUND(a.elapsed_time / 100) AS "Time(s)",
16:40:18 6 -- ROUND(a.elapsed_time / 100) AS "Ela(s)",
16:40:18 7 -- ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s"
16:40:18 8 FROM v$backup_async_io a, v$rman_status b
16:40:18 9 WHERE a.rman_status_recid = b.recid
16:40:18 10 group by b.status;

STATUS Total MB Size MB
---------- ---------- ----------
RUNNING 0 36348

16:40:18 SQL>
16:42:54 SQL>
16:43:01 SQL>
16:43:07 SQL>
16:43:13 SQL>
16:43:18 SQL>
16:43:21 SQL> /

STATUS Total MB Size MB
---------- ---------- ----------
RUNNING 0 41288

16:43:22 SQL>

16:51:54 SQL> SET lines 200
16:51:54 SQL> col filename FOR a40
16:51:54 SQL> col status for a10
16:51:54 SQL> col DEVICE_TYPE for a10
16:51:54 SQL> col "Ela(s)" for 999999
16:51:54 SQL> SET pages 50
16:51:54 SQL> SELECT a.buffer_size/1024/1024 as buffersize_mb,
16:51:54 2 -- a.device_type,
16:51:54 3 a.TYPE,
16:51:54 4 b.status,
16:51:54 5 -- b.mbytes_processed AS "Total MB",
16:51:54 6 a.filename,
16:51:54 7 ROUND(a.bytes / (1024 * 1024)) AS "Size MB",
16:51:54 8 TO_CHAR(a.open_time, 'dd-mon-yyyy hh24:mi:ss') AS open_time,
16:51:54 9 ROUND(a.elapsed_time / 100) AS "Time(s)",
16:51:54 10 ROUND(a.elapsed_time / 100) AS "Ela(s)",
16:51:54 11 ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s"
16:51:54 12 FROM v$backup_async_io a, v$rman_status b
16:51:54 13 WHERE a.rman_status_recid = b.recid
16:51:54 14 ORDER BY a.use_count;

BUFFERSIZE_MB TYPE STATUS FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s
---------------- --------- ---------- ---------------------------------------- ---------------- ----------------------- ---------------- ------- ----------------
 1 INPUT RUNNING /u03/ForStandby/ForStandby_5oojeeb6_1_1 7,462 10-sep-2013 16:13:50
 1 INPUT RUNNING /u03/ForStandby/ForStandby_5sojeeb7_1_1 9,682 10-sep-2013 16:13:50
 1 INPUT RUNNING /u03/ForStandby/ForStandby_5rojeeb7_1_1 10,017 10-sep-2013 16:13:52
 1 INPUT RUNNING /u03/ForStandby/ForStandby_5qojeeb7_1_1 9,664 10-sep-2013 16:13:52
 1 INPUT RUNNING /u03/ForStandby/ForStandby_5pojeeb7_1_1 8,595 10-sep-2013 16:14:53
 1 INPUT RUNNING /u03/ForStandby/ForStandby_5nojeeb6_1_1 9,634 10-sep-2013 16:15:46

6 rows selected.

16:51:55 SQL>

这个存储是NFS来的,网卡到极限了,就这个速度,IOWAIT也都27%多了。。。。。。:

[root@oradg ~]# sar -n DEV -u 2 2
Linux 2.6.18-238.el5xen (oradg) 09/10/2013

05:12:30 PM CPU %user %nice %system %iowait %steal %idle
05:12:32 PM all 0.37 0.00 1.35 27.14 0.06 71.08

05:12:30 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
05:12:32 PM lo 1.00 1.00 50.00 50.00 0.00 0.00 0.00
05:12:32 PM peth0 21539.00 10783.00 32521089.00 758605.00 0.00 0.00 0.00
05:12:32 PM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM vif0.0 9291.00 18578.50 616164.00 27977989.50 0.00 0.00 0.00
05:12:32 PM eth0 18578.50 9291.00 27977989.50 616164.00 0.00 0.00 0.00
05:12:32 PM vif0.1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM veth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM vif0.2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM veth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM vif0.3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM veth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM vif0.4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM veth4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:32 PM xenbr0 29.50 0.00 11288.50 0.00 0.00 0.00 29.50

05:12:32 PM CPU %user %nice %system %iowait %steal %idle
05:12:34 PM all 0.31 0.00 1.68 23.12 0.00 74.89

05:12:32 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
05:12:34 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM peth0 22215.00 11116.50 33549739.00 782637.00 0.00 0.00 0.00
05:12:34 PM eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM vif0.0 10757.00 21491.50 714316.00 32364581.00 0.00 0.00 0.00
05:12:34 PM eth0 21491.50 10757.00 32364581.00 714316.00 0.00 0.00 0.00
05:12:34 PM vif0.1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM veth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM vif0.2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM veth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM vif0.3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM veth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM vif0.4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM veth4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
05:12:34 PM xenbr0 19.00 0.00 10253.00 0.00 0.00 0.00 19.00

Average: CPU %user %nice %system %iowait %steal %idle
Average: all 0.34 0.00 1.52 25.14 0.03 72.97

Average: IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
Average: lo 0.50 0.50 25.00 25.00 0.00 0.00 0.00
Average: peth0 21877.00 10949.75 33035414.00 770621.00 0.00 0.00 0.00
Average: eth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: virbr0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: vif0.0 10024.00 20035.00 665240.00 30171285.25 0.00 0.00 0.00
Average: eth0 20035.00 10024.00 30171285.25 665240.00 0.00 0.00 0.00
Average: vif0.1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: veth1 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: vif0.2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: veth2 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: vif0.3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: veth3 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: vif0.4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: veth4 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: xenbr0 24.25 0.00 10770.75 0.00 0.00 0.00 24.25
[root@oradg ~]#
[root@oradg ~]#

&nbsp;

SQL>
SQL> set linesize 140
SQL> set pages 999
SQL> SET lines 200
col filename FOR a40
col status for a10
col DEVICE_TYPE for a10
col "Ela(s)" for 999999
SET pages 50
SELECT a.device_type,
 a.TYPE,
 b.status,
 b.mbytes_processed AS "Total MB",
 a.filename,
 ROUND(a.bytes / (1024 * 1024)) AS "Size MB",
 TO_CHAR(a.open_time, 'dd-mon-yyyy hh24:mi:ss') AS open_time,
 ROUND(a.elapsed_time / 100) AS "Time(s)",
 ROUND(a.elapsed_time / 100) AS "Ela(s)",
 ROUND(a.effective_bytes_per_second / (1024 * 1024)) AS "MB/s"
 FROM v$backup_async_io a, v$rman_status b
 WHERE a.rman_status_recid = b.recid
 ORDER BY a.use_count;
SQL> SQL> SQL> SQL> SQL> SQL> 2 3 4 5 6 7 8 9 10 11 12 13
DEVICE_TYP TYPE STATUS Total MB FILENAME Size MB OPEN_TIME Time(s) Ela(s) MB/s
---------- --------- ---------- ---------- ---------------------------------------- ---------- ----------------------- ---------- ------- ----------
DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5oojeeb6_1_1 62203 10-sep-2013 16:13:50 13626 13626 5
DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5sojeeb7_1_1 66335 10-sep-2013 16:13:50 13648 13648 5
DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5rojeeb7_1_1 73345 10-sep-2013 16:13:52 14108 14108 5
DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5qojeeb7_1_1 84269 10-sep-2013 16:13:52 14740 14740 6
DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5pojeeb7_1_1 111184 10-sep-2013 16:14:53 15582 15582 7
DISK INPUT COMPLETED 0 /u03/ForStandby/ForStandby_5nojeeb6_1_1 127680 10-sep-2013 16:15:46 15739 15739 8

6 rows selected.

SQL>

恢复过程遇到的由于offline 的文件造成的问题:


[oracle@oradg ~]$ rman target /

Recovery Manager: Release 11.2.0.2.0 - Production on Tue Sep 10 21:39:41 2013

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

connected to target database: bjlunar (DBID=4088537672, not open)

RMAN> recover database;

Starting recover at 10-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=574 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=858 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=1141 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=1423 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=1707 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=1993 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=6 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=290 device type=DISK

starting media recovery

unable to find archived log
archived log thread=2 sequence=5875
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/10/2013 21:40:30
RMAN-06054: media recovery requesting unknown archived log for thread 2 with sequence 5875 and starting SCN of 12030111275805

RMAN>

select name,thread#,sequence#,status,to_char(COMPLETION_TIME ,'yyyymmdd hh24:mi:ss')
from v$archived_log where thread#=1 and sequence#=13664;
select name,thread#,sequence#,status
from v$archived_log where thread#=2 and sequence#=5875;

SQL> select thread#,count(*) from v$archived_log where thread#=2 and sequence#>=5875 group by thread#;

THREAD# COUNT(*)
---------- ----------
 2 717

SQL>
SQL> select thread#,min(sequence#) from v$log_history group by thread#;

THREAD# MIN(SEQUENCE#)
---------- --------------
 1 10821
 2 8294

SQL>
SQL> select distinct checkpoint_change# from v$datafile;

CHECKPOINT_CHANGE#
----------------------------------------------
 12030111275805
 12762145943484

SQL>
SQL> select distinct checkpoint_change# from v$datafile_header;

CHECKPOINT_CHANGE#
----------------------------------------------
 12030111275805
 12762144336474
 12762144336497
 12762144336582
 12762144336583
 12762144336585
 12762144336590
 12762477971858
 12762477971876
 12762477971883

10 rows selected.

SQL>

SQL> select status,file# from v$datafile_header where status!='ONLINE';

STATUS FILE#
------- ----------
OFFLINE 48
OFFLINE 50
SQL>
使用recover standby database,可以跨过这个问题,可以看见,已经找比较新的archive log了:
1

SQL> alter database recover standby database;
alter database recover standby database
*
ERROR at line 1:
ORA-00279: change 12762144336474 generated at 09/09/2013 17:52:39 needed for thread 1
ORA-00289: suggestion : /home/oracle/log1/log_1_13664_764800648.arc
ORA-00280: change 12762144336474 for thread 1 is in sequence #13664
SQL>

SQL> select name,thread#,sequence#,status,to_char(COMPLETION_TIME ,'yyyymmdd hh24:mi:ss')
from v$archived_log where thread#=1 and sequence#=13664; 2

NAME THREAD# SEQUENCE# S TO_CHAR(COMPLETIO
------------------------------ ---------- ---------- - -----------------
lunars 1 13664 A 20130909 23:53:43
+RECO_DM01/lunar/archive/arch1/ 1 13664 A 20130909 23:53:52
1_13664_764800648.dbf
SQL>

增加standby logfile:
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 31 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 32 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 33 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 34 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 35 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 36 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 37 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 38 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 39 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 40 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 41 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 42 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 43 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 44 '+DATA_DM01' size 200m;
 ALTER DATABASE ADD STANDBY LOGFILE GROUP 45 '+DATA_DM01' size 200m;
[oracle@oradg trace]$ tail alert_lunars.log
Wed Sep 11 10:26:38 2013
Archived Log entry 42 added for thread 1 sequence 13684 ID 0xf3b1df48 dest 1:
Wed Sep 11 11:48:55 2013
RFS[2]: Selected log 33 for thread 1 sequence 13686 dbid -206429624 branch 764800648
Wed Sep 11 11:49:03 2013
Media Recovery Waiting for thread 1 sequence 13686 (in transit)
Recovery of Online Redo Log: Thread 1 Group 33 Seq 13686 Reading mem 0
 Mem# 0: +DATA_DM01/lunars/onlinelog/group_33.295.825808103
Wed Sep 11 11:49:28 2013
Archived Log entry 43 added for thread 1 sequence 13685 ID 0xf3b1df48 dest 1:
[oracle@oradg trace]$

<bold>恢复完成后,就可以把dg放到恢复模式,让他恢复几个日志,然后把数据库重新打到open read only,再次启动恢复进程,就是adg了。。。。。。。。。。</bold>

<bold>
大体思路:
在备库执行(如果是rac,只启动一个实例):
startup nomount

如果使用了rman catalog库,那么可以直接使用下面命令获取控制文件:
RESTORE STANDBY CONTROLFILE FROM TAG ‘FORSTANDBY’;

如果没有rman catalog库,那么使用主库备份的控制文件(本溪使用这个方法):
restore standby controlfile from ‘/tmp/stdbyctl.bkp’;

mount上备库:
alter database mount;
CATALOG START WITH ‘/u03/ForStandby/’;
REPORT SCHEMA;
RECOVER DATABASE NOREDO;

——————————————————————————–
针对OMF的数据文件使用下面命令:
catalog start with ‘+DATA1/MUM/DATAFILE/’;

针对非OFM的数据文件使用下面命令:
catalog datafilecopy ‘<File-Specification>’;
——————————————————————————–
switch database to copy;
——————————————————————————–
–clear all 所有 online redo log groups
select group# from v$log;
alter database clear logfile group 1;
alter database clear logfile group 2;
alter database clear logfile group 3;
——————————————————————————–

——————————————————————————–
–clear all 所有 standby redolog groups
select group# from v$standby_log;
alter database clear logfile group 4;
alter database clear logfile group 5;
alter database clear logfile group 6;
——————————————————————————–
——————————————————————————–
重建standby redo log:
select group# from v$standby_log;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 41 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 42 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 43 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 44 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 45 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 46 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 47 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 48 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 49 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 50 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 51 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 52 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 53 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 54 ‘+DATA_DM01’ size 200m;
ALTER DATABASE ADD STANDBY LOGFILE GROUP 55 ‘+DATA_DM01’ size 200m;
——————————————————————————–
alter database recover managed standby database disconnect from session;

——————————————————————————–
重新enable备库的flashback:
alter database flashback off;
alter database flashback on;
——————————————————————————–

</bold>

发表在 ASM, backup&recovery, Dataguard | 标签为 , , , , | 留下评论

安装oracle 11.2.0.1 RAC和11.2.0.4 RAC on aix 7.1

<head profile=”http://gmpg.org/xfn/11″>

<style type=”text/css”>#header { background: url(http://feed.askmaclean.com/wp-content/themes/minimum/images/header.png) no-repeat !important; }</style>

</head>

lunardb2/#oslevel -r

7100-02
lunardb2/#

/usr/sbin/lsattr -E -l sys0 -a realmem
/usr/sbin/lsps -a

/usr/bin/df -g

/usr/bin/df -g /tmp

bootinfo -K

lsattr -El rhdiskpower0 -a size_mb
lsattr -El hdiskpower0

/usr/sbin/no -a | fgrep ephemeral
# /usr/sbin/no -p -o tcp_ephemeral_low=9000 -o tcp_ephemeral_high=65500
# /usr/sbin/no -p -o udp_ephemeral_low=9000 -o udp_ephemeral_high=65500

lunardb2/#/usr/sbin/no -a | fgrep ephemeral
tcp_ephemeral_high = 65500
tcp_ephemeral_low = 9000
udp_ephemeral_high = 65500
udp_ephemeral_low = 9000
lunardb2/#

ioo -o aio_maxreqs

ps -ek|grep -v grep|grep –v posix_aioserver|grep -c aioserver

从AIX 6.1以后,下属值貌似是缺省值了,跟Oracle install guide一致,因此无需修改:
vmo -p -o minperm%=3
vmo -p -o maxperm%=90
vmo -p -o maxclient%=90
vmo -p -o lru_file_repage=0
vmo -p -o strict_maxclient=1
vmo -p -o strict_maxperm=0
检查vmo的设置:
lunardb2/#vmo -a
ame_cpus_per_pool = n/a
ame_maxfree_mem = n/a
ame_min_ucpool_size = n/a
ame_minfree_mem = n/a
ams_loan_policy = n/a
enhanced_affinity_affin_time = 1
enhanced_affinity_vmpool_limit = 10
esid_allocator = 1
force_relalias_lite = 0
kernel_heap_psize = 65536
lgpg_regions = 0
lgpg_size = 0
low_ps_handling = 1
maxfree = 1088
maxperm = 21912435
maxpin = 22729495
maxpin% = 90
memory_frames = 25165824
memplace_data = 0
memplace_mapped_file = 0
memplace_shm_anonymous = 0
memplace_shm_named = 0
memplace_stack = 0
memplace_text = 0
memplace_unmapped_file = 0
minfree = 960
minperm = 730410
minperm% = 3
nokilluid = 0
npskill = 131072
npswarn = 524288
num_locks_per_semid = 1
numpsblks = 16777216
pinnable_frames = 23496532
relalias_percentage = 0
scrub = 0
v_pinshm = 0
vmm_default_pspa = 0
vmm_klock_mode = 2
wlm_memlimit_nonpg = 1
lunardb2/#

lunardb2/#vmstat -v
25165824 memory pages
24347152 lruable pages
22149779 free pages
10 memory pools
1669293 pinned pages
90.0 maxpin percentage
3.0 minperm percentage
90.0 maxperm percentage
5.0 numperm percentage
1233770 file pages
0.0 compressed percentage
0 compressed pages
5.0 numclient percentage
90.0 maxclient percentage
1233770 client pages
0 remote pageouts scheduled
31 pending disk I/Os blocked with no pbuf
0 paging space I/Os blocked with no psbuf
2228 filesystem I/Os blocked with no fsbuf
4192 client filesystem I/Os blocked with no fsbuf
6 external pager filesystem I/Os blocked with no fsbuf
7.1 percentage of memory used for computational pages
lunardb2/#
lunardb2/#/usr/sbin/lsattr -E -l sys0 -a maxuproc
maxuproc 16384 Maximum number of PROCESSES allowed per user True
lunardb2/#

修改/etc/rc.net文件,使设置永久生效:
if [ -f /usr/sbin/no ] ; then
/usr/sbin/no -o udp_sendspace=131072
/usr/sbin/no -o udp_recvspace=1310720
/usr/sbin/no -o tcp_sendspace=65536
/usr/sbin/no -o tcp_recvspace=65536
/usr/sbin/no -o rfc1323=1
/usr/sbin/no -o sb_max=4194304
/usr/sbin/no -o ipqmaxlen=512
fi

-r表示reboot后生效,-p表示即刻生效:
/usr/sbin/no -r -o ipqmaxlen=512
/usr/sbin/no -p -o sb_max=4194304
/usr/sbin/no -p -o udp_sendspace=131072
/usr/sbin/no -p -o udp_recvspace=1310720
/usr/sbin/no -p -o tcp_sendspace=65536
/usr/sbin/no -p -o tcp_recvspace=65536
/usr/sbin/no -p -o rfc1323=1
lunardb2/#no -a|grep space
tcp_recvspace = 65536
tcp_sendspace = 65536
udp_recvspace = 1310720
udp_sendspace = 131072
lunardb2/#

检查其他kernal设置:
lunardb2/#lsattr -El sys0
SW_dist_intr false Enable SW distribution of interrupts True
autorestart true Automatically REBOOT OS after a crash True
boottype disk N/A False
capacity_inc 1.00 Processor capacity increment False
capped true Partition is capped False
chown_restrict true Chown Restriction Mode True
conslogin enable System Console Login False
cpuguard enable CPU Guard True
dedicated true Partition is dedicated False
enhanced_RBAC true Enhanced RBAC Mode True
ent_capacity 18.00 Entitled processor capacity False
frequency 6400000000 System Bus Frequency False
fullcore false Enable full CORE dump True
fwversion IBM,AM770_048 Firmware version and revision levels False
ghostdev 0 Recreate ODM devices on system change / modify PVID True
id_to_partition 0X800009C30A300001 Partition ID False
id_to_system 0X800009C30A300000 System ID False
iostat false Continuously maintain DISK I/O history True
keylock normal State of system keylock at boot time False
log_pg_dealloc true Log predictive memory page deallocation events True
max_capacity 24.00 Maximum potential processor capacity False
max_logname 9 Maximum login name length at boot time True
maxbuf 20 Maximum number of pages in block I/O BUFFER CACHE True
maxmbuf 0 Maximum Kbytes of real memory allowed for MBUFS True
maxpout 8193 HIGH water mark for pending write I/Os per file True
maxuproc 16384 Maximum number of PROCESSES allowed per user True 这个是手工修改的
min_capacity 12.00 Minimum potential processor capacity False
minpout 4096 LOW water mark for pending write I/Os per file True
modelname IBM,9117-MMC Machine name False
ncargs 256 ARG/ENV list size in 4K byte blocks True 这个比文档要求大了
nfs4_acl_compat secure NFS4 ACL Compatibility Mode True
ngroups_allowed 128 Number of Groups Allowed True
os_uuid 15398297-d4a2-464a-986e-756d892be8e7 N/A True
pre430core false Use pre-430 style CORE dump True
pre520tune disable Pre-520 tuning compatibility mode True
realmem 100663296 Amount of usable physical memory in Kbytes False
rtasversion 1 Open Firmware RTAS version False
sed_config select Stack Execution Disable (SED) Mode True
systemid IBM,021063E77 Hardware system identifier False
variable_weight 0 Variable processor capacity weight False
lunardb2/#

检查磁盘属性:
lunardb2/#lsattr -El hdiskpower0
PR_key_value none Reserve Key. True
clr_q yes Clear Queue (RS/6000) True
location Location True
lun_id 0x1000000000000 LUN ID False
lun_reset_spt yes FC Forced Open LUN True
max_coalesce 0x100000 Maximum coalesce size True
max_transfer 0x100000 Maximum transfer size True
pvid none Physical volume identifier False
pvid_takeover yes Takeover PVIDs from hdisks True
q_err no Use QERR bit True
q_type simple Queue TYPE False
queue_depth 32 Queue DEPTH True
reassign_to 120 REASSIGN time out value True
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
rw_timeout 40 READ/WRITE time out True
scsi_id 0x20400 SCSI ID False
start_timeout 180 START unit time out True
ww_name 0x5000097408413d24 World Wide Name False
lunardb2/#

lunardb2/#lsattr -El hdiskpower1
PR_key_value none Reserve Key. True
clr_q yes Clear Queue (RS/6000) True
location Location True
lun_id 0x2000000000000 LUN ID False
lun_reset_spt yes FC Forced Open LUN True
max_coalesce 0x100000 Maximum coalesce size True
max_transfer 0x100000 Maximum transfer size True
pvid none Physical volume identifier False
pvid_takeover yes Takeover PVIDs from hdisks True
q_err no Use QERR bit True
q_type simple Queue TYPE False
queue_depth 32 Queue DEPTH True
reassign_to 120 REASSIGN time out value True
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
rw_timeout 40 READ/WRITE time out True
scsi_id 0x20400 SCSI ID False
start_timeout 180 START unit time out True
ww_name 0x5000097408413d24 World Wide Name False
lunardb2/#lsattr -El hdiskpower2
PR_key_value none Reserve Key. True
clr_q yes Clear Queue (RS/6000) True
location Location True
lun_id 0x3000000000000 LUN ID False
lun_reset_spt yes FC Forced Open LUN True
max_coalesce 0x100000 Maximum coalesce size True
max_transfer 0x100000 Maximum transfer size True
pvid none Physical volume identifier False
pvid_takeover yes Takeover PVIDs from hdisks True
q_err no Use QERR bit True
q_type simple Queue TYPE False
queue_depth 32 Queue DEPTH True
reassign_to 120 REASSIGN time out value True
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
rw_timeout 40 READ/WRITE time out True
scsi_id 0x20400 SCSI ID False
start_timeout 180 START unit time out True
ww_name 0x5000097408413d24 World Wide Name False
lunardb2/#
建立用户组,用户和目录(简易版,如果是11.2.0.4以上,rootpre.sh会要求更为细致的组,比如asmadmin等等,具体可参考文档):
mkgroup -‘A’ id=’1000′ adms=’root’ oinstall
mkgroup -‘A’ id=’1031′ adms=’root’ dba
mkuser id=’1100′ pgrp=’oinstall’ groups=’dba’ home=’/home/grid’ grid
mkuser id=’1101′ pgrp=’oinstall’ groups=’dba’ home=’/home/oracle’ oracle
mkdir -p /u01/app/11.2.0/grid
chown -R grid:oinstall /u01
mkdir /u01/app/oracle
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/

# mkdir -p /u01/app/11.2.0/grid
# chown grid:oinstall /u01/app/11.2.0/grid
# chmod -R 775 /u01/app/11.2.0/grid
# mkdir -p /u01/app/oracle
# chown -R oracle:oinstall /u01/app/oracle
# chmod -R 775 /u01/app/oracle

修改优先级:
/usr/bin/lsuser -a capabilities grid
# /usr/bin/chuser capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE grid

/usr/bin/lsuser -a capabilities oracle
# /usr/bin/chuser capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle
修改磁盘数组为grid oinstall(如果是11.2.0.4以上,根据设置的需求,可能会要求更改为 grid dba,是具体设置而定):
lunardb2/#chown grid:oinstall /dev/rhdiskpower[0-9]
lunardb2/#ls -lrt /dev/rhdiskpower[0-9]
crw-rw—- 1 grid oinstall 43, 1 Oct 12 17:00 /dev/rhdiskpower1
crw-rw—- 1 grid oinstall 43, 0 Oct 12 17:00 /dev/rhdiskpower0
crw-rw—- 1 grid oinstall 43, 9 Oct 12 17:00 /dev/rhdiskpower9
crw-rw—- 1 grid oinstall 43, 8 Oct 12 17:00 /dev/rhdiskpower8
crw-rw—- 1 grid oinstall 43, 7 Oct 12 17:00 /dev/rhdiskpower7
crw-rw—- 1 grid oinstall 43, 6 Oct 12 17:00 /dev/rhdiskpower6
crw-rw—- 1 grid oinstall 43, 5 Oct 12 17:00 /dev/rhdiskpower5
crw-rw—- 1 grid oinstall 43, 4 Oct 12 17:00 /dev/rhdiskpower4
crw-rw—- 1 grid oinstall 43, 3 Oct 12 17:00 /dev/rhdiskpower3
crw-rw—- 1 grid oinstall 43, 2 Oct 12 17:00 /dev/rhdiskpower2
lunardb2/#

查看磁盘大小:
lunardb2/#
lunardb2/#bootinfo -s hdiskpower0
5118
lunardb2/#bootinfo -s hdiskpower1
5118
lunardb2/#bootinfo -s hdiskpower2
5118
lunardb2/#

bootinfo -s hdiskpower3
bootinfo -s hdiskpower4
bootinfo -s hdiskpower5
bootinfo -s hdiskpower6
bootinfo -s hdiskpower7
bootinfo -s hdiskpower8
bootinfo -s hdiskpower9

lunardb2/#bootinfo -s hdiskpower9
147457
lunardb2/#
数据分为两部分,DATA_DG存放数据,RECO_DG存放归档和flashback的数据:
VOT和OCR使用SYS_DG, /dev/rhdiskpower[0-2],每块盘分配了5G,共3块盘:
sys_dg: /dev/rhdiskpower[0-2]
data_dg: /dev/rhdiskpower[3-6]
reco_dg: /dev/rhdiskpower[7-9]
实际使用时,ASMCA不能识别到0~2这三个5g的盘,且根据最佳实践,也没有必要创建3个磁盘组
遗留工作:
1,查询mos,是否有相关bug和限制(install guide上只有计算方法和建议设置1g以上,没有说明5g不能被识别的问题)
2,使用这3个小盘尝试手工创建一个磁盘组,进行测试,看看报什么错。。。。。。
3,将这3个小盘删除,重建成一个15g的盘,增加到其他dg上

# chown grid:oinstall /dev/rhdiskpower0
# chmod 660 /dev/rhdiskpower0
# chown root:oinstall /dev/rora_ocr_raw_280m
# chmod 640 /dev/rora_ocr_raw_280m

设置磁盘属性:
lsattr -E -l hdiskpower0| grep reserve
lsattr -E -l hdiskpower1| grep reserve
lsattr -E -l hdiskpower2| grep reserve
lsattr -E -l hdiskpower3| grep reserve
lsattr -E -l hdiskpower4| grep reserve
lsattr -E -l hdiskpower5| grep reserve
lsattr -E -l hdiskpower6| grep reserve
lsattr -E -l hdiskpower7| grep reserve
lsattr -E -l hdiskpower8| grep reserve
lsattr -E -l hdiskpower9| grep reserve

lunardb2/#lsattr -E -l hdiskpower0| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower1| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower2| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower3| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower4| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower5| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower6| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower7| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower8| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#lsattr -E -l hdiskpower9| grep reserve
reserve_policy no_reserve Reserve Policy used to reserve device on open. True
lunardb2/#
lunardb2/#

The response is either a reserve_lock setting, or a reserve_policy setting. If
the attribute is reserve_lock, then ensure that the setting is reserve_lock =
no. If the attribute is reserve_policy, then ensure that the setting is reserve_
policy = no_reserve.
If necessary, change the setting with the chdev command using the following
syntax, where n is the hdisk device number:
chdev -l hdiskn -a [ reserve_lock=no | reserve_policy=no_reserve ]
设置用户限制:
修改/etc/security/limits:
default:
fsize = -1
core = 2097151
cpu = -1
data = -1
rss = -1
stack = -1
nofiles = -1

oracle:
fsize = -1
core = -1
cpu = -1
data = -1
rss = -1
stack = -1
nofiles = -1

grid:
fsize = -1
core = -1
cpu = -1
data = -1
rss = -1
stack = -1
nofiles = -1
启动NTP:
修改/etc/rc.tcpip ,主意下面的一行为修改后的:
start /usr/sbin/xntpd “$src_running” “-x”

启动NTP服务:
startsrc -s xntpd -a “-x”
11.2,中,配置SSH需要作如下设置:
By default, OUI searches for SSH public keys in the directory /usr/local/etc/, and
ssh-keygen binaries in /usr/local/bin. However, on AIX, SSH public keys
typically are located in the path /etc/ssh, and ssh-keygen binaries are located in
the path /usr/bin. To ensure that OUI can set up SSH, use the following command to
create soft links:
# ln -s /etc/ssh /usr/local/etc
# ln -s /usr/bin /usr/local/bin

配置root环境变量:
====================================================================
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:$PATH

if [ -t 0 ]; then
stty intr ^C
fi

export AIXTHREAD_SCOPE=S

set -o vi
alias ll=”ls -lrt”

配置grid和oracle用户的环境变量:
asm1
=======================================
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM1
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:$PATH

if [ -t 0 ]; then
stty intr ^C
fi

export PS1=`hostname`”:”\$PWD”>”

export AIXTHREAD_SCOPE=S

set -o vi
alias ll=”ls -lrt”
alias ss=”sqlplus / sysasm”
asm2
=======================================
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM2
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:$PATH

if [ -t 0 ]; then
stty intr ^C
fi

export AIXTHREAD_SCOPE=S

export PS1=`hostname`”:”\$PWD”>”

set -o vi
alias ll=”ls -lrt”
alias ss=”sqlplus / sysasm”
qgdb1
=======================================
export ORACLE_BASE=/u01/app
export ORACLE_HOME=/u01/app/oracle
export ORACLE_SID=qgdb1
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:$PATH

if [ -t 0 ]; then
stty intr ^C
fi

export AIXTHREAD_SCOPE=S

export PS1=`hostname`”:”\$PWD”>”
set -o vi
alias ll=”ls -lrt”
alias ss=”sqlplus / sysdba”
qgdb2
=======================================
export ORACLE_BASE=/u01/app
export ORACLE_HOME=/u01/app/oracle
export ORACLE_SID=qgdb2
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:$PATH

if [ -t 0 ]; then
stty intr ^C
fi

export AIXTHREAD_SCOPE=S

export PS1=`hostname`”:”\$PWD”>”
set -o vi
alias ll=”ls -lrt”
alias ss=”sqlplus / sysdba”

bjdb1
=======================================
export ORACLE_BASE=/u01/app
export ORACLE_HOME=/u01/app/oracle
export ORACLE_SID=bjdb1
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:$PATH

if [ -t 0 ]; then
stty intr ^C
fi

export AIXTHREAD_SCOPE=S

export PS1=`hostname`”:”\$PWD”>”
set -o vi
alias ll=”ls -lrt”
alias ss=”sqlplus / sysdba”
bjdb2
=======================================
export ORACLE_BASE=/u01/app
export ORACLE_HOME=/u01/app/oracle
export ORACLE_SID=bjdb2
export PATH=$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:$PATH

if [ -t 0 ]; then
stty intr ^C
fi

export AIXTHREAD_SCOPE=S

export PS1=`hostname`”:”\$PWD”>”
set -o vi
alias ll=”ls -lrt”
alias ss=”sqlplus / sysdba”

启动安装进程前,使用root运行rootpre.sh,在两个节点分别执行:
# ./rootpre.sh
主意,如果是11.2.0.4,检查相对以前版本更加严格,比如对于SSH还要检查加密算法,对于用户数组,尤其是gird的数组,要求划分更为细致,因此有两个方法:
1,根据11.2.0.4的rootpre运行结果,一次解决问题,然后执行
2,使用11.2.0.1的rootpre分别在集群的所有节点运行

lunardb1:/tmp/oracle/database#./rootpre.sh
./rootpre.sh output will be logged in /tmp/rootpre.out_13-10-15.15:58:08
Saving the original files in /etc/ora_save_13-10-15.15:58:08….
Copying new kernel extension to /etc….
Loading the kernel extension from /etc

Oracle Kernel Extension Loader for AIX
Copyright (c) 1998,1999 Oracle Corporation
Kernel Extension /etc/pw-syscall.64bit_kernel already loaded, unloading it
Unconfigured the kernel extension successfully
Unloaded the kernel extension successfully
Successfully loaded /etc/pw-syscall.64bit_kernel with kmid: 0x50ef5000
Successfully configured /etc/pw-syscall.64bit_kernel with kmid: 0x50ef5000
The kernel extension was successfuly loaded.

Checking if group services should be configured….
Nothing to configure.
lunardb1:/tmp/oracle/database#
*******************************************************************************
在第一个节点和第二个节点分别执行$ORACLE_BASE/oraInventory/orainstRoot.sh,修改inventory的属组和权限:
lunardb1/#/u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
lunardb1/#

lunardb1/#
在第一个节点执行root.sh:
lunardb1/#/u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script…

The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin …
Copying oraenv to /usr/local/bin …
Copying coraenv to /usr/local/bin …
Creating /etc/oratab file…
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2013-10-15 15:30:14: Parsing the host name
2013-10-15 15:30:14: Checking for super user privileges
2013-10-15 15:30:14: User has super user privileges
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User grid has the required capabilities to run CSSD in realtime mode
LOCAL ADD MODE
Creating OCR keys for user ‘root’, privgrp ‘system’..
Operation successful.
root wallet
root wallet cert
root cert export
peer wallet
profile reader wallet
pa wallet
peer wallet keys
pa wallet keys
peer cert request
pa cert request
peer cert
pa cert
peer root cert TP
profile reader root cert TP
pa root cert TP
peer pa cert TP
pa peer cert TP
profile reader pa cert TP
profile reader peer cert TP
peer user cert
pa user cert
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
CRS-2672: Attempting to start ‘ora.gipcd’ on ‘lunardb1’
CRS-2672: Attempting to start ‘ora.mdnsd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.gipcd’ on ‘lunardb1’ succeeded
CRS-2676: Start of ‘ora.mdnsd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.gpnpd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.gpnpd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.cssdmonitor’ on ‘lunardb1’
CRS-2676: Start of ‘ora.cssdmonitor’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.cssd’ on ‘lunardb1’
CRS-2672: Attempting to start ‘ora.diskmon’ on ‘lunardb1’
CRS-2676: Start of ‘ora.diskmon’ on ‘lunardb1’ succeeded
CRS-2676: Start of ‘ora.cssd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.ctssd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.ctssd’ on ‘lunardb1’ succeeded

ASM created and started successfully.

DiskGroup DATA_DG created successfully.

clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root’, privgrp ‘system’..
Operation successful.
CRS-2672: Attempting to start ‘ora.crsd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.crsd’ on ‘lunardb1’ succeeded
CRS-4256: Updating the profile
Successful addition of voting disk 94838a7fc3ec4f3abf5b67c086006d16.
Successfully replaced voting disk group with +DATA_DG.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
## STATE File Universal Id File Name Disk group
— —– —————– ——— ———
1. ONLINE 94838a7fc3ec4f3abf5b67c086006d16 (/dev/rhdiskpower3) [DATA_DG]
Located 1 voting disk(s).
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘lunardb1’
CRS-2677: Stop of ‘ora.crsd’ on ‘lunardb1’ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ‘lunardb1’
CRS-2677: Stop of ‘ora.asm’ on ‘lunardb1’ succeeded
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘lunardb1’
CRS-2677: Stop of ‘ora.ctssd’ on ‘lunardb1’ succeeded
CRS-2673: Attempting to stop ‘ora.cssdmonitor’ on ‘lunardb1’
CRS-2677: Stop of ‘ora.cssdmonitor’ on ‘lunardb1’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘lunardb1’
CRS-2677: Stop of ‘ora.cssd’ on ‘lunardb1’ succeeded
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘lunardb1’
CRS-2677: Stop of ‘ora.gpnpd’ on ‘lunardb1’ succeeded
CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘lunardb1’
CRS-2677: Stop of ‘ora.gipcd’ on ‘lunardb1’ succeeded
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘lunardb1’
CRS-2677: Stop of ‘ora.mdnsd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.mdnsd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.mdnsd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.gipcd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.gipcd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.gpnpd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.gpnpd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.cssdmonitor’ on ‘lunardb1’
CRS-2676: Start of ‘ora.cssdmonitor’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.cssd’ on ‘lunardb1’
CRS-2672: Attempting to start ‘ora.diskmon’ on ‘lunardb1’
CRS-2676: Start of ‘ora.diskmon’ on ‘lunardb1’ succeeded
CRS-2676: Start of ‘ora.cssd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.ctssd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.ctssd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.asm’ on ‘lunardb1’
CRS-2676: Start of ‘ora.asm’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.crsd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.crsd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.evmd’ on ‘lunardb1’
CRS-2676: Start of ‘ora.evmd’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.asm’ on ‘lunardb1’
CRS-2676: Start of ‘ora.asm’ on ‘lunardb1’ succeeded
CRS-2672: Attempting to start ‘ora.DATA_DG.dg’ on ‘lunardb1’
CRS-2676: Start of ‘ora.DATA_DG.dg’ on ‘lunardb1’ succeeded

lunardb1 2013/10/15 15:37:24 /u01/app/11.2.0/grid/cdata/lunardb1/backup_20131015_153724.olr
Configure Oracle Grid Infrastructure for a Cluster … succeeded
Updating inventory properties for clusterware
Starting Oracle Universal Installer…

Checking swap space: must be greater than 500 MB. Actual 65536 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
‘UpdateNodeList’ was successful.
lunardb1/#

lunardb1/#ps -ef|grep d.bin
root 4456530 1 0 15:32:27 – 0:04 /u01/app/11.2.0/grid/bin/ohasd.bin reboot
grid 4522138 1 0 15:35:22 – 0:00 /u01/app/11.2.0/grid/bin/gpnpd.bin
root 5046320 1 0 15:36:36 – 0:00 /u01/app/11.2.0/grid/bin/oclskd.bin
root 5242960 1 0 15:37:04 – 0:01 /u01/app/11.2.0/grid/bin/orarootagent.bin
root 2228696 1 0 15:35:26 – 0:00 /bin/sh /u01/app/11.2.0/grid/bin/ocssd
grid 3080542 1 0 15:35:18 – 0:00 /u01/app/11.2.0/grid/bin/oraagent.bin
root 3146224 1 0 15:35:26 – 0:00 /u01/app/11.2.0/grid/bin/cssdagent
grid 3211576 1 0 15:35:18 – 0:00 /u01/app/11.2.0/grid/bin/mdnsd.bin
grid 3408338 1 0 15:35:20 – 0:00 /u01/app/11.2.0/grid/bin/gipcd.bin
grid 3604800 2228696 1 15:35:26 – 0:01 /u01/app/11.2.0/grid/bin/ocssd.bin
grid 3998018 1 0 15:37:21 – 0:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit
root 2556504 1 0 15:36:34 – 0:01 /u01/app/11.2.0/grid/bin/crsd.bin reboot
root 3015312 1 0 15:35:24 – 0:00 /u01/app/11.2.0/grid/bin/cssdmonitor
grid 3670680 1 0 15:35:26 – 0:00 /u01/app/11.2.0/grid/bin/diskmon.bin -d -f
grid 3998212 1 0 15:36:56 – 0:00 /u01/app/11.2.0/grid/bin/oraagent.bin
grid 4129292 1 0 15:36:36 – 0:00 /u01/app/11.2.0/grid/bin/evmd.bin
root 4325942 4128828 0 15:40:11 pts/0 0:00 grep d.bin
root 3605266 1 0 15:36:13 – 0:00 /u01/app/11.2.0/grid/bin/octssd.bin
grid 3802090 4129292 0 15:36:38 – 0:00 /u01/app/11.2.0/grid/bin/evmlogger.bin -o /u01/app/11.2.0/grid/evm/log/evmlogger.info -l /u01/app/11.2.0/grid/evm/log/evmlogger.log
root 3867418 1 0 15:35:26 – 0:00 /u01/app/11.2.0/grid/bin/orarootagent.bin
grid 4260618 1 0 15:36:22 – 0:00 /u01/app/11.2.0/grid/bin/oclskd.bin
lunardb1/#
在第二个节点执行root.sh:
lunardb2/#/u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script…

The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin …
Copying oraenv to /usr/local/bin …
Copying coraenv to /usr/local/bin …
Creating /etc/oratab file…
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2013-10-15 15:39:01: Parsing the host name
2013-10-15 15:39:01: Checking for super user privileges
2013-10-15 15:39:01: User has super user privileges
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User grid has the required capabilities to run CSSD in realtime mode
LOCAL ADD MODE
Creating OCR keys for user ‘root’, privgrp ‘system’..
Operation successful.
Adding daemon to inittab
CRS-4123: Oracle High Availability Services has been started.
ohasd is starting
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node lunardb1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
CRS-2672: Attempting to start ‘ora.mdnsd’ on ‘lunardb2’
CRS-2676: Start of ‘ora.mdnsd’ on ‘lunardb2’ succeeded
CRS-2672: Attempting to start ‘ora.gipcd’ on ‘lunardb2’
CRS-2676: Start of ‘ora.gipcd’ on ‘lunardb2’ succeeded
CRS-2672: Attempting to start ‘ora.gpnpd’ on ‘lunardb2’
CRS-2676: Start of ‘ora.gpnpd’ on ‘lunardb2’ succeeded
CRS-2672: Attempting to start ‘ora.cssdmonitor’ on ‘lunardb2’
CRS-2676: Start of ‘ora.cssdmonitor’ on ‘lunardb2’ succeeded
CRS-2672: Attempting to start ‘ora.cssd’ on ‘lunardb2’
CRS-2672: Attempting to start ‘ora.diskmon’ on ‘lunardb2’
CRS-2676: Start of ‘ora.diskmon’ on ‘lunardb2’ succeeded
CRS-2676: Start of ‘ora.cssd’ on ‘lunardb2’ succeeded
CRS-2672: Attempting to start ‘ora.ctssd’ on ‘lunardb2’
CRS-2676: Start of ‘ora.ctssd’ on ‘lunardb2’ succeeded
CRS-2672: Attempting to start ‘ora.asm’ on ‘lunardb2’
CRS-2676: Start of ‘ora.asm’ on ‘lunardb2’ succeeded
CRS-2672: Attempting to start ‘ora.crsd’ on ‘lunardb2’
CRS-2676: Start of ‘ora.crsd’ on ‘lunardb2’ succeeded
CRS-2672: Attempting to start ‘ora.evmd’ on ‘lunardb2’
CRS-2676: Start of ‘ora.evmd’ on ‘lunardb2’ succeeded

lunardb2 2013/10/15 15:42:03 /u01/app/11.2.0/grid/cdata/lunardb2/backup_20131015_154203.olr
Configure Oracle Grid Infrastructure for a Cluster … succeeded
Updating inventory properties for clusterware
Starting Oracle Universal Installer…

Checking swap space: must be greater than 500 MB. Actual 65536 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/app/oraInventory
‘UpdateNodeList’ was successful.
lunardb2/#
lunardb1:/#crsctl status res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA_DG.dg
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.asm
ONLINE ONLINE lunardb1 Started
ONLINE ONLINE lunardb2 Started
ora.eons
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.gsd
OFFLINE OFFLINE lunardb1
OFFLINE OFFLINE lunardb2
ora.net1.network
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.ons
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE lunardb1
ora.oc4j
1 OFFLINE OFFLINE
ora.lunardb1.vip
1 ONLINE ONLINE lunardb1
ora.lunardb2.vip
1 ONLINE ONLINE lunardb2
ora.scan1.vip
1 ONLINE ONLINE lunardb1
lunardb1:/#

安装过程中,比较考验RP的是远程拷贝文件的过程,grid大概需要15~30分钟,oracle大概需要30~50分钟,。。。。。。。。。

安装grid,远程copy文件,走public网络:
-topas_nmon–q=Quit————-Host=lunardb2——Refresh=2 secs—13:55.43————————————————————————————————————————————————————–+
| Network ———————————————————————————————————————————————————————————————————————————-|
|I/F Name Recv=KB/s Trans=KB/s packin packout insize outsize Peak->Recv TransKB |
| en4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 |
| en10 64651.8 901.2 46026.3 15377.6 1438.4 60.0 64651.8 901.2 |
| en11 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 |
| lo0 0.1 0.1 1.0 1.0 52.0 52.0 0.3 0.3 |
| Total 63.1 0.9 in Mbytes/second Overflow=0 |
|I/F Name MTU ierror oerror collision Mbits/s Description |
| en4 1500 0 0 0 1024 Standard Ethernet Network Interface |
| en10 1500 0 0 0 1024 Standard Ethernet Network Interface |
| en11 1500 0 0 0 1024 Standard Ethernet Network Interface |
| lo0 16896 0 0 0 0 Loopback Network Interface |
|——————————————————————————————————————————————————————————————–
安装oracle,远程copy文件,两个网络都走:
+-topas_nmon–d=Disk-Graph——-Host=lunardb2——Refresh=2 secs—14:58.48————————————————————————————————————————————————————–+
| Network ———————————————————————————————————————————————————————————————————————————-|
|I/F Name Recv=KB/s Trans=KB/s packin packout insize outsize Peak->Recv TransKB |
| en4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 |
| en10 0.7 0.9 10.5 10.5 69.1 89.3 1999.3 10872.3 |
| en11 68.2 99.9 65.0 88.5 1073.8 1155.7 95969.5 138985.1 |
| lo0 4.8 4.8 3.0 3.0 1627.3 1627.3 6760.4 6760.4 |
| Total 0.1 0.1 in Mbytes/second Overflow=0 |
|I/F Name MTU ierror oerror collision Mbits/s Description |
| en4 1500 0 0 0 1024 Standard Ethernet Network Interface |
| en10 1500 0 0 0 1024 Standard Ethernet Network Interface |
| en11 1500 0 0 0 1024 Standard Ethernet Network Interface |
| lo0 16896 0 0 0 0 Loopback Network Interface |
|———————————————————————————-
+-topas_nmon–l=LongTerm-CPU—–Host=lunardb2——Refresh=2 secs—15:23.34————————————————————————————————————————————————————–+
| Network ———————————————————————————————————————————————————————————————————————————-|
|I/F Name Recv=KB/s Trans=KB/s packin packout insize outsize Peak->Recv TransKB |
| en4 0.0 0.0 0.0 0.0 0.0 0.0 0.1 0.2 |
| en10 18291.5 257.9 13041.3 4391.8 1436.2 60.1 103965.8 10872.3 |
| en11 2.0 0.8 5.0 4.0 417.1 198.2 95969.5 138985.1 |
| lo0 0.2 0.2 3.0 3.0 52.7 52.7 6760.4 6760.4 |
| Total 17.9 0.3 in Mbytes/second Overflow=0 |
|I/F Name MTU ierror oerror collision Mbits/s Description |
| en4 1500 0 0 0 1024 Standard Ethernet Network Interface |
| en10 1500 0 0 0 1024 Standard Ethernet Network Interface |
| en11 1500 0 0 0 1024 Standard Ethernet Network Interface |
| lo0 16896 0 0 0 0 Loopback Network Interface |
|—————————————————————————————–
配置环境时,11.2.0.4的check比较严格,比较好的做法是规范化环境,逐个排除问题,设置好环境(主要还是数组,权限,一些安全限制等等比较多)
如果环境特殊,也可以考虑使用11.2.0.1绕过去作为一个workround,O(∩_∩)O哈哈~

lunardb1:/tmp/oracle#/u01/app/oracle/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of “dbhome” have not changed. No need to overwrite.
The contents of “oraenv” have not changed. No need to overwrite.
The contents of “coraenv” have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
lunardb1:/tmp/oracle#

lunardb2:/u01#du -ks
18895048 .
lunardb2:/u01#/u01/app/oracle/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of “dbhome” have not changed. No need to overwrite.
The contents of “oraenv” have not changed. No need to overwrite.
The contents of “coraenv” have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
lunardb2:/u01#
lunardb1:/tmp/oracle#crsctl status res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA_DG.dg
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.LISTENER.lsnr
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.asm
ONLINE ONLINE lunardb1 Started
ONLINE ONLINE lunardb2 Started
ora.gsd
OFFLINE OFFLINE lunardb1
OFFLINE OFFLINE lunardb2
ora.net1.network
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.ons
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.registry.acfs
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE lunardb1
ora.cvu
1 ONLINE ONLINE lunardb1
ora.oc4j
1 ONLINE ONLINE lunardb1
ora.lunardb1.vip
1 ONLINE ONLINE lunardb1
ora.lunardb2.vip
1 ONLINE ONLINE lunardb2
ora.scan1.vip
1 ONLINE ONLINE lunardb1
lunardb1:/tmp/oracle#
lunardb1/home/grid>lsnrctl status

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.4.0 – Production on 16-OCT-2013 16:14:57

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.4.0 – Production
Start Date 16-OCT-2013 14:28:11
Uptime 0 days 1 hr. 46 min. 48 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/lunardb1/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.12.110)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.12.112)(PORT=1521)))
Services Summary…
Service “+ASM” has 1 instance(s).
Instance “+ASM1”, status READY, has 1 handler(s) for this service…
Service “qgdb” has 1 instance(s).
Instance “qgdb1”, status READY, has 1 handler(s) for this service…
Service “qgdbXDB” has 1 instance(s).
Instance “qgdb1”, status READY, has 1 handler(s) for this service…
The command completed successfully
lunardb1/home/grid>
lunardb1/home/grid>crsctl status res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA_DG.dg
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.LISTENER.lsnr
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.RECO_DG.dg
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.asm
ONLINE ONLINE lunardb1 Started
ONLINE ONLINE lunardb2 Started
ora.gsd
OFFLINE OFFLINE lunardb1
OFFLINE OFFLINE lunardb2
ora.net1.network
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.ons
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.registry.acfs
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE lunardb1
ora.cvu
1 ONLINE ONLINE lunardb1
ora.oc4j
1 ONLINE ONLINE lunardb1
ora.lunardb1.vip
1 ONLINE ONLINE lunardb1
ora.lunardb2.vip
1 ONLINE ONLINE lunardb2
ora.qgdb.db
1 OFFLINE OFFLINE
2 OFFLINE OFFLINE
ora.scan1.vip
1 ONLINE ONLINE lunardb1
lunardb1/home/grid>
lunardb2/home/grid>lsnrctl status

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.4.0 – Production on 16-OCT-2013 16:15:58

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.4.0 – Production
Start Date 16-OCT-2013 14:28:10
Uptime 0 days 1 hr. 47 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/lunardb2/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.12.111)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.12.113)(PORT=1521)))
Services Summary…
Service “+ASM” has 1 instance(s).
Instance “+ASM2”, status READY, has 1 handler(s) for this service…
The command completed successfully
lunardb2/home/grid>
lunardb1:/#crsctl status res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA_DG.dg
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.LISTENER.lsnr
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.RECO_DG.dg
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.asm
ONLINE ONLINE lunardb1 Started
ONLINE ONLINE lunardb2 Started
ora.gsd
OFFLINE OFFLINE lunardb1
OFFLINE OFFLINE lunardb2
ora.net1.network
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.ons
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
ora.registry.acfs
ONLINE ONLINE lunardb1
ONLINE ONLINE lunardb2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE lunardb1
ora.cvu
1 ONLINE ONLINE lunardb1
ora.oc4j
1 ONLINE ONLINE lunardb1
ora.lunardb1.vip
1 ONLINE ONLINE lunardb1
ora.lunardb2.vip
1 ONLINE ONLINE lunardb2
ora.qgdb.db
1 ONLINE ONLINE lunardb1 Open
2 ONLINE ONLINE lunardb2 Open
ora.scan1.vip
1 ONLINE ONLINE lunardb1
lunardb1:/#
lunardb1/home/grid>lsnrctl

LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.4.0 – Production on 17-OCT-2013 10:09:08

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

Welcome to LSNRCTL, type “help” for information.

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for IBM/AIX RISC System/6000: Version 11.2.0.4.0 – Production
Start Date 16-OCT-2013 14:28:11
Uptime 0 days 19 hr. 41 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/lunardb1/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.12.110)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.12.112)(PORT=1521)))
Services Summary…
Service “+ASM” has 1 instance(s).
Instance “+ASM1”, status READY, has 1 handler(s) for this service…
Service “qgdb” has 1 instance(s).
Instance “qgdb1”, status READY, has 1 handler(s) for this service…
Service “qgdbXDB” has 1 instance(s).
Instance “qgdb1”, status READY, has 1 handler(s) for this service…
The command completed successfully
LSNRCTL> service
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
Services Summary…
Service “+ASM” has 1 instance(s).
Instance “+ASM1”, status READY, has 1 handler(s) for this service…
Handler(s):
“DEDICATED” established:1304 refused:0 state:ready
LOCAL SERVER
Service “qgdb” has 1 instance(s).
Instance “qgdb1”, status READY, has 1 handler(s) for this service…
Handler(s):
“DEDICATED” established:1240 refused:0 state:ready
LOCAL SERVER
Service “qgdbXDB” has 1 instance(s).
Instance “qgdb1”, status READY, has 1 handler(s) for this service…
Handler(s):
“D000” established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: lunardb1, pid: 6029852>
(ADDRESS=(PROTOCOL=tcp)(HOST=lunardb1)(PORT=13791))
The command completed successfully
LSNRCTL>
gisqgdb1:/#su – oracle
lunardb1/home/oracle>cd $ORACLE_HOME
lunardb1/u01/app/oracle>cd network
lunardb1/u01/app/oracle/network>cd admin
lunardb1/u01/app/oracle/network/admin>ls
samples shrept.lst tnsnames.ora
lunardb1/u01/app/oracle/network/admin>cat tn*
# tnsnames.ora Network Configuration File: /u01/app/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

QGDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = lunarqg-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = qgdb)
)
)

lunardb1/u01/app/oracle/network/admin>sqlplus system/oracle@qgdb

SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 17 10:31:23 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, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
lunardb1/u01/app/oracle/network/admin>

常见问题:
SSH-问题1:
====================
INFO: Unable to find /usr/local/bin/ssh-keygen on node: pgisqgdb1
INFO: Home Dir /home/grid
INFO: Lock Location : /home/grid/.ssh/lock
INFO: Releasing Lock…
INFO: Lock Released
解决方法:设置目录连接,文档表述如下:
By default, OUI searches for SSH public keys in the directory /usr/local/etc/, and
ssh-keygen binaries in /usr/local/bin. However, on AIX, SSH public keys
typically are located in the path /etc/ssh, and ssh-keygen binaries are located in
the path /usr/bin. To ensure that OUI can set up SSH, use the following command to
create soft links:
# ln -s /etc/ssh /usr/local/etc
# ln -s /usr/bin /usr/local/bin
pgisqgdb2/#which ssh
/usr/bin/ssh
pgisqgdb2/#which scp
/usr/bin/scp
pgisqgdb2/#ls /usr/bin/ssh-keygen
/usr/bin/ssh-keygen
pgisqgdb2/#

pgisqgdb1/#mkdir -p /usr/local
pgisqgdb1/#ln -s /etc/ssh /usr/local/etc
pgisqgdb1/#ln -s /usr/bin /usr/local/bin
pgisqgdb1/#cd /usr/local
pgisqgdb1/usr/local#ls
bin etc
pgisqgdb1/usr/local#
SSH问题2:
==========================================
INFO: Lock Retry Count 120
INFO: Lock Sleep Time 30000
INFO: Home Dir /home/grid
INFO: Lock Location : /home/grid/.ssh/lock
INFO: Trying to get Lock ….
INFO: Lock Acquired
INFO: LIBRARY_LOC = /tmp/OraInstall2013-10-15_02-07-32PM/oui/lib/aix
INFO: Validating remote binaries..
INFO: [pgisqgdb1]
INFO: /bin/bash -c ‘/bin/true’
INFO: Exit-status: 0
INFO: Error:
INFO:
INFO:
INFO: [pgisqgdb1]
INFO: /bin/bash -c ‘if [[ -f /etc/ssh/ssh_host_rsa_key.pub ]] ; then exit 0; else exit 1; fi’
INFO: Exit-status: 0
INFO: Error:
INFO:
INFO:
INFO: [pgisqgdb1]
INFO: /bin/bash -c ‘if [[ -f /usr/local/bin/ssh-keygen ]] ; then exit 0; else exit 1; fi’
INFO: Exit-status: 0
INFO: Error:
INFO:
INFO:
INFO: [pgisqgdb2]
INFO: /bin/bash -c ‘/bin/true’
INFO: Exit-status: 127
INFO: Error: ksh: /bin/bash: not found.

INFO:
INFO:
INFO: Existence check failed for /bin/bash on node: pgisqgdb2
INFO: Home Dir /home/grid
INFO: Lock Location : /home/grid/.ssh/lock
INFO: Releasing Lock…
INFO: Lock Released

解决方法:
安装bash包
如果使用11.2.0.4会提示一些很无聊的错误,比如,你的udp设置比文档大,文档是65535,你设置了128k,那么也会有warning,还以oracle的脚本写的有问题(11.2.0.1没这个问题)。。。。。。忽略之。。。

发表在 Installation and Deinstall, RAC | 标签为 , , | 留下评论

AIX环境下11.2 rac的快速卸载脚本

以下脚本(支持11.2.0.4和以前的11.2版本),如果不是很熟悉自己环境或者脚本含义,可以逐步执行:

crsctl stop crs
crsctl disable crs

rm /etc/rc.d/rc2.d/K96init.crs
rm /etc/rc.d/rc2.d/S96init.crs

rm -f /etc/init.tfa
rm -f /etc/inittab.tfa
rm -f /etc/init.ohasd
rm /etc/inittab.crs
cp /etc/inittab.no_crs /etc/inittab

rm -rf /etc/oratab
rm -rf /etc/oraIn*
rm -rf /etc/oracle*
rm -rf /etc/ora*

rm -rf $ORACLE_BASE

rm -rf /tmp/.oracle
rm -rf /tmp/ora*
rm -rf /var/tmp/.oracle

rm -rf /tmp/CVU*
rm -rf /tmp/Ora*
rm -rf /home/grid/.oracle
dd if=/dev/zero of=/dev/rhdiskpower3 bs=1M count=256
dd if=/dev/zero of=/dev/rhdiskpower4 bs=1M count=256
dd if=/dev/zero of=/dev/rhdiskpower5 bs=1M count=256
dd if=/dev/zero of=/dev/rhdiskpower6 bs=1M count=256
dd if=/dev/zero of=/dev/rhdiskpower7 bs=1M count=256
dd if=/dev/zero of=/dev/rhdiskpower8 bs=1M count=256
dd if=/dev/zero of=/dev/rhdiskpower9 bs=1M count=256
shutdown -Fr

发表在 Installation and Deinstall, RAC, Scripts | 标签为 , , | 留下评论

重温旧梦–RedhatAdvance Server2上安装Oracle 8.0.5

翻箱倒柜找到了以前的一个老vm,RedhatAdvance Server2,于是琢磨着在上面安装Oracle 8.0.5,回想十几年前,多有意思的经历啊,o(∩_∩)o 哈哈

看了下主机名,想不起来当时这个是为什么做的vm了,为啥叫做那么怪异名字。。。这个vm不改了,下一个弄815的时候,改成lunar,o(∩_∩)o 哈哈

RH ADS2 安装805

发表在 Oracle 8 & Oracle 8i | 标签为 , | 留下评论

解决奇怪的 ORA-12547 TNS lost contact

很久以前的一个老vm,忽然sqlplus不能使用,直接报错:

[oracle@gg admin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 15 21:10:35 2013

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

ERROR:
ORA-12547: TNS:lost contact


Enter user-name: 
ERROR:
ORA-12547: TNS:lost contact


Enter user-name: 
[oracle@gg admin]$ 

sqlplus1
sqlplus2

[oracle@gg ~]$ oerr ora 12560
12560, 00000, "TNS:protocol adapter error"
// *Cause: A generic protocol adapter error occurred.
// *Action: Check addresses used for proper protocol specification. Before
// reporting this error, look at the error stack and check for lower level
// transport errors. For further details, turn on tracing and reexecute the
// operation. Turn off tracing when the operation is complete.
[oracle@gg ~]$


[oracle@gg admin]$ cat sqlnet.log


***********************************************************************
Fatal NI connect error 12547, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/home/oracle/oracle/product/10.2.0/db_1/bin/oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=sqlplus)(HOST=gg.oracle.linux)(USER=oracle))))

  VERSION INFORMATION:
        TNS for Linux: Version 10.2.0.1.0 - Production
        Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
  Time: 15-SEP-2013 21:10:35
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12547
    TNS-12547: TNS:lost contact
    ns secondary err code: 12560
    nt main err code: 517
    TNS-00517: Lost contact
    nt secondary err code: 32
    nt OS err code: 0


***********************************************************************
Fatal NI connect error 12547, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/home/oracle/oracle/product/10.2.0/db_1/bin/oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=sqlplus)(HOST=gg.oracle.linux)(USER=oracle))))

  VERSION INFORMATION:
        TNS for Linux: Version 10.2.0.1.0 - Production
        Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
  Time: 15-SEP-2013 21:10:36
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12547
    TNS-12547: TNS:lost contact
    ns secondary err code: 12560
    nt main err code: 517
    TNS-00517: Lost contact
    nt secondary err code: 32
    nt OS err code: 0


***********************************************************************
Fatal NI connect error 12547, connecting to:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/home/oracle/oracle/product/10.2.0/db_1/bin/oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=sqlplus)(HOST=gg.oracle.linux)(USER=oracle))))

  VERSION INFORMATION:
        TNS for Linux: Version 10.2.0.1.0 - Production
        Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
  Time: 15-SEP-2013 21:11:08
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12547
    TNS-12547: TNS:lost contact
    ns secondary err code: 12560
    nt main err code: 517
    TNS-00517: Lost contact
    nt secondary err code: 32
    nt OS err code: 0
[oracle@gg admin]$ 
[oracle@gg admin]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.

127.0.0.1       localhost.localdomain   localhost

192.168.30.16   com.oracle.linux        com
192.168.30.19   gg.oracle.linux         gg

192.168.30.2    lunar-cn


[oracle@gg admin]$ 

[oracle@gg ~]$ oerr ora 12560
12560, 00000, "TNS:protocol adapter error"
// *Cause: A generic protocol adapter error occurred.
// *Action: Check addresses used for proper protocol specification. Before
// reporting this error, look at the error stack and check for lower level
// transport errors. For further details, turn on tracing and reexecute the
// operation. Turn off tracing when the operation is complete.
[oracle@gg ~]$ 


[root@gg network-scripts]# rpm -qa libaio*
libaio-0.3.105-2
[root@gg network-scripts]# 


[oracle@gg ~]$ tnsping ggt

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 15-SEP-2013 22:09:23

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

Used parameter files:
/home/oracle/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = gg.oracle.linux)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.oracle.com)))
OK (0 msec)
[oracle@gg ~]$

[root@gg network-scripts]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:B7:9E:F4  
          inet addr:192.168.30.19  Bcast:192.168.30.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:feb7:9ef4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:917 errors:0 dropped:0 overruns:0 frame:0
          TX packets:834 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:84967 (82.9 KiB)  TX bytes:107279 (104.7 KiB)
          Interrupt:185 Base address:0x1400 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1249 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1249 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1570048 (1.4 MiB)  TX bytes:1570048 (1.4 MiB)

[root@gg network-scripts]# ping 192.168.30.19
PING 192.168.30.19 (192.168.30.19) 56(84) bytes of data.
64 bytes from 192.168.30.19: icmp_seq=0 ttl=64 time=0.027 ms
64 bytes from 192.168.30.19: icmp_seq=1 ttl=64 time=0.027 ms

--- 192.168.30.19 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.027/0.027/0.027/0.000 ms, pipe 2
[root@gg network-scripts]#

Strace sqlplus / as sysdba
有如下信息:

open("/home/oracle/sqlnet.log", O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666) = 8
fstat64(8, {st_mode=S_IFREG|0644, st_size=22137, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f09000
fstat64(8, {st_mode=S_IFREG|0644, st_size=22137, ...}) = 0
_llseek(8, 22137, [22137], SEEK_SET)    = 0
fcntl64(8, F_SETFD, FD_CLOEXEC)         = 0
write(8, "\n\n******************************"..., 73) = 73
_llseek(8, 0, [22210], SEEK_CUR)        = 0
write(8, "\nFatal NI connect error 12547, c"..., 306) = 306
_llseek(8, 0, [22516], SEEK_CUR)        = 0
gettimeofday({1379252277, 703250}, NULL) = 0
write(8, "\n  VERSION INFORMATION:\n\tTNS for"..., 223) = 223
_llseek(8, 0, [22739], SEEK_CUR)        = 0
write(8, "  Time: 15-SEP-2013 21:37:57\n", 29) = 29
_llseek(8, 0, [22768], SEEK_CUR)        = 0
write(8, "  Tracing not turned on.\n", 25) = 25
_llseek(8, 0, [22793], SEEK_CUR)        = 0
write(8, "  Tns error struct:\n", 20)   = 20
_llseek(8, 0, [22813], SEEK_CUR)        = 0
write(8, "    ns main err code: 12547\n", 28) = 28
_llseek(8, 0, [22841], SEEK_CUR)        = 0
open("/home/oracle/oracle/product/10.2.0/db_1/network/mesg/tnsus.msb", O_RDONLY) = 9
fcntl64(9, F_SETFD, FD_CLOEXEC)         = 0
lseek(9, 0, SEEK_SET)                   = 0
read(9, "\25\23\"\1\23\3\t\t\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 256) = 256
lseek(9, 512, SEEK_SET)                 = 512
read(9, "\2331\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
lseek(9, 1024, SEEK_SET)                = 1024
read(9, "\t\0\22\0\32\0&\0-\0F\0N\0U\0\\\0k\0w\0\201\0\212\0\223"..., 170) = 170
lseek(9, 39936, SEEK_SET)               = 39936
read(9, "\16\0\0001\0\0\\\0\0011\0\0\213\0\0021\0\0\306\0\0031\0"..., 512) = 512
write(8, "    ", 4)                     = 4
_llseek(8, 0, [22845], SEEK_CUR)        = 0
write(8, "TNS-12547: TNS:lost contact\n", 28) = 28
_llseek(8, 0, [22873], SEEK_CUR)        = 0
write(8, "    ns secondary err code: 12560"..., 33) = 33
_llseek(8, 0, [22906], SEEK_CUR)        = 0
write(8, "    nt main err code: 517\n", 26) = 26
_llseek(8, 0, [22932], SEEK_CUR)        = 0
lseek(9, 14848, SEEK_SET)               = 14848
read(9, "\16\0\1\2\0\0\\\0\2\2\0\0x\0\3\2\0\0\243\0\4\2\0\0\336"..., 512) = 512
write(8, "    ", 4)                     = 4
_llseek(8, 0, [22936], SEEK_CUR)        = 0
write(8, "TNS-00517: Lost contact\n", 24) = 24
_llseek(8, 0, [22960], SEEK_CUR)        = 0
write(8, "    nt secondary err code: 32\n", 30) = 30
_llseek(8, 0, [22990], SEEK_CUR)        = 0
close(7)                                = 0
open("/home/oracle/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb", O_RDONLY) = 7

发现在读写 /home/oracle/sqlnet.log 是报错,怀疑是oracle本身有问题,查询metalink证实了这个想法:
Troubleshooting ORA-12547 TNS: Lost Contact [ID 555565.1]
于是重新编译:

cd $ORACLE_HOME/bin
relink all 1>relink.out 2>relink.err 

[oracle@gg bin]$ relink all
/home/oracle/oracle/product/10.2.0/db_1/bin/genclntsh
/home/oracle/oracle/product/10.2.0/db_1/bin/genagtsh /home/oracle/oracle/product/10.2.0/db_1/lib/libagtsh.so 1.0
Linking /home/oracle/oracle/product/10.2.0/db_1/precomp/lib/proc
rm -f /home/oracle/oracle/product/10.2.0/db_1/bin/proc
mv /home/oracle/oracle/product/10.2.0/db_1/precomp/lib/proc /home/oracle/oracle/product/10.2.0/db_1/bin/
rm -f ldapadd ldapbind ldapcompare ldapdelete ldapmodify ldapsearch ldapmoddn ldapaddmt ldapmodifymt dsml2ldif
gcc -o ldapadd -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapadd -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gslmod.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib 
gcc -o ldapbind -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapbind -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gslbind.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib
gcc -o ldapcompare -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapcompare -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gslcompare.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib
gcc -o ldapdelete -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapdelete -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gsldel.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lpthread -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib 
gcc -o ldapmodify -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapmodify -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gslmod.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib 
gcc -o ldapsearch -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapsearch -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gsldsearch.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib
gcc -o ldapmoddn -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapmoddn -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gslmoddn.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib
gcc -o ldapaddmt -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapaddmt -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gsltmod.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lpthread -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib 
gcc -o ldapmodifymt -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o ldapmodifymt -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gsltmod.o  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/gslmcu.o -lpthread -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib 
gcc -o dsml2ldif -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc    -o dsml2ldif -L/home/oracle/oracle/product/10.2.0/db_1/ldap/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/ldap/lib/s0gsldsml2ldif.o  -lncrypt10 /home/oracle/oracle/product/10.2.0/db_1/lib/libldapclnt10.a  -lldapclnt10 -lncrypt10 -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm  -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib
mv -f ldapdelete /home/oracle/oracle/product/10.2.0/db_1/bin/ldapdelete
mv: `ldapdelete' and `/home/oracle/oracle/product/10.2.0/db_1/bin/ldapdelete' are the same file
make: [inst_clientonly] Error 1 (ignored)
mv -f ldapmodify /home/oracle/oracle/product/10.2.0/db_1/bin/ldapmodify
mv: `ldapmodify' and `/home/oracle/oracle/product/10.2.0/db_1/bin/ldapmodify' are the same file
make: [inst_clientonly] Error 1 (ignored)
mv -f ldapmodifymt /home/oracle/oracle/product/10.2.0/db_1/bin/ldapmodifymt
mv: `ldapmodifymt' and `/home/oracle/oracle/product/10.2.0/db_1/bin/ldapmodifymt' are the same file
make: [inst_clientonly] Error 1 (ignored)
mv -f ldapadd /home/oracle/oracle/product/10.2.0/db_1/bin/ldapadd
mv: `ldapadd' and `/home/oracle/oracle/product/10.2.0/db_1/bin/ldapadd' are the same file
.

......................



Linking sqlplus
rm -f sqlplus
gcc -o sqlplus -L/home/oracle/oracle/product/10.2.0/db_1/sqlplus/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/ -L/home/oracle/oracle/product/10.2.0/db_1/lib/stubs/ -L/usr/lib -lirc  /home/oracle/oracle/product/10.2.0/db_1/sqlplus/lib/s0afimai.o -lsqlplus -lclntsh  `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /home/oracle/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10  -lvsn10 -lcommon10 -lgeneric10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -Wl,-rpath,/home/oracle/oracle/product/10.2.0/db_1/lib -lm -lpthread   `cat /home/oracle/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm -lpthread  -L/home/oracle/oracle/product/10.2.0/db_1/lib
/bin/chmod 755 sqlplus
mv -f /home/oracle/oracle/product/10.2.0/db_1/bin/sqlplus /home/oracle/oracle/product/10.2.0/db_1/bin/sqlplusO
mv -f /home/oracle/oracle/product/10.2.0/db_1/sqlplus/lib/sqlplus /home/oracle/oracle/product/10.2.0/db_1/bin/sqlplus
/bin/chmod 751 /home/oracle/oracle/product/10.2.0/db_1/bin/sqlplus
[oracle@gg bin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Sep 15 22:19:07 2013

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

Connected to an idle instance.

SQL> 

好了搞定了

发表在 network, ORA-XXXXX | 留下评论

Oracle DB 12c中定制COMMON USER的前缀

我们知道Oracle Database 12c中用户分为COMMON_USERS 和 LOCAL_USERS两种,其中COMMON_USERS缺省以”C##”开头 ,其实这是受一个隐含参数控制的,即 _common_user_prefix
我们可以定制COMMON USER的前缀,下面咱们测试下:

[oracle@lunar ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Thu Aug 29 21:25:56 2013

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options

SYS@lunarbb>show con_name

CON_NAME
------------------------------
CDB$ROOT
SYS@lunarbb>show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/lunarbb/spfilelunarbb.or
                                                 a
SYS@lunarbb>col KSPPINM for a30
SYS@lunarbb>col ksppstvl format a15
SYS@lunarbb>col KSPPDESC for a55
SYS@lunarbb>select ksppinm, ksppstvl, KSPPDESC 
  2  from x$ksppi pi, x$ksppcv cv 
  3  where cv.indx=pi.indx and pi.ksppinm like '\_%' escape '\' 
  4   and pi.ksppinm like '%common%';

KSPPINM                        KSPPSTVL        KSPPDESC
------------------------------ --------------- -------------------------------------------------------
_eliminate_common_subexpr      TRUE            enables elimination of common sub-expressions
_dump_common_subexpressions    FALSE           dump common subexpressions
_common_data_view_enabled      TRUE            common objects returned through dictionary views
_common_user_prefix            C##             Enforce restriction on a prefix of a Common User/Role/Profile name


Elapsed: 00:00:00.01
SYS@lunarbb>      
SYS@lunarbb>conn c##lunar/lunar
Connected.
C##LUNAR@lunarbb>create pfile='/tmp/pfile.bak' from spfile;
create pfile='/tmp/pfile.bak' from spfile
*
ERROR at line 1:
ORA-01031: insufficient privileges


Elapsed: 00:00:00.00
C##LUNAR@lunarbb>conn c##lunar/lunar as sysdba
Connected.
SYS@lunarbb>create pfile='/tmp/pfile.bak' from spfile;

File created.

Elapsed: 00:00:00.12
SYS@lunarbb>

[oracle@lunar ~]$ tail /tmp/pfile.bak
*.query_rewrite_enabled='TRUE'
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_manager_plan='SCHEDULER[0x420F]:DEFAULT_MAINTENANCE_PLAN'
*.result_cache_max_size=1560K
*.sga_max_size=330M# internally adjusted
*.sga_target=330M
*.shared_pool_size=160M
*.skip_unusable_indexes=TRUE
*.undo_tablespace='UNDOTBS1'
*._common_user_prefix='L##'
[oracle@lunar ~]$ 

SYS@lunarbb>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@lunarbb>startup pfile=/tmp/pfile.bak
ORACLE instance started.

Total System Global Area  346562560 bytes
Fixed Size                  2288240 bytes
Variable Size             297797008 bytes
Database Buffers           37748736 bytes
Redo Buffers                8728576 bytes
Database mounted.
Database opened.
SYS@lunarbb>

SYS@lunarbb>conn c##lunar/lunar
Connected.
C##LUNAR@lunarbb>conn L##lunar/lunar
ERROR:
ORA-01017: invalid username/password; logon denied


Warning: You are no longer connected to ORACLE.
C##LUNAR@lunarbb>
C##LUNAR@lunarbb>conn / as sysdba 
Connected.
SYS@lunarbb>
SYS@lunarbb>CREATE USER L##lunar IDENTIFIED BY lunar;

User created.

Elapsed: 00:00:00.80
SYS@lunarbb>grant dba,sysdba,connect,resource to L##lunar;

Grant succeeded.

Elapsed: 00:00:00.17
SYS@lunarbb>
SYS@lunarbb>conn L##lunar/lunar
Connected.
L##LUNAR@lunarbb>conn L##lunar/lunar as sysdba
Connected.
SYS@lunarbb>
SYS@lunarbb>show parameter common

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
_common_data_view_enabled            boolean     TRUE
_common_user_prefix                  string      L##
_eliminate_common_subexpr            boolean     TRUE
SYS@lunarbb>
发表在 Database, ORACLE 12C | 标签为 , | 留下评论

使用VBox 安装 Oracle Database 12c Flex Cluster for OEL 5.8—第5部分 总结

执行脚本

[root@lunar1 Disk1]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@lunar1 Disk1]# 
[root@lunar1 Disk1]# /u01/app/12.1.0/grid/root.sh
Performing root user operation for Oracle 12c 
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/12.1.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/12.1.0/grid/crs/install/crsconfig_params
2013/08/27 20:13:34 CLSRSC-363: User ignored prerequisites during installation
OLR initialization - successful
  root wallet
  root wallet cert
  root cert export
  peer wallet
  profile reader wallet
  pa wallet
  peer wallet keys
  pa wallet keys
  peer cert request
  pa cert request
  peer cert
  pa cert
  peer root cert TP
  profile reader root cert TP
  pa root cert TP
  peer pa cert TP
  pa peer cert TP
  profile reader pa cert TP
  profile reader peer cert TP
  peer user cert
  pa user cert
2013/08/27 20:14:34 CLSRSC-330: Adding Clusterware entries to file '/etc/inittab'

具体见:使用VBox 安装 Oracle Database 12c Flex Cluster for OEL 5.8—第5部分 总结

发表在 Installation and Deinstall, ORACLE 12C, RAC | 标签为 , , | 留下评论