Why alter user lock, still can query? - oracle

I am using Oracle database 21c Express edition in Windows x64.
With system user, I run
alter user `bichvan` account lock
With system user
but, in Oracle SQL Developer, session of user bichvan, I still can query.
Why alter user lock, still can query?

Documentation says:
To temporarily deny access to the database for a particular user account, you can lock the user account. If the user then attempts to connect, then the database displays an error message and does not allow the connection.
It means that lock won't affect currently logged users. But, if you disconnect and then try to connect, you won't be allowed to do that.

Related

Oracle Database 11g: How to enable/create a user?

I just downloaded the Oracle Database 11g and I can't select,create,update or do anything. Every command that I entered and run only results to "ORA-01435: user does not exist"
What are the things that i need to do in order to enable creating and running some commands?
Here is a picture of ORA-01435: user does not exist
Please look at right upper corner SCHEMA:XS$NULL:
From Securing Oracle Database User Accounts
XS$NULL
An internal account that represents the absence of a user in a session. Because XS$NULL is not a user, this account can only be accessed by the Oracle Database instance. XS$NULL has no privileges and no one can authenticate as XS$NULL, nor can authentication credentials ever be assigned to XS$NULL.
Expired and locked
You need to change it to some specific schema.

Oracle version 12c Default account

Trying to access default Database from Oracle 12c but Oracle 12c not accessing by default Username Scott and Password Tiger, Why?. While 11g provide the access.
Per the Docs
When you install Oracle Database with the Oracle Universal Installer,
the sample schemas are installed by default if you select the Basic
Installation option. Selecting the sample schemas option installs all
sample schemas (HR, OE, PM, SH, IX) in the database. If you choose not
to install the sample schemas at that time, you can add them later by
following the instructions in section "Manually Installing Sample
Schemas".
At the end of the installation process, a dialog box displays the
accounts that have been created and their lock status. By default, all
sample schemas are locked and their passwords are expired. Before you
can use a locked account, you must unlock it and reset its password.
You can unlock the accounts at this point in the installation process.
Alternatively, after the installation completes, you can unlock the
schemas and reset their passwords by using the ALTER USER ... ACCOUNT
UNLOCK statement.

How to duplicate Oracle database without sysdba privilege

We have an oracle 11g installed on a linux machine. I want to duplicate the database on my local 64-bit windows machine. We have total 403 tables and a few of them have foreign key constraints. I am not a dba so I don't have the sysdba privilege. Also I cannot shutdown the remote database. Is there a quick way to do this rather than I copy the tables one by one? Thanks
Considering you do not have DBA role granted and not having access to server machine, you won't be able to do a cold backup and install in on your machine, because cold backup requires database getting shut downed.
Secondly, you can't use rman utility either.
You can use expdp utility to get database exported as files and import it to your db with impdp utility.But in order to get data exported you at least need CONNECT and RESOURCE roles granted to your user ( Assuming you already have CONNECT otherwise you won't be able to connect to db at all ) and with those roles you can only import objects you already have access to. Including objects you own.
On the other hand, if you need a full database export, then you need EXP_FULL_DATABASE granted. DBA, SYS and some other roles has this role included. So your best chance is to contact dba's asking for the role granted to your user, see how they react to that.

How to create a user in Oracle SQL developer

I am newbie to oracle sql developer 3.1.07.42, and have just installed it on my machine. I want to make a new connection, but it requires a user and a password which I do not know. I have been googling about it since many days, and have learned that there are some commands to create user, but I do not know where should I run those commands, because I cannot run queries/commands until the connection is created.
Would anyone let me know what should I do?
Steps for creating new user :
1)Open Sql Developer, make new connection.
2)Login with System username and password(made during installation).
3)Once you connect, expand the System user (under Connections, in the left pane) and scroll down to Other users. Then right click users and add new user.
4)Give its username and password & select appropriate system privilege.
5)You are done now, check by making new connection.
Use this below simple commands to create an user
-- Create a user
CREATE USER youruser IDENTIFIED BY yourpassword;
--Grant permissions
GRANT CONNECT, RESOURCE, DBA TO demo;
you should install database software in your local pc/laptop then create user in the database and you can connect the database via sql developer by key in username and password that already created.If you want to connect to other database same step like the previous step but before that you need to point to the remote database.
I thinks you should use "Database Configuration Assistant" to create new database and U can set user name and password and use it in oracle SQL Developer!!!

How to create Oracle database link with sysdba privilege

I want to:
select * from v$database#standby;
Problem:
standby is mounted so only a SYSDBA user can connect to query it
I can't find out how to use a database link using SYSDBA privilege
My goal is to display system information/stats from a standby Oracle database on a web page.
I'm using Oracle APEX. Pages are computed from mod_plsql which runs from an Oracle DB so it is easy to display the result of this kind of query.
Alternative:
How to select * from "shell script"?
I don't think you can do this, based on the few things I've seen via Google.
To sum up, connecting remotely as sysdba uses authentication via the password file. Database links do not attempt to authenticate this way, they are authenticated in the remote database and not externally.
Here's a link to a site that briefly touches upon the subject.
I think what you want is:
CREATE PUBLIC DATABASE LINK STANDBY
rather than CREATE DATABASE LINK STANDBY. I just tested this from sqlplus / as sysdba and was able to query.

Resources