2023. 7. 26. 09:22

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

ORACLE/SQL2023. 7. 2. 00:48
반응형

-- 유저 별
select 'select '||'count(*)'||' ' ||'from ' ||table_name||';'   from user_tables; 


-- 전체 건수 뽑는 쿼리 뽑기
select 'select '||'count(*)'||' ' ||' from '|| owner||'.' ||table_name||';'   from dba_tables
order by owner,table_name
;;

-- 유저 별 함수 사용
select table_name
,num_rows "통계건수"
,to_number(
dbms_xmlgen.getxmltype('SELECT COUNT(*) C FROM ' || TABLE_NAME).Extract('//text()'))  "실제 건수"
FROM dba_tables;



select table_name
,num_rows "통계건수"
,to_number(
dbms_xmlgen.getxmltype('SELECT COUNT(*) C FROM ' || TABLE_NAME).Extract('//text()'))  "실제 건수"
FROM user_tables;

반응형
Posted by [PineTree]
ORACLE/INSTALL2023. 6. 14. 17:43
반응형

-- /etc/hosts
192.168.219.59  ora19adg1
192.168.219.69  ora19adg2
192.168.219.51  ora19c
192.168.219.57  ora19c-ogg

192.168.56.108  radg1
192.168.56.103  radg2


#1

*.audit_file_dest='/u01/app/oracle/admin/ora19c/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/oradata/ORA19C/control01.ctl','/oradata/ORA19C/control02.ctl'
*.db_block_size=8192
*.db_name='ora19c'
*.db_recovery_file_dest='/oradata'
*.db_recovery_file_dest_size=8256m
*.db_unique_name='primary'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora19cXDB)'
*.local_listener='LISTENER1','LISTENER2'
*.log_archive_config='dg_config=(primary,standby)'
*.log_archive_dest_1='location=/arch'
*.log_archive_dest_2='service=standby lgwr async valid_for=(online_logfile,primary_role) db_unique_name=standby'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.arc'
*.nls_language='KOREAN'
*.nls_territory='KOREA'
*.open_cursors=300
*.pga_aggregate_target=996m
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2986m
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'


#2
*.audit_file_dest='/u01/app/oracle/admin/standby/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/oradata/STANDBY/control01.ctl','/oradata/STANDBY/control02.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_file_name_convert='/oradata/ORA19C','/oradata/STANDBY'
*.db_name='ora19c'
*.db_recovery_file_dest='/oradata'
*.db_recovery_file_dest_size=8256m
*.db_unique_name='standby'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
*.fal_client='primary'
*.fal_server='standby'
*.local_listener='LISTENER1','LISTENER2'
*.log_archive_config='dg_config=(primary,standby)'
*.log_archive_dest_1='location=/arch'
*.log_archive_dest_2='service=primary lgwr async valid_for=(online_logfile,primary_role) db_unique_name=primary'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_format='%t_%s_%r.arc'
*.log_file_name_convert='/oradata/ORA19C','/oradata/STANDBY'
*.nls_language='KOREAN'
*.nls_territory='KOR
*.open_cursors=300
*.pga_aggregate_target=996m
*.processes=320
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=2986m
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'



패스워드 파일 DR서버로 복사(SCP)
orapwora19c 복사

복제용 임시 리스너 설정
#2 서버에 적용 listener.ora 및 기동
SID_LIST_LISTENER_ADG =
   (SID_LIST =
     (SID_DESC =
       (SID_NAME = standby)
       (ORACLE_HOME = /u01/app/oracle/product/19c/db_1)
     )
   )



LISTENER_ADG =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21525))
      (CONNECT_DATA =
       (SERVER = DEDICATED)
       (SERVICE_NAME = standby)
     )
   )

lsnrctl start listener_adg
-- tnsnames.ora설정 #1,#2 서버 모두 설정

LISTENER_ORA19CADG =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1521))


LISTENER_ADG =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21525))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = standby)
    )
  )

STANDBY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 21521))
      (FAIL_OVER = ON)
    )
    (CONNECT_DATA =
      (SERVICE_NAME = standby)
    )
  )

LISTENER_ADG1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 21521))
    )
    (CONNECT_DATA =
      (SID = primary)
    )
  )



primary =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 21521))
      (FAIL_OVER = ON)
    )
    (CONNECT_DATA =
      (SERVICE_NAME = primary)
    )
  )


복제
1) active 서버 에서 복제
nomount 모드로 기동

sqlplus / as sysdba
startup nomount

[ora19c:/u01/app/oracle/product/19c/db_1/network/admin]> rman target sys/oracle@primary auxiliary sys/oracle@standby

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jun 1 17:01:41 2023
Version 19.13.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORA19C (DBID=1191478324)
connected to auxiliary database: ORA19C (not mounted)

