Feed aggregator

RefCursor and Multiple responses in single call

Tom Kyte - Fri, 2016-07-15 00:06
Hello Tom, Thank you in advance for taking my question and for this wonderful platform. For search functionality for our Content Management system, I have created a package which returns a ref cursor. The package accepts search critetrias, dy...
Categories: DBA Blogs

Database Security

Tom Kyte - Fri, 2016-07-15 00:06
In Our organization , two employees who copy whole windows server system to image file. And our server has business and people's related information stored in oracle database. Both does not know the password but they know sys user. and they are a ...
Categories: DBA Blogs

Query does not use index

Tom Kyte - Fri, 2016-07-15 00:06
I would like to understand why my sql instruction doesn't use an index; I have a table that has 6 million rows. And I'm trying to extract some rows and Oracle optmizer are not using the index existent in column. TABLE ESTRUCTURE: <code> COLUM...
Categories: DBA Blogs

How to loop a select statement while inserting the values in a table

Tom Kyte - Fri, 2016-07-15 00:06
create or replace PROCEDURE PROC_PROJ_ID_AUTO_GENERATE(op_error_code OUT VARCHAR2, op_succ_msg OUT VARCHAR2) BEGIN FOR i IN (select a.program_id , a.PRODUCTIVITY_IDENTIFIER ,TARGET_START_DATE ,TARGET_COMP_DATE , PRGM_...
Categories: DBA Blogs

The Nextbit Robin

Oracle AppsLab - Thu, 2016-07-14 19:46

For a couple of months, I’ve been using as my main phone the Nextbit Robin. A $299 Android phone that started as a campaign in Kickstarter, and it got 3,611 backers including Jake (@jkuramot).

I previously had my Nexus 5, but over the time, Bluetooth stopped working and that was a good excuse to try this phone.

Also I was so excited because at SXSW I had a long talk with the Nextbit (@nextbitsys) development team about all technology behind this phone, more details below.

4

So Nexbit is a new company that wants to revolutionize hand held storage and this first attempt is really good.

They came up with Robin phone; it is square, rectangular with tight corners that looks like uncomfortable at first but it has soft touch finish. It has a decent balance of weight. People tend to ask me if this is the modular phone (Project Ara) by Google or if it’s new Lego’s phone. Either way, conclusion is that it has a pretty cool and minimalistic design and people like it a lot.

Talking about its design, power button on the right hand side with is also a fingerprint reader and tiny volume buttons on the left hand side. Probably that’s the worst part of the build; the buttons are small and round and of course kinda hard to press.

The power button does not protrude at all so it’s hard to press too. The fingerprint is actually really good though; accuracy and speed are on point. The fingerprint with the side placement like this, actually makes a lot of sense as you can register your left index finger and right thumb for the way you grip the phone and unlock it as soon as you hold the phone.

It has an USB Type-C at the bottom left corner with quick charging and dual front-facing stereo speakers, loud and clear. Quick charging is awesome.

Running the latest version of Android 6 with a custom Nextbit skin but all elements feel pretty stock.

Specifications are pretty good too, Snapdragon 808, 3 Gb of RAM, 2680 mAh battery, that makes the phone pretty smooth. Camera on the back with 13 MP with decent colors and details but dynamic range is weak.

I noticed that is very slow to actually take the photos, but they just have release new software update that solves the shutter lag.

1

But let’s focus on what’s the main spec of this phone, storage. All magic is in the Nextbit skin. Every Robin comes with 32 GB on-board storage but then also 100 GB of free cloud storage. Now, you’ll be asking why do you need cloud storage instead on-board storage?

What happens is Robin is supposed to be smart enough to offload the oldest and least frequently used stuff from internal storage straight to the cloud. So when you start to run out of local storage with old apps and old photos that haven’t been opened in a while they will be moved to the cloud and make room for more in your local storage seamlessly almost without you ever having a notice.

2

Directly in the application drawer you will notice that some app icons are grayed out, so these are the apps that are offline or stored in the cloud and not stored in the device anymore. If you want to use any of them, it takes a minute or so to download everything in the state you last left it in and then opens up right where you left off. So it’s a process of archiving and restoring.

You can also set apps to not get archived swiping the icon app down to pin them, and they will never go to the cloud. If you are using some apps all the time you shouldn’t even need to pin them as Robin will noticed that you use it a lot.

In order to save battery and don’t waste your carrier data, backing up process happens only when the phone is in WiFi and is charging.

Problem is that all restoring is dependent on the internet, so if you are out there with no data and want to use your app that is archived in the cloud, pretty much you’re lost.

In deep details, it has machine learning algorithms, cloud integrated into Android OS and onboard storage is merged with cloud seamlessly. Machine learning mechanism learns from your app and photos usage. Also it can think ahead, so months before you ever run out of storage Robin anticipates you will need more space and continually synchronizes apps and photos. For pictures, they are downsampled to screen resolution but full size version remain linked in the cloud.
For security concerns, all data stored in cloud storage is encrypted with Android built-in encryption.

I like the idea behind Robin system, but the cool thing is that you can use it like a normal phone, you can use your launcher of choice, even root it. The bootloader is actually unlocked out of the box and still under the warranty.

Pretty good phone for the price outside of the storage solution, but if you are looking for a phone focusing on having lots of storage, I’d look for something with a Micro SD card slot. Otherwise it’s definitely worth considering this. Definitely, I would use it as my main phone.

It’s cool to see this type of cloud-based storage solution in action.

3Possibly Related Posts:

BPEL 12.2.1 Certified for Prebuilt EBS 12.2 SOA Integrations

Steven Chan - Thu, 2016-07-14 12:47

Service Oriented Architecture (SOA) integrations with Oracle E-Business Suite can either be custom integrations that you build yourself or prebuilt integrations from Oracle.  For more information about the differences between the two options for SOA integrations, see this previously-published certification announcement.

The prebuilt BPEL business processes in Oracle E-Business Suite Release 12.2 are:

  • Oracle Price Protection (DPP)
  • Advanced Supply Chain Planning (MSC)
  • Oracle Transportation Management: Oracle Warehouse Management (WMS)
  • Oracle Transportation Management: Oracle Shipping Execution (WSH)
  • Oracle Transportation Management: Oracle Purchasing (PO)
  • Complex Maintenance, Repair & Overhaul (CMRO/AHL)

BPEL integration architecture diagram example

These prebuilt BPEL processes have now been certified with Oracle BPEL Process Manager 12c version 12.2.1 (in Oracle Fusion Middleware SOA Suite 12c) for Oracle E-Business Suite Release 12.2.

References

Certified Platforms

Oracle SOA Suite Release 12g 12.2.1 is certified to run on any operating system upon which Oracle WebLogic Server 12c is certified. Check the following for more details:

For information on operating systems supported by Oracle SOA Suite, refer to this document:

Integration with Oracle SOA Suite involves components spanning several different suites of Oracle products. There are no restrictions on which platform any particular component may be installed so long as the platform is supported for that component.

Pending Certifications 

The certification for BPEL 12.2.1 with prebuilt EBS 12.1 SOA integrations is underway now. Oracle's Revenue Recognition rules prohibit us from discussing certification and release dates, but you're welcome to monitor or subscribe to this blog. I'll post updates here as soon as soon as they're available.   

Getting Support

If you need support for the prebuilt EBS BPEL business processes, you can log Service Requests against the Applications Technology Group product family.

Related Articles

Categories: APPS Blogs

Set connection retry frequency on DataSource in WebLogic 12c.

Darwin IT - Thu, 2016-07-14 11:45
I have encountered several times in WebLogic 12c that when the ConnectionPool of a DataSource in WebLogic could not be initialized because due to a connection error or invalid username or password, the server could not be started.

I can't remember having encounterd this problem in 11g, and this week I struggled with it with one of my customers. The perception of the DBA there was that in 11g the server did start up, but the DataSource would go in Suspended-state. Half a year ago, one of the admins just removed a datasource because it made the 12c WebLogic server unstartable. "Taking a short turn", we would say in Dutch.

Now, having a database that is down is a reality at my customers. At least in development and test environments. Also at some of my customers it is a reality to have databases refreshed with an earlier clone. Causing for instance database passwords becoming invalid. It's quite inconvenient not being able to start the servers. Especially when the AdminServer can't be started because of it. And with SOASuite and OSB this is a reality since some of the consoles and composers are targeted to the AdminServer.

This week I found there were 2 options to get the server started:
  • Temporarily untarget the datasource
  • Set the initial and minimum connections to 0. 
The first was acceptable for one of my customers because they have just one cluster to which the problematic datasources was targeted to. Untargeting would leave all the other settings. And retargetting doesn't raise questions because there's only one target option.

But in a complex domain with several clusters it might not be too obvious to which cluster(s) or server(s) the datasource should be retargeted.

Changing the initial/minimum connections is not ideal either. Because you need to remember what the preferred settings were. These are important when using them for web applications or services used by web applications where performance is key.

But today I stumbled upon a third option: 'Connection Creation Retry Frequency' which can be found under DataSource -> Configuration -> Connection Pool -> Advanced:

Set this to 300 to have a retry every 5 minutes. It is described as:
The number of seconds between attempts to establish connections to the database.

If you do not set this value, data source creation fails if the database is unavailable. If set and if the database is unavailable when the data source is created, WebLogic Server will attempt to create connections in the pool again after the number of seconds you specify, and will continue to attempt to create the connections until it succeeds.

When set to 0, connection retry is disabled.'

Learning all the time...



Modernize Customer Engagement

WebCenter Team - Thu, 2016-07-14 08:34

Digital trends are changing the current landscape. Email, web, social, mobile, content and digital technologies are all evolving and with that, so have customer expectations. Customers want seamless experiences when they are interacting with your brand. They want to have streamlined communications and have consistent messages across multiple channels. 


But in reality, this just isn’t happening, and consumers are receiving inconsistent messages. Marketers send millions of messages and emails a day to customers – the latest offer or sale, the seasonal promotion – and many times it’s not very specific to that customer or their needs. In fact, 96% of consumers say they receive mistargeted ads or promotions each day. Gleanstar Research estimates is costs companies $958M each year in inefficient and ineffective content marketing spend.

While everyone likes to complain about email, this messaging challenge is really a cross-channel one. Consumers have a fragmented experience across channels, and we all live it as consumers every day. For example, you might purchase a product on the web, and that could automatically trigger an email with an email marketing system. But when a few days pass, you get an ad for the same product you already purchased. As you are probably aware, this can be quite frustrating and Accenture actually did some research around this, and found that 78% of customer receive a fragmented experience as they move from channel-by-channel.

But customers aren’t the only ones who need to be engaged. Partners and Suppliers do as well. 42% of partners are not clear how vendors use their feedback, according to Gallup. Which also indicates there are broken experiences and inconsistencies not only across channels, but stakeholders as well. 

Can you relate to any of these challenges? What is needed to solve these challenges and modernize customer engagement? There is a solution to solve these challenges that Marketers and Services organizations face -- Digital Experience solutions for Marketing and Services to Modernize Customer Engagement.


We invite you to read this solution brief to learn how Oracle’s digital experience solutions for marketing and business services can help you improve brand loyalty, deliver self-service to suppliers and partners and help you overall modernize customer engagement.

Ultra Subjective Space

Oracle AppsLab - Thu, 2016-07-14 06:37

Architects design space. A building is just a way to create spaces. Information architects at Oracle design relationships with abstract concepts. So far the main way we have to create visible spaces for our users is by projecting pixels onto glass screens.

This may change someday. If the promise of virtual reality is ever achieved, we may be able to sculpt entirely new realities and change the very way that people experience space.

pace1

The AppsLab R&D Team visits the teamLab exhibition

One sneak peek into this possible future is now on display at Pace Gallery in Menlo Park. Last week the AppsLab research and design team toured the Living Digital Space and Future Parks exhibit by the renowned Japanese art collective teamLab.

Still photographs do not do this exhibit justice. Each installation is a space which surrounds you with moving imagery. Some of these spaces felt like VR without the goggles – almost like being on a holodeck.

Various teamLab installations

Various teamLab installations

The artwork has a beautiful Japanese aesthetic. The teamLab artists are exploring a concept they call ultra subjective space. Their theory is that art shapes the way people of different cultures experience space.

Since the renaissance, people in the west have been taught to construct their experience of spatial reality like perspective paintings with themselves as a point observer. Premodern Japanese art, in contrast, might have taught people to experience a very different flattened perspective which places them inside each space: subjective instead of objective.

To explore this idea, teamLab starts with three dimensional computer models and uses mathematical techniques to create flattened perspectives which then form the basis for various animated experiences. I can’t say that the result actually changed my perception of reality, but the experience was both sublime and thought-provoking.

More teamLab installations

More teamLab installations

Their final installation was kid-centric. In one area, visitors were given paper and crayons and were asked to draw spaceships, cars, and sea creatures. When you placed your drawing under a scanner it became animated and was immediately projected onto one of two giant murals. We made an AppsLab fish and an AppsLab flying saucer.

Another area lets you hop across virtual lillypads or build animated cities with highways, rivers, and train tracks by moving coded wooden blocks around a tabletop. I could imagine using such a tabletop to do supply chain management.

Kids having fun - including us

Kids having fun – including us

Ultra subjective space is a pretty high brow concept. It’s interesting to speculate that ancient Japanese people may have experienced space in a different way than we do now, though I don’t see any way of proving it. But the possibility of changing something that fundamental is certainly an exciting idea. If virtual reality ever lets us do this, the future may indeed be not just stranger than we imagine, but stranger than we can imagine.

Living Digital Space and Future Parks will be on display at the Pace Gallery in Menlo Park through December 18, 2016.Possibly Related Posts:

Oracle RAWTOHEX Function with Examples

Complete IT Professional - Thu, 2016-07-14 06:00
The Oracle RAWTOHEX function is a simple conversion function. Learn how to use it and see some examples in this article. Purpose of the Oracle RAWTOHEX Function The purpose of the RAWTOHEX function is to convert from a RAW value into a hexadecimal value. As mentioned in the HEXTORAW function article, a RAW value is […]
Categories: Development

Truncate on cluster table

Tom Kyte - Thu, 2016-07-14 05:46
Hi Team, Could you please help me on how to truncate a table which part of a cluster. I want to truncate a table and getting below error. please help me ASAP. Below is the error: SQL> truncate table TEST1; truncate table TEST1 ...
Categories: DBA Blogs

Rebuild optimize failing for Text index in RDBMS 12c (12.1.0.2.0) CDB-PDB config

Tom Kyte - Thu, 2016-07-14 05:46
Hi Guys, DB: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production OS: OEL 6.5 I am testing use case for Oracle Text index on 12c CDB-PDB config (single PDB), and found that REBUILD optimize is failing with internal exce...
Categories: DBA Blogs

Spatial queries

Tom Kyte - Thu, 2016-07-14 05:46
Hi Tom I am calculating distance between two 2 points (using their gps co-ordinates) from the below query (Query 1). One column (name geo_location of sdo_geometry datatype where spatial index is created) in my table stores the geometric location o...
Categories: DBA Blogs

Session Memory Release

Tom Kyte - Thu, 2016-07-14 05:46
Hi Connor, Wanted to understand the session memory release process. 1] A database 2] Connections are established to the database, through connection pool 3] Connection pool is configured in Application Server [ Weblogic ] 4] The connection p...
Categories: DBA Blogs

