Wednesday, July 24, 2024

How to modify JSON DMS task for load data using limited LOB - AWS

 JSON DMS task for load data using limited LOB - AWS  


{

    "Logging": {

        "EnableLogging": true,

        "EnableLogContext": true,

        "LogComponents": [

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "TRANSFORMATION"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "SOURCE_UNLOAD"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "IO"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "TARGET_LOAD"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "PERFORMANCE"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "SOURCE_CAPTURE"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "SORTER"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "REST_SERVER"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "VALIDATOR_EXT"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "TARGET_APPLY"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "TASK_MANAGER"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "TABLES_MANAGER"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "METADATA_MANAGER"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "FILE_FACTORY"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "COMMON"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "ADDONS"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "DATA_STRUCTURE"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "COMMUNICATION"

            },

            {

                "Severity": "LOGGER_SEVERITY_DEFAULT",

                "Id": "FILE_TRANSFER"

            }

        ],

        "LogConfiguration": {

            "TraceOnErrorMb": 10,

            "EnableTraceOnError": false

        },

        "CloudWatchLogGroup": "dms-tasks-fenv2-ibm-maximo-windows-dms-ri-lg2x",

        "CloudWatchLogStream": "dms-task-SELZLHKDZ5CIDLRD7XZKV3FU4A"

    },

    "StreamBufferSettings": {

        "StreamBufferCount": 12,

        "CtrlStreamBufferSizeInMB": 8,

        "StreamBufferSizeInMB": 16

    },

    "ErrorBehavior": {

        "FailOnNoTablesCaptured": true,

        "ApplyErrorUpdatePolicy": "LOG_ERROR",

        "FailOnTransactionConsistencyBreached": false,

        "RecoverableErrorThrottlingMax": 1800,

        "DataErrorEscalationPolicy": "SUSPEND_TABLE",

        "ApplyErrorEscalationCount": 0,

        "RecoverableErrorStopRetryAfterThrottlingMax": true,

        "RecoverableErrorThrottling": true,

        "ApplyErrorFailOnTruncationDdl": false,

        "DataTruncationErrorPolicy": "LOG_ERROR",

        "ApplyErrorInsertPolicy": "LOG_ERROR",

        "EventErrorPolicy": "IGNORE",

        "ApplyErrorEscalationPolicy": "LOG_ERROR",

        "RecoverableErrorCount": -1,

        "DataErrorEscalationCount": 0,

        "TableErrorEscalationPolicy": "STOP_TASK",

        "RecoverableErrorInterval": 5,

        "ApplyErrorDeletePolicy": "IGNORE_RECORD",

        "TableErrorEscalationCount": 0,

        "FullLoadIgnoreConflicts": true,

        "DataErrorPolicy": "LOG_ERROR",

        "TableErrorPolicy": "SUSPEND_TABLE"

    },

    "TTSettings": {

        "TTS3Settings": null,

        "TTRecordSettings": null,

        "EnableTT": false

    },

    "FullLoadSettings": {

        "CommitRate": 50000,

        "StopTaskCachedChangesApplied": false,

        "StopTaskCachedChangesNotApplied": false,

        "MaxFullLoadSubTasks": 45,

        "TransactionConsistencyTimeout": 600,

        "CreatePkAfterFullLoad": false,

        "TargetTablePrepMode": "TRUNCATE_BEFORE_LOAD"

    },

    "TargetMetadata": {

        "ParallelApplyBufferSize": 0,

        "ParallelApplyQueuesPerThread": 0,

        "ParallelApplyThreads": 0,

        "TargetSchema": "maximo",

        "InlineLobMaxSize": 0,

        "ParallelLoadQueuesPerThread": 0,

        "SupportLobs": true,

        "LobChunkSize": 0,

        "TaskRecoveryTableEnabled": false,

        "ParallelLoadThreads": 0,

        "LobMaxSize": 32,

        "BatchApplyEnabled": false,

        "FullLobMode": false,

        "LimitedSizeLobMode": true,

        "LoadMaxFileSize": 0,

        "ParallelLoadBufferSize": 0

    },

    "BeforeImageSettings": null,

    "ControlTablesSettings": {

        "historyTimeslotInMinutes": 5,

        "HistoryTimeslotInMinutes": 5,

        "StatusTableEnabled": false,

        "SuspendedTablesTableEnabled": false,

        "HistoryTableEnabled": false,

        "ControlSchema": "",

        "FullLoadExceptionTableEnabled": false

    },

    "LoopbackPreventionSettings": null,

    "CharacterSetSettings": null,

    "FailTaskWhenCleanTaskResourceFailed": false,

    "ChangeProcessingTuning": {

        "StatementCacheSize": 100,

        "CommitTimeout": 1,

        "RecoveryTimeout": -1,

        "BatchApplyPreserveTransaction": true,

        "BatchApplyTimeoutMin": 1,

        "BatchSplitSize": 0,

        "BatchApplyTimeoutMax": 30,

        "MinTransactionSize": 1000,

        "MemoryKeepTime": 1000,

        "BatchApplyMemoryLimit": 500,

        "MemoryLimitTotal": 32768

    },

    "ChangeProcessingDdlHandlingPolicy": {

        "HandleSourceTableDropped": true,

        "HandleSourceTableTruncated": true,

        "HandleSourceTableAltered": true

    },

    "PostProcessingRules": null

}

