Quantcast
Channel: Oracle for All
Viewing all 144 articles
Browse latest View live

Oracle Property Manager Tables and Views

$
0
0

Oracle Property Manager Tables:

TABLE NAME DESCRIPTION
PN_ACCOUNTING_EVENTS_ALL The accounting events table
PN_ADDRESSES_ALL Information on locations and service providers
PN_ADJUSTMENT_DETAILS Details of an adjustment.
PN_ADJUSTMENT_SUMMARIES Summary of Adjustement.
PN_AE_HEADERS_ALL The accounting headers table
PN_AE_LINES_ALL The accounting lines table
PN_COMPANIES_ALL Information pertaining to a  service provider
PN_COMPANY_SITES_ALL Site information of a service provider
PN_CONTACT_ASSIGN_HISTORY Track changes in contacts linked to the lease
PN_CONTACT_ASSIGNMENTS_ALL Llinks  locations or leases with the site of a service provider.
PN_CONTACTS_ALL Contact information identified at the site level of a service provider
PN_CURRENCIES Information about currency_code and conversion_type
PN_DISTRIBUTIONS_ALL The table stores distributions for a payment term
PN_DISTRIBUTIONS_HISTORY Distributions History Table.
PN_EMP_SPACE_ASSIGN_ITF PN_EMP_SPACE_ASSIGN_ITF Interface Table.
PN_INDEX_EXCLUDE_TERM_ALL This table has terms which have to excluded from the calculation of the Rent increase.
PN_INDEX_HISTORY_HEADERS PN_INDEX_HISTORY_HEADERS stores index information. Indexes help to account for inflation when calculating rent increases
PN_INDEX_HISTORY_LINES PN_INDEX_HISTORY_LINES stores all the relevant details associated with an Index type including index dates and index values.
PN_INDEX_LEASE_CONSTRAINTS_ALL PN_INDEX_LEASE_CONSTRAINTS_ALL stores the constraints that apply to the rent increase.
PN_INDEX_LEASE_PERIODS_ALL PN_INDEX_LEASE_PERIODS_ALL stores the relevant details associated with all the rent increase periods.
PN_INDEX_LEASE_TERMS_ALL This table stores the index payment terms.
PN_INDEX_LEASES_ALL PN_INDEX_LEASES_ALL stores all the rent increases associated with an existing lease.
PN_INSUR_REQUIRE_HISTORY Track changes to insurance details related to a lease
PN_INSURANCE_REQUIREMENTS_ALL Insurance details related to a lease.
PN_LANDLORD_SERVICE_HISTORY Track changes in the service provided by the landlord to the tenant
PN_LANDLORD_SERVICES_ALL Information about the services provided by the landlord to the tenant.
PN_LEASE_CHANGES_ALL Lease abstracted, amended and edited
PN_LEASE_DETAILS_ALL Lease dates and accounting information
PN_LEASE_DETAILS_HISTORY Track  changes to the lease details data elements
PN_LEASE_MILESTONES_ALL Information about important events in a lease
PN_LEASE_OPTIONS_ITF PN_LEASE_OPTIONS_ITF Interface Table.
PN_LEASE_TRANSACTIONS_ALL Transactions performed on a lease
PN_LEASES_ALL Lease information
PN_LOC_ACC_MAP_ALL Stores the information for mapping of expense accounts to the location.
PN_LOC_ACC_MAP_HDR_ALL Stores mapping accounts to location header information.
PN_LOCATION_FEATURES_ALL Information on  features available in a building
PN_LOCATION_PARKS Information on Regions and Office Parks
PN_LOCATIONS_ALL Space definition
PN_LOCATIONS_ITF Space definition data  to be imported or exported in and out of Oracle Property Manager
PN_MILESTONES_ITF PN_MILESTONES_ITF Interface Table.
PN_NOTE_DETAILS Multiple lines of  text associated with a note type.
PN_NOTE_HEADERS Type of note in a lease
PN_OPEX_AGREEMENTS_ALL This table stores method and overview information for operating expense agreements.
PN_OPEX_CRITICAL_DATES_ALL This table stores information on critical dates for operating expense agreements.
PN_OPEX_EST_PAYMENTS_ALL This table stores estimated payment information for operating expense agreements.
PN_OPEX_EXP_GRPS_ALL This table stores expense group information for operating expense agreements.
PN_OPEX_NOTES_ALL This table stores the information related to the ‘Notes’ section on various sub tabs in an Opex Agreement.
PN_OPEX_PRORAT_BASIS_DTLS_ALL This table stores pro rata basis information for operating expense agreeements.
PN_OPEX_RECON_ALL This table stores reconciliation overview information for operating expenses
PN_OPEX_RECON_CRDT_ALL This table stores information on critical dates for operating expense reconciliations
PN_OPEX_RECON_DETAILS_ALL This table stores reconciliation review information for operating expenses
PN_OPEX_RECON_EXP_GRP_ALL This table stores expense group information for operating expense reconciliations
PN_OPEX_RECON_PRTBS_ALL This table stores pro rata basis information for operating expense reconciliations
PN_OPTIONS_ALL Details of specified terms for a specific period in a lease contract
PN_OPTIONS_HISTORY Track  changes in option details related to a lease
PN_PAY_GROUP_BYS Stores Group By information.
PN_PAY_GROUP_RULES Stores grouping rules information.
PN_PAYMENT_ITEMS_ALL Payment and  billing items associated with a  payment or a billing schedule
PN_PAYMENT_ITEMS_EFC  Shadow table for PN_PAYMENT_ITEMS_ALL for supporting Euro functional currency
PN_PAYMENT_SCHEDULES_ALL Payment or billing schedules for both landlord and the tenant
PN_PAYMENT_TERMS_ALL Payment and billing terms defined in a lease
PN_PAYMENT_TERMS_EFC Shadow table for PN_PAYMENT_TERMS_ALL for supporting Euro functional currency.
PN_PAYMENT_TERMS_HISTORY Term History table.
PN_PHONES_ALL Telecommuting information to reach a  contact
PN_PROPERTIES_ALL  Stores the properties information.
PN_REC_AGR_LINABAT_ALL Recovery Abatement set up table
PN_REC_AGR_LINAREA_ALL Recovery Area set up table
PN_REC_AGR_LINCONST_ALL Recovery Constraint set up table
PN_REC_AGR_LINES_ALL Recovery Lines set up table
PN_REC_AGR_LINEXP_ALL Recovery Expense set up table
PN_REC_AGREEMENTS_ALL Recovery Agreement set up table
PN_REC_ARCL_ALL Stores area class header information.
PN_REC_ARCL_DTL_ALL Stores area class details summary header information
PN_REC_ARCL_DTLLN_ALL  Stores drilldown information associated with an area class detail
PN_REC_ARCL_EXC_ALL Stores area class exclusions information.
PN_REC_CALC_PERIODS_ALL Calculation Periods table
PN_REC_EXP_ITF Recovery Expense Interface Table.
PN_REC_EXP_LINE_ALL Stores the expense lines header information.
PN_REC_EXP_LINE_DTL_ALL Stores recovery expense lines and recovery expense line allocations information.
PN_REC_EXPCL_ALL Stores expense class setup information
PN_REC_EXPCL_DTL_ALL Stores expense class details header information.
PN_REC_EXPCL_DTLACC_ALL Stores drilldown information associated with an expense class line detail.
PN_REC_EXPCL_DTLLN_ALL Stores expense class line details associated with a summary header.
PN_REC_EXPCL_INC_ALL Stores expense class inclusions associated with an expense class
PN_REC_EXPCL_TYPE_ALL Stores expense class types associated with an expense class
PN_REC_LINBILL_ALL Calculation Periods table
PN_REC_PERIOD_BILL_ALL Billed terms for a period and line table
PN_REC_PERIOD_LINES_ALL Recovery lines and the amount calculated for a period
PN_RENT_INCREASE_DETAIL_ITF This table is used to create the RXi Rent Increase Detail Report
PN_RENT_INCREASE_DETAILACC_ITF This table is used to create the RXi Rent Increase Account Detail Report
PN_RENT_INCREASE_SUMMARY_ITF This table is used to create the RXi   Rent Increase Summary Report
PN_RENT_ROLL_LEASE_EXP_ITF PN_RENT_ROLL_LEASE_EXP_ITF Interface Table.
PN_RIGHTS_ALL Stores the rights information for leases
PN_RIGHTS_HISTORY Stores the rights history for lease amendments
PN_SET_MILESTONES Milestone setup  information to be associated with a milestone set
PN_SET_TYPES Type of milestones grouping
PN_SPACE_ALLOC_ITF No Longer Used
PN_SPACE_ALLOCATIONS_ALL Space assignment information for an employee,  contractor  or the cost center.
PN_SPACE_ASSIGN_CUST_ALL  Stores the customer space assignment information.
PN_SPACE_ASSIGN_EMP_ALL  Stores the employee space assignment information
PN_SPACE_ASSIGN_LEASE_ITF PN_SPACE_ASSIGN_LEASE_ITF Interface Table.
PN_SPACE_ASSIGN_LOC_ITF PN_SPACE_ASSIGN_LOC_ITF Interface Table.
PN_SPACE_UTIL_LEASE_ITF PN_SPACE_UTIL_LEASE_ITF Interface Table.
PN_SPACE_UTIL_LOC_ITF PN_SPACE_UTIL_LOC_ITF Interface Table.
PN_SYSTEM_SETUP_OPTIONS Property Manager system setup options for operating units.
PN_TENANCIES_ALL Information on leased or subleased locations
PN_TENANCIES_HISTORY Track changes in the leased or subleased locations
PN_TERM_TEMPLATES_ALL PN_TERM_TEMPLATES_ALL stores the payment/billing term details defaults.
PN_VAR_ABAT_DEFAULTS_ALL This table stores setup information for abatements and allowances.
PN_VAR_ABATEMENTS_ALL Stores recurring abatements information for an invoice.
PN_VAR_BKDT_DEFAULTS_ALL This table stores setup information for breakpoint details by organization.
PN_VAR_BKHD_DEFAULTS_ALL This table stores setup information for breakpoints by organization.
PN_VAR_BKPTS_DET_ALL Stores breakpoint related information to be used in the calculation of variable rent for each line item.
PN_VAR_BKPTS_HEAD_ALL Stores breakpoint related detail information to be used in the calculation of variable rent for each line item.
PN_VAR_CONSTR_DEFAULTS_ALL This table stores setup information for constraints by organization.
PN_VAR_CONSTR_TEMPLATES_ALL Constraints Templates
PN_VAR_CONSTRAINTS_ALL Stores constraints to be applied to a period for the calculation of variable rent.
PN_VAR_DEDUCT_ARCH_ALL This table stores deduction data that was modified during batch import.
PN_VAR_DEDUCTIONS_ALL Stores deductions to be applied to each line item for calculation of variable rent.
PN_VAR_GRP_DATES_ALL Stores critical dates related to the variable rent agreement generated by the periods generation program.
PN_VAR_LINE_DEFAULTS_ALL This table stores default line setup information for variable rent by organization.
PN_VAR_LINE_TEMPLATES_ALL This table stores line setup information for variable rent by organization.
PN_VAR_LINES_ALL Stores information related to line items associated within each period for a variable rent.
PN_VAR_PERIODS_ALL Stores information about periods generated by the periods generation program for the duration of  variable rent.
PN_VAR_RENT_DATES_ALL Stores GL Calendar to be used and variable agreement related date frequencies.
PN_VAR_RENT_INV_ALL Stores the calculated variable rent details for a period and for an invoice date.
PN_VAR_RENT_SUMM_ALL Stores the calculated variable rent for a line item for a group date.
PN_VAR_RENTS_ALL Stores variable rent agreement information.
PN_VAR_REPORT_DATES_ALL This table stores report dates of variable rent by group date.
PN_VAR_TEMPLATES_ALL This table stores templates containing default values for variable rent agreements.
PN_VAR_TRX_DETAILS_ALL This table stores information on variable rent records.
PN_VAR_TRX_HEADERS_ALL This table stores details of variable rent calculations
PN_VAR_VOL_ARCH_ALL This table stores volume data that was modified during batch import.
PN_VAR_VOL_HIST_ALL Stores volume history related to a line item.
PN_VOL_HIST_BATCH_ITF Interface table to contain batch information.
PN_VOL_HIST_LINES_ITF Interface table to contain batch lines information.