Is it possible to overwrite OS User when connecting to oracle database from a .NET Application

Tom Kyte - Thu, 2016-07-14 05:46
I have a .NET Desktop Application which runs on our user's machine individually, as part of one of our functionality we need to pull data from Upstream that has data stored in an Oracle Database. Currently we get data from this oracle db by logging ...
Categories: DBA Blogs

Cardinality of table collections in SQL

Tom Kyte - Thu, 2016-07-14 05:46
I'm doing two queries, one will use an index I am trying to use. The first query it does not use the index and does full table scan. number_tbl will be a parameter passed into a stored procedure. We are using a type to pass in a table of numbers. ...
Categories: DBA Blogs

Migration of about 20000 Tablespaces from Solaris Sparc 10 with Oracle 9.2.0.4 to OL 7.2 64bit Oracle 12c

Tom Kyte - Thu, 2016-07-14 05:46
Hello Tom we plan a migration of our production system. we think we have two possibilities 1) one is from the 9i system exporting all TS's with exp and go directly to the 12c and do with imp all tablespaces in the new database but this optio...
Categories: DBA Blogs

sql loader delimiters

Tom Kyte - Thu, 2016-07-14 05:46
columns separated by ',' in data file but in control file by mistake if i mentioned field terminated '/' in control file.then what happen while loading data.
Categories: DBA Blogs

