Archive for the ‘Fedora’ Category
Set up Gnome for Oracle
Back in September, I showed how to setup Oracle Database 11g XE on Fedora. It was straightforward more or less, but tonight I ran into a problem while working with the Oracle Stop Database menu option. When I selected it form the menu, I got the user must be in the DBA OS group to stop the database.
Since the database started automatically on boot and shutdown when closing the operating system, I missed this nuance in the setup. The screen shot for the error is:
Oracle Database 11g XE automatically creates an oracle
user with a dba
group. While the mclaughlinm
user was in the wheel
group and an authorized sudoer, the mclaughlinm
user needed to also be in the dba
group. That’s more tricky in Fedora 15 and 16 because they’ve removed the System menu and the options that let you install and modify users.
Here are the steps to add your user to the dba
group. Open a terminal session, and launch the User Manager application with the following command:
system-config-users |
You have to enter the root
password to get this to work. Then, it launches the User Manager application. Click on the target user, and click the Properties button.
The User Manager application launches the User Properties dialog. Click on the Groups tab.
Scroll in the groups list to the dba
group. Click the checkbox for the dba
group and the OK button.
Now, you’ll be able to navigate to through the menu to Stop Database to shutdown and Start Database to restart the Oracle database.
Hope this helps a few folks.
Gnome Menu Editing Fix
Fedora 16 is clearly better than Fedora 15 but I found Menu Editing (Alacarte package) was broken in it because of a missing library dependency, and I’ve updated Fedora Bug 734442 with the work around. Here’s what’s wrong and how to fix it.
Update on Status of Bug 734442
Download Site Change
After installing the Menu Editing (Alacarte) package, you’ll encounter this error when trying to launch the menu editor:
MainWindow.py:19:<module>:Import Error: No module named gmenu |
That error occurs because the gnome-menus-3.2.0.1-1.fc16.x86_64
is missing the /usr/lib64/python2.7/site-packages/gmenu.so
library. So, I copied the version of gmenu.so
from a Fedora 15 release as the root
user. Naturally, at this point you’d test if it was fixed, I did. It wasn’t, and I got a new error:
MainWindow.py:19:<module>:Import Error: libgnome-menu.so.2: cannot open shared object file: No such file or directory |
That error occurs because the gnome-menus-3.2.0.1-1.fc16.x86_64
is missing the /usr/lib64/libgnome-menu.so.2
symbolic link to the /usr/lib64/libgnome-menu.so.2.4.13
library. While the package meets the dependency check, the libraries fail the run time validation.
If digging in like this is all new to you, I’d recommend UNIX and Linux System Administration Handbook (4th Edition) (University of Colorado at Bolder folks) for the Linux stuff and The Quick Python Book, Second Edition for Python basics.
You can get a copy of the Fedora 15 package with the following command, which you should connect as the root
user in navigate to the /tmp
directory. Then, create a copy
directory and change the /tmp/copy
directory before running either of the next two commands.
Use this for 32-bit Installs
# wget http://archive.fedoraproject.org/pub/fedora/linux/releases/15/Fedora/i386/os/Packages/gnome-menus-3.0.1-1.fc15.i686.rpm |
Use this for 64-bit Installs
# wget http://archive.fedoraproject.org/pub/fedora/linux/releases/15/Fedora/x86_64/os/Packages/gnome-menus-3.0.1-1.fc15.x86_64.rpm |
That command only a copy of the RPM file, but the following converts it into an exploded directory. Assuming you created a copy
directory in the /tmp
directory, execute the following command from within the /tmp/copy
directory. It will create a directory tree with the required files. After you copy the files, you can remove (rm
) the copy
directory from the /tmp
directory.
Use this for 32-bit Installs
# rpm2cpio http://archive.fedoraproject.org/pub/fedora/linux/releases/15/Fedora/i386/os/Packages/gnome-menus-3.0.1-1.fc15.i686.rpm | cpio -ivd |
Use this for 64-bit Installs
# rpm2cpio http://archive.fedoraproject.org/pub/fedora/linux/releases/15/Fedora/x86_64/os/Packages/gnome-menus-3.0.1-1.fc15.x86_64.rpm | cpio -ivd |
You can now copy the files with these files. The target location differs between the 32-bit and 64-bit versions of the operating system.
Use this for 32-bit Installs
# cp /tmp/copy/usr/lib/libgnome-menu.so.2* /usr/lib # cp /tmp/copy/usr/lib/python2.7/site-packages/gmenu.so /usr/lib/python2.7/site-packages |
Alternatively, you can copy the following two files from any valid 32-bit Fedora 15 instance into a Fedora 16 instance, and manually create the symbolic link.
# /usr/lib/libgnome-menu.so.2.4.13 # /usr/lib/python2.7/site-packages/gmenu.so |
Use this for 64-bit Installs
# cp /tmp/copy/usr/lib64/libgnome-menu.so.2* /usr/lib64 # cp /tmp/copy/usr/lib64/python2.7/site-packages/gmenu.so /usr/lib64/python2.7/site-packages |
Alternatively, you can copy the following two files from any valid Fedora 64-bit 15 instance into a Fedora 16 instance, and manually create the symbolic link.
/usr/lib64/libgnome-menu.so.2.4.13 /usr/lib64/python2.7/site-packages/gmenu.so |
After you copy the two files into the right directories as root
, you can create the necessary symbolic link with the following command (this isn’t necessary with the wildcard instruction provided earlier in the post). You need to ensure that you’re in the /usr/lib
directory when you run the ln
command, as noted by Gavin’s comment:
Use this for 32-bit Installs
# ln -s /usr/lib/libgnome-menu.so.2.4.13 libgnome-menu.so.2 |
Use this for 64-bit Installs
# ln -s /usr/lib64/libgnome-menu.so.2.4.13 libgnome-menu.so.2 |
As mentioned by Darr247, don’t forget to remove the /tmp/copy
directory when you’re done making the changes.
Somebody asked me to add the Red Hat Package Manager (RPM) commands that let me find these dependencies. That seemed like a good idea, here they are:
rpm -qa search_string
grep
to filter the list.rpm -qf file_name
rpm -q package_name
rpm -qi package_name
rpm -qR package_name
rpm -ql package_name
rpm -qd package_name
rpm -qc package_name
If you want to set a menu item up manually, check this blog post. You also have the LXMenuEditor that’s available in beta as an alternative. Hope this helps those in need, as always.
Fedora Install of Oracle 11g
After the installation of Oracle 11g XE on Windows, I anticipated problems installing on Fedora. It’s terrific to report it was by far simpler to install on Fedora. This post provides the steps, and builds on the Fedora configuration published earlier this week.
- After you download the software from the Oracle web site, you’ll need to expand the compressed file. When you double click on the download item you will see the following screen. Click Extract at the top of the display.
- The Extract displays the following dialog. Click the Create Folder button and you’ll get an entry point for a new directory in your user’s directory. For the example, Oracle11gXE
- After creating the directory, click the Extract button.
- The extract process completes and shows the following dialog.
- The Disk1 directory will show the following contents.
- You need to drop down into a Terminal session, which you can launch by clicking on Applications, System Tools, and Terminal in the menu.
sudo rpm -iv oracle-xe-11.2.0-1.0.x86_64.rpm |
This command will install the packages in verbose syntax and display the following messages:
[sudo] password for mclaughlinm: Preparing packages for installation... oracle-xe-11.2.0-1.0 Executing post-install steps... You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database. |
- This step requires that you assume the role of the
root
user, which can be done with this syntax:
sudo sh |
In this root
shell, you run the Oracle 11g XE configuration with this command:
/etc/init.d/oracle-xe configure |
The following are the text prompts that you accept to configure Oracle 11g XE:
Oracle Database 11g Express Edition Configuration ------------------------------------------------- This will configure on-boot properties of Oracle Database 11g Express Edition. The following questions will determine whether the database should be starting upon system boot, the ports it will use, and the passwords that will be used for database accounts. Press <Enter> to accept the defaults. Ctrl-C will abort. Specify the HTTP port that will be used for Oracle Application Express [8080]: Specify a port that will be used for the database listener [1521]: Specify a password to be used for database accounts. Note that the same password will be used for SYS and SYSTEM. Oracle recommends the use of different passwords for each database account. This can be done after initial configuration: Confirm the password: Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]: Starting Oracle Net Listener...Done Configuring database... Starting Oracle Database 11g Express Edition instance...Done Installation completed successfully. |
After completing the configuration, you need to do two things. First, you need to modify the .bash_profile
file for your user (covered in the next step). Second, you need to reboot your system.
- This step requires that you exit the
root
shell by typing theexit
command. This should put you back into your administration account with sudoer privileges. You usevi
to edit and add the following to the.bashrc
file.
. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh |
Or, you can write your own file, like this:
# Oracle Settings TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR ORACLE_HOSTNAME=localhost.localdomain; export ORACLE_HOSTNAME ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe; export ORACLE_HOME ORACLE_SID=XE; export ORACLE_SID NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`; export NLS_LANG ORACLE_TERM=xterm; export ORACLE_TERM PATH=/usr/sbin:$PATH; export PATH PATH=$ORACLE_HOME/bin:$PATH; export PATH LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi |
You can now log in to the Oracle database with the following syntax from the command line. You’ll be prompted for the system
password that you entered during the configuration steps. I’ll add another post on SQL Developer later this week.
sqlplus system |
- This step is optional. You can configure an
oracleenv.sh
file in theoracle
user’s home directory. While you could put this in the.bashrc
file, theoracle
account isn’t bootable. That’s why I recommend putting it in an environment file.
# .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # Uncomment the following line if you don't like systemctl's auto-paging feature: # export SYSTEMD_PAGER= # User specific aliases and functions . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh # Wrap sqlplus with rlwrap to edit prior lines with the # up, down, left and right keys. sqlplus() { if [ "$RLWRAP" = "0" ]; then sqlplus "$@" else rlwrap sqlplus "$@" fi } # Set vi as a command line editor. set -o vi |
If you want to use the menu choices added by the installation, you need to put your privileged sudoer
in the dba
group. I wrote a blog post on it here.
Configure Fedora on VMWare
It seems Fedora is always a bit of work. You begin by mistakenly downloading Fedora Live, which isn’t really the product but a run-time demonstration product. After finding the product, if you choose a full installation, there are post installation steps to complete. The first time you launch it in VMWare, you’ll see a Gnome 3 Failed to Load error dialog like this:
I suspected that installing VMWare Tools would fix that, and it did. However, your entry account doesn’t have “sudoers” permissions. You must add them before you can run VMWare Tools. There are six steps to enable your user with the sudoers permissions and four others to configure the standard installation:
- Navigate to the Applications menu choice in the upper left hand corner. You’ll get the following drop-down menu. Click on Other menu item to launch a dependent floating menu.
- The following floating menu displays to the right. Click on Users and Groups menu item at the bottom of the list.
- The choice from the floating menu prompts account validation. Enter your password and click the OK button.
- After validating your password, the User Manager dialog opens. Click on the single user that should be installed –
mclaughlinm
. Click the Properties button to change the groups assigned to the user.
- The User Properties dialog opens with the default User Data tab clicked. Click on the Groups tab to add the user to the
wheel
group as a property of your user.
- Scroll down through the list of groups and click the
wheel
group check box. Like the Mac OS, the wheel group provides “sudoer” privileges. Click the OK button to assign the group to the user.
- Navigate to the VMWare Menu, choose Virtual Machine and in the drop down menu Install VMWare Tools. This will mount a virtual CD in the Fedora virtual machine.
- Navigate to the Places menu choice and then Computer. Inside the Computer, choose the VMware Tools from the Devices section and you’ll see the following:
- Open a terminal session by choosing Applications, within the drop down choose System Tools, and then launch a Terminal session. You can then run the VMWare Toolkit by following these instructions:
cd /media/VMware\ Tools cp VMwareTools-8.4.7-416484.tar.gz /tmp cd /tmp gunzip VMwareTools-8.4.7-416484.tar.gz tar -xvf VMwareTools-8.4.7-416484.tar cd vmware-tools-distrib sudo ./vmware-install.pl |
The last step requires that you reply to a set of prompts. If you’d like to accept the default at one time, you can use the following command:
sudo ./vmware-install.pl --default |
If you find limited access to the system after installing or upgrading VMWare Tools, you may have packages in the caught between start and finish. You can clean them up with the following syntax, as the root
user:
sudo yum-complete-transaction |
- In the terminal session you should configure three files to make sure your networking works. I found that the dialogs failed to set one key element, so it’s simply easier to do this manually. Rather than using
sudo
, you should open aroot
shell with the following command:
sudo sh |
Enter your user’s password:
[sudo] password for mclaughlinm: |
You should use vi
to edit and save the resolv.conf
file with appropriate domain, search, and nameserver values. The values below work for VMWare when the gateway IP address is 172.16.123.2
.
# Generated by NetworkManager
domain localdomain
search localdomain
nameserver 172.16.123.2 |
Using vi
, edit the /etc/sysconfig/network
file to include an appropriate gateway IP address, like so:
NETWORKING=yes HOSTNAME=localhost.localdomain GATEWAY=172.16.123.2 |
The last file to fix is /etc/sysconfig/network-scripts/ifcfg-eth0
file. This is the file that isn’t completely configured by the GUI component (it fails set the ONBOOT
value to yes
).
DEVICE=eth0 HWADDR=00:0c:29:31:ef:46 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=dhcp TYPE=Ethernet DNS1=172.16.123.2 USERCTL=no PEERDNS=yes IPV6INIT=no |
You reset networking with the following command:
/etc/rc.d/init.d/network restart |
As always, I hope this helps a few folks.