Search This Blog

Total Pageviews

Monday 11 April 2016

Oracle Create scott schema ....

Oracle Create scott schema ....


create oracle scott user 


sqlplus  / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Apr 10 17:49:19 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options


SQL> @?/rdbms/admin/utlsampl.sql    -----!!!!!!!!!!!!!!!  run this script to create scott schema 
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options


[oracle@ora12c ~]$ !sql
sqlplus  / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Apr 10 17:49:51 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options


SQL> SELECT username, account_status FROM dba_users WHERE username = 'SCOTT';

USERNAME                       ACCOUNT_STATUS
------------------------------ --------------------------------
SCOTT                          OPEN




SQL> connect scott/tiger
Connected.

SQL> select * from tab ;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
BONUS                          TABLE
DEPT                           TABLE
EMP                            TABLE
SALGRADE                       TABLE


====

with insert command 



 create table scott.emptest as select * from scott.emp where 1=2 ;

alter session set nls_date_format='dd-mon-yy';
set linesize 300
col x for a200
select 'insert into scott.emptest( EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) values ('
 ||EMPNO||','''||ENAME||''','||''''||JOB||''','||MGR||','''||HIREDATE||''','||SAL||','||nvl( to_char(comm),'null')||','||DEPTNO||' );'  X from scott.emp ;



HR data

https://github.com/oracle-samples/db-sample-schemas/tree/main/human_resources

https://github.com/oracle-samples/db-sample-schemas/releases

Oracle DBA

anuj blog Archive