Start and stop a WebLogic (SOA/OSB) Domain

Darwin IT - Thu, 2016-07-14 04:24
So let's start the day with a blog. In the past few months I created scripts to install FMW products and build a WebLogic domain for it. For most of my findings I did a blog already:
And then I did not list the blogs about the scripts to setup and patch the QuickStarts. Nice  to mention is that this week 12.2.1.1 is released. So I can adapt my scripts with the new software (I'm not going to post that, you should be able to figure that out yourself, maybe I'll provide the changed snippets when I come to it).

But the important missing part in this series are the start and stop of the domain. So let me provide and describe my scripts.

Oracle does provide scripts to start and stop your NodeManager and WebLogic servers. When you configure the NodeManager and Servers correctly you can use those to add the NodeManager to the init.d services on Linux or to your Windows Services. Then the NodeManager would start the AdminServer and other Servers automatically.

However, on my demo/training/development systems I'd like to be able to start/stop the parts myself.  So here we go.

SettingsI'm working with Linux and create shell scripts to kick-off the wlst scripts that I use to start the particular components. Therefor I use a settings script called fmw12c_env.sh to call the setWLSEnv.sh from the FMW home. I take it that you're able to translate them to Windows Command file if applicable. I provided it a couple of time already. But for completeness here it is:
#!/bin/bash
echo set Fusion MiddleWare 12cR2 environment
export FMW_HOME=/u01/app/oracle/FMW12210
export NODEMGR_HOME=/u01/app/work/domains/osb_domain/nodemanager

