Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing package dos2unix for db2 server #333

Open
marde16 opened this issue Feb 5, 2024 · 1 comment
Open

Missing package dos2unix for db2 server #333

marde16 opened this issue Feb 5, 2024 · 1 comment

Comments

@marde16
Copy link
Contributor

marde16 commented Feb 5, 2024

When an admin prepare a new environment for a side-by-side migration and must migrate Docs 2.0.1 to Docs 2.0.2 (under CentOS 7 (minimal installation)) the following script updateDBSchema.sh can't update the schema because of the missing package dos2unix to run this command dos2unix -n fixup$VERSION.sql fixup_tmp.sql

# Get schema from DB
db2 connect to CONCORD 
#db2 connect to CONCORD >/dev/null 2>&1
output=`db2 -x "select \"SCHEMA_VERSION\" from \"CONCORDDB\".\"PRODUCT\" where \"ID\"='lotuslive.symphony'"` 
db2 connect reset

# Parse schema number, or set to 0 if not found
trim() { echo $1; }
VERSION="$(trim $output )"
echo "Schema version number is $VERSION"
if ! [[ "$VERSION" =~ ^[0-9]+$ ]]
then
	echo "Get NON-NUMBER FOR SCHEMEMA version, SET IT TO ZERO "
	VERSION=0
fi
echo "update sql with version $VERSION"

DIRTY=0

while [ "" = "" ]
do
    ((VERSION++))
    if [ -f "fixup$VERSION.sql" ]
    then
        echo "applying fixup$VERSION.sql"
        dos2unix -n fixup$VERSION.sql fixup_tmp.sql
        mv -f fixup_tmp.sql fixup$VERSION.sql
        db2 -td@ -f fixup$VERSION.sql
        DIRTY=1
    else
        break
    fi
done

:
:

Please update the setup_os.yml playbook.

@pln-git4011
Copy link
Collaborator

Hi Martin, thank you for the feedback. Please submit a PR for this change and it will be merged into the Connections-Automation repository. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants