Sei sulla pagina 1di 5

[root@devp ~]# fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes


255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot
Start
/dev/sda1 *
1
/dev/sda2
4570
/dev/sda3
26371
/dev/sda4
26383
/dev/sda5
26383
/dev/sda6
27001
/dev/sda7
28306
/dev/sda8
29611
/dev/sda9
29872
/dev/sda10
30003
[root@devp ~]# fdisk /dev/sda

End
4570
26370
26382
30401
27000
28305
29610
29871
30002
30133

Blocks
36700160
175112192
96390
32282617+
4964053+
10482381
10482381
2096451
1052226
1052226

Id
7
7
83
5
82
83
83
83
83
83

System
HPFS/NTFS
HPFS/NTFS
Linux
Extended
Linux swap / Solaris
Linux
Linux
Linux
Linux
Linux

The number of cylinders for this disk is set to 30401.


There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n
First cylinder (30134-30401, default 30134):
Using default value 30134
Last cylinder or +size or +sizeM or +sizeK (30134-30401, default 30401): +10M
Command (m for help): n
First cylinder (30136-30401, default 30136):
Using default value 30136
Last cylinder or +size or +sizeM or +sizeK (30136-30401, default 30401): +10M
Command (m for help): n
First cylinder (30138-30401, default 30138):
Using default value 30138
Last cylinder or +size or +sizeM or +sizeK (30138-30401, default 30401): +10M
Command (m for help): n
First cylinder (30140-30401, default 30140):
Using default value 30140
Last cylinder or +size or +sizeM or +sizeK (30140-30401, default 30401): +10M
Command (m for help): n
First cylinder (30142-30401, default 30142):
Using default value 30142
Last cylinder or +size or +sizeM or +sizeK (30142-30401, default 30401): +10M
Command (m for help): n
The maximum number of partitions has been created
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource

busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@devp ~]# partprobe
[root@devp ~]# fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot
Start
End
Blocks
/dev/sda1 *
1
4570
36700160
/dev/sda2
4570
26370 175112192
/dev/sda3
26371
26382
96390
/dev/sda4
26383
30401
32282617+
/dev/sda5
26383
27000
4964053+
/dev/sda6
27001
28305
10482381
/dev/sda7
28306
29610
10482381
/dev/sda8
29611
29871
2096451
/dev/sda9
29872
30002
1052226
/dev/sda10
30003
30133
1052226
/dev/sda11
30134
30135
16033+
/dev/sda12
30136
30137
16033+
/dev/sda13
30138
30139
16033+
/dev/sda14
30140
30141
16033+
/dev/sda15
30142
30143
16033+
[root@devp ~]# raw /dev/raw/raw1 /dev/sda11
/dev/raw/raw1: bound to major 8, minor 11
[root@devp ~]# raw /dev/raw/raw2 /dev/sda12
/dev/raw/raw2: bound to major 8, minor 12
[root@devp ~]# raw /dev/raw/raw3 /dev/sda13
/dev/raw/raw3: bound to major 8, minor 13
[root@devp ~]# raw /dev/raw/raw4 /dev/sda14
/dev/raw/raw4: bound to major 8, minor 14
[root@devp ~]# raw /dev/raw/raw5 /dev/sda15
/dev/raw/raw5: bound to major 8, minor 15
[root@devp ~]# vi /etc/sysconfig/rawdevices
# raw device bindings
# format: <rawdev> <major> <minor>
#
<rawdev> <blockdev>
# example: /dev/raw/raw1 /dev/sda1
#
/dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sda11
/dev/raw/raw2 /dev/sda12
/dev/raw/raw3 /dev/sda13
/dev/raw/raw4 /dev/sda14
/dev/raw/raw5 /dev/sda15

Id
7
7
83
5
82
83
83
83
83
83
83
83
83
83
83

System
HPFS/NTFS
HPFS/NTFS
Linux
Extended
Linux swap / Solaris
Linux
Linux
Linux
Linux
Linux
Linux
Linux
Linux
Linux
Linux

Restart the rawdevices service using the following command.