export SOA_HOME=$FMW_HOME/soa
export OSB_HOME=$FMW_HOME/osb
export MFT_HOME=$FMW_HOME/mft
#
echo call setWLSEnv.sh
. $FMW_HOME/wlserver/server/bin/setWLSEnv.sh
export PATH=$FMW_HOME/oracle_common/common/bin:$WL_HOME/common/bin/:$WL_HOME/server/bin:$PATH

Then the wlst scrips need a property file fmw.properties:
#############################################################################
# Set SOABPM Domain properties
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 1.0, 2016-06-27
#
#############################################################################
#
#Per domain nodemanager...
#############################################################################
# Set SOABPM Domain properties
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 1.0, 2016-06-27
#
#############################################################################
#
#Per domain nodemanager...
#nmHome=/u01/app/work/domains/osb_domain/nodemanager
nmHome=/u01/app/work/domains/soabpm_domain/nodemanager
#nmHome=/u01/app/work/domains/soabpm12c_dev/nodemanager
nmHost=darlin-vce-db
nmPort=5555
nmType=plain
#
#Domain
#wlsDomainName=osb_domain
#wlsDomainName=soabpm12c_dev
wlsDomainName=soabpm_domain
wlsDomainsHome=/u01/app/work/domains
#
#AdminServer
adminServerName=AdminServer
#adminServerName=OsbAdmin
adminUrl=darlin-vce-db:7001
adminUser=weblogic
adminPwd=welcome1
usrCfgFile=wlsCfgFile
usrKeyFile=wlsKeyFile
#Clusters
osbClr=OsbCluster
soaClr=SoaCluster

Create User Config and Key filesIn the property file above you'll see the adminUser and adminPwd (password). On a production environment you probably don't want to have those in plain sight. WebLogic provides a means to encrypt those in to a user config and a key file. When you generate those with the default names to your home folder you even can connect to the AdminServer without providing the username/password. In my scripts I use named files as defined in the usrCfgFile and usrKeyFile properties. But first we need to generate those and for that we need to connect to the AdminServer using the adminUser and adminPwd properties.

I created the script createUserConfigFiles.py to generate those files:
#############################################################################
# Stop AdminServer
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 2.1, 2016-06-27
#
#############################################################################
# Modify these values as necessary
import sys, traceback
scriptName = 'stopAdmin.py'
#
#
lineSeperator='__________________________________________________________________________________'
#
#
def usage():
print 'Call script as: '
print 'Windows: wlst.cmd '+scriptName+' -loadProperties localhost.properties'
print 'Linux: wlst.sh '+scriptName+' -loadProperties environment.properties'
print 'Property file should contain the following properties: '
print "adminUrl=localhost:7101"
print "adminUser=weblogic"
print "adminPwd=welcome1"
#
#
def main():
try:
print(lineSeperator)
print('Create user config files')
print(lineSeperator)
print('\nConnect to the AdminServer: '+adminServerName)
connect(adminUser, adminPwd, adminUrl)
#
print('\nStore Config files')
storeUserConfig(usrCfgFile,usrKeyFile)
#
print('\nExiting...')
except NameError, e:
print('Apparently properties not set.')
print "Please check the property: ", sys.exc_info()[0], sys.exc_info()[1]
usage()
except:
apply(traceback.print_exception, sys.exc_info())
stopEdit('y')
exit(exitcode=1)
#
main();

After connecting to the AdminServer it is the storeUserConfig(usrCfgFile,usrKeyFile) that creates the files. If you don't supply the parameters it will create the default files in your home folder (for instance /home/oracle), then you can connect just by issueing connect('localhost:7001'). For more on this, read this blog.

To call the script above you can use the script createUserConfigFiles.sh or the contents of it:
#!/bin/bash
#############################################################################
# Create user config files using wlst.sh
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 2.1, 2016-06-27
#
#############################################################################
#
. fmw12c_env.sh
echo
echo Create User Config files
wlst.sh ./createUserConfigFiles.py -loadProperties fmw.properties

After having greated the files you can (and should!) remove the adminUser and adminPwd properties from the fmw.properties file.
Start the NodeManager In de domain home/bin folder (for instance /u01/app/work/domains/soabpm_domain/bin) you'll find scripts to start and stop the NodeManager: startNodeManager.sh and stopNodeManager.sh. These are fine to use in the service configurations in Linux or Windows.

