Oracle Database 12c-新特性的设计与开发实现
- 格式:pptx
- 大小:6.18 MB
- 文档页数:25


Oracle12C新特性之PDB热克隆(本地克隆、远端异机克隆)说明:版本12.2.0.112c r1版本中 clone ⼀份PDB源库需要打开在read only只读模式 , 在12c r2版本中引⼊了local undo mode, 源PDB在read/write 读写模式也可以 clone 。
local undo mode 也是oracle推崇的模式。
说明: shared undo 与 Local undo 模式切换可以参考 /zhang123456456/article/details/71374528要求:1、 Archive Log Enabled2、 Local Undo Enabled3、 destination CDB must have a public database link to the source CDB,have sufficient privileges to use the database link.⼀、克隆本地pdb[oracle@12c ~]$ sqlplus / as sysdba-- 检查是否开启 local undoSQL>col PROPERTY_NAME for a25;col PROPERTY_VALUE for a25;select PROPERTY_NAME,PROPERTY_VALUE from database_properties where property_name='LOCAL_UNDO_ENABLED'; PROPERTY_NAME PROPERTY_VALUE------------------------- -------------------------LOCAL_UNDO_ENABLED TRUESQL> show pdbsCON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 PDB01 READ WRITE NOSQL> show parameter pdb_file_name_convertNAME TYPE VALUE------------------------------------ ----------- ------------------------------pdb_file_name_convert string-- clone pdb 数量为⼀,注意这⾥ pdb_file_name_convert 参数⽣效级别设置的是 session ,如有需要,⾃⾏设置为全局SQL> alter session set pdb_file_name_convert='pdb01','pdb02';Session altered.SQL> create pluggable database pdb02 from pdb01;Pluggable database created.SQL> alter pluggable database pdb02 open;Pluggable database created.SQL> alter pluggable database pdb02 close immediate;Pluggable database altered.-- clone pdb 数量为多SQL> alter session set pdb_file_name_convert='pdb01','pdb02,pdb03';Session altered.SQL> create pluggable database pdb03 from pdb01;Pluggable database created.SQL> show pdbsCON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 PDB01 READ WRITE NO4 PDB02 MOUNTED5 PDB03 MOUNTEDSQL> alter pluggable database pdb02 open;Pluggable database altered.SQL> alter pluggable database pdb03 open;Pluggable database altered.SQL> show pdbsCON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 PDB01 READ WRITE NO4 PDB02 READ WRITE NO5 PDB03 READ WRITE NO⼆、克隆远程pdb--源端SQL> create user c##andy identified by andy container=all;User created.SQL> grant dba to c##andy container=all;Grant succeeded.-- ⽬标端cdb执⾏SQL> create database link clonePdb connect to c##andy identified by andy using '(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP) (HOST = 10.219.24.17)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = pdb01)))';Database link created.-- 源端SQL> show pdbsCON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 PDB01 READ WRITE NO-- ⽬标端cdbSQL> show pdbsCON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 PDB01 READ WRITE NO4 PDB02 READ WRITE NO5 PDB03 READ WRITE NOSQL> alter session set pdb_file_name_convert='pdb01','pdb04';Session altered.-- 通过 dblink 克隆源端的 pdbSQL> create pluggable database pdb04 from pdb01@clonePdb;Pluggable database created.SQL> show pdbsCON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 PDB01 READ WRITE NO4 PDB02 READ WRITE NO5 PDB03 READ WRITE NO6 PDB04 MOUNTEDSQL> alter pluggable database pdb04 open;alter pluggable database pdb04 open*ERROR at line 1:ORA-14694: database must in UPGRADE mode to begin MAX_STRING_SIZE migrationSQL> ho oerr ora 1469414694, 00000, "database must in UPGRADE mode to begin MAX_STRING_SIZE migration"// *Cause: An attempt was made to update the MAX_STRING_SIZE parameter// to EXTENDED when the database was not in UPGRADE mode.//* Action: Restart the database in UPGRADE mode, modify the parameter,// run the utl32k.sql script in $ORACLE_HOME/rdbms/admin, and// restart the database in normal mode.说明:这个报错的原因是⽬标端使⽤了12c的新特性extended data type ,源端没有使⽤这个新特性,从源端克隆过来的pdb需要扩展extended data type 新特性与⽬标端保持⼀致。
oracle12c的CDB与PDBoracle12c的CDB与PDBoracle12c的新特性Oracle 12C引⼊了CDB与PDB的新特性,在ORACLE 12C数据库引⼊的多租⽤户环境(Multitenant Environment)中,允许⼀个数据库容器(CDB)承载多个可插拔数据库(PDB)。
CDB全称为Container Database,中⽂翻译为数据库容器,PDB全称为Pluggable Database,即可插拔数据库。
在ORACLE 12C之前,实例与数据库是⼀对⼀或多对⼀关系(RAC):即⼀个实例只能与⼀个数据库相关联,数据库可以被多个实例所加载。
⽽实例与数据库不可能是⼀对多的关系。
当进⼊ORACLE 12C后,实例与数据库可以是⼀对多的关系。
下⾯是官⽅⽂档关于CDB与PDB的关系图。
cdb相当于操作系统,调⽤并管理各个pdb。
pdb相当于真正提供业务需求的数据库实例。
oracle 12c安装后只创建了cdb,需要⾃⼰⽣成相应的pdb。
oracle 12c使⽤了CDB-PDB架构,类似于docker,在container-db内可以加载多个pluggable-db.安装成功后修改tnsnames.ora我的在D:\app\oracle\product\12.1.0\dbhome_1\NETWORK\ADMIN⽂件夹下############################tnsnames.ora#######################cdborcl =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) )(CONNECT_DATA =(SERVICE_NAME = orcl) #cdb的db_name))#pdbpdborcl =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = pdborcl) #pdb的db_name))##########################tnsnames.ora######################数据库下拉框会出现pdborcl选项遇到的坑使⽤system登录,PLSQL Developer选择ORCL,执⾏select name,open_mode from v$pdbs; ⽤来查看当前CDB容器中包含的PDB容器pdborcl的open_mide的状态是READ WRITE,使⽤pdborcl也能登录,但是你重启服务器这个状态会变为这时候PLSQL Developer选择pdborcl就不能登录了,出现错误因为服务器重启时,pdb默认不启动PLSQL Developer选择ORCL. system登录(或使⽤sqlplus)执⾏alter pluggable database PDBORCL open; 启动pdb创建⽤户创建新⽤户,注意CDB容器中创建⼀个通⽤⽤户,⽤户名必须以C##或者c##开头,因为CDB中默认创建的是common user如果想要创建本地⽤户,则要在PDB容器中创建,下⾯会说如何切换到PDB容器create user C##test identified by 123456; //其中C##test为⽤户名,123456为密码给新⽤户授权grant create session to C##test;grant create table to C##test;grant create tablespace to C##test;grant create view to C##test;切换⾄查到的某个PDB容器(上⾯查到的是PDBORCL)注意使⽤这个命令需要的sysdba级别的权限,否则⽆法执⾏,切换后才可使⽤当前pdb的私有⽤户进⾏操作,12c数据库创建完成后,默认情况下使⽤sqlplus / as sysdba 登录连接的是CDB。
Oracle University |Contact Us: 20 (0)2 35350254 Oracle Database 12c R2: New Features for Administrators Part 2 Ed 1Duration: 5 DaysWhat you will learnThroughout the lessons of the Oracle Database 12c R2: New Features for Administrators Part 2 course constituted by five modules; the Securing Data module, the Making Data Available module, the Partitioning Data module, the Managing Information Lifecycle module and the Monitoring DB Operations and Managing Performance module, students receive a good knowledge of the Oracle Database 12c Release 2 new and enhanced features in different areas of database administration like Unified Auditing, Transparent Data Encryption (TDE) and other areas of security, Recovery Manager, online operations, Oracle Data Pump, SQL*Loader, new partitioning methods, Automatic Data Optimization, In-Memory Column Store, Full Database In-Memory Caching, and Automatic Big Table Caching.Learn To:Gain an understanding of the new and enhanced features of Oracle Database 12c Release 2 (12.2.0.1) amongst different areas such as security, availability, partitioning, performance, and Information Lifecycle Management (ILM).Benefits To YouBenefit from getting a thorough understanding of the following lessons:The lessons of the Securing Data module cover enhancements in auditing like role based conditional auditing, in privilege administration like new system administrative privilege for RAC, in Privilege Analysis and Data Redaction, in Transparent Sensitive Data Protection with new types of policies for FGA and TDE, and finally also in Transparent Data Encryption (TDE).The lessons of the Making Data Available module cover enhanced features in RMAN like table recovery, transport data across platforms, enhancements related to online operations, and finally ongoing enhancements with Oracle Data Pump, SQL*Loader and external tables.The lesson of the Partitioning Data module covers enhancements and new partitioning methods.The lessons of the Managing Information Lifecycle module introduce Heat Map and Automatic Data Optimization with heat map statistics tracking and ADO policies. The lessons also cover Temporal functionalities such as temporal history and temporal validity. In-Database Archiving provides a new feature, the Row-archival.The lessons of the Monitoring DB Operations and Managing Performance module explain the new features to improve the performance of the databases with SQL Performance Analyzer, DB Replay and SQL Plan Management, and to improve query execution with the Optimizer Statistics Advisor, JOIN processing. You will also learn about In-Memory Database option.A Live Virtual Class (LVC) is exclusively for registered students; unregistered individuals may not view an LVC at anytime. Registered students must view the class from the country listed in the registration form. Unauthorized recording, copying, or transmission of LVC content may not be made.AudienceDatabase AdministratorsEnd UsersSystem AdministratorRelated TrainingRequired PrerequisitesKnowledge of Oracle Database 11g R2Knowledge of Oracle Multitenant Container Database architectureSuggested PrerequisitesOracle Database 12c R2: New Features for Administrators Part 1 Ed 1Oracle Enterprise Manager Cloud Control 13c: Install & Upgrade Ed 1Oracle Enterprise Manager Cloud Control 13c: Install & Upgrade Ed 2Course ObjectivesManage security by using Unified AuditingManage security by using privileges and profilesManage security by using Privilege AnalysisManage security by using Data RedactionManage security by using Transparent Data EncryptionManage security by using Transparent Sensitive Data EncryptionDescribe the new RMAN enhancementsManage data availability by using new features of Oracle Data Pump, SQL*Loader and external tablesManage data availability by performing online operationsManage data partitioningManage Information Lifecycle by using ADOManage Information Lifecycle by using In-Database Archiving and Temporal featuresDescribe database operationsConfigure and use In-Memory Column StoreUse In-Memory CachingUse Real Application Testing enhancementsCourse TopicsIntroductionGlobal objectives of the courseLessons grouped by modulesSchedule of the weekAuditing Using Unified AuditQuick review of 11g R2 audit trail implementationOverview of the Unified Audit TrailCreating and enabling audit policies for all users to whom the role is granted directlyCapturing VPD (Virtual Private Database) generated predicatesControlling Data Access Using Privileges and ProfilesNew 12.2 administrative privilegesPassword file enhancementsEnhance the security of administrative usersEnforce the associated profile’s password limitsUsing mandatory INHERIT PRIVILEGES privilege to execute invoker's rights procedureUsing mandatory INHERIT PRIVILEGES privilege to select from BEQUEATH current_user views Using new INHERIT (ANY) REMOTE PRIVILEGES privilegeControlling Data Access Using Privilege AnalysisOverview of database privilege analysisGranting the CAPTURE_ADMIN role to enable management of privilege capturesCreating and starting/stopping privilege captures and runsViewing privilege analysis resultQuerying DBA_PRIV_CAPTURESRedacting DataOverview of Oracle Data RedactionTypes of Data Redaction PoliciesNew redaction format library in EM GUIRedaction policy expressionRedacting with Nullify redaction functionEncrypting DataEncrypt / decrypt / rekey tablespaces onlineConfigure automatic tablespace encryptionControlling Data Access Using Transparent Sensitive Data ProtectionConfigure and use TSDP with VPDConfigure and use TSDP with Data RedactionConfigure and use TSDP with Unified AuditingConfigure and use TSDP with Fine-Grained Auditing (FGA)Configure and use TSDP with Transparent Data Encryption (TDE)Making Data Available by Using RMAN FeaturesRMAN enhancementsTransport Data Across PlatformsTable recoveryAutomate the manual recovery process by using Recover Database Until Available RedoREPAIR FAILURE command extentedMaking Data Available by Using Oracle Data Pump, SQL*Loader and External TablesOracle Data Pump enhancementsSQL*Loader enhancementsQuerying against external tables and overriding external table clausesMaking Data Available by Performing Online OperationsDescribe online redefinition supportsMove and compress table partitions ONLINEPartitioning DataEnable reference partitioning with interval partitioned parent tablesIncorporate the CASCADE option for TRUNCATE PARTITION and EXCHANGE [SUB]PARTITION operations Convert partitioning Range to Interval and vice-versaConvert subpartitioning Range to Interval and vice-versaSimplify the maintenance of (sub) partitioned tablesComposite partitioningManaging Information Lifecycle Using ADOData classification in 12c : tablespace, group, object, row levelsConfigure heat mapAutomatic movement and compressionCompression levels and typesPolicy declarationCustomized automated action execution with user-defined functionExecution in scheduled maintenance windows and by MMONCustomized schedule with DBMS_ILM packageManaging Information Lifecycle Using In-Database Archiving and TemporalChallenges of old data in tables and 11g solutionsIn-database archiving new solutionsUse ROW ARCHIVAL clause to enable row lifecycle state for applicationsSet ROW ARCHIVAL VISIBILITY for session level visibility controlUse predicate on ORA_ARCHIVE_STATE columnTemporal Validity versus Temporal History (Transaction Time of FDA)Set a Temporal Validity by using PERIOD FOR clause of CREATE / ALTER TABLENew SQL temporal data typeMonitoring DB Operations and PerformanceOverviewUse casesCurrent ToolsDefine a DB operationMonitoring: Bracketing an OperationMonitoring the Progress of OperationsDB Operation TuningDB Operation Active ReportConfiguring In-Memory Column StoreIn-Memory Database option goals and benefitsRow format and columnar formatNew SGA componentDeploymentCompression and priority in-memory segments attributesDictionary tables, added columns, IM statistics and IM AdvisorIM FastStartInteraction with other productsUsing In-Memory Column StoreCaching results of frequently evaluated expressions and virtual columnsOptimizing joined columns by creating join groupsImproving Performance Using In-Memory CachingSetting up Full Database In-Memory CachingExplaining the two buffer replacement algorithms of Automatic Big Table CachingConfiguring Automatic Big Table Caching with DB_BIG_TABLE_CACHE_PERCENT_TARGET initialization parameter Using Automatic Big Table CachingImproving SQL PerformanceStatistics gathering performance improvements: Optimizer Statistics AdvisorAdaptive Execution PlanBenefit from automatic dynamic samplingUsing Real Application Testing EnhancementsSQL Performance Analyzer enhancementsSQL Plan Management enhancementsDatabase Replay enhancementsImproving Performance Using Other FeaturesManage session PGA limitMultiple indexes on the same set of columnsDescribe Advanced Row Compression and Avanced Index Compression HIGH levelReduce Cursor Invalidations for DDLsDefine real-time materialized views with on query computation and ON STATEMENT refresh materialized views Using multi-process multi-threaded Oracle architectureDescribe Database Smart Flash Cache enhancementsUse temporary undo for your temporary tables。
Oracle Database 12c应用与开发教程第1章数据库基础习题答案1. 简述Oracle 12c的应用结构。
答:参阅教材2. 简述Oracle与SQL Server的区别。
答:参阅教材3. 简述Oracle 12c的新特性。
答:参阅教材第2章Oracle Database 12c的安装和配置习题答案一、填空题1. Windows Unix2. 1GB3. 物理内存的两倍4. orcl5. 55006. SYSDBA Normal第3章Oracle Database的体系结构习题答案一、选择题A B B D B C D D1Oracle Database 12c应用与开发教程二、简答题1.什么是Oracle的实例?它是一种什么机制?答:Oracle数据库系统指具有管理Oracle数据库功能的计算机系统。
每一个运行的Oracle数据库都对应一个Oracle实例(Instance),一个Oracle实例为存取和控制数据库的软件机制。
当数据库服务器上的一个数据库启动时,Oracle将分配一块内存区间,叫做系统全局区(SGA),并启动一个或多个Oracle进程。
因此实例是一组内存结构和后台进程的集合。
总之,Oracle实例是指数据库拥有自己的系统全局区和相关数据库文件的Oracle服务器进程集,是存取和控制数据库的软件机制。
2.段是什么概念?如何组成的?答:表空间的下一级逻辑存储单位称作段,一个段只能存储同一模式对象。
根据存储模式对象的不同,段可以分为数据段、索引段、临时段和回滚段。
3.Oracle表空间的概念是什么?常用的表空间有哪些?答:表空间是数据库的逻辑划分,一个数据库在逻辑上由多个表空间组成。
表空间相当于一个容器,用于将不同类型的数据组织在一起。
表空间中的数据在物理上是存储在数据文件中的,一个表空间对应一个或多个数据文件。
常用的表空间有:系统表空间(SYSTEM Tablespace)、辅助表空间(SYSAUX Tablespace)、撤销表空间(UNDO Tablespace)、临时表空间(Temporary Tablespace)、用户表空间(Users Tablespace)。