Friday 12 February 2016

MDS Interview questions?

What is MDS & Why we use MDS in Oracle SOA? MDS stands for Oracle MetaData Service. It is central repository inside Oracle Fusion Middleware. MDS purpose is to provide centralized store where we can keep, manage & access metadata.
Metadata is often defined as data about data, or in other words, pieces of information that describes and gives meaning to other information. Typical examples of metadata used by Oracle Fusion Middleware components are XML files, XSD schema files, XSL transformations, SCA composites, BPEL processes, WSDLs, business rules, Oracle ADF pages, JaveServer Pages (JSP), and Oracle ADF task flows, among others.
The same metadata that is used during the design phase of application is used at application runtime through the metadata service layer. This ensures consistency through the lifecycle of the application. Metadata such as XML files or XSD schema files is usually shared among different components. Therefore, it is not only necessary that those resources can be accessed easily and referenced by all the components, but it is also important that they remain consistent; a change in the metadata should be reflected in all the components that are referencing it. Having only one copy of each metadata resource avoids unnecessary redundancy and guarantees that the changes are made in only one place.
Types of MDS Repository?
File-Based & DB Based.
What is File-Based MDS Repository?
  The idea behind file-based repositories is to allow developers to have a light repository available in their local environment that can be easily adapted for development and tests; a file-based repository relieves developers of having to configure and maintain an external database while providing necessary functionality, such as file referencing and customizations. These kinds of repositories are easily modified and maintained, since they define a directory structure similar to any other directory structure inside an operating system. They can be navigated and altered using common shell commands or any kind of visual file explorer application. The file-based repository is usually located inside the Oracle JDeveloper home (JDEV_HOME/integration) if the default configuration is used.
 What is DB-Based MDS Repository?
  Database-based repositories are used in production environments where robustness is needed. These repositories are created using the Repository Creation Utility (RCU) application from Oracle. This utility helps with the creation of a new database schema with its corresponding tables and objects. Repositories can later be registered or deregistered via the Oracle Enterprise Manager Fusion Middleware Control console.
Which configuration file store MDS configurations?
 The adf-config.xml file is a configuration file that is used to store MDS Configurations.
What type of WSDL file we usually keep in MDS?
 We usually keep Abstract WSDL’s only in MDS.

Wednesday 10 February 2016

Weblogic Server User Password Using WLST-2

Oracle Weblogic Server: How to Change Oracle Weblogic Server User Password Using WLST
1. Setting environment variable
    a. go to directory $WLS_HOME/wlserver_10.3/server/bin
    b. source file setWLSEnv.sh  as command: . setWLSEnv.sh .

2. Create a domain which name is test1032,
3. Weblogic admin user name is weblogic, password is weblogic1.
4. Create test user, which name is test and password is weblogic1.

Instruction
$java weblogic.WLST changepw.py <Domain Name> <Admin URI> <Admin user> <Admin password> <user name> <user password>
<Domain Name> : the domain name which need to change user password. e.g. test1032
<Admin URI>   : weblogic server adminstration URL, e.g. t3://localhost:7001
<Admin user>  : weblogic admin user, e.g. weblogic
<Admin password> : admin user password, e.g. weblogic1
<user name>      : the user who need to change password. e.g. test
<user password>  : new user password. .e.g welcome1


Monday 8 February 2016

How to Migrate a WebLogic Domain from a 32 to a 64 bit JVM/Architecture

To create migration template:
1.Execute $<WLS_HOME>/wlserver_10.3/common/bin/config_builder.sh
2.Create Domain Template.
3.Select Domain to migrate.
4.Enter the name of template and other info. Click next.
5.Using Add Button, Select libraries you want to add under lib folder. copy jdbc data sources you would like to have under config/jdbc folder. If you want to have log4j configuration, copy log4j.xml under domain_root folder.
6.Select data base for the domain and click next.
7.Enter Admin Server Name and port numbers. Click next.
8.Enter username and password. Click next. Select No if you don want to add users/groups/roles
9.Click next until reach button create.

This will create a jar file that is needed for the next action plan.

To install and migrate domain to 64 bit architecture. 

1.Install a 64 bit JVM of your choice on environment.
2.Go to $JVM_HOME/bin and execute $ java -d64 -jar wls1034_generic.jar
3.When prompt, select JVM in browse menu, and wait for installation to finish.
4.Go to <WLS_HOME>/wlserver_10.3/common/bin and execute $ ./config.sh
5.Select Create a new Weblogic domain
6.Select Base this domain on an existing template and select browse.
7.Select jar file created on previous action plan.
8.Select Name of domain. Maintain in most cases.
9.Select user name and password. Maintain in most cases.
10.Select JVM of your choice and click next.
11.Confirm all JMS/JDBC/security configuration.
12.On select Optional Configuration, reconfigure if necessary.
13.Check on Configuration summary for all domain configuration.
14.Click on create, to finish up domain import.

Note: Always when installing a 64 bit WLS, it's necessary to install first the 64 JVM and then run the generic installer with the -d64 bit option. If this is not performed, the installation will be the 32 default version.