RMAN> run {
2> allocate channel prmy1 type disk;
3> allocate auxiliary channel stby1 type disk;
4> duplicate target database for standby from active database nofilenamecheck dorecover;
5>   }

using target database control file instead of recovery catalog
allocated channel: prmy1
channel prmy1: SID=23 device type=DISK

allocated channel: stby1
channel stby1: SID=10 device type=DISK

Starting Duplicate Db at 01-JUN-23
current log archived

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/u01/app/oracle/product/19c/db_1/dbs/orapwstandby'   ;
}
executing Memory Script

Starting backup at 01-JUN-23
Finished backup at 01-JUN-23

contents of Memory Script:
{
   restore clone from service  'primary' standby controlfile;
}
executing Memory Script

Starting restore at 01-JUN-23

channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: restoring control file
channel stby1: restore complete, elapsed time: 00:00:01
output file name=/oradata/STANDBY/control01.ctl
output file name=/oradata/STANDBY/control02.ctl
Finished restore at 01-JUN-23

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oradata/STANDBY/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/oradata/STANDBY/system01.dbf";
   set newname for datafile  3 to 
 "/oradata/STANDBY/sysaux01.dbf";
   set newname for datafile  4 to 
 "/oradata/STANDBY/undotbs01.dbf";
   set newname for datafile  7 to 
 "/oradata/STANDBY/users01.dbf";
   restore
   from  nonsparse   from service 
 'primary'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oradata/STANDBY/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 01-JUN-23

channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00001 to /oradata/STANDBY/system01.dbf
channel stby1: restore complete, elapsed time: 00:00:25
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00003 to /oradata/STANDBY/sysaux01.dbf
channel stby1: restore complete, elapsed time: 00:00:15
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00004 to /oradata/STANDBY/undotbs01.dbf
channel stby1: restore complete, elapsed time: 00:00:01
channel stby1: starting datafile backup set restore
channel stby1: using network backup set from service primary
channel stby1: specifying datafile(s) to restore from backup set
channel stby1: restoring datafile 00007 to /oradata/STANDBY/users01.dbf
channel stby1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  'primary' 
           archivelog from scn  2276859;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 01-JUN-23

channel stby1: starting archived log restore to default destination
channel stby1: using network backup set from service primary
channel stby1: restoring archived log
archived log thread=1 sequence=13
channel stby1: restore complete, elapsed time: 00:00:01
channel stby1: starting archived log restore to default destination
channel stby1: using network backup set from service primary
channel stby1: restoring archived log
archived log thread=1 sequence=14
channel stby1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1138381380 file name=/oradata/STANDBY/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1138381380 file name=/oradata/STANDBY/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1138381380 file name=/oradata/STANDBY/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1138381380 file name=/oradata/STANDBY/users01.dbf

contents of Memory Script:
{
   set until scn  2277311;
   recover
   standby
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 01-JUN-23

starting media recovery

archived log for thread 1 with sequence 13 is already on disk as file /arch/1_13_1138290295.arc
archived log for thread 1 with sequence 14 is already on disk as file /arch/1_14_1138290295.arc
archived log file name=/arch/1_13_1138290295.arc thread=1 sequence=13
archived log file name=/arch/1_14_1138290295.arc thread=1 sequence=14
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-JUN-23

contents of Memory Script:
{
   delete clone force archivelog all;
}
executing Memory Script

deleted archived log
archived log file name=/arch/1_13_1138290295.arc RECID=1 STAMP=1138381378
deleted archived log
archived log file name=/arch/1_14_1138290295.arc RECID=2 STAMP=1138381379
Deleted 2 objects

Finished Duplicate Db at 01-JUN-23
released channel: prmy1
released channel: stby1

2) standby 서버에서 복제 실행

[standby:/oradata/STANDBY]> rman target sys/oracle@primary auxiliary sys/oracle@listener_adg

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Jun 1 17:46:05 2023
Version 19.13.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORA19C (DBID=1191478324)
connected to auxiliary database: ORA19C (not mounted)

RMAN> duplicate target database for standby from active database nofilenamecheck dorecover;

Starting Duplicate Db at 01-JUN-23
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=379 device type=DISK
current log archived

contents of Memory Script:
{
   backup as copy reuse
   passwordfile auxiliary format  '/u01/app/oracle/product/19c/db_1/dbs/orapwstandby'   ;
}
executing Memory Script

Starting backup at 01-JUN-23
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
Finished backup at 01-JUN-23

