Oracle 12c RMAN의 new feature 중 하나인 table recovery 

아래 table recovery 방법을 보니 AUXILIARY Database를 만들어 거기서 dump datafile을 뽑아내는 모양새. 


과거에 삭제된 table 복구를 위해 수행되었던 복구 절차를 명령어 한줄로 만들어 놓았네요. ㅎ


Recover the tables EMP and DEPT using the following clauses in the RECOVER command: DATAPUMP DESTINATION, DUMP FILE, REMAP TABLE, and NOTABLEIMPORT.


The following RECOVER command recovers the EMP and DEPT tables.


RECOVER TABLE SCOTT.EMP, SCOTT.DEPT

    UNTIL TIME 'SYSDATE-1'

    AUXILIARY DESTINATION '/tmp/oracle/recover'

    DATAPUMP DESTINATION '/tmp/recover/dumpfiles'

    DUMP FILE 'emp_dept_exp_dump.dat'

    NOTABLEIMPORT;


참고 : http://docs.oracle.com/cd/E16655_01/backup.121/e17630/rcmresind.htm#BRADV703



Oracle 12c에서 많이 밀고 있는 Multitenant, ADO 등의 New feature 외에 소소한 몇몇 feature 들... 

어디다가 쓸진 모르겠지만.. 


Invisible Columns

• The new 12c feature allows you to hide columns 

• If a user or developer selects ALL columns from a table (i.e. select *…)  the invisible columns will NOT be displayed. 

• If a user specifically selects the invisible column (i.e. select salary,…) the column WILL be displayed in the output (you have to know it’s there). 

• You can set column(s) to be visible/invisible with an alter table : 

 

SQL> ALTER TABLE EMPLOYEE MODIFY (SSN INVISIBLE); 


이로써 invisible 기능으로 index, row (12c new feature - valid time temporal), column을 숨길수 있게됬군요.. ㅋ


Create Views as Tables  

Export a view as a table and then import it: 


SQL> create view emp_dept as 

(select a.empno, a.ename, b.deptno, b.dname, b.loc 

 from emp a, dept b 

 where a.deptno=b.deptno); 


View created. 

 

$ expdp scott2/tiger VIEWS_AS_TABLES=emp_dept 

 

Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE 

. . exported "SCOTT2"."EMP_DEPT" 

7.140 KB 14 rows 


view를 table로 export 할 수 있는 기능. 

업무에선 어떻게 쓰일수 있을지 모르겠지만.. 

DB 성능관련 view 들도 table로 간단히 뽑아낼 수 있다면 성능 history 구축하긴 쉽겠네요. 



Question: Can DD, TAR or other OS tools be used to back up a database on storage managed by ASM?

Answer: DD, Tar and other OS tools are not supported with ASM. The answer is use Rman with ASM. Matrix for Supported backup or clongin Options:

-----------------------X
|  DD           |  No  |
-----------------------| 
|  Atomic Snaps | Yes  |
-----------------------|
|  TAR          |  No  |
-----------------------|
|  RMAN         | YES! |
-----------------------X


Automic snaps are split mirror technologies which support atomis splits across several LUN as a consistant point in time copy. Products like TimeFinder or MirrorView. Database must be placed in HOT BACKUP mode for this type of backup for the duration of the split. This is because the split can not capture a block-consistent view of all datafiles while the database is open for write. The split is typically a few seconds so the performance impact is minimal.


오류 메세지 : 

VT-x/AMD-V 하드웨어 가속 기능이 활성화되었지만, 현재 작동하지 않습니다.
64비트 게스트 운영 체제에서 64비트 CPU를 인식할 수 없어서 부팅할 수 없습니다.

컴퓨터 바이오스에서 VT-x/AMD-V를 활성화했는지 확인해 보십시오.


bios 상에서 Virtual Technology 라는 기능이 있습니다.  
제 bios 에서는 overclocking 메뉴에서 CPU 항목에 있더군요..


오류 메세지 : 

하드 디스크 D:\test_vm.vdi을(를) 여는 데 실패했습니다.


Cannot register the hard disk 'D:\test_vm.vdi' {2c780ed3-3642-47db-b2d9-12f01bd959ea} because a hard disk 'D:\test_vm_org.vdi' with UUID {2c780ed3-3642-47db-b2d9-12f01bd959ea} already exists.


결과 코드: E_INVALIDARG (0x80070057)

구성 요소: VirtualBox

인터페이스: IVirtualBox {3b2f08eb-b810-4715-bee0-bb06b9880ad2}

호출자 RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)


