확인이 필요하여 테스트 해봄


1. NOMOUNT 단계시 listener status 및 접속가능여부


SYS@ORCL> startup nomount

ORACLE instance started.


Total System Global Area  617975808 bytes

Fixed Size                  2255752 bytes

Variable Size             398460024 bytes

Database Buffers          213909504 bytes

Redo Buffers                3350528 bytes


none> select status from v$instance;


STATUS

------------------------------------

STARTED


[oracle:/home/oracle]#lsnrctl status


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-SEP-2014 14:56:31


Copyright (c) 1991, 2013, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                16-SEP-2014 14:56:18

Uptime                    0 days 0 hr. 0 min. 12 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /oracle/product/11.2.0.4/network/admin/listener.ora

Listener Log File         /oracle/diag/tnslsnr/single/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.50)(PORT=1521)))

Services Summary...

Service "ORCL" has 1 instance(s).

  Instance "ORCL", status BLOCKED, has 1 handler(s) for this service...

The command completed successfully


접속 시도해봄


[oracle:/home/oracle]#sqlplus system/manager@ORCL


SQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 16 15:05:04 2014


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


ERROR:

ORA-12528: TNS:listener: all appropriate instances are blocking new connections


2. MOUNT 단계시 listener status 및 접속가능여부


none> startup mount

ORACLE instance started.


Total System Global Area  617975808 bytes

Fixed Size                  2255752 bytes

Variable Size             398460024 bytes

Database Buffers          213909504 bytes

Redo Buffers                3350528 bytes

Database mounted.

none> select status from v$instance;


STATUS

------------------------------------

MOUNTED


[oracle:/home/oracle]#lsnrctl status


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-SEP-2014 15:01:04


Copyright (c) 1991, 2013, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date                16-SEP-2014 14:56:18

Uptime                    0 days 0 hr. 4 min. 45 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /oracle/product/11.2.0.4/network/admin/listener.ora

Listener Log File         /oracle/diag/tnslsnr/single/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.50)(PORT=1521)))

Services Summary...

Service "ORCL" has 1 instance(s).

  Instance "ORCL", status READY, has 1 handler(s) for this service...

The command completed successfully


[oracle:/home/oracle]#sqlplus system/manager@ORCL


SQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 16 15:07:40 2014


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


ERROR:

ORA-01033: ORACLE initialization or shutdown in progress

Process ID: 0

Session ID: 0 Serial number: 0


3. open시는 당연하므로 패스..

Posted by pat98

2014. 9. 16. 14:55 오라클

rman duplicate



11g 에서는 rman 을 이용하여 DB가 백업본이 없어도 운영중인 상태에서 복제가 가능하다.(FROM ACTIVE DATABASE 이용)


현재 서버 ORCL DB -> 다른서버의 ORCL2 라는 이름으로  복제해 보자. 귀찮아서 새로운 서버의 화일 경로는 바꾸지 않았다.

 

1. source 와 target에서 각각의 서비스를 tnsnames.ora 에 모두 반영

 

target 관련 TNS에는 from active database 옵션을 써서 복제할 경우 startup nomount 상태시 target 의 listener 가 blocking 되어 통신이 되지 않으므로 (UR=A) 항목을 추가해 줘서 에러를 방지해 준다.

 

TEST2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = single2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TEST2) (UR=A)
    )
  )


2. 양쪽 listener start 


3. source 에서 pfile 을 생성하여 target 환경에 맞게 수정후 init 화일 생성


SQL> create pfile from spfile;


생성된 pfile 을 이용하여 target 에 init화일을 생성해준다.


환경에 맞게 db_name 등을 수정반영


ORCL.__db_cache_size=197132288

ORCL.__java_pool_size=4194304

ORCL.__db_cache_size=197132288

ORCL.__java_pool_size=4194304

ORCL.__large_pool_size=4194304

ORCL.__oracle_base='/oracle'#ORACLE_BASE set from environment

ORCL.__pga_aggregate_target=251658240

ORCL.__sga_target=369098752

ORCL.__shared_io_pool_size=0

ORCL.__shared_pool_size=150994944

ORCL.__streams_pool_size=0

*.audit_file_dest='/oracle/admin/ORCL/adump'

*.audit_trail='db'

*.compatible='11.2.0.0.0'

*.control_files='/oradata/control01.ctl','/oradata/control02.ctl','/oradata/control03.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='ORCL2'

*.diagnostic_dest='/oracle/'

*.log_archive_dest_1='LOCATION=/oradata/arch'

*.log_archive_format='arch_%t_%r_%s.arc'

