Skip to content

Commit 4aa4bae

Browse files
authored
Fix ORA-02199: missing DATAFILE/TEMPFILE when creating a new tablespace (#1)
* setting db_create_file parameter * fix sqlplus command * mkdir if not exists
1 parent 79af564 commit 4aa4bae

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ apt-get update
1010
# Prepare to install Oracle
1111
apt-get install -y libaio1 net-tools bc &&
1212
ln -s /usr/bin/awk /bin/awk &&
13-
mkdir /var/lock/subsys &&
13+
mkdir -p /var/lock/subsys &&
1414
mv /assets/chkconfig /sbin/chkconfig &&
1515
chmod 755 /sbin/chkconfig &&
1616

startup.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ service oracle-xe start
5555
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
5656
export PATH=$ORACLE_HOME/bin:$PATH
5757
export ORACLE_SID=XE
58+
export ORACLE_DATA=/u01/app/oracle/oradata/$ORACLE_SID
5859

5960

6061
if [ ! -e "/u01/app/oracle/initialized.id" ] ; then
@@ -79,6 +80,12 @@ if [ ! -e "/u01/app/oracle/initialized.id" ] ; then
7980

8081
fi
8182

83+
echo "Setting db_create_file_dest param..."
84+
if ! echo "ALTER SYSTEM SET db_create_file_dest = '$ORACLE_DATA';" | sqlplus -s SYSTEM/oracle; then
85+
echo "error setting db_create_file_dest param"
86+
exit 1
87+
fi
88+
8289
if [ -z "$ORACLE_PASSWORD" ] ; then
8390
echo "Warning: using default password!!. Set ORACLE_PASSWORD environment variable to change it"
8491
export ORACLE_PASSWORD="oracle";

0 commit comments

Comments
 (0)