contents of Memory Script:
{
   restore clone from service  'primary' standby controlfile;
}
executing Memory Script

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oradata/STANDBY/control01.ctl
output file name=/oradata/STANDBY/control02.ctl
Finished restore at 01-JUN-23

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/oradata/STANDBY/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "/oradata/STANDBY/system01.dbf";
   set newname for datafile  3 to 
 "/oradata/STANDBY/sysaux01.dbf";
   set newname for datafile  4 to 
 "/oradata/STANDBY/undotbs01.dbf";
   set newname for datafile  7 to 
 "/oradata/STANDBY/users01.dbf";
   restore
   from  nonsparse   from service 
 'primary'   clone database
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /oradata/STANDBY/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /oradata/STANDBY/system01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /oradata/STANDBY/sysaux01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /oradata/STANDBY/undotbs01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /oradata/STANDBY/users01.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

sql statement: alter system archive log current
current log archived

contents of Memory Script:
{
   restore clone force from service  'primary' 
           archivelog from scn  2283316;
   switch clone datafile all;
}
executing Memory Script

Starting restore at 01-JUN-23
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=21
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service primary
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=22
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 01-JUN-23

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=1138384007 file name=/oradata/STANDBY/system01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=1138384007 file name=/oradata/STANDBY/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=1138384007 file name=/oradata/STANDBY/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1138384007 file name=/oradata/STANDBY/users01.dbf

contents of Memory Script:
{
   set until scn  2283480;
   recover
   standby
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 01-JUN-23
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 21 is already on disk as file /arch/1_21_1138290295.arc
archived log for thread 1 with sequence 22 is already on disk as file /arch/1_22_1138290295.arc
archived log file name=/arch/1_21_1138290295.arc thread=1 sequence=21
archived log file name=/arch/1_22_1138290295.arc thread=1 sequence=22
media recovery complete, elapsed time: 00:00:01
Finished recover at 01-JUN-23

contents of Memory Script:
{
   delete clone force archivelog all;
}
executing Memory Script

released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
deleted archived log
archived log file name=/arch/1_21_1138290295.arc RECID=1 STAMP=1138384004
deleted archived log
archived log file name=/arch/1_22_1138290295.arc RECID=2 STAMP=1138384006
Deleted 2 objects

Finished Duplicate Db at 01-JUN-23


 

오라클 single adg 네트워크 설정

#1.listener.ora ############################################################################# LISTENER1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529)) ) LISTENER2 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT

theone79.tistory.com

 

 

반응형
Posted by [PineTree]
ORACLE/INSTALL2023. 6. 14. 16:12
반응형

#1.listener.ora 
#############################################################################
LISTENER1 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529))
)

LISTENER2 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 9999))
)
#############################################################################
#2.listener.ora
#############################################################################
LISTENER1 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 1529))
)

LISTENER2 =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg2)(PORT = 9999))
)


#############################################################################
#1,#2 서버에 모두 적용
alter system set local_listener='LISTENER1','LISTENER2' scope=both;
#############################################################################

#1.tnsnames.ora

LISTENER1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529))

LISTENER2 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 9999))
  
SER1 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = ora19c)
    )
  )

SER2 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = standby)
    )
  )

primary   =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = primary)
    )
  )

standby   =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg2)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = standby)
    )
~     

#############################################################################
#2.tnsnames.ora

LISTENER1 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 1529))

LISTENER2 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg2)(PORT = 9999))


SER1 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg1)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = ora19c)
    )
  )

SER2 =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = ora19adg2)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = standby)
    )
  )

primary   =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg1)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = primary)
    )
  )

standby   =
  (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = radg2)(PORT = 1529))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = standby)
    )
~     


#############################################################################
#2 서버에서 ADG 기동

alter database recover managed standby database cancel;
alter database flashback on;
alter database recover managed standby database using current logfile disconnect;

모니터링
COLUMN NAME FORMAT A24
COLUMN VALUE FORMAT A16     
COLUMN DATUM_TIME FORMAT A24
SELECT NAME, VALUE, DATUM_TIME FROM V$DATAGUARD_STATS;


 

오라클 single adg 초기 설정 (1)

-- /etc/hosts 192.168.219.59 ora19adg1 192.168.219.69 ora19adg2 192.168.219.51 ora19c 192.168.219.57 ora19c-ogg 192.168.56.108 radg1 192.168.56.103 radg2 #1 *.audit_file_dest='/u01/app/oracle/admin/ora19c/adump' *.audit_trail='db' *.compatible='19.0.0' *.c

theone79.tistory.com

 

반응형

'ORACLE > INSTALL' 카테고리의 다른 글

oracle 19c Silent install linux  (0) 2023.07.26
오라클 single adg 초기 설정 (1)  (0) 2023.06.14
oracle seha 설치 후 relocate 실패  (2) 2022.09.30
오라클 11G upgrade관련문서  (0) 2013.10.29
oracle silent install  (0) 2012.05.11
Posted by [PineTree]
ORACLE/ADMIN2023. 6. 9. 21:47
반응형

RAC 기준으로 설명

오라클 ASM diskgroup 생성 및 disk 추가

※  선행 작업으로 disk 쪼개고 공유 설정 후 서버에 할당 해줌