*.memory_target=620756992

*.open_cursors=300

*.processes=500


4. target 에서 원격접속을 위해 passwd 화일 생성


[oracle:/oracle/product/11.2.0.4/dbs]#orapwd file=orapwORCL2 password=manager entries=10


5. nomount 로 DB기동


export ORACLE_SID=ORCL2

sqlplus "/as sysdba"


SQL> startup nomount


6. rman 접속


target 에서


[oracle:/home/oracle]#rman target sys/manager@ORCL auxiliary sys/manager@ORCL2



Recovery Manager: Release 11.2.0.4.0 - Production on Tue Sep 16 14:37:21 2014


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


connected to target database: ORCL (DBID=1380694829)

connected to auxiliary database: ORCL2 (not mounted)


DUPLICATE TARGET DATABASE TO "ORCL2"

FROM ACTIVE DATABASE

SPFILE

NOFILENAMECHECK;

      

Starting Duplicate Db at 16-SEP-2014 14:37:32

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=19 device type=DISK


contents of Memory Script:

{

   backup as copy reuse

   targetfile  '/oracle/product/11.2.0.4/dbs/spfileORCL.ora' auxiliary format 

 '/oracle/product/11.2.0.4/dbs/spfileORCL2.ora'   ;

   sql clone "alter system set spfile= ''/oracle/product/11.2.0.4/dbs/spfileORCL2.ora''";

}

executing Memory Script


Starting backup at 16-SEP-2014 14:37:33

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=35 device type=DISK

Finished backup at 16-SEP-2014 14:37:35


sql statement: alter system set spfile= ''/oracle/product/11.2.0.4/dbs/spfileORCL2.ora''


contents of Memory Script:

{

   sql clone "alter system set  db_name = 

 ''ORCL2'' comment=

 ''duplicate'' scope=spfile";

   shutdown clone immediate;

   startup clone nomount;

}

executing Memory Script


sql statement: alter system set  db_name =  ''ORCL2'' comment= ''duplicate'' scope=spfile


Oracle instance shut down


connected to auxiliary database (not started)

Oracle instance started


Total System Global Area     617975808 bytes


Fixed Size                     2255752 bytes

Variable Size                398460024 bytes

Database Buffers             213909504 bytes

Redo Buffers                   3350528 bytes


contents of Memory Script:

{

   sql clone "alter system set  db_name = 

 ''ORCL'' comment=

 ''Modified by RMAN duplicate'' scope=spfile";

   sql clone "alter system set  db_unique_name = 

 ''ORCL2'' comment=

 ''Modified by RMAN duplicate'' scope=spfile";

   shutdown clone immediate;

   startup clone force nomount

   backup as copy current controlfile auxiliary format  '/oradata/control01.ctl';

   restore clone controlfile to  '/oradata/control02.ctl' from 

 '/oradata/control01.ctl';

   restore clone controlfile to  '/oradata/control03.ctl' from 

 '/oradata/control01.ctl';

   alter clone database mount;

}

executing Memory Script


sql statement: alter system set  db_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile


sql statement: alter system set  db_unique_name =  ''ORCL2'' comment= ''Modified by RMAN duplicate'' scope=spfile


Oracle instance shut down


Oracle instance started


Total System Global Area     617975808 bytes


Fixed Size                     2255752 bytes

Variable Size                398460024 bytes

Database Buffers             213909504 bytes

Redo Buffers                   3350528 bytes


Starting backup at 16-SEP-2014 14:38:04

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

copying current control file

output file name=/oracle/product/11.2.0.4/dbs/snapcf_ORCL.f tag=TAG20140916T143803 RECID=3 STAMP=858436686

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07

Finished backup at 16-SEP-2014 14:38:11


Starting restore at 16-SEP-2014 14:38:12

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=19 device type=DISK


channel ORA_AUX_DISK_1: copied control file copy

Finished restore at 16-SEP-2014 14:38:13


Starting restore at 16-SEP-2014 14:38:14

using channel ORA_AUX_DISK_1


channel ORA_AUX_DISK_1: copied control file copy

Finished restore at 16-SEP-2014 14:38:15


database mounted

RMAN-05538: WARNING: implicitly using DB_FILE_NAME_CONVERT


contents of Memory Script:

