HANDLECOLLISIONS - NOHANDLECOLLISIONS
Create N number of Logical partition in Linux
Hi All,
With help of below script we can create multiple logical(extended)
portions
uses : Mk_partion.sh Disk name
Ex. Mk_partion.sh /dev/sdb
Param :
1."PARTITION_SIZE" -- Logical Portion
size
2."PARTITION_SIZE_P" --Primary Portion size
click Here to Download : Mk_partion.sh
#----------------------------Start
Mk_partion.sh-------------------------------------
#--
+----------------------------------------------------------------------------+
#--
|
By
OraVR
|
#--
|
info@gmail.com
|
#--
|
www.oravr.com
|
#--
|----------------------------------------------------------------------------|
#--
|
|
#--
|----------------------------------------------------------------------------|
#-- | DATABASE :
Oracle
|
#-- | FILE :
Mk_partion.sh
|
#-- | CLASS :
Storage
|
#-- | PURPOSE : Create Multiple logical
disk
|
#-- | NOTE : As with any code, ensure to test this
script in a development |
#-- |
environment before attempting to run it in
production. |
#--
+----------------------------------------------------------------------------+
#!/bin/bash
if [ $# -eq 0 ]
then
echo "input the device"
exit
fi
NUM_PARTITIONS=50
PARTITION_SIZE="+4096M"
PARTITION_SIZE_P="+100M"
SED_STRING="o"
TAIL="p
w
q
"
NEW_LINE="
"
LETTER_n="n"
EXTENDED_PART_NUM=4
TGTDEV=$1
SED_STRING="$SED_STRING$NEW_LINE"
for i in $(seq $NUM_PARTITIONS)
do
if [ $i -lt $EXTENDED_PART_NUM ]
then
SED_STRING="$SED_STRING$LETTER_n$NEW_LINE$NEW_LINE$NEW_LINE$NEW_LINE$PARTITION_SIZE_P$NEW_LINE"
fi
if [ $i -eq $EXTENDED_PART_NUM ]
then
SED_STRING="$SED_STRING$LETTER_n$NEW_LINE$NEW_LINE$NEW_LINE$NEW_LINE"
SED_STRING="$SED_STRING$LETTER_n$NEW_LINE$NEW_LINE$PARTITION_SIZE$NEW_LINE"
fi
if [ $i -gt $EXTENDED_PART_NUM ]
then
SED_STRING="$SED_STRING$LETTER_n$NEW_LINE$NEW_LINE$PARTITION_SIZE$NEW_LINE"
fi
done
SED_STRING="$SED_STRING$TAIL"
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk ${TGTDEV}
$SED_STRING
EOF
########## Remove PARTITION if anything goes wrong
#########################################
######dd if=/dev/zero of=/dev/sda bs=512 count=1 conv=notrunc######
#---------------------------- End
Mk_partion.sh-------------------------------------
Enable DDL Logging
Enable DDL Logging
One can monitor or audit all DB changes by viewing log file.
One can set enable_ddl_logging=true to enable DDL logging.
Oracle will start recording all DDL statements in log.xml file. This file has the same format and basic behavior as the alert log, but it only contains the DDL statements.
The DDL log file is created in $ADR_HOME/log/ddl directory; it contains DDL statements that are extracted from alertl log file.
Log file Path
$ADR_BASE/diag/rdbms/{DB-name}/{SID}/log/ddl/log.xml
NOTE:- Oracle license "Oracle Change Management Pack" is require to use this feature.
Parameter enable_ddl_logging is licensed as part of the Change Management Pack.
Following DDL statements are written to the log:
• ALTER/CREATE/DROP/TRUNCATE CLUSTER
• ALTER/CREATE/DROP FUNCTION
• ALTER/CREATE/DROP INDEX
• ALTER/CREATE/DROP OUTLINE
• ALTER/CREATE/DROP PACKAGE
• ALTER/CREATE/DROP PACKAGE BODY
• ALTER/CREATE/DROP PROCEDURE
• ALTER/CREATE/DROP PROFILE
• ALTER/CREATE/DROP SEQUENCE
• CREATE/DROP SYNONYM
• ALTER/CREATE/DROP/RENAME/TRUNCATE TABLE
• ALTER/CREATE/DROP TRIGGER
• ALTER/CREATE/DROP TYPE
• ALTER/CREATE/DROP TYPE BODY
• DROP USER
• ALTER/CREATE/DROP VIEW
Following is the example of DDL logging,
VRTEST$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Feb 11 04:41:39 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
VB_SQL>
VB_SQL> show parameter enable_ddl_logging
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
enable_ddl_logging boolean FALSE
VB_SQL> alter system set enable_ddl_logging=true;
System altered.
VB_SQL>
VB_SQL> show parameter enable_ddl_logging;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
enable_ddl_logging boolean TRUE
VB_SQL> conn VB/VB
Connected.
VB_SQL>
VB_SQL> create table vb_ddltest (id number, name varchar2(50));
Table created.
VB_SQL>
VB_SQL> alter table vb_ddltest add ( address varchar2(100));
Table altered.
VB_SQL>
VB_SQL> insert into vb_ddltest values (1,'CBT','XYZ');
1 row created.
VB_SQL>
VB_SQL> commit;
Commit complete.
VB_SQL> drop table vb_ddltest;
Table dropped.
VB_SQL>
Check the log file for all DDL commands that was run by user.
VRTEST$ pwd
"/opt/oracle/app/orcl/diag/rdbms/VRTEST/VRTEST/log/ddl"
VRTEST$ cat log.xml
msg_id='opiexe:4383:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='OraLinuxNode' host_addr='10.184.150.107'
version='1'>
create table vb_ddltest (id number, name varchar2(50))
msg_id='opiexe:4383:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='OraLinuxNode' host_addr='10.184.150.107'>
alter table vb_ddltest add ( address varchar2(100))
msg_id='opiexe:4383:2946163730' type='UNKNOWN' group='diag_adl'
level='16' host_id='OraLinuxNode' host_addr='10.184.150.107'>
drop table vb_ddltest
VRTEST$
If you want to see clear and readable DDL log file, Just invoke ADRCI utility and issue show log command as shown below,
VRTEST$ adrci
ADRCI: Release 19.0.0.0.0 - Production on Tue Feb 11 04:44:53 2020
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
ADR base = "/opt/oracle/app/orcl"
ADR base = "/mnt/Oracle"
adrci> show log -l ddl
ADR Home = /opt/oracle/app/orcl/diag/rdbms/VRTEST/VRTEST:
*************************************************************************
Output the results to file: /tmp/utsout_19321_13991_1.ado
adrci>
When you issue the command "show log", this will open the log.xml file in edtor (i.e. vi in linux/unix) and show the contents, in following format :
2020-02-11 12:23:22.395000 +05:30
create table vb_ddltest (id number, name varchar2(50))
2020-02-11 12:24:05.301000 +05:30
alter table vb_ddltest add ( address varchar2(100))
2020-02-11 12:25:14.003000 +05:30
drop table vb_ddltest
2020-02-11 12:30:33.272000 +05:30
truncate table wri$_adv_addm_pdbs
Also you can see the debug log using adrci show log command i.e. show log -l debug.
SQL Query Parsing
Patches CPU/PSU/SPU
CPU, PSU, SPU - Oracle Critical Patch Update Terminology Update
Critical Patch Update (CPU) now refers to the overall release of security fixes each quarter rather than the cumulative database security patch for the quarter. Think of the CPU as the overarching quarterly release and not as a single patch.
Patch Set Updates (PSU) are the same cumulative patches that include both the security fixes and priority fixes. The key with PSUs is they are minor version upgrades (e.g., 11.2.0.1.1 to 11.2.0.1.2). Once a PSU is applied, only PSUs can be applied in future quarters until the database is upgraded to a new base version.
Security Patch Update (SPU) terminology is introduced in the October 2012 Critical Patch Update as the term for the quarterly security patch. SPU patches are the same as previous CPU patches, just a new name. For the database, SPUs can not be applied once PSUs have been applied until the database is upgraded to a new base version.
Bundle Patches are the quarterly patches for Windows and Exadata which include both the quarterly security patches as well as recommended fixes.
