Upload
yogesh-joshi
View
213
Download
0
Embed Size (px)
Citation preview
7/23/2019 Oracle 12c Feature
http://slidepdf.com/reader/full/oracle-12c-feature 1/8
1. Online rename and relocation of an active data file
Unlike in the previous releases, a data file migration or renaming in Oracle database 12c R1 no longer
requires a number of steps i.e. putting the tablespace in REA O!"# mode, follo$ed b% data file offline
action. &n 12c R1, a data file can be renamed or moved online simpl% using the A"'ER A'A(A)E *O+E
A'A&"E )-" statement. hile the data file is being transferred, the end user can perform queries, *"
and " tasks. Additionall%, data files can be migrated bet$een storages e.g. from non/A)* to A)* and
vice versa.
Rename a data file0
SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users01.dbf' TO
'/u00/data/users_01.dbf'
*igrate a data file from non/A)* to A)*0
SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO '!D"_DATA'
*igrate a data file from one A)* disk group to another0
SQL> ALTER DATABASE MOVE DATAFILE '!D"_DATA/DB#AME/DATAFILE/users_01.dbf ' TO
'!D"_DATA_0$'
Over$rite the data file $ith the same name, if it eists at the ne$ location0
SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO'/u00/data_%e&/users_01.dbf' RESE
op% the file to a ne$ location $hilst retaining the old cop% in the old location0
7/23/2019 Oracle 12c Feature
http://slidepdf.com/reader/full/oracle-12c-feature 2/8
SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO
'/u00/data_%e&/users_01.dbf' (EE)
#ou can monitor the progress $hile a data file being moved b% quer%ing
the v$session_longops d%namic vie$. Additionall%, %ou can also refer the alert.log of the database
$here Oracle $rites the details about action being taken place.
2. Online migration of table partition or sub-partition
*igration of a table partition or sub/partition to a different tablespace no longer requires a comple
procedure in Oracle 12c R1. &n a similar $a% to ho$ a heap 3non/partition4 table online migration $as
achieved in the previous releases, a table partition or sub/partition can be moved to a different tablespace
online or offline. hen an O!"&!E clause is specified, all *" operations can be performed $ithout an%
interruption on the partition5sub/partition $hich is involved in the procedure. &n contrast, no *"
operations are allo$ed if the partition5sub/partition is moved offline.
6ere are some $orking eamples0
SQL> ALTER TABLE tab*e_%a+e MOVE )ARTITIO#,SB)ARTITIO# -artt%_%a+e TO
tab*es-ae tab*es-ae_%a+e
SQL> ALTER TABLE tab*e_%a+e MOVE )ARTITIO#,SB)ARTITIO# -artt%_%a+e TOtab*es-ae tab*es-ae_%a+e )DATE I#DEES O#LI#E
'he first eample is used to move a table partition5sub/partition to a ne$ tablespace offline. 'he second
eample moves a table partition7sub/partitioning online maintaining an% local7global indees on the table.
Additionall%, no *" operation $ill get interrupted $hen O!"&!E clause is mentioned.
Important notes:
'he U8A'E &!E9E) clause $ill avoid an% local7global indees going unusable on the table.
'able online migration restriction applies here too. 'here $ill be locking mechanism involved to complete the procedure, also it might leads to
performance degradation and can generate huge redo, depending upon the si:e of the partition, sub/
partition.
7. Backup specific user privilege
7/23/2019 Oracle 12c Feature
http://slidepdf.com/reader/full/oracle-12c-feature 3/8
&n 11g R2, )#)A)* privilege $as introduced to perform A)* specific operations. )imilarl%, backup and
recover% tasks specific privilege )#)(A;U8 has been introduced in 12c to eecute backup and
recover% commands in Recover% *anager 3R*A!4. 'herefore, %ou can create a local user in the
database and grant the )#)(A;U8 privilege to perform an% backup and recover% related tasks in
R*A! $ithout being granting the )#)(A privilege.
2 ./r+a% tar3et 4user%a+e/-ass&rd as S5SBA6()4
. !o" to e#ecute %& statement in '()*
&n 12c, %ou can no$ eecute an% )-" and 8"7)-" commands in R*A! $ithout the need of a )-" prefi0
%ou can eecute an% )-" and 8")7)-" commands directl% from R*A!. 6o$ %ou can eecute )-"
statements in R*A!0
RMA#> SELE6T user%a+e7+a8%e FROM 92sess%
RMA#> ALTER TABLES)A6E users ADD DATAFILE SI:E 1$1+
+. ,able or partition recover in '()*
Oracle database backups are mainl% categori:ed into t$o t%pes0 logical and ph%sical. Each backup t%pehas its o$n pros and cons. &n previous editions, it $as not feasible to restore a table or partition using
eisting ph%sical backups. &n order to restore a particular ob<ect, %ou must have logical backup. ith 12c
R1, %ou can recover a particular table or partition to a point/in/time or )! from R*A! backups in the
event of a table drop or truncate.
hen a table or partition recover% is initiated via R*A!, the follo$ing action is performed0
Required backup sets are identified to recover the table7partition
An auiliar% database $ill be configured to a point/in/time temporaril% in the process of recovering
the table7partition
Required table7partitions $ill be then eported to a dumpfile using the data pumps
Optionall%, %ou can import the table7partitions in the source database
Rename option $hile recover%
An eample of a table point/in/time recover% via R*A! 3ensure %ou alread% have a full database backup
from earlier40
7/23/2019 Oracle 12c Feature
http://slidepdf.com/reader/full/oracle-12c-feature 4/8
RMA#> %%et tar3et 4user%a+e/-ass&rd as S5SBA6()4
RMA#> RE6OVER TABLE user%a+e.tab*e%a+e #TIL TIME 'TIMESTAM);'
AILIAR5 DESTI#ATIO# '/u01/tab*ere9er<'
DATA)M) DESTI#ATIO# '/u01/d-u+-'
DM) FILE 'tab*e%a+e.d+-'
#OTABLEIM)ORT == t8s -t% a9ds +-rt%3 t8e tab*e
aut+ata**<.
REMA) TABLE 'user%a+e.tab*e%a+e' 'user%a+e.%e&_tab*e_%a+e' == a% re%a+e
tab*e &t8 t8s -t%.
Important notes:
Ensure sufficient free space available under 7u=1 files%stem for auiliar% database and also to
keep the data pump file
A full database backup must be eists, or at least the )#)'E* related tablespaces
'he follo$ing limitations7restrictions are applied on table7partition recover% in R*A!0
)#) user table7partition can>t be recovered
'ables7partitions stored under )#)AU9 and )#)'E* tablespaces can>t be recovered
Recover% of a table is not possible $hen RE*A8 option used to recover% a table that contains
!O' !U"" constraints
atabase upgrade improvements
henever a ne$ Oracle version is announced, the immediate challenge that ever% (A confronts is the
upgrade process. &n this section, & $ill eplain the t$o ne$ improvements introduced for upgrading to 12c.
/re-upgrade script
A ne$ and much improved pre/upgrade information script, preupgrd.s0l, replaces the
legac% utlu121s.s0l script in 12c R1. Apart from the preupgrade checks verification, the script is
capable of addressing the various issues ? in the form of fiup scripts ? that are raised during the pre/post
upgrade process.
7/23/2019 Oracle 12c Feature
http://slidepdf.com/reader/full/oracle-12c-feature 5/8
'he fiup scripts that are generated can be eecuted to resolve the problems at different levels, for
eample, pre/upgrade and post upgrade. hen upgrading the database manuall%, the script must be
eecuted manuall% before initiating the actual upgrade procedure. 6o$ever, $hen the atabase Upgrade
Assistant 3(UA4 tool is used to perform a database upgrade, it automaticall% eecutes the pre/upgrade
scripts as part of the upgrade procedure and $ill prompt %ou to eecute the fiup scripts in case of an%
errors that are reported.
'he follo$ing eample demonstrates ho$ to eecute the scripts0
SQL> ?2ORA6LE_1$"@OME/rdb+s/ad+%/-reu-3rd.s*
'he above script generates a log file and a pre3postupgrade_fi#up.s0l script. All these files are
located under the $O')4&5_B)53cfgtoollogs director%. (efore %ou continue $ith the real upgrade
procedure, %ou should run through the recommendations mentioned in the log file and eecute the scripts
to fi an% issues.
*ote: Ensure %ou cop% the preupgrd.s0l and utluppkg.s0l scripts from the 12c Oracle
home7rdbms7admin director% to the current Oracle database7rdbms7admin location.
/arallel-upgrade utilit
'he database upgrade duration is directl% proportional to the number of components that are configured
on the database, rather than the database si:e. &n previous releases, there $as no direct option or
$orkaround available to run the upgrade process in parallel to quickl% complete the overall upgrade
procedure.
'he catctl.pl 3parallel/upgrade utilit%4 that replaces the legac% catupgrd.s0l script in 12c R1 comes $ith
an option to run the upgrade procedure in parallel mode to improve the overall duration required to
complete the procedure.
'he follo$ing procedure eplains ho$ to initiate the parallel 3$ith @ processes4 upgrade utilit% %ou need
to run this after %ou )'AR'U8 the database in U8BRAE mode0
d 2ORA6LE_1$_@OME/-er*/b%
2 ./-er* att*.-* % C =atu-3rd.s*
'he above t$o steps need to be run eplicitl% $hen a database is upgraded manuall%. 6o$ever, the
(UA inherits the both ne$ changes.
7/23/2019 Oracle 12c Feature
http://slidepdf.com/reader/full/oracle-12c-feature 6/8
6. 'estore3'ecover data files over te net"ork
#et another great enhancement in 12c R1. #ou can no$ restore or recover a data file, control file, spfile,
tablespace or entire database bet$een primar% and standb% databases using a )ER+&E name. 'his is
particularl% useful to s%nchroni:e the primar% and standb% databases.
hen there is a prett% long gap found bet$een the primar% and standb% database, %ou no longer require
the comple roll/for$ard procedure to fill the gap bet$een the primar% and standb%. R*A! is able to
perform standb% recover% getting the incremental backups through the net$ork and appl%ing them to the
ph%sical standb% database. 6aving said that, %ou can directl% cop% the required data files from the
standb% location to the primar% site using the )ER+&E name e.g. in the case of a data file, tablespace
lost on the primar% database, or $ithout actuall% restoring the data files from a backup set.
'he follo$ing procedure demonstrates ho$ to perform a roll for$ard using the ne$ features to
s%nchroni:e the standb% database $ith its primar% database0
On the ph%sical standb% database0
./r+a% tar3et 4user%a+e/-ass&rd?sta%db<_db_t%s as S5SBA6()4
RMA#> RE6OVER DATABASE FROM SERVI6E -r+ar<_db_t%s SI#" 6OM)RESSED BA6()SET
'he above eample uses the primar_db_tns connect string defined on the standb% database, connects
to the primar% database, performs an incremental backup, transfers these incremental backups over
standb% destination, and then applies these files to the standb% database to s%nchroni:e the standb%.
6o$ever, %ou need to ensure %ou have configured primar_db_tns to point to the primar% database on
the standb% database side.
&n the follo$ing eample, & $ill demonstrate a scenario to restore a lost data file on the primar% database
b% fetching the data file from the standb% database0
On the primar% database0
./r+a% tar3et 4user%a+e/-ass&rd?-r+ar<_db_t%s as S5SBA6()4
R*A!C RE)'ORE A'A&"E DBF&);BROU87(A!*E7A'A&"E7filename> RO* )ER+&E
standb%FdbFtns
7/23/2019 Oracle 12c Feature
http://slidepdf.com/reader/full/oracle-12c-feature 7/8
8. ata /ump enancements
'his part of the section $ill focus on the important enhancements introduced in data pumps. 'here are
quite a fe$ useful additions, such as converting vie$ into a table $hile eporting and turning off logging
$hile import.
,urn off redo log generation
'he ne$ ,')*9O'( option introduced in data pumps import provides the fleibilit% to turn off the redo
generation for the ob<ects during the course of import. hen I)B&5_)'4!I5_&O;;I*; values is
specified $ith the,')*9O'( option, redo generation for the ob<ects in the contet $ill be turned off
during the entire import duration. 'his feature provides a great relief $hen importing large tables, and
reduces the ecessive redo generation, $hich results in quicker imports. 'his attribute applies to tables
and indees.
'his eample demonstrates this feature0
2 ./+-d- dretr<d-u+- du+-f*eabd.d+- *3f*eabd.*3
TRA#SFORMDISABLE_AR6@IVE_LO""I#"5
,ransport vie" as table
'his is another improvement in the data pumps. ith the ne$ I5<_)_,)B&5 option, %ou can
unload the vie$ data into a table. 'he follo$ing eample describes ho$ to unload vie$s data into a table
during eport0
2 ./e-d- dretr<d-u+- du+-f*eabd.d+- *3f*eabd.*3
9e&s_as_tab*es+<_9e&+<_tab*e
=. 'eal-time )( analsis
Anal%:ing past and current database health statuses through a set of automatic diagnostic tools such as
AR, A)6 and A* is part of ever% (As life. 'hough each individual tool can be used at various
levels to measure the database>s overall heath and performance, no tool can be used $hen the database
is unresponsive or totall% hung.
hen %ou encounter an unresponsive database or hung state, and if %ou have configured Oracle
Enterprise *anager 12c loud ontrol, %ou can diagnose serious performance issues. 'his $ould give
%ou a good picture about $hat>s currentl% going on in the database, and might also provide a remed% to
resolve the issue.
7/23/2019 Oracle 12c Feature
http://slidepdf.com/reader/full/oracle-12c-feature 8/8
'he follo$ing step/b%/step procedure demonstrates ho$ to anal%:e the situation on the Oracle E* 12c
loud ontrol 0
)elect the 5mergenc (onitoring option from the /erformance menu on the Access the
atabase !ome page.'his $ill sho$ the top blocking sessions in the 6ang Anal%sis table.
)elect the 'eal-,ime )( option from the /erformance to perform Real/time A* anal%sis.
After collecting the performance data, click on the 9indings tab to get the interactive summar% of
all the findings.
>. ;atering statistics concurrentl on multiple tables
&n previous Oracle database editions, $henever %ou eecute a B(_,), procedure to gather table,
inde, schema or database level statistics, Oracle used to collect stats one table at a time. &f the table is
big enough, then increasing the parallelism $as recommended. ith 12c R1, %ou can no$ collect stats on
multiple tables, partitions and sub partitions concurrentl%. (efore %ou start using it, %ou must set the
follo$ing at the database level to enable the feature0
SQL> ALTER S5STEM SET RESOR6E_MA#A"ER_)LA#'DEFALT_MAI#'
SQL> ALTER S5STEM SET OB_QEE_)RO6ESSESG
SQL> EE6 DBMS_STATS.SET_"LOBAL_)REFSH'6O#6RRE#T'7 'ALL'
SQL> EE6 DBMS_STATS."AT@ER_S6@EMA_STATSH'S6OTT'