Login to XE-MySQL Syntax

Login:
——
mysql -uroot -proot

# /etc/init.d/mysqld start
# /etc/init.d/mysqld stop
# /etc/init.d/mysqld restart
# mysqladmin -u root -p status
# datadir=/var/lib/mysql

mysql> show variables like ‘%datadir%;
In MySQL Space Issue: (1) Delete /var/log/mysqld.log files

———————————————————————————————————————–

Login:
——

$ sqlplus sys/oracle as sysdba

$ orapwd file =orapwXE PASSWORD=ORACLE force=y entries=3

In Oracle 11g Default path for Alter log files is:

For Issues:
———–

SQL> show parameter background_dump_dest

Ex: /u01/app/oracle/diag/rdbms/db01/db001/trace/alert_db001.log

In Oracle : (1) Delete alert log files
(2) Drop unwanted user by taking the backup using expdump and keep the backup on same server
(3) For Archive log issue, delete files from archive logs / # df -kh
SQL> archive log list;
(4) SQL DEVELOPER Connectivity issue listener
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

sqlplus system/system-password@XE

sqlplus system/system-password

sqlplus / as sysdba
Solution:

sqlplus /nolog
conn system/password
connected.
alter system register;
exit
lsnrctl stat

Now you can see the service
Even if don’t see try this one out
$ sqlplus /nolog
SQL> conn system/password
connected.
SQL> alter system set local_listener = ‘(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))’ scope = both;
… system altered …
sql> alter system register;
SQL> exit
$ lsnrctl stat (IT SHOULD SHOW SERVICE REGISTERED NOW )

This should probably work …

Advertisements

Installing Oracle Database 11g XE on Fedora 17/18

[Oracle 11g Logo]

The following are the steps to install a Oracle 11g in fedora.
Step1:  Downloading the Software
Download the oracle-xe-11.2.0-1.0.x86_64.rpm.zip file from follwing url
Step2: Extracting the content
Extract the zip into any location. Here i am extracting the above zip into following location.

[ranga@ranga Disk1]$ pwd

/home/ranga/install/Disk1
[ranga@ranga Disk1]$ ls
oracle-xe-11.2.0-1.0.x86_64.rpm  response  upgrade
[ranga@ranga Disk1]$
Step3: Install libaio

[root@ranga Disk1]#  yum install libaio
Step4: Installing the oracle by using rpm command.
 
[root@ranga Disk1]# rpm -i oracle-xe-11.2.0-1.0.x86_64.rpm
Preparing… ########################################### [100%] 1:oracle-xe ########################################### [100%] Executing post-install steps… You must run ‘/etc/init.d/oracle-xe configure’ as the root user to configure the database.
Your installation done but u need configure
Step5: Configuring the database
[root@ranga Disk1]# /etc/init.d/oracle-xe configure
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]: 9090 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]:y Starting Oracle Net Listener…Done Configuring database…Done Starting Oracle Database 11g Express Edition instance…Done Installation completed successfully.
In the above configuration, i am given port number is 9090 by default 8080 and database listener is same and you need to enter SYS or SYSTEM password. If you want while booting it self starting the database your giving ‘y’ in boot option. Finaly your database configured successfully. This installation created under /u01 directory.
Starting the Database manually : 
To start the database manually, run this command as root user:
# /etc/init.d/oracle-xe start
or
# /usr/lib/oracle/xe/app/oracle/product/11.2.0/server/bin/lsnrctl start
Stopping the Database manually:
To stop the database manually, run the following command as root user:

# /etc/init.d/oracle-xe stop

Un Install the Oracle 11g: 

Step1: First you need to check which oracle version is installed.
[ranga@ranga ~]$ rpm -qa | grep oracle
oracle-xe-11.2.0-1.0.x86_64
Step2: Uninstall the oracle by using rpm -e with which version it is installed.
[ranga@ranga ~]$ rpm -e 

oracle-xe-11.2.0-1.0.x86_64

Installing Oracle Database 11g XE on Oracle Enterprise Linux (64-bit)

Before we begin installing Oracle Database XE in Linux, we need to prepare
the environment by installing the required packages, setting kernel parameters,
and so on.
———–Installing and Uninstalling Oracle Database XE————-

