[oracle@prdb19 ~]$ emcli create_named_credential -cred_name="hostv1" -auth_target_type="host" -cred_type="HostCreds" -attributes="HostUserName:oracle;HostPassword:oracle" Credential HOSTV1 created. [oracle@prdb19 ~]$ [oracle@prdb19 ~]$ emcli set_preferred_credential -set_name=HostCredsNormal -target_name=prdb19 -target_type=host -credential_name=hostv1 -credential_owner="sysman" Successfully set preferred credentials for target prdb19:host. [oracle@prdb19 ~]$ emcli execute_hostcmd -cmd="ls -l;" -credential_set_name="HostCredsNormal" -targets="prdb19:host;" ******************************************************************************* * Target: prdb19:host * Execution Status: Succeeded ******************************************************************************* total 152 -rw-r-----. 1 oracle oinstall 22 Jul 18 20:56 ag_current_status.msg -rw-r-----. 1 oracle oinstall 243 Jul 18 20:29 agntstmp.txt -rw-r-----. 1 oracle oinstall 242 Jul 15 15:09 agntstmp.txt.bak drwxr-----. 2 oracle oinstall 6 Apr 20 13:02 attachmentDB drwxr-----. 4 oracle oinstall 35 Apr 20 12:57 backupUpload -rw-r-----. 1 oracle oinstall 0 Jul 18 20:29 blackouts.lck -rw-r-----. 1 oracle oinstall 52 Apr 20 12:57 blackouts.xml drwxr-----. 2 oracle oinstall 252 Jul 18 20:41 collection drwxr-----. 2 oracle oinstall 6 Apr 20 12:57 collection_upgrade drwxr-----. 2 oracle oinstall 6 Apr 20 13:01 dumps -rw-r-----. 1 oracle oinstall 3444 Apr 20 17:46 emagent_storage.config drwxr-----. 2 oracle oinstall 6 Apr 20 13:01 longOpDiag drwxr-----. 2 oracle oinstall 6 Apr 20 13:02 metricCache drwxr-----. 2 oracle oinstall 6 Apr 20 13:02 metricExtLib drwxr-----. 2 oracle oinstall 6 Apr 20 13:02 remote drwxr-----. 15 oracle oinstall 4096 Apr 20 16:42 state -rw-r-----. 1 oracle oinstall 63416 Jul 18 20:29 targets.xml -rw-r-----. 1 oracle oinstall 63416 Jul 15 15:09 targets.xml.bak drwxr-----. 2 oracle oinstall 6 Jul 18 20:31 temp drwxr-----. 4 oracle oinstall 35 Apr 20 12:57 upload ******************************************************************************* * Execution Summary * Targets Succeeded: 1 * prdb19:host * Targets Failed: 0 ******************************************************************************* [oracle@prdb19 ~]$ [oracle@prdb19 ~]$ emcli execute_hostcmd -cmd="sh /home/oracle/001.sh;" -credential_set_name="HostCredsNormal" -targets="prdb19:host;" ******************************************************************************* * Target: prdb19:host * Execution Status: Succeeded ******************************************************************************* SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jul 18 21:01:12 2024 Version 19.23.0.0.0 Copyright (c) 1982, 2023, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.23.0.0.0 SQL> NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ allow_group_access_to_sga boolean FALSE lock_sga boolean FALSE pre_page_sga boolean TRUE sga_max_size big integer 8000M sga_min_size big integer 0 sga_target big integer 8000M unified_audit_sga_queue_size integer 1048576 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.23.0.0.0 ******************************************************************************* * Execution Summary * Targets Succeeded: 1 * prdb19:host * Targets Failed: 0 ******************************************************************************* [oracle@prdb19 ~]$ [oracle@prdb19 ~]$ emcli execute_hostcmd -input_file="FILE:/home/oracle/001.sh" -credential_set_name="HostCredsNormal" -targets="prdb19:host;" -osscript="FILE" -cmd="/bin/sh -s" ******************************************************************************* * Target: prdb19:host * Execution Status: Succeeded ******************************************************************************* SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jul 18 21:03:40 2024 Version 19.23.0.0.0 Copyright (c) 1982, 2023, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.23.0.0.0 SQL> NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ allow_group_access_to_sga boolean FALSE lock_sga boolean FALSE pre_page_sga boolean TRUE sga_max_size big integer 8000M sga_min_size big integer 0 sga_target big integer 8000M unified_audit_sga_queue_size integer 1048576 SQL> Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.23.0.0.0 ******************************************************************************* * Execution Summary * Targets Succeeded: 1 * prdb19:host * Targets Failed: 0 ******************************************************************************* [oracle@prdb19 ~]$
标签:oinstall,20,prdb19,命令,oem,oracle,-----.,os,sga From: https://www.cnblogs.com/notonlydba/p/18310461