Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the new features of Oracle 12c

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the relevant knowledge of "what are the new features of Oracle 12c". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Enhancements in automatic Storage Management (ASM)

Flex ASM

In a typical grid infrastructure installation environment, each node runs its own instance of ASM as a storage container for the database running on this node. However, there is a corresponding risk of single point of failure in this setting. For example, if the ASM instance on this node fails, all databases and instances running on this node are affected. To avoid a single point of failure of ASM instances, Oracle 12c provides a feature called Flex ASM. Flex ASM is a different concept and architecture, and only a small number of ASM instances need to run on some servers in the cluster. When an ASM instance on one node fails, the Oracle cluster automatically starts an alternative ASM instance on a different node to enhance availability. In addition, this setting provides ASM instance load balancing capabilities for instances running on this node. Another advantage of Flex ASM is that it can be configured on a separate node.

When the Flex Cluster option is selected as the first part of the cluster installation environment, the Flex ASM configuration is automatically selected due to the requirements of Flex Cluster. Traditional clusters are also applicable to Flex ASM. When you decide to use Flex ASM, you must make sure that the required network is available. You can choose the Flex ASM storage option as part of the cluster installation environment, or use ASMCA to enable Flex ASM in a standard cluster environment.

The following command shows the current ASM mode:

$. / asmcmd showclustermode

$. / srvctl config asm

Or connect to the ASM instance and query the INSTANCE_TYPE parameter. If the output value is ASMPROX, then Flex ASM is already configured.

Relaxation of ASM storage restrictions

The ASM storage hard limit has increased significantly in terms of the maximum ASM disk group and disk size. ASM supports 511 ASM disk groups in 12c R1 and 63 in 11g R2. Similarly, this number has now been increased to 32 PB compared to the disk size of 20 PB in 11g R2.

Optimization of ASM equalization operation

The new EXPLAIN WORK FOR statement in 12c is used to measure the amount of work required for a given ASM equalization operation and to enter the result in the V$ASM_ESTIMATE dynamic view. Using this dynamic view, you can adjust the POWER LIMIT statement to improve the rebalance operation. For example, if you want to measure the amount of work required to add a new ASM disk, you can use the following command before actually performing a manual equalization operation:

SQL > EXPLAIN WORK FOR ALTER DISKGROUP DG_DATA ADD DISK data_005

SQL > SELECT est_work FROM V$ASM_ESTIMATE

SQL > EXPLAIN WORK SET STATEMENT_ID='ADD_DISK' FOR ALTER DISKGROUP DG_DATA AD DISK data_005

SQL > SELECT est_work FROM V$ASM_ESTIMATE WHERE STATEMENT_ID = 'ADD_DISK'

You can adjust the POWER limits according to the output from the dynamic view to improve the equalization operation.

ASM disk cleanup

In an ASM disk group, the new ASM disk cleanup operation is divided into normal or highly redundant levels, which can detect logical data corruption on all disks in the ASM disk group, and can automatically repair logical corruption. If logical data corruption is detected, ASM mirrored disks are used. Disk cleanup can be performed on a disk group, a specific disk, or a file so that its impact can be minimized. The following demonstrates the disk cleanup scenario:

SQL > ALTER DISKGROUP dg_data SCRUB POWER LOW:HIGH:AUTO:MAX

SQL > ALTER DISKGROUP dg_data SCRUB FILE'+ DG_DATA/MYDB/DATAFILE/filename.xxxx.xxxx'

REPAIR POWER AUTO

Active session History of ASM (ASH)

The V$ACTIVE_SESSION_HISOTRY dynamic view can now also provide sampling of active sessions for ASM instances. However, the use of diagnostic packages is restricted by licensing.

two。 Enhancements to grid (Grid) infrastructure

Flex cluster

Oracle 12c supports two types of configurations during cluster installation: traditional standard clusters and Flex clusters. In a traditional standard cluster, all the nodes in the cluster are closely integrated with each other, interact through the private network, and have direct access to storage. On the other hand, Flex clusters introduce two types of nodes between Hub and Leaf node structures. The nodes assigned in Hub are similar to traditional standard clusters. They are interconnected to each other through private networks and have direct read and write access to storage. Unlike Hub nodes, Leaf nodes do not need to access the underlying storage directly; instead, they access storage and data through Hub nodes.