service rawdevices restart
[root@devp ~]# chown -R oracle.oinstall /dev/raw/raw*
[root@devp ~]# chmod -R 777 /dev/raw/
[root@devp ~]# vi /etc/rc.local
chown -R oracle.oinstall /dev/raw/raw1
chown -R oracle.oinstall /dev/raw/raw2
chown -R oracle.oinstall /dev/raw/raw3
chown -R oracle.oinstall /dev/raw/raw4

chown -R oracle.oinstall /dev/raw/raw5


chmod -R 777 /dev/raw/raw1
chmod -R 777 /dev/raw/raw2
[root@devp ~]# cd /dev/raw/
[root@devp raw]# ls
raw1 raw2 raw3 raw4 raw5
[root@devp raw]# cd
Now login as oracle and open dbca
configure asm
Startup ASM instance
export ORACLE_SID=+ASM
sqlplus
/ as sysdba
shutdown
startup
startup database also
create tablespace test datafile '+G1';
desc dba_data_files
select file_name from dba_data_files
For asmcmd utility
export ORACLE_SID=+ASM
asmcmd
ls
cd G
ls
cd orcl
ls
For configuration of ASM with Enterprise Manager:
Start both orcl and ASM instance
Configure orcl with default listener and using net manager(netmgr) and start the
default listener.
Open terminal
export ORACLE_SID=orcl
emca -deconfig dbcontrol db
After completion of this step again
export ORACLE_SID=orcl
emca -config dbcontrol db
Enter all the details and it will take some time for the configuration
After completion open the Enterprise manager and see the ASM link just below Lis
tener on the left hand side.
#########################################################################
MIGRATE DATABASE TO ASM
#########################################################################
Steps
1. Create pfile from spile
SQL> create pfile='/home/oracle/Desktop/initrajdb.ora' from spfile;
2. Shutdown the database
SQL>shutdown immediate;

3. Edit the pfile to use OMF


a) Remove the control_files parameter completely
b) set the value for db_create_file_dest to asm diskgroup
*.db_create_file_dest='+dg1'
c) Set the value for db_recovery_file_dest
*.db_recovery_file_dest='+dg1'
d) Set the value for db_recovery_file_dest_size
*.db_recovery_file_dest_size=2147483648
4. Start any other database in nomount stage
5. Create spfile from the edited pfile
create spfile='/u01/app/oracle/product/10.2.0/db_1/dbs/
spfilerajdb.ora' from pfile='/home/oracle/Desktop/initrajdb.ora';
6. Start rman
7. Connect to the target database
8. Startup the database in nomont stage
RMAN> startup nomount;
9. Restore the controlfile
RMAN> restore controlfile from '/u01/app/oracle/oradata/rajdb/
control01.ctl';
10. Mount the database.
RMAN> alter database mount;
11. Backup the database as copy
RMAN> backup as copy database format '+dg1';
12. Switch the database to the backup copy
RMAN> switch database to copy;
13. Open the database
RMAN> alter database open;
################################################################################
#######
REMOVING DISK FROM DISKGROUP
################################################################################
#######
-----------------------------------Display the disks in a diskgroup
---------------------------------SQL> select group_number,
2
name,
3
path
4 from v$asm_disk;
GROUP_NUMBER
-----------1
1
1
1
1

NAME
-----------------------------DG1_0004
DG1_0003
DG1_0002
DG1_0001
DG1_0000

PATH
-------------------/dev/raw/raw5
/dev/raw/raw4
/dev/raw/raw3
/dev/raw/raw2
/dev/raw/raw1

-----------------------------------Remove a disk from the diskgroup


---------------------------------SQL> alter diskgroup dg1
2 drop disk 'DG1_0004';
Diskgroup altered.

----------------------Creating Diskgroups
--------------------SQL> create diskgroup dg2
2 normal redundancy
3 disk '/dev/raw/raw4','/dev/raw/raw5';
################################################################################
######
ASM VIEWS
################################################################################
######
v$asm_diskgroup
v$asm_disk
v$asm_client
v$asm_file
v$asm_operation
################################################################################
#####
################################################################################
#####

Potrebbero piacerti anche