Oracle · oracle · Uncategorized

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s