However, running them from the shell/command line will cause your session to be taken for the NodeManager. Stopping the session will cause the NodeManager to be stopped. Not so handy if you want to start the NodeManager in an overall script that starts the complete domain.

But you can start the NodeManager from wlst as well. And then it spawns the NodeManager into a seperate process in  the background.
The script startNodeManager.py is quite simple:
#############################################################################
# Start nodemanager
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 2.1, 2016-06-27
#
#############################################################################
# Modify these values as necessary
import sys, traceback
scriptName = sys.argv[0]
#
#
lineSeperator='__________________________________________________________________________________'
#
#
def usage():
print 'Call script as: '
print 'Windows: wlst.cmd '+scriptName+' -loadProperties localhost.properties'
print 'Linux: wlst.sh '+scriptName+' -loadProperties environment.properties'
print 'Property file should contain the following properties: '
print "adminUrl=localhost:7101"
print "adminUser=weblogic"
print "adminPwd=welcome1"
#
#
def startNM(nmHost, nmPort, nmHome, nmType):
print(lineSeperator)
print ('Start NodeManager')
startNodeManager(verbose='true', NodeManagerHome=nmHome, ListenPort=nmPort, ListenAddress=nmHost);
print('Finished starting NodeManager')
#
def main():
try:
startNM(nmHost, nmPort, nmHome, nmType);
except NameError, e:
print('Apparently properties not set.')
print "Please check the property: ", sys.exc_info()[0], sys.exc_info()[1]
usage()
except:
apply(traceback.print_exception, sys.exc_info())
stopEdit('y')
exit(exitcode=1)
#
main()

It's mainly about the startNodeManager(verbose='true', NodeManagerHome=nmHome, ListenPort=nmPort, ListenAddress=nmHost) statement in the  startNM() function, which is quite self explaining, I think.  No username password is required to start the NodeManager, but it does need to know what it's home and listenPort and Address should be.

As with all the scripts I  declare a scripName variable with the assignment of the 0-th argument: sys.argv[0]. This is used in the usage() function that is called in case of a NameError exception. This exception is raised when certain variable or function references are made but not found. Normally this would mean that a certain property is not set in the property file.

To run it from the shell you can use the startNodeManager.sh script:

#!/bin/bash
#############################################################################
# Start nodemanager using wlst
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 2.1, 2016-06-27
#
#############################################################################
#
. fmw12c_env.sh
echo
echo Start NodeManager
wlst.sh ./startNodeManager.py -loadProperties fmw.properties
For every python script in the procession of this blog I have an accompanying shell script like this. So I won't provide those for the other scripts.

Stopping the NodeManager is a little more complicated:
#############################################################################
# Stop nodemanager
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 2.1, 2016-06-27
#
#############################################################################
# Modify these values as necessary
import sys, traceback
scriptName = sys.argv[0]
#
#
lineSeperator='__________________________________________________________________________________'
#
#
def usage():
print 'Call script as: '
print 'Windows: wlst.cmd '+scriptName+' -loadProperties localhost.properties'
print 'Linux: wlst.sh '+scriptName+' -loadProperties environment.properties'
print 'Property file should contain the following properties: '
print "adminUrl=localhost:7101"
print "adminUser=weblogic"
print "adminPwd=welcome1"
#
#
def connectToNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType):
try:
print(lineSeperator)
print('Try to connect to the Node Manager')
try:
nmConnect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, host=nmHost, port=nmPort, domainName=wlsDomainName, domainDir=wlsDomainHome, nmType=nmType)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the NodeManager adminUser and adminPwd properties')
nmConnect(username=adminUser, password=adminPwd, host=nmHost, port=nmPort, domainName=wlsDomainName, domainDir=wlsDomainHome, nmType=nmType)
print('Connected to the Node Mananger')
except WLSTException:
message='Apparently NodeManager not Started!'
print (message)
raise Exception(message)
#
#
def stopNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType):
try:
print(lineSeperator)
print ('Try to connect to the Node Manager')
connectToNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType);
print ('Connected to the Node Mananger')
print ('Stop the NodeManager')
stopNodeManager();
print('Finished stapping NodeManager')
except WLSTException:
print ('Apparently NodeManager not Started!')
#
def main():
try:
wlsDomainHome = wlsDomainsHome+'/'+wlsDomainName
stopNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType);
except NameError, e:
print('Apparently properties not set.')
print "Please check the property: ", sys.exc_info()[0], sys.exc_info()[1]
usage()
except:
apply(traceback.print_exception, sys.exc_info())
stopEdit('y')
exit(exitcode=1)
#
main()

