I am facing the error while upgrading oracle database 11gR2 to 19c.
Error Code: ORA-04023: Object SYS.DBMS_JAVA could not be validated or authorized.
For example:
SQL> select dbms_java.longname('TEST') from dual;
select dbms_java.longname('TEST') from dual
*
ERROR at line 1:
ORA-04023: Object SYS.DBMS_JAVA could not be validated or authorized
Using dba_registry should help identify if there is something wrong with your Java version installed in the database.
Query
SELECT comp_id, comp_name, version, version_full, status, procedure
FROM dba_registry
WHERE comp_id = 'JAVAVM';
Example Result
COMP_ID COMP_NAME VERSION VERSION_FULL STATUS PROCEDURE
__________ _______________________________ _____________ _______________ _________ _____________________________
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 19.10.0.0.0 VALID INITJVMAUX.VALIDATE_JAVAVM
When looking at dba_registry, any components that are not listed as VALID can be validated by connecting as SYS then running the procedure listed under the PROCEDURE column.
Related
I've been working with dbt for a couple of months now, so still fairly new to it. When running a test model, I have no problems when using the view materialization:
{{ config(materialized='view') }}
select 1 as id
Resulting in:
15:30:25 | 1 of 1 START view model dbt.stg_CampaignTableTest.................... [RUN]
15:30:26 | 1 of 1 OK created view model dbt.stg_CampaignTableTest............... [SUCCESS 1 in 1.48s]
However, when I make the switch to a table materialization I get an error message about not having an active warehouse selected in Snowflake:
{{ config(materialized='table') }}
select 1 as id
Resulting in:
15:32:52 | 1 of 1 START table model dbt.stg_CampaignTableTest................... [RUN]
15:32:53 | 1 of 1 ERROR creating table model dbt.stg_CampaignTableTest.......... [ERROR in 1.22s]
Database Error in model stg_CampaignTableTest (models/test/stg_CampaignTableTest.sql)
000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.
Of course, it's not possible to include a "use warehouse" statement within my test model as it is inserted into the compiled SQL at the wrong position:
{{ config(materialized='table') }}
use warehouse "AnalysisTeam_WH";
select 1 as id
Because it leads to:
2021-10-07T15:33:59.366279Z: On model.my_new_project.stg_CampaignTableTest: /* {"app": "dbt", "dbt_version": "0.21.0", "profile_name": "user", "target_name": "default", "node_id": "model.my_new_project.stg_CampaignTableTest"} */
create or replace transient table "AnalysisTeam"."dbt"."stg_CampaignTableTest" as
(
use warehouse "AnalysisTeam_WH";
2021-10-07T15:33:59.366342Z: Opening a new connection, currently in state closed
2021-10-07T15:34:00.163673Z: Snowflake query id: 019f7386-3200-ec67-0000-464100e189fa
2021-10-07T15:34:00.163803Z: Snowflake error: 001003 (42000): SQL compilation error:
syntax error line 4 at position 0 unexpected 'use'.
I appear to have the correct permissions with my Snowflake 'role' to create tables, views, etc., so I was at a loss to understand why changing from view to table would cause the model to fail. I suspect it could be related to Snowflake permissions rather than a dbt issue but I am not sure. Any ideas would be really appreciated!
Edit: I appeared to make a mistake with my screenshots so I have switched to code snippets which is hopefully clearer.
I would suggest checking two possibilities.
A. The active profile coniguration at "~/.dbt/profiles.yml" Snowflake Profile:
and search for 'warehouse:'
my-snowflake-db:
target: dev
outputs:
dev:
type: snowflake
account: [account id]
# User/password auth
user: [username]
password: [password]
role: [user role]
database: [database name]
warehouse: [warehouse name] <<<<<
schema: [dbt schema]
threads: [1 or more]
B. Default warehouse setting for user used for connection ALTER USER:
SHOW USERS;
ALTER USER user_name SET DEFAULT_WAREHOUSE = '<existing_warehouse_name>';
Make sure the Snowflake Role dbt is using has been granted access to the Snowflake Warehouse dbt is using.
show grants on warehouse 'xxxxxxxx'
I am upgrading ci 2 to ci 3.11
I have done all the changes in upgrading,
Still i get this error
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE id = 'gr6rnf66t7d20oqlkocr5ate3nlg3equ'' at line 2
SELECT 1 WHERE id = 'gr6rnf66t7d20oqlkocr5ate3nlg3equ'
Filename: D:/xampp/htdocs/XXXX/system/database/DB_driver.php
Line Number: 691
I want to know from while file this database querying.
Just now i found that if i change
$config['sess_cookie_name'] = 'ci_session';
this value id in the query is changing
For now i changed to sess_driver to files in config to work
I didn't give $config['sess_save_path'] = 'ci_sessions'; (Its the table name of session)
I'm creating a new report (*.rdl), and there I want to add username who runs the script (insert).
I've tried on VS2008 through "built-in-fields" function which is "User ID", but it didn't work:
CREATE TABLE #Some_Table
(
Plan_date date null,
Plan_customer int null,
creator_id nvarchar(55) null
)
INSERT INTO Some_Table
(
[Plan_date] ,
[Plan_customer],
[creator_id]
)
SELECT
#p_plan_monthly,
#p_plan_clients,
#creator_id ="user id" --from built-in-fields
Expected result is: Column creator_id is filling with value of username from active directory who made insert through my report.
To reiterate my comment, as it's is incredibly important:
"You need to use a different account to access your data #whitefang. The sa account should never be used for something as mundane as a report. In truth it should never be used unless you really need sysadmin privileges, or you're doing something like recovering the server. You should have a service account that can do the respective tasks it needs to. If you can suffer injection through those reports, you're service is like an open book to whomever has access."
Now, onto your problem. I would add a further internal parameter on your report. Change the value of the parameter to have the default value of =User!UserID; this will be the ID of the user running the report (perhaps something like StackOverflow\Larnu).
Then map that report parameter to your dataset parameter #creator_id and change your INSERT statement to:
INSERT INTO Some_Table ([Plan_date],
[Plan_customer],
[creator_id])
VALUES (#p_plan_monthly, #p_plan_clients, #creator_id);
Q: "and there I want to add username who runs the script (insert)"
You can use these functions.
-- database user name
SELECT USER_NAME()
-- login identification name
SELECT SUSER_NAME()
I'm trying to grant access to a colleague to allow them to query on SSISDB package errors.
I've given them access to the database (SSISDB) with db_datareader. Under Logins > Properties > User Mapping.
The query executes fine for my colleague, but produces no results.
n.b. not my query, stumbled across this online a while ago. But gives me good results.
USE SSISDB;
GO
SELECT TOP 1000 [execution_id]
,[folder_name]
,[project_name]
,ex.[package_name]
,MESSAGE
,[project_lsn]
,[executed_as_name]
,[use32bitruntime]
,[status]
,CASE [status]
WHEN 1 THEN 'Created'
WHEN 2 THEN 'Running'
WHEN 3 THEN 'Canceled'
WHEN 4 THEN 'Failed'
WHEN 5 THEN 'Pending'
WHEN 6 THEN 'Ended unexpectedly'
WHEN 7 THEN 'Succeeded'
WHEN 8 THEN 'Stopping'
WHEN 9 THEN 'Completed'
ELSE 'ADDITIONAL VALUE - PLEASE CHECK CASE STATEMENT'
END StatusDescription
,[start_time]
,[end_time]
,[caller_name]
,[process_id]
,[stopped_by_sid]
,[stopped_by_name]
,[server_name]
FROM [SSISDB].[catalog].[executions] ex
LEFT OUTER JOIN SSISDB.catalog.event_messages em
ON em.operation_id = ex.execution_id
AND event_name NOT LIKE '%Validate%'
AND MESSAGE LIKE '%An error occurred%'
where start_time > GETDATE() - 7 --last weeks errors
AND status not in (2, 7, 9)
order by [execution_id] desc
When I run this, I am given a list of failed SSIS packages and the errors messages. However, when my colleague runs this - the output is blank.
Any help much appreciated.
I got around this by adding the user into the ssis_admin role.
This is because of a special database role: ssis_admin
USE [SSISDB]
ALTER ROLE [ssis_admin] ADD MEMBER [login_used_to_query_data]
There other SSIS level permission which we need to give to check if all those are working.
And use the below one and check if this helps
1- Run Dcomcnfg.exe. ...
2- In the Component Services dialog, expand the Component Services > Computers > My Computer > DCOM Config node.
3- Right-click Microsoft SQL Server Integration Services 13.0, and then click Properties.
dxStatusbar1.Panels1.Text :=
DataModule2.UniConnectDialog1.Connection.Username;
...gives me the username that has connected to sql server.
However the connected user has a different name in the actual database.
Example:
His login name for the sql server is 'John' and is user mapped to 'Northwind' database.
However in 'Northwind' database he is called 'John Smith'.
And this is the name (John Smith) I am trying to have displayed in dxStatusbar1.Panels1.Text
after he connects.
How can I get that ?
edit :
Tried Victoria suggestion :
UserName := DataModule2.UniConnection1.ExecSQL('SELECT :Result = CURRENT_USER', ['Result']);
dxStatusbar1.Panels[1].Text := UserName;
but get :
I couldn't find any UniDAC API way to get currently connected user name (not even for SDAC), so I would just issue a SQL command querying CURRENT_USER and grab the name from the result:
SELECT CURRENT_USER;
Or in the Unified SQL way with the USER function:
SELECT {fn USER};
Since you've mentioned stored procedure in your comment, it sounds to me like you probably want to get this information directly from a connection object without using query object. If that is so, you don't even need to have a stored procedure but execute directly command like this:
var
UserName: string;
begin
UserName := UniConnection1.ExecSQL('SELECT :Result = CURRENT_USER', ['Result']);
...
end;
Or in unified way:
var
UserName: string;
begin
UserName := UniConnection1.ExecSQL('SELECT :Result = {fn USER}', ['Result']);
...
end;
One of these might do the job for you. Haven't tested.
SELECT ORIGINAL_LOGIN()
SELECT SYSTEM_USER
SELECT SUSER_SNAME()
Hope it helps.
ORIGINAL_LOGIN: Returns the name of the login that connected to the instance of SQL Server. You can use this function to return the identity of the original login in sessions in which there are many explicit or implicit context switches.
SYSTEM_USER: Allows a system-supplied value for the current login to be inserted into a table when no default value is specified.
SUSER_SNAME: Returns the login name associated with a security identification number (SID).