You are on page 1of 45

:

,,

QQ:54110058

section7

90

( 700)
oracle home
0777 oracle ssh

oracle home 0700

:
mkdir .ssh
chmod 700 .ssh
-- 700
cd .ssh
[oracle@rac1 .ssh]$ ssh-keygen -t rsa
--

[oracle@rac1 .ssh]$ ssh-keygen -t dsa


[oracle@rac1 .ssh]$ ls
id_dsa id_dsa.pub id_rsa id_rsa.pub
[oracle@rac1 .ssh]$ cat *.pub >authorized_key
--
rac2
[oracle@rac1 .ssh]$ scp authorized_key rac2:/home/oracle/.ssh/rac_keys
-- 2
[oracle@rac2 .ssh]$ cat rac_keys >>authorized_keys
-- 2
1

[oracle@rac2 .ssh]$ scp authorized_keys rac1:/home/oracle/.ssh/ --


1
[oracle@rac1 .ssh]$ ssh rac2 date
[oracle@rac1 .ssh]$ ssh rac2 priv date
[oracle@rac1 .ssh]$ ssh rac1 date
[oracle@rac1 .ssh]$ ssh rac1-priv date
1 2

./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -verbose


2
crs

[root@rac1 ~]# more /etc/redhat-release


Red Hat Enterprise Linux Server release 5.8 (Tikanga)
4,

rac2,?

eth0 public

ocr

vote

/../oraInventory/orainstRoot.sh

[root@rac1 crs]# ./root.sh

WARNING: directory '/oracle/product/10.2.0' is not owned by root


WARNING: directory '/oracle/product' is not owned by root
WARNING: directory '/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/oracle/product/10.2.0' is not owned by root
WARNING: directory '/oracle/product' is not owned by root
WARNING: directory '/oracle' is not owned by root
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/raw/raw2
Format of 1 voting devices complete.
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
CSS is inactive on these nodes.
rac2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.
orc,

rac2
( rac2 )

/etc/oracle/scls_scr/rac1/oracle/cssfatal ..

[root@rac2 crs]# ./root.sh


WARNING: directory '/oracle/product/10.2.0' is not owned by root
WARNING: directory '/oracle/product' is not owned by root
WARNING: directory '/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
Oracle CRS stack is already configured and will be running under init(1M)
:
[root@rac2 crs]# ./root.sh
WARNING: directory '/oracle/product/10.2.0' is not owned by root
WARNING: directory '/oracle/product' is not owned by root
WARNING: directory '/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/oracle/product/10.2.0' is not owned by root
WARNING: directory '/oracle/product' is not owned by root
WARNING: directory '/oracle' is not owned by root

clscfg: EXISTING configuration version 3 detected.


clscfg: version 3 is 10G Release 2.
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node <nodenumber>: <nodename> <private interconnect name> <hostname>
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
clscfg: Arguments check out successfully.
NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
rac2
CSS is active on all nodes.
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
/oracle/product/10.2.0/crs/jdk/jre//bin/java: error while loading
shared libraries: libpthread.so.0: cannot open shared object file: No
such file or directory
:
$CRS_HOME/bin srvctl vipca ,(Bug 3937317)
export LD_ASSUME_KERNEL
unset LD_ASSUME_KERNEL

vipca,
[root@rac2 bin]# ./vipca
Error 0(Native: listNetInterfaces:[3])
[Error 0(Native: listNetInterfaces:[3])]
:
[root@rac2 bin]# ./oifcfg getif
[root@rac2 bin]# ./oifcfg iflist
eth0 192.168.2.0
eth1 10.0.0.0
[root@rac2 bin]# ./oifcfg setif -global eth0/192.168.2.0:public
[root@rac2
bin]#
./oifcfg
setif
-global
eth1/10.0.0.0:cluster_interconnect

[root@rac2 bin]# ./oifcfg iflist


eth0 192.168.2.0
eth1 10.0.0.0
[root@rac2 bin]# ./oifcfg getif
eth0 192.168.2.0 global public
eth1 10.0.0.0 global cluster_interconnect
, vip
vipca

eth0

ip alias name ,tab

ok ,.


root :
./srvctl remove nodeapps -n rac1,rac2 f
[oracle@rac1 ~]$ crs_stat -t
Name
Type
Target
State
Host
-----------------------------------------------------------ora.rac1.gsd
application
ONLINE
ONLINE
rac1
ora.rac1.ons
application
ONLINE
ONLINE
rac1
ora.rac1.vip
application
ONLINE
ONLINE
rac1
ora.rac2.gsd
application
ONLINE
ONLINE
rac2
ora.rac2.ons
application
ONLINE
ONLINE
rac2
ora.rac2.vip
application
ONLINE
ONLINE
rac1
ocr

database

/etc/oratab

[root@rac1 db_1]# ./root.sh


Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle

ORACLE_HOME=

/oracle/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:


The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
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.

listener

(netca)

ASM (dbca)

ASM (oracle) PFile


asmlib, asm parameters

PFILE

External,

ARCH,DATA mount ???


v$asm_diskgroup ()
group, mout , asmcmd


by another ASM instance
alter diskgroup RDG1 dismount;

(dbca)

ORA-15073: diskgroup DATA is mounted

:oracle

racdb_serv RACDB1 RACDB2

service (Server-Side TAF)


select name,failover_method from dba_services;

SQL> alter system set service_names='RACDB','RACDB_REV1','RACDB_REV2';


