Can multiple Powershell v4 DSC configuration objects be combined on a machine?

I'm working on configuring servers using Powershell Desired State Configuration (DSC). I have several different groups of IIS servers. The configuration for all of them is about 90% identical, but there are differences between the groups.
In order to follow good programming practices and re-use the common code, I attempted to use multiple configuration objects to configure the groups. There was one configuration object full of common configuration, and then each group had a configuration
object with group specific config. It looked something like this:
Configuration CommonConfiguration {
Node "IISServer1" {
#Common configuration settings go here, such as this one (to keep things brief, I'm only showing one setting... there would be many more):
WindowsFeature Role_Web_Server_IIS
Ensure = "Present"
Name = "Web-Server"
Configuration IISGroup1Configuration {
Node "IISServer1" {
#Configuration resources for group1 go here. Again, much shorter than real life.
WindowsFeature Feature_ASP_Dot_Net_4_5
Ensure = "Present"
Name = "Web-Asp-Net45"
To fully configure a server in my first group of IIS servers, I would need to use both these configuration objects by running them like this:
CommonConfiguration
IISGroup1Configuration
Start-DscConfiguration -Path ".\CommonConfiguration\"
Start-DscConfiguration -Path ".\IISGroup1Configuration\"
DSCConfiguration runs twice and starts two Powershell jobs, both of which seem to complete. But there is a problem, and I'm wondering if it is at all solvable.
Problem:
When I try to use other DSC cmdlets to control my server's configuration, such as Restore-DCSConfiguration or Get-DSCConfiguration, it only seems to work on what ever configuration object ran last. For example, Get-DSCConfiguration returns only the IISGroup1Configuration,
because that ran last. I've tried playing around with order, and whichever configuration I run last is what is returned. Similarly, if I were to try to keep my configuration enforced with restore-configuration, it's only going to work on IISGroup1Configuration,
because it ran last. This is an example of what I ran that returned only one of the configuration objects.
Get-DscConfiguration -CimSession "IISServer1"
The behavior I want is for the server to treat ever configuration block run on it as its configuration and return all of them. But since it doesn't, does this mean I have to have everything needed to configure a server in a single configuration block? For
example, if I wanted to use DSC to configure two groups of IIS servers, would I have to have the following?
Configuration Group1 {
Node "IISServer1" {
#---Common configuration, 90% the same---
#---Group 1 specifics----
Configuration Group2 {
Node "IISServer2" {
#---Common configuration copy pasted in, 90% the same---
#---Group 2 specifics----
If this is how I have to do things, and a node can have only one configuration block be its "configuration", then this is absolutely terrible from a code reuse perspective. If I have six groups of servers, and I want to edit some shared code, I'm
going to have to go into six groups of configuration objects and edit the same line six times. That leads to errors and makes a mess. Is there any way to avoid this, while have the server consider all configuration objects run against it to be part of
its configuration?

Hi AlgebraicMirror,
Sorry for the delay.
I am trying to involve someone familiar with this topic to further look at this issue.
There might be some time delay. Appreciate your patience.
If you have any feedback on our support,
please click here.
Best Regards,
Anna
TechNet Community Support

Similar Messages

  • Can Multiple Objects be copied into Sales Order??????

    Hi,
    I have created three charecteristics and assigned to a class of class type 001. In the classification view of material master for each material i assigned the class.This assignment is done for calling the object at sales order level.
    I am able to find the multiple objects for single characteristics in sales order but multiple objects are not copied into sales order..only single object is copied into sales order...when i try to copy multiple objects system is throwing warning message as "You can only copy one object in this mode".... Is it possible to copy multiple objects ?? Any answers will be highly appreciated.
    Ramagiri.

    Hi,
    But what's the purpose behind that.Material Class 001 is just only for information purpose only to search the materials with help of class and characterstic.
    If your material is configuable one then you have to use Class type 200 - Material (Configurable Objects) and for the same you have maintain the characterstic value during sales order creation.
    Regards,
    Dhaval

  • How can a JMS adapter be configured in BPEL to consume messages from multiple queues ?

    How can a JMS adapter be configured in BPEL to consume messages from multiple queues ?

    If you want to use JMS with AQ as datastore then there is some configuration you need to do to enable this. This is outside SOA Suite per sa, e.g. no adapter required.
    If you want to connect to the AQ direct then use the AQ adapter.
    this blog may be of some help understand the configuration
    http://biemond.blogspot.com/2008/01/oracle-jms-with-esb-and-bpel.html
    cheers
    James

  • Index creation error. Can't lock configuration object.

    Hi,
    My Trex it is giving me a lot of trouble. I am not able to create index with the Trex Search and Classification service (the message I get is==> Index could not be created: null)
    The defaulttrace says:
    #1.5 #0017A4F64A4801160000003200001F7000043C109F857E90#1191942000781#com.sap.workflow#sap.com/irj#com.sap.workflow#Guest#0####9fd2cf80767011dc9b4f0017a4f64a48#Thread[ThreadPool.Worker4,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error#1#/Applications/Workflow/General#Plain###TaskSchedulerDeadline.run()#
    #1.5 #0017A4F64A4801160000003300001F7000043C109F859265#1191942000797#com.sap.workflow#sap.com/irj#com.sap.workflow.#Guest#0####9fd2cf80767011dc9b4f0017a4f64a48#Thread[ThreadPool.Worker4,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###LockConfigException: Cannot lock configuration object "config://local/com.sap.workflow/scheduler/task" without a valid user ID.
    at com.sapportals.config.fwk.data.ConfigLockManager.lock(ConfigLockManager.java:516)
    at com.sapportals.config.fwk.data.ConfigLockManager.lock(ConfigLockManager.java:265)
    at com.sapportals.config.fwk.data.Configurable.lock(Configurable.java:184)
    at com.sapportals.config.fwk.data.ConfigPlugin.getAndLockConfigurable(ConfigPlugin.java:452)
    at com.sap.workflow.cfg.AbstractConfiguration.setValue(AbstractConfiguration.java:313)
    at com.sap.workflow.es.scheduler.TaskSchedulerDeadline.run(TaskSchedulerDeadline.java:86)
    at com.sapportals.wcm.service.scheduler.SchedulerEntry.run(SchedulerEntry.java:174)
    at com.sapportals.wcm.service.scheduler.crt.PoolWorker.run(PoolWorker.java:108)
    at java.lang.Thread.run(Thread.java:534)
    What means the message "Cannot lock configuration object "config://local/com.sap.workflow/scheduler/task" without a valid user ID."?
    Have I to do something abut configuration, users, permissions??
    The version is 7.00 patch 57
    Operation system is WServer 2003SR2 Enterprise Edition (En)
    I have installed the TREX HTTP server
    In Monitoring I see a green light for http server, index server, name server, queue server
    I am so confused, don't know wich way to turn.
    Any help will be appreciated.
    Thanks in advance.
    Guillermo.

    Hi,
    It was an error caused by permissions.
    By mistake the repository /taxonomies was manipulated by an user and the permissions were changed.
    After it the portal wasn't able to create new folders under that repository.
    Regards.

  • Can Multiple Webgate/OAM/IdentityStores access one multitenant WLS domain?

    Can multiple access points ( web tier + OAM + Identity store) access one application?
    The objective here is to have one multi-tenant ADF application accessed by users who are authenthicated by their own enterprise sso and identity store. Authenthicated session should pass the context with list of all enterprise roles that user belongs to which would be used for authorization by the multitenant application. It is assumed here that naming convention for relevant roles is followed by all participating identity stores.
    Can Webgate/OAM and accessed WebLogic domain be configured to accomplish this?

    OAM can pass as header variables all of the things you mention. For example, you get these by default:
    OAM_REMOTE_USER containing the userid of the logged in user (eg "jsmith")
    HTTP_OAM_IDENTITY_DOMAIN containing the name of the Identity Store that the logged in user belongs to, as known to the OAM admin console (eg "SunLDAP")
    additionally you can define a headervar that contains the user's ldap group membership, and one that contains the user's full DN (or any other attribute and other information).
    Of course, any receiving app would need to be configured to consume this information.
    Regards,
    Colin

  • 22591 The specified computer name (%ComputerName;) is already in use by another virtual machine or by a virtual machine configuration object. Ensure that the computer name is unique in the VMM environment, and then try again.

    Hello everyone,
    I recently bummed into an error message when I want to deploy a service template.
    Setup:
    1 HyperV server on win2k12 r2
    1 SCCM VMM 2k12r2 on the hyperv server
    1 template with all the objects in the library
    Error:
    When I deploy the the service template I get the below error message.
    22591
    The specified computer name (%ComputerName;) is already in use by another virtual machine or by a virtual machine configuration object.
    Ensure that the computer name is unique in the VMM environment, and then try again.
    The issue is that I can't find it anywhere, not on my domain controller not on my dns server as a record and also not as a vm in sccm or in powershell when doing get-vm. So where do I need to remove it ( no it is not an option to create a new Hostname for
    this service template ).
    Andre

    There could be a couple things happening.
    One - you have a Service Template, it defines %Computername% as a variable.  And you have deployed this Template once using 'foo' and you are deploying it again as 'foo' without deleting the previous instance.
    Two - you hardcoded the computer name into the template.
    Three - you are scaling out and you have hit the bug that the wizard does not increment the machinename if you have something like computername## where SCVMM should be incrementing the machine name.
    Windows does not support identically named machines (you can't have two machines on the same network with the same computer name - they broadcast their name and the 'second' one shuts down its network stack).  In support of this SCVMM also enforces
    this rule.
    And with any templates SCVMM is in charge of machine names at deployment.
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

  • A self documenting DSC Configuration wich contains all Resources

    One funny thing with PowerShell is allways: It can document himself.
    Inspired by Steven Murawskis video on Desired State Configuration (DSC) I have done a full Blowen full self documenting DSC Configuration:
    Not perfect but it works for the first shot...
    This code:
    $ConfigOut = @"
    Configuration Name {
    param(
    [String]`$Parameter1
    # One can evaluate expression
    # E.g.: `$AllNodes.Where("Role -eq Web").NodeName
    Node ('Node1','Node2','Node3') {
    $(
    Get-DscResource | ForEach {
    "`n`t`t# Call the '$($_.Name)' Resource the Provider`n"
    "`t`t$($_.Name) FriendlyName {`n`n"
    "`t`t`t# Possible Resource Options`n"
    $Ofs = "','"
    $_.Properties | ForEach {
    "`t`t`t$($_.Name) = '$($_.Values)' # Type:$($_.PropertyType) $(If($_.IsMandatory) {'is Mandatory!'})`n"
    $Ofs = ' '
    "`t`t}`n"
    } # end Node
    } # end Configuration
    $ConfigOut
    Produces this output on my Windows 8.1:
    Configuration Name {
    param(
    [String]$Parameter1
    # One can evaluate expression
    # E.g.: $AllNodes.Where("Role -eq Web").NodeName
    Node ('Node1','Node2','Node3') {
    # Call the 'File' Resource the Provider
    File FriendlyName {
    # Possible Resource Options
    DestinationPath = '' # Type:[string] is Mandatory!
    Attributes = 'Archive','Hidden','ReadOnly','System' # Type:[string[]]
    Checksum = 'CreatedDate','ModifiedDate','SHA-1','SHA-256','SHA-512' # Type:[string]
    Contents = '' # Type:[string]
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    Force = '' # Type:[bool]
    MatchSource = '' # Type:[bool]
    Recurse = '' # Type:[bool]
    SourcePath = '' # Type:[string]
    Type = 'Directory','File' # Type:[string]
    # Call the 'Archive' Resource the Provider
    Archive FriendlyName {
    # Possible Resource Options
    Destination = '' # Type:[string] is Mandatory!
    Path = '' # Type:[string] is Mandatory!
    Checksum = 'CreatedDate','ModifiedDate','SHA-1','SHA-256','SHA-512' # Type:[string]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    Force = '' # Type:[bool]
    Validate = '' # Type:[bool]
    # Call the 'Environment' Resource the Provider
    Environment FriendlyName {
    # Possible Resource Options
    Name = '' # Type:[string] is Mandatory!
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    Path = '' # Type:[bool]
    Value = '' # Type:[string]
    # Call the 'Group' Resource the Provider
    Group FriendlyName {
    # Possible Resource Options
    GroupName = '' # Type:[string] is Mandatory!
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Description = '' # Type:[string]
    Ensure = 'Absent','Present' # Type:[string]
    Members = '' # Type:[string[]]
    MembersToExclude = '' # Type:[string[]]
    MembersToInclude = '' # Type:[string[]]
    # Call the 'Log' Resource the Provider
    Log FriendlyName {
    # Possible Resource Options
    Message = '' # Type:[string] is Mandatory!
    DependsOn = '' # Type:[string[]]
    # Call the 'Package' Resource the Provider
    Package FriendlyName {
    # Possible Resource Options
    Name = '' # Type:[string] is Mandatory!
    Path = '' # Type:[string] is Mandatory!
    ProductId = '' # Type:[string] is Mandatory!
    Arguments = '' # Type:[string]
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    LogPath = '' # Type:[string]
    ReturnCode = '' # Type:[UInt32[]]
    # Call the 'Registry' Resource the Provider
    Registry FriendlyName {
    # Possible Resource Options
    Key = '' # Type:[string] is Mandatory!
    ValueName = '' # Type:[string] is Mandatory!
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    Force = '' # Type:[bool]
    Hex = '' # Type:[bool]
    ValueData = '' # Type:[string[]]
    ValueType = 'Binary','Dword','ExpandString','MultiString','Qword','String' # Type:[string]
    # Call the 'Script' Resource the Provider
    Script FriendlyName {
    # Possible Resource Options
    GetScript = '' # Type:[string] is Mandatory!
    SetScript = '' # Type:[string] is Mandatory!
    TestScript = '' # Type:[string] is Mandatory!
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    # Call the 'Service' Resource the Provider
    Service FriendlyName {
    # Possible Resource Options
    Name = '' # Type:[string] is Mandatory!
    BuiltInAccount = 'LocalService','LocalSystem','NetworkService' # Type:[string]
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    StartupType = 'Automatic','Disabled','Manual' # Type:[string]
    State = 'Running','Stopped' # Type:[string]
    # Call the 'User' Resource the Provider
    User FriendlyName {
    # Possible Resource Options
    UserName = '' # Type:[string] is Mandatory!
    DependsOn = '' # Type:[string[]]
    Description = '' # Type:[string]
    Disabled = '' # Type:[bool]
    Ensure = 'Absent','Present' # Type:[string]
    FullName = '' # Type:[string]
    Password = '' # Type:[PSCredential]
    PasswordChangeNotAllowed = '' # Type:[bool]
    PasswordChangeRequired = '' # Type:[bool]
    PasswordNeverExpires = '' # Type:[bool]
    # Call the 'WindowsFeature' Resource the Provider
    WindowsFeature FriendlyName {
    # Possible Resource Options
    Name = '' # Type:[string] is Mandatory!
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    IncludeAllSubFeature = '' # Type:[bool]
    LogPath = '' # Type:[string]
    Source = '' # Type:[string]
    # Call the 'WindowsProcess' Resource the Provider
    WindowsProcess FriendlyName {
    # Possible Resource Options
    Arguments = '' # Type:[string] is Mandatory!
    Path = '' # Type:[string] is Mandatory!
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    StandardErrorPath = '' # Type:[string]
    StandardInputPath = '' # Type:[string]
    StandardOutputPath = '' # Type:[string]
    WorkingDirectory = '' # Type:[string]
    } # end Node
    } # end Configuration
    Watch:
    Steven Murawskis and Joel Bennett: Video on Desired State Configuration (DSC)
    http://www.youtube.com/watch?v=EN8eJA9rpXw
    hope this helps....
    PowerShell Artikel, Buchtipps und kostenlose PowerShell Tutorials + E-Books
    auf der deutschsprachigen PowerShell Community
    Mein 21 Teiliger PowerShell Video Grundlehrgang
    Deutsche PowerShell Videos auf Youtube
    Folge mir auf:
    Twitter |
    Facebook |
    Google+

    One funny thing with PowerShell is allways: It can document himself.
    Inspired by Steven Murawskis video on Desired State Configuration (DSC) I have done a full Blowen full self documenting DSC Configuration:
    Not perfect but it works for the first shot...
    This code:
    $ConfigOut = @"
    Configuration Name {
    param(
    [String]`$Parameter1
    # One can evaluate expression
    # E.g.: `$AllNodes.Where("Role -eq Web").NodeName
    Node ('Node1','Node2','Node3') {
    $(
    Get-DscResource | ForEach {
    "`n`t`t# Call the '$($_.Name)' Resource the Provider`n"
    "`t`t$($_.Name) FriendlyName {`n`n"
    "`t`t`t# Possible Resource Options`n"
    $Ofs = "','"
    $_.Properties | ForEach {
    "`t`t`t$($_.Name) = '$($_.Values)' # Type:$($_.PropertyType) $(If($_.IsMandatory) {'is Mandatory!'})`n"
    $Ofs = ' '
    "`t`t}`n"
    } # end Node
    } # end Configuration
    $ConfigOut
    Produces this output on my Windows 8.1:
    Configuration Name {
    param(
    [String]$Parameter1
    # One can evaluate expression
    # E.g.: $AllNodes.Where("Role -eq Web").NodeName
    Node ('Node1','Node2','Node3') {
    # Call the 'File' Resource the Provider
    File FriendlyName {
    # Possible Resource Options
    DestinationPath = '' # Type:[string] is Mandatory!
    Attributes = 'Archive','Hidden','ReadOnly','System' # Type:[string[]]
    Checksum = 'CreatedDate','ModifiedDate','SHA-1','SHA-256','SHA-512' # Type:[string]
    Contents = '' # Type:[string]
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    Force = '' # Type:[bool]
    MatchSource = '' # Type:[bool]
    Recurse = '' # Type:[bool]
    SourcePath = '' # Type:[string]
    Type = 'Directory','File' # Type:[string]
    # Call the 'Archive' Resource the Provider
    Archive FriendlyName {
    # Possible Resource Options
    Destination = '' # Type:[string] is Mandatory!
    Path = '' # Type:[string] is Mandatory!
    Checksum = 'CreatedDate','ModifiedDate','SHA-1','SHA-256','SHA-512' # Type:[string]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    Force = '' # Type:[bool]
    Validate = '' # Type:[bool]
    # Call the 'Environment' Resource the Provider
    Environment FriendlyName {
    # Possible Resource Options
    Name = '' # Type:[string] is Mandatory!
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    Path = '' # Type:[bool]
    Value = '' # Type:[string]
    # Call the 'Group' Resource the Provider
    Group FriendlyName {
    # Possible Resource Options
    GroupName = '' # Type:[string] is Mandatory!
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Description = '' # Type:[string]
    Ensure = 'Absent','Present' # Type:[string]
    Members = '' # Type:[string[]]
    MembersToExclude = '' # Type:[string[]]
    MembersToInclude = '' # Type:[string[]]
    # Call the 'Log' Resource the Provider
    Log FriendlyName {
    # Possible Resource Options
    Message = '' # Type:[string] is Mandatory!
    DependsOn = '' # Type:[string[]]
    # Call the 'Package' Resource the Provider
    Package FriendlyName {
    # Possible Resource Options
    Name = '' # Type:[string] is Mandatory!
    Path = '' # Type:[string] is Mandatory!
    ProductId = '' # Type:[string] is Mandatory!
    Arguments = '' # Type:[string]
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    LogPath = '' # Type:[string]
    ReturnCode = '' # Type:[UInt32[]]
    # Call the 'Registry' Resource the Provider
    Registry FriendlyName {
    # Possible Resource Options
    Key = '' # Type:[string] is Mandatory!
    ValueName = '' # Type:[string] is Mandatory!
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    Force = '' # Type:[bool]
    Hex = '' # Type:[bool]
    ValueData = '' # Type:[string[]]
    ValueType = 'Binary','Dword','ExpandString','MultiString','Qword','String' # Type:[string]
    # Call the 'Script' Resource the Provider
    Script FriendlyName {
    # Possible Resource Options
    GetScript = '' # Type:[string] is Mandatory!
    SetScript = '' # Type:[string] is Mandatory!
    TestScript = '' # Type:[string] is Mandatory!
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    # Call the 'Service' Resource the Provider
    Service FriendlyName {
    # Possible Resource Options
    Name = '' # Type:[string] is Mandatory!
    BuiltInAccount = 'LocalService','LocalSystem','NetworkService' # Type:[string]
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    StartupType = 'Automatic','Disabled','Manual' # Type:[string]
    State = 'Running','Stopped' # Type:[string]
    # Call the 'User' Resource the Provider
    User FriendlyName {
    # Possible Resource Options
    UserName = '' # Type:[string] is Mandatory!
    DependsOn = '' # Type:[string[]]
    Description = '' # Type:[string]
    Disabled = '' # Type:[bool]
    Ensure = 'Absent','Present' # Type:[string]
    FullName = '' # Type:[string]
    Password = '' # Type:[PSCredential]
    PasswordChangeNotAllowed = '' # Type:[bool]
    PasswordChangeRequired = '' # Type:[bool]
    PasswordNeverExpires = '' # Type:[bool]
    # Call the 'WindowsFeature' Resource the Provider
    WindowsFeature FriendlyName {
    # Possible Resource Options
    Name = '' # Type:[string] is Mandatory!
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    IncludeAllSubFeature = '' # Type:[bool]
    LogPath = '' # Type:[string]
    Source = '' # Type:[string]
    # Call the 'WindowsProcess' Resource the Provider
    WindowsProcess FriendlyName {
    # Possible Resource Options
    Arguments = '' # Type:[string] is Mandatory!
    Path = '' # Type:[string] is Mandatory!
    Credential = '' # Type:[PSCredential]
    DependsOn = '' # Type:[string[]]
    Ensure = 'Absent','Present' # Type:[string]
    StandardErrorPath = '' # Type:[string]
    StandardInputPath = '' # Type:[string]
    StandardOutputPath = '' # Type:[string]
    WorkingDirectory = '' # Type:[string]
    } # end Node
    } # end Configuration
    Watch:
    Steven Murawskis and Joel Bennett: Video on Desired State Configuration (DSC)
    http://www.youtube.com/watch?v=EN8eJA9rpXw
    hope this helps....
    PowerShell Artikel, Buchtipps und kostenlose PowerShell Tutorials + E-Books
    auf der deutschsprachigen PowerShell Community
    Mein 21 Teiliger PowerShell Video Grundlehrgang
    Deutsche PowerShell Videos auf Youtube
    Folge mir auf:
    Twitter |
    Facebook |
    Google+

  • How can I insert values from table object into a regular table

    I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
    CREATE TABLE ITEM
    ITEMID VARCHAR2(10) NOT NULL,
    PRODUCTID VARCHAR2(10) NOT NULL,
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE T_ITEM_OBJ AS OBJECT
    ITEMID VARCHAR2(10),
    PRODUCTID VARCHAR2(10),
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
    PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
    When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
    In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
    INSERT INTO ITEM
    ITEMID,
    PRODUCTID,
    LISTPRICE,
    UNITCOST,
    STATUS,
    SUPPLIER,
    ATTR1
    ) SELECT ITEMID, PRODUCTID, LISTPRICE,
    UNITCOST, STATUS, SUPPLIER, ATTR1
    FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
    WHERE it.ITEMID != NULL;
    COMMIT;
    Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
    Thanks.

    Sigh. I answered this in your other How can I convert table object into table record format?.
    Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
    Thank you for your future co-operation.
    Cheers, APC

  • Can multiple threads write to the database?

    I am a little confused from the statement in the documentation: "Berkeley DB Data Store does not support locking, and hence does not guarantee correct behavior if more than one thread of control is updating the database at a time."
    1. Can multiple threads write to the "Simple Data Store"?
    2. Considering the sample code below which writes to the DB using 5 threads - is there a possibility of data loss?
    3. If the code will cause data loss, will adding DB_INIT_LOCK and/or DB_INIT_TXN in DBENV->open make any difference?
    #include "stdafx.h"
    #include <stdio.h>
    #include <windows.h>
    #include <db.h>
    static DB *db = NULL;
    static DB_ENV *dbEnv = NULL;
    DWORD WINAPI th_write(LPVOID lpParam)
    DBT key, data;
    char key_buff[32], data_buff[32];
    DWORD i;
    printf("thread(%s) - start\n", lpParam);
    for (i = 0; i < 200; ++i)
    memset(&key, 0, sizeof(key));
    memset(&data, 0, sizeof(data));
    sprintf(key_buff, "K:%s", lpParam);
    sprintf(data_buff, "D:%s:%8d", lpParam, i);
    key.data = key_buff;
    key.size = strlen(key_buff);
    data.data = data_buff;
    data.size = strlen(data_buff);
    db->put(db, NULL, &key, &data, 0);
    Sleep(5);
    printf("thread(%s) - End\n", lpParam);
    return 0;
    int main()
    db_env_create(&dbEnv, 0);
    dbEnv->open(dbEnv, NULL, DB_CREATE | DB_INIT_MPOOL | DB_THREAD, 0);
    db_create(&db, dbEnv, 0);
    db->open(db, NULL, "test.db", NULL, DB_BTREE, DB_CREATE, 0);
    CreateThread(NULL, 0, th_write, "A", 0, 0);
    CreateThread(NULL, 0, th_write, "B", 0, 0);
    CreateThread(NULL, 0, th_write, "B", 0, 0);
    CreateThread(NULL, 0, th_write, "C", 0, 0);
    th_write("C");
    Sleep(2000);
    }

    Here some clarification about BDB Lock and Multi threads behavior
    Question 1. Can multiple threads write to the "Simple Data Store"?
    Answer 1.
    Please Refer to http://docs.oracle.com/cd/E17076_02/html/programmer_reference/intro_products.html
    A Data Store (DS) set up
    (so not using an environment or using one, but without any of the DB_INIT_LOCK, DB_INIT_TXN, DB_INIT_LOG environment regions related flags specified
    each corresponding to the appropriate subsystem, locking, transaction, logging)
    will not guard against data corruption due to accessing the same database page and overwriting the same records, corrupting the internal structure of the database etc.
    (note that in the case of the Btree, Hash and Recno access methods we lock at the database page level, only for the Queue access method we lock at record level)
    So,
    if You want to have multiple threads in the application writing concurrently or in parallel to the same database You need to use locking (and properly handle any potential deadlocks),
    otherwise You risk corrupting the data itself or the database (its internal structure).
    Of course , If You serialize at the application level the access to the database, so that no more one threads writes to the database at a time, there will be no need for locking.
    But obviously this is likely not the behavior You want.
    Hence, You need to use either a CDS (Concurrent Data Store) or TDS (Transactional Data Store) set up.
    See the table comparing the various set ups, here: http://docs.oracle.com/cd/E17076_02/html/programmer_reference/intro_products.html
    Berkeley DB Data Store
    The Berkeley DB Data Store product is an embeddable, high-performance data store. This product supports multiple concurrent threads of control, including multiple processes and multiple threads of control within a process. However, Berkeley DB Data Store does not support locking, and hence does not guarantee correct behavior if more than one thread of control is updating the database at a time. The Berkeley DB Data Store is intended for use in read-only applications or applications which can guarantee no more than one thread of control updates the database at a time.
    Berkeley DB Concurrent Data Store
    The Berkeley DB Concurrent Data Store product adds multiple-reader, single writer capabilities to the Berkeley DB Data Store product. This product provides built-in concurrency and locking feature. Berkeley DB Concurrent Data Store is intended for applications that need support for concurrent updates to a database that is largely used for reading.
    Berkeley DB Transactional Data Store
    The Berkeley DB Transactional Data Store product adds support for transactions and database recovery. Berkeley DB Transactional Data Store is intended for applications that require industrial-strength database services, including excellent performance under high-concurrency workloads of read and write operations, the ability to commit or roll back multiple changes to the database at a single instant, and the guarantee that in the event of a catastrophic system or hardware failure, all committed database changes are preserved.
    So, clearly DS is not a solution for this case, where multiple threads need to write simultaneously to the database.
    CDS (Concurrent Data Store) provides locking features, but only for multiple-reader/single-writer scenarios. You use CDS when you specify the DB_INIT_CDB flag when opening the BDB environment: http://docs.oracle.com/cd/E17076_02/html/api_reference/C/envopen.html#envopen_DB_INIT_CDB
    TDS (Transactional Data Store) provides locking features, adds complete ACID support for transactions and offers recoverability guarantees. You use TDS when you specify the DB_INIT_TXN and DB_INIT_LOG flags when opening the environment. To have locking support, you would need to also specify the DB_INIT_LOCK flag.
    Now, since the requirement is to have multiple writers (multi-threaded writes to the database),
    then TDS would be the way to go (CDS is useful only in single-writer scenarios, when there are no needs for recoverability).
    To Summarize
    The best way to have an understanding of what set up is needed, it is to answer the following questions:
    - What is the data access scenario? Is it multiple writer threads? Will the writers access the database simultaneously?
    - Are recoverability/data durability, atomicity of operations and data isolation important for the application? http://docs.oracle.com/cd/E17076_02/html/programmer_reference/transapp_why.html
    If the answers are yes, then TDS should be used, and the environment should be opened like this:
    dbEnv->open(dbEnv, ENV_HOME, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | DB_INIT_LOG | DB_RECOVER | DB_THREAD, 0);
    (where ENV_HOME is the filesystem directory where the BDB environment will be created)
    Question 2. Considering the sample code below which writes to the DB using 5 threads - is there a possibility of data loss?
    Answer 2.
    Definitely yes, You can see data loss and/or data corruption.
    You can check the behavior of your testcase in the following way
    1. Run your testcase
    2.After the program exits
    run db_verify to verify the database (db_verify -o test.db).
    You will likely see db_verify complaining, unless the thread scheduler on Windows weirdly starts each thread one after the other,
    IOW no two or ore threads write to the database at the same time -- kind of serializing the writes
    Question 3. If the code will cause data loss, will adding DB_INIT_LOCK and/or DB_INIT_TXN in DBENV->open make any difference?
    Answer 3.
    In Your case the TDS should be used, and the environment should be opened like this:
    dbEnv->open(dbEnv, ENV_HOME, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | DB_INIT_LOG | DB_RECOVER | DB_THREAD, 0);
    (where ENV_HOME is the filesystem directory where the BDB environment will be created)
    doing this You have proper deadlock handling in place and proper transaction usage
    so
    You are protected against potential data corruption/data loss.
    see http://docs.oracle.com/cd/E17076_02/html/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf
    Multi-threaded and Multi-process Applications
    DB is designed to support multi-threaded and multi-process applications, but their usage
    means you must pay careful attention to issues of concurrency. Transactions help your
    application's concurrency by providing various levels of isolation for your threads of control. In
    addition, DB provides mechanisms that allow you to detect and respond to deadlocks.
    Isolation means that database modifications made by one transaction will not normally be
    seen by readers from another transaction until the first commits its changes. Different threads
    use different transaction handles, so this mechanism is normally used to provide isolation
    between database operations performed by different threads.
    Note that DB supports different isolation levels. For example, you can configure your
    application to see uncommitted reads, which means that one transaction can see data that
    has been modified but not yet committed by another transaction. Doing this might mean
    your transaction reads data "dirtied" by another transaction, but which subsequently might
    change before that other transaction commits its changes. On the other hand, lowering your
    isolation requirements means that your application can experience improved throughput due
    to reduced lock contention.
    For more information on concurrency, on managing isolation levels, and on deadlock
    detection, see Concurrency (page 32).

  • Error in importing Configuration objects of PI 7.0 to PI 7.1

    Hi All,
    My server is upgraded from PI 7.0 to PI 7.1.
    I am getting Error while  importing Configuration objects of PI 7.0 to PI 7.1 now.
    Pls see the below error
    Attempt to access the 1 requested objects on 1 failed. Detailed information:  com.sap.aii.ib.core.roa.RoaObjectAccessException: Attempt to read object Adapter Metadata Mail | http://sap.com/xi/XI/System, type AdapterMetaData from application REPOSITORY on system REPOSITORY failed. Object does not exist. Detailed informatio n: Software component version with key ID: b38bcd00e47111d7afacde420a1145a5 not found
    Pls suggest

    Hi,
    It seems that adapter metadata has not been loaded into integration repository and because of that when you are trying to import configuration objects in ID then you are getting the error.
    The SAP adapter metadata objects are located under the namespace http://sap.com/xi/XI/System of software component SAP BASIS.
    What you can do is, if you have installation dvd's then you can copy from their or you can simply [_DOWNLOAD_|https://websmp205.sap-ag.de/~form/handler?_APP=00200682500000001943&_EVENT=SEARCH&HIDE=&SEARCH_SPAT=X&SEARCH_BPAT=X&SEARCH_CD=X&SEARCH_P=X&SEARCH_PV=X&SEARCH_C=X&SEARCH_CV=X&SEARCH_TA=&SEARCH_V=&HIDE_EXPERT_SEARCH=X&SEARCH_MAX_RESULT=20 ] from sap market place (refer this [thread|how to import Adapter metadata;) (you must have S-user id for this) and then after you need to do as mentioned below...
    1. First unzip the file (if it is zipped) and then put it in the import directory: \usr\sap\<SID>\SYS\global\xi\repository_server\import\
    2. Now login to IR and then from menu TOOLS ---> Import design objects and import it.
    3. After that in ID, Environment ---> Clear SLD Data Cache
    4. Now you can try to import configuration objects...
    Regards,
    Sarvesh

  • How can I get a count of objects in the near cache? (Extend client)

    Hi,
    I'm trying to figure out how to get the count of objects in my near cache (from c++ client). Knowing the size of the near cache is a key factor when optimizing configurations for performance.
    However if I call size() on the cache handle I get the count of objects in the cache (ie the cluster). How can I get a count of objects in the near cache?
    Thanks
    Rich Carless

    H Rich,
    It may not be ideal, but I think you may be able to infer the size by using the HeapAnalyzer (http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_heap_analyzer.html) facility, specifically the "class" based HeapAnalyzer. Its Snapshot representation http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_class_based_heap_analyzer_1_1_snapshot.html provides a mapping between class name and ClassStats (http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_class_based_heap_analyzer_1_1_class_stats.html) which provides information on how many instances of a given class type are in memory. Note the reported counts are process wide but if your key or value type are distinct you may be able to infer your answer. I realize this is rather complex, my only other suggestion would be to just make some guesses on size and see how they effect performance.
    Mark
    Oracle Coherence

  • Configuration Objects

    Hi All,
    I am new to Solution Manager. In SOLAR02 t-code, i have to maintain 'Configuration Objects' for configuration we are doing in ECC 6.0 in configuration tab. So can any one tell me how to find the configuration object.
    Thanks

    There are two options.
    - If you had chosen to build your project structure from the BPR (Business Process Repository) this tab would be pre-populated with the standard content. All you have to do is edit this to suit your requirements.
    The other ways is to group the objects manually. The steps are,
    -Choose object type ' IMG object' under the 'type' column in ' Configuration' tab.
    -Your default logical component will default or you choose one from the dropdown in the next column ' Logical component'
    - When you F4 in the next column ' Object' it takes you to the target IMG where you can pick and choose the IMG objects for the referenced process in the structure.
    Hope this helps. Thanks.
    Kathir

  • Updating an attribute value in a custom Configuration Object

    I created a custom configuration object, and have two attributes which should hold date values. One attribute will contain a null value and one attribute will contain a date value by default. Now, when i enter date values on an end user form and press continue, the user entered values have to be updated in these fields in the configuartion object. The attrib1 null value has to be updated with the corresponding value entered on the userform and the attibute2 ( which already has a default value) has to be overwritten with the date value selected(date selected with the date picker) on the enter user form.
    I used checkout object, a script to get the value from the form and a checkin object to perform the above operation, but the value is not being updated in the configuration object. Any suggestions for the above problem would help me a lot!!

    Have you tried accessing the object from a rule using 'getObject' (you might need to use 'getExtension' also).
    Try gettting the object directly from a rule, and use a 'set' to set the object key. I am not sure, but you might need to 'dumpMap' to actually convert the object to a Map structure before you can modify it.
    IC.

  • Demo Error when creating or changing configuration objects

    Hi All,
    I am trying to "Generate the Configuration Objects" for Demo: CheckFlightAvailability.
    But in the GenerationLog I got the error under "Generation Statistic" saying that "Error when creating or changing configuration objects".
    I can any one tell me what went wrong?
    Regards,
    Nagarjuna.

    Did you ever solve this issue? We are experiencing the same errors, but with ZCM 11. Server configurstion is Windows Server 2008R2, database is MS SQL 2005.
    Every time we try to create or change a (Windows) bundle or policy there's an error message in ZCC. The error is:
    com.novell.zenworks.datamodel.exceptions.InternalD ataModelException: com.novell.zenworks.datamodel.exceptions.InternalD ataModelException: org.hibernate.exception.ConstraintViolationExcepti on: could not insert collection: [com.novell.zenworks.datamodel.objects.assignableco ntent.AssignableContentObject.ContentServers
    ...followed by a different GUID(?) every time.
    We've placed a SR but haven't had any suggestions from Novell yet - we're soon going from calm to panic as we are planning to move from test to production in two weeks...
    Cheers,
    Peter

  • Message "Configuration object replaced by user

    #1.5...#/Applications/Common/Configuration#sap.com/irj#com.sapportals.config.service.audit.ConfigAuditLogManager#Guest#19####b...b#Thread[Thread-727,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#com.sapportals.config.service.audit.ConfigAuditLogManager#Java###Configuration object "" replaced by user ""#5#config://local/cm/services/schedulertasks/718e04bd-6e44-2810-158b-d90016097c52#index_service#<null>#<null>#<null>#

    i will add some information :
    these messages created 3 files of applications.log today
    i aslo see lots of messages
    #1.5#0013216BB88B01860000000B0000427000040BBBF4C43C5B#1138801800282#/Applications/Workflow/General#sap.com/irj#com.sap.workflow#Guest#19####a3423ba0932911da85a60013216bb88b#Thread[ThreadPool.Worker15,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Info#1#com.sap.workflow#Plain###Running task ID WFTaskSchedulerDeadline On Wed Feb 01 15:50:00 GMT+02:00 2006#
    can anyone tell me what are they mean?
    thanks a lot

Maybe you are looking for