Article Original Creation Date: 2013-05-03
Overview
SPRT_EC_DEVICE
table, but first wants to back up the following parameters from these devices:
- Domain
- Provisioning Code
- MAC Address
- Serial Number
- All Services
- All Attributes
- Manual Override
Environment
- ServiceGateway 4.2.2
- Solaris 10
- Oracle 10
- JBoss 4.0.4GA
Information
Backing up the Data
The CPE (Customer Premise Equipment) parameters listed above are available in the following tables:
Table Name | Description |
---|---|
SPRT_EC_DEVICE | Contains Domain ID, the MAC Address, and the Serial number |
SPRT_EC_DEVICE_SERVICE_XREF | Contains data for services that are associated directly with the device |
SPRT_EC_SUBSCRIBER_DEVICE_XREF | Contains data for Device-Subscriber association |
SPRT_EC_SUB_SERVICE_XREF | Contains data for Subscriber-Service association |
SPRT_EC_DEVICE_ATTR | Contains data for Device Attributes |
SPRT_SG_DEVICE_TC | Contains data for Manual Overrides |
The query below fetches the needed information and saves it in the table BACKUP_OLD_DEVICES
.
CREATE TABLE BACKUP_OLD_DEVICES as
SELECT
dev.ID,
svc.NAME SERV_NAME,
svc.ID SERV_ID,
dev.EC_REALM_GUID,
sprt_ec_realm.name as realm,
dev.ec_ad_id,
dev.UNIQUE_ID_STRING UNIQUE_ID_STR,
dev.PROVISIONINGCODE as "PROV_CODE",
fw.FIRMWARE_VERSION as Firmware,
dev.MAC_ADDRESS MAC_ADDR,
dev.WAN_CONNECTION_TYPE as "CONN_TYPE",
AttrDef.NAME as "ATTR_NAME",
devattr.ATTR_VALUE as "ATTR_VALUE",
tc.NAME as "Manual Override",
sprt_ec_reporting_util.formatip(dev.IP_ADDRESS) AS IP_ADDR,
TO_CHAR(
dev.LAST_SUCCESSFUL_COMM_DATE, 'DD.MM.YYYY HH24:MI:SS'
) AS LAST_SUCC_COMM_DATE,
TO_CHAR(
dev.LAST_UNSUCCESSFUL_COMM_DATE,
'DD.MM.YYYY HH24:MI:SS'
) AS LAST_UNSUCC_COMM_DATE,
TO_CHAR(
dev.CREATED, 'DD.MM.YYYYHH24:MI:SS'
) AS CREATED_DATE,
dev.CREATED_BY
FROM
SPRT_EC_DEVICE dev
LEFT JOIN SPRT_EC_REALM ON dev.EC_REALM_GUID = sprt_ec_realm.guid
LEFT JOIN SPRT_EC_DEVICE_SERVICE_XREF xref ON dev.ID = xref.EC_DEVICE_ID
LEFT JOIN SPRT_EC_SERVICE svc ON xref.EC_SERVICE_ID = svc.ID
LEFT JOIN SPRT_EC_FIRMWARE fw ON dev.FIRMWARE_GUID = fw.guid
LEFT JOIN SPRT_EC_DEVICE_ATTR DevAttr ON dev.ID = DevAttr.Object_ID
LEFT JOIN SPRT_EC_ATTR_DEF AttrDef ON devattr.attr_def_guid = AttrDef.guid
LEFT JOIN SPRT_SG_DEVICE_TC sg_dev ON dev.ID = sg_dev.EC_DEVICE_ID
LEFT JOIN SPRT_SG_TC tc ON sg_dev.OVERRIDE_TC_GUID = tc.guid
WHERE
dev.ID in ('1130', '1131', '1133', '1134')
ORDER BY
dev.UNIQUE_ID_STRING;
The structure and a sample row from BACKUP_OLD_DEVICES
looks like the following:
(Click on the preview image above to see the complete row.)
Restoring the Information
To restore the above-gathered information, use SoapUI. Following is the WSDL (Web Service Definition Language) URL for the ServiceGateway application server:
http://<service_gateway_server>/servicegatewayeai/services/Inventory?WSDL
Add the right ServiceGateway UserID and Password in the request properties field of SoapUI and as domain use a "/".
Two methods to add and update device are as follows:
- addDevice
- updateDevice
A sample profile for addDevice is:
2013-06-06T00:00:00-00:00
/
SPRT
0.0.0.1s
SPRT
A
0.0.0.1h
33.7.22.33
aa:bb:cc:dd:ee:ff
SprtGTS
NEWID3
NEWID3
A sample profile for updateDevice is:
false
DEVICE_PPP_USERNAME
paul-test
false
1010
false
Base
NEWID3
Priyanka Bhotika
Comments