{

   set newname for datafile  1 to 

 "/oradata/system01.dbf";

   set newname for datafile  2 to 

 "/oradata/sysaux01.dbf";

   set newname for datafile  3 to 

 "/oradata/undotbs01.dbf";

   set newname for datafile  4 to 

 "/oradata/ogg01.dbf";

   backup as copy reuse

   datafile  1 auxiliary format 

 "/oradata/system01.dbf"   datafile 

 2 auxiliary format 

 "/oradata/sysaux01.dbf"   datafile 

 3 auxiliary format 

 "/oradata/undotbs01.dbf"   datafile 

 4 auxiliary format 

 "/oradata/ogg01.dbf"   ;

   sql 'alter system archive log current';

}

executing Memory Script


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


executing command: SET NEWNAME


Starting backup at 16-SEP-2014 14:38:23

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile copy

input datafile file number=00001 name=/oradata/system01.dbf

output file name=/oradata/system01.dbf tag=TAG20140916T143822

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:26

channel ORA_DISK_1: starting datafile copy

input datafile file number=00002 name=/oradata/sysaux01.dbf

output file name=/oradata/sysaux01.dbf tag=TAG20140916T143822

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:05

channel ORA_DISK_1: starting datafile copy

input datafile file number=00003 name=/oradata/undotbs01.dbf

output file name=/oradata/undotbs01.dbf tag=TAG20140916T143822

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:35

channel ORA_DISK_1: starting datafile copy

input datafile file number=00004 name=/oradata/ogg01.dbf

output file name=/oradata/ogg01.dbf tag=TAG20140916T143822

channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35

Finished backup at 16-SEP-2014 14:44:05


sql statement: alter system archive log current


contents of Memory Script:

{

   backup as copy reuse

   archivelog like  "/oradata/arch/arch_1_852914093_13.arc" auxiliary format 

 "/oradata/archarch_1_852914093_13.arc"   ;

   catalog clone archivelog  "/oradata/archarch_1_852914093_13.arc";

   switch clone datafile all;

}

executing Memory Script


Starting backup at 16-SEP-2014 14:44:07

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log copy

input archived log thread=1 sequence=13 RECID=3 STAMP=858437045

output file name=/oradata/archarch_1_852914093_13.arc RECID=0 STAMP=0

channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01

Finished backup at 16-SEP-2014 14:44:09


cataloged archived log

archived log file name=/oradata/archarch_1_852914093_13.arc RECID=3 STAMP=858437050


datafile 1 switched to datafile copy

input datafile copy RECID=3 STAMP=858437051 file name=/oradata/system01.dbf

datafile 2 switched to datafile copy

input datafile copy RECID=4 STAMP=858437051 file name=/oradata/sysaux01.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=5 STAMP=858437051 file name=/oradata/undotbs01.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=6 STAMP=858437051 file name=/oradata/ogg01.dbf


contents of Memory Script:

{

   set until scn  342205;

   recover

   clone database

    delete archivelog

   ;

}

executing Memory Script


executing command: SET until clause


Starting recover at 16-SEP-2014 14:44:13

using channel ORA_AUX_DISK_1


starting media recovery


archived log for thread 1 with sequence 13 is already on disk as file /oradata/archarch_1_852914093_13.arc

archived log file name=/oradata/archarch_1_852914093_13.arc thread=1 sequence=13

media recovery complete, elapsed time: 00:00:01

Finished recover at 16-SEP-2014 14:44:19

Oracle instance started


Total System Global Area     617975808 bytes


Fixed Size                     2255752 bytes

Variable Size                398460024 bytes

Database Buffers             213909504 bytes

Redo Buffers                   3350528 bytes


contents of Memory Script:

{

   sql clone "alter system set  db_name = 

 ''ORCL2'' comment=

 ''Reset to original value by RMAN'' scope=spfile";

   sql clone "alter system reset  db_unique_name scope=spfile";

   shutdown clone immediate;

   startup clone nomount;

}

executing Memory Script


sql statement: alter system set  db_name =  ''ORCL2'' comment= ''Reset to original value by RMAN'' scope=spfile


sql statement: alter system reset  db_unique_name scope=spfile


Oracle instance shut down


connected to auxiliary database (not started)

Oracle instance started


Total System Global Area     617975808 bytes


Fixed Size                     2255752 bytes

Variable Size                398460024 bytes

Database Buffers             213909504 bytes

Redo Buffers                   3350528 bytes

sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL2" RESETLOGS ARCHIVELOG 

  MAXLOGFILES      5

  MAXLOGMEMBERS      5

  MAXDATAFILES     1000

  MAXINSTANCES     1

  MAXLOGHISTORY      292

 LOGFILE

  GROUP   1 ( '/oradata/redo01.log' ) SIZE 100 M  REUSE,

  GROUP   2 ( '/oradata/redo02.log' ) SIZE 100 M  REUSE,

  GROUP   3 ( '/oradata/redo03.log' ) SIZE 100 M  REUSE

 DATAFILE

  '/oradata/system01.dbf'

 CHARACTER SET AL32UTF8



