Friday, June 13, 2014

How to get Current ODI Session Number

ODI Interview Questions and Answers:

We can use below getsession method in ODI procedure to get session no.



OdiOutFile -FILE=C:\sess.txt
<%=odiRef.getSession("SESS_NO"
)%>

Sybase Database users commands

Users and logins in Sybase 

 sp_iqaddlogin
  

Add users and define their password, number of concurrent connections, and password expiration

sp_iqdroplogin
  

Drop users

sp_iqlistexpiredpasswords
  

List users whose passwords have expired

sp_iqlistlockedusers
  

List users who are locked out of the database

sp_iqlistpasswordexpirations
  

List password expiration information for all users

sp_iqlocklogin
  

Lock a user account so that the user cannot connect to the database

sp_iqmodifyadmin
  

Enable Sybase IQ User Administration, or set database defaults for active user or database connections or password expirations

sp_iqmodifylogin
  

Modify the number of concurrent connections or password expiration for one or all users

sp_iqpassword
    


Modify a user’s password. Users can modify their own password. DBAs can modify any password.

 

Logins:

How to add login in Sybase database?

>sp_addlogin login_name,password,db_name

How to drop login from Sybase database?

>sp_droplogin login_name

Note: Need to drop user before dropping login.

How to find authentication mechanism of login in Sybase database?

>sp_showauthmech login_name
 
Users:
How to find user exists in Sybase database?

>sp_helpuser user_name

How to add user to Sybase database?

>sp_adduser loginame [, user_name [, groupname]]

How to drop user in Sybase database?

>sp_dropuser  user_name

How to add alias to the user in Sybase database?

>sp_addalias user_name,dbo

Note: drop the old user_name from db and add new alias to user 

Imp Note: System Database owner permission is required to run above system procedures.

Friday, June 6, 2014

Added Pivot , Unpivot ,Table functions and sub query objects in new ODI 12.1.2 patch number 17053768

Finally we got PIVOT and other three objects UNPIVOT , TABLE Function & Subquery Filter in Mapping after applying the Opatch 17053768

Copy your opatch file into C:\TEMP  directory (odi_1212_opatch\17053768)

C:\Java\jdk1.7.0_55\bin>set PATH=D:\Oracle\Middleware\Oracle_Home\OPatch;%PATH%


C:\Java\jdk1.7.0_55\bin>cd C:\TEMP\odi_1212_opatch

C:\TEMP\odi_1212_opatch>where opatch
D:\Oracle\Middleware\Oracle_Home\OPatch\opatch
D:\Oracle\Middleware\Oracle_Home\OPatch\opatch.bat

