In this article, I would be briefing about some new features getting introduced in upcoming Oracle Database 19c - probably would get released in 1st quarter of 2019.
......... Continued ......
In this article, I would be briefing about some new features getting introduced in upcoming Oracle Database 19c - probably would get released in 1st quarter of 2019.
......... Continued ......
$cd /opt/oracle.SupportTools/onecommand
Then$cat databasemachine.xml | grep MACHINE
/opt/oracle.SupportTools/onecommand
dbm01rac01[TESTDB] cat databasemachine.xml | grep MACHINE
<MACHINETYPE>36</MACHINETYPE>
<MACHINETYPE>X3-2 Half Rack HC 3TB</MACHINETYPE>
<MACHINEUSIZE>42</MACHINEUSIZE>
> !cat fsx.sql ---------------------------------------------------------------------------------------- -- -- File name: fsx.sql -- -- Purpose: Find SQL and report whether it was Offloaded and % of I/O saved. -- -- Usage: This scripts prompts for two values. -- -- sql_text: a piece of a SQL statement like %select col1, col2 from skew% -- -- sql_id: the sql_id of the statement if you know it (leave blank to ignore) -- -- Description: -- -- This script can be used to locate statements in the shared pool and -- determine whether they have been executed via Smart Scans. -- -- It is based on the observation that the IO_CELL_OFFLOAD_ELIGIBLE_BYTES -- column in V$SQL is only greater than 0 when a statement is executed -- using a Smart Scan. The IO_SAVED_% column attempts to show the ratio of -- of data received from the storage cells to the actual amount of data -- that would have had to be retrieved on non-Exadata storage. Note that -- as of 11.2.0.2, there are issues calculating this value with some queries. -- -- Note that the AVG_ETIME will not be acurate for parallel queries. The -- ELAPSED_TIME column contains the sum of all parallel slaves. So the -- script divides the value by the number of PX slaves used which gives an -- approximation. -- -- Note also that if parallel slaves are spread across multiple nodes on -- a RAC database the PX_SERVERS_EXECUTIONS column will not be set. -- --------------------------------------------------------------------------------------- set pagesize 999 set lines 190 col sql_text format a70 trunc col child format 99999 col execs format 9,999 col avg_etime format 99,999.99 col "IO_SAVED_%" format 999.99 col avg_px format 999 col offload for a7 select sql_id, child_number child, plan_hash_value plan_hash, executions execs, (elapsed_time/1000000)/decode(nvl(executions,0),0,1,executions)/ decode(px_servers_executions,0,1,px_servers_executions/ decode(nvl(executions,0),0,1,executions)) avg_etime, px_servers_executions/decode(nvl(executions,0),0,1,executions) avg_px, decode(IO_CELL_OFFLOAD_ELIGIBLE_BYTES,0,'No','Yes') Offload, decode(IO_CELL_OFFLOAD_ELIGIBLE_BYTES,0,0, 100*(IO_CELL_OFFLOAD_ELIGIBLE_BYTES-IO_INTERCONNECT_BYTES) /decode(IO_CELL_OFFLOAD_ELIGIBLE_BYTES,0,1,IO_CELL_OFFLOAD_ELIGIBLE_BYTES)) "IO_SAVED_%", sql_text from v$sql s where upper(sql_text) like upper(nvl('&sql_text',sql_text)) and sql_text not like 'BEGIN :sql_text := %' and sql_text not like '%IO_CELL_OFFLOAD_ELIGIBLE_BYTES%' and sql_id like nvl('&sql_id',sql_id) order by 1, 2, 3 /
SQL> select /*+ gather_plan_statistics fsx-example-002 */ 2 avg(id) from bigtab where id between 1000 and 50000; AVG(ID) ---------- 25500 Elapsed: 00:00:00.64 SQL> alter session set cell_offload_processing=false; Session altered. Elapsed: 00:00:00.00 SQL> select /*+ gather_plan_statistics fsx-example-002 */ 2 avg(id) from bigtab where id between 1000 and 50000; AVG(ID) ---------- 25500 Elapsed: 00:00:53.88 SQL> @fsx4 Enter value for sql_text: %fsx-example-002% Enter value for sql_id: SQL_ID CHILD OFFLOAD IO_SAVED_% AVG_ETIME SQL_TEXT ------------- ------ ------- ---------- ---------- ---------------------------------------- cj0p52wha5wb8 0 Yes 99.97 .63 select /*+ gather_plan_statistics fsx-ex cj0p52wha5wb8 1 No .00 53.88 select /*+ gather_plan_statistics fsx-ex 2 rows selected.
SQL> select xmltype(reason) from v$sql_shared_cursor 2 where sql_id = 'cj0p52wha5wb8' and child_number = 0; XMLTYPE(REASON) --------------------------------------------------------------------------- <ChildNode> <ChildNumber>0</ChildNumber> <ID>3</ID> <reason>Optimizer mismatch(12)</reason> <size>2x356</size> <cell_offload_processing> true false </cell_offload_processing> </ChildNode>
SQL> select /*+ gather_plan_statistics fsx-example-004 */ avg(id) 2 from bigtab where id between 1000 and 50002; AVG(ID) ---------- 25501 Elapsed: 00:00:00.68 SQL> alter session set "_serial_direct_read" = never; Session altered. Elapsed: 00:00:00.00 SQL> select /*+ gather_plan_statistics fsx-example-004 */ avg(id) 2 from bigtab where id between 1000 and 50002; AVG(ID) ---------- 25501 Elapsed: 00:04:50.32 SQL> SQL> alter session set "_serial_direct_read" = auto; Session altered. Elapsed: 00:00:00.00 SQL> select /*+ gather_plan_statistics fsx-example-004 */ avg(id) 2 from bigtab where id between 1000 and 50002; AVG(ID) ---------- 25501 Elapsed: 00:00:00.63 SQL> @fsx4 Enter value for sql_text: %fsx-example-004% Enter value for sql_id: SQL_ID CHILD OFFLOAD IO_SAVED_% AVG_ETIME SQL_TEXT ------------- ------ ------- ---------- ---------- ---------------------------------------- 6xh6qwv302p13 0 Yes 55.17 97.21 select /*+ gather_plan_statistics fsx-ex
ALTER SYSTEM CANCEL SQL 'SID, SERIAL, @INST_ID, SQL_ID';
ALTER SYSTEM CANCEL SQL '20, 51142, 8vu7s907prbgr';
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
List the Pluggable databases exists in the Multitenant container database using "show pdbs" command, here in this example, I am going to drop PDB3 Pluggable Database.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB3 MOUNTED
To drop a Pluggable Database from your container database, you run the DROP PLUGGABLE DATABASE command being logged into the root container with SYSDBA privilege.
SQL> drop pluggable database pdb3 including datafiles;
Pluggable database dropped.
Note : There is another option to drop the Pluggable Database with KEEP DATAFILES clause - use this option if you want to preserve the data files for the PDB being dropped and later you have the luck to the point in time recovery of the dropped PDB since its associated backup files exists out there. Only temp files for the PDB will be deleted from OS file system since that would be no longer required in the incomplete recovery of that Pluggable Database.
From the Container database(CDB) alert log, you can see that all associated data files for the Pluggable Database(PDB) being dropped are deleted from the OS file system permanently.
Sun Aug 19 20:28:55 2018
Deleted file /u01/app/oracle/oradata/Win2Linux_data_D-CDB3_I-680903414_TS-USERS_FNO-9_0htafbrg.dbf
.
.
Deleted file /u01/app/oracle/oradata/Win2Linux_data_D-CDB3_I-680903414_TS-SYSAUX_FNO-8_0dtafbpb.dbf
Deleted file /u01/app/oracle/oradata/Win2Linux_data_D-CDB3_I-680903414_TS-SYSTEM_FNO-7_0ftafbqu.dbf
Completed: drop pluggable database pdb3 including datafiles
Sun Aug 19 20:29:52 2018
Here we can validate the Pluggable databases again using the SQL>show pdbs command and can see that PDB3 is dropped now.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
SQL>
root@rac1 mnt]# mount -t vmhgfs .host:/ /home/oracle
mount: unknown filesystem type 'vmhgfs'
[root@rac1 mnt]# /usr/bin/vmhgfs-fuse /mnt
[root@rac1 mnt]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.9G 0 4.9G 0% /dev
tmpfs 4.9G 100K 4.9G 1% /dev/shm
tmpfs 4.9G 9.1M 4.9G 1% /run
tmpfs 4.9G 0 4.9G 0% /sys/fs/cgroup
/dev/mapper/ol-root 12G 4.2G 7.5G 36% /
/dev/mapper/ol-tmp 4.9G 45M 4.9G 1% /tmp
/dev/mapper/ol-u01 30G 19G 12G 63% /u01
/dev/sda1 197M 173M 25M 88% /boot
tmpfs 1000M 8.0K 1000M 1% /run/user/1001
/dev/sr0 102M 102M 0 100% /run/media/oracle/VMware Tools
vmhgfs-fuse 460G 400G 61G 87% /mnt
[root@rac1 ~]# cd /mnt/
[root@rac1 mnt]# ls -ltr
total 12
drwxrwxrwx. 1 root root 4096 Jul 25 00:18 18c installation
drwxrwxrwx. 1 root root 8192 Jul 25 10:08 Database Products
[root@rac1 mnt]#
[oracle@rac1 oracle]$ pwd
/u01/app/oracle
[oracle@rac1 oracle]$ export ORACLE_HOME=/u01/app/oracle
[oracle@rac1 oracle]$ ./runInstaller