ASM 설치 후 관리

Oracle/Oracle_RAC 2016. 7. 28. 18:14


- Archive 저장할 Disk Group 생성

sql문으로 생성할 시  permission denied가 된다.

grid 유저로 asmca로 들어가서 생성해도 된다.

 

 


SQL> create diskgroup ARC external redundancy disk 'ORCL:ARC01','ORCL:ARC02';
create diskgroup ARC external redundancy disk 'ORCL:ARC01','ORCL:ARC02'
*
ERROR at line 1:
ORA-15260: permission denied on ASM disk group


SQL>
SQL>
SQL>
SQL> show parameter asm_diskstring

NAME         TYPE      VALUE
------------------------------------ ---------------------- ------------------------------
asm_diskstring        string

 


SQL> set lines 200
SQL> col group_name for a10
SQL> col disk_name for a10
SQL>
SQL> select b.name group_name, a.name disk_name, a.header_status, a.state, a.free_mb
  2  from v$asm_disk a, v$asm_diskgroup b
  3  where a.group_number=b.group_number;

GROUP_NAME DISK_NAME  HEADER_STATUS        STATE     FREE_MB
---------- ---------- ------------------------ ---------------- ----------
ARC    ARC01      MEMBER         NORMAL        2022
ARC    ARC02      MEMBER         NORMAL        2018
DATA    DATA01     MEMBER         NORMAL        4449
DATA    DATA02     MEMBER         NORMAL        4453
DATA    DATA03     MEMBER         NORMAL        4454

 

- Archive mode 활성화
- Archive Destination 설정하기

SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size      2253664 bytes
Variable Size   1006636192 bytes
Database Buffers   587202560 bytes
Redo Buffers      7319552 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode        Archive Mode
Automatic archival        Enabled
Archive destination        +ARC
Oldest online log sequence     4
Next log sequence to archive   6
Current log sequence        6
SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.


- grid유저로 asmcmd 사용하여 ASM directory 확인하기


[grid:/home/grid/]$ asmcmd
ASMCMD> ls
ARC/
DATA/
ASMCMD> cd DATA
ASMCMD> ls
ASM/
QDB/
ASMCMD> cd ASM
ASMCMD> ls
ASMPARAMETERFILE/
ASMCMD> cd ASMPARAMETERFILE
ASMCMD> ls
REGISTRY.253.918403535
ASMCMD>
ASMCMD> cd ../..
ASMCMD> ls
ASM/
QDB/
ASMCMD> cd QDB
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileQDB.ora
ASMCMD>
ASMCMD> ls DATAFIE^H
ASMCMD-8004: Oracle ASM file path 'DATAFI' contains an invalid alias name
ASMCMD>
ASMCMD> ls DATAFILE
EXAMPLE.265.918406011
SYSAUX.257.918405923
SYSTEM.256.918405923
UNDOTBS1.258.918405923
USERS.259.918405925


- oracle 유저에서 sqlplus 접속 후 tablespace 생성/삭제

 

SQL> create tablespace test datafile '+DATA' size 10m;

Tablespace created.

SQL> col tablespace_name for a15
SQL> col file_name for a50
SQL> set lines 500
SQL> select tablespace_name, file_name, bytes/1024/1024 mb
  2  from dba_data_files;

TABLESPACE_NAME FILE_NAME         MB
--------------- -------------------------------------------------- ----------
USERS  +DATA/qdb/datafile/users.259.918405925       5
UNDOTBS1 +DATA/qdb/datafile/undotbs1.258.918405923    105
SYSAUX  +DATA/qdb/datafile/sysaux.257.918405923     540
SYSTEM  +DATA/qdb/datafile/system.256.918405923     750
EXAMPLE  +DATA/qdb/datafile/example.265.918406011       313.125
TEST  +DATA/qdb/datafile/test.267.918410889      10

SQL> drop tablespace test;

Tablespace dropped.

ASMCMD> ^[[A^[[A
        commands:
        --------

        md_backup, md_restore

        lsattr, setattr

        cd, cp, du, find, help, ls, lsct, lsdg, lsof, mkalias
        mkdir, pwd, rm, rmalias

        chdg, chkdg, dropdg, iostat, lsdsk, lsod, mkdg, mount
        offline, online, rebal, remap, umount

        dsget, dsset, lsop, shutdown, spbackup, spcopy, spget
        spmove, spset, startup

        chtmpl, lstmpl, mktmpl, rmtmpl

        chgrp, chmod, chown, groups, grpmod, lsgrp, lspwusr, lsusr
        mkgrp, mkusr, orapwusr, passwd, rmgrp, rmusr

        volcreate, voldelete, voldisable, volenable, volinfo
        volresize, volset, volstat

 

'Oracle > Oracle_RAC' 카테고리의 다른 글

ora.rac1.ons  (0) 2016.08.02
Virtual IP  (0) 2016.08.02
RAC1 /RAC2 설치과정  (0) 2016.08.01
ASM 개념과 설치  (0) 2016.07.28
RAC소개  (0) 2016.07.28
admin