Saturday, 20 April 2013

Setting Enviroment Variables on Linux platform for Oracle

Setting Enviroment Variables on Linux platform

For Bourne,Korn or Bash shell

>source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

For C shell:
>source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.csh

 not path for 11g2

>source /usr/lib/oracle/xe/app/oracle/product/11.2.0/server/bin/oracle_env.sh



For Remote login

SQL>EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);

[sajib@fws ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 05-OCT-2013 22:33:15

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                05-OCT-2013 22:01:03
Uptime                    0 days 0 hr. 32 min. 12 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/fws/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=::1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully



[sajib@fws ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Sat Oct 5 22:34:37 2013

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> select status from v$instance;

STATUS
------------
OPEN

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

Check HTTP Port:


SQL>SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

-- If the above returns 0 then run this

Set HTTP Port:

EXEC DBMS_XDB.SETHTTPPORT(8080);

 SQL>SELECT LOG_MODE FROM SYS.V$DATABASE;

 ARCHIVELOG  or  NO ARCHIVELOG

SQL> select dbms_xdb.gethttpport from dual;

GETHTTPPORT
-----------
       8080


SQL> show parameter DB_RECOVERY_FILE_DEST;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest             string     /u01/app/oracle/fast_recovery_
                         area
db_recovery_file_dest_size         big integer 10G


SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 50G;

System altered.

SQL> show parameter DB_RECOVERY_FILE_DEST;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest             string     /u01/app/oracle/fast_recovery_
                         area
db_recovery_file_dest_size         big integer 50G



SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;

LOG_MODE
------------
NOARCHIVELOG

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  622149632 bytes
Fixed Size            2229048 bytes
Variable Size          394267848 bytes
Database Buffers      222298112 bytes
Redo Buffers            3354624 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;

LOG_MODE
------------
ARCHIVELOG

[root@fws Desktop]# lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 08-OCT-2013 02:57:19

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                08-OCT-2013 02:36:40
Uptime                    0 days 0 hr. 20 min. 41 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/fws/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=fws.colbd.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=fws.colbd.com)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XE" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
The command completed successfully
[root@fws Desktop]#



 expdp system schemas=sajib directory=dmpdir dumpfile=sajib.dmp logfile=expsajib.log

expdp system/051502718 schemas=sajib directory=dmpdir dumpfile=expsajib.dmp logfile=expsajib.log

EXPORT COMMAND
for Full Data Mode:
exp full=y file=dba.dmp grants=y rows=y
exp full=y file=dba.dmp log=dba.log

for User Mode:
exp sajib/sajib file=sajib.dmp owner=sajib grants=y rows=y compress=y log=sajib.log

IMPORT COMMAND

imp full=y ignore=y file=expdat.dmp

No comments:

Post a Comment