Oracle Property Manager Views:

VIEW NAME DESCRIPTION
PN_ACT_RENT_DETAILS_V View for viewing actual variable rent details by line item and group date.
PN_ADJUSTMENT_DETAILS_V Adjustment Details Form Views.
PN_AEL_BILL_GL_V  
PN_AEL_PAY_GL_V  
PN_BUILDINGS_V Form view used to view company information.
PN_COMPANIES_V  
PN_COMPANY_SITES_V  
PN_CONTACTS_V  
PN_CONTACT_ASSIGNMENTS_V  
PN_CONTACT_ASSIGN_HISTORY_V  
PN_DISTRIBUTIONS_HISTORY_V Distributions History Form View.
PN_DISTRIBUTIONS_V  
PN_EMPLOYEE_SPACE_INFO_V Employee and Space Asignment Information
PN_EXP_PAYMENT_ITEMS_V  
PN_FLOORS_V Public view used to view Location information.
PN_FOR_RENT_DETAILS_V View for viewing actual variable rent details by line item and group date.
PN_GL_PERIOD_V  
PN_INDEX_EXCLUDE_TERM_V  
PN_INDEX_HISTORY_HEADERS_V Form view based on table PN_INDEX_HISTORY_HEADERS_ALL
PN_INDEX_HISTORY_LINES_V Form view based on table PN_INDEX_HISTORY_LINES_ALL
PN_INDEX_LEASES_V Form view for table PN_INDEX_LEASES_ALL
PN_INDEX_LEASE_CONSTRAINTS_V Form view based on table PN_INDEX_LEASE_CONSTRAINTS_ALL
PN_INDEX_LEASE_PERIODS_V Form view based on PN_INDEX_LEASE_PERIODS_ALL
PN_INSURANCE_REQUIREMNTS_V  
PN_INSUR_REQUIRE_HISTORY_V  
PN_JE_CATEGORIES_V  
PN_LANDLORD_SERVICES_V FORM
PN_LANDLORD_SERVICE_HISTORY_V  
PN_LEASES_V  
PN_LEASE_CHANGES_V  
PN_LEASE_CONTACT_ASSIGN_V  
PN_LEASE_DETAILS_HISTORY_V  
PN_LEASE_DETAILS_V  
PN_LEASE_MILESTONES_V  
PN_LEASE_TRANSACTIONS_V  
PN_LOCATIONS_ITF_V  
PN_LOCATIONS_PUB_V Public view used to view location information.
PN_LOCATIONS_V This view is used as form view for the Locations form PNSULOCN.fmb used for defining space & its attributes
PN_LOCATION_CONTACT_ASSIGN_V  
PN_LOCATION_FEATURES_V  
PN_LOCATION_PARKS_VL  
PN_LOC_ACC_MAP_HDR_V Stores mapping accounts to location header information.
PN_LOC_ACC_MAP_V Stores the information for mapping of expense accounts to the location.
PN_NOTE_DETAILS_VL  
PN_NOTE_HEADERS_V  
PN_OFFICES_V Public view used to view Location information.
PN_OPTIONS_HISTORY_V  
PN_OPTIONS_V  
PN_PAYMENT_ITEMS_V  
PN_PAYMENT_SCHEDULES_V Form view used to input payment schedules information
PN_PAYMENT_TERMS_HISTORY_V Term History Form View.
PN_PAYMENT_TERMS_V Form view used to input payment terms information
PN_PAY_GROUP_BYS_V Stores Group By information.
PN_PAY_GROUP_RULES_V Stores grouping rules information.
PN_PBUILDING_V  
PN_PHONES_V  
PN_PLAND_V  
PN_PROPERTIES_V  
PN_RIGHTS_HISTORY_V  
PN_RIGHTS_V Form view used to input rights information
PN_SET_MILESTONES_VL This view is to be used as a base table for Milestones Types region in the Milestones_Notification Set form.
PN_SET_TYPES_VL  
PN_SPACE_ALLOCATIONS_V  
PN_SPACE_ASSIGN_CUST_PUB_V   Public view used to view customer assignment information
PN_SPACE_ASSIGN_CUST_V  
PN_SPACE_ASSIGN_EMP_PUB_V Public view used to view employee assignment information
PN_SPACE_ASSIGN_EMP_V  
PN_TENANCIES_HISTORY_V  
PN_TENANCIES_V  
PN_TERM_HISTORY_HEADER_V Term History Header Form View.
PN_TERM_TEMPLATES_V Form view used to enter/view term template information.
PN_TRX_LEASE_EXPENSE  
PN_TRX_LEASE_REVENUE  
PN_VAR_BKPTS_DET_V Form view used to input breakpoint detail
PN_VAR_BKPTS_HEAD_V Form view used to input breakpoint header information.
PN_VAR_CONSTRAINTS_V Form view used to input constraints related  information.
PN_VAR_DEDUCTIONS_V Form view used to input deductions related  information.
PN_VAR_LINES_DATES_V Form view for viewing variable rent line item details.
PN_VAR_LINES_V Form view used to input line item related information.
PN_VAR_PERIODS_DATES_V Form view for viewing variable rent period details.
PN_VAR_PERIODS_V Form view used to display generated periods for a variable rent agreement.
PN_VAR_RENTS_V Form view used to input variable rent agreement related information.
PN_VAR_RENT_ADJ_V Form view for viewing variable rent adjustment history details.
PN_VAR_RENT_DATES_V Form view for viewing variable rent dates details
PN_VAR_RENT_DETAILS_V Form view for viewing variable rent details by line item and group date.
PN_VAR_RENT_INV_V Form view used to view variable rent calculation details by period.
PN_VAR_RENT_SUMM_V Form view used to view variable rent calculation details by line item.
PN_VAR_TERMS_V Form view used to view abatement details for an invoice.
PN_VAR_VOL_HIST_V Form view used to input volume history related information.
PN_XLA_EXTRACT_HEADERS_V  
PN_XLA_EXTRACT_LINES_V  

 

