ITPub博客

首页 > 数据库 > Oracle > RAC+ASM安装文档

RAC+ASM安装文档

原创 Oracle 作者:HUVON 时间:2007-10-09 16:28:57 0 删除 编辑
Oracle Real Application Cluster
Installation Guide, Redhat AS 3.0
Aug,2004 Version 1.1
Oracle Partner Training Only

1. Pre-installation
Note: All Pre-installation steps should be done on every node in the whole cluster, the
document is for example on node raclinux1
Create Oracle user and group
Log in as root/oracle.
a. Start a terminal window (Main Menu --> System Tools --> Terminal).
b. To create the oracle user and groups:
i. Create the Oracle user, as root:
groupadd -g 500 dba
groupadd -g 501 oinstall
useradd -u 500 -g dba -G oinstall -m -s /bin/bash oracle
ii. Set password "passwd oracle".
1. At the "New password:" prompt, enter "oracle".
2. Ignore the "BAD PASSWORD: it is based on a dictionary word" warning.
3. At the "Retype new password:" prompt, enter "oracle" again.
Check IP address
c. To confirm the IP addresses are set correctly:
i. Public interface (eth0)
1. Run "ifconfig eth0".
ii. Private interface (eth1)
1. Run "ifconfig eth1".
d. Edit /etc/hosts:
i. Run "vi /etc/hosts" -OR- "nedit /etc/hosts".
ii. Clean the 127.0.0.1 line to match the sample below.
iii. Add 6 new lines as in sample below:
127.0.0.1 localhost.localdomain localhost
10.10.10.11 raclocal1.us.oracle.com raclocal1
10.10.10.12 raclocal2.us.oracle.com raclocal2
192.168.203.11 raclinux1.us.oracle.com raclinux1
192.168.203.12 raclinux2.us.oracle.com raclinux2
192.168.203.111 raclinux1-vip.us.oracle.com raclinux1-vip
192.168.203.112 raclinux2-vip.us.oracle.com raclinux2-vip
Oracle Partner Training Only
Modify Kernel Parameters
e. Modify kernel parameters to match Oracle10g requirements:
i. Run "vi /etc/sysctl.conf" -OR- "nedit /etc/sysctl.conf".
ii. Add the following lines to the end of the file:
fs.file-max = 65536
kernel.shmmax = 2147483648
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range= 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
iii. Run "sysctl -p" to make the changes take effect.
OCFS installation steps
1. Log in to Linux GUI desktop as the oracle user.
2. Get Latest OCFS RPMS:
a. Click the "Mozilla" internet browser icon on the task bar.
b. Type in URL "http://oss.oracle.com".
c. Under "Projects", click "OCFS".
d. Under "Project: OCFS", click "Files".
e. Click "Red Hat".
f. Click "RHEL 3".
g. Click "i386".
h. Click "ocfs-2.4.21-EL-1.0.12-1.i686.rpm"
Notice If you use SMP hardware and run in SMP linux, please choose SMP version of
OCFS(ocfs-2.4.21-EL-smp-1.0.12-1.i686.rpm). OCFS gets updated every once in a while just pick
up the latest version. In our example above the version is "1.0.12-1".
i. Select "Save it to disk".
ii. Click "OK".
iii. Click "Save".
i. Repeat step 'g.' for "ocfs-tools-1.0.10-1.i386.rpm".
j. Repeat step 'g.' for "ocfs-support-1.0.10-1.i386.rpm".
Oracle Partner Training Only
NOTE: tools/support version may not match the ocfs version, it's OK as long as you take the latest
version see readme on site
k. Exit Mozilla.
3. Open a terminal window:
a. Click Main Menu --> System Tools --> Terminal.
b. Change user to root by typing:
$ su -
Password: oracle
#
4. Run the following commands as root:
a. # cd ~oracle
b. # rpm -Uvh ocfs-support-1.0.10-1.i386.rpm
c. # rpm -Uvh ocfs-2.4.21-EL-1.0.12-1.i686.rpm
d. # rpm -Uvh ocfs-tools-1.0.10-1.i386.rpm
OR Simply:
a. # cd ~oracle
b. # rpm -Uvh ocfs-*.rpm
5. As root, run "ocfstool &".
a. Select "Tasks" --> "Generate Config...".
i. Interface: Select "eth1" from the pulldown menu.
ii. Node name: Enter "raclocal1.us.oracle.com".
iii. Click "OK".
b. Select "File" --> "Exit".
6. As root, run "load_ocfs".
7. Partitioning ocfs device.
Note: Depending on weather you want to place the OCR (Oracle Cluster Registry) on raw devices
or on OCFS you will follow slightly different paths, choose ONLY ONE option. There is no
difference in performance or features, placing all on OCFS is simpler, if you want to practice/learn
raw devices choose that. Remember your selection, you will need it later.
As root run:
Oracle Partner Training Only
# fdisk /dev/sdd
Option 1: OCR+Voting disk ON OCFS Filesystem:
i. Command: Type "n" and press ENTER.
ii. Command action: Type "p" and press ENTER.
iii. Partition number: Type "1" and press ENTER.
iv. First cylinder: Press ENTER.
v. v. Last cylinder: Press ENTER. (Entire disk)
Option 2: OCR+Voting disk ON RAW Devices:
Partition 1: (ocr_file)
i. Command: Type "n" and press ENTER.
ii. Command action: Type "p" and press ENTER.
iii. Partition number: Type "1" and press ENTER.
iv. First cylinder: Press ENTER.
v. Last cylinder: +100M.
Partition 2: (voting_disk)
i. Command: Type "n" and press ENTER.
ii. Command action: Type "p" and press ENTER.
iii. Partition number: Type "2" and press ENTER.
iv. First cylinder: Press ENTER.
v. Last cylinder: +100M.
Partition 3: (ocfs filesystem)
i. Command: Type "n" and press ENTER.
ii. Command action: Type "p" and press ENTER.
iii. Partition number: Type "3" and press ENTER.
iv. First cylinder: Press ENTER.
v. v. Last cylinder: Press ENTER. (rest of the drive)
View partition table, to make sure it's what you want, Type "p" Output will look like (for option
2):
Device Boot Start End Blocks Id System
/dev/sdd1 1 13 104391 83 Linux
/dev/sdd2 14 26 104422+ 83 Linux
/dev/sdd3 27 1044 8177085 83 Linux
Finalize changes: Type "w" and press ENTER.
Oracle Partner Training Only
8. As root, run "ocfstool &".
a. Select "Tasks" --> "Format...".
i. Device: Select "/dev/sdd1" (everything on OCFS) or "/dev/sdd3" (if
OCR+Voting are on raw devices) from the pulldown menu.
ii. Volume Label: Enter "ocfs".
iii. Mountpoint: Enter "/ocfs".
iv. User: Select "oracle" from the pulldown menu.
v. Group: Select "dba" from the pulldown menu.
vi. Click "OK".
vii. Dialog box: "Are you sure you want to format /dev/sdd1?" or "sdd3?"
Click "Yes".
b. Select "File" --> "Exit".
9. As root, run "nedit /etc/fstab &".
a. Add ONE of the following lines (without quotes) to the end of the fstab:
Everything on OCFS:
"/dev/sdd1 /ocfs ocfs _netdev 0 0"
OCR+Voting on raw devices:
"/dev/sdd3 /ocfs ocfs _netdev 0 0"
b. Click "File->Save" at the top of the window.
c. Click "File->Exit" at the top of the window.
10. As root, run "mkdir /ocfs".
11. As root, run "mount /ocfs".
12. Tell updatedb not to touch ocfs filesystems
Edit two lines in /etc/updatedb.conf (Just add the "ocfs" at end)
PRUNEFS="devpts NFS nfs afs sfs proc smbfs autofs auto iso9660 ocfs"
PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /net /sfs /ocfs"
Oracle Partner Training Only
2. Oracle10g RAC 10.1.0.2 Install
Tips:
1. log in to Linux GUI desktop as the oracle user. DO NOT LOG IN TO DESKTOP AS ROOT
and su to oracle.
2. To prepare the GUI environment:
i. Locate the terminal program (Main Menu --> System Tools --> Terminal).
ii. Right-click on the "Terminal" menu item.
iii. Select "Add this launcher to panel".
3. Open two terminal windows, if you haven't already:
i. Click the Terminal icon we just added to the taskbar.
ii. In one of the windows change user to root by typing:
$ su -
Password: oracle
#
Config SSH
Oracle 10g can use ssh instead of rsh to install software to remote nodes. If ssh is not defined the
installer will fallback to rsh. In both cases (ssh/rsh) login must be password-less during installation.
To set up secure, password-less login via SSH for the oracle user:
a. Generate the users's public and private SSH keys (~/.ssh/id_dsa.pub and id_dsa), as
the oracle user:
$ ssh-keygen -t dsa
i. "Enter file in which to save the key ...:" --> Press ENTER.
ii. "Enter passphrase ...:"
For LESS Secure connection just Press ENTER.
For Secure connection enter a passphrase only you will know.
iii. "Enter same passphrase again:" Either ENTER or passphrase.
Note: Repeat step 'a.' above on each node in the cluster before proceeding to step 'b.'
b. Create the authorized_keys file by combining the contents of the id_dsa.pub files
from each server. You can do this all on one node by running the command below
Oracle Partner Training Only
multiple times, replacing "raclinux1" with a different node name each time. As the
oracle user:
$ ssh raclinux1 "cat ~/.ssh/id_dsa.pub" >> ~/.ssh/authorized_keys
i. Each time you connect from any node to a new hostname for the first time,
you will see a message similar to:
"The authenticity of host 'raclinux1 (192.168.203.11)' can't be established. RSA
key fingerprint is ...
Are you sure you want to continue connecting (yes/no)?"
Type "yes" and press ENTER. You will then see the message:
"Warning: Permanently added 'raclinux1,192.168.203.11' (RSA) to the list of
known hosts."
ii. "oracle@raclinux1's password:" --> Type "oracle" and press ENTER.
Note: Copy the authorized_keys file you just created to the ~/.ssh directory of the oracle user
on each node in the cluster. For example, you could use the following command to copy it
to node "raclinux2":
$ scp ~/.ssh/authorized_keys raclinux2:/home/oracle/.ssh/
oracle@raclinux2's password: --> Type "oracle" and press ENTER.
c. To finalize and test the passwordless SSH connection, answer YES to any prompt:
i. Run "ssh raclinux1 date".
ii. Run "ssh raclocal1 date".
iii. Run "ssh raclinux1.us.oracle.com date".
iv. Run "ssh raclocal1.us.oracle.com date".
Note: Repeat above steps to all nodes
Install Oracle Cluster Ready Services
1. Change permission to ORACLE_BASE directory, as root:
# chown oracle:oinstall /opt/oracle
2. If you choose to put the CRS files (Voting disk & OCR file) on raw devices you must do
this step, otherwise skip this step. Remember, if you decide to use OCFS (skip this step):
Oracle Partner Training Only
Setup raw devices for voting disk and OCR file:
a) vi or nedit as root /etc/sysconfig/rawdevices and add:
/dev/raw/raw1 /dev/sdd1
/dev/raw/raw2 /dev/sdd2
b) Change permission on the raw devices to oracle:
# chown oracle:dba /dev/raw/raw1
# chown oracle:dba /dev/raw/raw2
OR in shorthand Linux-style:
# chown oracle:dba /dev/raw/raw[12]
c) Restart the raw devices as root:
# /etc/init.d/rawdevices restart
d) Create symbolic links for the voting disk & OCR file as oracle:
$ cd /ocfs
$ ln -sf /dev/raw/raw1 ocr_file
$ ln -sf /dev/raw/raw2 voting_disk
Note: This step should be done on all nodes of cluster
3. Install Cluster Ready Services (CRS):
a. Put the Oracle10g CRS CD in CD tray, Linux will automount it and add a
"CDROM" icon to the desktop. If not, as root issue:
# mount /mnt/cdrom
b. Run the installer, as the oracle user:
$ cd (Do NOT cd into /mnt/cdrom)
$ /mnt/cdrom/runInstaller (First time)
i. Screen: "Welcome"
Click "Next"
ii. Screen: "Specify Inventory directory and credentials"
1. Change Inventory directory to: /opt/oracle/oraInventory
2. Change Operating System group name to: oinstall
Oracle Partner Training Only
3. Click "Next"
iii. PopUP... As root run /opt/oracle/oraInventory/orainstRoot.sh
# /opt/oracle/oraInventory/orainstRoot.sh
Click "Continue" in installer.
iv. Screen: "Specify File Locations"
Change Name to: CRS10g
Change Path to: /opt/oracle/CRS10g
Click "Next"
v. Screen: "Language Selection"
Click "Next"
vi. Screen: "Cluster Configuration"
Leave Cluster Name as "crs"
For public node name, use "raclinux1.us.oracle.com".
For private node name, use "raclocal1.us.oracle.com".
Click "Next"
Note: If you get warning: node unreachable, double check that "ssh
date" returns nothing except the date
vii. Screen: "Private Interconnect Enforcement"
For eth0, select "Public" in the "Interface Type" column.
For eth1, select "Private" in the "Interface Type" column.
Click "Next"
viii. Screen: "Oracle Cluster Registry"
Enter: /ocfs/ocr_file
Click "Next"
ix. Screen: "Voting Disk"
Enter: /ocfs/voting_disk
Click "Next"
x. Screen: "Summary"
Click "Install" to finish installation
xi. PopUP Setup Privileges: As root run /opt/oracle/CRS10g/root.sh on each node:
# /opt/oracle/CRS10g/root.sh
Ignore:
Oracle Partner Training Only
"WARNING: directory '/opt/oracle' is not owned by root"
See bug 3463657 for details.
CRS Success message as follows:
"Oracle CRS stack installed and running under init(1M)"
Click "OK" in installer PopUP.
xii. Screen: "End of Installation", exit the installer
Click "Exit" and confirm exit.
c. Remove Oracle10g CRS CD, as root user:
# umount /mnt/cdrom
Eject CD if not done automatically.
Create Oracle user environment:
a. Edit .bash_profile login file of the oracle user:
$ vi $HOME/.bash_profile -OR- nedit $HOME/.bash_profile
Insert following 5 lines after "if" statement ends (Line 7):
export ORACLE_SID=O10G1
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/DB10g
export ORA_CRS_HOME=/opt/oracle/CRS10g
export PATH=$PATH:$ORACLE_HOME/bin
# export LD_ASSUME_KERNEL=2.4.19 (Needed for RHEL3 vanilla or Update 1)
b. Execute the .bash_profile script to pickup changes, as the oracle user You will have to do this
for any new xterm you open until you relogin to GUI desktop:
$ source $HOME/.bash_profile
c. As the root user:
# source ~oracle/.bash_profile
Oracle Partner Training Only
Install Oracle software 10.1.0.2 from CD
a. Put the Oracle10g Database CD in CD tray. Linux will automount it and add a "CDROM"
icon to the desktop. If not, as root issue:
# mount /mnt/cdrom
b. Run the installer, as the oracle user:
$ cd (Do NOT cd into /mnt/cdrom)
$ /mnt/cdrom/runInstaller (Second time)
i. Screen: "Welcome"
Click "Next"
ii. Screen: "Specify File Locations"
Change Name to: DB10g
Verify Path is: /opt/oracle/DB10g
Click "Next"
iii. Screen: "Specify Hardware Cluster Installation Mode"
Select: "Cluster Installation" (TOP option)
Select all nodes
Click "Next"
iv. Screen: "Select Installation Type"
Select: "Enterprise Edition" (TOP option)
Click "Next"
v. Screen: "Product-specific Prerequisite Checks"
All checks should be successful.
Click "Next"
vi. Screen: "Select Database Configuration"
Select: "Do not create a starter database" (BOTTOM option)
Click "Next"
vii. Screen: Summary
Click "Install" (About 30 minutes)
viii. PopUP Setup Privileges: As root run $ORACLE_HOME/root.sh on each node:
# $ORACLE_HOME/root.sh
Oracle Partner Training Only
1. "Enter the full pathname of the local.." Accept default.
2. VIP Configuration Assistant (vipca) starts automatically:
a. Screen: "Welcome"
Click "Next"
b. Screen: "1 of 2, Network Interfaces"
Select only the public interface(s), in our case "eth0"
Click "Next"
c. Screen: "2 of 2, Virtial IPs for cluster nodes"
Enter "raclinux1-vip.us.oracle.com" under "IP Alias Name".
Press TAB to autofill the "IP address" column.
Click "Next"
d. Screen: "Summary"
Click "Finish"
e. Dialog: "Configuration Assistant Progress Dialog"
After all steps complete, click "OK".
f. Dialog: "Configuration Results"
Click "Exit"
Click "OK" in installer PopUP.
ix. Screen: "End of Installation", exit the installer
Click "Exit" and confirm exit.
c. Remove Oracle10g Database CD, as root user:
# umount /mnt/cdrom
Eject CD if not done automatically.
Load hangcheck-timer needed by 10g CRS
Edit /etc/rc.local add following line:
insmod hangcheck-timer hangcheck_tick=90 hangcheck_margin=360
Load module, as root enter:
# /etc/rc.local
Verify that all services are running properly
Note: Check on all nodes
As oracle user:
Oracle Partner Training Only
$ srvctl status nodeapps -n raclinux1
VIP is running on node: raclinux1
GSD is running on node: raclinux1
PRKO-2016 : Error in checking condition of listener on node: raclinux1
ONS daemon is running on node: raclinux1
Listener error will go away once we run netca.
Use NETCA to config listener
l. We will use netca (Network Configuration Assistant) to configure SQL*Net listeners.
a. Run netca to create two listeners (on one node) as oracle:
$ export LD_ASSUME_KERNEL=2.4.19 (Only for RHEL3 vanilla or Update1)
$ netca
i. Select: "Cluster configuration"
Click "Next"
ii. Screen: "TOPSNodes"
Select all nodes
Click "Next"
iii. Screen: "Welcome"
Select: "Listener configuration"
Click "Next"
iv. Screen: "Listener Configuration, Listener"
Select: "Add"
Click "Next"
v. Screen: "Listener Configuration, Listener Name"
Leave: "LISTENER"
Click "Next"
vi. Screen: "Listener Configuration, Select Protocols"
Leave: "TCP"
Click "Next"
vii. Screen: "Listener Configuration, TCP/IP Protocol"
Oracle Partner Training Only
Leave: "1521"
Click "Next"
Notes: Above steps already configure a listener on each node (both port 1521)
viii. Screen: "Listener Configuration, More Listeners?"
Select: "No"
Click "Next"
ix. Screen: "Listener Configuration, Select Listener"
Select: "LISTENER2"
Click "Next"
x. Screen: "Listener Configuration Done"
Click "Finish"
b. Startup the primary listener:
$ srvctl start nodeapps -n raclinux1
c. Verify the two listeners are running:
$ ps -ef|grep tnslsnr
Should see 2 lines: LISTENER_RACLINUX1 & LISTENER2_RACLINUX1
d. Obtain tnsnames.ora.
Create tnsnames.ora in $ORACLE_HOME/network/admin folder
e. If you create listeners through NETCA, then CRS will start them up automatically,
OTHERWISE: To enable autostart at boot:
Add startup lines to /etc/rc.local
su - oracle -c "lsnrctl start listener_raclinux1"
su - oracle -c "lsnrctl start listener2_raclinux1"
Create a sample database using DBCA 10g
a. Invoke dbca, as oracle user:
$ export LD_ASSUME_KERNEL=2.4.19 (Only for RHEL3 vanilla or Update1)
$ dbca
Oracle Partner Training Only
i. Screen: "Welcome..."
Select: "Oracle Real Application Clusters database"
Click "Next"
ii. Screen: "Step 1 of 17: Operations"
Select: "Create a database"
Click "Next"
iii. Screen: "Step 2 of 17: Node Selection"
Select all nodes, If you Don't see this, check that VIP/GSD/ONS are UP
Click "Next"
iv. Screen: "Step 3 of 17: Database Templates"
Select: "Custom Database"
Click "Next"
v. Screen: "Step 4 of 17: Database Identification"
Enter "O10G" in both fields
Click "Next"
vi. Screen: "Step 5 of 16: Management Options"
Leave: "Configure the Database with Enterprise Manager"
Click "Next"
vii. Screen: "Step 6 of 16: Database Credentials"
Enter: "oracle" as password for all accounts
Click "Next"
viii. Screen: "Step 7 of 14: Storage Options"
Leave: "Cluster File System"
Click "Next"
ix. Screen: "Step 8 of 14: Database File Locations"
Select: "Use Common Location for All Database Files"
Enter: "/ocfs"
Click "Next"
x. Screen: "Step 9 of 14: Recovery Configuration"
Enter location as "/ocfs/flash_recovery_area"
Click "Next"
xi. Screen: "Step 10 of 14: Database Content"
Select the options and parameters that you need
Click "Next"
Oracle Partner Training Only
xii. xv. Screen: "Step 14 of 14: Creation Options"
Select "Generate Database Creation Scripts"
Let dbca create database AUTOMATICALLY now:
Select "Create Database"
Click "Finish"
Review summary and Click "OK"
About 50-120 minutes depending on hardware speed
You will get a success message.
Click Exit.
"Do you want to perform another operation?"
Click "no"
b. Enable auto-start of database
edit /etc/oratab:
If created DB manually, add the following line to /etc/oratab:
O10G:/opt/oracle/DB10g:Y
If dbca created DB automatically just change the "N" to "Y" on that line inside /etc/oratab.
Ignore lines starting as "*:/opt..."
Add new instance to database
TWO options of doing this: DBCA or Manually
Add instance using DBCA
i. Create second instance
$ dbca
Choose: RAC, Instance Management, Add instance user: sys , passwd: oracle,
Click next , next, next, finish. Instance Summary: OK
Installer asks "Do you want perform another operation?"
Click "NO"
Oracle Partner Training Only
If auto start fails you can startup by using:
$ srvctl start instance -d O10G -i O10G2
Verify
a. On Linux level:
ipcs
ps -ef|grep dbw
b. On Oracle level:
sqlplus "sys/oracle@O10G1 as sysdba"
sqlplus "sys/oracle@O10G2 as sysdba"
sqlplus "sys/oracle@O10G-TAF as sysdba"
sqlplus "sys/oracle@O10G-NOTAF as sysdba"
All above should connect to database, to verify which instance you connected to issue:
SQL> select hostname,instance_name from v$instance;
c. You also have Enterprise Manager configured, just add:
su - oracle -c "emctl start agent"
su - oracle -c "emctl start dbconsole"
To /etc/rc.local to start it up automatically at next boot.
To manage & monitor connect to: http://raclinux1.us.oracle.com:5500/em
user: sys pass: oracle
Setup OEM dbconsole
You can SKIP this script if you let dbca create the database automatically. Just make sure you have
the agent and dbconsole startup in rc.local, as:
su - oracle -c "emctl start agent"
su - oracle -c "emctl start dbconsole"
If you executed the create database scripts generated by dbca MANUALLY and you want to
configure dbconsole (EM on single node) this script will do it.
Oracle Partner Training Only
1. Before we set up dbconsole, we'll shutdown O10G2 to save memory and show how it
discovers down instances:
$ srvctl stop instance -d O10G -i O10G2
2. Start Enterprise Manager DB Control middle tier:
a. Check if OEM DB Control has been fully configured:
i. cd $ORACLE_HOME/oc4j/j2ee
If the directory OC4J_DBConsole_${HOSTNAME}_${ORACLE_SID} exists,
then DB Control is fully configured. Skip to step 'b.' below.
ii. If the database already contains the OEM Repository schema,
then run "emca -r -c" as the oracle user.
Otherwise, run "emca" as the oracle user.
1. Listener port number: 1521
2. Cluster name: crs
3. Database name: O10G
4. Service name: O10G
5. Email address for notification: (Press ENTER.)
6. Email gateway for notification: (Press ENTER.)
7. Password for dbsnmp: oracle
8. Password for sysman: oracle
9. Password for sys: oracle
------------------------------------------
You have specified the following settings
...
------------------------------------------
10. Do you wish to continue? [yes/no]: yes
HOWEVER If you see:
A) INFO: Starting the DBConsole ...
Could not complete the configuration.
Refer to the log file for details.
Note: The last message above tricks you into thinking the configuration failed.
But don't be fooled- it's not true!
Oracle Partner Training Only
B) SEVERE: Repository already exists.
Fix the error(s) and run EM Configuration Assistant
again in standalone mode.
Note: You forgot the "-r" flag on emca to skip creation of repository.
11. Skip to step 'c.' below.
b. Start OEM DB Control middle tier, as oracle:
$ emctl start dbconsole
c. Verify that OEM DB Control is running:
i. From a browser, connect to URL "http://raclinux1:5500/em"
3. Since we have only 1 node, we'll shutdown one of the dbconsoles:
$ ORACLE_SID=O10G2 emctl stop dbconsole
Oracle Partner Training Only
General notes
a. To startup/stop database
(this will be done automatically at boot time by CRS):
$ srvctl stop database -d O10G
$ srvctl start database -d O10G
PRKP-1001 : Error starting instance O10G1 on node raclinux1
CRS-1005: Failed to get required resources
CRS-0223: Resource ora.O10G.O10G1.inst has placement error.
See bug# 3465118 for details, possible workaround:
$ srvctl start instance -d O10G -i O10G1
$ sleep 10
$ srvctl start instance -d O10G -i O10G2
There are several start/stop scripts in the ~oracle/bin directory to help you control the
environment.
b. Check how DB is configured:
srvctl config database -d O10G -a
Sample output:
raclinux1 O10G1 /opt/oracle/DB10g
raclinux1 O10G2 /opt/oracle/DB10g
DB_NAME: O10G
ORACLE_HOME: /opt/oracle/DB10g
SPFILE: null
DOMAIN: null
DB_ROLE: null
START_OPTIONS: null
c. To Turn tracing ON in srvctl:
$ export SRVM_TRACE=true
d. To add another NODE to RAC: From an *existing* RAC member/node run:
$ cd $ORA_CRS_HOME/oui/bin/ (As oracle user)
$ addNode.sh
Oracle Partner Training Only
Follow the prompts, oui will copy the software to the remote node Later you can use dbca to
add an instance on that new node. No need to use the CDs/ISO to reinstall the software.
OUI will mirror the existing ORACLE_HOME onto the new hosts.
Oracle Partner Training Only
Using ASM
Notes: Every instance needs an ASM instance on one node
Create an ASM instance using DBCA
We use 3 disk to simulate, for simplicity.
1. Use fdisk to partition /dev/sde into 4 partitions:
As root run:
# fdisk /dev/sde
i. Command: Type "n" and press ENTER.
ii. Command action: Type "p" and press ENTER.
iii. Partition number: Type "1" and press ENTER.
iv. First cylinder: Press ENTER.
v. Last cylinder: Press ENTER
vi. To write partition table and exit; Type "write"
Repeat these steps 2 more times for other two disks: /dev/sdf, /dev/sdg
In a real RAC, all other nodes will have to re-read the partition table change. Easiest
way is to reboot these nodes, refer to OS/vendor to inquire if there's a less intrusive way.
4. Configure raw devices (since not using ASMLib)
i. Add entries to /etc/sysconfig/rawdevices on all nodes, for example:
/dev/raw/raw11 /dev/sde
/dev/raw/raw12 /dev/sdf
/dev/raw/raw13 /dev/sdg
ii. As root restart the raw devices on all nodes:
# /etc/init.d/rawdevices restart
If CRS is already up with 2 raw devices, the "rawdevices restart" will give errors for
those two, but that's OK. It just means CRS already has those raw devices open so
they can't be changed.
iii. Fix permissions as root, on all nodes:
# chown oracle:dba /dev/raw/raw1[1-3]
Oracle Partner Training Only
5. Run dbca to create the ASM instance and DB:
i. Select single instance database
ii. Create Database
iii. DB name is ASM10G
iv. Select Automatic Storage Management (ASM)
v. Let DBCA create the ASM instance
vi. Create a new diskgroup Name: MY_DG
vii. Select devices /dev/raw/raw11 & 12 to be added to MY_DG with normal
redundancy.
viii. Continue to create database
6. Notice the ASM instance has been shutdown, startup issue:
$ srvctl start asm -n raclinux1
$ srvctl status asm -n raclinux1
Oracle Partner Training Only
ASM Demo
Using oewizard from swingbench to create a new schema using ASM file spec, supply
+MY_DG in the filename location and "SOE_ASM" as user, password and tablespace.
1. The ASM re-balancing demo:
i. Monitor the ASM instance and manipulate the diskgroup:
$ ORACLE_SID=+ASM sqlplus "/ as sysdba"
Initial condition:
SQL> select state,header_status,substr(name,1,12) Name,free_mb,
substr(path,1,16) PATH from v$asm_disk;
STATE HEADER_STATU NAME FREE_MB PATH
-------- ------------ ------------ ---------- ----------------
NORMAL CANDIDATE 0 /dev/raw/raw13
NORMAL MEMBER MY_DG_0001 1812 /dev/raw/raw12
NORMAL MEMBER MY_DG_0000 1812 /dev/raw/raw11
SQL> select * from v$asm_operation; (no rows)
ii. Add two new disks to the existing diskgroup:
SQL> alter diskgroup MY_DG add disk '/dev/raw/raw13'
SQL> select state,header_status,substr(name,1,12) Name,free_mb,
substr(path,1,16) PATH from v$asm_disk;
STATE HEADER_STATU NAME FREE_MB PATH
-------- ------------ ------------ ---------- ----------------
NORMAL MEMBER MY_DG_0002 1911 /dev/raw/raw13
NORMAL MEMBER MY_DG_0001 1812 /dev/raw/raw12
NORMAL MEMBER MY_DG_0000 1812 /dev/raw/raw11
SQL> select operation,state,power,actual,sofar,est_work,
est_minutes from v$asm_operation;
OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_MINUTES
----- ---- ---------- ---------- ---------- ---------- -----------
Oracle Partner Training Only
REBAL RUN 1 1 3 62 1
ASM is rebuilding the diskgroup by adding the new disks.
iii. Now DROP the initial disks that hold all the user data watch ASM transfer all the data
to the new disks thus allowing you to remove the unwanted disks. Drop completes
right away, operation of transfering data is taking place in background.
SQL> alter diskgroup MY_DG drop disk my_dg_0000;
SQL> select state,header_status,substr(name,1,12) Name,free_mb,
substr(path,1,16) PATH from v$asm_disk;
STATE HEADER_STATU NAME FREE_MB PATH
-------- ------------ ------------ ---------- ----------------
NORMAL MEMBER MY_DG_0002 2335 /dev/raw/raw13
NORMAL MEMBER MY_DG_0001 1827 /dev/raw/raw12
DROPPING MEMBER MY_DG_0000 1867 /dev/raw/raw11
SQL> select operation,state,power,actual,sofar,est_work,
est_minutes from v$asm_operation;
OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_MINUTES
----- ---- ---------- ---------- ---------- ---------- -----------
REBAL RUN 1 1 7 233 0
When operation is complete, the disks are marked as FORMER members meaning they
can be removed or reused for space.
SQL> select state,header_status,substr(name,1,12) Name,free_mb,
substr(path,1,16) PATH from v$asm_disk;
STATE HEADER_STATU NAME FREE_MB PATH
-------- ------------ ------------ ---------- ----------------
NORMAL FORMER 0 /dev/raw/raw11
NORMAL MEMBER MY_DG_0001 2303 /dev/raw/raw12
NORMAL MEMBER MY_DG_0002 1769 /dev/raw/raw13
Inside the ASM Instance
a. To connect to it, use bash to set ORACLE_SID just for this shell:
$ ORACLE_SID=+ASM1 sqlplus "/ as sysdba"
Oracle Partner Training Only[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10469105/viewspace-975483/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论
  • 博文量
    2
  • 访问量
    2428