SSL(Security Socket Layer) and Keystore

1. Generating the certificate:

The following steps are:
Step1: Open a command prompt and set the environment by running the setDomainEnv script.
( C:\bea9\user_projects\domains\ram_domain\bin\setDomainEnv.cmd)

Step2: Generate the private – public key pair. For demonstration we would use keytool java utility to do so.        
However we can use other utilities like openssl etc.
keytool  -genkey  -alias mykey   -keyalg RSA   -keysize 2048   -keystore  identity.jks

Step3: Generate a Certificate Signing Request (CSR) and send it to Certifying Authority.
keytool  -selfcert   -alias mykey  -keystore   identity.jks

Step 4: Create a identity  keystore, this can be done my exporting
keytool   -export  -alias  mykey  -file  cert.cer  -keystore   identity.jks

Step5: Create a trust keystore, this can be done my importing.
keytool   -import   -alias   mykey  -file  cert.cer   -keystore   trust.jks    -noprompt

To verify the contents of the keystore, you can use the below command,
keytool  -list  -v  -keystore <keystore-name>  -storepass <keystore-password>
2)  Configuring the keystore on the WebLogic Server:

Step 1: Log into the Admin Console, Click on servers
Step 2: Click on Lock and Edit
Step 3: select the server on which you want to configure the SSL    certificate.(Ex:ms1)
Step 4: Click on keystores
Step 5: select Custom identity and Custom trust

Identiy:

CustomIdentitykeystore:C:\bea9\user_projects\domains\sai_domain\identity.jks
Custom Identity keystore type: jks
Custom identity passphrase : shailu@123

Trust:

Custom trust keystore: C:\bea9\user_projects\domains\sai_domain\trust.jks
Custom trust keystore type: jks
Custom trust passphrase : shailu@123
save  
Activate changes

Step 6: Click on SSL
Step 7: Enter identity

Private key alias: mykey
Privatekey passphrase : shailu@123
save  
Activate changes
To check SSL type browser  https://localhost:5003(ms1 ssl portnumber)/messaging(deploying application)

How to Change Oracle Weblogic Server User Password Using WLST

1. Setting environment variable
    a. go to directory $WLS_HOME/wlserver_10.3/server/bin
    b. source file setWLSEnv.sh  as command: . setWLSEnv.sh .

2. Create a domain which name is test1032,
3. Weblogic admin user name is weblogic, password is weblogic1.
4. Create test user, which name is test and password is weblogic1.


Instruction 
$java weblogic.WLST changepw.py <Domain Name> <Admin URI> <Admin user> <Admin password> <user name> <user password>

<Domain Name> : the domain name which need to change user password. e.g. test1032
<Admin URI>   : weblogic server adminstration URL, e.g. t3://localhost:7001
<Admin user>  : weblogic admin user, e.g. weblogic
<Admin password>  : admin user password, e.g. weblogic1
<user name>       : the user who need to change password. e.g. test
<user password>   : new user password. .e.g welcome1 
 1. create file named changepw.py which contents as below:

if len(sys.argv) != 7:
print 'Usage: java weblogic.WLST changepw.py <Domain Name> <Admin URI> <Admin user> <Admin password> <user name> <user password> '
sys.exit(1)

DomainName = sys.argv[1]
ADMINUrl = sys.argv[2]
ADMINuser = sys.argv[3]
ADMINPwd = sys.argv[4]
UserToChange = sys.argv[5]
NewUserPassword=sys.argv[6]

print "DomainName: %s" % (DomainName)
print "ADMINUrl: %s" % (ADMINUrl)
print "ADMINuser: %s" % (ADMINuser)
print "AdminPassword: %s" % (ADMINPwd)
print "UserToChange: %s" % (UserToChange)
print "NewUserPassword: %s" % (NewUserPassword)


print ' ---- Connecting to domain with user: '+ADMINuser+' ------- '
print ' '
connect(ADMINuser,ADMINPwd,ADMINUrl)
cd('/SecurityConfiguration/'+DomainName+'/Realms/myrealm/AuthenticationProviders/DefaultAuthenticator')
print 'Changing password for user: '+UserToChange
cmo.resetUserPassword(UserToChange,NewUserPassword)

print ' ---- Password for User: '+UserToChange+' changed Successfully --- '
print ' '
disconnect()
print ' '

disconnect()

2. The command to run above script, e.g. change password from weblogic1 to weblogic
java weblogic.WLST changepw.py test1032 t3://localhost:7001 weblogic weblogic1 test welcome1

Sample Output
[zsy@ofmpc1 bin]$ java weblogic.WLST changepw.py test1032 t3://localhost:7001 weblogic weblogic1 test welcome1

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

DomainName: test1032
ADMINUrl: t3://localhost:7001
ADMINuser: weblogic
AdminPassword: weblogic1
UserToChange: test
NewUserPassword: welcome1
---- Connecting to domain with user: weblogic -------

Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'test1032'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

Changing password for user: test
---- Password for User: test changed Successfully ---

Disconnected from weblogic server: AdminServer


You will need to be connected to a running server to execute this command