여기서는 버추얼 박스로 총 ASM01~05까지 5개를 만들고  서버마다 할당 해줌

-- 쪼개기

H:\Vbox\storage>vboxmanage createmedium --filename ASM01.vdi --size 100 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 519461cf-729c-418f-af0f-0fede3ed646b

H:\Vbox\storage>vboxmanage createmedium --filename ASM02.vdi --size 100 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 3715751b-9226-40b2-95e9-f68698b16a63

H:\Vbox\storage>vboxmanage createmedium --filename ASM03.vdi --size 100 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 1e423ac5-6474-4617-a6e8-8e7b6270593e

H:\Vbox\storage>vboxmanage createmedium --filename ASM04.vdi --size 100 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: 361e559f-1efe-4e95-ad13-9ad007149583

H:\Vbox\storage>vboxmanage createmedium --filename ASM05.vdi --size 100 --format VDI --variant Fixed
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: a8432efa-251b-4f1f-8a05-b99d57fbd009

 

-- 버추얼 박스 관리자에서 각각의 서버에 공유 볼륨을 똑 같은 순서로 할당

각각의 서버에에 할당


-- 공유 디바이스로 설정
H:\Vbox\storage>vboxmanage modifymedium ASM01.vdi --type shareable

H:\Vbox\storage>vboxmanage modifymedium ASM02.vdi --type shareable

H:\Vbox\storage>vboxmanage modifymedium ASM03.vdi --type shareable

H:\Vbox\storage>vboxmanage modifymedium ASM04.vdi --type shareable

H:\Vbox\storage>vboxmanage modifymedium ASM05.vdi --type shareable

====================================

-- 추가한 disk 확인

[root@rac1 dev]# ls -al sd*
brw-rw----. 1 root disk 8,   0  6월  8 16:11 sda
brw-rw----. 1 root disk 8,   1  6월  8 16:11 sda1
brw-rw----. 1 root disk 8,   2  6월  8 16:11 sda2
brw-rw----. 1 root disk 8,  16  6월  8 16:11 sdb
brw-rw----. 1 root disk 8,  17  6월  8 16:11 sdb1
brw-rw----. 1 root disk 8,  32  6월  8 16:11 sdc
brw-rw----. 1 root disk 8,  33  6월  8 16:11 sdc1
brw-rw----. 1 root disk 8,  48  6월  8 16:11 sdd
brw-rw----. 1 root disk 8,  49  6월  8 16:11 sdd1
brw-rw----. 1 root disk 8,  64  6월  8 16:11 sde
brw-rw----. 1 root disk 8,  65  6월  8 16:11 sde1
brw-rw----. 1 root disk 8,  80  6월  8 16:11 sdf
brw-rw----. 1 root disk 8,  81  6월  8 16:11 sdf1
brw-rw----. 1 root disk 8,  96  6월  8 16:11 sdg
brw-rw----. 1 root disk 8,  97  6월  8 16:11 sdg1
brw-rw----. 1 root disk 8, 112  6월  8 16:16 sdh
brw-rw----. 1 root disk 8, 113  6월  8 17:19 sdh1
brw-rw----. 1 root disk 8, 128  6월  8 16:11 sdi
brw-rw----. 1 root disk 8, 144  6월  8 16:11 sdj
brw-rw----. 1 root disk 8, 160  6월  8 16:11 sdk
brw-rw----. 1 root disk 8, 176  6월  8 16:11 sdl
brw-rw----. 1 root disk 8, 192  6월  8 16:11 sdm

 

-- 파티션 생성
[root@rac1 dev]# fdisk /dev/sdi
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x1763f317.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-204799, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default 204799): 
Using default value 204799
Partition 1 of type Linux and of size 99 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 dev]# fdisk /dev/sdj
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x697410e9.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-204799, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default 204799): 
Using default value 204799
Partition 1 of type Linux and of size 99 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 dev]# fdisk /dev/sdk
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x0dde1be5.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-204799, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default 204799): 
Using default value 204799
Partition 1 of type Linux and of size 99 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 dev]# fdisk /dev/sdl
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xd45bb1c8.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-204799, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default 204799): 
Using default value 204799
Partition 1 of type Linux and of size 99 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 dev]# fdisk /dev/sdm
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x57f6bcbe.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
First sector (2048-204799, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-204799, default 204799): 
Using default value 204799
Partition 1 of type Linux and of size 99 MiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
-- ASM disk 등록
oracleasm createdisk asm01 /dev/sdi1
oracleasm createdisk asm02 /dev/sdj1
oracleasm createdisk asm03 /dev/sdk1
oracleasm createdisk asm04 /dev/sdl1
oracleasm createdisk asm05 /dev/sdm1

 

-- 그리드 계정에서 접속
sqlplus / as sysasm