The post Oracle Property Manager Tables and Views appeared first on Oracle for All.


Multiple Indexes in Oracle Database 12c

$
0
0

First you learn that is the big question, are you searching the term index what is it

What is index?

Indexes are optional structures that associated with tables and clusters.

Why use index?

Index allow SQL queries to execute more quickly against a table.

Index in manual helps that you can locate information faster data retrieve, if there were no index.

Oracle Database index provides a faster access path to table data.

Note

  1. Index apply and Create and recreate After Inserting Table Data, or already data exists in the table.
  2. Multiple indexes on the same column list a very bad idea.
  3. LONG and LONG RAW columns cannot be indexed.
  4. The Primary and unique keys automatically have indexes, but you might want to create an index on a foreign key.

Indexes in Oracle Database 12c

From an indexing perspective in oracle database 12c , one of the bigger ticket items introduced with in the new capability to create multiple indexes on the same column list.

The Oracle database 12c allows the multiple indexes on the same set of columns, provided only one index is visible and all indexes are different in some way.

Non-Partitioned Tables

The non-partitioned indexes, the optimizer does not consider any unusable indexes when creating an access plan for SELECT statements. The only exception is when an index is explicitly specified with the INDEX() hint.

Create the following table.

DROP TABLE test1 PURGE;

CREATE TABLE test1 (
  id            NUMBER,
  description   VARCHAR2(50),
  created_date  DATE
);