srvctl config service -d RACDB -s RACDB_REV1 -a
RACDB_REV1 PREF: RACDB1 AVAIL: RACDB2 TAF: none
tns
RACDB_REV1=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=rac2)(PORT=1521)))
(CONNECT_DATA=
(SERVICE_NAME=RACDB_REV1)))
RACDB_REV2=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521))
(ADDRESS=(PROTOCOL=tcp)(HOST=rac2)(PORT=1521)))
(CONNECT_DATA=
(SERVICE_NAME=RACDB_REV2)))

UTF8

:
PRKP-1037 failed to create cluster database xXX

[oracle@rac1 bin]$ srvctl remove database -d RACDB


Remove the database RACDB? (y/[n]) y
PRKR-1001 : cluster database RACDB does not exist
PRKO-2005 : Application error: Failure in getting Cluster Database
Configuration for: RACDB
[oracle@rac1 bin]$ crs_unregister ora.RACDB.db
finish
.
PRKS-1023 : Failed to remove CRS resource for ASM instance "ASM1" on node
"racsvr1",
[CRS-0214:
Could
not
unregister
resource
'ora.racsvr1.ASM1.asm'.]]
:
[root@rac2 init.d]# ./init.crs stop --

[oracle@rac1 bin]$ srvctl remove asm -n rac2 -f

[root@rac2 init.d]# ./init.crs start


:
CRS-0215

configToolFailedCommands

Clusterware
$ /etc/init.d/init.crs disable

--

Clusterware :
$ /etc/init.d/init.crs enable
crs:
$/etc/init.d/init.cssd start
$/etc/init.d/init.crs start
asm ,/etc/oratab

ASM
1
srvctl stop asm -n
srvctl stop asm -n o10n2
2
srvctl remove asm -n rac1
srvctl remove asm -n rac2 -- init.crs stop

3(2
[Oracle@o10n2 ~]$ rm -f $ORACLE_HOME/dbs/*ASM*
[oracle@o10n2 ~]$ rm -fr $ORACLE_BASE/admin/*ASM*
4/etc/oratab (2
5 dbca asm

1:+ASM2
Unable to find dynamic library libocr10.so in search paths

bug: 4918834
:export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

priv 10 ?
private eth1 10.0.0.0
+ASM2 alert

+ASM2 , 10
10 ,, crs .

drop diskgroup
Mos: 353423.1
SQL> alter diskgroup RDG2 mount;
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15063: ASM discovered an insufficient number of disks for diskgroup
"RDG2"
SQL> drop diskgroup RDG2;
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15001: diskgroup "RDG2" does not exist or is not mounted
force
SQL> create diskgroup TEST_DG external redundancy disk '/dev/raw/raw6',
'/dev/raw/raw7' FORCE;
SQL> select name,state,type,total_mb,free_mb from v$asm_diskgroup;
NAME
STATE
TYPE
TOTAL_MB
FREE_MB
------------------------------ ----------- ------ ---------- ---------RDG1
MOUNTED
EXTERN
3826
2584

TEST_DG
MOUNTED
3774
SQL> select name, state from v$asm_diskgroup;

EXTERN

NAME
STATE
------------------------------ ----------RDG1
MOUNTED
TEST_DG
MOUNTED
RDG2
SQL> drop diskgroup TEST_DG;
--
SQL> select name,path,header_status from v$asm_disk;
:
1:
[oracle@rac1 10.2.0]$ pwd
/oracle/product/10.2.0
[root@rac1 /]# rm -rf /oracle/
[root@rac1 u01]# rm -rf crs_1/
[root@rac1 u01]# rm -rf db_1/
[root@rac1 oracle]# rm -rf oraInventory/
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
[root@rac1 ~]# rm /etc/oracle/ocr.loc
/etc/oratab
--
rm -rf /etc/oracle/scls_scr
- root.sh
rm -f /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab.crs
--
dd if=/dev/zero of=/dev/raw/raw2 bs=8192 count=2560
dd if=/dev/zero of=/dev/raw/raw3 bs=8192 count=2560

[root@rac1 rules.d]# pwd


/etc/udev/rules.d

3826

[root@rac1 rules.d]# more 60-raw.rules


ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1
ACTION=="add", KERNEL=="sdb5",RUN+="/bin/raw /dev/raw/raw2
ACTION=="add", KERNEL=="sdb6",RUN+="/bin/raw /dev/raw/raw3
ACTION=="add", KERNEL=="sdb4",RUN+="/bin/raw /dev/raw/raw4
ACTION=="add", KERNEL=="sdb3",RUN+="/bin/raw /dev/raw/raw5
ACTION=="add", KERNEL=="sdb7",RUN+="/bin/raw /dev/raw/raw6
ACTION=="add", KERNEL=="sdb8",RUN+="/bin/raw /dev/raw/raw7
ACTION=="add",KERNEL=="raw*", OWNER="oracle", GROUP="dba",
[root@rac1 rules.d]# start_udev
[root@rac1 rules.d]# raw
/dev/raw/raw1: bound to
/dev/raw/raw2: bound to
/dev/raw/raw3: bound to
/dev/raw/raw4: bound to
/dev/raw/raw5: bound to
/dev/raw/raw6: bound to
/dev/raw/raw7: bound to

-qa
major
major
major
major
major
major
major

%N"
%N"
%N"
%N"
%N"
%N"
%N"
MODE="660"

--

8,
8,
8,
8,
8,
8,
8,

minor
minor
minor
minor
minor
minor
minor

17
21
22
20
19
23
24

---ocr
----vote disk

You might also like