Wednesday, January 28, 2015
Where Can Custom HTML Pages be Deployed in EPM 11.1.2.1?
Thursday, January 8, 2015
Oracle Database 12c New Features – Part I
12c new features article series, I shall be extensively exploring some of the very important new additions and enhancements introduced in the area of Database Administration, RMAN, High Availability and Performance Tuning.
Part I covers:
- Online migration of an active data file
- Online table partition or sub-partition migration
- Invisible column
- Multiple indexes on the same column
- DDL logging
- Temporary undo in- and- outs
- New backup user privilege
- How to execute SQL statement in RMAN
- Table level recovery in RMAN
- Restricting PGA size
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 READ ONLY mode, followed by data file offline action. In 12c R1, a data file can be renamed or moved online simply using the ALTER DATABASE MOVE DATAFILE SQL statement. While the data file is being transferred, the end user can perform queries, DML and DDL tasks. Additionally, data files can be migrated between storages e.g. from non-ASM to ASM and vice versa.
Rename a data file:
SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users01.dbf' TO '/u00/data/users_01.dbf';
Migrate a data file from non-ASM to ASM:
SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO '+DG_DATA';
Migrate a data file from one ASM disk group to another:
SQL> ALTER DATABASE MOVE DATAFILE '+DG_DATA/DBNAME/DATAFILE/users_01.dbf ' TO '+DG_DATA_02';
Overwrite the data file with the same name, if it exists at the new location:
SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO '/u00/data_new/users_01.dbf' REUSE;
Copy the file to a new location whilst retaining the old copy in the old location:
SQL> ALTER DATABASE MOVE DATAFILE '/u00/data/users_01.dbf' TO '/u00/data_new/users_01.dbf' KEEP;
You can monitor the progress while a data file being moved by querying the v$session_longops dynamic view. Additionally, you can also refer the alert.log of the database where Oracle writes the details about action being taken place.
2. Online migration of table partition or sub-partition
Migration of a table partition or sub-partition to a different tablespace no longer requires a complex procedure in Oracle 12c R1. In a similar way to how a heap (non-partition) table online migration was achieved in the previous releases, a table partition or sub-partition can be moved to a different tablespace online or offline. When an ONLINE clause is specified, all DML operations can be performed without any interruption on the partition|sub-partition which is involved in the procedure. In contrast, no DML operations are allowed if the partition|sub-partition is moved offline.
Here are some working examples:
SQL> ALTER TABLE table_name MOVE PARTITION|SUBPARTITION partition_name TO tablespace tablespace_name;
SQL> ALTER TABLE table_name MOVE PARTITION|SUBPARTITION partition_name TO tablespace tablespace_name UPDATE INDEXES ONLINE;
The first example is used to move a table partition|sub-partition to a new tablespace offline. The second example moves a table partition/sub-partitioning online maintaining any local/global indexes on the table. Additionally, no DML operation will get interrupted when ONLINE clause is mentioned.
Important notes:
- The UPDATE INDEXES clause will avoid any local/global indexes going unusable on the table.
- Table online migration restriction applies here too.
- There will be locking mechanism involved to complete the procedure, also it might leads to performance degradation and can generate huge redo, depending upon the size of the partition, sub-partition.
3. Invisible columns
In Oracle 11g R1, Oracle introduced a couple of good enhancements in the form of invisible indexes and virtual columns. Taking the legacy forward, invisible column concepts has been introduced in Oracle 12c R1. I still remember, in the previous releases, to hide important data –columns from being displayed in the generic queries– we used to create a view hiding the required information or apply some sort of security conditions.
In 12c R1, you can now have an invisible column in a table. When a column is defined as invisible, the column won’t appear in generic queries, unless the column is explicitly referred to in the SQL statement or condition, or DESCRIBED in the table definition. It is pretty easy to add or modify a column to be invisible and vice versa:
SQL> CREATE TABLE emp (eno number(6), ename name varchar2(40), sal number(9) INVISIBLE);
SQL> ALTER TABLE emp MODIFY (sal visible);
You must explicitly refer to the invisible column name with the INSERT statement to insert the database into invisible columns. A virtual column or partition column can be defined as invisible too. However, temporary tables, external tables and cluster tables won’t support invisible columns.
4. Multiple indexes on the same column
Pre Oracle 12c, you can’t create multiple indexes either on the same column or set of columns in any form. For example, if you have an index on column {a} or columns {a,b}, you can’t create another index on the same column or set of columns in the same order. In 12c, you can have multiple indexes on the same column or set of columns as long as the index type is different. However, only one type of index is usable/visible at a given time. In order to test the invisible indexes, you need to set the optimizer_use_use_invisible_indexes=true.
Here’s an the example:
SQL> CREATE INDEX emp_ind1 ON EMP(ENO,ENAME); SQL> CREATE BITMAP INDEX emp_ind2 ON EMP(ENO,ENAME) INVISIBLE;
5. DDL logging
There was no direction option available to log the DDL action in the previous releases. In 12cR1, you can now log the DDL action into xml and log files. This will be very useful to know when the drop or create command was executed and by who. The ENABLE_DDL_LOGGING initiation parameter must be configured in order to turn on this feature. The parameter can be set at the database or session levels. When this parameter is enabled, all DDL commands are logged in an xml and a log file under the $ORACLE_BASE/diag/rdbms/DBNAME/log|ddl location. An xml file contains information, such as DDL command, IP address, timestamp etc. This helps to identify when a user or table dropped or when a DDL statement is triggered.
To enable DDL logging
SQL> ALTER SYSTEM|SESSION SET ENABLE_DDL_LOGGING=TRUE;
The following DDL statements are likely to be recorded in the xml/log file:
- CREATE|ALTER|DROP|TRUNCATE TABLE
- DROP USER
- CREATE|ALTER|DROP PACKAGE|FUNCTION|VIEW|SYNONYM|SEQUENCE
6. Temporary Undo
Each Oracle database contains a set of system related tablespaces, such as, SYSTEM, SYSAUX, UNDO & TEMP, and each are used for different purposes within the Oracle database. Pre Oracle 12c R1, undo records generated by the temporary tables used to be stored in undo tablespace, much similar to a general/persistent table undo records. However, with the temporary undo feature in 12c R1, the temporary undo records can now be stored in a temporary table instead of stored in undo tablespace. The prime benefits of temporary undo includes: reduction in undo tablespace and less redo data generation as the information won’t be logged in redo logs. You have the flexibility to enable the temporary undo option either at session level or database level.
Enabling temporary undo
To be able to use the new feature, the following needs to be set:
- Compatibility parameter must be set to 12.0.0 or higher
- Enable TEMP_UNDO_ENABLED initialization parameter
- Since the temporary undo records now stored in a temp tablespace, you need to create the temporary tablespace with sufficient space
- For session level, you can use: ALTER SESSION SET TEMP_UNDO_ENABLE=TRUE;
Query temporary undo information
The dictionary views listed below are used to view/query the information/statistics about the temporary undo data:
- V$TEMPUNDOSTAT
- DBA_HIST_UNDOSTAT
- V$UNDOSTAT
To disable the feature, you simply need to set the following:
SQL> ALTER SYSTEM|SESSION SET TEMP_UNDO_ENABLED=FALSE;
7. Backup specific user privilege
In 11g R2, SYSASM privilege was introduced to perform ASM specific operations. Similarly, backup and recovery tasks specific privilege SYSBACKUP has been introduced in 12c to execute backup and recovery commands in Recovery Manager (RMAN). Therefore, you can create a local user in the database and grant the SYSBACKUP privilege to perform any backup and recovery related tasks in RMAN without being granting the SYSDBA privilege.
$ ./rman target "username/password as SYSBACKUP"
8. How to execute SQL statement in RMAN
In 12c, you can now execute any SQL and PL/SQL commands in RMAN without the need of a SQL prefix: you can execute any SQL and PLS/SQL commands directly from RMAN. How you can execute SQL statements in RMAN:
RMAN> SELECT username,machine FROM v$session; RMAN> ALTER TABLESPACE users ADD DATAFILE SIZE 121m;
9. Table or partition recovery in RMAN
Oracle database backups are mainly categorized into two types: logical and physical. Each backup type has its own pros and cons. In previous editions, it was not feasible to restore a table or partition using existing physical backups. In order to restore a particular object, you must have logical backup. With 12c R1, you can recover a particular table or partition to a point-in-time or SCN from RMAN backups in the event of a table drop or truncate.
When a table or partition recovery is initiated via RMAN, the following action is performed:
- Required backup sets are identified to recover the table/partition
- An auxiliary database will be configured to a point-in-time temporarily in the process of recovering the table/partition
- Required table/partitions will be then exported to a dumpfile using the data pumps
- Optionally, you can import the table/partitions in the source database
- Rename option while recovery
An example of a table point-in-time recovery via RMAN (ensure you already have a full database backup from earlier):
RMAN> connect target "username/password as SYSBACKUP"; RMAN> RECOVER TABLE username.tablename UNTIL TIME 'TIMESTAMP…' AUXILIARY DESTINATION '/u01/tablerecovery' DATAPUMP DESTINATION '/u01/dpump' DUMP FILE 'tablename.dmp' NOTABLEIMPORT -- this option avoids importing the table automatically. REMAP TABLE 'username.tablename': 'username.new_table_name'; -- can rename table with this option.
Important notes:
- Ensure sufficient free space available under /u01 filesystem for auxiliary database and also to keep the data pump file
- A full database backup must be exists, or at least the SYSTEM related tablespaces
The following limitations/restrictions are applied on table/partition recovery in RMAN:
- SYS user table/partition can’t be recovered
- Tables/partitions stored under SYSAUX and SYSTEM tablespaces can’t be recovered
- Recovery of a table is not possible when REMAP option used to recovery a table that contains NOT NULL constraints
10. Restricting PGA size
Pre Oracle 12c R1, there was no option to limit and control the PGA size. Although, you set a certain size toPGA_AGGREGATE_TARGET initialization parameter, Oracle could increase/reduce the size of the PGA dynamically based on the workload and requirements. In 12c, you can set a hard limit on PGA by enabling the automatic PGA management, which requires PGA_AGGREGATE_LIMIT parameter settings. Therefore, you can now set the hard limit on PGA by setting the new parameter to avoid excessive PGA usage.
SQL> ALTER SYSTEM SET PGA_AGGREGATE_LIMIT=2G; SQL> ALTER SYSTEM SET PGA_AGGREGATE_LIMIT=0; --disables the hard limit
Important notes:
When the current PGA limits exceeds, Oracle will automatically terminates/abort the session/process that holds the most untenable PGA memory.
Wednesday, January 7, 2015
R11i / R12.0 / R12.1 : Cloning Oracle Application with Rapid Clone - Database (9i/10g/11g) Using Hot Backup on Open Database
APPLIES TO:
Oracle Applications Manager - Version 11.5.10.0 to 12.1.3 [Release 11.5.10 to 12.1]
Information in this document applies to any platform.
GOAL
This purpose of this article is to help to duplicate/clone the Active/Open database to another machine.
NOTE: This is NOT A SUPPORTED PROCESS, but is available for reference as needed.
SOLUTION
You need to follow the "pre-requisite" and "preparation" steps from section 1 and 2 of the cloning note applicable to your EBS Version:
Release 11i : Note 230672.1 - 'Cloning Oracle Applications Release 11i with Rapid Clone'
Release 12 : Note 406982.1 - 'Cloning Oracle Applications Release 12 with Rapid Clone'
This Note helps you to implement the steps mentioned in "Appendix B: Recreating database control files manually in Rapid Clone" as per above Clone Note.
Step 1: Ensure adpreclone.pl has been run
Step 2: Obtain a trace file script to recreate the controlfile. On the source database issue the following
command:
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
The trace file script will be put into the user_dump_dest directory. The name of the trace file script will be something like PROD_ora_12345.trc.
Compare the date and time of the new trace file script to the time in which you entered the ALTER DATABASE BACKUP CONTROLFILE TO TRACE command.
This will ensure you will be using the most recent trace file script, the one you created in this step
Step 3: In the create controlfile script just created in step 2 change:
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS
to:
CREATE CONTROLFILE DATABASE "PROD" RESETLOGS ARCHIVELOG
If you want to change the Database Name , You need to use the clause SET DATABASE
CREATE CONTROLFILE SET DATABASE "newdbname" RESETLOGS NOARCHIVELOG
You must specify RESETLOGS.
The ARCHIVELOG mode may be changed to NOARCHIVELOG if you wish to run the copied database in noarchive log mode. Change all directories in the create controlfile clause to point to the correct directories for the new target database, if necessary.
Leave "only" the CREATE CONTROLFILE clause. The other statements, like the recover command, will be done manually. Be sure you also remove the STARTUP NOMOUNT command.
Note: Please ensure that there is no new datafile/tablespace added to Database after you generate controlfile script as above
Step 4: On the source database make an online copy of all datafiles using:
SQL> ALTER TABLESPACE
Copy all datafiles within tablespace
On Unix systems, this can be done with the cp command.
Then do:
SQL> ALTER TABLESPACE
Do NOT copy the controlfiles and redo log files as they will be recreated. You must copy the datafiles only after the ALTER .. BEGIN BACKUP command has been executed, otherwise the datafiles may be corrupted.
The names of the datafiles and tablespaces to which the datafiles belong can be obtained using the following command:
SQL> SELECT FILE_NAME, TABLESPACE_NAME FROM DBA_DATA_FILES;
Note: Instead of performing step 4 and step 5 to create a new online backup, you may instead use a previously taken online backup of your database.If you choose to use a previous online backup be sure to copy the required archived redo logs taken with the the previous online backup.
Step 5: After all datafiles have been copied and the tablespaces taken out of backup mode issue the following command:
SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;
You will need all of the archivelog files from the start of datafile copy commands including the one just created with the command ALTER SYSTEM ARCHIVE LOG CURRENT.
Step 6: Copy the database (DBF) files,controlfile script and archive log files from the source to the target
system
Step 7: So, As mentioned in 230672.1 (Appendix B), Replace section 2.2a (Configure the target system database server) with the following steps:
Execute the following commands to configure the target system. You will be prompted for the target system specific values (SID, Paths, Ports, etc)
Log on to the target system as the ORACLE user
Configure the
cd
perl adcfgclone.pl dbTechStack
Step 7: On the target system issue STARTUP NOMOUNT command. For example:
SQL> startup nomount pfile=initTEST.ora
Step 8: Run the prepared script created in step 3 to create the new controlfile. For example:
SQL> @PROD_ora_12345.trc
Step 9: Issue the command:
SQL> RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE
You will be prompted to apply all of the archived redo logs from the source database including
the last archive redo log file created with the ALTER DATABASE ARCHIVE LOG CURRENT
command from step 5.
After applying all of these archive log files issue the CANCEL command.
Step 10: Open the database with resetlogs:
SQL>ALTER DATABASE OPEN RESETLOGS
At this point the target database will have been successfully cloned and opened.
Step 11: Create Temporary Tablespace if not created in Source, else you shall add Temporary tablespace
You can check if tablespace TEMP has tempfiles or datafiles using the following SQL:
SQL> SELECT FILE_NAME,TABLESPACE_NAME,STATUS,AUTOEXTENSIBLE from DBA_TEMP_FILES where TABLESPACE_NAME like 'TEMP';
SQL> SELECT FILE_NAME,TABLESPACE_NAME, STATUS,AUTOEXTENSIBLE FROM DBA_DATA_FILES WHERE TABLESPACE_NAME LIKE 'TEMP';
If Temporary Tablespace is not created from above query,
SQL> create temporary tablespace temp add tempfile 'xxxx.dbf' size xx
Or
SQL> alter tablespace TEMP add tempfile 'xxxx.dbf' size xx
Step 12: Run the library update script against the database
cd
sqlplus "/ as sysdba" @adupdlib.sql
where
not required for Windows.
Step 13: Configure the target database (the database must be open)
cd
perl adcfgclone.pl dbconfig
where target context file is:
Finally, refer back to cloning notes and the following sections:
Copy the Application Tier File System
Configure the Target System Application Tier Server Nodes
Finishing Tasks
Cannot Copy a File Using cp on OCFS While the Database on RH3
APPLIES TO:Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 9.2.0.4Red Hat Enterprise Linux Advanced Server x86-64 (AMD Opetron Architecture) Red Hat Enterprise Linux Advanced Server Check for relevance on 29-Sep-2007 SYMPTOMSYou have followed the below note.Note:235113.1 Cannot Copy a File Using cp on OCFS While the Database is Running But while installing fileutils-4.1-4.2.i386.rpm. You receive following errors. error: Failed dependencies: sh-utils is needed by (installed) krb5-libs-1.2.7-19 sh-utils is needed by (installed) modutils-2.4.25-9.EL sh-utils is needed by (installed) initscripts-7.31.6.EL-1 . . . CAUSErpm detects conflict with other packages while installing fileutils package.SOLUTIONIn place of using fileutils-4.1-4.2.i386.rpm. Use coreutils-X.X.X-XX.i386.rpm package.where X.X.X-XX is the latest available package. It can be download from below URL. http://oss.oracle.com/projects/ocfs/files/supported/RedHat/RHAS3/ To Install this package use the command # rpm -Uvh coreutils-4.5.3-33.i386.rpm Preparing... ########################################### [100%] 1:coreutils ########################################### [100%] To copy the file from OCFS partition use following example. $cp --o_direct /ocfs/users.dbf /tmp/backup/users.dbf $dd o_direct=yes if=/ocfs/users.dbf of=/tmp/backup/users.dbf And dont forget to put the tablespace in the "begin backup" mode before copying SQL> alter tablespace USERS begin backup; |
Thursday, December 18, 2014
How to save your HFM Consolidation History
When task auditing is enabled, Hyperion Financial Management will store records of tasks in the _TASK_AUDIT table in the configured relational database. This table grows quickly and is often purged periodically by administrators or automated processes. In order to track consolidation history and more importantly, the duration of these consolidations, you will need to capture these records before they are purged.
One method of capturing this data is to export it prior to truncating the table via the HFM application. This is suitable for an environment where you are unable to access the back end database tables… like most environments.
- Log into Workspace as an HFM application administrator.
- Select Administration > Task Audit
- Select the date range, user, and or task types.
- Click the Export button and save the result.
The output from the export is saved as a CSV file with the same data that was displayed on screen. You can then save this file off someplace save and when you need to review the data, you can retrieve it.
Another method is to create a database trigger on the _TASK_AUDIT table that captures new consolidation records and inserts them into a new table. This method requires some knowledge of database management and SQL as well as access to SQL Server database associated with the HFM application.
The first step is to create a table to store the consolidation results.
Below is the SQL I use to create the history table, which I cleverly named CONSOLIDATION_HISTORY. The SQL also populates the table with existing consolidation records. In this example, the database I used is called TEST_HYP_HFM_1 and the database schema is DBO. The task audit table is titled using the HFM application name followed by “_TASK_AUDIT.” In the SQL, I called it APPLICATION_TASK_AUDIT. Just replace the name to match the table name in your database. Note the SQL is written using SQL Server T-SQL.
USE [TEST_HYP_HFM_1]
GO
IF (NOT EXISTS (SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'CONSOLIDATION_HISTORY'))
BEGIN
CREATE TABLE [dbo].[CONSOLIDATION_HISTORY](
[GUID] [nvarchar](32) NOT NULL,
[ActivityUserID] [int] NOT NULL,
[ActivitySessionID] [int] NOT NULL,
[ActivityCode] [int] NOT NULL,
[ServerName] [nvarchar](256) NOT NULL,
[AppName] [nvarchar](20) NOT NULL,
[Start] [datetime] NULL,
[End] [datetime] NULL,
[Duration] [int] NULL,
[Description] [nvarchar](1000) NULL,
[Scenario] [nvarchar](1000) NULL,
[Year] [nvarchar](1000) NULL,
[StartPeriod] [nvarchar](1000) NULL,
[EndPeriod] [nvarchar](1000) NULL,
[Entity] [nvarchar](4000) NULL,
[Parent] [nvarchar](4000) NULL,
CONSTRAINT [PK_CONSOLIDATION_HISTORY] PRIMARY KEY CLUSTERED
(
[GUID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO
INSERT INTO [dbo].[CONSOLIDATION_HISTORY] (
[GUID]
,[ActivityUserID]
,[ActivitySessionID]
,[ActivityCode]
,[ServerName]
,[AppName]
,[Start]
,[End]
,[Duration]
,[Description]
,[Scenario]
,[Year]
,[StartPeriod]
,[EndPeriod]
,[Entity]
,[Parent])
(SELECT [strGUID]
,[ActivityUserID]
,[ActivitySessionID]
,[ActivityCode]
,[ServerName]
,[AppName]
,cast([StartTime]-2 as datetime) as [Start]
,cast([EndTime]-2 as datetime) as [End]
,datediff(s,cast([StartTime]-2 as datetime),cast([EndTime]-2 as datetime)) as [Duration]
,[strDescription]
,SUBSTRING([strDescription],CHARINDEX('The Scenario is',[strDescription])+16,(CHARINDEX(';',[strDescription],CHARINDEX('The Scenario is',[strDescription])))-(CHARINDEX('The Scenario is',[strDescription])+16)) as [Scenario]
,SUBSTRING([strDescription],CHARINDEX('The Year is',[strDescription])+11,(CHARINDEX(';',[strDescription],CHARINDEX('The Year is',[strDescription])))-(CHARINDEX('The Year is',[strDescription])+11)) as [Year]
,SUBSTRING([strDescription],CHARINDEX('The Start Period is',[strDescription])+19,(CHARINDEX(';',[strDescription],CHARINDEX('The Start Period is',[strDescription])))-(CHARINDEX('The Start Period is',[strDescription])+19)) as [StartPeriod]
,SUBSTRING([strDescription],CHARINDEX('The End Period is',[strDescription])+18,(CHARINDEX(';',[strDescription],CHARINDEX('The End Period is',[strDescription])))-(CHARINDEX('The End Period is',[strDescription])+18)) as [EndPeriod]
,CASE WHEN CHARINDEX('The Parent is',[strDescription]) > 0
THEN SUBSTRING([strDescription],CHARINDEX('The Entity is',[strDescription])+14,(CHARINDEX(';',[strDescription],CHARINDEX('The Entity is',[strDescription])))-(CHARINDEX('The Entity is',[strDescription])+14))
ELSE REPLACE(RIGHT([strDescription],LEN([strDescription])-CHARINDEX('The Entity is',[strDescription])-13),'.','')
END as [Entity]
,CASE WHEN CHARINDEX('The Parent is',[strDescription]) > 0
THEN REPLACE(RIGHT([strDescription],LEN([strDescription])-CHARINDEX('The Parent is',[strDescription])-13),'.','')
ELSE Null
END as [Parent]
FROM [TEST_HYP_HFM_1].[dbo].[APPLICATION_TASK_AUDIT]
where activitycode=4
)
The last step is to create the trigger. The SQL below was written to create a trigger on the APPLICATION_TASK_AUDIT table that will insert a record into the CONSOLIDATION_HISTORY table when a record with an ActivityCode of 4 is inserted. ActivityCode 4 is a consolidation record. Members from each of the dimensions described in the description are parsed out into their own field in the table so you can query them by similarity to look for trends. The duration is stored in seconds using the DATEDIFF command. The source data for the start and end times are stored numerically and it’s just a simple matter to convert them to a DATETIME. For some reason, I had to subtract two from the value to return the correct date. You can verify the result against the values returned in the Task Audit screen of the HFM application. Some records will depict the selected Parent member in the description while others will not. Because of this, I had to test for the string “the Parent is” in the description prior to parsing out the Entity and Parent members.
Once the SQL is modified and executed successfully, records will be inserted in the CONSOLIDATION_HISTORY table whenever consolidations are completed in the source HFM application. Accessing the data becomes the next challenge.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER dbo.InsertHistory
ON dbo.APPLICATION_TASK_AUDIT
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO dbo.CONSOLIDATION_HISTORY (
[GUID]
,[ActivityUserID]
,[ActivitySessionID]
,[ActivityCode]
,[ServerName]
,[AppName]
,[Start]
,[End]
,[Duration]
,[Description]
,[Scenario]
,[Year]
,[StartPeriod]
,[EndPeriod]
,[Entity]
,[Parent])
(SELECT [strGUID]
,[ActivityUserID]
,[ActivitySessionID]
,[ActivityCode]
,[ServerName]
,[AppName]
,cast([StartTime]-2 as datetime) as [Start]
,cast([EndTime]-2 as datetime) as [End]
,datediff(s,cast([StartTime]-2 as datetime),cast([EndTime]-2 as datetime)) as [Duration]
,[strDescription]
,SUBSTRING([strDescription],CHARINDEX('The Scenario is', [strDescription])+16, (CHARINDEX(';',[strDescription],CHARINDEX('The Scenario is',[strDescription])))-(CHARINDEX('The Scenario is',[strDescription])+16)) as [Scenario]
,SUBSTRING([strDescription],CHARINDEX('The Year is',[strDescription])+11,(CHARINDEX(';',[strDescription],CHARINDEX('The Year is',[strDescription])))-(CHARINDEX('The Year is',[strDescription])+11)) as [Year]
,SUBSTRING([strDescription],CHARINDEX('The Start Period is',[strDescription])+19,(CHARINDEX(';',[strDescription],CHARINDEX('The Start Period is',[strDescription])))-(CHARINDEX('The Start Period is',[strDescription])+19)) as [StartPeriod]
,SUBSTRING([strDescription],CHARINDEX('The End Period is',[strDescription])+18,(CHARINDEX(';',[strDescription],CHARINDEX('The End Period is',[strDescription])))-(CHARINDEX('The End Period is',[strDescription])+18)) as [EndPeriod]
,CASE WHEN CHARINDEX('The Parent is',[strDescription]) > 0
THEN SUBSTRING([strDescription],CHARINDEX('The Entity is',[strDescription])+14,(CHARINDEX(';',[strDescription],CHARINDEX('The Entity is',[strDescription])))-(CHARINDEX('The Entity is',[strDescription])+14))
ELSE REPLACE(RIGHT([strDescription],LEN([strDescription])-CHARINDEX('The Entity is',[strDescription])-13),'.','')
END as [Entity]
,CASE WHEN CHARINDEX('The Parent is',[strDescription]) > 0
THEN REPLACE(RIGHT([strDescription],LEN([strDescription])-CHARINDEX('The Parent is',[strDescription])-13),'.','')
ELSE Null
END as [Parent]
FROM inserted
WHERE [ActivityCode]=4)
END
Subcubes - How HFM Stores Data
HFM organizes data into sections called "subcubes" which is a set of records that allows HFM to cache portions of the database into memory.
A subcube is made up of:
- 1 member from Scenario, Year, Entity, and Value dimensions
- all members of Account, ICP, View, and any Custom dimensions
- Each Account, ICP, View, and Custom dimension combination contains 12 values which is for the 12 months of the Period dimension.
HFM then stores these subcubes in one of three tables:
- DCE (Currency Subcube) - Stores Entity and Parent Currency values and their adjustments.
- DCN (Parent Subcube - Stores remaining Value dimension members
- DCT (Journal Transactions) - Stores Journal transactions. When JEs are posted, they are transferred to either DCE (for
and ) or DCN (for and )
Friday, December 5, 2014
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
avax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Are you getting this error? This simply means that the web server or the URL you are connecting to does not have a valid certificate from an authorized CA. But however, being a programmer you would want to find out the alternative way to solve this issue.
What you need to do is to import the server certificate and install it in your JDK's keystore. If I am talking greek, its ok. I too just leant this. Just follow these steps and you will be able to get rid of that error.
1. First of all you copy the URL that you are connecting to and paste it in your browser. Let us say you are using IE. Just paste the url in the address bar and press enter.
2. You will now probably see a dialog box warning you about the certificate. Now click on the 'View Certificate' and install the certificate. Ignore any warning messages.
3. Now that the server certificate is installed in your computer, your browser will not warn you when you visit the same site again. But however your JRE dumb as it is does not yet know about this certificate's existence until you add it to its keystore. Usually you will use the keytool to manage certificates. Keytool is a command-line utility with numerous arguments that allow you to create and manage keystores for housing digital certificates. For the complete documentation of keytool,http://java.sun.com/j2se/1.3/docs/tooldocs/win32/keytool.html
4. You can list the current certificates contained within a keystore using they keytool -list command. The initial password for the cacerts keystore is changeit. For example:
C:\Program Files\Citrix\Citrix Extranet Server\SGJC\jre\bin>keytool -list -keystore ..\lib\security\cacerts
Enter keystore password: changeit
You will then see the something like this:
Keystore type: jks
Keystore provider: SUN
Your keystore contains 11 entries:
engweb, Wed Apr 11 16:22:49 EDT 2001, trustedCertEntry,
Certificate fingerprint (MD5): 8C:24:DA:52:7A:4A:16:4B:8E:FB:67:44:C9:D2:E4:16
thawtepersonalfreemailca, Fri Feb 12 15:12:16 EST 1999, trustedCertEntry,
Certificate fingerprint (MD5): 1E:74:C3:86:3C:0C:35:C5:3E:C2:7F:EF:3C:AA:3C:D9
thawtepersonalbasicca, Fri Feb 12 15:11:01 EST 1999, trustedCertEntry,
Certificate fingerprint (MD5): E6:0B:D2:C9:CA:2D:88:DB:1A:71:0E:4B:78:EB:02:41
verisignclass3ca, Mon Jun 29 13:05:51 EDT 1998, trustedCertEntry,
Certificate fingerprint (MD5): 78:2A:02:DF:DB:2E:14:D5:A7:5F:0A:DF:B6:8E:9C:5D
thawteserverca, Fri Feb 12 15:14:33 EST 1999, trustedCertEntry,
Certificate fingerprint (MD5): C5:70:C4:A2:ED:53:78:0C:C8:10:53:81:64:CB:D0:1D
thawtepersonalpremiumca, Fri Feb 12 15:13:21 EST 1999, trustedCertEntry,
Certificate fingerprint (MD5): 3A:B2:DE:22:9A:20:93:49:F9:ED:C8:D2:8A:E7:68:0D
verisignclass4ca, Mon Jun 29 13:06:57 EDT 1998, trustedCertEntry,
Certificate fingerprint (MD5): 1B:D1:AD:17:8B:7F:22:13:24:F5:26:E2:5D:4E:B9:10
verisignclass1ca, Mon Jun 29 13:06:17 EDT 1998, trustedCertEntry,
Certificate fingerprint (MD5): 51:86:E8:1F:BC:B1:C3:71:B5:18:10:DB:5F:DC:F6:20
verisignserverca, Mon Jun 29 13:07:34 EDT 1998, trustedCertEntry,
Certificate fingerprint (MD5): 74:7B:82:03:43:F0:00:9E:6B:B3:EC:47:BF:85:A5:93
thawtepremiumserverca, Fri Feb 12 15:15:26 EST 1999, trustedCertEntry,
Certificate fingerprint (MD5): 06:9F:69:79:16:66:90:02:1B:8C:8C:A2:C3:07:6F:3A
verisignclass2ca, Mon Jun 29 13:06:39 EDT 1998, trustedCertEntry,
Certificate fingerprint (MD5): EC:40:7D:2B:76:52:67:05:2C:EA:F2:3A:4F:65:F0:D8
5. Now you have to add the previosly installed certificate to this keystore. To add, begin by exporting your CA Root certificate as a DER-encoded binary file and save it as C:\root.cer. (you can view the installed certificates under Tools->'Internet Options' ->Content->Certificates. Once you open the certificates, locate the one you just installed under 'Trusted Root Certification Authorities". Select the right one and click on 'export'. You can now save it (DER encoded binary) under your c: drive.
6. Then use the keytool -import command to import the file into your cacerts keystore.
For example:-alias myprivateroot -keystore ..\lib\security\cacerts -file c:\root.cer
Enter keystore password: changeitOwner: CN=Division name, OU=Department, O=Your Company, L=Anytown,ST=NC, C=US, EmailAddress=you@company.comIssuer: CN=Division name, OU=Department, O=Your Company, L=Anytown,ST=NC, C=US, EmailAddress=you@company.comSerial number: 79805d77eecfadb147e84f8cc2a22106Valid from: Wed Sep 19 14:15:10 EDT 2001 until: Mon Sep 19 14:23:20 EDT 2101Certificate fingerprints:MD5: B6:30:03:DC:6D:73:57:9B:F4:EE:13:16:C7:68:85:09SHA1: B5:C3:BB:CA:34:DF:54:85:2A:E9:B2:05:E0:F7:84:1E:6E:E3:E7:68Trust this certificate? [no]: yesCertificate was added to keystore
7. Now run keytool -list again to verify that your private root certificate was added:
C:\Program Files\Citrix\Citrix Extranet Server\SGJC\jre\bin>keytool -list -keystore ..\lib\security\cacerts
You will now see a list of all the certificates including the one you just added.
This confirms that your private root certificate has been added to the Extranet server cacerts keystore as a trusted certificate authority.
Thursday, December 4, 2014
Java.net.BindException: Address already in use: JVM_Bind:8080 Solution
This exception is self explanatory, its saying that a Java application is trying to connect on port 8080 but that port is already used by some other process and JVM Bind to that particular port, here its 8080, is failed. Now to fix this error you need to find out which process is listening of port 8080, we will how to find a process which is listening on a particular port in windows and then how to kill that process to make our port free to use.
Common Scenario when you see "Address already in use: JVM_Bind"
1. While doing Java remote debugging in Eclipse and when Eclipse tries to connect your remote java application on a particular port and that port is not free.
2. Starting tomcat when earlier instance of tomcat is already running and bonded to 8080 port. It will fail with SEVERE: Error initializing endpoint java.net.BindException: Address already in use: JVM_Bind:8080
Find and listening port
Subscribe to:
Posts (Atom)