Özgür Umut VURGUN

  • View
    52

  • Download
    0

Embed Size (px)

DESCRIPTION

12c Pluggable Database Hands-On. Özgür Umut VURGUN. TROUG Ankara Bulusmasi. Ajanda. Oracle Kronoloji. Oracle Kronoloji Oracle 12c Pluggable Database Container Database CDB$ROOT Pluggable Database Oracle 12c Yeni Kullanıcılar ve Haklar Oracle 12c Hands On - PowerPoint PPT Presentation

Text of Özgür Umut VURGUN

  • zgr Umut VURGUN12c Pluggable Database Hands-On16 Ocak 2014www.ozgurumutvurgun.comTROUG Ankara Bulusmasi

  • Ajandawww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiOracle KronolojiOracle 12c Pluggable DatabaseContainer DatabaseCDB$ROOTPluggable DatabaseOracle 12c Yeni Kullanclar ve HaklarOracle 12c Hands On

    Lab 1: Drop / Unplug PDBLab 2: Plug / Clone PDBLab 3: CLONE PDB FROM REMOTE CDB Lab 4: CLONE PDB FROM REMOTE CDB with DB LinkLab 5: Non CDB to CDB with Data Pump Transportable Export / ImportOracle Kronoloji

  • Oracle Kronolojiwww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiReal Application Cluster

    GridManage changing

  • Pre - Oracle 12cwww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiOracle 12c ncesi veritaban yapsn inceleyecek olursak Background Proses okluuYksek memory paylam Birden ok Oracle Medata zorunluluu

  • Oracle 12c Pluggable Databasewww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiContainer Database (CDB)Birden fazla veri tabannn alt ana yap.Pluggable Database (PDB)Tanabilir zellii olan ve normal ilemlerin yrtld veri tabanlarNon Container DatabaseOracle 12c yaps dnda kullanlan veri tabanlarPDB$SEEDContainer DB zerinde bulunan template PDBCDB ve PDB zerinde yeni kullanclar. Common Role &Users , Local Role & UsersUser & Grants

  • Container Database (CDB)www.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara Bulusmasi

  • CDB$ROOT / Root Fileswww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiSYSTEM SYSAUX - UNDO ve USERS tablespaceleri Oracle Sistem Medata Redolog [oracle@test1 scripts]$ sqlplus / as sysdba

    SQL> @tablespace CON_ID Status Name Type Size (M) ---------- ----- ------------------------------ --------------------- -------------- 1 ONLINE SYSTEM PERMANENT 790.000 1 ONLINE SYSAUX PERMANENT 1,470.000 1 ONLINE UNDOTBS1 UNDO 250.000 1 ONLINE USERS PERMANENT 5.000 2 ONLINE SYSTEM PERMANENT 250.000 2 ONLINE SYSAUX PERMANENT 590.000 5 ONLINE ABYS_DATA PERMANENT 161.250 5 ONLINE SYSAUX PERMANENT 820.000 5 ONLINE USERS PERMANENT 38.750 5 ONLINE SYSTEM PERMANENT 440.000[oracle@test1 scripts]$ sqlplus sys/Oracle3@abys as sysdba

    SQL> @tablespace

    CON_ID Status Name Type Extent Man Size (M) ---------- --------- ------------------------------ --------- ---------- -------------- 5 ONLINE USERS PERMANENT 38.750 5 ONLINE ABYS_DATA PERMANENT 161.250 5 ONLINE TEMP TEMPORARY 506.000 5 ONLINE SYSTEM PERMANENT 440.000 5 ONLINE SYSAUX PERMANENT 820.000 Default temp PLSQL shared package(dbms_sql)

  • Pluggable Database (PDB)www.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara Bulusmasi

  • Topolojiwww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara Bulusmasi

  • Oracle 12c Installationwww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara Bulusmasi

  • Users and Roleswww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiLocal UsersRoot Containerdan ynetilirC## n adyla balamak zorundadr. CDB zerindeki her PDBde geerlidir.Unique UserCONTAINER=ALL Pre Oracle 12cPDB UserMultiple UserCommonRoleRoot Containerdan ynetilirCREATE ROLE SET CONTAINERC## n adyla balamak zorundadr. CONTAINER=ALL ile kullanlr.PDBden ynetilir.CREATE ROLEOluturulduu PDB zerinde geerlidir.CDB$ROOTPDB

  • Users and Grantswww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiCDB$ROOTSYSC##DBASYSC##DBANATHRSYSC##DBANATHRSYSC##DBAHRHRSqlplus sys/Oracle3@pdbtst1 as sysdba;Sqlplus sys/Oracle3@pdbtst2 as sysdba;NATNATpdbtst1pdbtst2Create user c##dba identified by test1 container=ALL;Grant create session to c##dba container=ALL;Grant select any table to c##dba container=ALL;

  • CREATE PDBswww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiSQL> show con_nameCON_NAMECDB$ROOT

    SQL> select NAME, OPEN_MODE, CON_ID from V$PDBS;NAME OPEN_MODE CON_IDPDB$SEED READ ONLY 2PDBORCL MOUNTED 3PDBTST1 MOUNTED 7**** alter session set pdb_file_name_convert='pdb','pdb_test';

  • PDB Open / Closewww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiSHUTDOWNNOMOUNTMOUNTOPENPDB OPENALTER PLUGGABLE DATABASE pdbtst1 OPEN; ALTER PLUGGABLE DATABASE ALL OPEN; ALTER DATABASE OPEN;STARTUPALTER DATABASE MOUNT;STARTUP MOUNTALTER PLUGGABLE DATABASE pdb1 CLOSE IMMEDIATE;ALTER PLUGGABLE DATABASE ALL EXCEPT pdb1 CLOSE;ALTER PLUGGABLE DATABASE ALL CLOSE;ALTER PLUGGABLE DATABASE CLOSE;SHUTDOWN IMMEDIATESTARTUP NOMOUNT SQL> alter database mount;Database altered.

    SQL> SELECT name,open_mode FROM v$pdbs;NAME OPEN_MODE------------------------------ ----------PDB$SEED MOUNTEDPDBORCL MOUNTEDPDBTST1 MOUNTEDSQL> startupORACLE instance started.Database opened.

    SQL> SELECT name,open_mode FROM v$pdbs;NAME OPEN_MODE------------------------------ ----------PDB$SEED READ ONLYPDBORCL MOUNTEDPDBTST1 MOUNTEDSQL> alter pluggable database all open;Pluggable databases opened.

    SQL> SELECT name,open_mode FROM v$pdbs;NAME OPEN_MODE------------------------------ ----------PDB$SEED READ ONLYPDBORCL READ WRITEPDBTST1 READ WRITE

  • Lab1: UNPLUG / DROP PDBswww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara Bulusmasi

  • Lab2 : PLUG / Clone PDB www.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiROOT

  • Lab 3 : CLONE PDB FROM REMOTE CDBwww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiROOT1Create PDB CDB to CDB ROOTCDBISTCDBANK

  • Lab 4 : CLONE PDB FROM REMOTE CDB with DB LINKwww.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiROOT4Create PDB CDB to CDB ROOTCDBISTCDBANKscp -r * oracle@192.168.4.61:/disk2/setup_files/datafiles

    SQL> select pdb_name, status from CDB_PDBS;PDB_NAME STATUSPDB$SEED NORMALPDBTST1 NORMAL

    createpluggabledatabaseTST06 using'/disk2/setup_files/ pdborcl.xml' source_file_name_convert (, ')nocopytempfilereuse;

    SQL> select pdb_name, status from CDB_PDBS;

    PDB_NAME STATUSPDB$SEED NORMALPDBTST1 NORMALTST06 UNPLUG

    SQL> select name, open_mode from V$PDBS;

    NAME OPEN_MODEPDB$SEED READ ONLYTST06 MOUNTEDPDBTST1 READ WRITEDB LinkPDB Read OnlySQL>alterpluggabledatabasePDBCDRcloseimmediate;SQL> alterpluggabledatabase PDBCDR openreadonly;DB Linkcreate database link pdbcdr _lnk connect to SYSTEM identified by Oracle3 using '192.168.4.61:1521/pdbcdr'; create pluggable database pdbcdr _rmt from pdbcdr @ pdbcdr _lnk file_name_convert=('/disk2/app/oracle/oradata/orcl/','/disk2/app/oracle/oradata/orcl/remotedb');PDB OluturmaSQL> select name, open_mode from V$PDBS; NAME OPEN_MODEPDB$SEED READ ONLYPDBCDR MOUNTEDPDBTST1 READ WRITE* BUG 15931910

  • Lab 5 : Move Non CDB to CDB www.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiABYSROOTCDBANKOS : Windows 7 32bitDB : Oracle 11.2.0.3OS : Centos Linux 64bitDB : Oracle 12.1.0.1Bu yntemi uygulamak iin ;**** Non CDB veritaban 11.2.0.3 olmak zorunda**** Compatible Parametresi = 11.2.0.3 **** Karakter setleri ayn olmalABYSDBDMPDosyas

  • Lab 5 : Move Non CDB to CDB www.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiABYSROOTCDBANKOS : Windows 7 32bitDB : Oracle 11.2.0.3OS : Centos Linux 64bitDB : Oracle 12.1.0.1ABYSDB4. Dosyalarn Transferi CREATE PLUGGABLE DATABASE abysADMIN USER admin IDENTIFIED BY abysROLES = (connect,resource);

    Alter pluggable database ABYS open read write ;

    DMPDosyas5. Pluggable DB OluturmaFTP ile kopyalama*** $scp r exp_files oracle@test2:/disk2/backup6. Restore Datafilesrun{CONVERT DATAFILE '/disk2/exp/ABYS.dbf' DB_FILE_NAME_CONVERT="/disk2/exp/import/ABYS.dbf","/disk2/app/oracle/oradata/orcl/abys_a/ABYS.dbf" FORMAT='/disk2/app/oracle/oradata/orcl/abys_a/ABYS.dbf';..

  • Lab 5: Move Non CDB to CDB www.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiROOTCDBANKOS : Centos Linux 64bitDB : Oracle 12.1.0.17. Import DMPDosyas8. PDB Status SQL> select CON_ID, NAME, OPEN_MODE from V$PDBS;

    CON_ID NAME OPEN_MODE 2 PDB$SEED READ ONLY4 ABYS READ WRITEimpdp \'sys/Oracle3@abyspdb AS SYSDBA\' full=y DIRECTORY=IMP_DATA_PUMP_DIR dumpfile=DATAPUMP_DEV2DB.DMP LOGFILE=imp_abys.log VERSION=12 TRANSPORT_DATAFILES=USERS01.DBF_2 job_name=imp_ABYSdb parallel=2 REMAP_TABLESPACE='ABYS':'ABYS_DATA'9. Tablo Kontrol [oracle@test1]$ sqlplus / as sysdba

    SQL > conn sys/Oracle3@abysdb as sysdbaConnectted.

    SQL> select count(*) from abys.abone;COUNT(*)567

  • www.ozgurumutvurgun.com16 Ocak 2014TROUG Ankara BulusmasiTeekkrler

    zgr Umut VurgunBilgisayar MhendisiOracle 10g OCA/OCP ozgurumutvurgun@gmail.com

    ww