Skip to content

Commit f4ea3ea

Browse files
authored
Create request_generator1.sh
1 parent d5f4164 commit f4ea3ea

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

request_generator1.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/ksh
2+
3+
if [ $# -lt 2 ]
4+
then
5+
echo "ERR - provide arguments 1. safe name, 2. dbname|all"
6+
exit 1
7+
fi
8+
9+
safe=$1
10+
dbname=$2
11+
12+
echo "Safe,Platform Id,Account Name,Username,Password,Address,Port,Remarks"
13+
14+
if [ "$dbname" = "all" ]
15+
then
16+
17+
# pvuseradmin accounts
18+
ps -ef|grep pmon |grep -v grep |grep -v ASM | grep -v MGMTDB |cut -d_ -f3 | sort | sed 's/.$//g' | while read dbname
19+
do
20+
21+
acct_pvuseradmin=${dbname}adminuser
22+
echo "admin-safe,OracleDB,${acct_pvuseradmin},adminuser,password,${dbname},1521,none"
23+
24+
done
25+
26+
# dbaopr accounts
27+
ps -ef|grep pmon |grep -v grep |grep -v ASM | grep -v MGMTDB |cut -d_ -f3 | sort | sed 's/.$//g' | while read dbname
28+
do
29+
30+
acct_dbaopr=${dbname}operatoruser
31+
echo "$safe,${acct_dbaopr},operatoruser,password,${dbname},1521,none"
32+
33+
done
34+
35+
36+
else
37+
38+
acct_pvuseradmin=${dbname}adminuser
39+
acct_dbaopr=${dbname}operatoruser
40+
41+
echo "admin-safe,OracleDB,${acct_pvuseradmin},adminuser,password,${dbname},1521,none"
42+
echo "$safe,${acct_dbaopr},operatoruser,password,${dbname},1521,none"
43+
44+
fi

0 commit comments

Comments
 (0)