You first need to connect to the NodeManager. This is done in connectToNM() that illustrates the use of the user config and key files with the adminUser/adminPwd properties as a fall back. First it tries to connect using the userConfigFile/userKeyFile combination. If that leads to a NameError, then you probably did not provide those, so it retries it on with the adminUser/adminPwd properties.
This construct is reused when trying to connect to the AdminServer to start the rest of the domain.
When it is connected the nodeManager can be stopped, simply with the stopNodeManager() command.
Start/Stop the AdminServerThe startAdmin.py provided below is used to Start the Admin Server. Again, there are  startWeblogic.sh and stopWeblogic.sh scripts in the bin folder of the domain. But those will start the server in the foreground (although you can move them to the background of course). But mainly the servers aren't under control of the NodeManager, what has it's advantages. So the startAdmin.py script:
#############################################################################
# Start AdminServer via NodeManager and try to connect to it.
# Result of this script should be that you are connect to the AdminServer.
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 2.1, 2016-06-27
#
#############################################################################
# Modify these values as necessary
import sys, traceback
scriptName = sys.argv[0]
#
#
lineSeperator='__________________________________________________________________________________'
#
#
def usage():
print 'Call script as: '
print 'Windows: wlst.cmd '+scriptName+' -loadProperties localhost.properties'
print 'Linux: wlst.sh '+scriptName+' -loadProperties environment.properties'
print 'Property file should contain the following properties: '
print "adminUrl=localhost:7101"
print "adminUser=weblogic"
print "adminPwd=welcome1"
#
#
def connectToNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType):
try:
print(lineSeperator)
print('Try to connect to the Node Manager')
try:
nmConnect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, host=nmHost, port=nmPort, domainName=wlsDomainName, domainDir=wlsDomainHome, nmType=nmType)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the NodeManager adminUser and adminPwd properties')
nmConnect(username=adminUser, password=adminPwd, host=nmHost, port=nmPort, domainName=wlsDomainName, domainDir=wlsDomainHome, nmType=nmType)
print('Connected to the Node Mananger')
except WLSTException:
message='Apparently NodeManager not Started!'
print (message)
raise Exception(message)
#print 'Start Nodemanager'
#startNodeManager(verbose='true', NodeManagerHome=nmHome, ListenPort=nmPort, ListenAddress=nmHost);
#print 'Retry to connect to the Node Manager';
#nmConnect(username=adminUser, password=adminPwd, host=nmHost, port=nmPort, domainName=wlsDomainName, domainDir=wlsDomainHome, nmType=nmType);
#
#
def connectToadminServer(adminUrl, adminServerName):
try:
print(lineSeperator)
print('Try to connect to the AdminServer')
try:
connect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, url=adminUrl)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the AdminServer adminUser and adminPwd properties')
connect(adminUser, adminPwd, adminUrl)
except WLSTException:
print('Apparently AdminServer not Started!')
print('Start AdminServer')
nmStart(adminServerName)
print('Retry to connect to the AdminServer')
try:
connect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, url=adminUrl)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the AdminServer adminUser and adminPwd properties')
connect(adminUser, adminPwd, adminUrl)
#
#
def main():
try:
wlsDomainHome = wlsDomainsHome+'/'+wlsDomainName
print(lineSeperator)
print('Start '+adminServerName+' for domain in : '+wlsDomainHome)
print(lineSeperator)
print ('Connect to the Node Manager')
connectToNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType)
print ('Connect to the AdminServer: '+adminServerName)
connectToadminServer(adminUrl, adminServerName)
except NameError, e:
print('Apparently properties not set.')
print "Please check the property: ", sys.exc_info()[0], sys.exc_info()[1]
usage()
except:
apply(traceback.print_exception, sys.exc_info())
exit(exitcode=1)
#
main();

The script first uses connectToNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType) to connect to the NodeManager. Just in the same way as in the stopNodeManager.py script.
Then it tries to connect to the AdminServer using connectToadminServer(adminUrl, adminServerName). Now, the connect to the NodeManager might be a little over done. But in the connectToadminServer() function it tries to connect to the AdminServer the same way as to the NodeManager: first with the userConfigFile, userKeyFile combination. But when those properties aren't set, it uses the username password combination. If a connection to the AdminServer fails, the function concludes that it isn't started yet. But since it is still connected to the nodemanager it can start the AdminServer using nmStart(adminServerName). So it is important that in the adminServerName property in the fmw.properties the correct name of the AdminServer is given.

To stop the admin server I have the stopAdmin.py script:
#############################################################################
# Stop AdminServer
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 2.1, 2016-06-27
#
#############################################################################
# Modify these values as necessary
import sys, traceback
scriptName = sys.argv[0]
#
#
lineSeperator='__________________________________________________________________________________'
#
#
def usage():
print 'Call script as: '
print 'Windows: wlst.cmd '+scriptName+' -loadProperties localhost.properties'
print 'Linux: wlst.sh '+scriptName+' -loadProperties environment.properties'
print 'Property file should contain the following properties: '
print "adminUrl=localhost:7101"
print "adminUser=weblogic"
print "adminPwd=welcome1"
#
#
def connectToadminServer( adminUrl, adminServerName):
try:
print(lineSeperator)
print('Try to connect to the AdminServer using user config')
connect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, url=adminUrl)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the AdminServer adminUser and adminPwd properties')
connect(adminUser, adminPwd, adminUrl)
except WLSTException:
message='Apparently AdminServer not Started!'
print (message)
raise Exception(message)
#
#
def main():
try:
wlsDomainHome = wlsDomainsHome+'/'+wlsDomainName
print(lineSeperator)
print('Stop '+adminServerName+' for domain in : '+wlsDomainHome)
print(lineSeperator)
print('\nConnect to the AdminServer: '+adminServerName)
connectToadminServer(adminUrl, adminServerName)
#
print('\nShutdown the AdminServer: '+adminServerName)
shutdown(force='true')
#
print('\nFinished stopping AdminServer: '+adminServerName)
except NameError, e:
print('Apparently properties not set.')
print "Please check the property: ", sys.exc_info()[0], sys.exc_info()[1]
usage()
except:
apply(traceback.print_exception, sys.exc_info())
exit(exitcode=1)
#
main();

This one does a connect to the AdminServer (in the same two layer approach), and when connected it performs a shutdown(force='true'). This is equivalant to the 'Force Shutdown Now' option in the console. Since no server or cluster name is provided the AdminServer is shutdown.
Start&Stop DomainIn my create domain scripts I create clusters for every component. Even when I have only one managed server (for instance in a development environment) I added the servers to a cluster. This makes it easier to expand the domain with multiple nodes. And it makes the management the same for every environment.

So to start and stop the domain I work per cluster. The nice thing then is that when connected you can just issue a start cluster command and the AdminServer uses the different nodeManagers on the hosts to start the servers simultaneously. This reduces the startup time significantly compared to starting the servers of a cluster one by one.

 Now, it might be that one of the servers couldn't be started right away. And this fails the start cluster command. So I added a little code to try to start the different servers one by one. I think it is somewhat over done in most cases, but it does illustrate some functions to figure out the servers to start and to determine their state. So here is my startDomain.py script:
