Search code examples
oracle-databaseoracle12c

Install oracle sample schema on a remote database


Is it possible to install Oracle Database 12c Sample schemas on a remote database that I have access? I am trying to install sample schemas on AWS RDS service that I do not have SYSDBA access.


Solution

  • If "install" means create user ..., then the answer is (sadly) no. Unless, of course, you provide login credentials which will connect you as a privileged user, the one that can create other users. You don't have to be a DBA. Here's an example:

    Connected as SYS (which is a SYSDBA), I'm creating my own "sys" user which will then be granted a privilege to create other users:

    SQL> connect sys@xe as sysdba
    Enter password:
    Connected.
    SQL> create user my_sys identified by stacko
      2  default tablespace users
      3  temporary tablespace temp
      4  quota unlimited on users;
    
    User created.
    
    SQL> grant create session to my_sys;
    
    Grant succeeded.
    
    SQL> grant create user to my_sys;
    
    Grant succeeded.
    

    OK; now, connect as newly created user and create yet another one:

    SQL> connect my_sys/stacko@xe
    Connected.
    SQL> create user test identified by test;
    
    User created.
    
    SQL>
    

    It works.

    Therefore, see if there's such a powerful user available to you (or, whether you can get it, somehow).

    Once it is done, you'll be able to connect as that user and create all its objects. Of course, you'll have to grant it set of privileges, from CREATE SESSION, CREATE TABLE, etc. - depending on what you're going to do.

    However, if you can't get it, I'm afraid that you won't be able to do that - not by yourself.