Skip to content

Commit 0df5cef

Browse files
authored
Merge pull request #7 from totierne/patch-2
Patch 2 test -f test -d and separate loadstorm
2 parents bc2db2e + 8051a76 commit 0df5cef

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

upload/3topLevel_inner.sh

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -127,25 +127,11 @@ echo "#!/bin/bash
127127
cd ~oracle
128128
echo create second ORDS pdb takes two minutes on intel i5
129129
echo y |~/bin/createnewpdbminhr
130-
sqlplus system/oracle@ORDS <<EOF
131-
set echo on
132-
grant dba, connect , resource, unlimited tablespace, create session to storm identified by oracle;
133-
EOF
134-
cd ~/storm
135-
if test -f storm.zip
136-
then
137-
if test -f storm.dmp
138-
then
139-
echo storm.zip already unzipped
140-
else
141-
echo unzipping storm.zip
142-
unzip storm.zip >> storm_vm_log 2>&1
143-
fi
144-
echo importing storm.dmp
145-
imp storm/oracle@ORDS FILE=storm.dmp FULL=Y >> storm_vm_log 2>&1
146-
fi
147-
echo End of Import">~oracle/bin/newpdbords
148-
chmod 755 ~oracle/bin/newpdbords' > /tmp/hrrest.sh
130+
echo Spatial storm data can be loaded with loadstorm script
131+
">~oracle/bin/newpdbords
132+
cp /tmp/1/loadstorm ~oracle/bin/loadstorm
133+
chmod 755 ~oracle/bin/newpdbords
134+
chmod 755 ~oracle/bin/loadstorm' > /tmp/hrrest.sh
149135
chmod 755 /tmp/hrrest.sh
150136
su - oracle -c '/bin/bash -xc /tmp/hrrest.sh'
151137
rm /tmp/hrrest.sh
@@ -236,7 +222,7 @@ service oracle stop
236222
rm /tmp/asoracle
237223

238224
#if apex installed remove 12.2 apex
239-
if test -f ~oracle/apex
225+
if test -d ~oracle/apex
240226
then
241227
rm -rf $ORACLE_HOME/apex
242228
fi

upload/loadCoffeeShopApplication.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ then
1111
mv /home/oracle/bin/newpdbords /home/oracle/bin/newpdbords.x
1212
#put on top - unzip
1313
(echo '#!/bin/bash
14-
if test -f /home/oracle/Desktop/Database_Track/coffeeshop
14+
if test -d /home/oracle/Desktop/Database_Track/coffeeshop
1515
then
1616
echo coffeeshopApp already unzipped
1717
else

upload/loadstorm

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
cd ~/storm
3+
export THEPDB="$1"
4+
if test "m$THEPDB" = "m"
5+
then
6+
export THEPDB=ORDS
7+
fi
8+
sqlplus system/oracle@$THEPDB <<EOF
9+
set echo on
10+
grant dba, connect , resource, unlimited tablespace, create session to storm identified by oracle;
11+
EOF
12+
if test -f storm.zip
13+
then
14+
if test -f storm.dmp
15+
then
16+
echo storm.zip already unzipped
17+
else
18+
echo unzipping storm.zip
19+
unzip storm.zip >> storm_vm_log 2>&1
20+
fi
21+
echo importing storm.dmp
22+
imp storm/oracle@$THEPDB FILE=storm.dmp FULL=Y >> storm_vm_log 2>&1
23+
fi

0 commit comments

Comments
 (0)