contents of Memory Script:

{

   set newname for tempfile  1 to 

 "/oradata/temp01.dbf";

   switch clone tempfile all;

   catalog clone datafilecopy  "/oradata/sysaux01.dbf", 

 "/oradata/undotbs01.dbf", 

 "/oradata/ogg01.dbf";

   switch clone datafile all;

}

executing Memory Script


executing command: SET NEWNAME


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


cataloged datafile copy

datafile copy file name=/oradata/sysaux01.dbf RECID=1 STAMP=858437097

cataloged datafile copy

datafile copy file name=/oradata/undotbs01.dbf RECID=2 STAMP=858437098

cataloged datafile copy

datafile copy file name=/oradata/ogg01.dbf RECID=3 STAMP=858437098


datafile 2 switched to datafile copy

input datafile copy RECID=1 STAMP=858437097 file name=/oradata/sysaux01.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=2 STAMP=858437098 file name=/oradata/undotbs01.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=3 STAMP=858437098 file name=/oradata/ogg01.dbf

Reenabling controlfile options for auxiliary database

Executing: alter database add supplemental log data


contents of Memory Script:

{

   Alter clone database open resetlogs;

}

executing Memory Script


database opened

Finished Duplicate Db at 16-SEP-2014 14:45:31


끝. 10분이면 완료


복제가 잘 되었다. Archive 설정도 자동으로 되어 있다.

Single 은 초간단하게 복제 가능 !!




Posted by pat98

오랜만에 힐링하는 음악..

 

John Mayer - Neon (Live In LA)

 

 

 

Posted by pat98




11g RAC 설치중 해당 과정 화면에서 root.sh 까지는 멋지게 성공하였으나 Session 오류나 기타 문제로 OUI 화면이

없어져 버렸을 경우 아래와 같이 조치하면 후속작업(Configure Oracle Grid Infrastructure for a Cluster 이하)

 계속 진행하고 마무리 지을수 있다.


$GRID_HOME/cfgtoollogs/configToolAllCommands


즉 text 모드로 진행하여 설치완료 할 수 있다.

Posted by pat98

2014. 7. 18. 22:58 오라클

scan ip 변경


SCAN IP를 105 -> 205 로 바꾸어 보자.

 

1. [root:/root]#crsctl stop crs

 

2. vi /etc/hosts

 

# SCAN
#192.168.56.105   rac-scan  

192.168.56.205   rac-scan  

 

3. [root:/root]#crsctl start crs

 

4.  확인해 보면 아직 반영 안 되어 있다.

[root:/root]#srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.56.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan/192.168.56.105

 

5. modify 해준다.

root 유저로 실행

[root:/root]#srvctl modify scan -n rac-scan

 

6. 확인 끝

[root:/root]#srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.56.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan/192.168.56.205

Posted by pat98

2014. 7. 17. 21:45 오라클

오라클 CHR 함수


 

많이 쓰이는 CHR 함수의미  정리


CHR(9)      탭문자
CHR(10)     라인피드        <- 줄바꾸기
CHR(13)     캐리지리턴     <- 행의 처음으로

CHR(38)     &
CHR(39)     '                   <- 싱글따옴표

CHR(44)     ,                   <- 쉼표

 

 

========== ASCII 코드를 캐릭터로 전환해서 보여 주는 Code ==========

 

set serveroutput on FORMAT WRAPPED
DECLARE
    vTab           VARCHAR2(5) := CHR(9);
    vNum          NUMBER := 0;
    vString       VARCHAR2(80) := '';