set line 200
col path for a30
select group_number, mount_status, path, total_mb
from v$asm_disk where mount_status='CLOSED';

GROUP_NUMBER MOUNT_STATUS          PATH         TOTAL_MB
------------ --------------------- ------------------------------ ----------
           0 CLOSED                /dev/oracleasm/disks/ASM03              0
           0 CLOSED                /dev/oracleasm/disks/ASM01              0
           0 CLOSED                /dev/oracleasm/disks/ASM05              0
           0 CLOSED                /dev/oracleasm/disks/ASM02              0
           0 CLOSED                /dev/oracleasm/disks/ASM04              0

-- disk group 생성
SQL> create diskgroup asmdata external redundancy disk '/dev/oracleasm/disks/ASM01' ;     

Diskgroup created.


-- DISK 추가
SQL> create diskgroup asmdata external redundancy disk '/dev/oracleasm/disks/ASM01' ;     

Diskgroup created.

SQL> alter diskgroup asmdata add disk '/dev/oracleasm/disks/ASM02'  REBALANCE POWER 5;

Diskgroup altered.

SQL> alter diskgroup asmdata add disk '/dev/oracleasm/disks/ASM03'  REBALANCE POWER 5;

Diskgroup altered.

alter diskgroup asmdata add disk '/dev/oracleasm/disks/ASM02'  REBALANCE POWER 5;
※ REBALANCE POWER : 0부터 1024까지 설정 할 수 있으며 숫자가 높을수록 리밸런스 속도가 빨라지지만

I/O 가 늘어남으로 시스템 상태 사용률이 낮거나 업무시간 이후에 높이는 것 추천!!

SQL> col path for a30                    
SQL> col name for a14
SQL> select group_number, disk_number, name, mount_status, path, total_mb, free_mb
  2  from v$asm_disk
  3  order by 1,3;

GROUP_NUMBER DISK_NUMBER NAME           MOUNT_STATUS          PATH                             TOTAL_MB    FREE_MB
------------ ----------- -------------- --------------------- ------------------------------ ---------- ----------
           0           0                CLOSED                /dev/oracleasm/disks/ASM05              0          0
           1           0 CRS_0000       CACHED                /dev/oracleasm/disks/CRS1            1020        760
           1           1 CRS_0001       CACHED                /dev/oracleasm/disks/CRS2            1020        764
           1           2 CRS_0002       CACHED                /dev/oracleasm/disks/CRS3            1020        760
           1           3 CRS_0003       CACHED                /dev/oracleasm/disks/CRS4            1020        816
           2           1 DATA2          CACHED                /dev/oracleasm/disks/DATA2          50996      47884
           2           0 DATA_0000      CACHED                /dev/oracleasm/disks/DATA           30716      28820
           3           0 FRA_0000       CACHED                /dev/oracleasm/disks/FRA            20476      19084
           4           0 ASMDATA_0000   CACHED                /dev/oracleasm/disks/ASM01             99         79
           4           1 ASMDATA_0001   CACHED                /dev/oracleasm/disks/ASM02             99         79
           4           2 ASMDATA_0002   CACHED                /dev/oracleasm/disks/ASM03             99         79
           4           3 ASMDATA_0003   CACHED                /dev/oracleasm/disks/ASM04             99         79

12 rows selected.

반응형
Posted by [PineTree]
ORACLE/TroubleShooting2023. 6. 8. 23:43
반응형


SQL> create user asmtest identified by asmtest default tablespace asmtbs temporary tablespace temp;
create user asmtest identified by asmtest default tablespace asmtbs temporary tablespace temp
            *
ERROR at line 1:
ORA-65096: invalid common user or role name

 

 c## 안 붙이고11g이하처럼ㅁ 편하게 쓰고싶으신분은 아래 쿼리문을 실행 해주세요

 

alter session set "_ORACLE_SCRIPT"=true;

 

반응형
Posted by [PineTree]
ORACLE/TroubleShooting2023. 6. 8. 17:30
반응형

오라클 ASM 작업 시에  sysdba 로 접속시에 디스크 관련 작업 실패

sqlplus / as sysasm 

sysasm계정으로 꼭 접속 해야 작업이 가능하다

 

ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15260: permission denied on ASM disk group

[+ASM1:/home/oracle]> sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 8 16:38:35 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> /

GROUP_NUMBER DISK_NUMBER NAME           MOUNT_STATUS          PATH           TOTAL_MB    FREE_MB
------------ ----------- -------------- --------------------- ------------------------------ ---------- ----------
           1           0 CRS_0000       CACHED                /dev/oracleasm/disks/CRS1            1020        700
           1           1 CRS_0001       CACHED                /dev/oracleasm/disks/CRS2            1020        696
           1           2 CRS_0002       CACHED                /dev/oracleasm/disks/CRS3            1020        696
           2           1 DATA2          CACHED                /dev/oracleasm/disks/DATA2          50996      47884
           2           0 DATA_0000      CACHED                /dev/oracleasm/disks/DATA           30716      28820
           3           0 FRA_0000       CACHED                /dev/oracleasm/disks/FRA            20476      19084

