ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Install Oracle base on ASM on Solaris

Install Oracle base on ASM on Solaris

原创 Linux操作系统 作者:hjianping 时间:2011-05-05 22:55:43 0 删除 编辑

[root@huang]# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0d0
          /pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
       1. c2t0d0
          /pci@0,0/pci1000,8000@14/sd@0,0
       2. c2t1d0
          /pci@0,0/pci1000,8000@14/sd@1,0
       3. c2t2d0
          /pci@0,0/pci1000,8000@14/sd@2,0
       4. c2t3d0
          /pci@0,0/pci1000,8000@14/sd@3,0
       5. c2t4d0
          /pci@0,0/pci1000,8000@14/sd@4,0
       6. c2t5d0
          /pci@0,0/pci1000,8000@14/sd@5,0
       7. c2t6d0
          /pci@0,0/pci1000,8000@14/sd@6,0
Specify disk (enter its number): 5
selecting c2t4d0
[disk formatted]

FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> p
WARNING - This disk may be in use by an application that has
          modified the fdisk table. Ensure that this disk is
          not currently in use before proceeding to use fdisk.
format> fdisk
No fdisk table exists. The default partition for the disk is:

  a 100% "SOLARIS System" partition

Type "y" to accept the default partition,  otherwise type "n" to edit the
 partition table.
y
format> p

PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        ! - execute , then return
        quit
partition> p
Current partition table (original):
Total disk cylinders available: 1532 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)          0
  1 unassigned    wm       0               0         (0/0/0)          0
  2     backup    wu       0 - 1531        2.99GB    (1532/0/0) 6275072
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6 unassigned    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0               0         (0/0/0)          0
  8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096
  9 unassigned    wm       0               0         (0/0/0)          0

partition> 2
Part      Tag    Flag     Cylinders        Size            Blocks
  2     backup    wu       0 - 1531        2.99GB    (1532/0/0) 6275072

Enter partition id tag[backup]:
Enter partition permission flags[wu]:
Enter new starting cyl[0]:
Enter partition size[6275072b, 1532c, 1531e, 3064.00mb, 2.99gb]: 0
partition> 6
Part      Tag    Flag     Cylinders     Size            Blocks
  6 unassigned    wm       0            0         (0/0/0)    0

Enter partition id tag[unassigned]: usr
Enter partition permission flags[wm]:
Enter new starting cyl[1]:
Enter partition size[0b, 0c, 1e, 0.00mb, 0.00gb]: 2.99gb
partition> p
Current partition table (unnamed):
Total disk cylinders available: 1532 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)          0
  1 unassigned    wm       0               0         (0/0/0)          0
  2 unassigned    wu       0               0         (0/0/0)          0
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6        usr    wm       1 - 1531        2.99GB    (1531/0/0) 6270976
  7 unassigned    wm       0               0         (0/0/0)          0
  8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096
  9 unassigned    wm       0               0         (0/0/0)          0

partition> label
Ready to label disk, continue? y

partition> q

FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> label
Ready to label disk, continue? y

format> q
[root@huang]# chown oracle:dba /dev/rdsk/c2t*
[root@huang]# chmod 660 /dev/rdsk/c2t*
[root@huang]# ls -lL /dev/rdsk


root
执行$ORACLE_HOME/bin/localconfig add是安装ocssd
执行$ORACLE_HOME/bin/localconfig delete

[root@huang]# cd /export/home/u01/oracle/bin
[root@huang]# ./localconfig add

oracle
[oracle@huang]$ dbca

[oracle@huang]$ export ORACLE_SID=+ASM
[oracle@huang]$ sqlplus / as sysdba
SQL> alter system set asm_diskstring='/dev/rdsk/*';
SQL> show parameter disk
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups                       string
asm_diskstring                       string      /dev/rdsk/*
disk_asynch_io                       boolean     TRUE

SQL> create diskgroup data1 normal redundancy failgroup d1 disk '/dev/rdsk/c2t0d0s6' failgroup d2 disk '/dev/rdsk/c2t1d0s6';

SQL> create diskgroup flash_data normal redundancy failgroup f1 disk '/dev/rdsk/c2t2d0s6' failgroup f2 disk '/dev/rdsk/c2t3d0s6';


SQL> select a.group_number,a.name group_name,b.failgroup,b.name file_name,b.path,b.mount_status,b.header_status,b.state,b.total_mb,b.free_mb
from v$asm_diskgroup a,v$asm_disk b
where a.group_number(+)=b.group_number
order by a.group_number,b.failgroup,b.name;

SQL> select group_number,name,state,type,total_mb,free_mb,
required_mirror_free_mb,usable_file_mb,offline_disks,unbalanced
from v$asm_diskgroup
order by group_number;

SQL> select group_number,mount_status,state,header_status,total_mb,free_mb,name,failgroup,path
from v$asm_disk
order by group_number,failgroup,path;

SQL> select * from v$asm_operation;

SQL> alter diskgroup data1 add
failgroup d1 disk '/dev/rdsk/c2t4d0s6'
failgroup d2 disk '/dev/rdsk/c2t5d0s6';


SQL> alter diskgroup data1 drop disk DATA1_0003;
SQL> alter diskgroup data1 add disk '/dev/rdsk/c2t6d0s7';
SQL> alter diskgroup data1 add failgroup d1 disk '/dev/rdsk/c2t6d0s6';
SQL> alter diskgroup temp_data mount;
SQL> drop diskgroup temp_data including contents;

select a.name disk_group_name,c.instance_name instance_name,c.db_name db_name,c.status status
from v$asm_diskgroup a,v$asm_client c
where a.group_number=c.group_number
order by a.name;

select g.name disk_group_name,
 a.name file_name,
 f.bytes bytes,
 f.space space,
 f.type type,
 f.creation_date creation_date
from v$asm_file f,v$asm_alias a,v$asm_diskgroup g
where f.group_number = a.group_number
and f.file_number=a.file_number
and f.group_number = g.group_number
and system_created = 'Y'
order by g.name,a.file_number;


SELECT 'alter diskgroup '||disk_group_name ||' drop file ''' || CONCAT('+' || disk_group_name, SYS_CONNECT_BY_PATH(alias_name, '/'))||''';' full_alias_path
FROM
(select g.name disk_group_name,
 a.parent_index pindex,
 a.name alias_name,
 a.reference_index rindex,
 f.type type
 from v$asm_file f right outer join v$asm_alias a using(group_number,file_number)
 join v$asm_diskgroup g using(group_number)
)
where type IS NOT NULL
START WITH (MOD(pindex, POWER(2, 24))) = 0
CONNECT BY PRIOR rindex = pindex

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

下一篇: 裸设备安装Oracle
请登录后发表评论 登录
全部评论

注册时间:2011-04-24

  • 博文量
    80
  • 访问量
    73190