INSERT INTO test1 VALUES (1, 'test1 ONE', TO_DATE('01/07/2011', 'DD/MM/YYYY'));
INSERT INTO test1 VALUES (2, 'test1 TWO', TO_DATE('01/07/2012', 'DD/MM/YYYY'));
INSERT INTO test1 VALUES (3, 'test1 THREE', TO_DATE('01/07/2013', 'DD/MM/YYYY'));
COMMIT;

When we create the first index, it works as expected.

SQL> CREATE INDEX test1_idx1 ON test1(created_date) VISIBLE;

Index created.

If we attempt to create an invisible index on the same set of columns it fails because it has the same attributes are the existing index.
SQL> CREATE INDEX test1_idx2 ON test1(created_date) INVISIBLE;
                           *
ERROR at line 1:
ORA-01408: such column list already indexed

SQL>

If we alter something about it, like make it a bitmapped index, it works.

CREATE BITMAP INDEX test1_idx3 ON test1(created_date) INVISIBLE;

Index created.

SQL>

Partitioned Tables

Partitioned index where one or more of the partitions is unusable, the optimizer can use table expansion. With table expansion, the optimizer transforms the query into a UNION ALLstatement, with some sub queries accessing indexed partitions and other sub queries accessing partitions with unusable indexes

Create the following partitioned table.