6 rows selected.

SQL> set line 200
SQL> col path for a50
SQL> select group_number, mount_status, path, total_mb
  2  from v$asm_disk where mount_status='CLOSED';
.
GROUP_NUMBER MOUNT_STATUS          PATH                                                 TOTAL_MB
------------ --------------------- -------------------------------------------------- ----------
           0 CLOSED                /dev/oracleasm/disks/CRS4                                   0


SQL> COL LABEL FOR A10
SQL> COL STATE FOR A10
SQL> SELECT A.NAME AS DISK_GROUP, D.NAME "LABEL", A.STATE
  2  FROM V$ASM_DISK D, V$ASM_DISKGROUP A
  3  WHERE D.GROUP_NUMBER=A.GROUP_NUMBER
  4  ORDER BY 2;

DISK_GROUP                                                                                 LABEL      STATE
------------------------------------------------------------------------------------------ ---------- ----------
CRS                                                                                        CRS_0000   MOUNTED
CRS                                                                                        CRS_0001   MOUNTED
CRS                                                                                        CRS_0002   MOUNTED
DATA                                                                                       DATA2      MOUNTED
DATA                                                                                       DATA_0000  MOUNTED
FRA                                                                                        FRA_0000   MOUNTED

6 rows selected.

SQL> col path for a30
SQL> col name for a14
SQL> select group_number, disk_number, name, mount_status, path, total_mb, free_mb
  2  from v$asm_disk
  3  order by 1,3;

GROUP_NUMBER DISK_NUMBER NAME           MOUNT_STATUS          PATH                             TOTAL_MB    FREE_MB
------------ ----------- -------------- --------------------- ------------------------------ ---------- ----------
           0           0                CLOSED                /dev/oracleasm/disks/CRS4               0          0
           1           0 CRS_0000       CACHED                /dev/oracleasm/disks/CRS1            1020        700
           1           1 CRS_0001       CACHED                /dev/oracleasm/disks/CRS2            1020        696
           1           2 CRS_0002       CACHED                /dev/oracleasm/disks/CRS3            1020        696
           2           1 DATA2          CACHED                /dev/oracleasm/disks/DATA2          50996      47884
           2           0 DATA_0000      CACHED                /dev/oracleasm/disks/DATA           30716      28820
           3           0 FRA_0000       CACHED                /dev/oracleasm/disks/FRA            20476      19084

7 rows selected.

SQL> ALTER DISKGROUP CRS ADD DISK '/dev/oracleasm/disks/CRS4' REBALANCE POWER 5;
ALTER DISKGROUP CRS ADD DISK '/dev/oracleasm/disks/CRS4' REBALANCE POWER 5
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15260: permission denied on ASM disk group


SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[+ASM1:/home/oracle]> sqlplus / as sysasm

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 8 17:22:00 2023
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> ALTER DISKGROUP CRS ADD DISK '/dev/oracleasm/disks/CRS4' REBALANCE POWER 5;

Diskgroup altered.

반응형
Posted by [PineTree]
ORACLE/ADMIN2023. 6. 8. 16:55
반응형

ORACLE ASM DISK 삭제 CRS_003-- ASM DISKGROUP 상태 확인

DISK_GROUP LABEL      STATE
---------- ---------- ----------
CRS        CRS_0000   MOUNTED
CRS        CRS_0001   MOUNTED
CRS        CRS_0002   MOUNTED
CRS        CRS_0003   MOUNTED
DATA       DATA2      MOUNTED
DATA       DATA_0000  MOUNTED
FRA        FRA_0000   MOUNTED

7 rows selected.

-- ASM DISKGROUP  세부 정보 확인
SQL> col path for a30
SQL> col name for a14
SQL> select group_number, disk_number, name, mount_status, path, total_mb, free_mb
  2  from v$asm_disk
  3  order by 1,3;
 
GROUP_NUMBER DISK_NUMBER NAME           MOUNT_STATUS          PATH                             TOTAL_MB    FREE_MB
------------ ----------- -------------- --------------------- ------------------------------ ---------- ----------
           1           0 CRS_0000       CACHED                /dev/oracleasm/disks/CRS1            1020        760
           1           1 CRS_0001       CACHED                /dev/oracleasm/disks/CRS2            1020        764
           1           2 CRS_0002       CACHED                /dev/oracleasm/disks/CRS3            1020        760
           1           3 CRS_0003       CACHED                /dev/oracleasm/disks/CRS4            1020        816
           2           1 DATA2          CACHED                /dev/oracleasm/disks/DATA2          50996      47884
           2           0 DATA_0000      CACHED                /dev/oracleasm/disks/DATA           30716      28820
           3           0 FRA_0000       CACHED                /dev/oracleasm/disks/FRA            20476      19084