C:\>"Program Files\Sun\VirtualBox\VBoxManage" internalcommands sethduuid d:\test_vm.vdi


  •  DBFS로 구성된 파일 시스템은 NFS을 지원하지 않습니다.
  •  파일명을 한글로 사용하는 것을 원칙적으로 지원하지 않습니다.
  •  파일이 내부적으로는 DB내에 Lob 테이블로 저장되기 때문에, 일반 파일시스템과 다르게 mv명령와 같은 경우 Row별로 데이터를 삭제 후 다시 저장되기 때문에 성능적인 차이가 존재합니다.
  •  DBFS의 경우 실행파일은 수행되지 않습니다..

Exadata에서 DBFS를 구성해 보니 DBFS용으로 추가 구성한 DB 내 LOB file을 filesystem 형식으로 보여주는 .. 형태로 구성되는 군요. 위의 주의사항 처럼 DBFS를 구성해서 filesystem으로 보인다 해도 여기에 어떠한 실행파일을 구성할 수 없습니다. 또한 성능도 이러한 구성이라면 그닥 기대할 만하지 못할 듯하네요...


어디다가 쓰지? DBFS? 

External table을 위한 sam file 정도 ? 





1. configure the initial load extract parameter file (source)
     GGSCI> edit param eload01

      sourceistable
      userid oggmgr, password oracle
      rmthost oggtest.localdomain, mgrport 5009
      rmtfile ./dirdat/TCUSTMER.dat, purge
      table scott.tcustmer;
      rmtfile ./dirdat/TCUSTORD.dat, purge
      table scott.tcustord;


2. Execute the initial load capture process (source)
     # extract paramfile dirprm/eload01.prm reportfile dirrpt/ELOD01.rpt
     # ggsci
     GGSCI> view report ELOD01

3. configure the initial load delivery parameter file (target)
     # ls -al ./dirdat/TCUST*.dat
     # ggsci
     GGSCI> edit param loadtcustmer

      specialrun
      end runtime
      userid oggmgr, password oracle
      assumetargetdefs
      extfile ./dirdat/TCUSTMER.dat
      map scott.tcustmer, target scott.tcustmer;


      GGSCI> edit param loadtcustord

      specialrun
      end runtime
      userid oggmgr, password oracle
      assumetargetdefs
      extfile ./dirdat/TCUSTORD.dat
      map scott.tcustord, target scott.tcustord;


4. execute the initial load delivery process
     # replicat paramfile dirprm/loadtcustmer.prm reportfile dirrpt/LOADTCUSTMER.rpt
     # replicat paramfile dirprm/loadtcustord.prm reportfile dirrpt/LOADTCUSTORD.rpt

     # ggsci
     GGSCI> view report LOADTCUSTMER
     GGSCI> view report LOADTCUSTORD


'Oracle Middleware' 카테고리의 다른 글

Oracle Goldengate의 기본적인 단방향 복제  (0) 2013.12.10


1. oracle database 기본 goldengate db user 생성 (source, target)

     SQL> create user oggmgr identified by oracle default tablespace users;
     SQL> grant dba to oggmgr;  -- role_setup script 는 ? 
     
2. oracle database supplemental log & archive log 설정 (source)
     SQL> alter database add supplemental log data; 
     SQL> select supplemental_log_data_min from v$database;
     SQL> shutdown immediate;
     SQL> startup mount
     SQL> alter database archivelog;
     SQL> alter database open;
     SQL> alter system switch logfile;
     SQL> archive log list;
     SQL> show parameter log_archive_dest_1

3. database test user 생성 (source, target)
     SQL> create user app identified by app default tablespace users;
     SQL> grant connect, resource to app;

4. goldengate 설치 (source, target)
     # ggsci
     GGSCI> create subdirs
     GGSCI> edit params ./GLOBALS

     GGSCHEMA OGGMGR
     CHECKPOINTTABLE OGGMGR.GGSCHKPT
     SYSLOG NONE

     GGSCI> edit param mgr

     port 9010 -- target은 9020

     GGSCI> start mgr
     GGSCI> info mgr
     GGSCI> info all

5. 테스트 테이블 생성 (source, target)
     # sqlplus app/app @demo_ora_create

6. 테스트 테이블에 대한 suplemental logging 설정 (source)
     # ggsci
     GGSCI> dblogin userid oggmgr, password oracle
     GGSCI> info trandata app.*
     GGSCI> add trandata app.tcustmer
     GGSCI> add trandata app.tcustord
     GGSCI> info trandata app.*

7. checkpoint table 생성 (target)
     #ggsci
     GGSCI> dblogin userid oggmgr, password oracle
     GGSCI> add checkpointtable

8. extract configuration & start (source)
     GGSCI> edit param ext01
     
     extract ext01
     userid oggmgr, password oracle
     discardfile ./dirout/ext01.dec, append, megabytes 50
     discardrollover at 00:01
     reportcount every 1 records
     reportrollover at 00:01

     exttrail ./dirdat/ex
     table app.*;

     GGSCI> dblogin userid oggmgr, password oracle
     GGSCI> add extract ext01, tranlog, begin now
     GGSCI> add exttrail ./dirdat/ext, extract ext01, megabytes 50
     GGSCI> info ext01
     GGSCI> start ext01

