Oracle Kill Inactive Session

1.Command to Kill Inactive Session SELECT * FROM v$session WHERE status =’INACTIVE’;   select ‘alter system kill session ”’ ||sid|| ‘,’ ||serial#|| ”’ immediate;’ as insess from v$session where status=’INACTIVE’; commit;   select ‘alter system kill session ”’ ||sid|| ‘,’ ||serial#|| ”’ immediate;’ from v$session… Read More

Oracle Export and Import Command

Please use the Account that have Oracle permission   1. Export exp fel/fel@FEL FULL=Y FILE= FullExport.dmp OR expdp fel/fel directory=data_pump_dir dumpfile=export.dmp nologfile=y tables=fel.mytable OR expdp fel/fel@FEL directory=data_pump_dir dumpfile=export.dmp nologfile=y schemas=fel   2. Inport imp fel/fel@FEL FULL=Y FILE=FullExport.dmp OR impdp fel/fel@fel directory=data_pump_dir dumpfile=FullExport.dmp logfile=imp.log table_exists_action=replace OR… Read More

Oracle Listener Configuration

I. Oracle Listener Configuration File Location in Linux 1. $OracleHome/network/admin OR 2. /opt/oracle/network/admin   II. Files to Configure 1. listener.ora LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = myora.prestobear.com)(PORT = 1521))… Read More

Oracle Create a User

set verify off; drop user “FEL” cascade;   — Create tablespace FEL if not exist CREATE USER FEL IDENTIFIED BY FEL default tablespace FEL temporary tablespace TEMP QUOTA UNLIMITED ON FEL;   — Grant the whole DB to user FEL GRANT DBA TO “FEL”;  … Read More

Oracle Create a Role and Grant to User

— Create a role name CREATE ROLE role111;   — Assign permissions to a role GRANT CREATE session, CREATE table, CREATE view, CREATE procedure, CREATE synonym, ALTER table, ALTER view, ALTER procedure,ALTER synonym, DROP table, DROP view, DROP procedure, DROP synonym, TO role111;   —… Read More