C:\TEMP\odi_1212_opatch>where unzi[
INFO: Could not find files for the given pattern(s).

C:\TEMP\odi_1212_opatch>where unzip
D:\ORACLEXE\app\oracle\product\11.2.0\server\bin\unzip.exe

C:\TEMP\odi_1212_opatch>opatch napply 17053768
Oracle Interim Patch Installer version 13.1.0.0.0
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : D:\Oracle\MIDDLE~1\ORACLE~1
Central Inventory : C:\Program Files\Oracle\Inventory
   from           : n/a
OPatch version    : 13.1.0.0.0
OUI version       : 13.1.0.0.0
Log file location : D:\Oracle\MIDDLE~1\ORACLE~1\cfgtoollogs\opatch\opatch2014-06
-06_23-11-38PM_1.log


OPatch detects the Middleware Home as "D:\Oracle\Middleware\Oracle_Home"

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   17053768

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local sy
stem.
(Oracle Home = 'D:\Oracle\MIDDLE~1\ORACLE~1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '17053768' to OH 'D:\Oracle\MIDDLE~1\ORACLE~1'

Patching component oracle.odi.sdk, 12.1.2.0.0...

Patching component oracle.odi.studio, 12.1.2.0.0...

Verifying the update...
Patch 17053768 successfully applied.
Log file location: D:\Oracle\MIDDLE~1\ORACLE~1\cfgtoollogs\opatch\opatch2014-06-
06_23-11-38PM_1.log

OPatch succeeded.

C:\TEMP\odi_1212_opatch>

Before Starting ODI12c Studio Client first Delete   odi_1212_opatch  directory from

C:\TEMP\odi_1212_opatch

If you are not deleted above folder then you can't find new Pivot and other objects

Next Start your ODI12c Studio Client then we can new objects in Mapping.







Thursday, June 5, 2014

Added Pivot , Unpivot ,Table functions and sub query objects in new ODI 12.1.2 patch number 17053768

Added Pivot , Un pivot ,Table functions and sub query objects in new ODI 12.1.2 patch number 17053768




Difference Between ODI 11g (11.1.1.7) and ODI 12c (12.1.2)


Difference Between ODI 11g (11.1.1.7) and ODI 12c (12.1.2)
ODI 11G(11.1.1.7)
ODI 12C (12.1.2)
No Multiple target tables in a single Interface
We can load multiple targets tables In single mapping
Interface
Mappings & Reusable Mappings
No Reusable mappings in Global Objects
Reusable Mappings Added in Global Objects
Stand Alone & J2ee Agent
Stand Alone, Colocated & J2ee Agent
Only NG-Profiles is  NG_DESIGNER
Added aditional NG profiles NG_CONSOLE,
NG_METADATA_ADMIN,NG_VERSION_ADMIN
No Wallet Password
Added Wallet Password
No-Direct role selection while creating users.
 Manually Drag n Drop
Direct Role selection whilre creating users
No-  Hive Technology For Hadoop in Topology
Added New Hive Technology For Hadoop  in Topology
No - Pivot functions
Available below functions in Opatch 17053768
1) Pivot Component
2) Unpivot Component
 
3) Table Function Component
4) Subquery Filter Component
Sequence Enhancements only NEXTVAL
Sequence Enhancements  CURRVAL & NEXTVAL
No  Split or Sort or set objects
Declarative Flow-Based User Interface
---------------------------------------------------
The new declarative flow-based user interface combines the simplicity and ease-of-use of the declarative approach with the flexibility and extensibility of configurable flows. Mappings (the successor of the Interface concept in Oracle Data Integrator 11g) connect sources to targets through a flow of components such as Join, Filter, Aggregate, Sort,Set, Split, and so on.
XML Improvements
-------------------------
The following XML Schema constructs are now supported:
list and union - List or union-based elements are mapped into VARCHAR columns.
substitutionGroup - Elements based on substitution groups create a table each for all types of the substitution group.
Mixed content - Elements with mixed content map into a VARCHAR column that contains text and markup content of the element.
Annotation - Content of XML schema annotations are stored in the table metadata.


Wednesday, June 4, 2014

MYSQL Database Commands syntax

To login (from unix shell) use -h only if needed.

# [mysql dir]/bin/mysql -h hostname -u root -p

Create a database on the sql server.

mysql> create database [databasename];

List all databases on the sql server.

mysql> show databases;

Switch to a database.

mysql> use [db name];

To see all the tables in the db.

mysql> show tables;

To see database's field formats.

mysql> describe [table name];

To delete a db.

mysql> drop database [database name];

To delete a table.

mysql> drop table [table name];

Show all data in a table.

mysql> SELECT * FROM [table name];

Returns the columns and column information pertaining to the designated table.

mysql> show columns from [table name];

Show certain selected rows with the value "whatever".

mysql> SELECT * FROM [table name] WHERE [field name] = "whatever";

Show all records containing the name "Bob" AND the phone number '3444444'.

mysql> SELECT * FROM [table name] WHERE name = "Bob" AND phone_number = '3444444';

Show all records not containing the name "Bob" AND the phone number '3444444' order by the phone_number field.

mysql> SELECT * FROM [table name] WHERE name != "Bob" AND phone_number = '3444444' order by phone_number;

Show all records starting with the letters 'bob' AND the phone number '3444444'.

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444';