DROP TABLE test1 PURGE;

CREATE TABLE test1 (
  id            NUMBER,
  description   VARCHAR2(50),
  created_date  DATE
)
PARTITION BY RANGE (created_date) (
  PARTITION part_2014 VALUES LESS THAN (TO_DATE('01/01/2011', 'DD/MM/YYYY')) TABLESPACE users,
  PARTITION part_2015 VALUES LESS THAN (TO_DATE('01/01/2012', 'DD/MM/YYYY')) TABLESPACE users,
  PARTITION part_2016 VALUES LESS THAN (TO_DATE('01/01/2013', 'DD/MM/YYYY')) TABLESPACE users
);

INSERT INTO test1 VALUES (1, 'test1 ONE', TO_DATE('01/07/2011', 'DD/MM/YYYY'));
INSERT INTO test1 VALUES (2, 'test1 TWO', TO_DATE('01/07/2012', 'DD/MM/YYYY'));
INSERT INTO test1 VALUES (3, 'test1 THREE', TO_DATE('01/07/2013', 'DD/MM/YYYY'));
COMMIT;

Create a global index.

CREATE INDEX test1_idx1 ON test1(created_date) GLOBAL VISIBLE;

Index created.

SQL>

Create some indexes with differing partitioning schemes.

CREATE INDEX test1_idx2 ON test1(created_date) GLOBAL
PARTITION BY RANGE (created_date) (
  PARTITION test1_p1 VALUES LESS THAN (TO_DATE('01/01/2012', 'DD/MM/YYYY')) TABLESPACE users,
  PARTITION test1_p2 VALUES LESS THAN (TO_DATE('01/01/2013', 'DD/MM/YYYY')) TABLESPACE users,
  PARTITION test1_p3 VALUES LESS THAN (MAXVALUE) TABLESPACE users
)
INVISIBLE;

Index created.

SQL>


CREATE INDEX test1_idx3 ON test1(created_date) LOCAL INVISIBLE;

Index created.

SQL>

Create a bitmapped index.

CREATE BITMAP INDEX test1_idx4 ON test1(created_date) LOCAL INVISIBLE;

Index created.

SQL>

Why we are using Multiple Indexes

Invisible indexes are still maintained, so having multiple indexes on the same set of columns allows you to quickly switch between them, making testing the impact of various indexes much quicker. Remember, there is an impact on DML performance of having too many indexes on a table, so this should be a short term situation.

The following example used the partitioned table and the associated indexes created in the previous section.

-- Check visibility of indexes.
COLUMN index_name FORMAT A10
COLUMN index_type FORMAT A10
COLUMN partitioned FORMAT A12
COLUMN locality FORMAT A8
COLUMN visibility FORMAT A10

SELECT a.index_name,
       a.index_type,
       a.partitioned,
       b.partitioning_type,
       b.locality,
       a.visibility
FROM   user_indexes a
       LEFT OUTER JOIN user_part_indexes b ON a.index_name = b.index_name
ORDER BY index_name;

INDEX_NAME INDEX_TYPE PARTITIONED  PARTITION LOCALITY   VISIBILITY
---------- ---------- ------------ --------- ---------- ----------
test1_IDX1    NORMAL     NO                                VISIBLE
test1_IDX2    NORMAL     YES          RANGE     GLOBAL     INVISIBLE
test1_IDX3    NORMAL     YES          RANGE     LOCAL      INVISIBLE
test1_IDX4    BITMAP     YES          RANGE     LOCAL      INVISIBLE

SQL>


-- Test the index usage.
SET AUTOTRACE TRACE EXPLAIN

