FNDWRR.exe后面的temp_id是如何生成的--解析Oracle EBS request log/output的url

我们在EBS的view concurrent request 界面里, 通常会点击log或output, 然后在菜单里选copy file,从IE里来获取相应的log或output文件. 相应的url是
http://host:port/OA_CGI/FNDWRR.exe?temp_id=2391709&login=APPLSYSPUT/PUB@VIS 
这个url是如何生成的呢? 通过查看FNDRSRUN这个form, 查到相关的两个package是fnd_webfile.get_url和fnd_concurrent_file.get_file_id
以下是fnd_webfile.get_url的参数说明
/* Function: GET_URL
 *
 * Purpose: Constructs and returns the URL for a Concurrent Processing
 *          log or output file.
 *
 * Arguments:
 *  file_type - Specifies the type of file desired:
 *       fnd_webfile.process_log = The log of the concurrent process identified
 *                                 by the parameter ID.
 *       fnd_webfile.icm_log     = The log of the ICM process identified by ID.
 *                                 Or, the log of the ICM process that spawned
 *                                 the concurrent process identified by ID.
 *                                 Or, the log of the most recent ICM process
 *                                 if ID is null.
 *       fnd_webfile.request_log = The log of the request identified by ID.
 *       fnd_webfile.request_out = The output of the request identified by ID.
 *       fnd_webfile.request_mgr = The log of the concurrent process that ran
 *                                 the request identified by ID.
 *       fnd_webfile.frd_log     = The log of the forms process identified
 *                                 by ID.
 *       fnd_webfile.generic_log = The log file identified by ID.
 *       fnd_webfile.generic_trc = The trace file identified by ID.
 *       fnd_webfile.generic_ora = The ora file identified by ID.
 *       fnd_webfile.generic_cfg = The config file identified by ID.
 *       fnd_webfile.context_file= The context file identified by ID.
 *       fnd_webfile.generic_text= Generic file using text transfer mode.
 *       fnd_webfile.generic_binary = Generic file using binary transfer mode.
 *
 *  id        - A concurrent process ID, concurrent request ID, or file ID
 *                 depending on the file type specified.
 *              For fnd_webfile.context_file,fnd_webfile.generic_text,
 *              fnd_webfile.generic_binary this value is null.
 *
 *  gwyuid    - The value of the environment variable GWYUID used in
 *                 constructing the URL.
 *
 *  two_task  - The database two_task, used in constructing the URL.
 *
 *  expire_time - The number of minutes for which this URL will remain
 *                   valid.
 *  source_file - Source file name with full patch
 *
 *  source_node - Source node name.
 *
 *  dest_file   - Destination file name
 *
 *  dest_node   - Destination node name
 *
 *  Returns NULL on error.  Check the FND message stack.

在这个get_url中, 如果文件是request_log或request_out类型的, 它会调用fnd_concurrent_file.get_file_id, 以下是源代码
function get_file_id return varchar2
is
fuid number;
fcrc number;
frand number;
fid number;
rval varchar2(32);
rtemp  varchar2(32);
begin

 select fnd_s_file_temp_id.nextval
  into fuid
  from dual;

 -- Get a random number
 fnd_random_pkg.init(7);
 fnd_random_pkg.seed(to_number(to_char(sysdate, 'JSSSSS')), 10, false);
 frand := fnd_random_pkg.get_next;

 -- Compute CRC32 of the random number and the sequence number,
 -- this creates a self-checking value.
 rval := lpad(to_char(frand),10,'0')||lpad(to_char(fuid),10,'0');
 fcrc := fnd_hash_pkg.crc32(rval);

 -- XOR the sequence and random values with whatever we have
 -- lying around.  This make our algorithm more obscure,
 -- since sequence values and pseudorandom numbers are no longer
 -- obvious to an observer.
 fuid := fnd_hash_pkg.xor32(fuid, frand);
 frand := fnd_hash_pkg.xor32(fcrc, frand);

 -- this value will be unique
 fid := fcrc * power(2,64) + frand * power(2,32) + fuid;

 -- base 64
 rval := fnd_code_pkg.base64(fid, 16);
 rtemp := rval;

 -- and finally encrypt it all with RC4...actually we now use CRC Hash
-- rval := fnd_crypt_pkg.encrypt('4237533241', rval, 16);
        rval := to_char(icx_call.CRCHASH('4237533241',rval));
 return rval;

end get_file_id;

其中可见oracle几个有趣的package, 如:
fnd_crypt_pkg
fnd_code_pkg
fnd_random_pkg
fnd_hash_pkg
icx_call
有空再研究一下这几个package.

 

您可以使用 AWS Management Console 或 AWS CLI 导出 Amazon Elastic Block Store (EBS) 卷的数据,并将其保存为 Excel 文件(.xlsx 格式)。这需要您安装 AWS Command Line Interface (CLI) 并创建一个 EC2 实例来运行导出命令。 以下是导出 EBS 卷数据的一些步骤: 1. 创建一个 EC2 实例并连接到该实例。 2. 安装 AWS CLI 并配置您的凭证。 3. 运行以下命令导出 EBS 卷数据并将其保存为 Excel 文件: `aws ec2 create-instance-export-task --instance-id <instance_id> --target-environment vmware --export-to-s3-task <S3 bucket and key> --format vmdk` `aws s3 cp s3://<S3 bucket and key>/<export_task_id>.vmdk - | aws ec2 import-snapshot --disk-container "Description=string,Format=vmdk,UserBucket={S3Bucket=<bucket_name>,S3Key=<S3 key>}"` `aws ec2 create-conversion-task --source-region <source_region> --source-disk "<snapshot_id>::<device_name>" --target-format vmdk --target-bucket <target_bucket> --target-prefix <prefix>` `aws s3 cp s3://<target_bucket>/<prefix>/<conversion_task_id>.vmdk - | aws ec2 create-image --name <image_name> --block-device-mappings "[{\"DeviceName\": \"<device_name>\", \"Ebs\":{\"SnapshotId\":\"<snapshot_id>\",\"VolumeSize\":<volume_size>,\"DeleteOnTermination\":true}}]" --virtualization-type hvm --description "<description>"` 4. 使用以下命令将 AMI 导出为 Excel 文件: `aws ec2 describe-images --image-ids <image_id> --query 'Images[*].[Name, BlockDeviceMappings[*].Ebs.VolumeId]' --output text | awk '{print $2}' | xargs -I {} sh -c 'aws ec2 create-snapshot --volume-id {} --description "Snapshot of {}" && echo "Created snapshot of {}"'` `aws ec2 describe-images --image-ids <image_id> --query 'Images[*].[Name, BlockDeviceMappings[*].Ebs.VolumeId]' --output text | awk '{print $2}' | xargs -I {} sh -c 'aws ec2 create-snapshot --volume-id {} --description "Snapshot of {}" && echo "Created snapshot of {}"'` `aws s3 cp s3://<S3 bucket>/<S3 key> - | sed 's/\t/,/g' > <output_file>.xlsx` 请注意,这只是一些基本步骤,您需要根据您的实际情况进行一些更改和调整。此外,这些命令可能会产生一些费用。请确保您已经了解了这些费用,并且您已经在 AWS 控制台上设置了适当的预算和限制。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值