mksample이 안됩니다. 0 2 1,560

by 김지호 [Oracle 에러코드] [2022.07.06 18:28:22]


환경은 윈도우 10 64비트 오라클 21c입니다

SQL> @C:\app\admin\product\21c\dbhomeXE\demo\schema\mksample.sql
SQL> Rem
SQL> Rem $Header: rdbms/demo/schema/mksample.sql.sbs /main/12 2015/03/19 10:23:26 smtaylor Exp $
SQL> Rem
SQL> Rem mksample.sql
SQL> Rem
SQL> Rem Copyright (c) 2001, 2016, Oracle and/or its affiliates.  All rights reserved.
SQL> Rem
SQL> Rem Permission is hereby granted, free of charge, to any person obtaining
SQL> Rem a copy of this software and associated documentation files (the
SQL> Rem "Software"), to deal in the Software without restriction, including
SQL> Rem without limitation the rights to use, copy, modify, merge, publish,
SQL> Rem distribute, sublicense, and/or sell copies of the Software, and to
SQL> Rem permit persons to whom the Software is furnished to do so, subject to
SQL> Rem the following conditions:
SQL> Rem
SQL> Rem The above copyright notice and this permission notice shall be
SQL> Rem included in all copies or substantial portions of the Software.
SQL> Rem
SQL> Rem THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
SQL> Rem EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
SQL> Rem MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
SQL> Rem NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
SQL> Rem LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
SQL> Rem OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
SQL> Rem WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SQL> Rem
SQL> Rem    NAME
SQL> Rem         mksample.sql - creates all 5 Sample Schemas
SQL> Rem
SQL> Rem    DESCRIPTION
SQL> Rem         This script rees and creates all Schemas belonging
SQL> Rem         to the Oracle10i Sample Schemas.
SQL> Rem         If you are unsure about the prerequisites for the Sample Schemas,
SQL> Rem         please use the Database Configuration Assistant DBCA to
SQL> Rem         configure the Sample Schemas.
SQL> Rem
SQL> Rem    NOTES
SQL> Rem         - OUI instantiates this script during install and saves it
SQL> Rem        as mksample.sql. The instantiated scripts matches
SQL> Rem        the directory structure on your system
SQL> Rem         - Tablespace EXAMPLE created with:
SQL> Rem             CREATE TABLESPACE example
SQL> Rem                 NOLOGGING
SQL> Rem                 DATAFILE '<filename>' SIZE 150M REUSE
SQL> Rem                 AUTOEXTEND ON NEXT 640k
SQL> Rem                 MAXSIZE UNLIMITED
SQL> Rem                 EXTENT MANAGEMENT LOCAL
SQL> Rem                 SEGMENT SPACE MANAGEMENT AUTO;
SQL> Rem
SQL> Rem         - CAUTION: This script will erase the following schemas:
SQL> Rem        - HR
SQL> Rem        - OE
SQL> Rem        - PM
SQL> Rem        - SH
SQL> Rem        - IX
SQL> Rem        - BI
SQL> Rem         - CAUTION: Never use the above mentioned Sample Schemas for
SQL> Rem        anything other than demos and examples
SQL> Rem         - USAGE: To return the Sample Schemas to their initial
SQL> Rem        state, you can call this script and pass the passwords
SQL> Rem        for SYS, SYSTEM and the schemas as parameters.
SQL> Rem        Example: @/your/path/to/mksample mgr secure h1 o2 p3 q4 s5
SQL> Rem        (please choose your own passwords for security purposes)
SQL> Rem
SQL> Rem    MODIFIED   (MM/DD/YY)
SQL> Rem         gvenzl 04/04/16 - added log directory creation
SQL> Rem         smtaylor       03/19/15 - added parameter 12, connect_string
SQL> Rem         smtaylor       03/19/15 - added @&&connect_string to CONNECT
SQL> Rem         smtaylor       03/19/15 - added pararmeter &&connect_string to script calls
SQL> Rem         celsbern       07/17/09 - removed drop of directory objects
SQL> Rem         celsbern       07/16/09 - removed drop of xdb directory objects
SQL> Rem         celsbern       02/24/09 - added drop of directory objects
SQL> Rem         cbauwens       03/05/07 - remove exit statement
SQL> Rem         ahunold        04/02/03 - bug-2884943
SQL> Rem         ahunold        02/20/03 - notes changes
SQL> Rem         ahunold        01/14/03 - no compression on TS level
SQL> Rem         ahunold        11/05/02 - parameters 9,10 and 11
SQL> Rem         ahunold        10/25/02 - SHOWMODE OFF
SQL> Rem         ahunold        09/25/02 - creating mkverify.sql
SQL> Rem         hyeh   08/29/02 - hyeh_mv_comschema_to_rdbms
SQL> Rem         ahunold        08/15/02 - versioning, new oe_main parameters, ix
SQL> Rem         ahunold        12/05/01 - added parameters
SQL> Rem         ahunold        05/03/01 - dupl lines
SQL> Rem         ahunold        04/23/01 - Verification, parameters for pm_main.
SQL> Rem         ahunold        04/13/01 - aaditional parameter (HR,OE,QS)
SQL> Rem         ahunold        04/04/01 - Installer variables
SQL> Rem         ahunold        04/03/01 - Merged ahunold_mkdir_log
SQL> Rem         ahunold        03/28/01 - Created
SQL> Rem
SQL>
SQL> SET FEEDBACK 1
SQL> SET NUMWIDTH 10
SQL> SET LINESIZE 80
SQL> SET TRIMSPOOL ON
SQL> SET TAB OFF
SQL> SET PAGESIZE 999
SQL> SET ECHO OFF

