简体   繁体   中英

Can DB2REMOTE be used to point a file from another server?

Using the script below, I was able to load the data to the table with local files.

db2 load from SOME/LOCAL/File.txt of asc modified by reclen=123 method L \(1 11, 12 14\) REPLACE INTO schema.tablename

However, I want to achieve to load the file from another server. I don't want to transfer the files from another server to db2 server so I will be able to use the command as above. Found that DB2REMOTE can be used for remotefiles in this documentation , but I'm not sure how to execute it with success.

Do I need to do this also? Because I don't have the right IAM role and don't have the credentials to do so. If I just can skip this and proceed to connect with another server only.

This is the script I'm trying with DB2REMOTE:

db2 load from 'DB2REMOTE://centos@123.456.789.0:/folders/directory/file.txt' of asc modified by reclen=123 method L \(1 11, 12 14\) REPLACE INTO schema.tablename

Thank you in advance!

DB2REMOTE is for accessing cloud object storage (eg Amazon S3, IBM Cloud Object Storage), from some Db2 commands.

If you are not using cloud object storage, then mount the remote directory locally with appropriate permissions, and specify the local mountpoint with the Db2 load command.

You can remote mount with SSHFS or similar, when installed and properly configured. This is not programming, but instead it is administration and configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM