Oracle 12c import dump with user profiles & roles - oracle

I'm trying to import dump file I received from customer.
The customer defined the schema on user with Profile and Role which obviously do not exist in my Database and are not required by me.
Whenever I do impdp I get multiple errors:
ORA-02380: profile APPL_PROFILE does not exist
ORA-01919: role 'APP_ROLE' does not exist
Is there a way to exclude the roles and profile from the import?
The only way I find to handle it is creating this Profile and role in my Database - which is not required and would like to avoid.

Managed to do that with exclude:user exclude:grant
as suggested here
https://www.cnblogs.com/chendian0/p/10867504.html

Related

can I create tables and RLS via any external API or similar?

I need to create a custom admin tool, where I create tables and RLS rules outside the Supabase admin dashboard.
Is this possible?
You can use any database interaction tool to do this. I am using a nodejs database migration tool in one of my project along with a nodejs postgres client and I'm able to create tables, enable RLS and write policies with this. You can see all the files doing these tasks in my project here.
Found out in the documentation for RLS, and in combination with the SQL editor (https://supabase.com/docs/guides/auth/row-level-security)
Wrap this bit in a database function with parameters
-- 1. Create table
create table profiles (
id uuid references auth.users,
avatar_url text
);
-- 2. Enable RLS
alter table profiles
enable row level security;
-- 3. Create Policy
create policy "Public profiles are viewable by everyone."
on profiles for select using (
true
);
Then call the function with rpc call

Unable to see error description in SQL plus

I am new to oracle and using SQL plus terminal to access oracle DB. I tried to create one function and it returned warning that
function created with compilation error
When I executed show errors it always showing
ERROR:
ORA-00942: table or view does not exist
My function :
create or replace function axsaum.get_name
AS
v_name varchar2(20);
begin
v_name:='Helloooooo';
dbms_output.put_line(v_name);
END;
/
Please suggest.
You have the error message: ORA-00942: table or view does not exist. This means your function contains a reference to a database object which the compiler is unable to associate to a table or view within the scope of the function.
There are several reasons why you might get this.
Your function references a table or view which exists in the schema but you have misspelled its name.
Your function references a table or view which exists in a different schema and you have not prefixed the reference with the owning schema and there is no synonym either.
Your function references a table or view which exists in a different schema but the schema owner has not granted you rights on that object.
Your function references a table or view which exists in a different schema and the schema owner has granted you rights on that object through a role. The Oracle security model means that we cannot build database objects (views, stored procedures, etc) using privileges granted to our account through a role. The privileges have to be explicitly granted to our named account.
The object does not exist in your schema or another.
The first two causes are ones you can fix by yourself. The others would require the intervention of the schema owner, or a power user with admin privileges (such as a DBA).
Now that you've posted your function, we can see that you are referencing an Oracle built-in package, DBMS_OUTPUT. Now that package should be installed and granted as part of a default install. But if you have a non-standard install or have accidentally dropped or revoked something you will need to get the SYS user to run the dbmsotpt.sql script which should fix it. The details are covered in the package's documentation. Find out more.

Specify schema for doing liquibase diff in Oracle?

I'm trying to do a liquibase diff in Oracle using an ant script.
Here's the snippet that preforms the diff
<target name="diff-database">
<diffDatabaseToChangeLog
driver=${db.driver}"
url="${db.url}"
username="${db.username}"
password="${db.password}"
referenceUrl="jdbc:oracle:thin#hostname:port:sid"
referenceUsername="user1"
referencePassword="password1"
outputFile="changelog.xml"
classpathref="tools.class.path"
</diffDatabaseToChangeLog>
</target>
Here's the issue.
The two databases I need to compare are both Oracle.
For the referenceDB I need access to the tables under a certain user, call it user2, but login for user2 is disabled on the server I need to run this from.
Luckily I have access to the referenceDB under another user, call it user1, and that user has the privilege "SELECT ANY TABLE". So I should be able to access the tables for user2 with user1.
So given all of that information, how do I specify that I want to use user2's tables as the reference DB?
I've look at this page, but haven't found anything that solves my problem.
It should be referenceDefaultSchemaName parameter (http://www.liquibase.org/documentation/maven/maven_diff.html), but according to https://liquibase.jira.com/browse/CORE-2364 there could be some issues (I've not triedit myself).

oracle export and import only user and their roles

I have two question about oracle export and import.
First of all,I want to export only user and their roles not tables,trigger and other object Later import user
How i can do?
Other question is while importing operation, can i get error?Because, which object importing early roles or user? Unless importing roles, user can't assign roles?
You must be using ddl statements, look How to clone user in Oracle and https://dba.stackexchange.com/questions/30337/duplicate-an-oracle-database-user ,and if you are using SQL Navigator, you can select user in the tree (press F12) and press Ctrl+D

MVC3 EDMmetadata table not found

I am new in MVC3 i am going to create a MVC3 test project where i am create model class name WhiteAccount with ID,Name,Email,Password property. and successfully create a DB but when i add another new property in that WhiteAccount model class and in my DB table too but it give me some error. Some people say just delete the EDMmetadata table from your DB, But Here is the problem i have no EDMmetadata table in my DB ! I create my DB by EntityFramework v4.3.1 system automatically (CodeFirst). What should i do now ?
Check for the __MigrationHistory table.
Open the nuget package manager console and run
update-database -script
It will likely give you a message about having to enable it first, follow those directions
Run: Enable-Migrations
some more info on migrations
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-code-based-migrations-walkthrough.aspx
Im gathering this table is there in your db (under system tables) and it contains your model information. Since your project changed you need to tell the migrations about the new field or delete the table (__MigrationsHistory)

Resources