Archive for the ‘Linux’ Category
Oracle 12c Pre-requisites
Installing any Oracle database is tedious, but the installing the prerequisites can be especially tedious. This post tries to simplify the process by creating a single prereq.sh
file for all the prerequisite libraries, except for the oracle-rdbms-server-12cR1-preinstall
, which you should run after the prerequisite file.
The prerequisite file should contain the following:
yum install -y binutils \ compat-libstdc++-33 \ compat-libstdc++-33.i686 \ gcc \ gcc-c++ \ glibc \ glibc.i686 \ glibc-devel \ glibc-devel.i686 \ ksh \ libgcc \ libgcc.i686 \ libstdc++ \ libstdc++.i686 \ libstdc++-devel \ libstdc++-devel.i686 \ libaio \ libaio.i686 \ libaio-devel \ libaio-devel.i686 \ libXext \ libXext.i686 \ libXtst \ libXtst.i686 \ libX11 \ libX11.i686 \ libXau \ libXau.i686 \ libxcb \ libxcb.i686 \ libXi \ libXi.i686 \ make \ sysstat \ unixODBC \ unixODBC-devel \ zlib-devel \ zlib-devel.i686 |
You can run the prereq.sh
script as the root
user like you would source an environment file:
. ./prereq.sh |
Dependent upon what you installed when creating the Oracle Linux 7.1 operating system, you should see something like this in the output console:
sh-4.2# . ./prereq.sh Loaded plugins: langpacks Package compat-libstdc++-33-3.2.3-72.el7.x86_64 already installed and latest version Package libXtst-1.2.2-2.1.el7.x86_64 already installed and latest version Package libXau-1.0.8-2.1.el7.x86_64 already installed and latest version Package 1:make-3.82-21.el7.x86_64 already installed and latest version Package sysstat-10.1.5-7.el7.x86_64 already installed and latest version Resolving Dependencies --> Running transaction check ---> Package binutils.x86_64 0:2.23.52.0.1-30.el7_1.2 will be updated ---> Package binutils.x86_64 0:2.23.52.0.1-55.el7 will be an update ---> Package compat-libstdc++-33.i686 0:3.2.3-72.el7 will be installed ---> Package gcc.x86_64 0:4.8.3-9.el7 will be updated --> Processing Dependency: gcc = 4.8.3-9.el7 for package: gcc-gfortran-4.8.3-9.el7.x86_64 --> Processing Dependency: gcc = 4.8.3-9.el7 for package: libquadmath-devel-4.8.3-9.el7.x86_64 ---> Package gcc.x86_64 0:4.8.5-4.el7 will be an update --> Processing Dependency: cpp = 4.8.5-4.el7 for package: gcc-4.8.5-4.el7.x86_64 --> Processing Dependency: libgomp = 4.8.5-4.el7 for package: gcc-4.8.5-4.el7.x86_64 ---> Package gcc-c++.x86_64 0:4.8.3-9.el7 will be updated ---> Package gcc-c++.x86_64 0:4.8.5-4.el7 will be an update ---> Package glibc.x86_64 0:2.17-78.0.1.el7 will be updated --> Processing Dependency: glibc = 2.17-78.0.1.el7 for package: glibc-headers-2.17-78.0.1.el7.x86_64 --> Processing Dependency: glibc = 2.17-78.0.1.el7 for package: glibc-common-2.17-78.0.1.el7.x86_64 ---> Package glibc.i686 0:2.17-106.0.1.el7_2.6 will be installed --> Processing Dependency: libfreebl3.so for package: glibc-2.17-106.0.1.el7_2.6.i686 --> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-106.0.1.el7_2.6.i686 ---> Package glibc.x86_64 0:2.17-106.0.1.el7_2.6 will be an update ---> Package glibc-devel.x86_64 0:2.17-78.0.1.el7 will be updated ---> Package glibc-devel.i686 0:2.17-106.0.1.el7_2.6 will be installed ---> Package glibc-devel.x86_64 0:2.17-106.0.1.el7_2.6 will be an update ---> Package ksh.x86_64 0:20120801-22.el7_1.3 will be installed ---> Package libX11.x86_64 0:1.6.0-2.1.el7 will be updated ---> Package libX11.i686 0:1.6.3-2.el7 will be installed --> Processing Dependency: libX11-common >= 1.6.3-2.el7 for package: libX11-1.6.3-2.el7.i686 ---> Package libX11.x86_64 0:1.6.3-2.el7 will be an update ---> Package libXau.i686 0:1.0.8-2.1.el7 will be installed ---> Package libXext.x86_64 0:1.3.2-2.1.el7 will be updated ---> Package libXext.i686 0:1.3.3-3.el7 will be installed ---> Package libXext.x86_64 0:1.3.3-3.el7 will be an update ---> Package libXi.x86_64 0:1.7.2-2.1.el7 will be updated ---> Package libXi.i686 0:1.7.4-2.el7 will be installed ---> Package libXi.x86_64 0:1.7.4-2.el7 will be an update ---> Package libXtst.i686 0:1.2.2-2.1.el7 will be installed ---> Package libaio.x86_64 0:0.3.109-12.el7 will be updated ---> Package libaio.i686 0:0.3.109-13.el7 will be installed ---> Package libaio.x86_64 0:0.3.109-13.el7 will be an update ---> Package libaio-devel.i686 0:0.3.109-13.el7 will be installed ---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed ---> Package libgcc.x86_64 0:4.8.3-9.el7 will be updated ---> Package libgcc.i686 0:4.8.5-4.el7 will be installed ---> Package libgcc.x86_64 0:4.8.5-4.el7 will be an update ---> Package libstdc++.x86_64 0:4.8.3-9.el7 will be updated ---> Package libstdc++.i686 0:4.8.5-4.el7 will be installed ---> Package libstdc++.x86_64 0:4.8.5-4.el7 will be an update ---> Package libstdc++-devel.x86_64 0:4.8.3-9.el7 will be updated ---> Package libstdc++-devel.i686 0:4.8.5-4.el7 will be installed ---> Package libstdc++-devel.x86_64 0:4.8.5-4.el7 will be an update ---> Package libxcb.x86_64 0:1.9-5.el7 will be updated ---> Package libxcb.i686 0:1.11-4.el7 will be installed ---> Package libxcb.x86_64 0:1.11-4.el7 will be an update ---> Package unixODBC.x86_64 0:2.3.1-11.el7 will be installed ---> Package unixODBC-devel.x86_64 0:2.3.1-11.el7 will be installed ---> Package zlib-devel.i686 0:1.2.7-15.el7 will be installed --> Processing Dependency: zlib = 1.2.7-15.el7 for package: zlib-devel-1.2.7-15.el7.i686 --> Processing Dependency: libz.so.1 for package: zlib-devel-1.2.7-15.el7.i686 ---> Package zlib-devel.x86_64 0:1.2.7-15.el7 will be installed --> Running transaction check ---> Package cpp.x86_64 0:4.8.3-9.el7 will be updated ---> Package cpp.x86_64 0:4.8.5-4.el7 will be an update ---> Package gcc-gfortran.x86_64 0:4.8.3-9.el7 will be updated ---> Package gcc-gfortran.x86_64 0:4.8.5-4.el7 will be an update --> Processing Dependency: libgfortran = 4.8.5-4.el7 for package: gcc-gfortran-4.8.5-4.el7.x86_64 --> Processing Dependency: libquadmath = 4.8.5-4.el7 for package: gcc-gfortran-4.8.5-4.el7.x86_64 ---> Package glibc-common.x86_64 0:2.17-78.0.1.el7 will be updated ---> Package glibc-common.x86_64 0:2.17-106.0.1.el7_2.6 will be an update ---> Package glibc-headers.x86_64 0:2.17-78.0.1.el7 will be updated ---> Package glibc-headers.x86_64 0:2.17-106.0.1.el7_2.6 will be an update ---> Package libX11-common.noarch 0:1.6.0-2.1.el7 will be updated ---> Package libX11-common.noarch 0:1.6.3-2.el7 will be an update ---> Package libgomp.x86_64 0:4.8.3-9.el7 will be updated ---> Package libgomp.x86_64 0:4.8.5-4.el7 will be an update ---> Package libquadmath-devel.x86_64 0:4.8.3-9.el7 will be updated ---> Package libquadmath-devel.x86_64 0:4.8.5-4.el7 will be an update ---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-12.el7_1 will be updated ---> Package nss-softokn-freebl.i686 0:3.16.2.3-14.2.el7_2 will be installed ---> Package nss-softokn-freebl.x86_64 0:3.16.2.3-14.2.el7_2 will be an update ---> Package zlib.x86_64 0:1.2.7-13.el7 will be updated ---> Package zlib.i686 0:1.2.7-15.el7 will be installed ---> Package zlib.x86_64 0:1.2.7-15.el7 will be an update --> Running transaction check ---> Package libgfortran.x86_64 0:4.8.3-9.el7 will be updated ---> Package libgfortran.x86_64 0:4.8.5-4.el7 will be an update ---> Package libquadmath.x86_64 0:4.8.3-9.el7 will be updated ---> Package libquadmath.x86_64 0:4.8.5-4.el7 will be an update --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: compat-libstdc++-33 i686 3.2.3-72.el7 ol7_latest 196 k glibc i686 2.17-106.0.1.el7_2.6 ol7_latest 4.2 M glibc-devel i686 2.17-106.0.1.el7_2.6 ol7_latest 1.0 M ksh x86_64 20120801-22.el7_1.3 ol7_latest 880 k libX11 i686 1.6.3-2.el7 ol7_latest 609 k libXau i686 1.0.8-2.1.el7 ol7_latest 28 k libXext i686 1.3.3-3.el7 ol7_latest 38 k libXi i686 1.7.4-2.el7 ol7_latest 39 k libXtst i686 1.2.2-2.1.el7 ol7_latest 19 k libaio i686 0.3.109-13.el7 ol7_latest 24 k libaio-devel i686 0.3.109-13.el7 ol7_latest 12 k libaio-devel x86_64 0.3.109-13.el7 ol7_latest 12 k libgcc i686 4.8.5-4.el7 ol7_latest 102 k libstdc++ i686 4.8.5-4.el7 ol7_latest 310 k libstdc++-devel i686 4.8.5-4.el7 ol7_latest 1.5 M libxcb i686 1.11-4.el7 ol7_latest 201 k unixODBC x86_64 2.3.1-11.el7 ol7_latest 412 k unixODBC-devel x86_64 2.3.1-11.el7 ol7_latest 54 k zlib-devel i686 1.2.7-15.el7 ol7_latest 49 k zlib-devel x86_64 1.2.7-15.el7 ol7_latest 49 k Updating: binutils x86_64 2.23.52.0.1-55.el7 ol7_latest 5.0 M gcc x86_64 4.8.5-4.el7 ol7_latest 16 M gcc-c++ x86_64 4.8.5-4.el7 ol7_latest 7.2 M glibc x86_64 2.17-106.0.1.el7_2.6 ol7_latest 3.6 M glibc-devel x86_64 2.17-106.0.1.el7_2.6 ol7_latest 1.0 M libX11 x86_64 1.6.3-2.el7 ol7_latest 605 k libXext x86_64 1.3.3-3.el7 ol7_latest 38 k libXi x86_64 1.7.4-2.el7 ol7_latest 39 k libaio x86_64 0.3.109-13.el7 ol7_latest 24 k libgcc x86_64 4.8.5-4.el7 ol7_latest 94 k libstdc++ x86_64 4.8.5-4.el7 ol7_latest 297 k libstdc++-devel x86_64 4.8.5-4.el7 ol7_latest 1.5 M libxcb x86_64 1.11-4.el7 ol7_latest 189 k Installing for dependencies: nss-softokn-freebl i686 3.16.2.3-14.2.el7_2 ol7_latest 187 k zlib i686 1.2.7-15.el7 ol7_latest 90 k Updating for dependencies: cpp x86_64 4.8.5-4.el7 ol7_latest 5.9 M gcc-gfortran x86_64 4.8.5-4.el7 ol7_latest 6.6 M glibc-common x86_64 2.17-106.0.1.el7_2.6 ol7_latest 11 M glibc-headers x86_64 2.17-106.0.1.el7_2.6 ol7_latest 662 k libX11-common noarch 1.6.3-2.el7 ol7_latest 161 k libgfortran x86_64 4.8.5-4.el7 ol7_latest 292 k libgomp x86_64 4.8.5-4.el7 ol7_latest 130 k libquadmath x86_64 4.8.5-4.el7 ol7_latest 182 k libquadmath-devel x86_64 4.8.5-4.el7 ol7_latest 45 k nss-softokn-freebl x86_64 3.16.2.3-14.2.el7_2 ol7_latest 203 k zlib x86_64 1.2.7-15.el7 ol7_latest 89 k Transaction Summary ================================================================================ Install 20 Packages (+ 2 Dependent packages) Upgrade 13 Packages (+11 Dependent packages) Total download size: 71 M Downloading packages: No Presto metadata available for ol7_latest (1/46): compat-libstdc++-33-3.2.3-72.el7.i686.rpm | 196 kB 00:00 (2/46): binutils-2.23.52.0.1-55.el7.x86_64.rpm | 5.0 MB 00:01 (3/46): cpp-4.8.5-4.el7.x86_64.rpm | 5.9 MB 00:01 (4/46): gcc-c++-4.8.5-4.el7.x86_64.rpm | 7.2 MB 00:02 (5/46): gcc-4.8.5-4.el7.x86_64.rpm | 16 MB 00:03 (6/46): glibc-2.17-106.0.1.el7_2.6.i686.rpm | 4.2 MB 00:01 (7/46): gcc-gfortran-4.8.5-4.el7.x86_64.rpm | 6.6 MB 00:02 (8/46): glibc-2.17-106.0.1.el7_2.6.x86_64.rpm | 3.6 MB 00:01 (9/46): glibc-devel-2.17-106.0.1.el7_2.6.i686.rpm | 1.0 MB 00:00 (10/46): glibc-devel-2.17-106.0.1.el7_2.6.x86_64.rpm | 1.0 MB 00:00 (11/46): glibc-headers-2.17-106.0.1.el7_2.6.x86_64.rpm | 662 kB 00:00 (12/46): ksh-20120801-22.el7_1.3.x86_64.rpm | 880 kB 00:00 (13/46): libX11-1.6.3-2.el7.i686.rpm | 609 kB 00:00 (14/46): libX11-1.6.3-2.el7.x86_64.rpm | 605 kB 00:00 (15/46): libX11-common-1.6.3-2.el7.noarch.rpm | 161 kB 00:00 (16/46): libXau-1.0.8-2.1.el7.i686.rpm | 28 kB 00:00 (17/46): libXext-1.3.3-3.el7.i686.rpm | 38 kB 00:00 (18/46): libXext-1.3.3-3.el7.x86_64.rpm | 38 kB 00:00 (19/46): libXi-1.7.4-2.el7.i686.rpm | 39 kB 00:00 (20/46): libXi-1.7.4-2.el7.x86_64.rpm | 39 kB 00:00 (21/46): libXtst-1.2.2-2.1.el7.i686.rpm | 19 kB 00:00 (22/46): libaio-0.3.109-13.el7.i686.rpm | 24 kB 00:00 (23/46): libaio-0.3.109-13.el7.x86_64.rpm | 24 kB 00:00 (24/46): libaio-devel-0.3.109-13.el7.i686.rpm | 12 kB 00:00 (25/46): glibc-common-2.17-106.0.1.el7_2.6.x86_64.rpm | 11 MB 00:04 (26/46): libaio-devel-0.3.109-13.el7.x86_64.rpm | 12 kB 00:00 (27/46): libgcc-4.8.5-4.el7.i686.rpm | 102 kB 00:00 (28/46): libgfortran-4.8.5-4.el7.x86_64.rpm | 292 kB 00:00 (29/46): libgomp-4.8.5-4.el7.x86_64.rpm | 130 kB 00:00 (30/46): libgcc-4.8.5-4.el7.x86_64.rpm | 94 kB 00:00 (31/46): libquadmath-4.8.5-4.el7.x86_64.rpm | 182 kB 00:00 (32/46): libquadmath-devel-4.8.5-4.el7.x86_64.rpm | 45 kB 00:00 (33/46): libstdc++-4.8.5-4.el7.i686.rpm | 310 kB 00:00 (34/46): libstdc++-4.8.5-4.el7.x86_64.rpm | 297 kB 00:00 (35/46): libstdc++-devel-4.8.5-4.el7.i686.rpm | 1.5 MB 00:00 (36/46): libstdc++-devel-4.8.5-4.el7.x86_64.rpm | 1.5 MB 00:00 (37/46): libxcb-1.11-4.el7.x86_64.rpm | 189 kB 00:00 (38/46): libxcb-1.11-4.el7.i686.rpm | 201 kB 00:00 (39/46): nss-softokn-freebl-3.16.2.3-14.2.el7_2.x86_64.rpm | 203 kB 00:00 (40/46): nss-softokn-freebl-3.16.2.3-14.2.el7_2.i686.rpm | 187 kB 00:00 (41/46): unixODBC-devel-2.3.1-11.el7.x86_64.rpm | 54 kB 00:00 (42/46): unixODBC-2.3.1-11.el7.x86_64.rpm | 412 kB 00:00 (43/46): zlib-1.2.7-15.el7.i686.rpm | 90 kB 00:00 (44/46): zlib-1.2.7-15.el7.x86_64.rpm | 89 kB 00:00 (45/46): zlib-devel-1.2.7-15.el7.x86_64.rpm | 49 kB 00:00 (46/46): zlib-devel-1.2.7-15.el7.i686.rpm | 49 kB 00:00 -------------------------------------------------------------------------------- Total 5.2 MB/s | 71 MB 00:13 Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : libgcc-4.8.5-4.el7.x86_64 1/70 Updating : glibc-common-2.17-106.0.1.el7_2.6.x86_64 2/70 Updating : nss-softokn-freebl-3.16.2.3-14.2.el7_2.x86_64 3/70 Updating : glibc-2.17-106.0.1.el7_2.6.x86_64 4/70 Updating : zlib-1.2.7-15.el7.x86_64 5/70 Updating : libquadmath-4.8.5-4.el7.x86_64 6/70 Updating : libstdc++-4.8.5-4.el7.x86_64 7/70 Updating : glibc-headers-2.17-106.0.1.el7_2.6.x86_64 8/70 Updating : libX11-common-1.6.3-2.el7.noarch 9/70 Installing : nss-softokn-freebl-3.16.2.3-14.2.el7_2.i686 10/70 Installing : glibc-2.17-106.0.1.el7_2.6.i686 11/70 Installing : libgcc-4.8.5-4.el7.i686 12/70 Installing : glibc-devel-2.17-106.0.1.el7_2.6.i686 13/70 Updating : libgfortran-4.8.5-4.el7.x86_64 14/70 Updating : cpp-4.8.5-4.el7.x86_64 15/70 Updating : binutils-2.23.52.0.1-55.el7.x86_64 16/70 Updating : libaio-0.3.109-13.el7.x86_64 17/70 Installing : unixODBC-2.3.1-11.el7.x86_64 18/70 Updating : libgomp-4.8.5-4.el7.x86_64 19/70 Updating : gcc-4.8.5-4.el7.x86_64 20/70 Updating : libquadmath-devel-4.8.5-4.el7.x86_64 21/70 Updating : libxcb-1.11-4.el7.x86_64 22/70 Updating : libX11-1.6.3-2.el7.x86_64 23/70 Updating : libXext-1.3.3-3.el7.x86_64 24/70 Updating : libXi-1.7.4-2.el7.x86_64 25/70 Updating : gcc-gfortran-4.8.5-4.el7.x86_64 26/70 Installing : unixODBC-devel-2.3.1-11.el7.x86_64 27/70 Installing : libaio-devel-0.3.109-13.el7.x86_64 28/70 Updating : glibc-devel-2.17-106.0.1.el7_2.6.x86_64 29/70 Updating : libstdc++-devel-4.8.5-4.el7.x86_64 30/70 Installing : zlib-devel-1.2.7-15.el7.x86_64 31/70 Installing : ksh-20120801-22.el7_1.3.x86_64 32/70 Installing : libstdc++-4.8.5-4.el7.i686 33/70 Installing : libstdc++-devel-4.8.5-4.el7.i686 34/70 Installing : libXau-1.0.8-2.1.el7.i686 35/70 Installing : libxcb-1.11-4.el7.i686 36/70 Installing : libX11-1.6.3-2.el7.i686 37/70 Installing : libXext-1.3.3-3.el7.i686 38/70 Installing : libXi-1.7.4-2.el7.i686 39/70 Installing : libaio-0.3.109-13.el7.i686 40/70 Installing : zlib-1.2.7-15.el7.i686 41/70 Installing : zlib-devel-1.2.7-15.el7.i686 42/70 Installing : libaio-devel-0.3.109-13.el7.i686 43/70 Updating : gcc-c++-4.8.5-4.el7.x86_64 44/70 Installing : libXtst-1.2.2-2.1.el7.i686 45/70 Installing : compat-libstdc++-33-3.2.3-72.el7.i686 46/70 Cleanup : gcc-gfortran-4.8.3-9.el7.x86_64 47/70 Cleanup : gcc-c++-4.8.3-9.el7.x86_64 48/70 Cleanup : libgfortran-4.8.3-9.el7.x86_64 49/70 Cleanup : libXi-1.7.2-2.1.el7.x86_64 50/70 Cleanup : libquadmath-devel-4.8.3-9.el7.x86_64 51/70 Cleanup : libstdc++-devel-4.8.3-9.el7.x86_64 52/70 Cleanup : gcc-4.8.3-9.el7.x86_64 53/70 Cleanup : glibc-devel-2.17-78.0.1.el7.x86_64 54/70 Cleanup : binutils-2.23.52.0.1-30.el7_1.2.x86_64 55/70 Cleanup : cpp-4.8.3-9.el7.x86_64 56/70 Cleanup : libstdc++-4.8.3-9.el7.x86_64 57/70 Cleanup : libXext-1.3.2-2.1.el7.x86_64 58/70 Cleanup : glibc-headers-2.17-78.0.1.el7.x86_64 59/70 Cleanup : libX11-1.6.0-2.1.el7.x86_64 60/70 Cleanup : libxcb-1.9-5.el7.x86_64 61/70 Cleanup : zlib-1.2.7-13.el7.x86_64 62/70 Cleanup : libgomp-4.8.3-9.el7.x86_64 63/70 Cleanup : libquadmath-4.8.3-9.el7.x86_64 64/70 Cleanup : libaio-0.3.109-12.el7.x86_64 65/70 Cleanup : libX11-common-1.6.0-2.1.el7.noarch 66/70 Cleanup : glibc-common-2.17-78.0.1.el7.x86_64 67/70 Cleanup : nss-softokn-freebl-3.16.2.3-12.el7_1.x86_64 68/70 Cleanup : glibc-2.17-78.0.1.el7.x86_64 69/70 Cleanup : libgcc-4.8.3-9.el7.x86_64 70/70 Verifying : libXext-1.3.3-3.el7.x86_64 1/70 Verifying : libgcc-4.8.5-4.el7.i686 2/70 Verifying : gcc-4.8.5-4.el7.x86_64 3/70 Verifying : glibc-devel-2.17-106.0.1.el7_2.6.i686 4/70 Verifying : libXext-1.3.3-3.el7.i686 5/70 Verifying : libstdc++-4.8.5-4.el7.i686 6/70 Verifying : glibc-2.17-106.0.1.el7_2.6.x86_64 7/70 Verifying : libxcb-1.11-4.el7.i686 8/70 Verifying : gcc-c++-4.8.5-4.el7.x86_64 9/70 Verifying : zlib-devel-1.2.7-15.el7.x86_64 10/70 Verifying : libaio-devel-0.3.109-13.el7.i686 11/70 Verifying : libX11-1.6.3-2.el7.x86_64 12/70 Verifying : glibc-common-2.17-106.0.1.el7_2.6.x86_64 13/70 Verifying : unixODBC-devel-2.3.1-11.el7.x86_64 14/70 Verifying : libXau-1.0.8-2.1.el7.i686 15/70 Verifying : libaio-0.3.109-13.el7.i686 16/70 Verifying : zlib-1.2.7-15.el7.x86_64 17/70 Verifying : ksh-20120801-22.el7_1.3.x86_64 18/70 Verifying : libaio-0.3.109-13.el7.x86_64 19/70 Verifying : libXtst-1.2.2-2.1.el7.i686 20/70 Verifying : glibc-2.17-106.0.1.el7_2.6.i686 21/70 Verifying : libstdc++-4.8.5-4.el7.x86_64 22/70 Verifying : libX11-common-1.6.3-2.el7.noarch 23/70 Verifying : zlib-devel-1.2.7-15.el7.i686 24/70 Verifying : unixODBC-2.3.1-11.el7.x86_64 25/70 Verifying : libgfortran-4.8.5-4.el7.x86_64 26/70 Verifying : libstdc++-devel-4.8.5-4.el7.i686 27/70 Verifying : gcc-gfortran-4.8.5-4.el7.x86_64 28/70 Verifying : libaio-devel-0.3.109-13.el7.x86_64 29/70 Verifying : nss-softokn-freebl-3.16.2.3-14.2.el7_2.x86_64 30/70 Verifying : glibc-headers-2.17-106.0.1.el7_2.6.x86_64 31/70 Verifying : zlib-1.2.7-15.el7.i686 32/70 Verifying : libstdc++-devel-4.8.5-4.el7.x86_64 33/70 Verifying : libXi-1.7.4-2.el7.x86_64 34/70 Verifying : cpp-4.8.5-4.el7.x86_64 35/70 Verifying : compat-libstdc++-33-3.2.3-72.el7.i686 36/70 Verifying : libX11-1.6.3-2.el7.i686 37/70 Verifying : libgomp-4.8.5-4.el7.x86_64 38/70 Verifying : libgcc-4.8.5-4.el7.x86_64 39/70 Verifying : binutils-2.23.52.0.1-55.el7.x86_64 40/70 Verifying : libquadmath-devel-4.8.5-4.el7.x86_64 41/70 Verifying : libXi-1.7.4-2.el7.i686 42/70 Verifying : glibc-devel-2.17-106.0.1.el7_2.6.x86_64 43/70 Verifying : nss-softokn-freebl-3.16.2.3-14.2.el7_2.i686 44/70 Verifying : libquadmath-4.8.5-4.el7.x86_64 45/70 Verifying : libxcb-1.11-4.el7.x86_64 46/70 Verifying : glibc-common-2.17-78.0.1.el7.x86_64 47/70 Verifying : libX11-common-1.6.0-2.1.el7.noarch 48/70 Verifying : libxcb-1.9-5.el7.x86_64 49/70 Verifying : libgfortran-4.8.3-9.el7.x86_64 50/70 Verifying : glibc-2.17-78.0.1.el7.x86_64 51/70 Verifying : libaio-0.3.109-12.el7.x86_64 52/70 Verifying : cpp-4.8.3-9.el7.x86_64 53/70 Verifying : libstdc++-devel-4.8.3-9.el7.x86_64 54/70 Verifying : libX11-1.6.0-2.1.el7.x86_64 55/70 Verifying : gcc-gfortran-4.8.3-9.el7.x86_64 56/70 Verifying : libquadmath-devel-4.8.3-9.el7.x86_64 57/70 Verifying : libXi-1.7.2-2.1.el7.x86_64 58/70 Verifying : glibc-devel-2.17-78.0.1.el7.x86_64 59/70 Verifying : gcc-c++-4.8.3-9.el7.x86_64 60/70 Verifying : nss-softokn-freebl-3.16.2.3-12.el7_1.x86_64 61/70 Verifying : libgcc-4.8.3-9.el7.x86_64 62/70 Verifying : binutils-2.23.52.0.1-30.el7_1.2.x86_64 63/70 Verifying : glibc-headers-2.17-78.0.1.el7.x86_64 64/70 Verifying : gcc-4.8.3-9.el7.x86_64 65/70 Verifying : zlib-1.2.7-13.el7.x86_64 66/70 Verifying : libXext-1.3.2-2.1.el7.x86_64 67/70 Verifying : libstdc++-4.8.3-9.el7.x86_64 68/70 Verifying : libgomp-4.8.3-9.el7.x86_64 69/70 Verifying : libquadmath-4.8.3-9.el7.x86_64 70/70 Installed: compat-libstdc++-33.i686 0:3.2.3-72.el7 glibc.i686 0:2.17-106.0.1.el7_2.6 glibc-devel.i686 0:2.17-106.0.1.el7_2.6 ksh.x86_64 0:20120801-22.el7_1.3 libX11.i686 0:1.6.3-2.el7 libXau.i686 0:1.0.8-2.1.el7 libXext.i686 0:1.3.3-3.el7 libXi.i686 0:1.7.4-2.el7 libXtst.i686 0:1.2.2-2.1.el7 libaio.i686 0:0.3.109-13.el7 libaio-devel.i686 0:0.3.109-13.el7 libaio-devel.x86_64 0:0.3.109-13.el7 libgcc.i686 0:4.8.5-4.el7 libstdc++.i686 0:4.8.5-4.el7 libstdc++-devel.i686 0:4.8.5-4.el7 libxcb.i686 0:1.11-4.el7 unixODBC.x86_64 0:2.3.1-11.el7 unixODBC-devel.x86_64 0:2.3.1-11.el7 zlib-devel.i686 0:1.2.7-15.el7 zlib-devel.x86_64 0:1.2.7-15.el7 Dependency Installed: nss-softokn-freebl.i686 0:3.16.2.3-14.2.el7_2 zlib.i686 0:1.2.7-15.el7 Updated: binutils.x86_64 0:2.23.52.0.1-55.el7 gcc.x86_64 0:4.8.5-4.el7 gcc-c++.x86_64 0:4.8.5-4.el7 glibc.x86_64 0:2.17-106.0.1.el7_2.6 glibc-devel.x86_64 0:2.17-106.0.1.el7_2.6 libX11.x86_64 0:1.6.3-2.el7 libXext.x86_64 0:1.3.3-3.el7 libXi.x86_64 0:1.7.4-2.el7 libaio.x86_64 0:0.3.109-13.el7 libgcc.x86_64 0:4.8.5-4.el7 libstdc++.x86_64 0:4.8.5-4.el7 libstdc++-devel.x86_64 0:4.8.5-4.el7 libxcb.x86_64 0:1.11-4.el7 Dependency Updated: cpp.x86_64 0:4.8.5-4.el7 gcc-gfortran.x86_64 0:4.8.5-4.el7 glibc-common.x86_64 0:2.17-106.0.1.el7_2.6 glibc-headers.x86_64 0:2.17-106.0.1.el7_2.6 libX11-common.noarch 0:1.6.3-2.el7 libgfortran.x86_64 0:4.8.5-4.el7 libgomp.x86_64 0:4.8.5-4.el7 libquadmath.x86_64 0:4.8.5-4.el7 libquadmath-devel.x86_64 0:4.8.5-4.el7 nss-softokn-freebl.x86_64 0:3.16.2.3-14.2.el7_2 zlib.x86_64 0:1.2.7-15.el7 Complete! |
After you have installed the prerequisites, you install the oracle-dbms-server-12cR1-preinstall
library as the root
user. You run the command as the root user like this:
yum install -y oracle-dbms-server-12cR1-preinstall |
You should see the following when it’s successful:
Loaded plugins: langpacks adobe-linux-x86_64 | 951 B 00:00 ol7_UEKR3 | 1.2 kB 00:00 ol7_latest | 1.4 kB 00:00 (1/2): ol7_latest/x86_64/updateinfo | 829 kB 00:00 (2/2): ol7_latest/x86_64/primary | 16 MB 00:02 ol7_latest 14500/14500 Resolving Dependencies --> Running transaction check ---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-4.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: oracle-rdbms-server-12cR1-preinstall x86_64 1.0-4.el7 ol7_latest 18 k Transaction Summary ================================================================================ Install 1 Package Total download size: 18 k Installed size: 43 k Downloading packages: oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64.rpm | 18 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64 1/1 Verifying : oracle-rdbms-server-12cR1-preinstall-1.0-4.el7.x86_64 1/1 Installed: oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-4.el7 Complete! |
After running the oracle-dbms-server-12cR1-preinstall library, you can navigate through the Applications, Sundry, and Users and Groups to see the following dialog:
It’s hard to tell from the GUI the oracle
user’s group. You can find oracle
primary user’s group by checking the /etc/passwd
file. You will find that oinstall
is the primary user’s group.
As always, I hope this helps those trying to install an Oracle Database 12c instance. Please post a comment if you have a better way to load the pre-requisite packages.
Linux User-Group Console
This post shows you how to add the menu option and GUI to set users and groups. It’s quite a bit easier than mastering all the command-line syntax. It makes setting up the required user and group accounts for an Oracle Enterprise or MySQL database solution much easier.
You add the utility by calling the yum (Yellowdog Updater, Modified) utility like this:
yum installed -y system-config_users |
You should see the following:
Loaded plugins: langpacks adobe-linux-x86_64 | 951 B 00:00 ol7_UEKR3 | 1.2 kB 00:00 ol7_latest | 1.4 kB 00:00 Resolving Dependencies --> Running transaction check ---> Package system-config-users.noarch 0:1.3.5-2.el7 will be installed --> Processing Dependency: system-config-users-docs for package: system-config-users-1.3.5-2.el7.noarch --> Running transaction check ---> Package system-config-users-docs.noarch 0:1.0.9-6.el7 will be installed --> Processing Dependency: rarian-compat for package: system-config-users-docs-1.0.9-6.el7.noarch --> Running transaction check ---> Package rarian-compat.x86_64 0:0.8.1-11.el7 will be installed --> Processing Dependency: rarian = 0.8.1-11.el7 for package: rarian-compat-0.8.1-11.el7.x86_64 --> Processing Dependency: rarian for package: rarian-compat-0.8.1-11.el7.x86_64 --> Processing Dependency: librarian.so.0()(64bit) for package: rarian-compat-0.8.1-11.el7.x86_64 --> Running transaction check ---> Package rarian.x86_64 0:0.8.1-11.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: system-config-users noarch 1.3.5-2.el7 ol7_latest 337 k Installing for dependencies: rarian x86_64 0.8.1-11.el7 ol7_latest 97 k rarian-compat x86_64 0.8.1-11.el7 ol7_latest 65 k system-config-users-docs noarch 1.0.9-6.el7 ol7_latest 307 k Transaction Summary ================================================================================ Install 1 Package (+3 Dependent packages) Total download size: 805 k Installed size: 3.9 M Downloading packages: (1/4): rarian-0.8.1-11.el7.x86_64.rpm | 97 kB 00:00 (2/4): rarian-compat-0.8.1-11.el7.x86_64.rpm | 65 kB 00:00 (3/4): system-config-users-1.3.5-2.el7.noarch.rpm | 337 kB 00:00 (4/4): system-config-users-docs-1.0.9-6.el7.noarch.rpm | 307 kB 00:00 -------------------------------------------------------------------------------- Total 830 kB/s | 805 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : rarian-0.8.1-11.el7.x86_64 1/4 Installing : rarian-compat-0.8.1-11.el7.x86_64 2/4 Installing : system-config-users-1.3.5-2.el7.noarch 3/4 Installing : system-config-users-docs-1.0.9-6.el7.noarch 4/4 Verifying : rarian-compat-0.8.1-11.el7.x86_64 1/4 Verifying : system-config-users-1.3.5-2.el7.noarch 2/4 Verifying : rarian-0.8.1-11.el7.x86_64 3/4 Verifying : system-config-users-docs-1.0.9-6.el7.noarch 4/4 Installed: system-config-users.noarch 0:1.3.5-2.el7 Dependency Installed: rarian.x86_64 0:0.8.1-11.el7 rarian-compat.x86_64 0:0.8.1-11.el7 system-config-users-docs.noarch 0:1.0.9-6.el7 Complete! |
After successfully installing the radian
, rarian-compat
, system-config-users
, and system-config-users-docs
packages, you will find that there’s now a Users and Groups option when you navigate by clicking on Applications and then clicking on Sundry from the menu.
Menu Instructions
- You navigate to the Applications menu, and choose Sundry from the menu list and Users and Groups from the menu item to continue.
- You will be prompted for the sudoer’s password in this dialog.
- At this point, you can use the GUI interface to set users and groups.
As always, I hope this helps those trying to set users and passwords without mastering the command-line syntax.
Fix VMware Networking
Occasionally, my students loose their network connection when copying their virtual machines. This article shows you how to rebuild your Internet connection.
The first step requires you to identify the port number on your host operating system, which is typically Windows OS or Mac OS X. You can find that by running the following search from a Mac OS X Terminal session or Windows OS Command session.
If you’re on the Mac OS X, you launch a Terminal session and then use the sudo
command to open a shell as the root
super user, like this:
sudo sh |
As the root
super user on Mac OS X , you run the netstat
command like this:
sh-3.2# netstat -a | grep 1.ntp | grep -v grep udp4 0 0 192.168.147.1.ntp *.* |
VMware uses the same subdomain with one difference for the gateway, it uses node 2:
192.168.147.2 |
The alternate syntax to find Vmware’s subdomain requires you to use an Administrator account on Windows, like this:
C:\> netstat -a | findstr /C:.ntp |
After you determine the subdomain, you need to ensure VMware is configured correctly. You navigate to the menu and choose Virtual Machine and then Settings from the dropdown menu. The software shows you the following:
Then, click on the Network Adapter under the Removable Devices, and you see the following screen:
You need to make sure that you’re using Internet Sharing, or Share with my Mac. If you’re not using it select it now.
Launch the hosted Linux OS and open a Terminal seesion. Inside the Terminal, you should find the machine’s address as the root address with the ifconfig
utility. The technique follows:
[student@localhost ~]$ sudo sh [sudo] password for student: sh-4.2# ifconfig eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 00:0c:29:70:77:64 txqueuelen 1000 (Ethernet) RX packets 34 bytes 4190 (4.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
Next, you need to edit some files, they assume the VMware Network Gateway is 192.168.147.2
and the machine’s address is “00:0c:29:70:77:64
“. The first file you need to edit is the /etc/resolv.conf
file, and it should look like this:
domain localdomain search localdomain nameserver 192.168.147.2 |
The second file you need to edit is the /etc/sysconfig/network
file. It should look like this:
# Created by anaconda NETWORKING=yes HOSTNAME=localhost.localdomain GATEWAY=192.168.147.2 |
The third file you need to edit is the /etc/sysconfig/network-scripts/ifcfg-eth0
file. It should look like this:
DEVICE=eth0 HWADDR=00:0c:29:70:77:64 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=dhcp TYPE=Ethernet DNS1=192.168.147.2 USERCTL=no PEERDNS=yes IPV6INIT=no |
The last step requires that you reboot the machine or run the /etc/rc.d/init.d/network
to restart the network. I hope this helps those trying to restore their VMware hosted operating systems network connection.
Fedora LAMP Steps
I posted earlier in the year how to configure a Fedora instance to test PHP code on a local VM. However, I’ve got a few questions on how to find those posts. Here’s a consolidation with links on those steps:
- Go to this blog post and install the
httpd
andphp
libraries with theyum
installer. - In the same blog post as step 1 (you can put the sample PHP code into the
/var/www/html
directory for testing), connect to theyum
shell and remove thephp-mysql
library and then install themysqlnd
library. - Go to this blog post and install the
php-gd
libraries, which enable you to render PNG images stored as binary streams in MySQL.
As always, I hope that helps.
Mac SQL Developer Install
This how you install SQL Developer on Mac OS Yosemite. The first thing you need to do is download and install Java 8, not Java 7 on your Mac OS Yosemite as suggested on some web sites. You can determine whether or not Java is installed by running the following command:
Mac-Pro-3:~ username$ java -version No Java runtime present, requesting install. |
You must accept the Java license to install Java 8 on the Mac OS X operating system:
You have the option of installing the Java SDK or JDK. I’ve opted to install Netbeans 8 with JDK 8u45, as you can tell from the screen capture after you launched the file:
It is a standard Mac OS installation, which is why I didn’t bother showing any dialog messages. After installing the Java JDK or SDK, you should download SQL Developer 4.1 from Oracle’s web site. Below is a screen shot of the Oracle download web page where I’ve accepted the license agreement:
If you attempt to launch the installation and you’ve set your Mac Security to the “Mac App Store and identified developers” setting, you should raise the following exception:
If you reset the Mac Security to an “Anywhere” setting, you can install Oracle SQL Developer on Yosemite. Just make sure you reset it to the “Mac App Store and identified developers” setting after you install SQL Developer.
If you launch SQL Developer with the Security “Anywhere” setting, it displays the following dialog:
After you launch the program, you will see the following progress dialog:
The last step of the installation launches SQL Developer, as shown below:
Click the Connections icon to create an initial connection, like the following:
After connecting to the database, you can write and execute a query as shown in the next screen capture:
As always, I hope that this helps those who require an example to install SQL Server on a Mac OS.
Run X11 Apps on Mac
It’s possible folks didn’t notice but Mac OS X no longer includes XQuartz by default from Maverick forward. You need to download XQuartz and install it. I’d recommend after you install Xcode.
Launch XQuartz and then either use the bash
shell it opens or open a Terminal bash
shell session. Inside the shell, you might start Secure Shell (ssh
) like this:
Mac-Pro-3:~ michaelmclaughlin$ ssh student@192.168.2.170 student@192.168.2.170's password: Last login: Thu Jun 4 14:33:37 2015 [student@localhost ~]$ xclock & [1] 10422 [student@localhost ~]$ Error: Can't open display: |
Granted that’s a trivial error and running the xclock X11 applications isn’t crucial, an error that makes it more important is the following from Oracle’s old Designer/2000 application:
FRM-91111: Internal Error: window system startup failure. FRM-10039: Unable to start up the Form Builder. |
This is the desired behavior. Secure shell (ssh
) can’t run it unless you make the connection with the -Y
flag. You should use the following syntax:
Mac-Pro-3:~ michaelmclaughlin$ ssh -Y student@192.168.2.170 student@192.168.2.170's password: Last login: Tue Jun 9 14:56:55 2015 from 192.168.2.1 /usr/bin/xauth: file /home/student/.Xauthority does not exist [student@localhost ~]$ xclock & [1] 10760 |
You can safely ignore the .Xauthority does not exist warning message because it’ll create a .Xauthority
file and store the magic cookie after the warning message. You should see the xclock
program running in the upper left hand corner of your console, like:
It’s terrific that you don’t get a font warning like you typically would using UTF-8 on Linux. Nice that the Mac OS fonts are so well done that there isn’t a raised exception.
Using xclock
or xeyes
isn’t very useful as a rule, but this method also lets you run any of the Linux GUI applications. For example, the following gedit
command lets you run the gedit
utility from a Mac OS console. If you’ve installed the gedit
plug-ins, you also can use the Terminal console on the remote system.
The process sequence for the command-line is shown below:
1030 1 /usr/sbin/sshd -D - The root process launches the ssh daemon 3145 1030 sshd: student [priv] - The sshd launches a ssh session to manage a student ssh session 3152 3145 sshd: student@pts/1 - The ssh session launched to manage the ssh session 3166 3152 -bash - The bash shell launched by connecting through the ssh session 3240 3166 gedit - The gedit command issued inside a ssh session 3166 3240 gnome-pty-helper - Launching the gedit session across X11 3169 3240 /bin/bash - Launching the Terminal session inside the gedit session across X11 3269 3884 ps -ef - Command run inside the gedit Terminal session |
Hope that helps those who want to use X11 applications on the Mac OS.
Fedora X11 Install
While working through getting my Mac OS X to work with X11, I stumbled on some interesting errors and misdirection solutions. Like most things, the solution was straightforward. Then, it struck me that I hadn’t installed it on my Fedora image. This blog post show you the errors I got the way to get it to work, and how to install X11 on Fedora.
The first step requires discovering the package. If you remember xclock
or xeyes
are X-Windows programs, it’s quite easy with this command (though it may take a moment or two to run):
repoquery -q -f */xclock |
It will return something like this:
xorg-x11-apps-0:7.7-7.fc20.x86_64 |
You can then install X11 as a sudoer
user with the yum
utility like this:
sudo yum -y install xorg-x11-apps |
It should return this to your console:
Loaded plugins: langpacks, refresh-packagekit Resolving Dependencies --> Running transaction check ---> Package xorg-x11-apps.x86_64 0:7.7-7.fc20 will be installed --> Processing Dependency: xorg-x11-xbitmaps for package: xorg-x11-apps-7.7-7.fc20.x86_64 --> Running transaction check ---> Package xorg-x11-xbitmaps.noarch 0:1.1.1-6.fc20 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: xorg-x11-apps x86_64 7.7-7.fc20 fedora 305 k Installing for dependencies: xorg-x11-xbitmaps noarch 1.1.1-6.fc20 fedora 37 k Transaction Summary ================================================================================ Install 1 Package (+1 Dependent package) Total download size: 341 k Installed size: 949 k Downloading packages: (1/2): xorg-x11-apps-7.7-7.fc20.x86_64.rpm | 305 kB 00:01 (2/2): xorg-x11-xbitmaps-1.1.1-6.fc20.noarch.rpm | 37 kB 00:00 -------------------------------------------------------------------------------- Total 252 kB/s | 341 kB 00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction (shutdown inhibited) Installing : xorg-x11-xbitmaps-1.1.1-6.fc20.noarch 1/2 Installing : xorg-x11-apps-7.7-7.fc20.x86_64 2/2 Verifying : xorg-x11-apps-7.7-7.fc20.x86_64 1/2 Verifying : xorg-x11-xbitmaps-1.1.1-6.fc20.noarch 2/2 Installed: xorg-x11-apps.x86_64 0:7.7-7.fc20 Dependency Installed: xorg-x11-xbitmaps.noarch 0:1.1.1-6.fc20 Complete! |
After you install the xorg-x11-apps
libraries, you can launch xclock
. You should use the following syntax:
xclock & |
It should display something like the following on your console:
The warning message is typically because you’re running something like en_US.UTF-8
mode. You can find suitable X11 character sets by using the following command:
sudo yum search xorg-x11-fonts |
You can install all of them with the following command:
sudo yum -y install xorg-x11-fonts* |
However, at the end of the day the warning doesn’t go way. You should just ignore it.
Hope this helps those who want to install X11 on Fedora.
Bash Arrays & Oracle
Last week, I wrote about how to use bash
arrays and the MySQL database to create unit and integration test scripts. While the MySQL example was nice for some users, there were some others who wanted me to show how to write bash
shell scripts for Oracle unit and integration testing. That’s what this blog post does.
If you don’t know much about bash
shell, you should start with the prior post to learn about bash arrays, if-statements, and for-loops. In this blog post I only cover how to implement a bash
shell script that runs SQL scripts in silent mode and then queries the database in silent mode and writes the output to an external file.
I’ve copied the basic ERD for the example because of a request from a reader. In their opinion it makes cross referencing the two posts unnecessary.
To run the bash
shell script, you’ll need the following SQL files, which you can see by clicking not he title below. There are several differences. For example, Oracle doesn’t support a DROP IF EXISTS
syntax and requires you to write anonymous blocks in their PL/SQL language; and you must explicitly issue a QUIT;
statement even when running in silent mode unlike MySQL, which implicitly issues an exit.
Setup SQL Files ↓
The actor.sql
file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | -- Drop actor table and actor_s sequence. BEGIN FOR i IN (SELECT object_name , object_type FROM user_objects WHERE object_name IN ('ACTOR','ACTOR_S')) LOOP IF i.object_type = 'TABLE' THEN EXECUTE IMMEDIATE 'DROP TABLE ' || i.object_name || ' CASCADE CONSTRAINTS'; ELSIF i.object_type = 'SEQUENCE' THEN EXECUTE IMMEDIATE 'DROP SEQUENCE ' || i.object_name; END IF; END LOOP; END; / -- Create an actor table. CREATE TABLE actor ( actor_id NUMBER CONSTRAINT actor_pk PRIMARY KEY , actor_name VARCHAR(30) NOT NULL ); -- Create an actor_s sequence. CREATE SEQUENCE actor_s; -- Insert two rows. INSERT INTO actor VALUES (actor_s.NEXTVAL,'Chris Hemsworth'); INSERT INTO actor VALUES (actor_s.NEXTVAL,'Chris Pine'); INSERT INTO actor VALUES (actor_s.NEXTVAL,'Chris Pratt'); -- Quit session. QUIT; |
The film.sql
file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | -- Drop film table and film_s sequence. BEGIN FOR i IN (SELECT object_name , object_type FROM user_objects WHERE object_name IN ('FILM','FILM_S')) LOOP IF i.object_type = 'TABLE' THEN EXECUTE IMMEDIATE 'DROP TABLE ' || i.object_name || ' CASCADE CONSTRAINTS'; ELSIF i.object_type = 'SEQUENCE' THEN EXECUTE IMMEDIATE 'DROP SEQUENCE ' || i.object_name; END IF; END LOOP; END; / -- Create a film table. CREATE TABLE film ( film_id NUMBER CONSTRAINT film_pk PRIMARY KEY , film_name VARCHAR(30) NOT NULL ); -- Create an actor_s sequence. CREATE SEQUENCE film_s; -- Insert four rows. INSERT INTO film VALUES (film_s.NEXTVAL,'Thor'); INSERT INTO film VALUES (film_s.NEXTVAL,'Thor: The Dark World'); INSERT INTO film VALUES (film_s.NEXTVAL,'Star Trek'); INSERT INTO film VALUES (film_s.NEXTVAL,'Star Trek into Darkness'); INSERT INTO film VALUES (film_s.NEXTVAL,'Guardians of the Galaxy'); -- Quit session. QUIT; |
The movie.sql
file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | -- Drop movie table and movie_s sequence. BEGIN FOR i IN (SELECT object_name , object_type FROM user_objects WHERE object_name IN ('MOVIE','MOVIE_S')) LOOP IF i.object_type = 'TABLE' THEN EXECUTE IMMEDIATE 'DROP TABLE ' || i.object_name || ' CASCADE CONSTRAINTS'; ELSIF i.object_type = 'SEQUENCE' THEN EXECUTE IMMEDIATE 'DROP SEQUENCE ' || i.object_name; END IF; END LOOP; END; / -- Create an movie table. CREATE TABLE movie ( movie_id NUMBER CONSTRAINT movie_pk PRIMARY KEY , actor_id NUMBER CONSTRAINT movie_nn1 NOT NULL , film_id NUMBER CONSTRAINT movie_nn2 NOT NULL , CONSTRAINT actor_fk FOREIGN KEY (actor_id) REFERENCES actor (actor_id) , CONSTRAINT film_fk FOREIGN KEY (film_id) REFERENCES film(film_id)); -- Create table constraint. CREATE SEQUENCE movie_s; -- Insert translation rows. INSERT INTO movie VALUES ( movie_s.NEXTVAL ,(SELECT actor_id FROM actor WHERE actor_name = 'Chris Hemsworth') ,(SELECT film_id FROM film WHERE film_name = 'Thor')); INSERT INTO movie VALUES ( movie_s.NEXTVAL ,(SELECT actor_id FROM actor WHERE actor_name = 'Chris Hemsworth') ,(SELECT film_id FROM film WHERE film_name = 'Thor: The Dark World')); INSERT INTO movie VALUES ( movie_s.NEXTVAL ,(SELECT actor_id FROM actor WHERE actor_name = 'Chris Pine') ,(SELECT film_id FROM film WHERE film_name = 'Star Trek')); INSERT INTO movie VALUES ( movie_s.NEXTVAL ,(SELECT actor_id FROM actor WHERE actor_name = 'Chris Pine') ,(SELECT film_id FROM film WHERE film_name = 'Star Trek into Darkness')); INSERT INTO movie VALUES ( movie_s.NEXTVAL ,(SELECT actor_id FROM actor WHERE actor_name = 'Chris Pratt') ,(SELECT film_id FROM film WHERE film_name = 'Guardians of the Galaxy')); -- Quit session. QUIT; |
The tables.sql
file, lets you verify the creation of the actor
, film
, and movie
tables:
1 2 3 4 5 6 7 8 9 | -- Set Oracle column width. COL table_name FORMAT A30 HEADING "Table Name" -- Query the tables. SELECT table_name FROM user_tables; -- Exit SQL*Plus. QUIT; |
The results.sql
file, lets you see join results from actor
, film
, and movie
tables:
1 2 3 4 5 6 7 8 9 10 11 | -- Format query. COL film_actors FORMAT A40 HEADING "Actors in Films" -- Diagnostic query. SELECT a.actor_name || ', ' || f.film_name AS film_actors FROM actor a INNER JOIN movie m ON a.actor_id = m.actor_id INNER JOIN film f ON m.film_id = f.film_id; -- Quit the session. QUIT; |
If you don’t have a sample
test schema to use to test this script, you can create a sample
schema with the following create_user.sql
file. The file depends on the existence of a users
and temp
tablespace.
Click the link below to see the source code for a script that let’s you create a sample
user account as the system
user:
Create sample
User SQL File ↓
You can use the dbms_metadata.get_ddl
function to discover the existence of the tablespaces. The following SQL syntax returns the SQL DDL statement that created a users
or temp
tablespace:
1 2 | SET LONG 200000 SELECT dbms_metadata.get_ddl('TABLESPACE','USERS') FROM dual; |
You create the sample
database with the following SQL statements:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | -- Drop the sample user table. BEGIN FOR i IN (SELECT username FROM dba_users WHERE username = 'SAMPLE') LOOP EXECUTE IMMEDIATE 'DROP USER ' || i.username || ' CASCADE'; END LOOP; END; / -- Create the sample user table. CREATE USER sample IDENTIFIED BY sample DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA 50M ON users; -- Grant privileges to sample user. GRANT CREATE CLUSTER, CREATE INDEXTYPE, CREATE OPERATOR , CREATE PROCEDURE, CREATE SEQUENCE, CREATE SESSION , CREATE TABLE, CREATE TRIGGER, CREATE TYPE , CREATE VIEW TO sample; |
The following list_oracle.sh
shell script expects to receive the username
, password
, and fully qualified path
in that specific order. The script names are entered manually in the array because this should be a unit test script.
This is an insecure version of the list_oracle.sh
script because you provide the password on the command line. It’s better to provide the password as you run the script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #!/usr/bin/bash # Assign user and password username="${1}" password="${2}" directory="${3}" echo "User name:" ${username} echo "Password: " ${password} echo "Directory:" ${directory} # Define an array. declare -a cmd # Assign elements to an array. cmd[0]="actor.sql" cmd[1]="film.sql" cmd[2]="movie.sql" # Call the array elements. for i in ${cmd[*]}; do sqlplus -s ${username}/${password} @${directory}/${i} > /dev/null done # Connect and pipe the query result minus errors and warnings to the while loop. sqlplus -s ${username}/${password} @${directory}/tables.sql 2>/dev/null | # Read through the piped result until it's empty. while IFS='\n' read actor_name; do echo $actor_name done # Connect and pipe the query result minus errors and warnings to the while loop. sqlplus -s ${username}/${password} @${directory}/result.sql 2>/dev/null | # Read through the piped result until it's empty. while IFS='\n' read actor_name; do echo $actor_name done |
The IFS
(Internal Field Separator) works with whitespace by default. The IFS
on lines 29 and 37 sets the IFS
to a line return ('\n'
). That’s the trick to display the data, and you can read more about the IFS
in this question and answer post.
You can run the shell script with the following syntax:
./list_oracle.sh sample sample /home/student/Code/bash/oracle > output.txt |
You can then display the results from the output.txt
file with the following command:
cat output.txt command: |
It will display the following output:
User name: sample Password: sample Directory: /home/student/Code/bash/oracle Table Name ------------------------------ MOVIE FILM ACTOR Actors in Films ---------------------------------------- Chris Hemsworth, Thor Chris Hemsworth, Thor: The Dark World Chris Pine, Star Trek Chris Pine, Star Trek into Darkness Chris Pratt, Guardians of the Galaxy |
As always, I hope this helps those looking for a solution.
Bash Arrays & MySQL
Student questions are always interesting! They get me to think and to write. The question this time is: “How do I write a Bash Shell script to process multiple MySQL script files?” This post builds the following model (courtesy of MySQL Workbench) by using a bash shell script and MySQL script files, but there’s a disclaimer on this post. It shows both insecure and secure approaches and you should avoid the insecure ones.
It seems a quick refresher on how to use arrays in bash
shell may be helpful. While it’s essential in a Linux environment, it’s seems not everyone masters the bash
shell.
Especially, since I checked my Learning the Bash Shell (2nd Edition) and found a typo on how you handle arrays in the bash
shell, and it’s a mistake that could hang newbies up (on page 161). Perhaps I should update my copy because I bought it in 1998. 😉 It was good then, and the new edition is probably better. The error is probably corrected in the current Learning the Bash Shell, but if not, the following examples show you how to use arrays in loops.
Naturally, these do presume some knowledge of working with bash
shell, like the first line always is the same in any bash
shell script. That you open an if-statement with an if
and close it with a fi
, and that you else-if is elif
; and that a semicolon between a for-statement and the do
statement is required when they’re on the same line because they’re two statements.
If you’re new to bash
shell arrays, click on the link below to expand a brief tutorial. It takes you through three progressive examples of working with bash
arrays.
Working with bash
Arrays ↓
A basic example of working with an array in bash
shell is the following list1.sh
script:
1 2 3 4 5 6 7 8 9 10 11 12 13 | #!/usr/bin/bash # Print script name. echo $0 #!/usr/bin/bash # Define an array. declare -a cmd=("one" "two" "three") # Call the array elements. for i in ${cmd[*]}; do echo ${i} done |
Line 8 declares the cmd
array by assigning three strings. Line 12 returns the elements of the array to the ${i}
variable, which lets you manage them one at a time. You use the chmod
command to make the list1.sh
executable, like this:
chmod 755 list1.sh |
Then, you can run it like this from the present working directory (pwd
):
./list1.sh |
It should print:
one two three |
The list2.sh
example changes the cmd
array declaration from list1.sh
. It declares the cmd
array as an empty array, and then it assigns elements by index numbers (using a zero-based index), as shown below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #!/usr/bin/bash # Define an array. declare -a cmd # Assign elements to an array. cmd[0]="one" cmd[1]="two" cmd[2]="three" # Call the array elements. for i in ${cmd[*]}; do echo ${i} done |
Lines 7 through 9 assign values to the elements of the cmd
array. You would chmod
the file, and run the file as qualified above for the list1.sh
script.
The last pre-implementation example requires that you create three demonstration scripts, the one.sh
, two.sh
, and three.sh
scripts. You should put them in the same directory as the list3.sh
script.
The demonstration scripts should all have the same code, like this:
1 2 3 4 | #!/usr/bin/bash # Print script name. echo $0 |
Line 4 returns command line parameter $0
or ${0}
, which is always the command line program’s file name. The file name may be provided as a relative or absolute file name, and if that’s new to you please check out The Linux Command Line: A Complete Introduction (also downloadable as a PDF for free).
The list3.sh
script should contain the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #!/usr/bin/bash <code> # Define an array. declare -a cmd # Assign elements to an array. cmd[0]="one.sh" cmd[1]="two.sh" cmd[2]="three.sh" # Call the array elements. for i in ${cmd[*]}; do `pwd`/${i} done |
When you run the list3.sh
script from the /home/student/Code/bash directory with a local syntax, the script should return the fully qualified file names of the subshell programs. The output should look like this:
/home/student/Code/bash/one.sh /home/student/Code/bash/two.sh /home/student/Code/bash/three.sh |
The list3.sh
script provides the present working directory (pwd
) and the one.sh
, two.sh
, and three.sh
scripts return only their executable name. For example, if you ran one.sh
with the following syntax:
./one.sh |
It returns
./one.sh |
Only one more trick needs to be qualified before our main MySQL examples. That trick is how you pass parameters to a bash
shell script. For reference, this is the part that’s insecure because user command histories are available inside the Linux OS.
Here’s a hello_whom.sh
script to demonstrates the concept of parameter passing:
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/bash # This says hello to the argument while managing no argument. if [[ ${#} = 1 ]]; then echo 'The '${0}' program says: "Hello '${1}'!"' elif [[ ${#} > 1 ]]; then echo 'The '${0}' program wants to know if you have more than one name?' else echo 'The '${0}' program wants to know if you have a name?' fi |
If you need more on how parameters are passed and managed, you can check a prior blob post on Handling bash
Parameters, or check the bash help pages. The following leverages bash
arrays to run scripts and query the MySQL database from the command line.
You will need the three batch SQL files first, so here they are:
Setup SQL Files ↓
The actor.sql
file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | -- Use the sampledb database. USE sampledb; -- Disable foreign key checking. SET foreign_key_checks = 0; -- Drop an actor table. DROP TABLE IF EXISTS actor; -- Create an actor table. CREATE TABLE actor ( actor_id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT , actor_name VARCHAR(30) NOT NULL ); -- Insert two rows. INSERT INTO actor (actor_name) VALUES ('Chris Hemsworth'); INSERT INTO actor (actor_name) VALUES ('Chris Pine'); INSERT INTO actor (actor_name) VALUES ('Chris Pratt'); |
The film.sql
file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | -- Use the sampledb database. USE sampledb; -- Disable foreign key checking. SET foreign_key_checks = 0; -- Drop a film table. DROP TABLE IF EXISTS film; -- Create a film table. CREATE TABLE film ( film_id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT , film_name VARCHAR(30) NOT NULL ); -- Insert rows. INSERT INTO film (film_name) VALUES ('Thor'); INSERT INTO film (film_name) VALUES ('Thor: The Dark World'); INSERT INTO film (film_name) VALUES ('Star Trek'); INSERT INTO film (film_name) VALUES ('Star Trek into Darkness'); INSERT INTO film (film_name) VALUES ('Guardians of the Galaxy'); |
The movie.sql
file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | -- Use the sampledb database. USE sampledb; -- Disable foreign key checking. SET foreign_key_checks = 0; -- Drop an movie table. DROP TABLE IF EXISTS movie; -- Create an movie table. CREATE TABLE movie ( movie_id int unsigned PRIMARY KEY AUTO_INCREMENT , actor_id int unsigned NOT NULL , film_id int unsigned NOT NULL , CONSTRAINT actor_fk FOREIGN KEY (actor_id) REFERENCES actor (actor_id) , CONSTRAINT film_fk FOREIGN KEY (film_id) REFERENCES film(film_id)); -- Use scalar subqueries to discover surrogate keys by using the faux natural key. INSERT INTO movie ( actor_id , film_id ) VALUES ((SELECT actor_id FROM actor WHERE actor_name = 'Chris Hemsworth') ,(SELECT film_id FROM film WHERE film_name = 'Thor')); -- Use scalar subqueries to discover surrogate keys by using the faux natural key. INSERT INTO movie ( actor_id , film_id ) VALUES ((SELECT actor_id FROM actor WHERE actor_name = 'Chris Hemsworth') ,(SELECT film_id FROM film WHERE film_name = 'Thor: The Dark World')); -- Use scalar subqueries to discover surrogate keys by using the faux natural key. INSERT INTO movie ( actor_id , film_id ) VALUES ((SELECT actor_id FROM actor WHERE actor_name = 'Chris Pine') ,(SELECT film_id FROM film WHERE film_name = 'Star Trek')); -- Use scalar subqueries to discover surrogate keys by using the faux natural key. INSERT INTO movie ( actor_id , film_id ) VALUES ((SELECT actor_id FROM actor WHERE actor_name = 'Chris Pine') ,(SELECT film_id FROM film WHERE film_name = 'Star Trek into Darkness')); -- Use scalar subqueries to discover surrogate keys by using the faux natural key. INSERT INTO movie ( actor_id , film_id ) VALUES ((SELECT actor_id FROM actor WHERE actor_name = 'Chris Pratt') ,(SELECT film_id FROM film WHERE film_name = 'Guardians of the Galaxy')); |
The following list_mysql.sh
shell script expects to receive the username
, password
, database
and fully qualified path
in that specific order. The script names are entered manually because this should be a unit test script. Naturally, you can extend the script to manage those parameters but as mentioned I see this type of solution as a developer machine only script to simplify unit testing. Anything beyond that is risky!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | #!/usr/bin/bash # Assign user and password username="${1}" password="${2}" database="${3}" directory="${4}" # List the parameter values passed. echo "Username: " ${username} echo "Password: " ${password} echo "Database: " ${database} echo "Directory: " ${directory} echo "" # Define an array. declare -a cmd # Assign elements to an array. cmd[0]="actor.sql" cmd[1]="film.sql" cmd[2]="movie.sql" # Call the array elements. for i in ${cmd[*]}; do mysql -s -u${username} -p${password} -D${database} < ${directory}/${i} > /dev/null 2>/dev/null done # Connect and pipe the query result minus errors and warnings to the while loop. mysql -u${username} -p${password} -D${database} <<<'show tables' 2>/dev/null | # Read through the piped result until it's empty but format the title. while IFS='\n' read list; do if [[ ${list} = "Tables_in_sampledb" ]]; then echo $list echo "----------------------------------------" else echo $list fi done echo "" # Connect and pipe the query result minus errors and warnings to the while loop. mysql -u${username} -p${password} -D${database} <<<'SELECT CONCAT(a.actor_name," in ",f.film_name) AS "Actors in Films" FROM actor a INNER JOIN movie m ON a.actor_id = m.actor_id INNER JOIN film f ON m.film_id = f.film_id' 2>/dev/null | # Read through the piped result until it's empty but format the title. while IFS='\n' read actor_name; do if [[ ${actor_name} = "Actors in Films" ]]; then echo $actor_name echo "----------------------------------------" else echo $actor_name fi done |
The IFS
(Internal Field Separator) works with whitespace by default. The IFS
on lines 33 and 47 sets the IFS
to a line return ('\n'
). That’s the trick to display the data, and you can read more about the IFS
in this question and answer post.
You can run this script with the following input parameters from the local directory where you deploy it. The a parameters are: (1) username
, (2) password
, (3) database
, and (4) a fully qualified path to the SQL setup files.
./list_mysql.sh student student sampledb "/home/student/Code/bash/mysql" |
With valid input values, the list_mysql.sh
bash
script generates the following output, which confirms inputs and verifies actions taken by the scripts with queries:
Username: student Password: student Database: sampledb Directory: /home/student/Code/bash/mysql Tables_in_sampledb ---------------------------------------- actor film movie Actors in Films ---------------------------------------- Chris Hemsworth in Thor Chris Hemsworth in Thor: The Dark World Chris Pine in Star Trek Chris Pine in Star Trek into Darkness Chris Pine in Guardians of the Galaxy |
If you forgot to provide the required inputs to the list_mysql.sh
bash
script, it alternatively returns the following output:
Username: Password: Database: Directory: ./list_mysql.sh: line 25: /actor.sql: No such file or directory ./list_mysql.sh: line 25: /film.sql: No such file or directory ./list_mysql.sh: line 25: /movie.sql: No such file or directory |
The secure way removes the password at a minimum! The refactored program will require you to manually enter the password for all elements of the array (three in this sample), and twice for the two queries. Here’s the refactored code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/bin/bash # Assign user and password username="${1}" database="${2}" directory="${3}" # List the parameter values passed. echo "Username: " ${username} echo "Database: " ${database} echo "Directory: " ${directory} echo "" # Define an array. declare -a cmd # Assign elements to an array. cmd[0]="actor.sql" cmd[1]="film.sql" cmd[2]="movie.sql" # Call the array elements. for i in ${cmd[*]}; do mysql -s -u${username} -p -D${database} < ${directory}/${i} > /dev/null 2>/dev/null done # Connect and pipe the query result minus errors and warnings to the while loop. mysql -u${username} -p -D${database} <<<'show tables' 2>/dev/null | # Read through the piped result until it's empty. while IFS='\n' read list; do if [[ ${list} = "Tables_in_sampledb" ]]; then echo $list echo "----------------------------------------" else echo $list fi done echo "" # Connect and pipe the query result minus errors and warnings to the while loop. mysql -u${username} -p -D${database} <<<'SELECT CONCAT(a.actor_name," in ",f.film_name) AS "Actors in Films" FROM actor a INNER JOIN movie m ON a.actor_id = m.actor_id INNER JOIN film f ON m.film_id = f.film_id' 2>/dev/null | # Read through the piped result until it's empty. while IFS='\n' read actor_name; do if [[ ${actor_name} = "Actors in Films" ]]; then echo $actor_name echo "----------------------------------------" else echo $actor_name fi done |
Please let me know if you think there should be any more scaffolding for newbies in this post. As always, I hope this helps those looking for this type of solution.
Add Gedit Plugins
Fedora comes with vim
and gedit
installed but the gedit
installation is bare bones. You can update gedit
to include supplemental Plug-ins with the following yum
command as the root
user:
yum install -y gedit-plugins |
It generates the following log file:
Loaded plugins: langpacks, refresh-packagekit mysql-connectors-community | 2.5 kB 00:00 mysql-tools-community | 2.5 kB 00:00 mysql56-community | 2.5 kB 00:00 pgdg93 | 3.6 kB 00:00 updates/20/x86_64/metalink | 14 kB 00:00 updates | 4.9 kB 00:00 (1/2): pgdg93/20/x86_64/primary_db | 86 kB 00:00 (2/2): updates/20/x86_64/primary_db | 11 MB 00:03 (1/2): updates/20/x86_64/pkgtags | 1.5 MB 00:00 (2/2): updates/20/x86_64/updateinfo | 2.0 MB 00:01 Resolving Dependencies --> Running transaction check ---> Package gedit-plugins.x86_64 0:3.10.1-1.fc20 will be installed --> Processing Dependency: libgit2-glib for package: gedit-plugins-3.10.1-1.fc20.x86_64 --> Running transaction check ---> Package libgit2-glib.x86_64 0:0.0.6-2.fc20 will be installed --> Processing Dependency: libgit2.so.0()(64bit) for package: libgit2-glib-0.0.6-2.fc20.x86_64 --> Running transaction check ---> Package libgit2.x86_64 0:0.19.0-2.fc20 will be installed --> Processing Dependency: libxdiff.so.1()(64bit) for package: libgit2-0.19.0-2.fc20.x86_64 --> Processing Dependency: libhttp_parser.so.2()(64bit) for package: libgit2-0.19.0-2.fc20.x86_64 --> Running transaction check ---> Package http-parser.x86_64 0:2.0-5.20121128gitcd01361.fc20 will be installed ---> Package libxdiff.x86_64 0:1.0-3.fc20 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: gedit-plugins x86_64 3.10.1-1.fc20 updates 830 k Installing for dependencies: http-parser x86_64 2.0-5.20121128gitcd01361.fc20 fedora 23 k libgit2 x86_64 0.19.0-2.fc20 fedora 281 k libgit2-glib x86_64 0.0.6-2.fc20 fedora 82 k libxdiff x86_64 1.0-3.fc20 fedora 33 k Transaction Summary ================================================================================ Install 1 Package (+4 Dependent packages) Total download size: 1.2 M Installed size: 5.2 M Downloading packages: (1/5): http-parser-2.0-5.20121128gitcd01361.fc20.x86_64.rpm | 23 kB 00:00 (2/5): libgit2-0.19.0-2.fc20.x86_64.rpm | 281 kB 00:00 (3/5): libgit2-glib-0.0.6-2.fc20.x86_64.rpm | 82 kB 00:00 (4/5): libxdiff-1.0-3.fc20.x86_64.rpm | 33 kB 00:00 (5/5): gedit-plugins-3.10.1-1.fc20.x86_64.rpm | 830 kB 00:01 -------------------------------------------------------------------------------- Total 899 kB/s | 1.2 MB 00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction (shutdown inhibited) Installing : libxdiff-1.0-3.fc20.x86_64 1/5 Installing : http-parser-2.0-5.20121128gitcd01361.fc20.x86_64 2/5 Installing : libgit2-0.19.0-2.fc20.x86_64 3/5 Installing : libgit2-glib-0.0.6-2.fc20.x86_64 4/5 Installing : gedit-plugins-3.10.1-1.fc20.x86_64 5/5 Verifying : libgit2-0.19.0-2.fc20.x86_64 1/5 Verifying : libgit2-glib-0.0.6-2.fc20.x86_64 2/5 Verifying : gedit-plugins-3.10.1-1.fc20.x86_64 3/5 Verifying : http-parser-2.0-5.20121128gitcd01361.fc20.x86_64 4/5 Verifying : libxdiff-1.0-3.fc20.x86_64 5/5 Installed: gedit-plugins.x86_64 0:3.10.1-1.fc20 Dependency Installed: http-parser.x86_64 0:2.0-5.20121128gitcd01361.fc20 libgit2.x86_64 0:0.19.0-2.fc20 libgit2-glib.x86_64 0:0.0.6-2.fc20 libxdiff.x86_64 0:1.0-3.fc20 Complete! |
When you launch the gedit
utility, you click on the
Gedit Plug-in Installation
- After you install the Gedit Plug-ins, you can configure the plug-ins by launching Gedit and then click on the
gedit
menu option. Then, click on the Preferences menu option to enable the new plugins, like the Embedded Terminal plug-in.
- You have four tab options when working with the Preferences menu. The first tab is the View tab, as shown to the left.
- The second tab is the Editor tab, as shown to the left.
- The third tab is the Font & Colors tab, as shown to the left.
- The fourth tab is the Plugins tab, as shown to the left. Scroll down the list and check the Embedded Terminal and Python Console plug-ins’ checkbox. The Embedded Terminal lets you edit a file and have command line access to a Terminal session from the
gedit
menu; and the Python Console session from thegedit
menu.
- Click on the View menu, and then choose the Bottom Panel menu option.
- After enabling the Bottom Panel in the Gedit menu, you can edit a file and click on the Terminal by simply clicking on the subpanel. You can see the split image on the left. There’s also a set of bottom tabs that lets you switch from a Linux Terminal session to the Python console.
As always, I hope this helps those working with gedit
on the Fedora operating system.