Oracle Sql

USING SQL PLUS or Any Oracle Tool Like “SQL Developer or TOAD”
==============================================================
create user supplier2 identified by supplier2
grant connect,resource,dba to supplier2

unlock
======
alter user joe account unlock;
alter user awb account unlock identified by awb;

change password
===============
alter user awb identified by awb;

To use import tool go to the following path in cmd:
===================================================
1. C:\Oracle\app\Administrator\product\11.2.0\dbhome_1\BIN
Then run the following command with different parameter:
========================================================

imp supplier2/supplier2 file = c:\SUPPLIER2.DMP full = yes
expired users return
select username,account_status,expiry_date from dba_users;

select password from sys.user$ where name=’MDSYS’;

alter user MDSYS identified by values ‘72979A94BAD2AF80’;

alter user joe account unlock;
Import & Export Dumps
================
exp emaar/emaar file = c:\emaar.dmp

Full database all users
=======================
exp target/target file = c:\target_Aust.dmp

exp target/target file = c:\target_Aust.dmp owner=target

from user to another user
==========================
imp emaar/emaar file = c:\emaar.dmp fromuser=emaar touser=emaar ignore=y

imp emaar/emaar@trngdb fromuser=emaar touser=emaar file=c:\emaar.dmp ignore=y

To Import Data Pump it is more faster and flexible than imp/exp
================================================================
http://www.oracle-base.com/articles/10g/oracle-data-pump-10g.php
CONN / AS SYSDBA
ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;

CREATE OR REPLACE DIRECTORY test_dir AS ‘/u01/app/oracle/oradata/’;
GRANT READ, WRITE ON DIRECTORY test_dir TO scott;
expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log

impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log

How to Fix ORA-12162 TNS:net service name is incorrectly specified Error in Oracle?

sometimes  the oracle profile is not prepared correctly and this give so many errors and you should go direct to directory of SqlPlus to start DB

/u01/app/oracle/product/11.2.0/dbhome_1/bin

./sqlplus sys/password as sysdba;

the following error will arises

ORA-12162 TNS:net service name is incorrectly specified

Cause

This arises if you have not set ORACLE_HOME and ORACLE_SID.

Solution

you can fix it by setting the ORACLE_HOME and ORACLE_SID as following

> export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
> export ORACLE_SID=ECMTEST

and try to start the DB 

./sqlplus sys/password as sysdba;
sql> startup force;