7 rows selected.

-- CRS_003 삭제

SQL> alter diskgroup crs drop disk CRS_0003;

-- ASM DISKGROUP  세부 정보 확인
SQL> col path for a30
SQL> col name for a14
SQL> select group_number, disk_number, name, mount_status, path, total_mb, free_mb
  2  from v$asm_disk
  3  order by 1,3;

GROUP_NUMBER DISK_NUMBER NAME           MOUNT_STATUS          PATH                             TOTAL_MB    FREE_MB
------------ ----------- -------------- --------------------- ------------------------------ ---------- ----------
           0           0                CLOSED                /dev/oracleasm/disks/CRS4               0          0
           1           0 CRS_0000       CACHED                /dev/oracleasm/disks/CRS1            1020        700
           1           1 CRS_0001       CACHED                /dev/oracleasm/disks/CRS2            1020        696
           1           2 CRS_0002       CACHED                /dev/oracleasm/disks/CRS3            1020        696
           2           1 DATA2          CACHED                /dev/oracleasm/disks/DATA2          50996      47884
           2           0 DATA_0000      CACHED                /dev/oracleasm/disks/DATA           30716      28820
           3           0 FRA_0000       CACHED                /dev/oracleasm/disks/FRA            20476      19084

7 rows selected.

--  OS에서 CRS4번 disk 정보 삭제
[root@rac1 disks]# oracleasm deletedisk crs4
Clearing disk header: done
Dropping disk: done


[root@rac1 disks]# oracleasm listdisks
CRS1
CRS2
CRS3
DATA
DATA2
FRA

-- ASM DISKGROUP  세부 정보 CLOSE 였던 CRS_003 목록에서 사라짐 확인
GROUP_NUMBER DISK_NUMBER NAME           MOUNT_STATUS          PATH                             TOTAL_MB    FREE_MB
------------ ----------- -------------- --------------------- ------------------------------ ---------- ----------
           1           0 CRS_0000       CACHED                /dev/oracleasm/disks/CRS1            1020        700
           1           1 CRS_0001       CACHED                /dev/oracleasm/disks/CRS2            1020        696
           1           2 CRS_0002       CACHED                /dev/oracleasm/disks/CRS3            1020        696
           2           1 DATA2          CACHED                /dev/oracleasm/disks/DATA2          50996      47884
           2           0 DATA_0000      CACHED                /dev/oracleasm/disks/DATA           30716      28820
           3           0 FRA_0000       CACHED                /dev/oracleasm/disks/FRA            20476      19084

6 rows selected.

반응형
Posted by [PineTree]
ORACLE/ADMIN2023. 6. 2. 21:07
반응형

oracle restart 기동 절차

