wnameless / docker-oracle-xe-11g

Dockerfile of Oracle Database Express Edition 11g Release 2
Apache License 2.0
1.35k stars 800 forks source link

[ ASK ] How To backup volume then restore it to different Computer #103

Open fahmyabdul opened 6 years ago

fahmyabdul commented 6 years ago

I'm new in using Docker, I want to backup volume from Server Computer to User Computer (From Different Computer), the step that I have done :

Running docker container with this command on Server Computer : docker run --restart=always -d -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true --mount source=oracle_vol,target=/u01/app/oracle wnameless/oracle-xe-11g:latest

Then I backup the volume with this command : docker run -it --rm -v oracle_vol:/volume -v /home/server123/backup/:/backup wnameless/oracle-xe-11g:latest tar -cjf /backup/orclvols_archive.tar.bz2 -C /volume ./

Then I copy the .tar.bz2 to User Computer and restore the volume with this command : docker run -it --rm -v oracle_vol:/volume -v /home/user123/backup_docker/:/backup wnameless/oracle-xe-11g:latest sh -c "rm -rf /volume/* /volume/..?* /volume/.[!.]* ; tar -C /volume/ -xjf /backup/orclvols_archive.tar.bz2"

Then run container in User Computer with command : docker run --restart=always -d -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true --mount source=oracle_vol,target=/u01/app/oracle wnameless/oracle-xe-11g:latest

And I got this error :

ERROR: ORA-01033: ORACLE initialization or shutdown in progress Process ID: 0 Session ID: 0 Serial number: 0

SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]] where ::= username>[/<password>][@<connect_identifier]

::= [][/][@] /usr/sbin/startup.sh: ignoring /docker-entrypoint-initdb.d/*

If I backup & restore it on the same Computer, I got no error and it run smoothly.

So how to backup the volume Then restore it on different computer? Is it possible?

I use this https://loomchild.net/2017/03/26/backup-restore-docker-named-volumes/ as reference.

Thanks

ryanfernandes09 commented 5 years ago

hey did you get this resolved? i've got the same issue.