You can configure up to 64 Hub nodes, and Leaf nodes can have more. In an Oracle Flex cluster, there is no need to configure a Leaf node to have a Hub node, while without a Hub node, a Leaf node would not exist. For a single Hub node, you can configure multiple Leaf nodes. In an Oracle Flex cluster, only Hub nodes directly access OCR and Voting disks. This is a great feature when you are planning a large-scale clustered environment. This series of settings will greatly reduce interconnection congestion and provide space for traditional standard clusters to expand the cluster.

There are two ways to deploy Flex clusters:

1. Deploy when configuring a new cluster

two。 Upgrade a standard cluster mode to a Flex cluster

If you are configuring a completely new cluster, you need to select the type of cluster configuration in step 3, select the configure a Flex cluster option, and then you need to classify the Hub and Leaf nodes in step 6. For each node, select whether the corresponding role is Hub or Leaf, and the virtual hostname is optional.

Converting a standard cluster mode to Flex cluster mode requires the following steps:

1. Use the following command to get the current state of the cluster:

$. / crsctl get cluster mode status

two。 Execute the following command as the root user:

$. / crsctl set cluster mode flex

$. / crsctl stop crs

. / crsctl start crs-wait

3. Change the node role according to the design:

$. / crsctl get node role config

$. / crsctl set node role hub | leaf

$. / crsctl stop crs

. / crsctl start crs-wait

Note:

? You cannot revert to standard cluster mode from Flex

? Changing the cluster node mode requires the cluster stack to stop.

? Ensure that GNS is configured with a fixed VIP

OCR backups in ASM disk groups

For 12c Magi OCR can now be backed up in the ASM disk group. This simplifies access to OCR backup files through all nodes. To prevent OCR recovery, you don't have to worry about which node the latest backup of OCR is on. The latest backup stored in ASM can be easily identified from any node and the restore can be easily performed.

The following demonstrates how to set the ASM disk group to the OCR backup location:

$. / ocrconfig-backuploc + DG_OCR

Support for IPv6 protocol

Oracle supports IPv6 network protocol configuration for 12c Oracle. You can now configure public or private network interfaces on IPv4 or IPv6, however, you need to make sure that the same IP protocol is used on all nodes in the cluster.

3. Enhancement of RAC database

What-if command evaluation

With srvctl using the new What-if command to evaluate options, you can now determine the impact of running this command. This newly added command to srvctl can be simulated without actually executing it or making any changes to the current system. This is especially useful when you want to make changes to an existing system but the results are uncertain. In this way, this command provides the effect of making changes. The-eval option can also be used through the crsctl command.

For example, if you want to know what happens when you stop a particular database, you can use the following example:

. / srvctl stop database-d MYDB-eval

. / crsctl eval modify resource-attr "value"

Improvement of srvctl

There are also some new features for the srvctl command. The following demonstrates how to use these new features to stop or start a database or instance resource on a cluster.

Srvctl start database | instance-startoption NOMOUNT | MOUNT | OPEN

Srvctl stop database | instance-stopoption NOMOUNT | MOUNT | OPEN

4. Truncation table CASCADE

In previous versions, truncation of a master table was not provided when the child table referenced a master table and where records existed in the child table. On the other hand, the TRUNCATE TABLE with CASCADE operation in 12c can truncate the records in the main table, recursively truncate the child tables automatically, and refer to them as DELETE ON CASCADE obeying foreign keys. Because this applies to all child tables, there is no CAP for the number of recursive levels, which can be grandchild tables, great-grandchild tables, and so on.

This enhancement rejects the premise of truncating all child table records before truncating a master table. The new CASCADE statement can also be applied to table partitions and child table partitions.

SQL > TRUNCATE TABLE CASCADE

SQL > TRUNCATE TABLE PARTITION CASCADE

If the ON DELETE CASCADE option is not defined for the foreign key of the child table, an ORA-14705 error is thrown.

5. Restrict records for Top-N query results

In previous versions, there were a variety of indirect means to get Top-N query results for top or bottom records. In 12c, the process is simplified and made more straightforward with a new FETCH FIRST | NEXT | PERCENT statement. To retrieve the top 10 payroll records from the EMP table, you can use the following new SQL statement:

SQL > SELECT eno,ename,sal FROM emp ORDER BY SAL DESC

FETCH FIRST 10 ROWS ONLY

The following example gets all similar records for the top N. For example, if the salary value in row 10 is 5000 and there are other employees whose salaries meet the top N criteria, they will also be obtained by the WITH TIES statement.

SQL > SELECT eno,ename,sal FROM emp ORDER BY SAL DESC

FETCH FIRST 10 ROWS ONLY WITH TIES

The following example restricts getting the top 10% records from the EMP table:

SQL > SELECT eno,ename,sal FROM emp ORDER BY SAL DESC

FETCH FIRST 10 PERCENT ROWS ONLY

The following example ignores the first five records and displays the next five records of the table:

SQL > SELECT eno,ename,sal FROM emp ORDER BY SAL DESC

OFFSET 5 ROWS FETCH NEXT 5 ROWS ONLY

All of these limitations can also be applied to PL/SQL blocks.

BEGIN

SELECT sal BULK COLLECT INTO sal_v FROM EMP

FETCH FIRST 100 ROWS ONLY

END

6. Various enhancements to SQL*Plus

The implicit result of SQL*Plus: in 12c, SQL*Plus returns the result from an implicit cursor of a PL/SQL block without actually binding a RefCursor. This new dbms_sql.return_result procedure will return and format the results specified by the SELECT statement query in the PL/SQL block. The following code describes this usage:

SQL > CREATE PROCEDURE mp1

Res1 sys_refcursor

BEGIN

Open res1 for SELECT eno,ename,sal FROM emp

Dbms_sql.return_result (res1)

END

SQL > execute mp1

When this process is performed, the formatted record is returned on the SQL*Plus.

Show invisible fields: in the first part of this series, I have explained the new features of invisible fields. When fields are defined as invisible, they will not be displayed when describing the table structure. However, you can display information about invisible fields by making the following settings at the SQL*Plus prompt:

SQL > SET COLINVISIBLE ON | OFF

The above settings are valid only for the DESCRIBE command. It currently does not have an effect on the results of SELECT statements on invisible fields.

7. Session level sequence

New session-level database sequences can now be created in 12c to support session-level sequence values. The types of these sequences are most suitable for global temporary tables with session levels.

The session-level sequence produces a unique range of values that are limited within, rather than beyond, the session. Once the session is terminated, the state of the session sequence also disappears. The following example explains the creation of a session-level sequence:

SQL > CREATE SEQUENCE my_seq START WITH 1 INCREMENT BY 1 SESSION

SQL > ALTER SEQUENCE my_seq GLOBAL | SESSION

For session-level sequences, CACHE, NOCACHE, ORDER, or NOORDER statements are ignored.

8. Improvement of WITH statement

In 12c, you can use SQL to run PL/SQL functions or procedures faster, which are defined and declared by the WITH statement of the SQL statement. The following example shows how to define and declare a procedure or function in a WITH statement:

WITH

PROCEDURE | FUNCTION test1 (…)

BEGIN

END

SELECT FROM table_name

/

Although you cannot use the with statement directly in the PL/SQL unit, it can be referenced by a dynamic SQL in the PL/SQL unit.

9. Extended data type

In 12c, the size of data types such as VARCHAR2, NAVARCHAR2, and RAW expands from 4K and 2K bytes to 32K bytes compared to previous versions. Whenever possible, the size of extended characters reduces the use of the LOB data type. To enable extended character size, you must set the initial database parameter of MAX_STRING_SIZE to EXTENDED.

To use extended character types, you need to perform the following procedures:

1. Shut down the database

two。 Restart the database in upgrade mode

3. Change parameter: ALTER SYSTEM SET MAX_STRING_SIZE=EXTENDED

4. Execute utl32k.sql as sysdba: SQL > @? / rdbms/admin/utl32k.sql

5. Shut down the database

6. Restart the database in read-write mode

Compared to LOB data types, in ASSM tablespace management, fields of extended data types are stored in SecureFiles LOB, while in non-ASSM tablespace management, they are stored in BasciFiles LOB.

Note: once changed, you can no longer change the settings back to STANDARD.

This is the end of "what are the new features of Oracle 12c". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report