## 상태 확인
[grid@+ASM ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       restart19c               STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       restart19c               STABLE
ora.asm
               ONLINE  ONLINE       restart19c               Started,STABLE
ora.ons
               OFFLINE OFFLINE      restart19c               STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.driver.afd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.evmd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.restart.db
      1        ONLINE  ONLINE       restart19c               Open,HOME=/u01/app/o
                                                             racle/product/19c/db
                                                             _1,STABLE
--------------------------------------------------------------------------------

## oracle restart 정지
-- (1) DB 정지
[oracle@RESTART ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jun 2 20:43:45 2023
Version 19.19.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0

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

-- (2) DB 정지 확인
[grid@+ASM ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       restart19c               STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       restart19c               STABLE
ora.asm
               ONLINE  ONLINE       restart19c               Started,STABLE
ora.ons
               OFFLINE OFFLINE      restart19c               STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.driver.afd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.evmd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.restart.db
      1        OFFLINE OFFLINE                               STABLE
--------------------------------------------------------------------------------

-- (3) 그리드 인프라 스트럭처 정지 및 프로세스  확인
그리드 계정으로 명령어 실행

[grid@+ASM ~]$ crsctl stop has
CRS-2791: 'restart19c'에서 Oracle 고가용성 서비스가 관리하는 리소스의 종료 시작 중
CRS-2673: 'ora.DATA.dg'을(를) 'restart19c'에서 정지하려고 시도하는 중입니다.
CRS-2673: 'ora.LISTENER.lsnr'을(를) 'restart19c'에서 정지하려고 시도하는 중입니다.
CRS-2677: 'ora.DATA.dg' 정지('restart19c')가 성공했습니다.
CRS-2673: 'ora.asm'을(를) 'restart19c'에서 정지하려고 시도하는 중입니다.
CRS-2677: 'ora.LISTENER.lsnr' 정지('restart19c')가 성공했습니다.
CRS-2677: 'ora.asm' 정지('restart19c')가 성공했습니다.
CRS-2673: 'ora.evmd'을(를) 'restart19c'에서 정지하려고 시도하는 중입니다.
CRS-2677: 'ora.evmd' 정지('restart19c')가 성공했습니다.
CRS-2673: 'ora.cssd'을(를) 'restart19c'에서 정지하려고 시도하는 중입니다.
CRS-2677: 'ora.cssd' 정지('restart19c')가 성공했습니다.
CRS-2673: 'ora.driver.afd'을(를) 'restart19c'에서 정지하려고 시도하는 중입니다.
CRS-2677: 'ora.driver.afd' 정지('restart19c')가 성공했습니다.
CRS-2793: 'restart19c'에서 Oracle 고가용성 서비스가 관리하는 리소스 종료가 완료되었습니다.
CRS-4133: Oracle 고가용성 서비스가 정지되었습니다.
[grid@+ASM ~]$ ps -ef |grep d.bin
grid      6929  6514  0 20:48 pts/1    00:00:00 grep --color=auto d.bin
[grid@+ASM ~]$ crsctl stat res -t
CRS-4639: Oracle 고가용성 서비스에 접속할 수 없습니다.
CRS-4000: Status 명령을 실패했거나 오류와 함께 완료되었습니다.
[grid@+ASM ~]$ 


## 오라클 리스타트 기동
-- 서버가 재 기동 하면 자동 기동 한다
-- db 인스턴스를 정상 정지 (shutdown immediate) 하였다면 자동으로 올라 가지 않는다
[grid@+ASM ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       restart19c               STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       restart19c               STABLE
ora.asm
               ONLINE  ONLINE       restart19c               Started,STABLE
ora.ons
               OFFLINE OFFLINE      restart19c               STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.driver.afd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.evmd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.restart.db
      1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
--------------------------------------------------------------------------------

--(2) DB 기동 및 확인

[oracle@RESTART ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jun 2 20:56:36 2023
Version 19.19.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 3154113376 bytes
Fixed Size                  8930144 bytes
Variable Size             637534208 bytes
Database Buffers         2499805184 bytes
Redo Buffers                7843840 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
[oracle@RESTART ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       restart19c               STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       restart19c               STABLE
ora.asm
               ONLINE  ONLINE       restart19c               Started,STABLE
ora.ons
               OFFLINE OFFLINE      restart19c               STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.driver.afd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.evmd
      1        ONLINE  ONLINE       restart19c               STABLE
ora.restart.db
      1        ONLINE  ONLINE       restart19c               Open,HOME=/u01/app/o
                                                             racle/product/19c/db
                                                             _1,STABLE

 
※ 그리드 인프라 스트럭처 기동 명령어
[grid@+ASM ~]$ crsctl start has
CRS-4123: Oracle 고가용성 서비스가 시작되었습니다.
[grid@+ASM ~]$ ps -ef |grep d.bin
grid      6216     1 11 21:01 ?        00:00:01 /u01/app/oracle/19c/grid/bin/ohasd.bin reboot
grid      6346     1  1 21:01 ?        00:00:00 /u01/app/oracle/19c/grid/bin/orarootagent.bin
grid      6569     1  6 21:01 ?        00:00:00 /u01/app/oracle/19c/grid/bin/oraagent.bin
grid      6596     1  1 21:01 ?        00:00:00 /u01/app/oracle/19c/grid/bin/evmd.bin
grid      6603     1  0 21:01 ?        00:00:00 /u01/app/oracle/19c/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
grid      6658  6596  1 21:01 ?        00:00:00 /u01/app/oracle/19c/grid/bin/evmlogger.bin -o /u01/app/oracle/19c/grid/log/[HOSTNAME]/evmd/evmlogger.info -l /u01/app/oracle/19c/grid/log/[HOSTNAME]/evmd/evmlogger.log
grid      6674     1  1 21:01 ?        00:00:00 /u01/app/oracle/19c/grid/bin/cssdagent
grid      6694     1  0 21:01 ?        00:00:00 /u01/app/oracle/19c/grid/bin/ocssd.bin
grid      6706  5865  0 21:01 pts/0    00:00:00 grep --color=auto d.bin

반응형
Posted by [PineTree]
ORACLE/ADMIN2023. 5. 25. 20:59
반응형

1.ASMCA  실행

ASMCA

2. 삭제 할 DISKGROUP  DATA1 선택 후 마운트 해제

 

DATA1 마운트 해제

3.DATA1 dismounted 확인

DISMOUNTED 상태 확인

4. 레이블 삭제 및 지우기 선택

레이블 삭제 및 지우기 선택

 

5.확인

확인

6. 삭제 완료

ASM DISKGROUP삭제 완료

 

7. crs 상태 확인 - 더이상 DATA1 볼륨 그룹은 보이지 않는다.

반응형
Posted by [PineTree]