BEGIN  
   --
   -- Formatted lower case letter to ASCII values
   --
   dbms_output.put_line('Formatted Lower Case Letters to ASCII values');
   dbms_output.put_line('-------------------------------------------------------');
   FOR i IN ASCII('a') .. ASCII('z') LOOP
      IF vNum < 6 THEN
         vString := vString||CHR(i)||' : '||i||vTab;
         vNum := vNum + 1;
      ELSIF vNum = 6 then
         dbms_output.put_line(vString||CHR(i)||' : '||i);
         vNum := 0;
         vString := '';
      ELSE
         dbms_output.put_line('ERROR');
      END IF;
   END LOOP;
   dbms_output.put_line(vString);

   --
   -- Formatted upper case letter to ASCII values
   --
   vString := '';
   vNum := 0;

   dbms_output.new_line;
   dbms_output.new_line;
   dbms_output.put_line('Formatted Upper Case Letters to ASCII values');
   dbms_output.put_line('-------------------------------------------------------');
   FOR i IN ASCII('A') .. ASCII('Z') LOOP
      IF vNum < 6 THEN
         vString := vString||CHR(i)||' : '||i||vTab;
         vNum := vNum + 1;
      ELSIF vNum = 6 then
         dbms_output.put_line(vString||CHR(i)||' : '||i);
         vNum := 0;
         vString := '';
      ELSE
         dbms_output.put_line('ERROR');
      END IF;
   END LOOP;
   dbms_output.put_line(vString);

   --
   -- Formatted chars less than 'a' to ASCII values
   --
   vString := '';
   vNum := 0;

   dbms_output.new_line;
   dbms_output.new_line;
   dbms_output.put_line('Formatted Letters, less than a  to ASCII values');
   dbms_output.put_line('-------------------------------------------------------');
   FOR i in 0 .. ASCII('a')-1 LOOP
      IF vNum < 6 THEN
         vString := vString||CHR(i)||' : '||i||vTab;
         vNum := vNum + 1;
      ELSIF vNum = 6 then
         dbms_output.put_line(vString||CHR(i)||' : '||i);
         vNum := 0;
         vString := '';
      ELSE
         dbms_output.put_line('ERROR');
      END IF;
   END LOOP;
   dbms_output.put_line(vString);

   --
   -- Formatted chars greater than 'Z' to ASCII values
   --
   vNum := 0;
   vString := '';

   dbms_output.new_line;
   dbms_output.new_line;
   dbms_output.put_line('Formatted Letters, greater than z  to ASCII values');
   dbms_output.put_line('-------------------------------------------------------');
   FOR i IN ASCII('z') .. ASCII('z')+133 LOOP
      IF vNum < 6 THEN
         vString := vString||CHR(i)||' : '||i||vTab;
         vNum := vNum + 1;
      ELSIF vNum = 6 then
         dbms_output.put_line(vString||CHR(i)||' : '||i);
         vNum := 0;
         vString := '';
      ELSE
         dbms_output.put_line('ERROR');
      END IF;
   END LOOP;
   dbms_output.put_line(vString);

END;
/

 

결과값은 아래와 같이 출력된다.

 

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

Formatted Lower Case Letters to ASCII values
-------------------------------------------------------
a : 97  b : 98  c : 99  d : 100 e : 101 f : 102 g : 103
h : 104 i : 105 j : 106 k : 107 l : 108 m : 109 n : 110
o : 111 p : 112 q : 113 r : 114 s : 115 t : 116 u : 117
v : 118 w : 119 x : 120 y : 121 z : 122


Formatted Upper Case Letters to ASCII values
-------------------------------------------------------
A : 65  B : 66  C : 67  D : 68  E : 69  F : 70  G : 71
H : 72  I : 73  J : 74  K : 75  L : 76  M : 77  N : 78
O : 79  P : 80  Q : 81  R : 82  S : 83  T : 84  U : 85
V : 86  W : 87  X : 88  Y : 89  Z : 90


Formatted Letters, less than a  to ASCII values
-------------------------------------------------------
  : 0    : 1     : 2     : 3     : 4     : 5     : 6
 : 7    : 8              : 9
 : 10
         : 11
 : 13            : 12
 : 14    : 15    : 16    : 17    : 18    : 19    : 20
 : 21    : 22    : 23    : 24    : 25    : 26   : 27
 : 28    : 29    : 30    : 31     : 32  ! : 33  " : 34
