App-Sqitch
view release on metacpan or search on metacpan
lib/sqitchtutorial-oracle.pod view on Meta::CPAN
-e APP_USER_PASSWORD=tiger \
gvenzl/oracle-xe:18-slim
This will create a user (and schema) named C<scott> in the pluggable database C<pdb1>.
To create a SID named C<flipr_test> pointing to the C<pdb1> database, add this entry to
F<$ORACLE_HOME/network/admin/tnsnames.ora>:
FLIPR_TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdb1)
)
)
=head3 Virtual Box Configuration
Some instructions for setting up the Database Virtual Box Appliance for
following along in this tutorial.
=over
=item *
See F<t/oracle.t> for instructions on downloading, installing, and configuring
the Oracle developer days VM.
=item *
Download and install L<VirtualBox|https://www.virtualbox.org/wiki/Downloads>.
=item *
Download the VM from the L<Database Virtual Box
Appliance|https://www.oracle.com/database/technologies/databaseappdev-vm.html>
page and import it into VirtualBox.
=item *
Once the VM is imported into VirtualBox and started, login with the username
"oracle" and the password "oracle". Then, in VirtualBox, go to Settings ->
Network, select the NAT adapter, and add two port forwarding rules
(https://barrymcgillin.blogspot.com/2011/12/using-oracle-developer-days-virtualbox.html):
Host Port | Guest Port
-----------+------------
1521 | 1521
2222 | 22
Then restart the VM. You should then be able to connect from your host with:
sqlplus sys/oracle@localhost/ORCL as sysdba
If this fails with either of these errors:
ORA-01017: invalid username/password; logon denied ORA-21561: OID
generation failed
Make sure that your computer's hostname is on the localhost line of F</etc/hosts>
(L<reference|https://sourceforge.net/p/tora/discussion/52737/thread/f68b89ad/>):
> hostname
stickywicket
> grep 127 /etc/hosts
127.0.0.1 localhost stickywicket
=item *
Give user C<scott> the access it needs:
ALTER USER scott IDENTIFIED BY tiger;
GRANT ALL PRIVILEGES TO scott;
=item *
To create a SID named C<flipr_test> pointing to the C<pdb1> database, add this entry to
F<$ORACLE_HOME/network/admin/tnsnames.ora>:
FLIPR_TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
=back
=head1 Starting a New Project
Usually the first thing to do when starting a new project is to create a
source code repository. So let's do that with Git:
> mkdir flipr
> cd flipr
> git init .
Initialized empty Git repository in /flipr/.git/
> touch README.md
> git add .
> git commit -am 'Initialize project, add README.'
[main (root-commit) 1bd134b] Initialize project, add README.
1 file changed, 38 insertions(+)
create mode 100644 README.md
If you're a Git user and want to follow along the history, the repository used
in these examples is L<on GitHub|https://github.com/sqitchers/sqitch-oracle-intro>.
Now that we have a repository, let's get started with Sqitch. Every Sqitch
project must have a name associated with it, and, optionally, a unique URI. We
recommend including the URI, as it increases the uniqueness of object
identifiers internally, so let's specify one when we initialize Sqitch:
identifiers internally, and will prevent the deployment of a different project
with the same name. So let's specify one when we initialize Sqitch:
Created sqitch.conf
Created sqitch.plan
Created deploy/
Created revert/
Created verify/
( run in 1.138 second using v1.01-cache-2.11-cpan-437f7b0c052 )