Show all records starting with the letters 'bob' AND the phone number '3444444' limit to records 1 through 5.

mysql> SELECT * FROM [table name] WHERE name like "Bob%" AND phone_number = '3444444' limit 1,5;

Use a regular expression to find records. Use "REGEXP BINARY" to force case-sensitivity. This finds any record beginning with a.

mysql> SELECT * FROM [table name] WHERE rec RLIKE "^a";

Show unique records.

mysql> SELECT DISTINCT [column name] FROM [table name];

Show selected records sorted in an ascending (asc) or descending (desc).

mysql> SELECT [col1],[col2] FROM [table name] ORDER BY [col2] DESC;

Return number of rows.

mysql> SELECT COUNT(*) FROM [table name];

Sum column.

mysql> SELECT SUM(*) FROM [table name];

Join tables on common columns.

mysql> select lookup.illustrationid, lookup.personid,person.birthday from lookup left join person on lookup.personid=person.personid=statement to join birthday in person table with primary illustration id;

Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.

# mysql -u root -p
mysql> use mysql;
mysql> INSERT INTO user (Host,User,Password) VALUES('%','username',PASSWORD('password'));
mysql> flush privileges;

Change a users password from unix shell.

# [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p password 'new-password'

Change a users password from MySQL prompt. Login as root. Set the password. Update privs.

# mysql -u root -p
mysql> SET PASSWORD FOR 'user'@'hostname' = PASSWORD('passwordhere');
mysql> flush privileges;

Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.

# /etc/init.d/mysql stop
# mysqld_safe --skip-grant-tables &
# mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where User='root';
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysql stop
# /etc/init.d/mysql start

Set a root password if there is on root password.

# mysqladmin -u root password newpassword

Update a root password.

# mysqladmin -u root -p oldpassword newpassword

Allow the user "bob" to connect to the server from localhost using the password "passwd". Login as root. Switch to the MySQL db. Give privs. Update privs.

# mysql -u root -p
mysql> use mysql;
mysql> grant usage on *.* to bob@localhost identified by 'passwd';
mysql> flush privileges;

Give user privilages for a db. Login as root. Switch to the MySQL db. Grant privs. Update privs.

# mysql -u root -p
mysql> use mysql;
mysql> INSERT INTO db (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv) VALUES ('%','databasename','username','Y','Y','Y','Y','Y','N');
mysql> flush privileges;

or

mysql> grant all privileges on databasename.* to username@localhost;
mysql> flush privileges;

To update info already in a table.

mysql> UPDATE [table name] SET Select_priv = 'Y',Insert_priv = 'Y',Update_priv = 'Y' where [field name] = 'user';

Delete a row(s) from a table.

mysql> DELETE from [table name] where [field name] = 'whatever';

Update database permissions/privilages.

mysql> flush privileges;

Delete a column.

mysql> alter table [table name] drop column [column name];

Add a new column to db.

mysql> alter table [table name] add column [new column name] varchar (20);

Change column name.

mysql> alter table [table name] change [old column name] [new column name] varchar (50);

Make a unique column so you get no dupes.

mysql> alter table [table name] add unique ([column name]);

Make a column bigger.

mysql> alter table [table name] modify [column name] VARCHAR(3);

Delete unique from table.

mysql> alter table [table name] drop index [colmn name];

Load a CSV file into a table.

mysql> LOAD DATA INFILE '/tmp/filename.csv' replace INTO TABLE [table name] FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1,field2,field3);

Dump all databases for backup. Backup file is sql commands to recreate all db's.

# [mysql dir]/bin/mysqldump -u root -ppassword --opt >/tmp/alldatabases.sql

Dump one database for backup.

# [mysql dir]/bin/mysqldump -u username -ppassword --databases databasename >/tmp/databasename.sql

Dump a table from a database.

# [mysql dir]/bin/mysqldump -c -u username -ppassword databasename tablename > /tmp/databasename.tablename.sql

Restore database (or database table) from backup.

# [mysql dir]/bin/mysql -u username -ppassword databasename < /tmp/databasename.sql

Create Table Example 1.

mysql> CREATE TABLE [table name] (firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35),suffix VARCHAR(3),officeid VARCHAR(10),userid VARCHAR(15),username VARCHAR(8),email VARCHAR(35),phone VARCHAR(25), groups VARCHAR(15),datestamp DATE,timestamp time,pgpemail VARCHAR(255));

Create Table Example 2.

mysql> create table [table name] (personid int(50) not null auto_increment primary key,firstname varchar(35),middlename varchar(50),lastnamevarchar(50) default 'bato');

ODI 12c Repository Creation in Mysql database

We can Create ODI 12c Repository RCU in MYSQL database 5.6.12 and above versions.

Before installation we need to add below three parameters in My.ini  parameter file in mysql.


# Uncomment the following if you are using InnoDB tables

innodb_file_format=Barracuda
innodb_large_prefix=ON
log_bin_trust_function_creator=ON

Tuesday, June 3, 2014

ODI 12c StandAlone Installation Step By Step Windows 7

Step1:    Download ODI 12c Software from Oracle Download. ofm_odi_generic_12.1.2.0.0_disk1_1of1.zip 
ODI 12c   

Step2:  Unzip 12.1.2  zip file.

step3:  Open CMD prompt as Administrator

step4:  Install JDK 1.7 in C:\java\  location.

Using below command to launch ODI installation wizard.  java -jar E:\ODI12c\odi_121200.jar

C:\Windows\system32>cd C:\Java\jdk1.7.0_55\bin

C:\Java\jdk1.7.0_55\bin>java -jar E:\ODI12c\odi_121200.jar




Step5: Click on Next

Step6:  Select your installation location.


Step7:  Select  Standalone installation option.

It will install the below plugins  except  ODI Studio & J2ee Agents and ODI Console


Step8:  Validating the system requirements


Step9:  Deselect the option for Oracle Support 


Step10:  click on Install option for installation.





Monday, June 2, 2014

Create Standalone Collocated Agent in ODI 12c

1) Create Standalone Collocated Agent in ODI 12c
Create Standalone Collocated Agent in ODI 12c

1) D:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin  Launch  config.batch file for windows or  config.sh file for unix or linux.

2)Select Create New domain and click on next.
3)Select Oracle Data Integrator -Standaline collocated Agent option in below list.


4) Enter the password for Weblogic login details. (for me password as Admin123)


5)Select RCU data and enter the database details for your RCU.   and Click on Get RCU Configuration option.


6) Select the all options for your repository details.





7)Test the selection connections.


8) Select System Components option.


9)Enter the Standaline agent details  Portno : 20910, Name :  OracleDIAgent1,
User name :  SUPERVISOR , password :  welcome ,Select Master Repository.


10) See the status of domain creation successful.





11) Domain is created in you Oracle Home folder inside user_projects folder.
D:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain

12) Start the services using below command in your domain folder.

startWebLogic

Creating Agent in Topology.


14) Goto =>Topology=>Physical Architecture=>Agents=>Right click=>New Agent.




Sunday, June 1, 2014

ODI 12c Repository Creations Step By Process in Oracle XE 11.2 Database

1) Go to Oracle\Middleware\Oracle_Home\oracle_common\bin  Call  rcu.batch for windows and rcu.sh for Unix.


2)Select System Load & Product Load


3) Provide your database details.  With SYSDBA privileged user.



4) Checking the DB requirement.  IF Oracle Database should be Greater than 11.2.0.3.
If you are using Oracle 12C. Check below requirement if you are getting below error in 12c.

Oracle DB 12c:--ORA-65096: invalid common user or role name

follow below rules.

http://www.ludovicocaldara.net/dba/playing-with-oracle-12c-users-and-roles/


5) Select below options for Repository users.

6) Validating the requirements.


7)Common Password for all users.


8) Master Repository and Work Repository Credentials.


9) It will create below list of Users and Table Spaces.

10). click on Create button to create all Repository tables.


11) Done.