# : 35  $ : 36  % : 37  & : 38  ' : 39  ( : 40  ) : 41
* : 42  + : 43  , : 44  - : 45  . : 46  / : 47  0 : 48
1 : 49  2 : 50  3 : 51  4 : 52  5 : 53  6 : 54  7 : 55
8 : 56  9 : 57  : : 58  ; : 59  < : 60  = : 61  > : 62
? : 63  @ : 64  A : 65  B : 66  C : 67  D : 68  E : 69
F : 70  G : 71  H : 72  I : 73  J : 74  K : 75  L : 76
M : 77  N : 78  O : 79  P : 80  Q : 81  R : 82  S : 83
T : 84  U : 85  V : 86  W : 87  X : 88  Y : 89  Z : 90
[ : 91  \ : 92  ] : 93  ^ : 94  _ : 95  ` : 96


Formatted Letters, greater than z  to ASCII values
-------------------------------------------------------
z : 122 { : 123 | : 124 } : 125 ~ : 126  : 127   : 128
 : 129   : 130   : 131   : 132   : 133   : 134   : 135
 : 136   : 137   : 138   : 139   : 140   : 141   : 142
 : 143   : 144   : 145   : 146   : 147   : 148   : 149
 : 150   : 151   : 152   : 153   : 154   : 155   : 156
 : 157   : 158   : 159   : 160   : 161   : 162   : 163
 : 164   : 165   : 166   : 167   : 168   : 169   : 170
 : 171   : 172   : 173   : 174   : 175   : 176   : 177
 : 178   : 179   : 180   : 181   : 182   : 183   : 184
 : 185   : 186   : 187   : 188   : 189   : 190   : 191
 : 192   : 193   : 194   : 195   : 196   : 197   : 198
 : 199   : 200   : 201   : 202   : 203   : 204   : 205
 : 206   : 207   : 208   : 209   : 210   : 211   : 212
 : 213   : 214   : 215   : 216   : 217   : 218   : 219
 : 220   : 221   : 222   : 223   : 224   : 225   : 226
 : 227   : 228   : 229   : 230   : 231   : 232   : 233
 : 234   : 235   : 236   : 237   : 238   : 239   : 240
 : 241   : 242   : 243   : 244   : 245   : 246   : 247
 : 248   : 249   : 250   : 251   : 252   : 253   : 254
 : 255

Posted by pat98

- 일자별 log switch 개수


select v2.DAY "DATE(Recent 15 Days)" , NVL(LOG_CNT,0) "Switch Count"

from

        (select to_char(first_time,'YYYY-MM-DD') DAY,count(*) LOG_CNT

         from V$LOG_HISTORY

         group by to_char(first_time,'YYYY-MM-DD')) v1,

        (select to_char((sysdate - 15),'YYYY-MM-DD') DAY from dual   union all    

         select to_char((sysdate - 14),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate - 13),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate - 12),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate - 11),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate - 10),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  9),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  8),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  7),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  6),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  5),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  4),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  3),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  2),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  1),'YYYY-MM-DD') DAY from dual) v2

where v1.DAY(+) = v2.DAY 

order by 1;


- 시간별 log switch 개수


select v2.Time || ' H' Time , NVL(LOG_CNT,0) SwitchCount

from (select to_char(first_time,'HH24') Time,count(*) LOG_CNT

          from V$LOG_HISTORY

         group by to_char(first_time,'HH24'))  v1,

        (select '00' Time from dual   union all    select '01' Time from dual  union all         

         select '02' Time from dual   union all    select '03' Time from dual  union all

         select '04' Time from dual   union all    select '05' Time from dual  union all

         select '06' Time from dual   union all    select '07' Time from dual  union all

         select '08' Time from dual   union all    select '09' Time from dual  union all

         select '10' Time from dual   union all    select '11' Time from dual  union all

         select '12' Time from dual   union all    select '13' Time from dual  union all

         select '14' Time from dual   union all    select '15' Time from dual  union all

         select '16' Time from dual   union all    select '17' Time from dual  union all

         select '18' Time from dual   union all    select '19' Time from dual  union all

         select '20' Time from dual   union all    select '21' Time from dual  union all

         select '22' Time from dual   union all    select '23' Time from dual  union all

         select '24' Time from dual   ) v2

where v1.Time(+) = v2.Time  

order by 1;



- 일별 로그생성 사이즈 (15일간)


set linesize 120

col v2.DAY for A20

col LOG_SIZE for A15


select v2.DAY "DATE (for 15 Days)" , NVL(LOG_SIZE,'-') "Archived Size" 

from

        (select to_char(COMPLETION_TIME,'YYYY-MM-DD') DAY,

                to_char(round(sum((BLOCKS * BLOCK_SIZE)/(1024*1024)),1)) || ' MB' LOG_SIZE

         from v$archived_log

         group by to_char(COMPLETION_TIME,'YYYY-MM-DD')) v1,

        (select to_char((sysdate - 15),'YYYY-MM-DD') DAY from dual   union all    

         select to_char((sysdate - 14),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate - 13),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate - 12),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate - 11),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate - 10),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  9),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  8),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  7),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  6),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  5),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  4),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  3),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  2),'YYYY-MM-DD') DAY from dual   union all

         select to_char((sysdate -  1),'YYYY-MM-DD') DAY from dual) v2

where v1.DAY(+) = v2.DAY 

order by 1;



- 시간대별 로그생성 크기


select v2.Time || ' H'  Time , NVL(LOG_SIZE,'-') SwitchCount

from 

         (select to_char(COMPLETION_TIME,'HH24') Time,

                 to_char(round(sum((BLOCKS * BLOCK_SIZE)/(1024*1024)),1)) || ' MB' LOG_SIZE

         from v$archived_log

         group by to_char(COMPLETION_TIME,'HH24'))  v1,

        (select '00' Time from dual   union all    select '01' Time from dual  union all         

         select '02' Time from dual   union all    select '03' Time from dual  union all

         select '04' Time from dual   union all    select '05' Time from dual  union all

         select '06' Time from dual   union all    select '07' Time from dual  union all

         select '08' Time from dual   union all    select '09' Time from dual  union all

         select '10' Time from dual   union all    select '11' Time from dual  union all

         select '12' Time from dual   union all    select '13' Time from dual  union all

         select '14' Time from dual   union all    select '15' Time from dual  union all

         select '16' Time from dual   union all    select '17' Time from dual  union all

         select '18' Time from dual   union all    select '19' Time from dual  union all

         select '20' Time from dual   union all    select '21' Time from dual  union all

         select '22' Time from dual   union all    select '23' Time from dual  union all

         select '24' Time from dual   ) v2

where v1.Time(+) = v2.Time  

order by 1;


- 시간대별 archive 발생량 확인


alter session set nls_date_format = 'YYYY-MM-DD HH24';

SELECT TRUNC(COMPLETION_TIME, 'HH') ARCHIVED_DATE_HOUR,

            SUM(BLOCKS * BLOCK_SIZE) / 1024 / 1024 SIZE_IN_MB

       FROM V$ARCHIVED_LOG

      GROUP BY TRUNC(COMPLETION_TIME, 'HH')

      ORDER BY 1;


- 시간대별 archive 발생량 확인 (per instance별)


SELECT

            TRUNC(COMPLETION_TIME) ARCHIVED_DATE,

            THREAD#,

            SUM(BLOCKS * BLOCK_SIZE) / 1024 / 1024 SIZE_IN_MB

       FROM V$ARCHIVED_LOG

      GROUP BY TRUNC(COMPLETION_TIME), THREAD#

      ORDER BY 1, 2;



- 일일 아카이브 발생량 및 삭제량


SELECT SUM_ARCH.DAY,

         SUM_ARCH.GENERATED_MB,

         SUM_ARCH_DEL.DELETED_MB,

         SUM_ARCH.GENERATED_MB - SUM_ARCH_DEL.DELETED_MB "REMAINING_MB"

    FROM (  SELECT TO_CHAR (COMPLETION_TIME, 'DD/MM/YYYY') DAY,

                   SUM (ROUND ( (blocks * block_size) / (1024 * 1024 * 1024), 2))

                      GENERATED_MB

              FROM V$ARCHIVED_LOG

             WHERE ARCHIVED = 'YES'

          GROUP BY TO_CHAR (COMPLETION_TIME, 'DD/MM/YYYY')) SUM_ARCH,

         (  SELECT TO_CHAR (COMPLETION_TIME, 'DD/MM/YYYY') DAY,

                   SUM (ROUND ( (blocks * block_size) / (1024 * 1024 * 1024), 2))

                      DELETED_MB

              FROM V$ARCHIVED_LOG

             WHERE ARCHIVED = 'YES' AND DELETED = 'YES'

          GROUP BY TO_CHAR (COMPLETION_TIME, 'DD/MM/YYYY')) SUM_ARCH_DEL

   WHERE SUM_ARCH.DAY = SUM_ARCH_DEL.DAY(+)

ORDER BY TO_DATE (DAY, 'DD/MM/YYYY');


- 시간별 발생량 확인


set pages 1000 

alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';

select trunc(COMPLETION_TIME,'HH') Hour,thread# , 

round(sum(BLOCKS*BLOCK_SIZE)/1024/1024/1024) GB,

count(*) Archives from v$archived_log 

group by trunc(COMPLETION_TIME,'HH'),thread#  order by 1 ;



Posted by pat98

2014. 6. 24. 10:08 오라클

RAC database autostart


RAC Database AUTO START 


자동관리 -> 수동관리로


1. 확인

[EXA1]oracle@exa1:/home/oracle# srvctl config database -d exa

Database unique name: EXA

Database name: EXA

Oracle home: /u01/app/oracle/product/11.2.0.4/dbhome_1

Oracle user: oracle

Spfile: +DATA/EXA/spfileEXA.ora

Domain: 

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: EXA

Database instances: EXA1,EXA2

Disk Groups: DATA,RECO

Mount point paths: 

Services: 

Type: RAC

Database is administrator managed


2. 변경

[EXA1]oracle@exa1:/home/oracle# srvctl modify database -d exa -y MANUAL


3. 확인

[EXA1]oracle@exa1:/home/oracle# srvctl config database -d exa

Database unique name: EXA

Database name: EXA

Oracle home: /u01/app/oracle/product/11.2.0.4/dbhome_1

Oracle user: oracle

Spfile: +DATA/EXA/spfileEXA.ora

Domain: 

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: MANUAL

Server pools: EXA

Database instances: EXA1,EXA2

Disk Groups: DATA,RECO

Mount point paths: 

Services: 

Type: RAC

Database is administrator managed

Posted by pat98

2014. 6. 13. 18:06 오라클

Cell service start, stop


Exadata Cell node Start, Stop, Restart


CellCLI> alter cell startup services rs

CellCLI> alter cell startup services ms

CellCLI> alter cell startup services cellsrv 


CellCLI> alter cell shutdown services rs

CellCLI> alter cell shutdown services ms

CellCLI> alter cell shutdown services cellsrv 

CellCLI> alter cell shutdown services all

CellCLI> alter cell shutdown services all force


CellCLI> alter cell restart services rs

CellCLI> alter cell restart services ms

CellCLI> alter cell restart services cellsrv

CellCLI> alter cell restart services all

CellCLI> alter cell restart services all force

Posted by pat98

[root@gtsw-iba01 ~]# help all

General commands:

help                  - Display this help

exit                  - Exit this shell

version               - Show switch and service processor version info

showfruinfo           - Show FRU info for the chassis

showpsufru            - Show FRU info for the PSUs


Switch diagnostics commands:

env_test              - Do a full environment test

showunhealthy         - Show unhealthy environment sensors

checkboot             - Check boot status of Onboard IB devices

checkpower            - Check status of the PSUs

checkvoltages         - Check the voltages on the main board

getfanspeed           - Get the speed of the FANs and check their status

showtemps             - Show the temperatures


Infiniband diagnostics commands:

connector             - Show info for a connector

dcsport               - Map between IB ports and connectors

generatetopology      - Generate Infiniband topology file

getmaster             - Show status and history of Subnet Manager

getportstatus         - Show status for local port

ibdiagnet             - IB diagnostic network

ibhosts               - Show InfiniBand host nodes in topology

ibnetstatus           - Show status of InfiniBand network

ibnodes               - Show InfiniBand nodes in topology

ibstat                - Query basic status of InfiniBand device

ibswitches            - Show InfiniBand switch nodes in topology

ibrouters             - Show InfiniBand router nodes in topology

ibroute               - Query InfiniBand switch forwarding tables

ibtracert             - Trace InfiniBand path

ibportstate           - Show port state and link speed of an port

listlinkup            - List all local ports/connectors

matchtopology         - Match the InfiniBand topology towards a topology file

perfquery             - Query InfiniBand port counters

saquery               - query InfiniBand subnet administration attributes

showsmlog             - Show the InininiBand Subnet manager log

showtopology          - Show the InfiniBand topology

smpquery              - query InfiniBand subnet management attributes


Subnet Manager administration commands:

checkguidfilesftree   - Sanity check of ftree GUID files

checktopomax          - Check the size of current IB topology

enablesm              - Enable local Subnet Manager

disablesm             - Disable local Subnet Manager

getmaster             - Show status and history of Subnet Manager

setsmpriority         - Set priority for local Subnet Manager

setcontrolledhandover - Set controlled handover for local Subnet Manager

setsubnetprefix       - Set subnet prefix for local Subnet Manager

showsmlog             - Show the InininiBand Subnet manager log

smconfigtest          - Test local Subnet Manager configuration

setmsmlocationmonitor - Enable/disable MSM location monitoring

smpartition           - Tool for partition configuration for Subnet Managers


Other managagement commands:

enableswitchport      - Enable a switch port

disableswitchport     - Disable a switch port

enablecablelog        - Enable syslog of Cable connector hotplug events

disablecablelog       - Disable syslog of Cable connector hotplug events

enablelinklog         - Enable syslog of Link Up/Down events

disablelinklog        - Disable syslog of Link Up/Down events



Posted by pat98

02-12 03:27
Flag Counter
Yesterday
Today
Total

글 보관함

최근에 올라온 글

달력

 « |  » 2025.2
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

최근에 달린 댓글