How to get max LOB size in column - DB2 database

 


SELECT MAX(LENGTHB(LOB_COLUMN)) FROM TABLE;

Tuesday, May 28, 2024

How to grant Permission in PostgreSQL ?

 Grant Permission in PostgreSQL  


GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA demo_admin TO demo_rw;

 

GRANT USAGE ON SCHEMA demo_admin TO demo_rw;

 

grant demo_rw to demo_app;

 

GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA demo_admin TO demo_rw;



How to grant access to users in PostgreSQL?



Here are some common statement to grant access to a PostgreSQL user:

=> Grant CONNECT to the database:



GRANT CONNECT ON DATABASE database_name TO username;

=> Grant USAGE on schema:



GRANT USAGE ON SCHEMA schema_name TO username;

=> Grant on all tables for DML statements: SELECT, INSERT, UPDATE, DELETE:



GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA schema_name TO username;

=> Grant all privileges on all tables in the schema:



GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema_name TO username;

=> Grant all privileges on all sequences in the schema:



GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA schema_name TO username;

=> Grant all privileges on the database:



GRANT ALL PRIVILEGES ON DATABASE database_name TO username;

=> Grant permission to create database:



ALTER USER username CREATEDB;

=> Make a user superuser:



ALTER USER myuser WITH SUPERUSER;

=> Remove superuser status:



ALTER USER username WITH NOSUPERUSER;



=> Those statements above only affect the current existing tables. To apply to newly created tables, you need to use alter default.

 For example:



ALTER DEFAULT PRIVILEGES FOR USER username IN SCHEMA schema_name

GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO username;


Friday, May 10, 2024

How to restart SSD service in Linux ?

Restart SSD service in Linux


[root@oraclesrc-2 ~]#

[root@oraclesrc-2 ~]# vi /etc/ssh/sshd_config

[root@oraclesrc-2 ~]#

[root@oraclesrc-2 ~]#

[root@oraclesrc-2 ~]# systemctl status sshd.service

● sshd.service - OpenSSH server daemon

   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)

   Active: active (running) since Fri 2024-05-10 12:11:33 UTC; 1h 3min ago

     Docs: man:sshd(8)

           man:sshd_config(5)

 Main PID: 3883 (sshd)

    Tasks: 1

   Memory: 3.6M

   CGroup: /system.slice/sshd.service

           └─3883 /usr/sbin/sshd -D


May 10 12:11:33 oraclesrc-2 sshd[3883]: Server listening on :: port 22.

May 10 12:11:33 oraclesrc-2 systemd[1]: Started OpenSSH server daemon.

May 10 12:11:47 oraclesrc-2 sshd[3896]: reverse mapping checking getaddrinfo for 192.240.103.in-addr.tripleplay.in [103.240...TTEMPT!

May 10 12:11:50 oraclesrc-2 sshd[3896]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= r...=oracle

May 10 12:11:51 oraclesrc-2 sshd[3896]: Failed password for oracle from 10.0.0.0 port 3952 ssh2

May 10 12:11:56 oraclesrc-2 sshd[3896]: Failed password for oracle from 10.0.0.0 port 3952 ssh2

May 10 12:12:17 oraclesrc-2 sshd[3896]: Accepted password for oracle from 10.0.0.0 port 3952 ssh2

May 10 12:12:19 oraclesrc-2 sshd[3982]: reverse mapping checking getaddrinfo for 192.240.103.in-addr.tripleplay.in [103.240...TTEMPT!

May 10 12:12:20 oraclesrc-2 sshd[3982]: Accepted password for oracle from 10.0.0.0 port 3969 ssh2

May 10 12:16:22 oraclesrc-2 sshd[4671]: Accepted publickey for azureadm from 10.0.1.4 port 44574 ssh2: RSA SHA256:/3WBXn4cT...7muuY2k

Hint: Some lines were ellipsized, use -l to show in full.

[root@oraclesrc-2 ~]#

[root@oraclesrc-2 ~]#

[root@oraclesrc-2 ~]# systemctl restart sshd.service

[root@oraclesrc-2 ~]#

[root@oraclesrc-2 ~]#