To begin, make sure that the following Linux packages are installed. To verify that the
following Linux packages are installed use the rpm –qa <package name> command:
• kernel-headers-2.6.18-194.el5.x86_64.rpm
• glibc-2.5-49.x86_64.rpm
• make-3.81-3.el5.x86_64.rpm
• binutils-2.17.50.0.6-14.el5.x86_64.rpm
• glibc-devel-2.5-49.x86_64.rpm
• glibc-headers-2.5-49.x86_64.rpm
• libgomp-4.4.0-6.el5.x86_64.rpm
• gcc-4.1.2-48.el5.x86_64.rpm
• libaio-0.3.106-5.x86_64.rpm
The parameters that need to be included in the sysctl.conf file under /etc are as
follows. These changes are to be made by logging in as the root user:
kernel.semmsl=250
kernel.semmns=32000
kernel.semopm=100
kernel.semmni=128
kernel.shmmax=4294967295
kernel.shmmni=4096
kernel.shmall=2097152
kernel.sem= 250 32000 100 128
fs.file-max= 6815744
net.ipv4.ip_local_port_range=9000 65500
We are now ready to start the Oracle Database XE installation. However, it is
recommended to complete the following steps for creating a Linux user oracle:
1. Create new groups and the oracle user as shown in the following code
snippet, by logging in as the root user:
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba,oper,asmadmin oracle
passwd oracle
2. Log in as the oracle user and add the following lines at the end of the
.bash_profile file:
# Oracle instance name
ORACLE_SID=XE; export ORACLE_SID;
# Oracle home directory
ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe; export ORACLE_HOME;
# Search path for executable

PATH=$ORACLE_HOME/bin:$PATH; export PATH;
# Search path for shared libraries
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH; export LD_
LIBRARY_PATH
3. Copy the downloaded software to a temporary folder, say /u01/software,
and run the following command as the root user to install Oracle Database
XE, as shown in the following screenshot:
4. Run /etc/init.d/oracle-xe configure as the root user to configure
the database. You will be prompted to select the HTTP port for Oracle
Application Express, database listener port, SYS and SYSTEM user
password, and the boot option. It is recommended to accept the default
values and continue with the configuration of the database as shown in the
following screenshot:
Installing and Uninstalling Oracle Database XE

To access the database’s home page go to Applications menu | Oracle Database 11g
Express Edition | Get Started.
Starting and stopping Oracle Database XE in
Linux
After you have installed Oracle Database XE, the database is up and running and
you can begin using it right away.

Alternatively, we can start the database manually by running the following
command as the root user:
# /etc/init.d/oracle-xe start
To manually stop the database, run the following command as the root user:
# /etc/init.d/oracle-xe stop
——Uninstalling Oracle Database 11g XE on Oracle Enterprise Linux (64-bit)——
When you uninstall Oracle Database XE, all components, including datafiles, control
files, redo logfiles, and software are removed.
Log on with the root privilege and run the command shown in the following

root@xe1 software]# rpm -e oracle-xe

Installing Oracle Database 11g XE on Fedora 17/18

[Oracle 11g Logo]
The following are the steps to install a Oracle 11g in fedora.
Step1:  Downloading the Software
Download the oracle-xe-11.2.0-1.0.x86_64.rpm.zip file from follwing url
Step2: Extracting the content
Extract the zip into any location. Here i am extracting the above zip into following location.
[ranga@ranga Disk1]$ pwd
/home/ranga/install/Disk1
[ranga@ranga Disk1]$ ls
oracle-xe-11.2.0-1.0.x86_64.rpm  response  upgrade
[ranga@ranga Disk1]$
Step3: Install libaio
[root@ranga Disk1]#  yum install libaio
Step4: Installing the oracle by using rpm command.
 
[root@ranga Disk1]# rpm -i oracle-xe-11.2.0-1.0.x86_64.rpm
Preparing… ########################################### [100%] 1:oracle-xe ########################################### [100%] Executing post-install steps… You must run ‘/etc/init.d/oracle-xe configure’ as the root user to configure the database.
Your installation done but u need configure
Step5: Configuring the database
[root@ranga Disk1]# /etc/init.d/oracle-xe configure
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]: 9090 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]:y Starting Oracle Net Listener…Done Configuring database…Done Starting Oracle Database 11g Express Edition instance…Done Installation completed successfully.
In the above configuration, i am given port number is 9090 by default 8080 and database listener is same and you need to enter SYS or SYSTEM password. If you want while booting it self starting the database your giving ‘y’ in boot option. Finaly your database configured successfully. This installation created under /u01 directory.
Starting the Database manually : 
To start the database manually, run this command as root user:
# /etc/init.d/oracle-xe start
or
# /usr/lib/oracle/xe/app/oracle/product/11.2.0/server/bin/lsnrctl start
Stopping the Database manually:
To stop the database manually, run the following command as root user:

# /etc/init.d/oracle-xe stop

Un Install the Oracle 11g: 

Step1: First you need to check which oracle version is installed.
[ranga@ranga ~]$ rpm -qa | grep oracle
oracle-xe-11.2.0-1.0.x86_64
Step2:Uninstall the oracle by using rpm -e with which version it is installed.

[ranga@ranga ~]$ rpm -e oracle-xe-11.2.0-1.0.x86_64

Fedora Install of Oracle 11g

  1. 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.
  1. 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
  1. After creating the directory, click the Extract button.
  1. The extract process completes and shows the following dialog.
  1. The Disk1 directory will show the following contents.
  1. 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.
  1. 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.

  1. This step requires that you exit the root shell by typing the exit command. This should put you back into your administration account with sudoer privileges. You use vi to edit and add the following to the .bashrc file.
You actually have two options here. You can use Oracle’s provided environment file or write your own. According to the Actually, according to the Oracle® Database Express Edition Installation Guide 11g Release 2 (11.2) for Linux x86-64 you can do it in one line.

. /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
  1. This step is optional. You can configure an oracleenv.sh file in the oracle user’s home directory. While you could put this in the .bashrc file, the oracle 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

How-to Install Oracle 11g R2 Express Database on CentOS 7 64bit GNU/Linux Easy Guide

The Linux Tutorial Show Step-by-Step How-to Install and Getting-Started with Oracle 11g R2 Express Edition Database on CentOS 7 x8664 Workstation/Server Linux+GNU.

Oracle Database Express Edition is a free, smaller-footprint edition of Oracle Database. Oracle Database XE is easy to install and easy to manage.

With Oracle Database XE and related tools you can:

  • Administer the database
  • Create tables, views, and other database objects
  • Import, export, and view table data
  • Run queries and SQL scripts
  1. Open a Command Line Terminal Window
    (Press “Enter” to Execute Commands)

    Oracle 11g Express Database Installation for CentOS 7 - Open Terminal

    Or Login into the Server Shell.

  2. Download Oracle 11g R2 Express Database Linux:
    Get Oracle 11g Express DB rpm.zip 64bit
  3. Double-Click on Archive and Extract into /tmp/
    Or from Shell:

    unzip -d /tmp/ ~/Downloads/oracle-xe-11*.zip
    How-to Install Oracle 11g R2 Express Database for CentOS 7 - Extraction
  4. Oracle 11g Express Database Installation
    cd /tmp/Disk1
    su -c "rpm -ivh oracle-xe-11*.rpm"
  5. Post-Installation SetUp
    su -c "/etc/init.d/oracle-xe configure"

    Eventually Accept the 8080 and 1521 Default Ports…
    Then Set and Take Note of Password for SYS and SYSTEM Admin Accounts
    Finally the Installation should be Successfull! 🙂
    CentOS 7 Oracle 11g Express Database Installation - Post Installation Setup

  6. To Start & Stop Oracle 11g Express DB Manually
    sudo/etc/init.d/oracle-xestart
    sudo /etc/init.d/oracle-xe stop
  7. Environment Vars SetUp
    sudo /u01/app/oracle/product/11.2.0/xe/bin/sqlplus

    If Got “User is Not in Sudoers file” then Look: Solution
    Test:

    which sqlplus
  8. Set the ‘oracle’ User Pass
    sudo passwd oracle
  9. Login as ‘oracle’ User
    su oracle
  10. Launch SQL-Plus
    sqlplus /nolog
  11. Connect to Database as SYSTEM Admin
    CONNECT SYSTEM/[yourSYSTEMadminPASS]

    Example:

    CONNECT SYSTEM/eureka

    Then You should be Successfully Connected Locally to the Database! 🙂

  12.