AnsweredAssumed Answered

SSH connector error

Question asked by Rajkiran Paul on Oct 3, 2016
Latest reply on Oct 5, 2016 by Cory Veilleux

   SSH connector  error:

 

Hi, i am running a  createUser.sh  script using that SSH connector.But we are getting the following error

 

 

 

My CreateUser.sh is 

 

 

#!/bin/sh
MMUSER=$1
su - oracle << EOF>>/home/XAGsoft/RMSsqlScripts/LOG/createUser.log
sqlplus adminusername/adminpassword@//localhost:port/db;
DROP USER "${MMUSER}" CASCADE;
CREATE USER "${MMUSER}" IDENTIFIED BY "${MMUSER}" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
ALTER USER "${MMUSER}" PROFILE RMSPROD_PASS_PROFILE;
GRANT CREATE SESSION,
CREATE TABLE,
CREATE PROCEDURE,
CREATE VIEW,
DELETE ANY TABLE,
INSERT ANY TABLE,
SELECT ANY TABLE,
UPDATE ANY TABLE,
SELECT ANY SEQUENCE,
EXECUTE ANY PROCEDURE,
CREATE SYNONYM
TO "${MMUSER}";
commit;
disconnect;
connect ${MMUSER}/${MMUSER}@//localhost:port/db;
DECLARE
L_SQL_DROP VARCHAR2(2000);
L_SQL_CREATE VARCHAR2(2000);
CURSOR C_EXISTING IS
SELECT OBJECT_NAME
FROM USER_OBJECTS;
CURSOR C_OBJECTS IS
SELECT OBJECT_NAME
FROM ALL_OBJECTS
WHERE OWNER = 'RMS'
AND OBJECT_TYPE IN ('TABLE',
'VIEW',
'SEQUENCE',
'FUNCTION',
'PROCEDURE',
'PACKAGE',
'TYPE');
BEGIN
FOR I IN C_EXISTING
LOOP
L_SQL_DROP := 'DROP SYNONYM '||I.OBJECT_NAME;
EXECUTE IMMEDIATE L_SQL_DROP;
END LOOP;
FOR I IN C_OBJECTS
LOOP
L_SQL_CREATE := 'CREATE SYNONYM '||I.OBJECT_NAME||' FOR RMS.'||I.OBJECT_NAME;
EXECUTE IMMEDIATE L_SQL_CREATE;
END LOOP;
commit;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
/
disconnect;
connect adminusername/adminpassword@//localhost:port/db;
INSERT INTO RMS.USER_ATTRIB (USER_ID, USER_NAME, LANG) VALUES ($MMUSER, $MMUSER, 1);
GRANT LS_MRR ,LS_REPL_PRTY_UPLD ,ALLOCUSR ,ALC_REPL_TSF_RTV_RO ,DEO ,TRANSFERS_RO ,TSFSUBAPP ,STORE TO "${MMUSER}";
GRANT LS_MRR ,LS_REPL_PRTY_UPLD ,ALLOCUSR ,ALC_REPL_TSF_RTV_RO ,DEO ,TRANSFERS_RO ,TSFSUBAPP ,STORE ,STK_ADJ ,SIM_INV_ADJ TO "${MMUSER}";
commit;
exit;
exit;
EOF
sql_return_code=$?
if [ $sql_return_code != 0 ]
then
exit $sql_return_code;
else
exit $sql_return_code;
fi

 

 

 

 

inside create account capability of SSH connector :

 

/home/XAGsoft/RMSsqlScripts/createUser.sh

Outcomes