SELECT *
FROM   test1
WHERE created_date = TO_DATE('01/07/2014', 'DD/MM/YYYY');

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation                                  | Name    | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                           |         |     1 |    49 |     1   (0)| 00:00:01 |       |       |
|   1 |  TABLE ACCESS BY GLOBAL INDEX ROWID BATCHED| test1      |     1 |    49 |     1   (0)| 00:00:01 |     1 |     1 |
|*  2 |   INDEX RANGE SCAN                         | test1_IDX1 |     1 |       |     1   (0)| 00:00:01 |       |       |
----------------------------------------------------------------------------------------------------------------------

SET AUTOTRACE OFF

Switch the index visibility and test again.

-- Switch indexes.
ALTER INDEX test1_idx1 INVISIBLE;
ALTER INDEX test1_idx2 VISIBLE;


-- Check visibility of indexes.
SELECT a.index_name,
       a.index_type,
       a.partitioned,
       b.partitioning_type,
       b.locality,
       a.visibility
FROM   user_indexes a
       LEFT OUTER JOIN user_part_indexes b ON a.index_name = b.index_name
ORDER BY index_name;

INDEX_NAME INDEX_TYPE PARTITIONED  PARTITION LOCALITY   VISIBILITY
---------- ---------- ------------ --------- ---------- ----------
test1_IDX1    NORMAL     NO                                INVISIBLE
test1_IDX2    NORMAL     YES          RANGE     GLOBAL     VISIBLE
test1_IDX3    NORMAL     YES          RANGE     LOCAL      INVISIBLE
test1_IDX4    BITMAP     YES          RANGE     LOCAL      INVISIBLE

SQL>


-- Test the index usage.
SET AUTOTRACE TRACE EXPLAIN

SELECT *
FROM   test1
WHERE created_date = TO_DATE('01/07/2012', 'DD/MM/YYYY');

-----------------------------------------------------------------------------------------------------------------------
| Id  | Operation                                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
-----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                            |         |     1 |    49 |     1   (0)| 00:00:01 |       |       |
|   1 |  PARTITION RANGE SINGLE                     |         |     1 |    49 |     1   (0)| 00:00:01 |     1 |     1 |
|   2 |   TABLE ACCESS BY GLOBAL INDEX ROWID BATCHED| test1      |     1 |    49 |     1   (0)| 00:00:01 |     1 |     1 |
|*  3 |    INDEX RANGE SCAN                         | test1_IDX2 |     1 |       |     1   (0)| 00:00:01 |     1 |     1 |
-----------------------------------------------------------------------------------------------------------------------

SET AUTOTRACE OFF

Switch the index visibility once again and test.

-- Switch indexes.
ALTER INDEX test1_idx2 INVISIBLE;
ALTER INDEX test1_idx3 VISIBLE;


-- Check visibility of indexes.
SELECT a.index_name,
       a.index_type,
       a.partitioned,
       b.partitioning_type,
       b.locality,
       a.visibility
FROM   user_indexes a
       LEFT OUTER JOIN user_part_indexes b ON a.index_name = b.index_name
ORDER BY index_name;

INDEX_NAME INDEX_TYPE PARTITIONED  PARTITION LOCALITY   VISIBILITY
---------- ---------- ------------ --------- ---------- ----------
test1_IDX1    NORMAL     NO                                INVISIBLE
test1_IDX2    NORMAL     YES          RANGE     GLOBAL     INVISIBLE
test1_IDX3    NORMAL     YES          RANGE     LOCAL      VISIBLE
test1_IDX4    BITMAP     YES          RANGE     LOCAL      INVISIBLE

SQL>


-- Test the index usage.
SET AUTOTRACE TRACE EXPLAIN

SELECT *
FROM   test1
WHERE created_date = TO_DATE('01/07/2012', 'DD/MM/YYYY');

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation                                  | Name    | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                           |         |     1 |    49 |     1   (0)| 00:00:01 |       |       |
|   1 |  PARTITION RANGE SINGLE                    |         |     1 |    49 |     1   (0)| 00:00:01 |     1 |     1 |
|   2 |   TABLE ACCESS BY LOCAL INDEX ROWID BATCHED| test1      |     1 |    49 |     1   (0)| 00:00:01 |     1 |     1 |
|*  3 |    INDEX RANGE SCAN                        | test1_IDX3 |     1 |       |     1   (0)| 00:00:01 |     1 |     1 |
----------------------------------------------------------------------------------------------------------------------

SET AUTOTRACE OFF

Switch the index visibility once again and test.

-- Switch indexes.
ALTER INDEX test1_idx3 INVISIBLE;
ALTER INDEX test1_idx4 VISIBLE;


-- Check visibility of indexes.
SELECT a.index_name,
       a.index_type,
       a.partitioned,
       b.partitioning_type,
       b.locality,
       a.visibility
FROM   user_indexes a
       LEFT OUTER JOIN user_part_indexes b ON a.index_name = b.index_name
ORDER BY index_name;

