Posts

Showing posts from March, 2022

UNDO Tablespace

The undo tablespace, has undo segments. The each undo segment is composed by undo extents. When transactions hit a database and they need undo space the allocation happens in the following sequence: 1. Allocate an extent in an undo segment which has no active transaction. Oracle tries to distribute transactions over all undo segments. 2. If no undo segment found then oracle tries to online an off-line undo segment and use it. 3. If no undo segments to online, then we create a new undo segment and use it. 4. If space does not permit creation of undo segment, then we try to reuse an expired extent from the existing undo segments. For a running transaction associated with undo segment/ extent, if it needs more undo space then: 1. If the current extent has more free blocks then use the next free block that is all ready allocated to the extent. 2. If the current extent does not have free blocks and if the next extent of the segment has expired then wrap in the the next extent and return the...

Handy sqls for JDE CNC

 Find out all checked out objects using SQL ============================ select * from ol920.f9861 where sistce=3; Access To Environments ================== To find out what users or groups have access to a certain environment run the following SQL: select * from sy920.f0093 where llll='<enviornment>'; Package Build Count =============== How many packages of each type per environment did you build last year? Here is the SQL : select hhpkgname, hhpathcd, year(date(char(hhblddte+1900000))) as hhblddte from sy920.f96215 where hhpkgname not like 'JJ%' --remove the ESUs and hhdatp='CLIENT' --type of build and hhbldsts=50 --build completed successfully Changing Status of Package Using SQL ============================= Below is the SQL statement that I use to mark the package as not deployed if it shows deployed:- update sy920.f9603 set PHISPTF=0 where phpkgname="PACKAGENAME"; ?Important Tables used by Object Management Workbench (OMW) or Object Librari...

Allow Blank Lines In Your SQL Statements: SQLBLANKLINES

  use the following SQL*Plus statement:   SET SQLBLANKLINES ON This statement has two options to turn ON or OFF blank lines. If blank lines are turned on, then you are allowed to use blank lines within the lines of your SQL statement.   By default the blank lines are OFF, meaning it is not allowed to have blank lines within a SQL statement. Below is an example on the usage   SQL>show SQLBLANKLINES sqlblanklines   OFF   SQL> SET   SQLBLANKLINES   ON   SQL> select   count (*)   from   dba_users 2 3   where   username   like   'D%' ;      COUNT (*) ----------          11   SQL> SET   SQLBLANKLINES   OFF   SQL> select   count (*)   from   dba_users 2 3   where   username   like   'D%' ;   SP2-0734: unknown command beginning   "where user..."   - rest   of   line ig...

3 Datapump parameters that can help

  1) REMAP_TABLESPACE Of course we know what this parameter does. It is used on the import to remap the source tablespace to the target tablespace. Usually, I use it this way: REMAP_TABLESPACE=HRPRD_DATA1:HRTST_DATA, HRPRD_DATA2:HRTST_DATA In the example above, I am remaping 2 tablespaces to the same target tablespace. This is pretty easy and fast to write, but when you have 10 tablespaces that you want to remap to only one, it’s becoming more inconvenient. There is a better way that I discovered! The above remap, can be simplified to: REMAP_TABLESPACE=%:HRTST_DATA This means that I remap all the source tablespaces to HRTST_DATA. This is amazing, all in one line! 2) LOGTIME This parameter can be use for export or import datapump, and specifies that the messages that are displayed during the export or import be timestamped. The values for this parameter could be NONE (the default), STATUS, LOGFILE or ALL. I would use ALL for LOGTIME. If you are using older versions of Oracle, ie 11g...