I have download the oracle sql developer version 21.2.1 and I want to create a new connection. But I do not have any schema created. Can somebody help me or any links would be helpful.
Note: I have searched on youtube and google. All the tutorials that I have seen seems to have already a schema.
Well, SQL Developer you downloaded is just a tool you'd use to access an Oracle database. What you need next is the database itself. Once you download & install it, create user (schema). This is 11g database version example:
Connect as a privileged user (SYS if you don't have any other; and you probably don't) using SQL*Plus (command-line tool):
SQL> connect sys/password_goes_here#xe as sysdba
Connected.
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USER_DATA
Create user:
SQL> create user will identified by ashoti
2 default tablespace user_data
3 temporary tablespace temp
4 quota unlimited on user_data;
User created.
Grant privileges which will allow that user to actually do something:
SQL> grant create session to will;
Grant succeeded.
SQL> grant create table to will;
Grant succeeded.
That's it; connect as newly created user:
SQL> connect will/ashoti#xe
Connected.
SQL> create table test as select sysdate as datum from dual;
Table created.
SQL> select * from test;
DATUM
----------
06.10.2021
SQL>
It works; moreover, it means that you should now be able to establish connection via SQL Developer as well.
Related
This question already has answers here:
Why my Oracle 10g does not have the scott account?
(2 answers)
Closed last month.
recently download oracle 11g, tried login using scott, turns out scott doesnt exist . I logged in using sys as sysdba and ran 'show pdbs' but it showed 'unknown show option pdbs'.
I looked up online and found that i need to run the scott.sql. But then i couldnt find the scott.sql file in the expected location. pls help
11g is rather old, there's no PDB there.
As you're logged as SYS, run the following command and say what status you got (in my database, it is OPEN):
SQL> select account_status from dba_users where username = 'SCOTT';
ACCOUNT_STATUS
--------------------------------
OPEN
SQL>
If it is LOCKED (which might be), then run
SQL> alter user scott account unlock;
User altered.
SQL> alter user scott identified by tiger;
User altered.
SQL>
and - finally - connect:
SQL> connect scott/tiger
Connected.
SQL>
If you really don't have that schema, create it. See this for more info.
I am using Oracle and SQL Developer. I have a table called T_TEST owned by SYSTEM (I know, that I shouldn't do it, but it's not a commercial project). I created another user and gave him this privileges:
GRANT CONNECT TO admin1;
GRANT CREATE SESSION TO admin1;
GRANT SELECT ON T_TEST TO admin1;
When I run this query I get the expected result:
SELECT SUM(value) FROM SYSTEM.T_TEST;
However, when I try to wrap this query in a transaction like this:
CREATE PROCEDURE reader
AS
BEGIN
SET TRANSACTION READ ONLY;
SELECT SUM(value) FROM SYSTEM.T_TEST;
COMMIT;
END;
I get this error:
ORA-01031: insufficient privileges
So which privilege am I missing here?
You are missing grants to create a procedure. You can do that by following the below command -
GRANT CREATE PROCEDURE TO [domain\user]
This link has a whole list of permissions that you can grant to the users. Enjoy your project.
Is there a means of querying a database environment to retrieve all Oracle APEX application IDs, together with the workspace name they belong to?
I basically want to create an LOV within an Oracle APEX app that can see all APEX application IDs and Workspaces.
I tried the APEX_APPLICATIONS view but that only displays info within the workspace you are in. I want to see all workspaces and application ids.
Is granting the apex_administrator_role to the parsing schema plausible? Your query would probably still want to exclude internal workspaces such as INTERNAL, COM.ORACLE.CUST.REPOSITORY and COM.ORACLE.APEX.REPOSITORY
SQL> conn hr/hr#XE1
Connected.
SQL>
SQL>
SQL> select count(1)
2 from apex_applications;
COUNT(1)
----------
0
SQL> disconnect
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> connect sys/oracle#XE1 as sysdba
Connected.
SQL> grant apex_administrator_role to hr;
Grant succeeded.
SQL> commit;
Commit complete.
SQL> conn hr/hr#XE1
Connected.
SQL> select count(1)
2 from apex_applications
3 ;
COUNT(1)
----------
60
note: This will also give your schema access to the APEX_INSTANCE_ADMIN API.
I am not able to connect with a local user in a pluggable database(12C)
Here is relevant code:
enter image description here
SQL> conn sys/sys as sysdba
Connected.
SQL> alter session set container=pdborcl;
Session altered.
SQL> create user user1 identified by user1;
User created.
SQL> grant create session,create table to user1;
Grant succeeded.
SQL> alter user user1 quota unlimited on users;
User altered.
SQL> conn user1/user1
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
This is a bit workaround but it worked for me on Oracle 18c Express Edition.First find container name by
show con_name
Then connect to user1 as
conn user1/user1#localhost:1521/xepdb1
enter image description here
I am trying to create a new schema in SQL Developer:
CREATE USER admindba
IDENTIFIED BY pwd4dba
DEFAULT TABLESPACE tbs_perm_01
TEMPORARY TABLESPACE tbs_temp_01
QUOTA 20M on tbs_perm_01;
I am getting error
SQL Error: ORA-00959: tablespace 'TBS_PERM_01' does not exist
00959. 00000 - "tablespace '%s' does not exist"
What is wrong? Can anyone clear the error?
I think, following steps will help you.
Login as sysdba in oracle developer.
Execute the create user statement. For example, create a new user named smith with a password of password as follows:
CREATE USER smith IDENTIFIED BY password;
Grant specific access to the new schema user. For example:
GRANT CREATE TABLE TO smith;
(Or this one to give all privileges to this user )
GRANT ALL PRIVILEGES TO smith;
Verify schema creation. For example, use the following query for new user smith:
SELECT username, account_status FROM dba_users
WHERE username = 'SMITH';
Then login as smith
I refer from this link
You have to create the tablespace first. Example:
create tablespace tbs_perm_01 datafile '/path/to/data/mydatafile01.dbf' size 1G autoextend on;
You will likely have create the temporary tablespace too. Then you can create the user that will use those tablespaces.
connect as sys to your server and check tablespaces
it looks that the tablespace TBS_PERM_01 is missing
select * from dba_tablespaces
select * from dba_tablespaces where tablespace_name = 'TBS_PERM_01'