9. pump configuration & start (source)
     # ggsci
     GGSCI> edit param pmp01

     extract pmp01
     passthru
     rmthost oggtest.localdomain, mgrport 9020
     rmttrail ./dirdat/ex
     reportcount every 1 records
     reportrollover at 00:01
     table app.*;

     GGSCI> add extract pmp01, exttrailsource ./dirdat/ex
     GGSCI> add exttrail ./dirdat/ex, extract pmp01, megabytes 50
     GGSCI> start pmp01
     GGSCI> info pmp01

10. replicat configuration & start (target)
     #ggsci
     GGSCI> edit param rep01

     replicat rep01
     userid oggmgr, password oracle
     discardfile ./dirout/rep01.dec, append, megabytes 50
     discardrollover at 00:01
     reportcount every 1 records
     reportrollover at 00:01
     assumetargetdefs
     map app.tcustmer, target app.tcustmer;
     map app.tcustord, target app.tcustord;

     GGSCI> add replicat rep01, exttrail ./dirdat/ex
     GGSCI> start rep01
     GGSCI> info rep01

11. 테스트 (source)
     # sqlplus app/app @demo_ora_insert

12. goldengate stop (source, target)
     #ggsci
     GGSCI> stop *
     GGSCI> stop mgr


'Oracle Middleware' 카테고리의 다른 글

Oracle Goldengate의 initial data load  (0) 2013.12.10


Oracle 12c에 Oracle Multitenant라는 새로운 개념이 등장했습니다. 

Database가 Container DB와 Pluggable DB로 나뉘어 Cloud 환경에 적합한 모양으로 구성 가능합니다. 


자세한 내용은 아래 링크 참조하시면 될 것 같고..

http://www.oracle.com/technetwork/database/multitenant/overview/index.html


Oracle 12c Multitenant라는 기능을 보다 보니까 내가 현재 어떤 DB에 접속하고 있는지 헤깔리기 쉽겠더군요..

PDB (Pluggable DB)를 내리려다 잘못해 Container DB를 내리면 해당 Container DB에 있는 PDB까지 다 내려갈 수 있으니 (걱정도 팔자임), 이는 큰일이 아닐 수 없습니다. ㅋ


해서 SQLPLUS의 prompt에 현재 어떤 DB에 접속하고 있는지 표시하도록 간단히 맹글어 보았습니다. 

모두 아시는 $ORACLE_HOME/sqlplus/admin/glogin.sql에 아래 내용을 넣으시면 됩니다. 

define _editor=vi

column sqlprompt_col new_value sqlprompt_value

set termout off

define sqlprompt_value='NOT CONNECTED'

SELECT SYS_CONTEXT('USERENV','CURRENT_USER')||'('||SYS_CONTEXT('USERENV','CON_NAME')||')'

  as sqlprompt_col

from dual;

set termout on

set sqlprompt '&sqlprompt_value >'


아래처럼 container DB에 접속하던 Pluggable DB에 접속하던 prompt 상에서 보여주게 됩니다. 

그러나 DB 가 내려가 있는 상태에서 접속하면 'NOT CONNECTED'로 나오는 부분은 수정 필요 --; 



Oracle 11g 때부터 raw device를 지원한다, 안한다 이야기가 많더니만,

드디어 Oracle 12c에서는 지원하지 않는다는 문장이 메뉴얼에 등장했네요. 


8.1.10.1 About Upgrading Oracle Database Release 10.2 or 11.1 and OCFS and RAW Devices


If you are upgrading an Oracle Database release 10.2.0.5 or release 11.1.0.7 environment that stores Oracle Clusterware files on OCFS on Windows or RAW devices, then you cannot directly upgrade to Oracle Database 12c. You must first perform an interim upgrade to Oracle Database release 11.2 and migrate the Oracle Clusterware files to Oracle Automatic Storage Management (Oracle ASM). Then you can upgrade from release 11.2 to Oracle Database 12c.


8.1.12 Desupport for Raw Storage Devices


Starting with Oracle Database 12c, block file storage on raw devices is not supported. You must migrate any data files stored on raw devices to Oracle ASM, a cluster file system, or Network File System (NFS).

This also affects the OCR and voting files for Oracle Clusterware. You cannot store the OCR or voting files on raw devices. Oracle Clusterware files must be moved to Oracle ASM before upgrading.


출처 : Oracle® Database Upgrade Guide 12c Release 1 (12.1)

(http://docs.oracle.com/cd/E16655_01/server.121/e17642/deprecated.htm#UPGRD60124)


이제 ASM을 공부해야 할 시간 ... 

Oracle ASM Strategic Best Practices




+ Recent posts