INDEX_NAME INDEX_TYPE PARTITIONED  PARTITION LOCALITY   VISIBILITY
---------- ---------- ------------ --------- ---------- ----------
test1_IDX1    NORMAL     NO                                INVISIBLE
test1_IDX2    NORMAL     YES          RANGE     GLOBAL     INVISIBLE
test1_IDX3    NORMAL     YES          RANGE     LOCAL      INVISIBLE
test1_IDX4    BITMAP     YES          RANGE     LOCAL      VISIBLE

SQL>


-- Test the index usage.
SET AUTOTRACE TRACE EXPLAIN

SELECT *
FROM   test1
WHERE created_date = TO_DATE('01/07/2012', 'DD/MM/YYYY');

----------------------------------------------------------------------------------------------------------------------
| Id  | Operation                                  | Name    | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
----------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                           |         |     1 |    49 |    15   (0)| 00:00:01 |       |       |
|   1 |  PARTITION RANGE SINGLE                    |         |     1 |    49 |    15   (0)| 00:00:01 |     1 |     1 |
|   2 |   TABLE ACCESS BY LOCAL INDEX ROWID BATCHED| test1      |     1 |    49 |    15   (0)| 00:00:01 |     1 |     1 |
|   3 |    BITMAP CONVERSION TO ROWIDS             |         |       |       |            |          |       |       |
|*  4 |     BITMAP INDEX SINGLE VALUE              | test1_IDX4 |       |       |            |          |     1 |     1 |
----------------------------------------------------------------------------------------------------------------------

SET AUTOTRACE OFF    detail information of index here

Indexes Data Dictionary Views

The following views display information about indexes:

View Description
DBA_INDEXESALL_INDEXES

USER_INDEXES

DBA view describes indexes on all tables in the database. ALL view describes indexes on all tables accessible to the user. USER view is restricted to indexes owned by the user. Some columns in these views contain statistics that are generated by the DBMS_STATS package orANALYZE statement.
DBA_IND_COLUMNSALL_IND_COLUMNS

USER_IND_COLUMNS

These views describe the columns of indexes on tables. Some columns in these views contain statistics that are generated by the DBMS_STATS package or ANALYZE statement.
DBA_IND_PARTITIONSALL_IND_PARTITIONS

USER_IND_PARTITIONS

These views display, for each index partition, the partition-level partitioning information, the storage parameters for the partition, and various partition statistics that are generated by theDBMS_STATS package.
DBA_IND_EXPRESSIONSALL_IND_EXPRESSIONS

USER_IND_EXPRESSIONS

These views describe the expressions of function-based indexes on tables.
DBA_IND_STATISTICSALL_IND_STATISTICS

USER_IND_STATISTICS

These views contain optimizer statistics for indexes.
INDEX_STATS Stores information from the last ANALYZE INDEX...VALIDATE STRUCTURE statement.
INDEX_HISTOGRAM Stores information from the last ANALYZE INDEX...VALIDATE STRUCTURE statement.
USER_OBJECT_USAGE Contains index usage information produced by the ALTER INDEX...MONITORING USAGEfunctionality.

The post Multiple Indexes in Oracle Database 12c appeared first on Oracle for All.

Most important table for DBA

$
0
0

Tables Data Dictionary Views

The following views allow you to access information about tables.

 
TABLES Description
DBA TABLES

DBA_TABLESALL_TABLES

USER_TABLES

DBA view describes all relational tables in the database. ALL view describes all tables accessible to the user. USER view is restricted to tables owned by the user. Some columns in these views contain statistics that are generated by the DBMS_STATS package or ANALYZE statement.
DBA_TAB_COLUMNSALL_TAB_COLUMNS

USER_TAB_COLUMNS

These views describe the columns of tables, views, and clusters in the database. Some columns in these views contain statistics that are generated by the DBMS_STATS package or ANALYZEstatement.
DBA_ALL_TABLESALL_ALL_TABLES

USER_ALL_TABLES

These views describe all relational and object tables in the database. Object tables are not specifically discussed in this book.
DBA_TAB_COMMENTSALL_TAB_COMMENTS

USER_TAB_COMMENTS

These views display comments for tables and views. Comments are entered using the COMMENTstatement.
DBA_COL_COMMENTSALL_COL_COMMENTS

USER_COL_COMMENTS

These views display comments for table and view columns. Comments are entered using theCOMMENT statement.
DBA_EXTERNAL_TABLESALL_EXTERNAL_TABLES

USER_EXTERNAL_TABLES

These views list the specific attributes of external tables in the database.
DBA_EXTERNAL_LOCATIONSALL_EXTERNAL_LOCATIONS

USER_EXTERNAL_LOCATIONS

These views list the data sources for external tables.
DBA_TAB_HISTOGRAMSALL_TAB_HISTOGRAMS

USER_TAB_HISTOGRAMS

These views describe histograms on tables and views.
DBA_TAB_STATISTICSALL_TAB_STATISTICS

USER_TAB_STATISTICS

