Load Subscription attributes and values
Function: The Load Subscription Attributes utility provides an efficient method of assigning attributes to a large number of subscriptions.
To load subscription attributes and values:
- Create a CSV file of Subscriptions, Attributes, and Values.
- Execute the Load Subscription Attribute Utility.
- Verify the Subscription Attributes Load.
- Create a report template using the SQL Template Designer.
Once attribute values are assigned to application databases, a SQL Template Designer report can query the database to report on the application databases.
The loadSubscriptionAttrFile utility assigns attribute values to a list of subscriptions. This utility takes a comma-separated values (CSV) file as input.
Note:
This CSV file becomes the master document of record for Subscription Attributes and hence must be preserved in a working directory for future updates.
Create a spreadsheet table, in the format shown in the following example, and save it as a CSV file in a working directory. This file is specific to loading Subscription attributes.
Columns:
The first column lists the Subscription Identifier.
Each additional column lists attributes and values that will be applied to the subscription.
Multiple attributes can be assigned to a single subscription object.
Rows:
First (Header) Row - Contains the fields that uniquely identify the Subscription Identifier followed by Attribute names. The header row is information only and is not processed as a data row.
Subsequent rows list the Subscription followed by the attribute values that you are assigning to each subscription.
Before you begin, Bulk Load utilities must be run in SQLPLUS as user APTARE.
The load_package utility is located in:
Linux:
/opt/aptare/database/stored_proceduresWindows:
\opt\oracle\database\stored_procedures
To assign attributes to application databases:
- Create a table in a spreadsheet.
- Save the table as a comma-separated file (for example,
subscription.csv). - Log in to the portal server.
- At the command line:
su -aptare
- At the command line, launch sqlplus:
sqlplus <pwd>/<pwd>@//localhost:1521/scdb
Example:
sqlplus portal/portal@//localhost:1521/scdb
- Execute the following at the SQL prompt:
SQL> Execute load_package.loadSubscriptionAttrFile ('pathname_and_filename','domain_name', subscription_identifier_col_num, 'log_path_name', 'log_file_name','check_valid_value');Example:
Execute load_package.loadSubscriptionAttrFile ('/tmp/subscription.csv', 'DomainEMEA',1,'/tmp', 'subscription.log','Y');Where:
pathname_and_filename
Full path + filename (enclosed in single straight quotes) of the CSV file.
Windows example: '
c:\temp\subscription.csv'Linux example: '
/tmp/subscription.csv'domain_name
Name (enclosed in single straight quotes) of the domain in which the host groups and hosts reside. Example: 'DomainEMEA'
subscription_identifier_col_num
Column number in the CSV file where the Subscription Identifier is listed; Example: 1
log_path_name
Full path (enclosed in single straight quotes) where the log file will be created/updated; verify that you have write access to this directory.
Optional: If a log path and filename are not specified, log records are written to scon.log and scon.err. To omit this parameter, enter: Example: 'c:\temp' or '/tmp'
log_file_name
Log file name enclosed in single straight quotes.
Optional: If a log path and filename are not specified, entries are written to
scon.logandscon.err. To omit this parameter, enter: ''Example: '
subscription.log'check_valid_value
'Y' or 'N' - enclosed in single straight quotes.
Y - Checks if the attribute value exists. If the utility determines that the attribute value is not valid, it skips this row and does not assign the attribute value to the switch object.
N - Updates without checking that the attribute value exists. This option is seldom chosen, but it is available for certain customer environments where attributes may have been created without values (with scripts that bypass the user interface).
- Check the log file for status and errors.
- Restart the portal services so that the newly added attributes become available in the product.
To verify that the attribute load was successful:
- In the portal, go to Reports.
- Select a blue user folder.
- Select New SQL Template.
- With the SQL Template Designer open, click the Query tab.
- Enter the following query in the SQL Template Designer to verify Switch attributes:
select * from aps_v_swi_subscription_attribute