#############################################################################
# Start SOA and OSB domain
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 1.1, 2016-06-27
#
#############################################################################
# Modify these values as necessary
import sys, traceback
scriptName = sys.argv[0]
#
#
lineSeperator='__________________________________________________________________________________'
#
#
def usage():
print 'Call script as: '
print 'Windows: wlst.cmd '+scriptName+' -loadProperties localhost.properties'
print 'Linux: wlst.sh '+scriptName+' -loadProperties environment.properties'
print 'Property file should contain the following properties: '
print "adminUrl=localhost:7001"
print "adminUser=weblogic"
print "adminPwd=welcome1"
#
#
def connectToNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType):
try:
print(lineSeperator)
print('Try to connect to the Node Manager')
try:
nmConnect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, host=nmHost, port=nmPort, domainName=wlsDomainName, domainDir=wlsDomainHome, nmType=nmType)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the NodeManager adminUser and adminPwd properties')
nmConnect(username=adminUser, password=adminPwd, host=nmHost, port=nmPort, domainName=wlsDomainName, domainDir=wlsDomainHome, nmType=nmType)
print('Connected to the Node Mananger')
except WLSTException:
message='Apparently NodeManager not Started!'
print (message)
raise Exception(message)
#print 'Start Nodemanager'
#startNodeManager(verbose='true', NodeManagerHome=nmHome, ListenPort=nmPort, ListenAddress=nmHost);
#print 'Retry to connect to the Node Manager';
#nmConnect(username=adminUser, password=adminPwd, host=nmHost, port=nmPort, domainName=wlsDomainName, domainDir=wlsDomainHome, nmType=nmType);
#
#
def connectToadminServer(adminUrl, adminServerName):
try:
print(lineSeperator)
print('Try to connect to the AdminServer')
try:
connect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, url=adminUrl)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the AdminServer adminUser and adminPwd properties')
connect(adminUser, adminPwd, adminUrl)
except WLSTException:
print('Apparently AdminServer not Started!')
print('Start AdminServer')
nmStart(adminServerName)
print('Retry to connect to the AdminServer')
try:
connect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, url=adminUrl)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the AdminServer adminUser and adminPwd properties')
connect(adminUser, adminPwd, adminUrl)
#
# Get the Servers of Cluster
def getClusterServers(clustername):
#Cluster config to be fetched from ServerConfig
print(lineSeperator)
print('\nGet Servers from cluster '+clustername)
serverConfig()
cluster = getMBean("/Clusters/" + clustername)
if cluster is None:
errorMsg= "Cluster " + clustername + " does not appear to exist!"
print errorMsg
raise(Exception(errorMsg))
print "Found cluster "+ clustername+ "."
servers = cluster.getServers()
return servers
#
#
def serverStatus(serverName):
serverRuntime=getMBean('/ServerRuntimes/'+serverName)
if serverRuntime is None:
print("Server Runtime for " + serverName + " not found, server apparently SHUTDOWN")
serverState="SHUTDOWN"
else:
print "Found Server Runtime for "+ serverName+ "."
serverState = serverRuntime.getState()
return serverState
#
#
def startClusterServersOneByOne(clusterName):
print(lineSeperator)
print ('Start servers for cluster: '+clusterName)
servers=getClusterServers(clusterName)
# Need to go to domainRuntime to get to the serverRuntimes.
domainRuntime()
#
for server in servers:
print(lineSeperator)
serverName = server.getName()
print('ServerName: '+serverName)
serverState = serverStatus(serverName)
print('Server '+serverName+': '+serverState)
if serverState=="SHUTDOWN":
print ('Server '+serverName+' is not running so start it.')
start(serverName)
elif serverState=="RUNNING":
print ('Server '+serverName+' is already running')
else:
print ('Server '+serverName+' in state '+serverState+', not startable!')
#
print ('\nFinished starting servers.')
#
#
def startClusterServers(clusterName):
print(lineSeperator)
print ('Start servers for cluster: '+clusterName)
#
try:
start(clusterName,'Cluster')
except WLSTException:
print "Apparently Cluster in incompatible state!", sys.exc_info()[0], sys.exc_info()[1]
startClusterServersOneByOne(clusterName)
state(clusterName,'Cluster')
#
print ('\nFinished starting servers.')
#
#
def main():
try:
wlsDomainHome = wlsDomainsHome+'/'+wlsDomainName
print (lineSeperator)
print ('Start Osb Cluster')
print('\nConnect to AdminServer ')
print (lineSeperator)
print ('Connect to the Node Manager')
connectToNM(nmHost, nmPort, nmHome, wlsDomainName, wlsDomainHome, nmType)
print ('Connect to the AdminServer: '+adminServerName)
connectToadminServer(adminUrl, adminServerName)
#
print('Start servers for cluster: '+osbClr)
startClusterServers(osbClr)
#
print('Start servers for cluster: '+soaClr)
startClusterServers(soaClr)
#
print('\nExiting...')
exit()
except NameError, e:
print('Apparently properties not set.')
print "Please check the property: ", sys.exc_info()[0], sys.exc_info()[1]
usage()
except:
apply(traceback.print_exception, sys.exc_info())
exit(exitcode=1)
#call main()
main()
exit()