These views contain optimizer statistics for tables.
DBA_TAB_COL_STATISTICSALL_TAB_COL_STATISTICS

USER_TAB_COL_STATISTICS

These views provide column statistics and histogram information extracted from the relatedTAB_COLUMNS views.
DBA_TAB_MODIFICATIONSALL_TAB_MODIFICATIONS

USER_TAB_MODIFICATIONS

These views describe tables that have been modified since the last time table statistics were gathered on them. They are not populated immediately, but after a time lapse (usually 3 hours).
DBA_ENCRYPTED_COLUMNSUSER_ENCRYPTED_COLUMNS

ALL_ENCRYPTED_COLUMNS

These views list table columns that are encrypted, and for each column, lists the encryption algorithm in use.
DBA_UNUSED_COL_TABSALL_UNUSED_COL_TABS

USER_UNUSED_COL_TABS

These views list tables with unused columns, as marked by the ALTER TABLE ... SET UNUSEDstatement.
DBA_PARTIAL_DROP_TABSALL_PARTIAL_DROP_TABS

USER_PARTIAL_DROP_TABS

These views list tables that have partially completed DROP COLUMN operations. These operations could be incomplete because the operation was interrupted by the user or a system failure.

Example: Displaying Column Information

Column information, such as name, datatype, length, precision, scale, and default data values can be listed using one of the views ending with the _COLUMNS suffix. For example, the following query lists all of the default column values for the emp and dept tables:

SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, DATA_LENGTH, LAST_ANALYZED
    FROM DBA_TAB_COLUMNS
    WHERE OWNER = 'HR'
    ORDER BY TABLE_NAME;
    

The following is the output from the query:

TABLE_NAME           COLUMN_NAME          DATA_TYPE   DATA_LENGTH LAST_ANALYZED
-------------------- -------------------- ---------- ------------ -------------
COUNTRIES            COUNTRY_ID           CHAR                  2 05-FEB-03
COUNTRIES            COUNTRY_NAME         VARCHAR2             40 05-FEB-03
COUNTRIES            REGION_ID            NUMBER               22 05-FEB-03
DEPARTMENTS          DEPARTMENT_ID        NUMBER               22 05-FEB-03
DEPARTMENTS          DEPARTMENT_NAME      VARCHAR2             30 05-FEB-03
DEPARTMENTS          MANAGER_ID           NUMBER               22 05-FEB-03
DEPARTMENTS          LOCATION_ID          NUMBER               22 05-FEB-03
EMPLOYEES            EMPLOYEE_ID          NUMBER               22 05-FEB-03
EMPLOYEES            FIRST_NAME           VARCHAR2             20 05-FEB-03
EMPLOYEES            LAST_NAME            VARCHAR2             25 05-FEB-03
EMPLOYEES            EMAIL                VARCHAR2             25 05-FEB-03
.
.
.
LOCATIONS            COUNTRY_ID           CHAR                  2 05-FEB-03
REGIONS              REGION_ID            NUMBER               22 05-FEB-03
REGIONS              REGION_NAME          VARCHAR2             25 05-FEB-03

 

The post Most important table for DBA appeared first on Oracle for All.

Indexes most important tables and views

$
0
0

Indexes are optional structures associated with tables and clusters that allow SQL queries to execute more quickly against a table. Just as the index in this manual helps you locate information faster than if there were no index, an Oracle Database index provides a faster access path to table data. You can use indexes without rewriting any queries. Your results are the same, but you see them more quickly.

View Description
DBA_INDEXESALL_INDEXES

USER_INDEXES

DBA view describes indexes on all tables in the database. ALL view describes indexes on all tables accessible to the user. USER view is restricted to indexes owned by the user. Some columns in these views contain statistics that are generated by the DBMS_STATS package orANALYZE statement.
DBA_IND_COLUMNSALL_IND_COLUMNS

USER_IND_COLUMNS

These views describe the columns of indexes on tables. Some columns in these views contain statistics that are generated by the DBMS_STATS package or ANALYZE statement.
DBA_IND_PARTITIONSALL_IND_PARTITIONS

USER_IND_PARTITIONS

These views display, for each index partition, the partition-level partitioning information, the storage parameters for the partition, and various partition statistics that are generated by theDBMS_STATS package.
DBA_IND_EXPRESSIONSALL_IND_EXPRESSIONS

USER_IND_EXPRESSIONS

These views describe the expressions of function-based indexes on tables.
DBA_IND_STATISTICSALL_IND_STATISTICS

USER_IND_STATISTICS

These views contain optimizer statistics for indexes.
INDEX_STATS Stores information from the last ANALYZE INDEX...VALIDATE STRUCTURE statement.
INDEX_HISTOGRAM Stores information from the last ANALYZE INDEX...VALIDATE STRUCTURE statement.
USER_OBJECT_USAGE Contains index usage information produced by the ALTER INDEX...MONITORING USAGEfunctionality.

The post Indexes most important tables and views appeared first on Oracle for All.

Viewing all 144 articles
Browse latest View live