specify password for SYSTEM as parameter 1:
1의 값을 입력하십시오: oracle

specify password for SYS as parameter 2:
2의 값을 입력하십시오: oracle

specify password for HR as parameter 3:
3의 값을 입력하십시오: hr

specify password for OE as parameter 4:
4의 값을 입력하십시오: oe

specify password for PM as parameter 5:
5의 값을 입력하십시오: pm

specify password for IX as parameter 6:
6의 값을 입력하십시오: ix

specify password for  SH as parameter 7:
7의 값을 입력하십시오: sh

specify password for  BI as parameter 8:
8의 값을 입력하십시오: bi

specify default tablespace as parameter 9:
9의 값을 입력하십시오: users

specify temporary tablespace as parameter 10:
10의 값을 입력하십시오: temp

specify log file directory (including trailing delimiter) as parameter 11:
11의 값을 입력하십시오: C:\app\admin\product\21c\dbhomeXE\demo\schema\log

specify connect string as parameter 12:
12의 값을 입력하십시오: localhost:1521

Sample Schemas are being created ...

하위 디렉터리 또는 파일 C:\app\admin\product\21c\dbhomeXE\demo\schema\log이(가) 이미 있습니다.

연결되었습니다.
DROP USER hr CASCADE
*
1행에 오류:
ORA-28014: 관리 사용자 또는 롤을 삭제할 수 없습니다.


DROP USER oe CASCADE
          *
1행에 오류:
ORA-01918: 사용자 'OE'(이)가 존재하지 않습니다


DROP USER pm CASCADE
          *
1행에 오류:
ORA-01918: 사용자 'PM'(이)가 존재하지 않습니다


DROP USER ix CASCADE
          *
1행에 오류:
ORA-01918: 사용자 'IX'(이)가 존재하지 않습니다


DROP USER sh CASCADE
          *
1행에 오류:
ORA-01918: 사용자 'SH'(이)가 존재하지 않습니다


DROP USER bi CASCADE
          *
1행에 오류:
ORA-01918: 사용자 'BI'(이)가 존재하지 않습니다


연결되었습니다.
SP2-0310: 파일 "__SUB__CWD__/human_resources/hr_main.sql"을 열 수 없습니다.
연결되었습니다.
SP2-0310: 파일 "__SUB__CWD__/order_entry/oe_main.sql"을 열 수 없습니다.
연결되었습니다.
SP2-0310: 파일 "__SUB__CWD__/product_media/pm_main.sql"을 열 수 없습니다.
연결되었습니다.
SP2-0310: 파일 "__SUB__CWD__/info_exchange/ix_main.sql"을 열 수 없습니다.
연결되었습니다.
SP2-0310: 파일 "__SUB__CWD__/sales_history/sh_main.sql"을 열 수 없습니다.
연결되었습니다.
SP2-0310: 파일 "__SUB__CWD__/bus_intelligence/bi_main.sql"을 열 수 없습니다.
연결되었습니다.
현재 스풀되지 않고 있습니다.
SP2-0310: 파일 "__SUB__CWD__/mkverify.sql"을 열 수 없습니다.

https://mydatanote.tistory.com/5?category=1053455

여기 있는 방법으로 hr 계정 여는 건 성공했는데 mksample은 해결이 안됩니다.

해결 방법 좀 부탁드립니다.

 

by 포동푸우 [2022.07.06 21:17:26]

mksample ,,,,  어떤 상황에서 어떤 오류 인가요 ?  

제가 21c 설치는 안 해 봤는데,, 19c 기준으로 보면, "DROP USER pm CASCADE / 1행에 오류: / ORA-01918: 사용자 'PM'(이)가 존재하지 않습니다" 는 DB Sample USer 설정 시,, 혹시나 User 가 이미 존재할 경우를 대비해 사전에 삭제하는 과정일 수 있고 --> 이 경우 해당 ORA-01918: 는 아무 문제 없는 것입니다. 


by 타락천사 [2022.07.08 16:35:37]

path 변경 이슈 같은데, 아래 참고 바랍니다.

https://jack-of-all-trades.tistory.com/254

 

근데, 주의할 점이 그냥 실행하면 아래와같이 __SUB__CWD__ 관련 에러가 발생합니다.

         SP2-0310: unable to open file "__SUB__CWD__/human_resources/hr_main.sql"

이건 모든 스크립트에 현재 디렉토리를 지정하는 __SUB__CWD__ 라는 변수를 사용하고 있기 때문입니다.

이 변수를 아래와 같은 perl 커맨드를 사용해서 현재 디렉토리로 바꿔줘야 합니다.

댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입