It first connects to the AdminServer in the familiar way. If that fails it tries to start it. So far it is copied from the startAdmin.py script. Then it calls the startClusterServers(clusterName) function for each cluster. You need to add each cluster here by hand. I could loop over the clusternames, but you might need to have them started in a certain order. This function first issues the start(clusterName,'Cluster') command. Providing the 'Cluster' parameter as a start type, a complete cluster can be started. If that fails, then apparently one or more servers failed to start. If so it tries to start the servers one by one in the startClusterServersOneByOne(clusterName) function. It gets the servers attached to the cluster using getClusterServers(clustername) function. This is done using the getServers() method of the cluster. This needs to be done in the serverConfig() state. After that for each server the status is fetched by querying the serverRuntime of the server in the serverStatus() function. ServerRuntimes are available in the DomainRuntime() state, so it is needed to switch the state using that function. If the ServerRuntime is not avaiable, the state is considered to be 'SHUTDOWN'. If the server is down a start(serverName) is issued. Lastly in the startClusterServers() function the state(clusterName,'Cluster') is called to print the state of the servers in the cluster.

To Stop the domain I created the stopDomain.py which mainly works in reverse:
#############################################################################
# Stop OSB Domain
#
# @author Martien van den Akker, Darwin-IT Professionals
# @version 1.1, 2016-06-27
#
#############################################################################
# Modify these values as necessary
import sys, traceback
scriptName = sys.argv[0]
#
#
lineSeperator='__________________________________________________________________________________'
#
#
def usage():
print 'Call script as: '
print 'Windows: wlst.cmd '+scriptName+' -loadProperties localhost.properties'
print 'Linux: wlst.sh '+scriptName+' -loadProperties environment.properties'
print 'Property file should contain the following properties: '
print "adminUrl=localhost:7001"
print "adminUser=weblogic"
print "adminPwd=welcome1"
#
#
def connectToadminServer(adminUrl, adminServerName):
try:
print(lineSeperator)
print('Try to connect to the AdminServer')
try:
connect(userConfigFile=usrCfgFile, userKeyFile=usrKeyFile, url=adminUrl)
except NameError, e:
print('Apparently user config properties usrCfgFile and usrKeyFile not set.')
print('Try to connect to the AdminServer adminUser and adminPwd properties')
connect(adminUser, adminPwd, adminUrl)
except WLSTException:
message='Apparently AdminServer not Started!'
print (message)
raise Exception(message)
#
# Get the Servers of Cluster
def getClusterServers(clustername):
#Cluster config to be fetched from ServerConfig
print(lineSeperator)
print('\nGet Servers from cluster '+clustername)
serverConfig()
cluster = getMBean("/Clusters/" + clustername)
if cluster is None:
errorMsg= "Cluster " + clustername + " does not appear to exist!"
print errorMsg
raise(Exception(errorMsg))
print "Found cluster "+ clustername+ "."
servers = cluster.getServers()
return servers
#
#
def serverStatus(serverName):
serverRuntime=getMBean('/ServerRuntimes/'+serverName)
if serverRuntime is None:
print("Server Runtime for " + serverName + " not found, server apparently SHUTDOWN")
serverState="SHUTDOWN"
else:
print "Found Server Runtime for "+ serverName+ "."
serverState = serverRuntime.getState()
return serverState
#
#
def stopClusterServers(clusterName):
print(lineSeperator)
print ('Stop servers for cluster: '+clusterName)
#
try:
shutdown(clusterName,'Cluster')
except WLSTException:
print "Apparently Cluster in incompatible state!", sys.exc_info()[0], sys.exc_info()[1]
state(clusterName,'Cluster')
print ('Try to stop servers for cluster: '+clusterName+', one by one')
servers=getClusterServers(clusterName)
# Need to go to domainRuntime to get to the serverRuntimes.
domainRuntime()
#
for server in servers:
print(lineSeperator)
serverName = server.getName()
print('ServerName: '+serverName)
serverState = serverStatus(serverName)
print('Server '+serverName+': '+serverState)
if serverState=="RUNNING":
print ('Server '+serverName+' is running so shut it down.')
shutdown(name=serverName, force='true')
elif serverState=="SHUTDOWN":
print ('Server '+serverName+' is already down.')
else:
print ('Server '+serverName+' in state '+serverState+', not stoppable!')
#
print ('\nFinished stopping servers.')
#
#
def main():
try:
wlsDomainHome = wlsDomainsHome+'/'+wlsDomainName
print (lineSeperator)
print ('Stop Osb Domain')
print (lineSeperator)
print('\nConnect to the AdminServer: '+adminServerName)
connectToadminServer(adminUrl, adminServerName)
print(lineSeperator)
print('First stop servers from cluster '+osbClr)
stopClusterServers(osbClr)
#
print(lineSeperator)
print('\nShutdown the AdminServer: '+adminServerName)
shutdown(force='true')
print ('\nFinished stopping servers.')
#
print('\nExiting...')
exit()
except NameError, e:
print('Apparently properties not set.')
print "Please check the property: ", sys.exc_info()[0], sys.exc_info()[1]
usage()
except:
apply(traceback.print_exception, sys.exc_info())
exit(exitcode=1)
#call main()
main()
exit()

In the sameway as in starting the servers this script first tries to shutdown the cluster as a whole. The AdminServer takes advantage of the NodeManager to simulaneously stop the servers. The NodeManager first tries to connect to the particular server to hand over a suicide pill. But if it can't reach the server directly it releases it from suffering by doing an explicit OS-Level kill process...
After the shutdown of the servers the AdminServer is shut down.
ConclusionThis concludes this article on starting and stopping your domain. I hope it was enlighting and entertaining. One improvements  would be to reuse the scripts on starting and stopping the AdminServer in the starting and stopping of the Domain. You see that there is some code-overlap. But the way I call them with an explicit property file prevents doing a execfile(). But the properties loaded aren't passed to the execfile() apparently. And it needs a path to the other file. So that's why I for now combined the code into one script.

Pages

Subscribe to Oracle FAQ aggregator