Avatar billede fredand Forsker
17. december 2010 - 16:01 Der er 1 kommentar

Why can I not see my tables?

Hello guys!

I'm trying to create a simple "database" in Oracle 10.

The if I get it right with users and tbale space I will do:

1) Create a database for eg mydatabase.
2) Log in as sys as dba to mydatabase and create a user for eg my user.
3) Log in as my user and create the tables.

I do above (2 and 3) in sql plus
But when I log in as myuser with Toad I can not see my tables in schema browser. (But I can execute selects)

Do see any missake I do?

In 2 I do:
sqlplus -s sys/thepassword@mydatabase sysdba @user.sql
(
CREATE TABLESPACE mytablespace
  LOGGING
  DATAFILE 'C:\mytablespace.DBF'
  SIZE 32M
  AUTOEXTEND ON
  NEXT 32M MAXSIZE 2048M
  EXTENT MANAGEMENT LOCAL;



CREATE USER myuser IDENTIFIED BY thepassword DEFAULT TABLESPACE mytablespace;

GRANT CREATE SESSION TO myuser;
GRANT CREATE SEQUENCE TO myuser;
GRANT CREATE PROCEDURE TO myuser;
GRANT CREATE TABLE TO myuser;
GRANT CREATE VIEW TO myuser;
)

In 3 I do:
sqlplus -s myuser/thepassword@mydatabase as sysdba @init.sql
(
CREATE TABLE Countries
(
    id INT NOT NULL,
    name VARCHAR(255) NOT NULL,
    PRIMARY KEY (id)
) TABLESPACE mytablespace;

DROP SEQUENCE Sequence_Countries_id;
CREATE SEQUENCE Sequence_Countries_id
START WITH 1
INCREMENT BY 1
NOMAXVALUE;
)

Best regards
Fredrik
Avatar billede teepee Nybegynder
19. december 2010 - 16:07 #1
When you are logged in as sysdba try to call "show user" and you'll see why you cant see the tables. Either prefix as myuser.countries or dont connect as sysdba
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester